marf.nlp.Parsing
Class TokenSubType

java.lang.Object
  extended by marf.nlp.Parsing.TokenType
      extended by marf.nlp.Parsing.TokenSubType
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
GrammarTokenType

public class TokenSubType
extends TokenType

MARF Specific Tokens Types.

$Id: TokenSubType.java,v 1.16 2008/01/03 03:21:57 mokhov Exp $

Since:
0.3.0.2
Version:
$Revision: 1.16 $
Author:
Serguei Mokhov
See Also:
Serialized Form

Field Summary
static int AND
          Constant for keyword "and".
static int CLASS
          Constant for keyword "class".
static int COMMA
          Constant for "comma".
static int CURLY_CL
          Constant for "closed curly brace".
static int CURLY_OP
          Constant for "open curly brace".
static int DO
          Constant for keyword "do".
static int ELSE
          Constant for keyword "else".
static int IF
          Constant for keyword "if".
static int INTEGER
          Constant for keyword "integer".
protected  int iSubtype
          Token subtype; default is UNKNOWN.
static int NOT
          Constant for keyword "not".
static int OP_ASIGN
          Constant for operator "assign".
static int OP_DIV
          Constant for operator "divide".
static int OP_EQ
          Constant for operator "equals".
static int OP_GE
          Constant for operator "greater than or equal to".
static int OP_GT
          Constant for operator "greater than".
static int OP_LE
          Constant for operator "less than or equal to".
static int OP_LT
          Constant for operator "less than".
static int OP_MEMB
          Constant for operator "object membership".
static int OP_MINUS
          Constant for operator "minus".
static int OP_MULT
          Constant for operator "multiply".
static int OP_NE
          Constant for operator "not equal".
static int OP_PLUS
          Constant for operator "plus".
static int OR
          Constant for keyword "or".
static int PAREN_CL
          Constant for "closed parenthesis".
static int PAREN_OP
          Constant for "open parenthesis".
static int PROGRAM
          Constant for keyword "program".
static int READ
          Constant for keyword "read".
static int REAL
          Constant for keyword "real".
static int RETURN
          Constant for keyword "return".
static int SEMICOLON
          Constant for "semicolon".
private static long serialVersionUID
          For serialization versioning.
static java.util.Hashtable soBrackets
          Maps constants and brackets, parentheses, and braces.
static java.util.Hashtable soKeywords
          Maps constants and keyword spellings.
static java.util.Hashtable soOperators
          Maps constants and operators.
static java.util.Hashtable soTokenSubTypes
          Matches numbers to literals for output purposes.
static java.util.Hashtable soValidPunctuation
          Maps constants and punctuation.
static int SQR_CL
          Constant for "close square bracket".
static int SQR_OP
          Constant for "open square bracket".
static int THEN
          Constant for keyword "then".
static int THIS
          Constant for keyword "this".
static int WHILE
          Constant for keyword "while".
static int WRITE
          Constant for keyword "write".
 
Fields inherited from class marf.nlp.Parsing.TokenType
BACKTRACK, BRACKET, EOF, ERROR, ID, iType, KEYWORD, NUM, OPERATOR, PUNCT, soTokenTypes, UNKNOWN
 
Constructor Summary
TokenSubType()
          Default Constructor.
 
Method Summary
static java.lang.String getMARFSourceCodeRevision()
          Retrieves class' revision.
 int getSubtype()
          Allows querying for the current token sub-type.
 void setSubtype(int piSubtype)
          Allows setting the current token sub-type.
 void setSubTypeByLexeme(java.lang.String pstrLexeme)
          Sets token sub-type given its lexeme.
 
Methods inherited from class marf.nlp.Parsing.TokenType
getType, setType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

iSubtype

protected int iSubtype
Token subtype; default is UNKNOWN.

See Also:
TokenType.UNKNOWN

OP_EQ

public static final int OP_EQ
Constant for operator "equals".

See Also:
Constant Field Values

OP_NE

public static final int OP_NE
Constant for operator "not equal".

See Also:
Constant Field Values

OP_LT

public static final int OP_LT
Constant for operator "less than".

See Also:
Constant Field Values

OP_GT

public static final int OP_GT
Constant for operator "greater than".

See Also:
Constant Field Values

OP_LE

public static final int OP_LE
Constant for operator "less than or equal to".

See Also:
Constant Field Values

OP_GE

public static final int OP_GE
Constant for operator "greater than or equal to".

See Also:
Constant Field Values

OP_PLUS

public static final int OP_PLUS
Constant for operator "plus".

See Also:
Constant Field Values

OP_MINUS

public static final int OP_MINUS
Constant for operator "minus".

See Also:
Constant Field Values

OP_MULT

public static final int OP_MULT
Constant for operator "multiply".

See Also:
Constant Field Values

OP_DIV

public static final int OP_DIV
Constant for operator "divide".

See Also:
Constant Field Values

OP_ASIGN

public static final int OP_ASIGN
Constant for operator "assign".

See Also:
Constant Field Values

OP_MEMB

public static final int OP_MEMB
Constant for operator "object membership".

See Also:
Constant Field Values

COMMA

public static final int COMMA
Constant for "comma".

See Also:
Constant Field Values

SEMICOLON

public static final int SEMICOLON
Constant for "semicolon".

See Also:
Constant Field Values

PAREN_OP

public static final int PAREN_OP
Constant for "open parenthesis".

See Also:
Constant Field Values

PAREN_CL

public static final int PAREN_CL
Constant for "closed parenthesis".

See Also:
Constant Field Values

CURLY_OP

public static final int CURLY_OP
Constant for "open curly brace".

See Also:
Constant Field Values

CURLY_CL

public static final int CURLY_CL
Constant for "closed curly brace".

See Also:
Constant Field Values

SQR_OP

public static final int SQR_OP
Constant for "open square bracket".

See Also:
Constant Field Values

SQR_CL

public static final int SQR_CL
Constant for "close square bracket".

See Also:
Constant Field Values

DO

public static final int DO
Constant for keyword "do".

See Also:
Constant Field Values

ELSE

public static final int ELSE
Constant for keyword "else".

See Also:
Constant Field Values

IF

public static final int IF
Constant for keyword "if".

See Also:
Constant Field Values

INTEGER

public static final int INTEGER
Constant for keyword "integer".

See Also:
Constant Field Values

CLASS

public static final int CLASS
Constant for keyword "class".

See Also:
Constant Field Values

READ

public static final int READ
Constant for keyword "read".

See Also:
Constant Field Values

REAL

public static final int REAL
Constant for keyword "real".

See Also:
Constant Field Values

RETURN

public static final int RETURN
Constant for keyword "return".

See Also:
Constant Field Values

THEN

public static final int THEN
Constant for keyword "then".

See Also:
Constant Field Values

WHILE

public static final int WHILE
Constant for keyword "while".

See Also:
Constant Field Values

WRITE

public static final int WRITE
Constant for keyword "write".

See Also:
Constant Field Values

PROGRAM

public static final int PROGRAM
Constant for keyword "program".

See Also:
Constant Field Values

AND

public static final int AND
Constant for keyword "and".

See Also:
Constant Field Values

NOT

public static final int NOT
Constant for keyword "not".

See Also:
Constant Field Values

OR

public static final int OR
Constant for keyword "or".

See Also:
Constant Field Values

THIS

public static final int THIS
Constant for keyword "this".

See Also:
Constant Field Values

soKeywords

public static java.util.Hashtable soKeywords
Maps constants and keyword spellings.

Since:
October 2, 2001

soValidPunctuation

public static java.util.Hashtable soValidPunctuation
Maps constants and punctuation.

Since:
October 2, 2001

soOperators

public static java.util.Hashtable soOperators
Maps constants and operators.

Since:
October 2, 2001

soBrackets

public static java.util.Hashtable soBrackets
Maps constants and brackets, parentheses, and braces.

Since:
October 2, 2001

soTokenSubTypes

public static java.util.Hashtable soTokenSubTypes
Matches numbers to literals for output purposes.

Since:
October 2, 2001

serialVersionUID

private static final long serialVersionUID
For serialization versioning. When adding new members or make other structural changes regenerate this number with the serialver tool that comes with JDK.

Since:
0.3.0.4
See Also:
Constant Field Values
Constructor Detail

TokenSubType

public TokenSubType()
Default Constructor.

Method Detail

setSubTypeByLexeme

public void setSubTypeByLexeme(java.lang.String pstrLexeme)
Sets token sub-type given its lexeme.

Parameters:
pstrLexeme - the lexeme to determine the token sub-type

getSubtype

public int getSubtype()
Allows querying for the current token sub-type.

Returns:
the current token subtype
Since:
0.3.0.5

setSubtype

public void setSubtype(int piSubtype)
Allows setting the current token sub-type.

Parameters:
piSubtype - the new token subtype
Since:
0.3.0.5

getMARFSourceCodeRevision

public static java.lang.String getMARFSourceCodeRevision()
Retrieves class' revision.

Returns:
revision string


SourceForge Logo