Package org.antlr.codegen

Examples of org.antlr.codegen.ActionTranslatorLexer.translate()


    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


    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
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.