[Uml-devel] C++ Parser

Oliver Kellogg okellogg at users.sourceforge.net
Thu Apr 3 04:29:44 UTC 2008

On Thursday 03 April 2008 04:37, Jean Vittor wrote:
> [...]
> 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.

Sounds great.
One other idea that comes to mind is to give the user a possibility to
define certain preprocessor symbols similar to the -D switch in gcc.
(It may be that the C++ source code requires certain externally
supplied #define settings so that it is imported properly.)

> If nobody complains, I think I'm going to use std::string for the
> first step (instead of QString).

Sure, why not. In fact, while converting Uml::IDType from int to string
I found that std::string is a lot faster than QString (at least in Qt3),
therefore I also used std:string there.


More information about the umbrello-devel mailing list