help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Force bison syntax error on string constant


From: Bob Rossi
Subject: Force bison syntax error on string constant
Date: Fri, 24 Oct 2014 09:10:31 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

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 (, variable is [a-zA-Z]+ and CLOSED_PAREN is ).
I want ONLY "gdb" to be allowed in this variable context.

Is there a way to force the syntax error in the action in such a way
that bison then bubbles up the error into the above 'output' error rule?

Thanks,
Bob Rossi



reply via email to

[Prev in Thread] Current Thread [Next in Thread]