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

Fw: HTML and shift/reduce conflicts

Hi again.

After verifying the documentation that comes with SableCC, I agree that the
licensing terms could be confusing. In the next release, I will add a
specific notice at the top of all Public Domain files clearly stating that
they can be used without any restriction.

I've quickly looked at the HTML grammar. I have a couple of suggestions. I
would try a different approach. I would define more specific opening tags.
Here's the idea:

 h = ['h' + 'H'];  // case insensitive 'h'
 t = ['t' + 'T'];
 m = ['m' + 'M'];
 l = ['l' + 'L'];

 {normal->tag} b_html = '<'  blank*  h  t  m  l;  // e.g. '<html'
 {normal->tag} e_html = '<'  blank*  '/'  blank*  h  t  m  l; // e.g.
 {tag->normal} end_tag = '>';

(or something like that)

This would already solve many grammar problems... But the way, isn't there
any YACC grammar for HTML? It would help greatly. I just don't have time to
do all those searches on the Internet. I am working hard on my research and
on improvements in the "lexer states" implementation.

Have fun!