Package com.gengoai.parsing
Enum CommonTypes
- java.lang.Object
-
- java.lang.Enum<CommonTypes>
-
- com.gengoai.parsing.CommonTypes
-
- All Implemented Interfaces:
TokenDef
,Tag
,Serializable
,Comparable<CommonTypes>
public enum CommonTypes extends Enum<CommonTypes> implements TokenDef
A enum of common Parser Token Types.- Author:
- David B. Bracewell
-
-
Enum Constant Summary
Enum Constants Enum Constant Description AMPERSAND
AT
BACKSLASH
CARROT
CLOSEBRACE
CLOSEBRACKET
CLOSEPARENS
COLON
COMMA
DIVIDE
DOLLAR
DOUBLEQUOTE
EQUALS
EXCLAMATION
FORWARDSLASH
MINUS
MULTIPLY
NEWLINE
NUMBER
OPENBRACE
OPENBRACKET
OPENPARENS
PERIOD
PIPE
PLUS
POUND
QUESTION
SEMICOLON
SINGLEQUOTE
TILDE
WHITESPACE
WORD
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getPattern()
Regular expression pattern for use in aLexer
boolean
isInstance(Tag tag)
Determines if this tag is an instance of a given tag.static CommonTypes
valueOf(String name)
Returns the enum constant of this type with the specified name.static CommonTypes[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.-
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Methods inherited from interface com.gengoai.Tag
isInstance, label, name, parent
-
-
-
-
Enum Constant Detail
-
NUMBER
public static final CommonTypes NUMBER
-
WORD
public static final CommonTypes WORD
-
OPENPARENS
public static final CommonTypes OPENPARENS
-
CLOSEPARENS
public static final CommonTypes CLOSEPARENS
-
OPENBRACKET
public static final CommonTypes OPENBRACKET
-
CLOSEBRACKET
public static final CommonTypes CLOSEBRACKET
-
OPENBRACE
public static final CommonTypes OPENBRACE
-
CLOSEBRACE
public static final CommonTypes CLOSEBRACE
-
PERIOD
public static final CommonTypes PERIOD
-
PLUS
public static final CommonTypes PLUS
-
MINUS
public static final CommonTypes MINUS
-
MULTIPLY
public static final CommonTypes MULTIPLY
-
DIVIDE
public static final CommonTypes DIVIDE
-
EXCLAMATION
public static final CommonTypes EXCLAMATION
-
POUND
public static final CommonTypes POUND
-
COMMA
public static final CommonTypes COMMA
-
EQUALS
public static final CommonTypes EQUALS
-
DOUBLEQUOTE
public static final CommonTypes DOUBLEQUOTE
-
AMPERSAND
public static final CommonTypes AMPERSAND
-
DOLLAR
public static final CommonTypes DOLLAR
-
AT
public static final CommonTypes AT
-
CARROT
public static final CommonTypes CARROT
-
COLON
public static final CommonTypes COLON
-
SEMICOLON
public static final CommonTypes SEMICOLON
-
QUESTION
public static final CommonTypes QUESTION
-
BACKSLASH
public static final CommonTypes BACKSLASH
-
FORWARDSLASH
public static final CommonTypes FORWARDSLASH
-
SINGLEQUOTE
public static final CommonTypes SINGLEQUOTE
-
NEWLINE
public static final CommonTypes NEWLINE
-
WHITESPACE
public static final CommonTypes WHITESPACE
-
TILDE
public static final CommonTypes TILDE
-
PIPE
public static final CommonTypes PIPE
-
-
Method Detail
-
values
public static CommonTypes[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (CommonTypes c : CommonTypes.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static CommonTypes valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getPattern
public String getPattern()
Description copied from interface:TokenDef
Regular expression pattern for use in aLexer
- Specified by:
getPattern
in interfaceTokenDef
- Returns:
- the pattern
-
isInstance
public boolean isInstance(Tag tag)
Description copied from interface:Tag
Determines if this tag is an instance of a given tag.- Specified by:
isInstance
in interfaceTag
- Parameters:
tag
- The given tag to check if this one is an instance of- Returns:
- True if this tag is an instance of the given tag
-
-