[antlr-interest] My first antlr v3 parser

Ilia Kantor ilia at obnovlenie.ru
Fri Sep 1 04:24:11 PDT 2006


Trying to attach a parser to MainLexer using XML example.
However, antlr.Tool doesn't compile this;

------- grammar ----------------

parser grammar MainParser;

options {
    tokenVocab=MainLexer;
}

grammar : grammarDefinition (output | rule | formula)*


grammarDefinition: GRAMMAR ID DC;

output: OUTPUT ID BLOCK;
rule: RULE ID BLOCK;
formula: FORMULA ID BLOCK;

------------- output -----------------

ANTLR Parser Generator   Early Access Version 3.0b4 (??, 2006)  1989-2006
7:1: syntax error: antlr: parser.g:7:1: unexpected token: grammar
0:0: syntax error: assign.types: <AST>:0:0: unexpected end of subtree
0:0: syntax error: define: <AST>:0:0: unexpected end of subtree
0:0: syntax error: buildnfa: <AST>:0:0: unexpected end of subtree
0:0: syntax error: codegen: <AST>:0:0: unexpected end of subtree

---- BUG ? 
files null.java, null.tokens appear in working folder.












More information about the antlr-interest mailing list