I'm not sure how to do conditional code in the parser. I set your
recommend string to <chapverse> in the scanner and then tried this in
the parser.
BibleReference :
( "Genesis" | "Gn" | "Gen" ) [<chapverse>] { Transcript show: '[',
'1' asString, ']' } ;
But this results in a Shift/Reduce Conflict. What I'm trying to
accomplish is 'Gen 3' to be recognized as a bible reference and 'Gen
hello' as a string (not an error).
Brian.
On Feb 18, 2008 4:26 PM, Lukas Renggli <
[hidden email]> wrote:
> > <biblebook> : (Genesis | Gn | Gen | Exodus | Ex | Leviticus | Lv | Lev
> > | Nm | Num | Numbers | Dt | Deuteronomy) \.? \s+ \d+ (\: \d+ (-
> > \d+)?)? ;
>
> You should split that huge expression up. Preferably you just keep \.?
> \s+ \d+ (\: \d+ (-\d+)?)? as part of the scanner and move the rest
> into the parser as literal strings.
>
> This is a problem in Squeak because methods can only have a certain size.
>
> Lukas
>
> --
> Lukas Renggli
>
http://www.lukas-renggli.ch>
>