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

Re: HTML and shift/reduce conflicts

> But the bad news is, I've got a ton of shift-reduce conflicts which I can't
> figure out how to resolve.  (Hopefully that's because I've been hacking
> JavaCC too long, and not because they are unresolvable in LALR(1)...)
> Here's the error msg you'll get when running SableCC on the grammar
> (provided below):

  I've been trying to turn the HTML grammar example distributed with JavaCC 
(RobsHTML developed by Rob Duncan) into a LALR(1) grammar to train with SableCC 
and i've had the same problems. One solution is to "flatten" the production 

  Once the shift/reduce conflicts solved i've had problems with reduce/reduce 
conflicts (i think they are due to the fact that <head>, </head>, <body>, and 
</body> are optional and that several tags (like <script>) might appear in both 
head and body; perhaps a solution would be to add {head} and {body} states). 
I've stopped this job because i am very busy right now.

  Have fun :-)

  -- Franck