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

« back to all changes in this revision

Viewing changes to AspectC++/Introducer.h

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2008-04-10 17:40:52 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20080410174052-xdnsm7oi8hauyyf1
Tags: 1.0pre4~svn.20080409+dfsg-3
Fix another missing include, this time in Ag++/StdSystem.cc

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#include "Puma/ACIntroducer.h"
27
27
using namespace Puma;
28
28
 
 
29
#include <set>
 
30
using std::set;
 
31
#include <list>
 
32
using std::list;
 
33
#include <map>
 
34
using std::map;
 
35
 
29
36
namespace Puma {
30
37
  class CT_ClassDef;
 
38
  class CT_Program;
31
39
  class CCParser;
32
40
  class PreprocessorParser;
33
41
  class CClassInfo;
 
42
  class TokenProvider;
 
43
  class TokenStream;
34
44
}
35
45
 
 
46
class IncludeGraph;
36
47
class CodeWeaver;
37
48
class JPP_Class;
 
49
class JPL_Class;
38
50
class Plan;
 
51
class ModelBuilder;
39
52
 
40
53
class Introducer : public ACIntroducer {
 
54
  Plan &_plan;
41
55
  CodeWeaver &_code_weaver;
42
56
  CCParser &_parser;
43
 
  Plan &_plan;
 
57
  ModelBuilder &_jpm;
44
58
  int _intro_level;
45
59
  PreprocessorParser *_cpp;
46
 
  
 
60
  IncludeGraph &_ig;
 
61
  set<const Unit*> _included_aspect_headers;
 
62
  list<CTree*> _ah_trees;
 
63
  typedef map<CClassInfo*,JPL_Class*> TargetMap;
 
64
  TargetMap _targets;
 
65
  list<TokenProvider*> _token_providers;
 
66
  list<TokenStream*> _token_streams;
 
67
    
 
68
  // find a member that is/must be link-once (global) code
 
69
  static CObjectInfo *link_once_object (CClassInfo *ci);
 
70
 
 
71
  // check whether an object was introduced
 
72
  static bool is_intro (CObjectInfo *obj);
 
73
 
 
74
  // parse code that shall be introduced
 
75
  CTree *parse (list<Unit*> units, CTree *(CCSyntax::*rule)(),
 
76
    const char *expected_id, ErrorStream &err);
 
77
 
47
78
public:
48
79
  // Contructor: every Introducer knows the parser
49
 
  Introducer (CodeWeaver &cw, CCParser &p, Plan &pl) :
50
 
    _code_weaver (cw), _parser (p), _plan (pl), _intro_level (0), _cpp (0) {}
 
80
  Introducer (Plan &pl, CodeWeaver &cw, CCParser &p, ModelBuilder &jpm,
 
81
    IncludeGraph &ig) : _plan (pl), _code_weaver (cw), _parser (p), _jpm (jpm),
 
82
    _intro_level (0), _cpp (0), _ig (ig) {}
 
83
  
 
84
  // Destructor: release all allocated resources
 
85
  ~Introducer ();
51
86
  
52
87
  // called when a new class/union/struct/aspect is created, current scope
53
88
  // is the global scope
58
93
 
59
94
  // called when a new class/union/struct/aspect definition ends
60
95
  // (still in the class scope)
61
 
  virtual void class_end (CT_ClassDef*, CTree*);
 
96
  virtual void class_end (CT_ClassDef*);
62
97
  
 
98
  // called after the parser tried to parse a base clause
 
99
  virtual void base_clause_end (CT_ClassDef*, Token*);
 
100
 
 
101
  // called after the program has been parsed completely
 
102
  virtual void trans_unit_end (CT_Program *);
 
103
 
 
104
  // get the list of aspect header syntax trees
 
105
  list<CTree*> &ah_trees () { return _ah_trees; }
 
106
 
63
107
private:
64
108
 
65
109
  // check in the plan if the current class needs an introduction
66
110
  JPP_Class *plan_lookup (CClassInfo *ci);
67
111
 
 
112
  // create the weaving plan for a given class
 
113
  JPP_Class *create_plan (CClassInfo *ci);
 
114
  
68
115
  // manage the intro nesting level and the _cpp pointer
69
116
  void enter ();
70
117
  void leave ();
 
118
  
71
119
};
72
120
 
73
121
#endif /* __Introducer_h__ */