Examples of ParserTables


Examples of fri.patterns.interpreter.parsergenerator.ParserTables

  public static void main(String [] args)  {
    try  {
      File syntaxFile = new File("fri/patterns/interpreter/parsergenerator/syntax/builder/examples/SyntaxBuilder.syntax");
      Syntax syntax = new fri.patterns.interpreter.parsergenerator.syntax.builder.SyntaxBuilder(syntaxFile).getParserSyntax();
      fri.util.TimeStopper ts = new fri.util.TimeStopper();
      ParserTables parserTables = new SerializedTables().get(syntax, "SyntaxBuilder");
      System.err.println("ParserTables were built in "+ts.getTimeMillis()+" millis");
    }
    catch (Exception e)  {
      e.printStackTrace();
    }
View Full Code Here

Examples of fri.patterns.interpreter.parsergenerator.ParserTables

  {
    SyntaxSeparation separation = new SyntaxSeparation(new Syntax(syntax))// separate lexer and parser syntax
    LexerBuilder builder = new LexerBuilder(separation.getLexerSyntax(), separation.getIgnoredSymbols())// build a Lexer
    Lexer lexer = builder.getLexer();
    lexer.setInput("\tHello \r\n\tWorld\n")// give the lexer some very complex input :-)
    ParserTables parserTables = new SLRParserTables(separation.getParserSyntax());
    Parser parser = new Parser(parserTables);
    parser.parse(lexer, new PrintSemantic())// start parsing with a print-semantic
  }
View Full Code Here

Examples of net.sf.lapg.ParserTables

      }

      long start = System.currentTimeMillis();
      ProcessingStatusAdapter adapter = new ProcessingStatusAdapter(notifier, options.getDebug());
      LexerTables l = LexicalBuilder.compile(s.getLexems(), adapter);
      ParserTables r = Builder.compile(s, adapter);
      if(l == null || r == null) {
        return false;
      }
      long generationTime = System.currentTimeMillis() - start;
View Full Code Here

Examples of net.sf.lapg.ParserTables

    action();
    return createResult();
  }

  private ParserTables createResult() {
    ParserTables r = new ParserTables();
    r.sym = this.sym;
    r.rules = this.rules;
    r.nsyms = this.nsyms;
    r.nterms = this.nterms;
    r.nstates = this.nstates;
View Full Code Here

Examples of net.sf.lapg.ParserTables

public class InputTest extends LapgTestCase {

  private void checkGenTables(Grammar g, String outputId, TestNotifier er) {
    LexerTables lt = LexicalBuilder.compile(g.getLexems(), new ProcessingStatusAdapter(er, 0));
    ParserTables pt = Builder.compile(g, new ProcessingStatusAdapter(er, 0));

    StringBuffer sb = new StringBuffer();

    OutputUtils.printTables(sb, lt);
    OutputUtils.printTables(sb, pt);
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.