tecgraf.javautils.jexpression.scanner
Enum Symbol

java.lang.Object
  extended by java.lang.Enum<Symbol>
      extended by tecgraf.javautils.jexpression.scanner.Symbol
All Implemented Interfaces:
Serializable, Comparable<Symbol>

public enum Symbol
extends Enum<Symbol>

Enumeração que define os símbolos da linguagem de expressões. A ordem da declaração dos símbolos é relevante para a análise léxica, por exemplo, o operador '>=' deve preceder o operador '>' por terem o mesmo prefixo. Basicamente, essa ordem serve para definir uma ordem no reconhecimento dos símbolos.

Author:
Tecgraf

Enum Constant Summary
AND
          e.
COLON
          senão.
COMMA
          vírgula.
DIVIDE
          divisão.
DOT
          ponto.
DOUBLE
          número.
EQUAL
          igualdade.
GREATER
          maior que.
GREATER_EQ
          maior ou igual.
L_BRACKET
          colchete.
L_PAREN
          parêntese.
LOWER
          menor que.
LOWER_EQ
          menor ou igual.
MINUS
          substração.
NAME
          nome.
NOT
          negação.
NOT_EQUAL
          diferente.
OR
          ou.
PLUS
          soma.
POW
          exponenciação.
QUESTION
          condição.
R_BRACKET
          colchete.
R_PAREN
          parêntese.
TIMES
          multiplicação.
UNKNOWN
          Caracter desconhecido.
 
Field Summary
 String graphic
          Representação gráfica do símbolo.
 Pattern pattern
          Regex que reconhece o símbolo.
 
Method Summary
static Symbol valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Symbol[] 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 class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

GREATER_EQ

public static final Symbol GREATER_EQ
maior ou igual.


GREATER

public static final Symbol GREATER
maior que.


LOWER_EQ

public static final Symbol LOWER_EQ
menor ou igual.


LOWER

public static final Symbol LOWER
menor que.


PLUS

public static final Symbol PLUS
soma.


COMMA

public static final Symbol COMMA
vírgula.


MINUS

public static final Symbol MINUS
substração.


DIVIDE

public static final Symbol DIVIDE
divisão.


TIMES

public static final Symbol TIMES
multiplicação.


POW

public static final Symbol POW
exponenciação.


QUESTION

public static final Symbol QUESTION
condição.


COLON

public static final Symbol COLON
senão.


L_PAREN

public static final Symbol L_PAREN
parêntese.


R_PAREN

public static final Symbol R_PAREN
parêntese.


L_BRACKET

public static final Symbol L_BRACKET
colchete.


R_BRACKET

public static final Symbol R_BRACKET
colchete.


EQUAL

public static final Symbol EQUAL
igualdade.


NOT_EQUAL

public static final Symbol NOT_EQUAL
diferente.


NOT

public static final Symbol NOT
negação.


AND

public static final Symbol AND
e.


OR

public static final Symbol OR
ou.


DOT

public static final Symbol DOT
ponto.


DOUBLE

public static final Symbol DOUBLE
número.


NAME

public static final Symbol NAME
nome.


UNKNOWN

public static final Symbol UNKNOWN
Caracter desconhecido.

Field Detail

graphic

public final String graphic
Representação gráfica do símbolo.


pattern

public final Pattern pattern
Regex que reconhece o símbolo.

Method Detail

values

public static Symbol[] 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 (Symbol c : Symbol.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Symbol 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 name
NullPointerException - if the argument is null


Copyright © 2007–2014 Tecgraf/PUC-Rio. All rights reserved.