[antlr-interest] Ignoring tokens in AnTLR with Python

Daniel Hernandez Bahr dbahr at estudiantes.uci.cu
Tue Mar 9 07:04:16 PST 2010


Hello everyone,

I would just like to ask if there is a way of ignoring sections of input 
language. Something like:

i want to recognize these sentences only and ignore everything that 
doesn't look like them.

I tried:
sentence: macro | ~macro
but antlr gives me an error: unexpected token: macro (quite 
understandable i guess, since is not a token but a syntactic rule).

So, summing up: can i tell antlr i want to recognize some specific 
syntactic rules and ignore everyother single stuff that doesn't match?? 
Maybe something like disabling errors (not that i like this alternative 
very much).

Best regards,

Bahr.


More information about the antlr-interest mailing list