Package antlr.collections.impl

Examples of antlr.collections.impl.IndexedVector


            this.superGrammarDelegate = antlrSuperGrammarGrammarMetadata == null ? null : new GrammarDelegate(
                    antlrSuperGrammarGrammarMetadata);

            Method getOptionsMethod = ANTLR_GRAMMAR_CLASS.getMethod("getOptions", NO_ARG_SIGNATURE);
            getOptionsMethod.setAccessible(true);
            IndexedVector options = (IndexedVector) getOptionsMethod.invoke(antlrGrammarMetadata, NO_ARGS);

            Method getRHSMethod = ANTLR_OPTION_CLASS.getMethod("getRHS", NO_ARG_SIGNATURE);
            getRHSMethod.setAccessible(true);

            final Object importVocabOption = options == null ? null : options.getElement("importVocab");
            this.importVocab = importVocabOption == null ? null : vocabName((String) getRHSMethod.invoke(
                    importVocabOption, NO_ARGS));

            final Object exportVocabOption = options == null ? null : options.getElement("exportVocab");
            this.exportVocab = exportVocabOption == null ? null : vocabName((String) getRHSMethod.invoke(
                    exportVocabOption, NO_ARGS));
        } catch (Throwable t) {
            throw new IllegalStateException("Error accessing  Antlr grammar metadata", t);
        }
View Full Code Here


    protected boolean expanded = false// any grammars expanded within?
  protected antlr.Tool tool;

    public GrammarFile(antlr.Tool tool, String f) {
        fileName = f;
        grammars = new IndexedVector();
        this.tool = tool;
    }
View Full Code Here

        this.antlrTool = tool;
    }

    public void addOption(Option o) {
        if (options == null) {  // if not already there, create it
            options = new IndexedVector();
        }
        options.appendElement(o.getName(), o);
    }
View Full Code Here

        // track whether a grammar file needed to have a grammar expanded
        GrammarFile gf = hier.getFile(getFileName());
        gf.setExpanded(true);

        // Copy rules from supergrammar into this grammar
        IndexedVector inhRules = superG.getRules();
        for (Enumeration e = inhRules.elements(); e.hasMoreElements();) {
            Rule r = (Rule)e.nextElement();
            inherit(r, superG);
        }

        // Copy options from supergrammar into this grammar
        // Modify tokdef options so that they point to dir of enclosing grammar
        IndexedVector inhOptions = superG.getOptions();
        if (inhOptions != null) {
            for (Enumeration e = inhOptions.elements(); e.hasMoreElements();) {
                Option o = (Option)e.nextElement();
                inherit(o, superG);
            }
        }
View Full Code Here

  ) throws RecognitionException, TokenStreamException {
   
    Token  hdr = null;
   
      Grammar gr;
      IndexedVector opt=null;
   
   
    try {      // for error handling
      {
      _loop265:
View Full Code Here

  }
 
  public final IndexedVector  optionSpec(
    Grammar gr
  ) throws RecognitionException, TokenStreamException {
    IndexedVector options;
   
    Token  op = null;
    Token  rhs = null;
   
      options = new IndexedVector();
   
   
    try {      // for error handling
      match(OPTIONS_START);
      {
      _loop280:
      do {
        if ((LA(1)==ID)) {
          op = LT(1);
          match(ID);
          rhs = LT(1);
          match(ASSIGN_RHS);
         
                  Option newOp = new Option(op.getText(),rhs.getText(),gr);
                  options.appendElement(newOp.getName(),newOp);
                  if ( gr!=null && op.getText().equals("importVocab") ) {
                    gr.specifiedVocabulary = true;
                    gr.importVocab = rhs.getText();
                  }
                  else if ( gr!=null && op.getText().equals("exportVocab") ) {
View Full Code Here

    Token  sup = null;
    Token  tk = null;
    Token  memberA = null;
   
      gr=null;
      IndexedVector rules = new IndexedVector(100);
      IndexedVector classOptions = null;
      String sc = null;
   
   
    try {      // for error handling
      {
View Full Code Here

    Token  arg = null;
    Token  ret = null;
    Token  init = null;
    Token  blk = null;
   
      IndexedVector o = null// options for rule
      String vis = null;
      boolean bang=false;
      String eg=null, thr="";
   
   
View Full Code Here

    protected boolean expanded = false// any grammars expanded within?
  protected antlr.Tool tool;

    public GrammarFile(antlr.Tool tool, String f) {
        fileName = f;
        grammars = new IndexedVector();
        this.tool = tool;
    }
View Full Code Here

        this.antlrTool = tool;
    }

    public void addOption(Option o) {
        if (options == null) {  // if not already there, create it
            options = new IndexedVector();
        }
        options.appendElement(o.getName(), o);
    }
View Full Code Here

TOP

Related Classes of antlr.collections.impl.IndexedVector

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.