Package persistence.antlr.collections.impl

Examples of persistence.antlr.collections.impl.Vector


    /**
     * IndexedVector constructor comment.
     */
    public IndexedVector() {
        elements = new Vector(10);
        index = new Hashtable(10);
    }
View Full Code Here


    /**
     * IndexedVector constructor comment.
     * @param size int
     */
    public IndexedVector(int size) {
        elements = new Vector(size);
        index = new Hashtable(size);
    }
View Full Code Here

       }
       else {
         // Must be the grammar file
         grammarFileName = incomingArgs[i];
         if (grammars == null) {
           grammars = new Vector(10);
         }
         grammars.appendElement(grammarFileName)// process it too
         if ((i + 1) < incomingArgs.length) {
           antlrTool.warning("grammar file must be last; ignoring other arguments...");
           break;
View Full Code Here

    Token t=null;
    Token t2=null;
   
      StringBuffer buf = new StringBuffer();
      int n=0;
      Vector terms = new Vector(10);
   
   
    _saveIndex=text.length();
    match('(');
    text.setLength(_saveIndex);
    {
    switch ( LA(1)) {
    case '\t'case '\n'case '\r'case ' ':
    {
      _saveIndex=text.length();
      mWS(false);
      text.setLength(_saveIndex);
      break;
    }
    case '"'case '#'case '('case 'A':
    case 'B'case 'C'case 'D'case 'E':
    case 'F'case 'G'case 'H'case 'I':
    case 'J'case 'K'case 'L'case 'M':
    case 'N'case 'O'case 'P'case 'Q':
    case 'R'case 'S'case 'T'case 'U':
    case 'V'case 'W'case 'X'case 'Y':
    case 'Z'case '['case '_'case 'a':
    case 'b'case 'c'case 'd'case 'e':
    case 'f'case 'g'case 'h'case 'i':
    case 'j'case 'k'case 'l'case 'm':
    case 'n'case 'o'case 'p'case 'q':
    case 'r'case 's'case 't'case 'u':
    case 'v'case 'w'case 'x'case 'y':
    case 'z':
    {
      break;
    }
    default:
    {
      throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
    }
    }
    }
    _saveIndex=text.length();
    mTREE_ELEMENT(true);
    text.setLength(_saveIndex);
    t=_returnToken;
   
          terms.appendElement(
            generator.processStringForASTConstructor(t.getText())
                       );
       
    {
    switch ( LA(1)) {
    case '\t'case '\n'case '\r'case ' ':
    {
      _saveIndex=text.length();
      mWS(false);
      text.setLength(_saveIndex);
      break;
    }
    case ')'case ',':
    {
      break;
    }
    default:
    {
      throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
    }
    }
    }
    {
    _loop649:
    do {
      if ((LA(1)==',')) {
        _saveIndex=text.length();
        match(',');
        text.setLength(_saveIndex);
        {
        switch ( LA(1)) {
        case '\t'case '\n'case '\r'case ' ':
        {
          _saveIndex=text.length();
          mWS(false);
          text.setLength(_saveIndex);
          break;
        }
        case '"'case '#'case '('case 'A':
        case 'B'case 'C'case 'D'case 'E':
        case 'F'case 'G'case 'H'case 'I':
        case 'J'case 'K'case 'L'case 'M':
        case 'N'case 'O'case 'P'case 'Q':
        case 'R'case 'S'case 'T'case 'U':
        case 'V'case 'W'case 'X'case 'Y':
        case 'Z'case '['case '_'case 'a':
        case 'b'case 'c'case 'd'case 'e':
        case 'f'case 'g'case 'h'case 'i':
        case 'j'case 'k'case 'l'case 'm':
        case 'n'case 'o'case 'p'case 'q':
        case 'r'case 's'case 't'case 'u':
        case 'v'case 'w'case 'x'case 'y':
        case 'z':
        {
          break;
        }
        default:
        {
          throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
        }
        }
        }
        _saveIndex=text.length();
        mTREE_ELEMENT(true);
        text.setLength(_saveIndex);
        t2=_returnToken;
       
                terms.appendElement(
                  generator.processStringForASTConstructor(t2.getText())
                              );
             
        {
        switch ( LA(1)) {
View Full Code Here

    /** Generate the lexer Java file */
    public void gen(LexerGrammar g) throws IOException {
        // If debugging, create a new sempred vector for this grammar
        if (g.debuggingOutput)
            semPreds = new Vector();

        setGrammar(g);
        if (!(grammar instanceof LexerGrammar)) {
            antlrTool.panic("Internal error generating lexer");
        }
View Full Code Here

    public void gen(ParserGrammar g) throws IOException {

        // if debugging, set up a new vector to keep track of sempred
        //   strings for this grammar
        if (g.debuggingOutput)
            semPreds = new Vector();

        setGrammar(g);
        if (!(grammar instanceof ParserGrammar)) {
            antlrTool.panic("Internal error generating parser");
        }
View Full Code Here

        println("public static final String[] _tokenNames = {");
        tabs++;

        // 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);
                if (ts != null && ts.getParaphrase() != null) {
                    s = StringUtils.stripFrontBack(ts.getParaphrase(), "\"", "\"");
                }
            }
            print(charFormatter.literalString(s));
            if (i != v.size() - 1) {
                _print(",");
            }
            _println("");
        }
View Full Code Here

    // if heterogeneous node known for that token T.
        tabs++;
    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

        // because they are all constants.
        println("public interface " + tm.getName() + TokenTypesFileSuffix + " {");
        tabs++;

        // Generate a definition for each token type
        Vector v = tm.getVocabulary();

        // 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

        // Header
        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

TOP

Related Classes of persistence.antlr.collections.impl.Vector

Copyright © 2018 www.massapicom. 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.