X-Git-Url: https://www.kengrimes.com/gitweb/?p=henge%2Fapc.git;a=blobdiff_plain;f=src%2Fparser.y;h=ff2d25715cd485b99183e1323a6a0e91b0e1e0d2;hp=2ff1638abab1281b232629ec566b6119df8263e6;hb=7896cfff4745b3999850dd301a296de71f7356eb;hpb=bd83074ab37f96455a2aff35c37ef6c3f07ebaec diff --git a/src/parser.y b/src/parser.y index 2ff1638..ff2d257 100644 --- a/src/parser.y +++ b/src/parser.y @@ -33,6 +33,7 @@ #define yyclassld(CS) (ir_classld_from_class(yyclass(CS))) } %define parse.error verbose +%define parse.lac full %define lr.type ielr %define api.pure full %define api.push-pull push @@ -137,7 +138,12 @@ void yyerror ( yycstate* cs, char const *s ) -{ fprintf(stderr, "%s\n", s); } +{ ir_class* iter; + for (iter = cs->class_stack; iter < cs->csp; iter++) + fprintf(stderr, "%s/", ir_class_name(*iter)); + fprintf(stderr, "\n\t"); + fprintf(stderr, "%s\n", s); +} yycstate* yycstate_new ( void ) @@ -155,7 +161,9 @@ yycstate* yycstate_new static inline ir_class yyclass_pop ( yycstate* cs ) -{ return *((cs->csp)--); } +{ cs->csp--; + return *(cs->csp + 1); +} static inline ir_class yyclass_push