~ubuntu-branches/ubuntu/quantal/aspectc++/quantal

« back to all changes in this revision

Viewing changes to Puma/gen-release/step1/src/PreMacroExpander.cc

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2006-04-07 11:56:35 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20060407115635-e8wfgmetasrf2p27
Tags: 0.99+1.0pre3-1
* new upstream release
* Apply patch from Martin Michlmayr for g++-4.1 (Closes: #357901)
* further (simple) patches in Puma/ and AspectC++ for g++-4.1
* note that Puma needs to be rewoven so that it can be compiled
  with g++-4.1. This will be done we switch the default compiler
  version.
* Patch JoinPointRepo.cc so that it doesn't loop endlessly anymore.

Show diffs side-by-side

added added

removed removed

Lines of Context:
98
98
    _preexpander->reset (_parser, &macroStack, _prescanned);
99
99
    
100
100
    // Expand the macros and get an unit as result again.
101
 
    Unit *unit = _preexpander->expandMacros (arg);
 
101
    set<PreMacro*> unexpanded;
 
102
    Unit *unit = _preexpander->expandMacros (arg, &unexpanded);
102
103
 
103
104
    // all the tokens from this unit are prescanned. If one is a macro name
104
105
    // it is a self-referential macro that has to be put on the black list
105
106
    for (Token *t = (Token*)unit->first (); t; t = (Token*)unit->next (t))
106
 
      if (t->is_identifier () &&
107
 
          _macroManager->getMacro (t->text ())) {
108
 
        _prescanned->insert (t);
109
 
      }        
 
107
      if (t->is_identifier ()) {
 
108
        PreMacro *macro = _macroManager->getMacro (t->text ());
 
109
        if (macro && unexpanded.find (macro) == unexpanded.end ())
 
110
          _prescanned->insert (t);
 
111
      }
110
112
    
111
113
    // Ensure that the macros on the macro stack will not
112
114
    // be deleted.
118
120
 
119
121
 
120
122
// Expand all macros of the given unit.
121
 
Unit* PreMacroExpander::expandMacros (Unit* expandUnit)
 
123
Unit* PreMacroExpander::expandMacros (Unit* expandUnit,
 
124
                                      set<PreMacro *> *unexpanded)
122
125
 {    
123
126
    if (! expandUnit) return (Unit*) 0;
124
127
 
179
182
                        // Scan the next token.
180
183
                        continue;
181
184
                    }
 
185
                    else
 
186
                    {
 
187
                      if (unexpanded)
 
188
                        unexpanded->insert (macro);
 
189
                    }
182
190
                }
183
191
            }
184
192