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;
 }
示例#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;
 }
示例#3
0
 // factory function
 public static Token EOF(int linePos, int charPos) {
   Token tok = new Token(linePos, charPos);
   tok.kind = Kind.EOF;
   return tok;
 }
示例#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;
 }
示例#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;
 }
示例#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;
 }
示例#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;
 }