diff options
author | Mike Buland <eichlan@xagasoft.com> | 2006-07-31 08:07:12 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2006-07-31 08:07:12 +0000 |
commit | 9139f1df4cda80b91ab68e5de27e85eaa4c54682 (patch) | |
tree | 87fadb2618ee8228f7184aa14bfa2b21741e3f49 /src/builder.h | |
parent | 113fc467a7170a8a564049c64d1036dd10e6abac (diff) | |
download | build-9139f1df4cda80b91ab68e5de27e85eaa4c54682.tar.gz build-9139f1df4cda80b91ab68e5de27e85eaa4c54682.tar.bz2 build-9139f1df4cda80b91ab68e5de27e85eaa4c54682.tar.xz build-9139f1df4cda80b91ab68e5de27e85eaa4c54682.zip |
I still can't get the pymake file to auto-make the bison and flex .c files, but
besides that everything is looking great. There's only one thing left to parse
and interpret before we can try actually building something.
Diffstat (limited to '')
-rw-r--r-- | src/builder.h | 46 |
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 | ||
10 | subExceptionDecl( BuildException ) | 11 | subExceptionDecl( BuildException ) |
11 | 12 | ||
12 | class Builder; | 13 | class Builder; |
13 | class Action; | 14 | class Action; |
14 | class Command; | 15 | class Command; |
16 | class Rule; | ||
17 | class 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 ) |
17 | YY_DECL; | 20 | YY_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 | |||
50 | private: | 80 | private: |
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 |