Package net.sf.lapg

Examples of net.sf.lapg.LexerTables


        genOptions.put(key, additional.get(key));
      }

      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


    int[][] stateChange = new int[states][];
    for (State s = first; s != null; s = s.next) {
      stateChange[s.number] = s.change;
    }

    return new LexerTables(states, characters, nterms, lnum, char2no, groupset, stateChange);
  }
View Full Code Here

      new TestLexem(1, 0, "number", "[0-9]+"),
      new TestLexem(2, 0, "empty", "()"),
  };

  public void testGenerator() {
    LexerTables lt = LexicalBuilder.compile(INPUT1, new ProcessingStatusAdapter(new TestNotifier(), 0));
    for(TestLexem tl : INPUT1) {
      for(String s : tl.getSamples()) {
        int res = nextToken(lt, s);
        Assert.assertEquals("For "+s+" Expected " + tl.getRegexp()+ ";",tl.index, res);
      }
View Full Code Here

import net.sf.lapg.test.oldparser.SyntaxUtilOld;

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);
View Full Code Here

TOP

Related Classes of net.sf.lapg.LexerTables

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.