Re: Parse::RecDescent demo fails hello.c !?
[email protected] (Terrence Brannon) Sat, 11 Oct 2003 14:40:31 -0700
| Newsgroups | perl.recdescent |
|---|---|
| Message-ID | <[email protected]> |
Randal L. Schwartz wrote:
>kynn> Here's what I get:
>
>kynn> $ cat hello.c
>kynn> #include <stdio.h>
>
>kynn> main()
>kynn> {
>kynn> printf("Hello, world.\n");
>kynn> }
>
>And the answer you got there was "CPP is meta to C grammar, so the
>C grammar parser chokes on that". You need to preprocess your
>file, then feed the output of that to the C grammar.
>
>
But removing the #include still leads to a failed parse even though the
program is syntactically valid without it.