more ideas for the parser
Jens Herden <[email protected]>
| Newsgroups | gmane.comp.kde.devel.quanta |
|---|---|
| Organization | http://www.kdewebdev.org |
| Message-ID | <[email protected]> |
Hi, our new parser should be implemented as a Finite State Machine. http://en.wikipedia.org/wiki/Finite_state_machine The configuration of the parser should be in external files, so that we can change the behavior of the parser at any time. The input events are the text stream character by character. We have to think about actions that can happen on state-in and state-out. It is probably possible to define a set of actions and hardcode them. The external configuration would refer to the internal coded action. Of course there are more flexible ways to implement this (plugins) but I fail to see where we need this yet. Some examples: - add the incoming character to an internal buffer - clear the internal buffer - call one of the builder functions to create the DOM tree We have to think about conditions for comparing the character that comes in. I immediately have this in mind: - compare with exactly one character - compare with a set of characters - check if the character fits in a class of characters, like whitespaces I have another one that I want to avoid whenever possible: - check if it match a regular expression I think the next steps would to try to start to define the states and transitions. I want to find a graphical tool for this, but the one I found did not compile. http://www.kde-apps.org/content/show.php?content=17578 Anyone a good idea what to use for this? Jens _______________________________________________ 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) iD8DBQBD0F1UkYmIVB8IV+ARAgR8AJ0f0yWoiPGaULjG0eoKVmV0Ge6ElACeOuFN b+HB+iXHXGh/uc1nLVf9BiU= =GuHD -----END PGP SIGNATURE-----