com.singularsys.jep.configurableparser.matchers
Class TerminatorTokenMatcher

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

public class TerminatorTokenMatcher
extends RegExpTokenMatcher

A token matcher which matches the end of an expression

See Also:
Serialized Form

Constructor Summary
TerminatorTokenMatcher(java.util.regex.Pattern pattern)
           
TerminatorTokenMatcher(java.lang.String regex)
           
 
Method Summary
 Token buildToken(java.lang.String s)
          Builds a token following a successful match.
 void init(Jep j)
          Initialize the matcher when the Jep instance is known.
static TerminatorTokenMatcher semiColonTerminatorMatcher()
          Factory creating a TerminalTokenMatcher which matches a semi-colon.
 
Methods inherited from class com.singularsys.jep.configurableparser.matchers.RegExpTokenMatcher
match
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TerminatorTokenMatcher

public TerminatorTokenMatcher(java.util.regex.Pattern pattern)

TerminatorTokenMatcher

public TerminatorTokenMatcher(java.lang.String regex)
Method Detail

buildToken

public Token buildToken(java.lang.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 semi-colon.

Returns:
the TokenMatcher.

init

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



Copyright © 2010 Singular Systems http://www.singularsys.com/jep