Package relaxngcc.builder
Class ScopeInfo
- java.lang.Object
-
- relaxngcc.builder.ScopeInfo
-
public final class ScopeInfo extends java.lang.Objectinformation about a scope
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classScopeInfo.ActionUser-defined code fragment.
-
Field Summary
Fields Modifier and Type Field Description NGCCGrammar_grammarScope_scopeScope object to which this object is attached.
-
Constructor Summary
Constructors Constructor Description ScopeInfo(NGCCGrammar g, Scope scope)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AliasaddAlias(CDType type, java.lang.String name)voidaddNSURI(java.lang.String nsuri)voidaddState(State state)voidappendHeaderSection(java.lang.String c)voidcalcAFOLLOW()Computes the AFOLLOW set of this _scopeScopeInfo.ActioncreateAction(java.lang.String code)Creates a new Action object inside this _scope.ScopeInfo.ActioncreateAction(java.lang.StringBuffer code)voiddump(java.io.PrintStream strm)voiddumpAutomaton(java.io.File target)Writes the automaton by using GraphViz.java.lang.StringgetClassName()Alias[]getConstructorParams()java.lang.StringgetHeaderSection()StategetInitialState()java.lang.StringgetNSStringConstant(java.lang.String uri)intgetStateCount()java.util.Sethead()Computes the HEAD set of this _scope (that doesn't include EVERYTHING_ELSE token) and returns them in a new set.voidhead(java.util.Set result)Computes the HEAD set of this _scope (that doesn't include EVERYTHING_ELSE token.) SeeHeadfor the definition.booleanisNullable()booleanisRoot()Returns true if this is the start pattern.booleanisUserDefinedField(java.lang.String name)java.util.IteratoriterateAcceptableStates()java.util.IteratoriterateActions()java.util.IteratoriterateAliases()Iterate all the aliases.java.util.IteratoriterateAllStates()java.util.IteratoriterateNSURIConstants()java.util.IteratoriterateStatesHaving(int alphabetTypes)Iterates states that have transitions with one of specified alphabets.voidminimizeStates()Makes the automaton smaller.voidsetInitialState(State s)voidsetNullable(boolean v)voidsimplifyAutomaton()
-
-
-
Field Detail
-
_grammar
public final NGCCGrammar _grammar
-
_scope
public final Scope _scope
Scope object to which this object is attached.
-
-
Constructor Detail
-
ScopeInfo
public ScopeInfo(NGCCGrammar g, Scope scope)
-
-
Method Detail
-
iterateNSURIConstants
public java.util.Iterator iterateNSURIConstants()
-
getInitialState
public State getInitialState()
-
setInitialState
public void setInitialState(State s)
-
isNullable
public boolean isNullable()
-
setNullable
public void setNullable(boolean v)
-
getStateCount
public int getStateCount()
-
getClassName
public java.lang.String getClassName()
-
getConstructorParams
public Alias[] getConstructorParams()
-
minimizeStates
public void minimizeStates()
Makes the automaton smaller. In actuality, this method only removes unreachable states.
-
appendHeaderSection
public void appendHeaderSection(java.lang.String c)
-
getHeaderSection
public java.lang.String getHeaderSection()
-
isUserDefinedField
public boolean isUserDefinedField(java.lang.String name)
-
iterateActions
public java.util.Iterator iterateActions()
-
createAction
public ScopeInfo.Action createAction(java.lang.String code)
Creates a new Action object inside this _scope.
-
createAction
public ScopeInfo.Action createAction(java.lang.StringBuffer code)
-
iterateAliases
public final java.util.Iterator iterateAliases()
Iterate all the aliases.
-
simplifyAutomaton
public void simplifyAutomaton()
-
addNSURI
public void addNSURI(java.lang.String nsuri)
-
getNSStringConstant
public java.lang.String getNSStringConstant(java.lang.String uri)
-
iterateStatesHaving
public java.util.Iterator iterateStatesHaving(int alphabetTypes)
Iterates states that have transitions with one of specified alphabets.
-
iterateAcceptableStates
public java.util.Iterator iterateAcceptableStates()
-
iterateAllStates
public java.util.Iterator iterateAllStates()
-
addState
public void addState(State state)
-
isRoot
public boolean isRoot()
Returns true if this is the start pattern.
-
dump
public void dump(java.io.PrintStream strm)
-
dumpAutomaton
public void dumpAutomaton(java.io.File target) throws java.io.IOException, java.lang.InterruptedExceptionWrites the automaton by using GraphViz.- Throws:
java.io.IOExceptionjava.lang.InterruptedException
-
head
public void head(java.util.Set result)
Computes the HEAD set of this _scope (that doesn't include EVERYTHING_ELSE token.) SeeHeadfor the definition.
-
head
public java.util.Set head()
Computes the HEAD set of this _scope (that doesn't include EVERYTHING_ELSE token) and returns them in a new set.
-
calcAFOLLOW
public void calcAFOLLOW()
Computes the AFOLLOW set of this _scope
-
-