Examples of ActionTranslatorLexer


Examples of org.antlr.codegen.ActionTranslatorLexer

      "grammar t;\n"+
        "a : ids+=. ( ',' ids+=ID {"+action+"})* ;" +
        "ID : 'a';\n");
    Tool antlr = newTool();
    CodeGenerator generator = new CodeGenerator(antlr, g, "Java");
    ActionTranslatorLexer translator =
      new ActionTranslatorLexer(generator,
                    "a",
                    new antlr.CommonToken(ANTLRParser.ACTION,action),1);
    g.setCodeGenerator(generator);
    generator.genRecognizer(); // forces load of templates
    String rawTranslation =
      translator.translate();
    StringTemplateGroup templates =
      new StringTemplateGroup(".", AngleBracketTemplateLexer.class);
    StringTemplate actionST = new StringTemplate(templates, rawTranslation);
    String found = actionST.toString();
    assertEquals(expecting, found);
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.