[antlr-interest] Combining a tree with the Parser
Jim Idle
jimi at temporal-wave.com
Tue Nov 25 08:24:41 PST 2008
On Tue, 2008-11-25 at 13:35 +0100, lists at krevsbech.dk wrote:
> Hey
> I am having a rather hard time figuring our how to let the tree find my
> parser.
> I use the ANTLR work and have tree files in the following way:
> FooLexer (lexer grammar FooLexer)
> FooParser (parser grammar FooParser)
> FooTree (tree grammar FooTree)
>
> In my parser I have:
> tokenVocab = FooLexer;
>
> In my tree I have:
> tokenVocab = FooParser;
>
> But here things goes wrong, when I use the ANTLR debugger on the Tree file
> it complains and gives the following output:
> error cannot read: "path"/FooParserLexer.java
> error cannot read: "path"/FooParserParser.java
>
> and no wonder it can't because the files are named FooLexer.java and
> FooParser.java
> Can anyone tell me what I have done wrong ?
Assuming that you are using the latest release of ANTLRWorks (check
that), check the following:
1) Is your ANTLRWorks working directory set to somewhere sensible, that
you can read and write to etc (general permissions);
2) Filenames are correct: FooLexer.g contains lexer grammar FooLexer;
FooParser.g contains parser grammar FooParser;
3) The generated java files are in the correct place.
4) You are debugging the tree grammar remotely (you cannot debug tree
grammars locally, at least not at the moment - generate with -debug, run
the program, connect the remote debugger to it);
If the suffixes Lexer and Parser are being appended, it implies that you
have 'grammar FooParser' rather than 'parser grammar FooParser'. Could
be a bug, but it is one I have never come across myself if it is. My
feeling is that you are are trying to debug the tree grammar locally.
Jim
>
> Kind regards and thanks
> Kasper Revsbech
>
>
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20081125/3b8c910c/attachment.html
More information about the antlr-interest
mailing list