예제 #1
0
 /**
  * Return the lexeme representing or held by this token.
  *
  * @return The lexeme string.
  */
 public String lexeme() {
   if (kind.hasStaticLexeme()) {
     return kind.default_lexeme;
   } else {
     return lexeme;
   }
 }
예제 #2
0
  public String toString() {
    String str = kind.name();

    if (!kind.hasStaticLexeme()) str += "(" + lexeme() + ")";

    str += "(";
    str += "lineNum:" + lineNum;
    str += ", ";
    str += "charPos:" + charPos;
    str += ")";

    return str;
  }
예제 #3
0
 public String lexeme() {
   return kind.hasStaticLexeme() ? kind.default_lexeme : lexeme;
 }