Class ControlRule
java.lang.Object
com.singularsys.extensions.structure.ControlRule
- All Implemented Interfaces:
GrammaticalRuleI,GrammarMatcher,Serializable
Parses
break and continue statements
<ControlRule> ::= | <word> <separator>A successful parse returns a
ControlNode- Author:
- Richard Morris
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionControlRule(SymbolToken word, SymbolToken separator, Object code) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidDelayed initialisation, this method is called whenever components of the jep instance are changed.match(Lookahead2Iterator<Token> it, GrammarParser parser) Attempt to parse the input using the rule
-
Constructor Details
-
ControlRule
Constructor.- Parameters:
word- token representing "break" or "continue"separator- separator at end ofcode- the control code to return
-
-
Method Details
-
match
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
-
init
Description copied from interface:GrammarMatcherDelayed initialisation, this method is called whenever components of the jep instance are changed.- Specified by:
initin interfaceGrammarMatcher- Parameters:
jep- the current jep instance.
-