SmaCC ?

Diego Fernandez diegof79 at gmail.com
Sat Jun 3 02:23:13 UTC 2006


Remove the token <anyLetter>, I think that it confuses the parser, ie:
HelloW --> o is a <anyLetter> or <lowerLetter>?.
SmaCC is not smart enough to see the difference. You can change it to:

Scanner:
<upperLetter>: [A-Z] ;
<lowerLetter> : [a-z_0-9] ;

Parser:
Test : <upperLetter>+ <lowerLetter>+ <upperLetter> AnyLetter+ ;

AnyLetter: <upperLetter>
    | <lowerLetter> ;


On 6/2/06, Keith Hodges <Keith.Hodges at warwick.ac.uk> wrote:
>
> Can anyone help me to work out why this is not working.
>
> Scanner:
>
> <anyLetter> : [A-Z a-z _ 0-9] ;
> <upperLetter>: [A-Z] ;
> <lowerLetter> : [a-z_0-9] ;
>
> Parser:
>
> Test : <upperLetter>+ <lowerLetter>+ <upperLetter> <anyLetter> ;
>
> Test String:
> HelloWorld
>
> I was expecting the parser to at least get past the 'o' in world.
>
> many thanks in advance
>
> Keith
>
> Send instant messages to your online friends http://uk.messenger.yahoo.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20060602/7e439bf4/attachment.htm


More information about the Squeak-dev mailing list