aboutsummaryrefslogtreecommitdiff
path: root/src/builder.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/builder.h')
-rw-r--r--src/builder.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/builder.h b/src/builder.h
index 58afaf5..89810c0 100644
--- a/src/builder.h
+++ b/src/builder.h
@@ -6,12 +6,15 @@
6#include <map> 6#include <map>
7#include "build.tab.h" 7#include "build.tab.h"
8#include "exceptionbase.h" 8#include "exceptionbase.h"
9#include "staticstring.h"
9 10
10subExceptionDecl( BuildException ) 11subExceptionDecl( BuildException )
11 12
12class Builder; 13class Builder;
13class Action; 14class Action;
14class Command; 15class Command;
16class Rule;
17class Target;
15 18
16#define YY_DECL int yylex( YYSTYPE *yylval_param, YYLTYPE *yylloc_param, Builder &bld ) 19#define YY_DECL int yylex( YYSTYPE *yylval_param, YYLTYPE *yylloc_param, Builder &bld )
17YY_DECL; 20YY_DECL;
@@ -39,6 +42,13 @@ public:
39 42
40 void add( Action *pAct ); 43 void add( Action *pAct );
41 void add( Command *pCmd ); 44 void add( Command *pCmd );
45 void add( Rule *pRule );
46 void add( Target *pTarg );
47 void varSet( const char *sName, const char *sValue );
48 void varAddSet( const char *sName, const char *sValue );
49 void requires( const char *sBase, const char *sReq );
50 void setContext( const char *sCont );
51 void setContext();
42 52
43 bool hasDefaultAction() 53 bool hasDefaultAction()
44 { 54 {
@@ -47,13 +57,49 @@ public:
47 57
48 void debug(); 58 void debug();
49 59
60 Rule *lastRule()
61 {
62 return pLastAddedRule;
63 }
64
65 Target *lastTarget()
66 {
67 return pLastAddedTarget;
68 }
69
70 void setTmp( const char *s )
71 {
72 sTmp = s;
73 }
74
75 const char *getTmp()
76 {
77 return sTmp;
78 }
79
50private: 80private:
81 void checkVar( const char *cont, const char *sName );
51 void scanBegin(); 82 void scanBegin();
52 void scanEnd(); 83 void scanEnd();
53 84
54 Action *pDefaultAction; 85 Action *pDefaultAction;
55 Action *pLastAddedAction; 86 Action *pLastAddedAction;
56 std::map<const char *, Action *, ltstr> mAction; 87 std::map<const char *, Action *, ltstr> mAction;
88
89 Rule *pLastAddedRule;
90 std::map<const char *, Rule *, ltstr> mRule;
91
92 Target *pLastAddedTarget;
93 std::map<const char *, Target *, ltstr> mTarget;
94
95 typedef std::map<std::string, std::string> varmap;
96 varmap mVar;
97 std::map<std::string, std::list<std::string> *> mRequires;
98
99 std::map<std::string, varmap> mContVar;
100 StaticString sContext;
101
102 StaticString sTmp;
57}; 103};
58 104
59#endif 105#endif