Examples of LexerATNFactory


Examples of org.antlr.v4.automata.LexerATNFactory

    if ( g.ast!=null && !g.ast.hasErrors ) {
      SemanticPipeline sem = new SemanticPipeline(g);
      sem.process();

      ATNFactory factory = new ParserATNFactory(g);
      if (g.isLexer()) factory = new LexerATNFactory((LexerGrammar) g);
      g.atn = factory.createATN();

      CodeGenerator gen = new CodeGenerator(g);
      ST outputFileST = gen.generateParser();
View Full Code Here

Examples of org.antlr.v4.automata.LexerATNFactory

      semanticProcess(g);
      assertEquals(0, g.tool.getNumErrors());

      ParserATNFactory f;
      if ( g.isLexer() ) {
        f = new LexerATNFactory((LexerGrammar)g);
      }
      else {
        f = new ParserATNFactory(g);
      }
View Full Code Here

Examples of org.antlr.v4.automata.LexerATNFactory

    if ( g.ast!=null && !g.ast.hasErrors ) {
      SemanticPipeline sem = new SemanticPipeline(g);
      sem.process();

      ATNFactory factory = new ParserATNFactory(g);
      if ( g.isLexer() ) factory = new LexerATNFactory((LexerGrammar)g);
      g.atn = factory.createATN();

      CodeGenerator gen = new CodeGenerator(g);
      ST outputFileST = gen.generateParser();
      String output = outputFileST.render();
View Full Code Here

Examples of org.antlr.v4.automata.LexerATNFactory

    if ( errMgr.getNumErrors()>prevErrors ) return;

    // BUILD ATN FROM AST
    ATNFactory factory;
    if ( g.isLexer() ) factory = new LexerATNFactory((LexerGrammar)g);
    else factory = new ParserATNFactory(g);
    g.atn = factory.createATN();

    if ( generate_ATN_dot ) generateATNs(g);
View Full Code Here

Examples of org.antlr.v4.automata.LexerATNFactory

    if ( modeName==null ) modeName = "DEFAULT_MODE";
    if ( g.modes.get(modeName)==null ) {
      System.err.println("no such mode "+modeName);
      return;
    }
    ParserATNFactory f = new LexerATNFactory(g);
    ATN nfa = f.createATN();
    ATNState startState = nfa.modeNameToStartState.get(modeName);
    ATNPrinter serializer = new ATNPrinter(g, startState);
    String result = serializer.asString();
    //System.out.print(result);
    assertEquals(expecting, result);
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.