Re: more ideas for the parser

Andras Mantia <[email protected]>
Newsgroups gmane.comp.kde.devel.quanta
Message-ID <[email protected]>
Hi  Jens,

 I'm trying to imagine what data structures would be the best, but I 
think I understand what you want.

> state. There are actions that will happen when the parser enters the
> state and others when the parser leaves a state. I am not sure yet if
> we really need both. There can be also more than one action that
> needs to be done at one time. E.g. emitting the tag name to the
> builder and clearing the tagname buffer.

I think we don't need the "exit action" from the state.

> Please have a look at kdevquanta/quantacore/parsers/comparator.cpp/.h
> This is my first attempt to hardcode the possible compare functions
> but make them configurable from a file. In the file you just write an
> id and when the parser reads the file it will translate the id into a
> pointer for the correct function. This function will get used to
> compare the incoming character and do something according to the
> result.

What I don't understand is how you find the id when you read the 
document?


> Looking into you file I think we are on the right track. Of course
> some things are missing, like namespace support.

I completely forgot about that.

> But I think we 
> should continue to write a diagram for our parsers. We could improve
> it even more if we clearly describe the in- and out-actions for each
> state.

So I will put it into the svn, so we can modify it.

> There is a problem with our special areas. The start of a special
> area can be in different states of the XML parser.

I'm not sure about this, but you may be right. Oh yes, you are right, a 
special area can start inside a tag as well. Yes, this will be trickier 
to implement.

> For a correct 
> result we need a kind of state-stack to remember where we want to
> return when the special area has ended. Actually I believe we have to
> make a solution that is on top of the XML parser and that takes over
> whenever a special area has started and returns to the XML parser in
> the state where it took over.

Yes, makes sense.

Andras
-- 
Quanta Plus developer - http://quanta.kdewebdev.org
K Desktop Environment - http://www.kde.org

_______________________________________________
quanta-devel mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/quanta-devel
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQBD1iQrTQdfac6L/08RAusZAJ9ZwglnNRMhuiAsJgn8kClUcGRcLACgyA4Q
IFqygZPVgBpFaIEBH14GdS4=
=Hs5F
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.