Class FunctionGrammarMatcher
java.lang.Object
com.singularsys.jep.configurableparser.matchers.FunctionGrammarMatcher
- All Implemented Interfaces:
GrammarMatcher
,Serializable
A GrammarMatcher which matches functions in the form 'atan2(y,x)'.
The function must be in the FunctionTable and brackets are required.
- See Also:
-
Constructor Summary
ConstructorDescriptionFunctionGrammarMatcher
(Token open, Token close, Token comma) Create a FunctionGrammarMatcher -
Method Summary
Modifier and TypeMethodDescriptionprotected Token
Generate a token to use in GrammarExceptionsvoid
Delayed initialisation, this method is called whenever components of the jep instance are changed.match
(Lookahead2Iterator<Token> it, GrammarParser parser) Attempt to match a function, calls the GrammarParser.parseSubExpression() to match function arguments.
-
Constructor Details
-
FunctionGrammarMatcher
Create a FunctionGrammarMatcher- Parameters:
open
- token representing an opening bracketclose
- token representing a closing bracketcomma
- token representing a list item separator
-
-
Method Details
-
init
Description copied from interface:GrammarMatcher
Delayed initialisation, this method is called whenever components of the jep instance are changed.- Specified by:
init
in interfaceGrammarMatcher
- Parameters:
jep
- the current jep instance.
-
errorToken
Generate a token to use in GrammarExceptions- Parameters:
it
- used to get current position- Returns:
- a TerminatorToken
-
match
Attempt to match a function, calls the GrammarParser.parseSubExpression() to match function arguments.- Specified by:
match
in 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.
-