Hi,
Could any one please help me in resolving the shift/reduce in the following
grammar?
%{
#include
extern char yytext[];
extern int column;
void yyerror(char const *s);
%}
%union
{
unsigned int tokVal;
unsigned char *tokValStr;
}
/* C operators */
%token STATIC CONST VOLATI
On 31 Jul 2010, at 15:54, anandvn wrote:
Could any one please help me in resolving the shift/reduce in the
following
grammar?
Have you tried applying precedences on the tokens immediately before
and after the "." in the conflicting states (as in the .output file)?
Hans
_
Hi!
Use the -v (verbose) flag on bison to generate the xxx.output file that
contains more information about the parser automaton (including where
the conflicts appear). Then please post it here.
You may also want to read the debugging section from:
info bison
Regards,
Panayiotis
On 07/
Hi Anand,
the problem is in your productions of "external_declaration".
Informally: Imagine the shift-reduce parser generated by bison sees one
of the following terminals as the next symbol in the input: STATIC,
CONST, VOLATILE, EXTERN, INT or UNSIGNED. The parser now can reduce the
init_dec rule,
Hi,
find the output file info below,
State 0 contains 6 shift/reduce conflicts.
State 7 contains 6 shift/reduce conflicts.
state 0
STATIC shift, and go to state 1
CONST shift, and go to state 2
VOLATILEshift, and go to state 3
EXTERN shift, and go to state 4
Hi Anand,
as I already mentioned, the problem is in your productions of
"external_declaration":
external_declaration
: function_definition
| declaration
;
probably the bext fix is to get rid of your init_dec non-terminal or you
change the above to something like:
externa