X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/3e6656f9ab66ae7e629f8e5d5b41810bf070f09d..b1ae9233bc1ab111bbac4b427cc4397fa9ee0564:/src/parse-gram.y diff --git a/src/parse-gram.y b/src/parse-gram.y index 70356942..c10c82ac 100644 --- a/src/parse-gram.y +++ b/src/parse-gram.y @@ -75,7 +75,7 @@ do { \ static void yyprint (FILE *file, int type, const yystype *value); symbol_class current_class = unknown_sym; -char *current_type = 0; +struniq_t current_type = 0; symbol_t *current_lhs; location_t current_lhs_location; assoc_t current_assoc; @@ -157,8 +157,10 @@ braced_code_t current_braced_code = action_braced_code; %token BRACED_CODE "{...}" -%type TYPE STRING string_content - BRACED_CODE PROLOGUE EPILOGUE epilogue.opt action +%type STRING string_content + BRACED_CODE action + PROLOGUE EPILOGUE +%type TYPE %type INT %type ID symbol string_as_id %type precedence_declarator @@ -169,7 +171,6 @@ input: declarations "%%" grammar epilogue.opt { yycontrol->errcode = 0; - epilogue_set ($4, @4); } ; @@ -417,12 +418,10 @@ string_content: epilogue.opt: /* Nothing. */ - { - $$ = xstrdup (""); - } | "%%" EPILOGUE { - $$ = $2; + epilogue_augment ($2, @2); + scanner_last_string_free (); } ; @@ -463,6 +462,10 @@ yyprint (FILE *file, case EPILOGUE: fprintf (file, " = {{ %s }}", value->string); break; + + default: + fprintf (file, "unknown token type"); + break; } }