private final Token jjFillToken() {
   Token t = Token.newToken(jjmatchedKind);
   t.kind = jjmatchedKind;
   String im = jjstrLiteralImages[jjmatchedKind];
   t.image = (im == null) ? input_stream.GetImage() : im;
   t.beginLine = input_stream.getBeginLine();
   t.beginColumn = input_stream.getBeginColumn();
   t.endLine = input_stream.getEndLine();
   t.endColumn = input_stream.getEndColumn();
   return t;
 }
Example #2
0
 public static Token ERROR(String lexeme, int linePos, int charPos) {
   Token tok = new Token(lexeme, linePos, charPos);
   tok.kind = Kind.ERROR;
   return tok;
 }
Example #3
0
 // factory function
 public static Token EOF(int linePos, int charPos) {
   Token tok = new Token(linePos, charPos);
   tok.kind = Kind.EOF;
   return tok;
 }
Example #4
0
 public static Token Identifier(String name, int linePos, int charPos) {
   Token tok = new Token(linePos, charPos);
   tok.kind = Kind.IDENTIFIER;
   tok.lexeme = name;
   return tok;
 }
Example #5
0
 public static Token Error(String description, int linePos, int charPos) {
   Token tok = new Token(linePos, charPos);
   tok.kind = Kind.ERROR;
   tok.lexeme = description;
   return tok;
 }
Example #6
0
 public static Token Float(String value, int linePos, int charPos) {
   Token tok = new Token(linePos, charPos);
   tok.kind = Kind.FLOAT;
   tok.lexeme = value;
   return tok;
 }
Example #7
0
 public static Token Integer(String value, int linePos, int charPos) {
   Token tok = new Token(linePos, charPos);
   tok.kind = Kind.INTEGER;
   tok.lexeme = value;
   return tok;
 }