Package org.antlr.codegen

Examples of org.antlr.codegen.ActionTranslatorLexer


    );
    Tool antlr = newTool();
    CodeGenerator generator = new CodeGenerator(antlr, g, "Java");
    g.setCodeGenerator(generator);
    generator.genRecognizer();
    ActionTranslatorLexer translator = new ActionTranslatorLexer(generator,
                                   "RULE",
                                   new antlr.CommonToken(ANTLRParser.ACTION,action),1);
    String rawTranslation =
      translator.translate();
    StringTemplateGroup templates =
      new StringTemplateGroup(".", AngleBracketTemplateLexer.class);
    StringTemplate actionST = new StringTemplate(templates, rawTranslation);
    String found = actionST.toString();
    assertEquals("unexpected errors: "+equeue, 0, equeue.errors.size());
View Full Code Here


    );
    Tool antlr = newTool();
    CodeGenerator generator = new CodeGenerator(antlr, g, "Java");
    g.setCodeGenerator(generator);
    generator.genRecognizer();
    ActionTranslatorLexer translator = new ActionTranslatorLexer(generator,
                                   "twoIDs",
                                   new antlr.CommonToken(ANTLRParser.ACTION,action),1);
    String rawTranslation =
      translator.translate();
    // check that we didn't use scopeSetAttributeRef int translation!
    boolean foundScopeSetAttributeRef = false;
    for (int i = 0; i < translator.chunks.size(); i++) {
      Object chunk = translator.chunks.get(i);
      if (chunk instanceof StringTemplate) {
View Full Code Here

TOP

Related Classes of org.antlr.codegen.ActionTranslatorLexer

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.