negative matching using Smacc

Damien Cassou damien.cassou at laposte.net
Sat Dec 30 10:01:22 UTC 2006


Damien Pollet a écrit :
> 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?

You should be able to define a priority between rules.



More information about the Squeak-dev mailing list