Package org.antlr.stringtemplate

Examples of org.antlr.stringtemplate.StringTemplateGroup


    ActionTranslatorLexer translator = new ActionTranslatorLexer(generator,"a",
                                   new antlr.CommonToken(ANTLRParser.ACTION,action),0);
    String expecting = action;
    String rawTranslation =
      translator.translate();
    StringTemplateGroup templates =
      new StringTemplateGroup(".", AngleBracketTemplateLexer.class);
    StringTemplate actionST = new StringTemplate(templates, "<action>");
    actionST.setAttribute("action", rawTranslation);
    String found = actionST.toString();
    assertEquals(expecting, found);
  }
View Full Code Here


      new ActionTranslatorLexer(generator,
                    "a",
                    new antlr.CommonToken(ANTLRParser.ACTION,action),0);
    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

    generator.genRecognizer(); // forces load of templates
    ActionTranslatorLexer translator = new ActionTranslatorLexer(generator,"a",
                                   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(expecting, found);

    assertEquals("unexpected errors: "+equeue, 0, equeue.errors.size());
View Full Code Here

    generator.genRecognizer(); // forces load of templates
    ActionTranslatorLexer translator = new ActionTranslatorLexer(generator,"a",
                                   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(expecting, found);

    assertEquals("unexpected errors: "+equeue, 0, equeue.errors.size());
View Full Code Here

    generator.genRecognizer(); // forces load of templates
    ActionTranslatorLexer translator = new ActionTranslatorLexer(generator,"a",
                                   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(expecting, found);

    assertEquals("unexpected errors: "+equeue, 0, equeue.errors.size());
View Full Code Here

    ActionTranslatorLexer translator = new ActionTranslatorLexer(generator,
                                   "a",
                                   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(expecting, found);

    int expectedMsgID = ErrorManager.MSG_UNKNOWN_SIMPLE_ATTRIBUTE;
View Full Code Here

      new ActionTranslatorLexer(generator,
                    "b",
                    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(expecting, found);

    assertEquals("unexpected errors: "+equeue, 0, equeue.errors.size());
View Full Code Here

      new ActionTranslatorLexer(generator,
                    "b",
                    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(expecting, found);

    assertEquals("unexpected errors: "+equeue, 0, equeue.errors.size());
View Full Code Here

    generator.genRecognizer(); // forces load of templates
    ActionTranslatorLexer translator = new ActionTranslatorLexer(generator,"a",
                                   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(expecting, found);

    assertEquals("unexpected errors: "+equeue, 0, equeue.errors.size());
View Full Code Here

    do {
      ActionTranslatorLexer translator = new ActionTranslatorLexer(generator,"rule1",
                                     new antlr.CommonToken(ANTLRParser.ACTION,action),i+1);
      String rawTranslation =
          translator.translate();
      StringTemplateGroup templates =
          new StringTemplateGroup(".", AngleBracketTemplateLexer.class);
      StringTemplate actionST = new StringTemplate(templates, rawTranslation);
      String found = actionST.toString();
      assertEquals(expecting, found);
      action = action2;
      expecting = expecting2;
View Full Code Here

TOP

Related Classes of org.antlr.stringtemplate.StringTemplateGroup

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.