Re: html and flex

mikee@cetasoft.cog (Mike Enright)
27 Jan 1999 12:19:24 -0500

          From comp.compilers

Related articles
html and flex (1999-01-25)
Re: html and flex rogerb@sco.COM (1999-01-27)
Re: html and flex mikee@cetasoft.cog (1999-01-27)
Re: html and flex (1999-02-03)
| List of all articles for this month |

From: mikee@cetasoft.cog (Mike Enright)
Newsgroups: comp.compilers
Date: 27 Jan 1999 12:19:24 -0500
Organization: CetaSoft (com not cog)
References: 99-01-093
Keywords: WWW, parse

On 25 Jan 1999 21:53:44 -0500, wrote:
>I've been playing with making a html window for a gui program of mine,
>and I have been playing with using flex to interpret the html tags.
>So far (not very far) it appears that I won't need yacc(bison) to be
>able to work with the tags that I want. Does anyone here have any
>experience suggestions or links that could help me out here? I'd
>especially like it if someone allready had some lex(flex) code to
>interpret the tags.

Many browsers (both browsers?) allow broken HTML to work. Therefore to
read those same pages, you will have to accept code that doesn't match
the specs, like <A HREF="somewhere.html> (missing quote within a tag)
or #include &ltstdio.h&gt; (missing semicolon after &lt). Maybe a
lexer can be written in lex that deals with such things. My feeling is
it would be a large grammar if it worked.

The situation with syntax is similar. You can read the document in a
recursive-descent fashion, but you have to gracefully handle a lot of
unexpected tags.

If you can control the quality of the HTML you have to display, the
job gets simpler.

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.