aboutsummaryrefslogtreecommitdiff
path: root/src/context.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/context.h150
1 files changed, 75 insertions, 75 deletions
diff --git a/src/context.h b/src/context.h
index 4eaeb25..8dc7527 100644
--- a/src/context.h
+++ b/src/context.h
@@ -14,86 +14,86 @@ class View;
14 14
15class Context 15class Context
16{ 16{
17 friend Bu::Formatter &operator<<( Bu::Formatter &f, const Context &c ); 17 friend Bu::Formatter &operator<<( Bu::Formatter &f, const Context &c );
18public: 18public:
19 Context(); 19 Context();
20 virtual ~Context(); 20 virtual ~Context();
21 21
22 void addTarget( Target *pTarget ); 22 void addTarget( Target *pTarget );
23 void addRule( Rule *pRule ); 23 void addRule( Rule *pRule );
24 void addFunction( Function *pFunction ); 24 void addFunction( Function *pFunction );
25 void addVariable( const Bu::String &sName, const Variable &vValue ); 25 void addVariable( const Bu::String &sName, const Variable &vValue );
26 void addAction( Action *pAction ); 26 void addAction( Action *pAction );
27 Action *getAction( const Bu::String &sName ); 27 Action *getAction( const Bu::String &sName );
28 28
29 void addTargetToTag( Target *pTarget, const Bu::String &sTag ); 29 void addTargetToTag( Target *pTarget, const Bu::String &sTag );
30 void addTargetToTags( Target *pTarget, const StrList &sTags ); 30 void addTargetToTags( Target *pTarget, const StrList &sTags );
31 TargetList &getTag( const Bu::String &sTag ); 31 TargetList &getTag( const Bu::String &sTag );
32 32
33 Variable &getVariable( const Bu::String &sName ); 33 Variable &getVariable( const Bu::String &sName );
34 void delVariable( const Bu::String &sName ); 34 void delVariable( const Bu::String &sName );
35 35
36 void pushScope(); 36 void pushScope();
37 void pushScope( const VarHash &hNewVars ); 37 void pushScope( const VarHash &hNewVars );
38 VarHash &getScope(); 38 VarHash &getScope();
39 void popScope(); 39 void popScope();
40 40
41 Variable call( const Bu::String &sName, Variable &input, VarList lParams ); 41 Variable call( const Bu::String &sName, Variable &input, VarList lParams );
42 42
43 Bu::String expand( const Bu::String &sIn ); 43 Bu::String expand( const Bu::String &sIn );
44 44
45 Target *getTarget( const Bu::String &sOutput ); 45 Target *getTarget( const Bu::String &sOutput );
46 TargetList getExplicitTargets(); 46 TargetList getExplicitTargets();
47 47
48 /** 48 /**
49 * This function actually builds the dependancy tree, and is responsible 49 * This function actually builds the dependancy tree, and is responsible
50 * for creating all of the auto-generated targets that are required by the 50 * for creating all of the auto-generated targets that are required by the
51 * explicitly created targets. 51 * explicitly created targets.
52 */ 52 */
53 void buildTargetTree( class Runner &r ); 53 void buildTargetTree( class Runner &r );
54 54
55 /** 55 /**
56 * This is done as a final step, it goes through all targets and 56 * This is done as a final step, it goes through all targets and
57 * attaches things that they should have even if they haven't defined them, 57 * attaches things that they should have even if they haven't defined them,
58 * like a clean profile, they'll get that even if they haven't added one of 58 * like a clean profile, they'll get that even if they haven't added one of
59 * their own. The defaults in this routine are added only if they aren't 59 * their own. The defaults in this routine are added only if they aren't
60 * already defined in the target. It should be excetued after 60 * already defined in the target. It should be excetued after
61 * buildTargetTree, which means it doesn't need to affect rules. 61 * buildTargetTree, which means it doesn't need to affect rules.
62 */ 62 */
63 void attachDefaults(); 63 void attachDefaults();
64 64
65 /** 65 /**
66 * This function generates some default actions if they don't already 66 * This function generates some default actions if they don't already
67 * exist, pretty straight forward, it will create all, clean, and default 67 * exist, pretty straight forward, it will create all, clean, and default
68 * (default is the same as all). 68 * (default is the same as all).
69 */ 69 */
70 void genDefaultActions(); 70 void genDefaultActions();
71 71
72 void writeTargetDot(); 72 void writeTargetDot();
73 73
74 void setView( View *pNewView ); 74 void setView( View *pNewView );
75 View *getView(); 75 View *getView();
76 76
77 void printBasicInfo(); 77 void printBasicInfo();
78 78
79private: 79private:
80 void buildTargetTree( class Runner &r, class Target *pTarget, const Bu::String &sInput, class Rule *pMaster, StrList &lNewIns ); 80 void buildTargetTree( class Runner &r, class Target *pTarget, const Bu::String &sInput, class Rule *pMaster, StrList &lNewIns );
81 81
82private: 82private:
83 typedef Bu::Hash<Bu::String, Target *> TargetHash; 83 typedef Bu::Hash<Bu::String, Target *> TargetHash;
84 typedef Bu::Hash<Bu::String, Rule *> RuleHash; 84 typedef Bu::Hash<Bu::String, Rule *> RuleHash;
85 typedef Bu::Hash<Bu::String, Function *> FunctionHash; 85 typedef Bu::Hash<Bu::String, Function *> FunctionHash;
86 typedef Bu::Hash<Bu::String, Action *> ActionHash; 86 typedef Bu::Hash<Bu::String, Action *> ActionHash;
87 typedef Bu::List<VarHash> ScopeStack; 87 typedef Bu::List<VarHash> ScopeStack;
88 typedef Bu::Hash<Bu::String, TargetList> TagHash; 88 typedef Bu::Hash<Bu::String, TargetList> TagHash;
89 89
90 TargetHash hTarget; 90 TargetHash hTarget;
91 RuleHash hRule; 91 RuleHash hRule;
92 FunctionHash hFunction; 92 FunctionHash hFunction;
93 ScopeStack sVars; 93 ScopeStack sVars;
94 ActionHash hAction; 94 ActionHash hAction;
95 TagHash hTag; 95 TagHash hTag;
96 View *pView; 96 View *pView;
97}; 97};
98 98
99Bu::Formatter &operator<<( Bu::Formatter &f, const Context &c ); 99Bu::Formatter &operator<<( Bu::Formatter &f, const Context &c );