negative matching using Smacc

Damien Pollet damien.pollet at gmail.com
Sat Dec 30 04:56:47 UTC 2006


Hi,

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>)* ;

but how do I define JunkLine to match anything BUT interesting lines?
-- 
Damien Pollet
type less, do more [ | ] http://typo.cdlm.fasmz.org



More information about the Squeak-dev mailing list