[antlr-interest] newbie problems

Anders Hessellund anders.hessellund at gmail.com
Sat Jun 23 03:49:30 PDT 2007


Hi,

I am sorry about the newbie question but neither google nor this list seems
to have any obvious answers to my question :)

I have just started with antlr by defining this little grammar:

grammar Web;
>
> site    :    page+
>     ;
>
> page    :    'PAGE' ID
>     ;
>
> ID    :    LETTER+
>     ;
>
> TEXT    :    LETTER ( LETTER | WS )*
>     ;
>
> LETTER    :    'a'..'z'|'A'..'Z'
>     ;
>
> NEWLINE    :    '\r'? '\n'
>     ;
>
> WS    :    (' ' | '\t' | '\n' | '\r' )+ { skip(); }
>     ;


Then I generate my lexer and parser tools and feed them the follow input
file

PAGE helloWorld


I get the following strange error. Could someone please explain why??

line 0:-1 required (...)+ loop did not match anything at input '<EOF>'



-- Anders
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070623/ffb7f52d/attachment.html 


More information about the antlr-interest mailing list