[webkit-dev] Grammer for html parsing
Shariq Rizvi
shariq at rizvi.org
Mon Feb 9 12:27:52 PST 2009
On Mon, Feb 9, 2009 at 12:23 PM, Nilesh Patil <vniles at gmail.com> wrote:
> Hi
>
> Yeah.... But still have a doubt. Doesn't it need to compare tags with
> what ever has come as response? i mean if some data comes then webkit
> must be identifying it in terms of HTML tags or other type of data. So
> is there no need of string comparison of actual HTML tags ?
>
It is the job of the tokenizer (HTMLTokenizer.cpp) to read the HTML "tags"
in the document and collect them into "tokens" (class Token). Once a Token
has been created, the tokenizer calls the parser (HTMLParser.cpp) to create
a DOM node and put it in the right place in the DOM tree.
Hence, the "string comparison" that you mention is going on inside the
tokenizer (during its reading of a tag to create a Token).
>
> THanks & Regards
> Niilesh
> On 2/9/09, Darin Adler <darin at apple.com> wrote:
> > On Feb 9, 2009, at 3:58 AM, Nilesh Patil wrote:
> >
> >> I need to know where does grammer for html Parser has been defined
> >> in webkit. Is it a string based comparison directly with tags or
> >> done any other way?
> >
> > The source files are HTMLTokenizer.cpp and HTMLParser.cpp. It doesn't
> > use a parser generator such as yacc or bison or a lexer generator such
> > as lex or flex, if that's what you're asking.
> >
> > -- Darin
> >
> >
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20090209/16417c41/attachment.html>
More information about the webkit-dev
mailing list