com.dandymadeproductions.expressionparser
Class Symbol

java.lang.Object
  extended by com.dandymadeproductions.expressionparser.Symbol

public class Symbol
extends java.lang.Object

An input symbol in an expression.

Version:
1.9 02/17/2012
Author:
David Wanqian Liu, Dana M. Proctor

Field Summary
 ExprNode enode
           
 Function func
           
 double nval
           
(package private) static int[][] precTab
           
 int stype
           
static int SYM_EXPRNODE
           
static int SYM_TERMINAL
           
static int SYM_UNKNOWN
           
static int TK_BRACKETL
           
static int TK_BRACKETR
           
static int TK_DIV
           
static int TK_EOE
           
static int TK_FUNCTION
           
static int TK_MINUS
           
static int TK_MULT
           
static int TK_NUMBER
           
static int TK_PLUS
           
static int TK_POW
           
static int TK_VARIABLE
           
 int ttype
           
 Variable variable
           
 
Constructor Summary
Symbol()
           
Symbol(int type, ExprNode en)
           
Symbol(int type, int tk)
           
Symbol(int type, int tk, char vchar)
           
Symbol(int type, int tk, double val)
           
Symbol(int type, int tk, java.lang.String str)
           
 
Method Summary
 boolean equal(Symbol a)
           
 boolean greater(Symbol a)
           
 boolean isEOE()
           
 boolean isExprNode()
           
 boolean less(Symbol a)
           
(package private) static int precTabIndex(int token)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SYM_UNKNOWN

public static final int SYM_UNKNOWN
See Also:
Constant Field Values

SYM_EXPRNODE

public static final int SYM_EXPRNODE
See Also:
Constant Field Values

SYM_TERMINAL

public static final int SYM_TERMINAL
See Also:
Constant Field Values

TK_EOE

public static final int TK_EOE
See Also:
Constant Field Values

TK_NUMBER

public static final int TK_NUMBER
See Also:
Constant Field Values

TK_VARIABLE

public static final int TK_VARIABLE
See Also:
Constant Field Values

TK_BRACKETL

public static final int TK_BRACKETL
See Also:
Constant Field Values

TK_BRACKETR

public static final int TK_BRACKETR
See Also:
Constant Field Values

TK_PLUS

public static final int TK_PLUS
See Also:
Constant Field Values

TK_MINUS

public static final int TK_MINUS
See Also:
Constant Field Values

TK_MULT

public static final int TK_MULT
See Also:
Constant Field Values

TK_DIV

public static final int TK_DIV
See Also:
Constant Field Values

TK_POW

public static final int TK_POW
See Also:
Constant Field Values

TK_FUNCTION

public static final int TK_FUNCTION
See Also:
Constant Field Values

stype

public int stype

ttype

public int ttype

enode

public ExprNode enode

nval

public double nval

func

public Function func

variable

public Variable variable

precTab

static int[][] precTab
Constructor Detail

Symbol

public Symbol()

Symbol

public Symbol(int type,
              int tk)

Symbol

public Symbol(int type,
              int tk,
              double val)

Symbol

public Symbol(int type,
              int tk,
              char vchar)
       throws ExpressionParseException
Throws:
ExpressionParseException

Symbol

public Symbol(int type,
              int tk,
              java.lang.String str)
       throws ExpressionParseException
Throws:
ExpressionParseException

Symbol

public Symbol(int type,
              ExprNode en)
Method Detail

precTabIndex

static int precTabIndex(int token)
                 throws ExpressionParseException
Throws:
ExpressionParseException

isEOE

public boolean isEOE()

isExprNode

public boolean isExprNode()

less

public boolean less(Symbol a)
             throws ExpressionParseException
Throws:
ExpressionParseException

equal

public boolean equal(Symbol a)
              throws ExpressionParseException
Throws:
ExpressionParseException

greater

public boolean greater(Symbol a)
                throws ExpressionParseException
Throws:
ExpressionParseException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object