Class AlternateFunctionGrammerMatcher

java.lang.Object
com.singularsys.jep.misc.overloadedfunctions.AlternateFunctionGrammerMatcher
All Implemented Interfaces:
GrammarMatcher, Serializable

public class AlternateFunctionGrammerMatcher extends Object implements GrammarMatcher
A FunctionGrammarMatcher that works with AlternateFunctions and OverloadedFunctionByStructure selecting the function at parse time. It wraps an FunctionGrammarMatcher calling its match method and substituting the appropriate function according to the number of arguments.
See Also:
  • Constructor Details

    • AlternateFunctionGrammerMatcher

      public AlternateFunctionGrammerMatcher(GrammarMatcher fgm)
  • Method Details

    • match

      public Node match(Lookahead2Iterator<Token> it, GrammarParser parser) throws ParseException
      Description copied from interface: GrammarMatcher
      Test whether the input matches this pattern.
      Specified by:
      match in interface GrammarMatcher
      Parameters:
      it - An iterator inspecting the input
      parser - 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

      public void init(Jep jep)
      Description copied from interface: GrammarMatcher
      Delayed initialisation, this method is called whenever components of the jep instance are changed.
      Specified by:
      init in interface GrammarMatcher
      Parameters:
      jep - the current jep instance.