help-bison
[Top][All Lists]
Advanced

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

Optional rule throws shift/reduce conflict


From: anandvn
Subject: Optional rule throws shift/reduce conflict
Date: Sun, 19 Sep 2010 03:10:33 -0700 (PDT)

Hi,

I'm new to bison and need help to acheive my following syntax,

syntax1: decl_spec semicolon

syntax2: decl_spec decl_attrib(optional) init_spec decl_attrib(optional)
semicolon


To achieve this i wrote bison grammar as,


declaration: decl_spec semicolon 
           |decl_spec decl_attrib init_spec decl_attrib semicolon


decl_attrib:  /* Since this is optional i kept blank rule */
           | '__attribute__'

But am getting shift/reduce conflicts. Also my grammar is not parsing the
input successfully, throws parser syntax error.

Please correct me where i did mistake. Also please let me know if any other
information required to fix this.

Thanks,
Anand V
-- 
View this message in context: 
http://old.nabble.com/Optional-rule-throws-shift-reduce-conflict-tp29751078p29751078.html
Sent from the Gnu - Bison - Help mailing list archive at Nabble.com.




reply via email to

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