Re: Force bison syntax error on string constant

2014-10-24 Thread Hans Aberg
> On 24 Oct 2014, at 15:10, Bob Rossi wrote: > > Hi, > > I have a rule like this, > > output: output_variant NEWLINE { >*gdbmi_output = $1; > }; > > output: error NEWLINE { >yyerrok; > }; > > output_variant: OPEN_PAREN variable CLOSED_PAREN { >$$ = gdbmi_output_alloc(); >

Re: Force bison syntax error on string constant

2014-10-24 Thread Martin Alexander Neumann
Hi Bob, use the macro YYERROR; It's documented here: https://www.gnu.org/software/bison/manual/html_node/GLR-Semantic-Actions.html#YYERROR Yours, Alex On 10/24/2014 03:10 PM, Bob Rossi wrote: > Hi, > > I have a rule like this, > > output: output_variant NEWLINE { > *gdbmi_output = $1; >

Force bison syntax error on string constant

2014-10-24 Thread Bob Rossi
Hi, I have a rule like this, output: output_variant NEWLINE { *gdbmi_output = $1; }; output: error NEWLINE { yyerrok; }; output_variant: OPEN_PAREN variable CLOSED_PAREN { $$ = gdbmi_output_alloc(); $$->kind = GDBMI_OUTPUT_PROMPT; free($2); } Where OPEN_PAREN is