Package antlr.collections.impl

Examples of antlr.collections.impl.Vector


    protected Vector handlers;


    public ExceptionSpec(Token label_) {
        label = label_;
        handlers = new Vector();
    }
View Full Code Here


    /** Walk the tree looking for all exact subtree matches.  Return
     *  an ASTEnumerator that lets the caller walk the list
     *  of subtree roots found herein.
     */
    public ASTEnumeration findAll(AST target) {
        Vector roots = new Vector(10);
        AST sibling;

        // the empty tree cannot result in an enumeration
        if (target == null) {
            return null;
View Full Code Here

    /** Walk the tree looking for all subtrees.  Return
     *  an ASTEnumerator that lets the caller walk the list
     *  of subtree roots found herein.
     */
    public ASTEnumeration findAllPartial(AST sub) {
        Vector roots = new Vector(10);
        AST sibling;

        // the empty tree cannot result in an enumeration
        if (sub == null) {
            return null;
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

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

    if( g.charVocabulary.size() > 256 )
      antlrTool.warning(g.getFilename()+": Vocabularies of this size still experimental in C++ mode (vocabulary size now: "+g.charVocabulary.size()+")");

    setGrammar(g);
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("// constructor creation turned of with 'noConstructor' option");
      println("#endif");
    }

    astTypes = new Vector();

    // Generate code for each rule in the grammar
    Enumeration ids = grammar.rules.elements();
    int ruleNum=0;
    while ( ids.hasMoreElements() ) {
View Full Code Here

      println("// constructor creation turned of with 'noConstructor' option");
      println("#endif");
    }
    println("");

    astTypes = new Vector();

    // Generate code for each rule in the grammar
    Enumeration ids = grammar.rules.elements();
    int ruleNum=0;
    String ruleNameInits = "";
View Full Code Here

TOP

Related Classes of 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.