Package org.antlr.grammar.v3

Examples of org.antlr.grammar.v3.ANTLRParser


        "ID : 'a';\n");

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

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


    antlr.setOutputDirectory(null); // write to /dev/null
    CodeGenerator generator = new CodeGenerator(antlr, g, "Java");
    g.setCodeGenerator(generator);
    generator.genRecognizer();

    ActionTranslator translator = new ActionTranslator(generator,"a",
      new CommonToken(ANTLRParser.ACTION,action),1);
    String found = translator.translate();
    assertEquals(expecting, found);
  }
View Full Code Here

        "    ;\n");
    Tool antlr = newTool();
    CodeGenerator generator = new CodeGenerator(antlr, g, "Java");
    g.setCodeGenerator(generator);
    generator.genRecognizer(); // forces load of templates
    ActionTranslator translator = new ActionTranslator(generator,
      "field",
      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,
      "rule",
      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,
      "rule",
      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,
      "rule",
      new CommonToken(ANTLRParser.ACTION,action),1);
    String rawTranslation =
      translator.translate();

    int expectedMsgID = ErrorManager.MSG_WRITE_TO_READONLY_ATTR;
    Object expectedArg = "rule";
    Object expectedArg2 = "stop";
    GrammarSemanticsMessage expectedMessage =
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,
      "rule",
      new CommonToken(ANTLRParser.ACTION,action),1);
    String rawTranslation =
      translator.translate();

    int expectedMsgID = ErrorManager.MSG_WRITE_TO_READONLY_ATTR;
    ArrayList<Message> expectedErrors = new ArrayList<Message>(3);
    GrammarSemanticsMessage expectedMessage =
      new GrammarSemanticsMessage(expectedMsgID, g, null, "start", "");
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,
      "rule",
      new CommonToken(ANTLRParser.ACTION,action),1);
    String rawTranslation =
      translator.translate();

    int expectedMsgID = ErrorManager.MSG_WRITE_TO_READONLY_ATTR;
    Object expectedArg = "other";
    Object expectedArg2 = "tree";
    GrammarSemanticsMessage expectedMessage =
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,
      "rule",
      new CommonToken(ANTLRParser.ACTION,action),1);
    String rawTranslation =
      translator.translate();

    int expectedMsgID = ErrorManager.MSG_WRITE_TO_READONLY_ATTR;
    Object expectedArg = "ID";
    Object expectedArg2 = "text";
    GrammarSemanticsMessage expectedMessage =
View Full Code Here

    );
    Tool antlr = newTool();
    CodeGenerator generator = new CodeGenerator(antlr, g, "Java");
    g.setCodeGenerator(generator);
    generator.genRecognizer();
    ActionTranslator translator = new ActionTranslator(generator,
      "RULE",
      new CommonToken(ANTLRParser.ACTION,action),1);
    String found = translator.translate();
    assertEquals("unexpected errors: "+equeue, 0, equeue.errors.size());
    assertEquals(expecting, found);
  }
View Full Code Here

TOP

Related Classes of org.antlr.grammar.v3.ANTLRParser

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.