Class JccArrayAccessGrammarMatcher
java.lang.Object
com.singularsys.jep.configurableparser.matchers.JccArrayAccessGrammarMatcher
- All Implemented Interfaces:
GrammarMatcher,Serializable
Matches syntax for array element access
rather than the structure produced by
v[3],
the node tree produced by this matcher matches those
produced by the standard Jep JccParser.
which has structure
ASTOpNode(Ele)
ASTVarNode(v)
ASTOpNode(List)
ASTConstant(3)
ArrayAccessGrammarMatcher:
ASTOpNode(Ele)
ASTVarNode(v)
ASTConstant(3)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionJccArrayAccessGrammarMatcher(SymbolToken open, SymbolToken close) Construct a matcher for array access. -
Method Summary
Modifier and TypeMethodDescriptionvoidDelayed initialisation, this method is called whenever components of the jep instance are changed.match(Lookahead2Iterator<Token> it, GrammarParser parser) Test whether the input matches this pattern.
-
Constructor Details
-
JccArrayAccessGrammarMatcher
Construct a matcher for array access.- Parameters:
open- token representing the opening delimiterclose- token representing the closing delimiter
-
-
Method Details
-
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.
-
match
Description copied from interface:GrammarMatcherTest whether the input matches this pattern.- Specified by:
matchin interfaceGrammarMatcher- Parameters:
it- An iterator inspecting the inputparser- the parser to use when evaluating sub expressions- Returns:
- if matched returns a node representing the content, return null is does not match
- Throws:
ParseException- if there is a syntactical error in the input.
-