[Uml-devel] C++ Parser
jean.vittor at free.fr
Thu Apr 3 02:37:20 UTC 2008
-----BEGIN PGP SIGNED MESSAGE-----
After a look to the C++ parser, here is what I understood :
* the lexer preprocesses a copy of the input file and builds a
list of token ; the preprocessing consists in
o parsing included files,
o managing macro definitions / undefs and substitution,
* the parser analyses the token-list and builds a tree.
One of the problems of the current parser is that preprocessing does
not properly the macros substitution (the substitution is done by
changing the input string ; that makes it harder to fix).
What I would like to change :
* only operate transformations (instead of changing the input
string while parsing it) :
o preprocess the file (without copying it) => a preprocessed
string (which contain no include nor define / if / else /
o do the lexical analysis (current lexing without
preprocessing) => the token-list
o do the grammatical analysis (current parsing) => tree.
* use a boost::spirit grammar for the parsing.
If nobody complains, I think I'm going to use std::string for the
first step (instead of QString).
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the umbrello-devel