Exemple #1
0
 /** Get the specific Token. */
 public static final Token getToken(int index) {
   Token t = token;
   for (int i = 0; i < index; i++) {
     if (t.next != null) t = t.next;
     else t = t.next = token_source.getNextToken();
   }
   return t;
 }
Exemple #2
0
 /** Get the next Token. */
 public static final Token getNextToken() {
   if (token.next != null) token = token.next;
   else token = token.next = token_source.getNextToken();
   jj_ntk = -1;
   jj_gen++;
   return token;
 }
Exemple #3
0
 private static Token jj_consume_token(int kind) throws ParseException {
   Token oldToken;
   if ((oldToken = token).next != null) token = token.next;
   else token = token.next = token_source.getNextToken();
   jj_ntk = -1;
   if (token.kind == kind) {
     jj_gen++;
     return token;
   }
   token = oldToken;
   jj_kind = kind;
   throw generateParseException();
 }
  protected static Token jjFillToken() {
    final Token t;
    final String curTokenImage;
    final int beginLine;
    final int endLine;
    final int beginColumn;
    final int endColumn;
    String im = jjstrLiteralImages[jjmatchedKind];
    curTokenImage = (im == null) ? input_stream.GetImage() : im;
    beginLine = input_stream.getBeginLine();
    beginColumn = input_stream.getBeginColumn();
    endLine = input_stream.getEndLine();
    endColumn = input_stream.getEndColumn();
    t = Token.newToken(jjmatchedKind, curTokenImage);

    t.beginLine = beginLine;
    t.endLine = endLine;
    t.beginColumn = beginColumn;
    t.endColumn = endColumn;

    return t;
  }
Exemple #5
0
 private static int jj_ntk() {
   if ((jj_nt = token.next) == null)
     return (jj_ntk = (token.next = token_source.getNextToken()).kind);
   else return (jj_ntk = jj_nt.kind);
 }