[aspectc-user] Modifying C++ code?

Matthias Urban matthias.urban at pure-systems.com
Sun Oct 26 18:06:43 CET 2008


Hi,

> 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 :)

That's true, these methods were added later. But that's no problem,
without these methods the code looks like this:

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 = (Puma::Token*)((Puma::Unit*)token->belonging_to())->next(token);
  }
}


-- 
Matthias Urban
Phone: +49-391-544569-32 Fax: +49-391-544569-90
-- 
pure-systems GmbH
Geschäftsführung: Danilo Beuche, Holger Papajewski
Sitz der Gesellschaft: Magdeburg
Registergericht: Amtsgericht Magdeburg, HRB 13044



More information about the aspectc-user mailing list