Class FunctionGrammarMatcher
- java.lang.Object
-
- com.singularsys.jep.configurableparser.matchers.FunctionGrammarMatcher
-
- All Implemented Interfaces:
GrammarMatcher,java.io.Serializable
public class FunctionGrammarMatcher extends java.lang.Object implements GrammarMatcher
A GrammarMatcher which matches functions in the form 'atan2(y,x)'. The function must be in the FunctionTable and brackets are required.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FunctionGrammarMatcher(Token open, Token close, Token comma)Create a FunctionGrammarMatcher
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected TokenerrorToken(Lookahead2Iterator<Token> it)Generate a token to use in GrammarExecptionsvoidinit(Jep jep)Delayed initialisation, this methods is called whenever components of the jep instance are changed.Nodematch(Lookahead2Iterator<Token> it, GrammarParser parser)Attempt to match a function, calls the GrammarParser.parseSubExpression() to match function arguments.
-
-
-
Method Detail
-
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.
-
errorToken
protected Token errorToken(Lookahead2Iterator<Token> it)
Generate a token to use in GrammarExecptions- Parameters:
it- used to get current position- Returns:
- a TerminatorToken
-
match
public Node match(Lookahead2Iterator<Token> it, GrammarParser parser) throws ParseException
Attempt to match a function, calls the GrammarParser.parseSubExpression() to match function arguments.- 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.
-
-