asg.cliche
Class Token

java.lang.Object
  extended by asg.cliche.Token

public class Token
extends java.lang.Object

Token associates index of a token in the input line with the token itself, in order to be able to provide helpful error indecation (see below :) ------------------------------------------------^ Misspelled word! (Exactly how it should work). This class is immutable. Parsing procedural module is also within.


Constructor Summary
Token(int index, java.lang.String string)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
static java.lang.String escapeString(java.lang.String input)
          Escape given string so that tokenize(escapeString(str)).get(0).getString === str.
 int getIndex()
           
 java.lang.String getString()
           
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Token

public Token(int index,
             java.lang.String string)
Method Detail

getIndex

public final int getIndex()

getString

public final java.lang.String getString()

toString

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

equals

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

hashCode

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

escapeString

public static java.lang.String escapeString(java.lang.String input)
Escape given string so that tokenize(escapeString(str)).get(0).getString === str.

Parameters:
input - String to be escaped
Returns:
escaped string