Package antlr.collections.impl

Examples of antlr.collections.impl.Vector.elementAt()


    println("NULL_TREE_LOOKAHEAD = antlr.NULL_TREE_LOOKAHEAD");
    println("MIN_USER_TYPE       = antlr.MIN_USER_TYPE");

    for (int i = Token.MIN_USER_TYPE; i < v.size(); i++)
    {
      String s = (String)v.elementAt(i);
      if (s != null)
      {
        if (s.startsWith("\""))
        {
          // a string literal
View Full Code Here


        println(tm.getName() + "    // output token vocab name");

        // Generate a definition for each token type
        Vector v = tm.getVocabulary();
        for (int i = Token.MIN_USER_TYPE; i < v.size(); i++) {
            String s = (String)v.elementAt(i);
            if (DEBUG_CODE_GENERATOR) {
                System.out.println("gen persistence file entry for: " + s);
            }
            if (s != null && !s.startsWith("<")) {
                // if literal, find label
View Full Code Here

 
          // Walk the token vocabulary and generate a Vector of strings
          // from the tokens.
          Vector v = grammar.tokenManager.getVocabulary();
          for (int i = 0; i < v.size(); i++) {
              String s = (String)v.elementAt(i);
              if (s == null) {
                  s = "<" + String.valueOf(i) + ">";
              }
              if (!s.startsWith("\"") && !s.startsWith("<")) {
                  TokenSymbol ts = (TokenSymbol)grammar.tokenManager.getTokenSymbol(s);
View Full Code Here

      boolean generatedNewHashtable = false;
      int n = 0;
          // Walk the token vocabulary and generate puts.
      Vector v = grammar.tokenManager.getVocabulary();
      for (int i = 0; i < v.size(); i++) {
        String s = (String)v.elementAt(i);
        if (s != null) {
          TokenSymbol ts = grammar.tokenManager.getTokenSymbol(s);
          if (ts != null && ts.getASTNodeType() != null) {
            n++;
            if ( !generatedNewHashtable ) {
View Full Code Here

          // Do special tokens manually
          println("int EOF = " + Token.EOF_TYPE + ";");
          println("int NULL_TREE_LOOKAHEAD = " + Token.NULL_TREE_LOOKAHEAD + ";");
 
          for (int i = Token.MIN_USER_TYPE; i < v.size(); i++) {
              String s = (String)v.elementAt(i);
              if (s != null) {
                  if (s.startsWith("\"")) {
                      // a string literal
                      StringLiteralSymbol sl = (StringLiteralSymbol)tm.getTokenSymbol(s);
                      if (sl == null) {
View Full Code Here

        tabs++;

        // Enumerate all the valid token types
        Vector v = tm.getVocabulary();
        for (int i = Token.MIN_USER_TYPE; i < v.size(); i++) {
            String s = (String)v.elementAt(i);
            if (s != null) {
                println(s + " = " + i);
            }
        }
View Full Code Here

        tabs++;

        // Enumerate all the valid token types
        Vector v = tm.getVocabulary();
        for (int i = Token.MIN_USER_TYPE; i < v.size(); i++) {
            String s = (String)v.elementAt(i);
            if (s != null) {
                println(s + " = " + i);
            }
        }
View Full Code Here

    // Walk the token vocabulary and generate a Vector of strings
    // from the tokens.
    Vector v = grammar.tokenManager.getVocabulary();
    for (int i = 0; i < v.size(); i++)
    {
      String s = (String)v.elementAt(i);
      if (s == null)
      {
        s = "<"+String.valueOf(i)+">";
      }
      if ( !s.startsWith("\"") && !s.startsWith("<") ) {
View Full Code Here

    // Move the other special token to the end, so we can solve
    // the superfluous comma problem easily

    for (int i = Token.MIN_USER_TYPE; i < v.size(); i++) {
      String s = (String)v.elementAt(i);
      if (s != null) {
        if ( s.startsWith("\"") ) {
          // a string literal
          StringLiteralSymbol sl = (StringLiteralSymbol)tm.getTokenSymbol(s);
          if ( sl==null ) {
View Full Code Here

          // Walk the token vocabulary and generate code to register every TokenID->ASTNodeType
          // mapping specified in the  tokens {...} section with the ASTFactory.
      Vector v = g.tokenManager.getVocabulary();
      for (int i = 0; i < v.size(); i++) {
        String s = (String)v.elementAt(i);
        if (s != null) {
          TokenSymbol ts = g.tokenManager.getTokenSymbol(s);
          if (ts != null && ts.getASTNodeType() != null) {
            println("factory.setTokenTypeASTNodeType(" + s + ", \"" + ts.getASTNodeType() + "\");");
          }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.