Examples of ParseTable


Examples of org.allspice.parser.parsetable.ParseTable

 
      // Merge the LR0 states.
      items = createStates(inserted);
    }
   
    ParseTable pt = new ParseTable(items.get(startingLR0).state) ;
   
    for(LR1State st: items.values()) {
      pt.addState(st.state) ;
    }
   
    // Calculate action's and goto's
    for(Map.Entry<LR0State,LR1State> e:items.entrySet()) {
      LR1State st = e.getValue() ;
View Full Code Here

Examples of org.allspice.parser.parsetable.ParseTable

      new Rule("E"),
      new Rule("E","E","id")),
      new Tree23Map<String,AssocType>(),
      new Tree23Map<String,Integer>(),
      new Tree23Map<Rule,Integer>()) ;
    ParseTable table = ParserGenerator.createParseTable(g);
    return new AugmentedParseTableImpl(new DefaultTranslationMapper(),table) ;
  }
View Full Code Here

Examples of org.allspice.parser.parsetable.ParseTable

    } catch (InvalidStartRule e) {
      throw new RuntimeException(e) ;
    } catch (StrandedSymbol e) {
      throw new RuntimeException(e) ;
    }
    ParseTable pt;
    try {
      pt = ParserGenerator.createParseTable(g);
    } catch (StateConflict e) {
      throw new RuntimeException(e) ;
    }
View Full Code Here

Examples of org.allspice.parser.parsetable.ParseTable

    } catch (InvalidStartRule e) {
      throw new GrammarIsInvalid(e) ;
    } catch (StrandedSymbol e) {
      throw new GrammarIsInvalid(e) ;
    }
    ParseTable pt;
    try {
      pt = ParserGenerator.createParseTable(theGrammar) ;
    } catch (StateConflict e) {
      throw new GrammarIsInvalid(e) ;
    }
View Full Code Here

Examples of org.allspice.parser.parsetable.ParseTable

      throw new RuntimeException(e) ;
    } catch (StrandedSymbol e) {
      throw new RuntimeException(e) ;
    }

    ParseTable pt;
    try {
      pt = ParserGenerator.createParseTable(g);
    } catch (StateConflict e) {
      throw new RuntimeException(e) ;
    }
View Full Code Here

Examples of org.allspice.parser.parsetable.ParseTable

   * @throws StrandedSymbol
   * @throws InvalidStartRule
   *
   */
  public void test1() throws IOException, StateConflict, InvalidStartRule, StrandedSymbol {
    ParseTable table = createParseTable();
    ObjectOutputStream oos = new ObjectOutputStream(new ByteArrayOutputStream()) ;
    oos.writeObject(table) ;
  }
View Full Code Here

Examples of org.allspice.parser.parsetable.ParseTable

   * @throws StrandedSymbol
   * @throws InvalidStartRule
   */
  private ParseTable createParseTable() throws StateConflict, InvalidStartRule, StrandedSymbol {
    Grammar g = createGrammar();
    ParseTable table = ParserGenerator.createParseTable(g);
    return table;
  }
View Full Code Here

Examples of org.spoofax.jsglr.client.ParseTable

          f.makeAppl(f.makeConstructor("states", 1), f.makeList()),
          f.makeAppl(f.makeConstructor("priorities", 1),
                     f.makeList(f.makeAppl(f.makeConstructor("arg-gtr-prio", 3),
                                           f.makeInt(257), f.makeInt(1), f.makeInt(257))))); // XXX

    ParseTable pt = null;
    try {
      pt = new ParseTable(tbl, f);
    } catch (InvalidParseTableException e) {
      throw new RuntimeException(e);
    }

    Tokenizer tokenizer = new Tokenizer(" ", " ", new KeywordRecognizer(pt) {});
View Full Code Here

Examples of org.spoofax.jsglr.client.ParseTable

  }
 
  private IStrategoTerm parseCompletionTree(String input, String filename, Result result) throws IOException {
    //TODO fix: adapt to parsing with parseMax
    RetractableTreeBuilder treeBuilder = new RetractableTreeBuilder();
    ParseTable table;
    try {
      table = ATermCommands.parseTableManager.loadFromFile(result.getParseTable().getAbsolutePath());
    } catch (InvalidParseTableException e) {
      return null;
    }
View Full Code Here

Examples of org.spoofax.jsglr.client.ParseTable

    BufferedWriter writePrios = null;
    try {
      write = new BufferedWriter(new FileWriter(labs));
      writePrios = new BufferedWriter(new FileWriter(prios));
     
      ParseTable table = ATermCommands.parseTableManager.loadFromFile(file);

      List<Label> labels = table.getLabels();
      for (int i = 0; i < labels.size(); i++)
        if (labels.get(i) != null) {
          Label lab = labels.get(i);
          write.write(i + ":\t" + lab.getProduction() + "\n");

          for (Priority p : table.getPriorities(lab)) {
            String kind;
            switch (p.type) {
            case Priority.LEFT:
              kind = "left";
              break;
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.