aboutsummaryrefslogtreecommitdiff
path: root/src/buildparser.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/buildparser.h')
-rw-r--r--src/buildparser.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/buildparser.h b/src/buildparser.h
new file mode 100644
index 0000000..8e2af6c
--- /dev/null
+++ b/src/buildparser.h
@@ -0,0 +1,40 @@
1#ifndef BUILD_PARSER_H
2#define BUILD_PARSER_H
3
4#include "build.tab.h"
5
6#include "bu/stack.h"
7#include "bu/fstring.h"
8#include "types.h"
9
10class BuildParser
11{
12public:
13 BuildParser( class Ast &rAst );
14 virtual ~BuildParser();
15
16 void load( const Bu::FString &sFile );
17
18 bool isKeyword( const Bu::FString &sStr );
19 bool isCond( const Bu::FString &sStr );
20 void include( const Bu::FString &sStr, void *scanner, YYLTYPE *loc );
21 void endInclude( YYLTYPE *loc );
22
23 void error( int iLine1, int iLine2, int iCol1, int iCol2,
24 const Bu::FString &sMsg );
25
26 class Ast &xAst;
27
28 void addIncludePath( const Bu::FString &sPath );
29
30private:
31 Bu::Stack<Bu::FString> sFilename;
32 Bu::Stack<YYLTYPE> sLocation;
33 StrList lIncludePaths;
34};
35
36typedef void * yyscan_t;
37#define YY_DECL int build_lex( YYSTYPE *yylval_param, YYLTYPE *yylloc_param, yyscan_t yyscanner, BuildParser &b )
38YY_DECL;
39
40#endif