diff options
author | Mike Buland <eichlan@xagasoft.com> | 2006-08-22 15:12:20 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2006-08-22 15:12:20 +0000 |
commit | f5cf5725026ecb2fa63d729fb6745b4da15e69d8 (patch) | |
tree | af48e59cc29dcea1218221dbb6ed9f0cd7f19989 /src/builder.h | |
parent | ee98faf71642cf351d5cda241679b094aeec65ce (diff) | |
download | build-f5cf5725026ecb2fa63d729fb6745b4da15e69d8.tar.gz build-f5cf5725026ecb2fa63d729fb6745b4da15e69d8.tar.bz2 build-f5cf5725026ecb2fa63d729fb6745b4da15e69d8.tar.xz build-f5cf5725026ecb2fa63d729fb6745b4da15e69d8.zip |
Started on the crazy process of building the stage one compiled data. It's
going pretty quickly, we'll see how the targets go, they'll be the only tricky
part.
Diffstat (limited to '')
-rw-r--r-- | src/builder.h | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/builder.h b/src/builder.h index a6f88f4..1d126dc 100644 --- a/src/builder.h +++ b/src/builder.h | |||
@@ -3,6 +3,8 @@ | |||
3 | 3 | ||
4 | #include <stdint.h> | 4 | #include <stdint.h> |
5 | #include <string> | 5 | #include <string> |
6 | #include <list> | ||
7 | #include <utility> | ||
6 | #include "build.tab.h" | 8 | #include "build.tab.h" |
7 | #include "exceptions.h" | 9 | #include "exceptions.h" |
8 | 10 | ||
@@ -19,6 +21,8 @@ YY_DECL; | |||
19 | 21 | ||
20 | subExceptionDecl( BuildException ); | 22 | subExceptionDecl( BuildException ); |
21 | 23 | ||
24 | typedef std::list<std::string> StringList; | ||
25 | |||
22 | class Builder | 26 | class Builder |
23 | { | 27 | { |
24 | public: | 28 | public: |
@@ -30,7 +34,6 @@ public: | |||
30 | 34 | ||
31 | void load( const std::string &sFile ); | 35 | void load( const std::string &sFile ); |
32 | 36 | ||
33 | |||
34 | private: | 37 | private: |
35 | std::string file; | 38 | std::string file; |
36 | void scanBegin(); | 39 | void scanBegin(); |
@@ -66,10 +69,30 @@ public: // List functions | |||
66 | void addListString( const char *str ); | 69 | void addListString( const char *str ); |
67 | void addListFunc(); | 70 | void addListFunc(); |
68 | 71 | ||
72 | typedef std::pair<std::string, Function *> BuildListItem; | ||
73 | typedef std::list<BuildListItem> BuildList; | ||
74 | |||
75 | StringList buildToStringList( BuildList &lSrc, StringList &lIn ); | ||
76 | |||
77 | private: | ||
78 | BuildList lTmp; | ||
79 | |||
69 | public: // Functions for dealing with rules | 80 | public: // Functions for dealing with rules |
81 | |||
82 | public: // Functions for dealing with actions | ||
70 | void addAction(); | 83 | void addAction(); |
71 | void addAction( const char *sName ); | 84 | void addAction( const char *sName ); |
72 | void addCommand( int nType ); | 85 | void addCommand( int nType ); |
86 | |||
87 | private: // Action variables | ||
88 | typedef std::pair<int, BuildList> ActionTmpCmd; | ||
89 | typedef std::list<ActionTmpCmd> ActionTmpCmdList; | ||
90 | typedef std::pair<std::string, ActionTmpCmdList> ActionTmp; | ||
91 | typedef std::list<ActionTmp> ActionTmpList; | ||
92 | ActionTmpList lActions; | ||
93 | |||
94 | public: // Debug | ||
95 | void debugDump(); | ||
73 | }; | 96 | }; |
74 | 97 | ||
75 | #endif | 98 | #endif |