On Sun, Jun 7, 2009 at 6:04 AM, Hans Aberg <hab...@math.su.se> wrote:
> On 6 Jun 2009, at 23:29, xelanoimis wrote: > > I'm updating my scripting language and I need some help from someone more >> experienced with bison who would like to have a look at my grammar. As it >> is >> now it works fine, but I just want to make sure I didn't do any bad things >> in there. Or if there's a way to "optimize" it, make the result smaller, >> faster, etc... >> > > You might inquiry the Usenet newsgroup comp.compilers. > > I have some "shift/reduce conflicts" and I wonder if I must fix them or >> just >> use the %expect option to silence the warning. >> > > Opinions differ, but not fixing could indicate grammar errors. Look into > the .output file for the parsing "." in the conflicting rules, and set token > precedences on the tokens immediately before and after. > > Also I wonder about reporting the parser error. I get the line number but >> it >> doesn't always say a suggestive message, like missing ';' or missing '}'. >> For example when I have an error in the top level it says: "parse error, >> expecting '$". I'm not sure where this came from and how can I get a >> better >> message. >> > > These are default messages that Bison generates. Better ones are on the > todo list. > > Hans You can use %error-verbose to get more detailed error message. Huang _______________________________________________ help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison