jess
Class JessToken

java.lang.Object
  extended by jess.JessToken
All Implemented Interfaces:
java.io.Serializable

public final class JessToken
extends java.lang.Object
implements java.io.Serializable

A packet of info about a single token parsed from an input stream.

(C) 2013 Sandia Corporation

See Also:
Jesp, Tokenizer, Serialized Form

Field Summary
static int COMMENT_TOK
           
static int FLOAT_TOK
           
static int INTEGER_TOK
           
static int LONG_TOK
           
 int m_end
           
 int m_lineno
           
 long m_lval
           
 double m_nval
           
 int m_start
           
 java.lang.String m_sval
           
 int m_ttype
           
static int MULTILINE_COMMENT_TOK
           
static int MULTIVARIABLE_TOK
           
static int NONE_TOK
           
static int REGEXP_TOK
           
static int STRING_TOK
           
static int SYMBOL_TOK
           
static int VARIABLE_TOK
           
 
Constructor Summary
JessToken(int start, int end)
           
JessToken(int start, int end, int type, java.lang.String sval)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 int hashCode()
           
 boolean isComment()
           
 boolean isEOF()
           
 boolean isLexeme()
           
 boolean isVariable()
           
 Value rawValueOf(Context context)
          Return the value of this token.
 java.lang.String toString()
           
 Value valueOf(Context context)
          Return the value of this token.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NONE_TOK

public static final int NONE_TOK
See Also:
Constant Field Values

MULTIVARIABLE_TOK

public static final int MULTIVARIABLE_TOK
See Also:
Constant Field Values

VARIABLE_TOK

public static final int VARIABLE_TOK
See Also:
Constant Field Values

STRING_TOK

public static final int STRING_TOK
See Also:
Constant Field Values

SYMBOL_TOK

public static final int SYMBOL_TOK
See Also:
Constant Field Values

INTEGER_TOK

public static final int INTEGER_TOK
See Also:
Constant Field Values

FLOAT_TOK

public static final int FLOAT_TOK
See Also:
Constant Field Values

COMMENT_TOK

public static final int COMMENT_TOK
See Also:
Constant Field Values

REGEXP_TOK

public static final int REGEXP_TOK
See Also:
Constant Field Values

LONG_TOK

public static final int LONG_TOK
See Also:
Constant Field Values

MULTILINE_COMMENT_TOK

public static final int MULTILINE_COMMENT_TOK
See Also:
Constant Field Values

m_sval

public java.lang.String m_sval

m_nval

public double m_nval

m_lval

public long m_lval

m_lineno

public int m_lineno

m_ttype

public int m_ttype

m_start

public int m_start

m_end

public int m_end
Constructor Detail

JessToken

public JessToken(int start,
                 int end)

JessToken

public JessToken(int start,
                 int end,
                 int type,
                 java.lang.String sval)
Method Detail

rawValueOf

public Value rawValueOf(Context context)
                 throws JessException
Return the value of this token. Converts a JessToken to a Value. Will not resolve variables.

Parameters:
context - an execution context
Returns:
a Value equivalent to the JessToken
Throws:
JessException - if something goes wrong

valueOf

public Value valueOf(Context context)
              throws JessException
Return the value of this token. Converts a JessToken to a Value. Will resolve variables if possible.

Parameters:
context - an execution context
Returns:
a Value equivalent to the JessToken
Throws:
JessException - if something goes wrong

toString

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

isComment

public boolean isComment()

isEOF

public boolean isEOF()

isVariable

public boolean isVariable()

isLexeme

public boolean isLexeme()

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

© 2013 Sandia Corporation