Interface GrammarMatcher
-
- All Superinterfaces:
java.io.Serializable
- All Known Subinterfaces:
GrammaticalRuleI
- All Known Implementing Classes:
ArrayAccessGrammarMatcher
,BlockRule
,BracketedRangeSequenceGrammarMatcher
,BracketedSequenceGrammarMatcher
,ControlRule
,ExpressionRule
,FunctionGrammarMatcher
,FunctionSequenceGrammarMatcher
,JavaForRule
,JavaIfRule
,JavaWhileRule
,ListGrammarMatcher
,ListOrBracketGrammarMatcher
,ListOrRangeGrammarMatcher
,OperatorAsFunctionGrammarMatcher
,PossiblyTerminatedExpressionRule
,RoundBracketGrammarMatcher
,SequenceRule
,SequenceSeparatorRule
,SingleArgFunctionMatcher
,StatementRule
,TerminatedExpressionRule
public interface GrammarMatcher extends java.io.Serializable
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 theLookahead2Iterator
and call theGrammarParser.parseSubExpression()
to parse expression fragments.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
init(Jep jep)
Delayed initialisation, this methods is called whenever components of the jep instance are changed.Node
match(Lookahead2Iterator<Token> it, GrammarParser parser)
Test whether the input matches this pattern.
-
-
-
Method Detail
-
match
Node match(Lookahead2Iterator<Token> it, GrammarParser parser) throws ParseException
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
void init(Jep jep)
Delayed initialisation, this methods is called whenever components of the jep instance are changed.- Parameters:
jep
- the current jep instance.
-
-