K
K
kacejot2017-06-15 16:58:57
HTML
kacejot, 2017-06-15 16:58:57

What pattern can you use when writing your own html page parser?

For a test project, you need to write a parser for html. But something tells me that while(!fstr.eof()) {...} is a bad idea.
I store the result of parsing in the DOM tree.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrei Smirnov, 2017-06-15
@kacejot

We'll have to separate the lexical analyzer and the parser. For the first one, you will take some kind of yacc, and for the second, use the visitor pattern. But then you just take webkit and regret not doing it right away.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question