[<<][meta][>>][..]
Sun Jun 28 20:04:45 CEST 2009
int f(int *);
box> (parse-program (open-input-string "int f(int *);"))
#f:1:11: parse: unexpected parenthesis (`)') in: C_PAREN
Time to read the grammar. It's funny: reading BNF to see at a glance
what's going on is a skill I've never mastered. Maybe because of its
extreme locality. Maybe there is a tool out there that can help one
view it using hyperlinks? Also, a BNF form annotated with examples
would be nice. This way the visual pattern-recognition can help.
In private/parser.ss I find this:
;; XXX: what about DeclarationSpecifiers AbstractDeclarator?
#;[(DeclarationSpecifiers !PushDeclarator AbstractDeclarator)
(build-parameter-declaration $1 $3 (@ 3))]
Which looks like it is the problem. Let's uncomment.
Ok, then it parses.. But i do get "1 shift/reduce conflict"..
Using one of the previous tests derived from forth.c I get the same
problem as before (after commenting out the line above):
box> (parse-program (open-input-file "test-1.c"))
car: expects argument of type <pair>; given ()
Crap.. It looks like there is no way around going into things a bit
deeper.
[1] http://www.open-std.org/JTC1/SC22/WG14/www/docs/n1256.pdf
[2] entry://../library/f0598571db600409ae2b7aefb43744dd
[Reply][About]
[<<][meta][>>][..]