blob: 1d126dc5656b2071db27829a39d80d47040679c5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
|
#ifndef BUILDER_H
#define BUILDER_H
#include <stdint.h>
#include <string>
#include <list>
#include <utility>
#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<std::string> 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<std::string, Function *> BuildListItem;
typedef std::list<BuildListItem> 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<int, BuildList> ActionTmpCmd;
typedef std::list<ActionTmpCmd> ActionTmpCmdList;
typedef std::pair<std::string, ActionTmpCmdList> ActionTmp;
typedef std::list<ActionTmp> ActionTmpList;
ActionTmpList lActions;
public: // Debug
void debugDump();
};
#endif
|