From 113fc467a7170a8a564049c64d1036dd10e6abac Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Sun, 30 Jul 2006 09:07:20 +0000 Subject: It's starting to look pretty good, just trying to figure out how to get through everything that needs to be made modular and general. --- src/builder.h | 41 ++++++++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 9 deletions(-) (limited to 'src/builder.h') diff --git a/src/builder.h b/src/builder.h index e379608..58afaf5 100644 --- a/src/builder.h +++ b/src/builder.h @@ -2,35 +2,58 @@ #define BUILDER_H #include +#include +#include +#include "build.tab.h" +#include "exceptionbase.h" -union YYSTYPE; +subExceptionDecl( BuildException ) -namespace yy -{ - class location; - class BuildParser; -} class Builder; +class Action; +class Command; -#define YY_DECL int yylex( YYSTYPE *yylval_param, yy::location *yylloc, Builder &bld ) +#define YY_DECL int yylex( YYSTYPE *yylval_param, YYLTYPE *yylloc_param, Builder &bld ) YY_DECL; class Builder { + struct ltstr + { + bool operator()(const char* s1, const char* s2) const + { + return strcmp(s1, s2) < 0; + } + }; + public: Builder(); virtual ~Builder(); void load( const char *sFN ); - void error( const yy::location &l, const std::string &m ); - void error( const std::string &m ); + //void error( const yy::location &l, const std::string &m ); + //void error( const std::string &m ); std::string file; + void add( Action *pAct ); + void add( Command *pCmd ); + + bool hasDefaultAction() + { + return pDefaultAction != NULL; + } + + void debug(); + private: void scanBegin(); void scanEnd(); + + Action *pDefaultAction; + Action *pLastAddedAction; + std::map mAction; }; #endif -- cgit v1.2.3