[antlr-interest] Lexer grammar in AntlrWorks 1.4.3
Stefan Mätje
Stefan.Maetje at esd-electronics.com
Thu Mar 1 10:47:28 PST 2012
Hi,
it seems to me that you have either the lexer grammar not named properly or
perhaps not saved with the same name as it is given in your lexer grammar
("testRE") below.
AntlrWorks runs the compiler himself but has given the compiler the name
"null.java". The name string internal of AntlrWorks seemed to be a null
reference -> null+".java". I would have expected "testRE.java".
Same accounts for the error message of the compiler for __Test__.java. Id was
missing because of empty lexer name ...
Am 01.03.2012 16:08:59 schrieb(en) Daniela da Cruz:
> Hi.
>
> I have been creating a very simple lexer in AntlrWorks but when trying to
> run it I got the following errors:
>
> [15:01:29] javac: file not found:
> C:\Users\Utilizador\Desktop\output\null.java
Bad file name from null reference? ^^^^
> [15:01:29] Usage: javac <options> <source files>
> [15:01:29] use -help for a list of possible options
> [15:01:31] C:\Users\Utilizador\Desktop\output\__Test__.java:12:
> <identifier> expected
> [15:01:31] g = new (tokens, 49100, null);
> [15:01:31] ^
Missing lexer class ^^^^ name.
> [15:01:31] 1 error
>
> It seems that is looking for the parser file that usually exists on a
> combined grammar.
> Was anyone able to run a lexer grammar in AntlrWorks?
>
> My lexer was something like:
>
> ---------------------------------------------------
> lexer grammar testRE;
>
> ID: '0'..'9'+ ;
> ---------------------------------------------------
This worked for me in AntlrWorks 1.4.3
Regards,
Stefan
More information about the antlr-interest
mailing list