Interface GrammarMatcher
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
ArrayAccessGrammarMatcher
,BracketedSequenceGrammarMatcher
,FunctionGrammarMatcher
,FunctionSequenceGrammarMatcher
,ListGrammarMatcher
,ListOrBracketGrammarMatcher
,OperatorAsFunctionGrammarMatcher
,RoundBracketGrammarMatcher
,SingleArgFunctionMatcher
Interface defining matchers for custom grammatical elements.
GrammarMatchers match syntax elements at the same precedence level as brackets
they can examine the next two tokens in the input using the
Lookahead2Iterator
and call the GrammarParser.parseSubExpression()
to parse expression fragments.-
Method Summary
Modifier and TypeMethodDescriptionvoid
Delayed 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.
-
Method Details
-
match
Test whether the input matches this pattern.- 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.
-
init
Delayed initialisation, this method is called whenever components of the jep instance are changed.- Parameters:
jep
- the current jep instance.
-