Package persistence.antlr.collections.impl

Examples of persistence.antlr.collections.impl.Vector


    /** Set all fields back like one just created */
    private void reset() {
        tabs = 0;
        // Allocate list of bitsets tagged for code generation
        bitsetsUsed = new Vector();
        currentOutput = null;
        grammar = null;
        DEBUG_CODE_GENERATOR = false;
        makeSwitchThreshold = DEFAULT_MAKE_SWITCH_THRESHOLD;
        bitsetTestThreshold = DEFAULT_BITSET_TEST_THRESHOLD;
View Full Code Here


     *  of the elements.
     */
    public static Vector parseSeparatedList(String list, char separator) {
        java.util.StringTokenizer st =
    new java.util.StringTokenizer(list, String.valueOf(separator));
        Vector v = new Vector(10);
        while ( st.hasMoreTokens() ) {
             v.appendElement(st.nextToken());
        }
        if (v.size() == 0) return null;
        return v;
    }
View Full Code Here

    String access;  // access specifier for this rule
    String comment;  // A javadoc comment if any.

    public RuleSymbol(String r) {
        super(r);
        references = new Vector();
    }
View Full Code Here

    // Turning this off will suppress stuff
    // like the if-then-else ambig.

    public AlternativeBlock(Grammar g) {
        super(g);
        alternatives = new Vector(5);
        this.not = false;
        nblks++;
        ID = nblks;
    }
View Full Code Here

        ID = nblks;
    }

    public AlternativeBlock(Grammar g, Token start, boolean not) {
        super(g, start);
        alternatives = new Vector(5);
//    this.line = start.getLine();
//    this.column = start.getColumn();
        this.not = not;
        nblks++;
        ID = nblks;
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 ':':
    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());
    }
    }
    }
    {
    _loop528:
    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 ':':
        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

        println("token identifiers.  Some tokens are literals, and because of that");
        println("they have no identifiers.  Literals are double-quoted.");
        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

    /** Construct a named rule. */
    public RuleBlock(Grammar g, String r) {
        super(g);
        ruleName = r;
        labeledElements = new Vector();
        cache = new Lookahead[g.maxk + 1];
        exceptionSpecs = new Hashtable();
        setAutoGen(g instanceof ParserGrammar);
    }
View Full Code Here

            }
            else {
                if (r.access.equals("public")) {
          Alternative alt = new Alternative(); // create alt we'll add to ref rule
          RuleBlock targetRuleBlock = r.getBlock();
          Vector targetRuleAlts = targetRuleBlock.getAlternatives();
          // collect a sem pred if only one alt and it's at the start;
          // simple, but faster to implement until real hoisting
          if ( targetRuleAlts!=null && targetRuleAlts.size()==1 ) {
            Alternative onlyAlt = (Alternative)targetRuleAlts.elementAt(0);
            if ( onlyAlt.semPred!=null ) {
              // ok, has sem pred, make this rule ref alt have a pred
              alt.semPred = onlyAlt.semPred;
              // REMOVE predicate from target rule???  NOPE, another
              // rule other than nextToken() might invoke it.
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.