Class IdentifierTokenMatcher
- java.lang.Object
-
- com.singularsys.jep.configurableparser.matchers.RegExpTokenMatcher
-
- com.singularsys.jep.configurableparser.matchers.IdentifierTokenMatcher
-
- All Implemented Interfaces:
TokenBuilder
,TokenMatcher
,java.io.Serializable
public class IdentifierTokenMatcher extends RegExpTokenMatcher
Matches identifiers: variables or function names.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description IdentifierTokenMatcher(java.lang.String regex)
Construct and identifier matcher.IdentifierTokenMatcher(java.util.regex.Pattern pattern)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static IdentifierTokenMatcher
basicIdentifierMatcher()
Matches identifiers which start with a letter or underscore and are followed by 0 or more letters digits or underscores.static IdentifierTokenMatcher
basicIndetifierMatcher()
Deprecated.replace by correctly spelled versionbasicIdentifierMatcher()
.Token
buildToken(java.lang.String s)
Create the token, if the name matches a function name return a FunctionToken otherwise return an IdentifierToken.static IdentifierTokenMatcher
dottedIdentifierMatcher()
Matches identifiers which start with a letter or underscore and are followed by 0 or more letters digits or underscores or . characters.static IdentifierTokenMatcher
dottedIndetifierMatcher()
Deprecated.replace by correctly spelled versiondottedIdentifierMatcher()
void
init(Jep j)
Initialize the matcher when the Jep instance is known.-
Methods inherited from class com.singularsys.jep.configurableparser.matchers.RegExpTokenMatcher
match
-
-
-
-
Constructor Detail
-
IdentifierTokenMatcher
public IdentifierTokenMatcher(java.util.regex.Pattern pattern)
-
IdentifierTokenMatcher
public IdentifierTokenMatcher(java.lang.String regex)
Construct and identifier matcher.- Parameters:
regex
- a regular expression specifying the allowed identifier names.- See Also:
Pattern
-
-
Method Detail
-
buildToken
public Token buildToken(java.lang.String s)
Create the token, if the name matches a function name return a FunctionToken otherwise return an IdentifierToken.- Specified by:
buildToken
in interfaceTokenBuilder
- Specified by:
buildToken
in classRegExpTokenMatcher
- Parameters:
s
- String representing the completed matched token- Returns:
- the appropriate type of token.
-
basicIndetifierMatcher
@Deprecated public static IdentifierTokenMatcher basicIndetifierMatcher()
Deprecated.replace by correctly spelled versionbasicIdentifierMatcher()
.Matches identifiers which start with a letter or underscore and are followed by 0 or more letters digits or underscores.- Returns:
- the matcher
-
dottedIndetifierMatcher
@Deprecated public static IdentifierTokenMatcher dottedIndetifierMatcher()
Deprecated.replace by correctly spelled versiondottedIdentifierMatcher()
Matches identifiers which start with a letter or underscore and are followed by 0 or more letters digits or underscores or . characters.- Returns:
- the matcher
-
basicIdentifierMatcher
public static IdentifierTokenMatcher basicIdentifierMatcher()
Matches identifiers which start with a letter or underscore and are followed by 0 or more letters digits or underscores. Correctly spelled version- Returns:
- the matcher
- Since:
- 3.5
-
dottedIdentifierMatcher
public static IdentifierTokenMatcher dottedIdentifierMatcher()
Matches identifiers which start with a letter or underscore and are followed by 0 or more letters digits or underscores or . characters. Correctly spelled version- Returns:
- the matcher
- Since:
- 3.5
-
init
public void init(Jep j)
Description copied from interface:TokenMatcher
Initialize the matcher when the Jep instance is known.- Parameters:
j
- Jep instance
-
-