diff options
| author | Mike Buland <eichlan@xagasoft.com> | 2006-08-21 05:54:52 +0000 |
|---|---|---|
| committer | Mike Buland <eichlan@xagasoft.com> | 2006-08-21 05:54:52 +0000 |
| commit | 4887f62bea708f24e03b3f926f2698c60a94c807 (patch) | |
| tree | 77271e92cf517cbc2846897f7482c9df5efee124 /src/builder.h | |
| parent | df5286fe3bca619beb4771da1ffa8ace9613e9e5 (diff) | |
| download | build-4887f62bea708f24e03b3f926f2698c60a94c807.tar.gz build-4887f62bea708f24e03b3f926f2698c60a94c807.tar.bz2 build-4887f62bea708f24e03b3f926f2698c60a94c807.tar.xz build-4887f62bea708f24e03b3f926f2698c60a94c807.zip | |
Getting there, it compiles, now for the fun sophisticated pieces where the
builder itself tells the lexer which tokens are functions, and which are target
types.
Diffstat (limited to 'src/builder.h')
| -rw-r--r-- | src/builder.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/builder.h b/src/builder.h new file mode 100644 index 0000000..9c146ea --- /dev/null +++ b/src/builder.h | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | #ifndef BUILDER_H | ||
| 2 | #define BUILDER_H | ||
| 3 | |||
| 4 | #include <stdint.h> | ||
| 5 | #include <string> | ||
| 6 | #include "build.tab.h" | ||
| 7 | |||
| 8 | class Builder; | ||
| 9 | |||
| 10 | #define YY_DECL int yylex( YYSTYPE *yylval_param, YYLTYPE *yylloc_param, Builder &bld ) | ||
| 11 | YY_DECL; | ||
| 12 | |||
| 13 | class Builder | ||
| 14 | { | ||
| 15 | public: | ||
| 16 | Builder(); | ||
| 17 | virtual ~Builder(); | ||
| 18 | |||
| 19 | void error( YYLTYPE *locp, const char *msg ); | ||
| 20 | void error( const std::string &msg ); | ||
| 21 | |||
| 22 | void load( const std::string &sFile ); | ||
| 23 | |||
| 24 | private: | ||
| 25 | std::string file; | ||
| 26 | void scanBegin(); | ||
| 27 | void scanEnd(); | ||
| 28 | |||
| 29 | }; | ||
| 30 | |||
| 31 | #endif | ||
