Re: C comments
[email protected] (Damian Conway)
| Newsgroups | perl.recdescent |
|---|---|
| Message-ID | <[email protected]> |
Andrew asked:
> Since there is no separate lexer in recdescent. And it is top down. Is
> there anyway to deal w/ removing C comments that could be anywhere.
Sure. Treat them as whitespace!
Do something like this:
program: <skip: qr{\s* (/[*] .*? [*]/ \s*)*}x> statement(s)
statement: # etc...
Damian