Class TerminatorTokenMatcher

java.lang.Object
com.singularsys.jep.configurableparser.matchers.RegExpTokenMatcher
com.singularsys.jep.configurableparser.matchers.TerminatorTokenMatcher
All Implemented Interfaces:
TokenBuilder, TokenMatcher, Serializable

public class TerminatorTokenMatcher extends RegExpTokenMatcher
A token matcher which matches the end of an expression
See Also:
  • Constructor Details

    • TerminatorTokenMatcher

      public TerminatorTokenMatcher(Pattern pattern)
    • TerminatorTokenMatcher

      public TerminatorTokenMatcher(String regex)
  • Method Details

    • buildToken

      public Token buildToken(String s)
      Description copied from class: RegExpTokenMatcher
      Builds a token following a successful match. Note new objects should be created each time as error reporting information is later attached to tokens.
      Specified by:
      buildToken in interface TokenBuilder
      Specified by:
      buildToken in class RegExpTokenMatcher
      Parameters:
      s - String representing the completed matched token
      Returns:
      the appropriate type of token.
    • semiColonTerminatorMatcher

      public static TerminatorTokenMatcher semiColonTerminatorMatcher()
      Factory creating a TerminalTokenMatcher which matches a semicolon.
      Returns:
      the TokenMatcher.
    • init

      public void init(Jep j)
      Description copied from interface: TokenMatcher
      Initialize the matcher when the Jep instance is known.
      Parameters:
      j - Jep instance