Class PossiblyTerminatedExpressionRule
- java.lang.Object
-
- com.singularsys.extensions.structure.PossiblyTerminatedExpressionRule
-
- All Implemented Interfaces:
GrammaticalRuleI,GrammarMatcher,java.io.Serializable
public class PossiblyTerminatedExpressionRule extends java.lang.Object implements GrammaticalRuleI
Parse an expression followed by an optional separator.<PossiblyTerminatedExpressionRule> ::= || <Expression> || <Expression> <sep>- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PossiblyTerminatedExpressionRule(ExpressionRule expressionRule, SymbolToken sep)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinit(Jep jep)Delayed initialisation, this methods is called whenever components of the jep instance are changed.Nodematch(Lookahead2Iterator<Token> it, GrammarParser parser)Attempt to parse the input using the rule
-
-
-
Constructor Detail
-
PossiblyTerminatedExpressionRule
public PossiblyTerminatedExpressionRule(ExpressionRule expressionRule, SymbolToken sep)
Constructor.- Parameters:
expressionRule- The rule for an expressionsep- token at end of a statement
-
-
Method Detail
-
match
public Node match(Lookahead2Iterator<Token> it, GrammarParser parser) throws ParseException
Description copied from interface:GrammaticalRuleIAttempt to parse the input using the rule- Specified by:
matchin interfaceGrammarMatcher- Specified by:
matchin interfaceGrammaticalRuleI- Parameters:
it- iterator with tokens to parseparser- the parser to parse any components of the rule- Returns:
- successful parses should return a Node, null if unsuccessful
- Throws:
ParseException- if there is a syntactical error
-
init
public void init(Jep jep)
Description copied from interface:GrammarMatcherDelayed initialisation, this methods is called whenever components of the jep instance are changed.- Specified by:
initin interfaceGrammarMatcher- Parameters:
jep- the current jep instance.
-
-