Package org.antlr.runtime

Examples of org.antlr.runtime.CommonToken


    Tool antlr = newTool();
    CodeGenerator generator = new CodeGenerator(antlr, g, "Java");
    g.setCodeGenerator(generator);
    generator.genRecognizer(); // forces load of templates
    ActionTranslator translator = new ActionTranslator(generator,"a",
      new CommonToken(ANTLRParser.ACTION,action),1);
    String found = translator.translate();    assertEquals(expecting, found);

    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(); // forces load of templates
    ActionTranslator translator = new ActionTranslator(generator,"a",
      new CommonToken(ANTLRParser.ACTION,action),1);
    String found = translator.translate();
    assertEquals(expecting, found);

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

        "        ;");
    Tool antlr = newTool();
    CodeGenerator generator = new CodeGenerator(antlr, g, "Java");
    ActionTranslator translator = new ActionTranslator(generator,
      "a",
      new CommonToken(ANTLRParser.ACTION,action),1);
    String found = translator.translate();
    assertEquals(expecting, found);

    int expectedMsgID = ErrorManager.MSG_UNKNOWN_SIMPLE_ATTRIBUTE;
    Object expectedArg = "x";
View Full Code Here

    g.setCodeGenerator(generator);
    generator.genRecognizer(); // forces load of templates
    ActionTranslator translator =
      new ActionTranslator(generator,
        "b",
        new CommonToken(ANTLRParser.ACTION,action),1);
    String found =  translator.translate();
    assertEquals(expecting, found);

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

    g.setCodeGenerator(generator);
    generator.genRecognizer(); // forces load of templates
    ActionTranslator translator =
      new ActionTranslator(generator,
        "a",
        new CommonToken(ANTLRParser.ACTION,action),1);
    String found =  translator.translate();
    assertEquals(expecting, found);

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

    g.setCodeGenerator(generator);
    generator.genRecognizer(); // forces load of templates
    ActionTranslator translator =
      new ActionTranslator(generator,
        "b",
        new CommonToken(ANTLRParser.ACTION,action),1);
    String found = translator.translate();
    assertEquals(expecting, found);

    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(); // forces load of templates
    ActionTranslator translator = new ActionTranslator(generator,"a",
      new CommonToken(ANTLRParser.ACTION,action),1);
    String found = translator.translate();
    assertEquals(expecting, found);

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

    int i = 0;
    String action = action1;
    String expecting = expecting1;
    do {
      ActionTranslator translator = new ActionTranslator(generator,"rule1",
        new CommonToken(ANTLRParser.ACTION,action),i+1);
      String found = translator.translate();
      assertEquals(expecting, found);
      action = action2;
      expecting = expecting2;
    } while (i++ < 1);
View Full Code Here

        "        : {"+action+"}\n" +
        "        ;");
    Tool antlr = newTool();
    CodeGenerator generator = new CodeGenerator(antlr, g, "Java");
    ActionTranslator translator = new ActionTranslator(generator,"a",
      new CommonToken(ANTLRParser.ACTION,action),1);
    String found = translator.translate();
    assertEquals(expecting, found);

    int expectedMsgID = ErrorManager.MSG_UNKNOWN_SIMPLE_ATTRIBUTE;
    Object expectedArg = "x";
View Full Code Here

    Tool antlr = newTool();
    CodeGenerator generator = new CodeGenerator(antlr, g, "Java");
    g.setCodeGenerator(generator);
    generator.genRecognizer(); // forces load of templates
    ActionTranslator translator = new ActionTranslator(generator,"a",
      new CommonToken(ANTLRParser.ACTION,action),1);
    String found = translator.translate();
    assertEquals(expecting, found);

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

TOP

Related Classes of org.antlr.runtime.CommonToken

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.