#ifndef BUILDER_H #define BUILDER_H #include #include #include #include #include "build.tab.h" #include "exceptions.h" class Builder; class Function; class FunctionFactory; class Perform; class PerformFactory; class Target; class TargetFactory; #define YY_DECL int yylex( YYSTYPE *yylval_param, YYLTYPE *yylloc_param, Builder &bld ) YY_DECL; subExceptionDecl( BuildException ); typedef std::list StringList; class Builder { public: Builder(); virtual ~Builder(); void error( YYLTYPE *locp, const char *msg ); void error( const std::string &msg ); void load( const std::string &sFile ); private: std::string file; void scanBegin(); void scanEnd(); public: // Target functions bool isTarget( const char *sType ); private: // Target variables Target *pTmpTarget; TargetFactory &fTarget; public: // Function functions bool isFunction( const char *sFunc ); void newFunctionCall( const char *sName ); void addFunctionParam( const char *sParam ); private: // Function variables Function *pTmpFunc; FunctionFactory &fFunction; public: // Perform functions bool isPerform( const char *sPerf ); void newPerform( const char *sName ); void addPerformParam( const char *sParam ); private: // Perform variables Perform *pTmpPerform; PerformFactory &fPerform; public: // List functions void newList(); void addListString( const char *str ); void addListFunc(); typedef std::pair BuildListItem; typedef std::list BuildList; StringList buildToStringList( BuildList &lSrc, StringList &lIn ); private: BuildList lTmp; public: // Functions for dealing with rules public: // Functions for dealing with actions void addAction(); void addAction( const char *sName ); void addCommand( int nType ); private: // Action variables typedef std::pair ActionTmpCmd; typedef std::list ActionTmpCmdList; typedef std::pair ActionTmp; typedef std::list ActionTmpList; ActionTmpList lActions; public: // Debug void debugDump(); }; #endif