Package com.javacc.core
Class Expansion
java.lang.Object
com.javacc.parser.BaseNode
com.javacc.core.Expansion
- All Implemented Interfaces:
JavaCCConstants,Node,freemarker.template.TemplateHashModel,freemarker.template.TemplateModel,freemarker.template.TemplateNodeModel,freemarker.template.TemplateScalarModel,Comparable<Node>
- Direct Known Subclasses:
AttemptBlock,EmptyExpansion,ExpansionChoice,ExpansionSequence,ExpansionWithParentheses,NonTerminal,RegularExpression,TryBlock
Describes expansions - entities that may occur on the right hand sides of
productions. This is the base class of a bunch of other more specific
classes.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.javacc.parser.JavaCCConstants
JavaCCConstants.LexicalState, JavaCCConstants.TokenTypeNested classes/interfaces inherited from interface com.javacc.parser.Node
Node.VisitorNested classes/interfaces inherited from interface freemarker.template.TemplateModel
freemarker.template.TemplateModel.InvalidExpressionModel, freemarker.template.TemplateModel.JavaNull -
Field Summary
FieldsFields inherited from interface com.javacc.parser.JavaCCConstants
BUF_SIZEFields inherited from interface freemarker.template.TemplateModel
INVALID_EXPRESSION, JAVA_NULL, NOTHINGFields inherited from interface freemarker.template.TemplateScalarModel
EMPTY_STRING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanabstract TokenSetintabstract TokenSetbooleanbooleanbooleanbooleanbooleanDo we do a syntactic lookahead using this expansion itself as the lookahead expansion?booleanbooleanbooleanbooleanbooleanDoes this expansion have a separate lookahead expansion?booleanintgetIndex()booleangetLabel()intabstract intabstract intfinal booleanbooleanbooleanintbooleanbooleanbooleanbooleanbooleanabstract booleanbooleanfinal booleanbooleanIf we hit a parsing error in this expansion, do we try to recover? This is only used in fault-tolerant mode, of course!voidsetCustomErrorRecoveryBlock(CodeBlock customErrorRecoveryBlock) voidvoidsetScanLimit(boolean scanLimit) voidsetScanLimitPlus(int scanLimitPlus) voidsetTolerantParsing(boolean tolerantParsing) voidsetTreeNodeBehavior(TreeBuildingAnnotation treeNodeBehavior) final booleanIs this expansion superfluous parentheses?toString()Methods inherited from class com.javacc.parser.BaseNode
addChild, addChild, children, clearChildren, get, getAsString, getBeginOffset, getChild, getChildCount, getChildNodes, getEndOffset, getGrammar, getInnerText, getLiteralText, getNodeName, getNodeNamespace, getNodeType, getParent, getParentNode, getSimpleName, getTokenSource, hasKeyWord, isEmpty, isUnparsed, prepend, removeChild, setBeginOffset, setChild, setEndOffset, setGrammar, setListClass, setParent, setTokenSource, setUnparsedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.javacc.parser.Node
appendChild, children, childrenOfType, close, compareTo, copyLocationInfo, copyLocationInfo, descendants, descendants, descendants, descendants, descendantsOfType, dump, dump, firstAncestorOfType, firstChildOfType, firstChildOfType, firstChildOfType, firstDescendantOfType, firstDescendantOfType, getAllTokens, getBeginColumn, getBeginLine, getEndColumn, getEndLine, getFirstChild, getFirstToken, getInputSource, getLastChild, getLastToken, getLocation, getRealTokens, getRoot, getSource, getTokenType, hasChildNodes, indexOf, iterator, nextSibling, open, prependChild, previousSibling, removeChild, replace, replaceChild
-
Field Details
-
firstSet
-
-
Constructor Details
-
Expansion
-
Expansion
public Expansion()
-
-
Method Details
-
getIndex
public int getIndex() -
getContainingProduction
-
getLabel
-
setLabel
-
isTolerantParsing
public boolean isTolerantParsing()If we hit a parsing error in this expansion, do we try to recover? This is only used in fault-tolerant mode, of course! -
setTolerantParsing
public void setTolerantParsing(boolean tolerantParsing) -
toString
-
getNestedExpansion
-
getIsRegexp
public boolean getIsRegexp() -
getTreeNodeBehavior
-
setTreeNodeBehavior
-
isAtChoicePoint
public boolean isAtChoicePoint() -
getNonSuperfluousParent
- Returns:
- the first ancestor that is not (directly) inside superfluous parentheses. (Yes, this is a bit hairy and I'm not 100% sure it's correct!) I really need to take a good look at all this handling of expansions inside parentheses.
-
getSpecifiedLexicalState
- Returns:
- the lexical state to switch into to parse this expansion.
-
getTokenActivation
-
getCustomErrorRecoveryBlock
-
setCustomErrorRecoveryBlock
-
superfluousParentheses
public final boolean superfluousParentheses()Is this expansion superfluous parentheses? -
beginsSequence
public boolean beginsSequence() -
isInsideLookahead
public boolean isInsideLookahead() -
getLookahead
-
getHasExplicitLookahead
public boolean getHasExplicitLookahead() -
getHasExplicitNumericalLookahead
public boolean getHasExplicitNumericalLookahead() -
getHasSeparateSyntacticLookahead
public boolean getHasSeparateSyntacticLookahead()Does this expansion have a separate lookahead expansion? -
getHasImplicitSyntacticLookahead
public boolean getHasImplicitSyntacticLookahead()Do we do a syntactic lookahead using this expansion itself as the lookahead expansion? -
isScanLimit
public boolean isScanLimit() -
setScanLimit
public void setScanLimit(boolean scanLimit) -
getScanLimitPlus
public int getScanLimitPlus() -
setScanLimitPlus
public void setScanLimitPlus(int scanLimitPlus) -
getRequiresScanAhead
public boolean getRequiresScanAhead() -
getRequiresPredicateMethod
public final boolean getRequiresPredicateMethod() -
getLookaheadExpansion
-
isAlwaysSuccessful
public boolean isAlwaysSuccessful() -
getHasGlobalSemanticActions
public boolean getHasGlobalSemanticActions() -
getLookaheadAmount
public int getLookaheadAmount() -
getHasSemanticLookahead
public boolean getHasSemanticLookahead() -
getHasScanLimit
public boolean getHasScanLimit() -
getHasInnerScanLimit
public boolean getHasInnerScanLimit() -
getUpToExpansion
-
getSemanticLookahead
-
getHasLookBehind
public boolean getHasLookBehind() -
getLookBehind
-
isNegated
public boolean isNegated() -
getFirstSetVarName
-
getFinalSetVarName
-
getFollowSetVarName
-
getScanRoutineName
-
getPredicateMethodName
-
getRecoverMethodName
-
getRecoverToMethodName
-
getFinalSetSize
public int getFinalSetSize() -
getFirstSet
-
getFinalSet
-
getHasFullFollowSet
public boolean getHasFullFollowSet() -
getSpecifiesLexicalStateSwitch
public boolean getSpecifiesLexicalStateSwitch() -
getHasTokenActivation
public boolean getHasTokenActivation() -
isPossiblyEmpty
public abstract boolean isPossiblyEmpty()- Returns:
- Can this expansion be matched by the empty string.
-
isSingleToken
public final boolean isSingleToken()- Returns:
- whether this Expansion is always matched by exactly one token AND there is no funny business like lexical state switches a FAIL or an up-to-here marker
-
getMinimumSize
public abstract int getMinimumSize()- Returns:
- the minimum number of tokens that this expansion consumes.
-
getMaximumSize
public abstract int getMaximumSize()- Returns:
- the maximum number of tokens that this expansion consumes.
-
getFollowingExpansion
-
getFollowSet
-
isBeforeLexicalStateSwitch
-
getRequiresRecoverMethod
public boolean getRequiresRecoverMethod()
-