[Uml-devel] C++ Parser

Jean Vittor jean.vittor at free.fr
Thu Apr 3 02:37:20 UTC 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

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 /
            endif... directives),
          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).


Jean
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org

iD8DBQFH9ELgQ0w7PvnJLt4RAq0QAJ4rIrT7mIox/ZXYBp1Q+ys/PDsK7gCghDBj
reA2CDhoqrPZ3UEpWrrjR+8=
=ieKP
-----END PGP SIGNATURE-----





More information about the umbrello-devel mailing list