negative matching using Smacc
Lukas Renggli
renggli at gmail.com
Sat Dec 30 08:02:25 UTC 2006
> I'm using SmaCC to parse a line-oriented file format. I'm only
> interested in some lines that begin with known keywords, and I want to
> ignore all other lines without knowing their format.
>
> At the moment I have a scanner rule like this:
> File : ((InterestingLine | JunkLine) <newline>)* ;
Have a look at Pier (or SmallWiki) they do line-based paring using SmaCC.
Also make sure that you are using a 3.9 image, because before there
were some bugs in Character that made it impossible to write a
line-based parser with SmaCC.
Cheers,
Lukas
--
Lukas Renggli
http://www.lukas-renggli.ch
More information about the Squeak-dev
mailing list
|