- Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
- Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ Free Software Foundation, Inc.
/* braceless is not to be used for rule or symbol actions, as it
calls code_props_plain_init. */
%type <chars> STRING "%{...%}" EPILOGUE braceless content.opt
/* braceless is not to be used for rule or symbol actions, as it
calls code_props_plain_init. */
%type <chars> STRING "%{...%}" EPILOGUE braceless content.opt
%printer { fputs (quotearg_style (c_quoting_style, $$), stderr); }
STRING
%printer { fprintf (stderr, "{\n%s\n}", $$); }
braceless content.opt "{...}" "%{...%}" EPILOGUE
%printer { fputs (quotearg_style (c_quoting_style, $$), stderr); }
STRING
%printer { fprintf (stderr, "{\n%s\n}", $$); }
braceless content.opt "{...}" "%{...%}" EPILOGUE
-%type <uniqstr> TAG ID ID_COLON BRACKETED_ID PERCENT_FLAG variable
-%type <named_ref> named_ref.opt
-%printer { fputs ($$, stderr); } ID variable
+%type <uniqstr> BRACKETED_ID ID ID_COLON PERCENT_FLAG TAG variable
+%printer { fputs ($$, stderr); } <uniqstr>
+%printer { fprintf (stderr, "[%s]", $$); } BRACKETED_ID
%printer { fprintf (stderr, "%s:", $$); } ID_COLON
%printer { fprintf (stderr, "%%%s", $$); } PERCENT_FLAG
%printer { fprintf (stderr, "<%s>", $$); } TAG
%type <integer> INT
%printer { fprintf (stderr, "%s:", $$); } ID_COLON
%printer { fprintf (stderr, "%%%s", $$); } PERCENT_FLAG
%printer { fprintf (stderr, "<%s>", $$); } TAG
%type <integer> INT
-%type <symbol> id id_colon symbol symbol.prec string_as_id
-%printer { fprintf (stderr, "%s", $$->tag); } id symbol string_as_id
+%type <symbol> id id_colon string_as_id symbol symbol.prec
+%printer { fprintf (stderr, "%s", $$->tag); } <symbol>
%printer { fprintf (stderr, "%s:", $$->tag); } id_colon
%type <assoc> precedence_declarator
%type <list> symbols.1 symbols.prec generic_symlist generic_symlist_item
%printer { fprintf (stderr, "%s:", $$->tag); } id_colon
%type <assoc> precedence_declarator
%type <list> symbols.1 symbols.prec generic_symlist generic_symlist_item
| rhs symbol named_ref.opt
{ grammar_current_rule_symbol_append ($2, @2, $3); }
| rhs "{...}" named_ref.opt
| rhs symbol named_ref.opt
{ grammar_current_rule_symbol_append ($2, @2, $3); }
| rhs "{...}" named_ref.opt
- { grammar_current_rule_action_append ($2, @2, $3); }
+ { grammar_current_rule_action_append ($2, @2, $3, false); }
+| rhs "%?{...}"
+ { grammar_current_rule_action_append ($2, @2, NULL, true); }
/*---------------------------.
| variable and content.opt. |
`---------------------------*/
/*---------------------------.
| variable and content.opt. |
`---------------------------*/
- char *p;
-
- /* Stop on last actual character. */
- for (p = decl; p[1]; p++)
- if ((p == decl
- || ! memchr (alphanum, p[-1], sizeof alphanum))
- && memchr (alphanum, p[0], sizeof alphanum - 10))
- name_start = p;
-
- /* Strip the surrounding '{' and '}', and any blanks just inside
- the braces. */
- while (*--p == ' ' || *p == '\t')
- continue;
- p[1] = '\0';
- while (*++decl == ' ' || *decl == '\t')
- continue;
+ {
+ char *p;
+ /* Stop on last actual character. */
+ for (p = decl; p[1]; p++)
+ if ((p == decl
+ || ! memchr (alphanum, p[-1], sizeof alphanum))
+ && memchr (alphanum, p[0], sizeof alphanum - 10))
+ name_start = p;
+
+ /* Strip the surrounding '{' and '}', and any blanks just inside
+ the braces. */
+ while (*--p == ' ' || *p == '\t')
+ continue;
+ p[1] = '\0';
+ while (*++decl == ' ' || *decl == '\t')
+ continue;
+ }