[antlr-interest] Lexer grammar in AntlrWorks 1.4.3

Daniela da Cruz danieladacruz at gmail.com
Thu Mar 1 11:13:43 PST 2012


Hi Stefan,

I have named the file that contains the lexer grammar as testRE.g. Exactly
as I do with combined grammars.
Are you able to run the file attached with success in AntlrWorks?

thanks
daniela

On Thu, Mar 1, 2012 at 18:47, Stefan Mätje <
Stefan.Maetje at esd-electronics.com> wrote:

> 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
>
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testRE.g
Type: application/octet-stream
Size: 95 bytes
Desc: not available
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20120301/5c19913d/attachment.obj 


More information about the antlr-interest mailing list