[aspectc-user] Modifying C++ code?

Gordon Schumacher gordon at rebit.com
Fri Oct 24 21:37:22 CEST 2008


Matthias Urban <matthias.urban at pure-systems.com> wrote:

> Value() is intended to return constant expression values, i.e. 
> expressions that can be calculated at compile time. That is not what you 
> want. The easiest way to copy the whole expression is as follows:
>
> void serialize(Puma::CTree* tree, std::ostream& os) {
>    Puma::Token* token = tree->token();
>    Puma::Token* end = tree->end_token();
>    while (token) {
>      os << token->text();
>      if (token == end) {
>        break;
>      }
>      token = token->unit()->next(token);
>    }
> }
>   

In the build I have here (1.0pre-3) the Puma::Token class does not have
a unit() function, nor does Puma::CUnit have a next() function. 
Puma::CObjectInfo has a NextObject(), and both Puma::List and
Puma::CScanBuffer have next() functions... I'm not quite sure how to
proceed here.  Other than that it looks to make sense to me :)

(One of my confusions has indeed been what the correct method is to
iterate through things!)



More information about the aspectc-user mailing list