Enum Parser.Operator
- java.lang.Object
-
- java.lang.Enum<Parser.Operator>
-
- com.google.auto.value.processor.escapevelocity.Parser.Operator
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<Parser.Operator>
- Enclosing class:
- Parser
static enum Parser.Operator extends java.lang.Enum<Parser.Operator>
-
-
Field Summary
Fields Modifier and Type Field Description (package private) int
precedence
(package private) java.lang.String
symbol
-
Constructor Summary
Constructors Modifier Constructor Description private
Operator(java.lang.String symbol, int precedence)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
toString()
static Parser.Operator
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static Parser.Operator[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
STOP
public static final Parser.Operator STOP
A dummy operator with low precedence. When parsing subexpressions, we always stop when we reach an operator of lower precedence than the "current precedence". For example, when parsing1 + 2 * 3 + 4
, we'll stop parsing the subexpression* 3 + 4
when we reach the+
because it has lower precedence than*
. This dummy operator, then, behaves like+
when the minimum precedence is*
. We also return it if we're looking for an operator and don't find one. If this operator is⊙
, it's as if our expressions are bracketed with it, like⊙ 1 + 2 * 3 + 4 ⊙
.
-
OR
public static final Parser.Operator OR
-
AND
public static final Parser.Operator AND
-
EQUAL
public static final Parser.Operator EQUAL
-
NOT_EQUAL
public static final Parser.Operator NOT_EQUAL
-
LESS
public static final Parser.Operator LESS
-
LESS_OR_EQUAL
public static final Parser.Operator LESS_OR_EQUAL
-
GREATER
public static final Parser.Operator GREATER
-
GREATER_OR_EQUAL
public static final Parser.Operator GREATER_OR_EQUAL
-
PLUS
public static final Parser.Operator PLUS
-
MINUS
public static final Parser.Operator MINUS
-
TIMES
public static final Parser.Operator TIMES
-
DIVIDE
public static final Parser.Operator DIVIDE
-
REMAINDER
public static final Parser.Operator REMAINDER
-
-
Method Detail
-
values
public static Parser.Operator[] 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 (Parser.Operator c : Parser.Operator.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Parser.Operator valueOf(java.lang.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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Enum<Parser.Operator>
-
-