X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/f71db70bce0f70517928d2567da829d01a22b402..fcd32abd3a4b68ef525d7766dbed1c98465e23b9:/src/parse-gram.y diff --git a/src/parse-gram.y b/src/parse-gram.y index 3e208d1b..4d48d7ad 100644 --- a/src/parse-gram.y +++ b/src/parse-gram.y @@ -151,6 +151,7 @@ static char const *char_name (char); ; %token BRACED_CODE "{...}" +%token BRACKETED_ID "[identifier]" %token CHAR "char" %token EPILOGUE "epilogue" %token EQUAL "=" @@ -163,7 +164,6 @@ static char const *char_name (char); %token TAG "" %token TAG_ANY "<*>" %token TAG_NONE "<>" -%token BRACKETED_ID "[identifier]" %type CHAR %printer { fputs (char_name ($$), stderr); } CHAR @@ -177,22 +177,23 @@ static char const *char_name (char); %printer { fprintf (stderr, "{\n%s\n}", $$); } braceless content.opt "{...}" "%{...%}" EPILOGUE -%type TAG ID ID_COLON BRACKETED_ID PERCENT_FLAG variable -%type named_ref.opt -%printer { fputs ($$, stderr); } ID variable +%type BRACKETED_ID ID ID_COLON PERCENT_FLAG TAG variable +%printer { fputs ($$, stderr); } +%printer { fprintf (stderr, "[%s]", $$); } BRACKETED_ID %printer { fprintf (stderr, "%s:", $$); } ID_COLON %printer { fprintf (stderr, "%%%s", $$); } PERCENT_FLAG %printer { fprintf (stderr, "<%s>", $$); } TAG %type INT -%printer { fprintf (stderr, "%d", $$); } INT +%printer { fprintf (stderr, "%d", $$); } -%type id id_colon symbol symbol.prec string_as_id -%printer { fprintf (stderr, "%s", $$->tag); } id symbol string_as_id +%type id id_colon string_as_id symbol symbol.prec +%printer { fprintf (stderr, "%s", $$->tag); } %printer { fprintf (stderr, "%s:", $$->tag); } id_colon %type precedence_declarator %type symbols.1 symbols.prec generic_symlist generic_symlist_item +%type named_ref.opt /*---------. | %param. | @@ -236,6 +237,7 @@ static char const *char_name (char); CASE(parse, parse-param); CASE(both, param); #undef CASE + case param_none: aver (false); break; } } ;