aboutsummaryrefslogtreecommitdiff
path: root/src/action.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/action.cpp')
-rw-r--r--src/action.cpp178
1 files changed, 89 insertions, 89 deletions
diff --git a/src/action.cpp b/src/action.cpp
index 1a2b8b1..e06fb45 100644
--- a/src/action.cpp
+++ b/src/action.cpp
@@ -6,127 +6,127 @@
6#include "variable.h" 6#include "variable.h"
7 7
8Action::Action( const class AstBranch *pRoot ) : 8Action::Action( const class AstBranch *pRoot ) :
9 pRoot( pRoot ), 9 pRoot( pRoot ),
10 pAst( NULL ) 10 pAst( NULL )
11{ 11{
12 sName = dynamic_cast<AstLeaf *>( 12 sName = dynamic_cast<AstLeaf *>(
13 *(*pRoot->getBranchBegin()).begin() 13 *(*pRoot->getBranchBegin()).begin()
14 )->getStrValue(); 14 )->getStrValue();
15} 15}
16 16
17Action::~Action() 17Action::~Action()
18{ 18{
19 delete pAst; 19 delete pAst;
20 pAst = NULL; 20 pAst = NULL;
21} 21}
22 22
23const Bu::String &Action::getName() const 23const Bu::String &Action::getName() const
24{ 24{
25 return sName; 25 return sName;
26} 26}
27 27
28void Action::call( class Runner *pRunner ) 28void Action::call( class Runner *pRunner )
29{ 29{
30 pRunner->run( (*(pRoot->getBranchBegin()+1)).begin() ); 30 pRunner->run( (*(pRoot->getBranchBegin()+1)).begin() );
31} 31}
32 32
33Action *Action::genDefaultAll() 33Action *Action::genDefaultAll()
34{ 34{
35 Ast *pAst = new Ast(); 35 Ast *pAst = new Ast();
36 pAst->addNode( AstNode::typeActionDef ); 36 pAst->addNode( AstNode::typeActionDef );
37 pAst->openBranch(); 37 pAst->openBranch();
38 pAst->addNode( AstNode::typeString, "all" ); 38 pAst->addNode( AstNode::typeString, "all" );
39 pAst->openBranch(); 39 pAst->openBranch();
40 pAst->addNode( AstNode::typeProcessTarget ); 40 pAst->addNode( AstNode::typeProcessTarget );
41 pAst->openBranch(); 41 pAst->openBranch();
42 pAst->addNode( AstNode::typeString, "build" ); 42 pAst->addNode( AstNode::typeString, "build" );
43 pAst->openBranch(); 43 pAst->openBranch();
44 pAst->addNode( AstNode::typeFunction ); 44 pAst->addNode( AstNode::typeFunction );
45 pAst->openBranch(); 45 pAst->openBranch();
46 pAst->addNode( AstNode::typeString, "targets" ); 46 pAst->addNode( AstNode::typeString, "targets" );
47 pAst->closeNode(); 47 pAst->closeNode();
48 pAst->closeNode(); 48 pAst->closeNode();
49 pAst->closeNode(); 49 pAst->closeNode();
50 Action *pRet = new Action( 50 Action *pRet = new Action(
51 dynamic_cast<const AstBranch *>( *pAst->getNodeBegin() ) 51 dynamic_cast<const AstBranch *>( *pAst->getNodeBegin() )
52 ); 52 );
53 pRet->pAst = pAst; 53 pRet->pAst = pAst;
54 54
55 return pRet; 55 return pRet;
56} 56}
57 57
58Action *Action::genDefaultClean() 58Action *Action::genDefaultClean()
59{ 59{
60 Ast *pAst = new Ast(); 60 Ast *pAst = new Ast();
61 pAst->addNode( AstNode::typeActionDef ); 61 pAst->addNode( AstNode::typeActionDef );
62 pAst->openBranch(); 62 pAst->openBranch();
63 pAst->addNode( AstNode::typeString, "clean" ); 63 pAst->addNode( AstNode::typeString, "clean" );
64 pAst->openBranch(); 64 pAst->openBranch();
65 pAst->addNode( AstNode::typeProcessTarget ); 65 pAst->addNode( AstNode::typeProcessTarget );
66 pAst->openBranch(); 66 pAst->openBranch();
67 pAst->addNode( AstNode::typeString, "clean" ); 67 pAst->addNode( AstNode::typeString, "clean" );
68 pAst->openBranch(); 68 pAst->openBranch();
69 pAst->addNode( AstNode::typeFunction ); 69 pAst->addNode( AstNode::typeFunction );
70 pAst->openBranch(); 70 pAst->openBranch();
71 pAst->addNode( AstNode::typeString, "targets" ); 71 pAst->addNode( AstNode::typeString, "targets" );
72 pAst->closeNode(); 72 pAst->closeNode();
73 pAst->closeNode(); 73 pAst->closeNode();
74 pAst->closeNode(); 74 pAst->closeNode();
75 Action *pRet = new Action( 75 Action *pRet = new Action(
76 dynamic_cast<const AstBranch *>( *pAst->getNodeBegin() ) 76 dynamic_cast<const AstBranch *>( *pAst->getNodeBegin() )
77 ); 77 );
78 pRet->pAst = pAst; 78 pRet->pAst = pAst;
79 79
80 return pRet; 80 return pRet;
81} 81}
82 82
83Action *Action::genDefaultCleanAll() 83Action *Action::genDefaultCleanAll()
84{ 84{
85 Ast *pAst = new Ast(); 85 Ast *pAst = new Ast();
86 pAst->addNode( AstNode::typeActionDef ); 86 pAst->addNode( AstNode::typeActionDef );
87 pAst->openBranch(); 87 pAst->openBranch();
88 pAst->addNode( AstNode::typeString, "clean-all" ); 88 pAst->addNode( AstNode::typeString, "clean-all" );
89 pAst->openBranch(); 89 pAst->openBranch();
90 pAst->addNode( AstNode::typeProcessTarget ); 90 pAst->addNode( AstNode::typeProcessTarget );
91 pAst->openBranch(); 91 pAst->openBranch();
92 pAst->addNode( AstNode::typeString, "clean" ); 92 pAst->addNode( AstNode::typeString, "clean" );
93 pAst->openBranch(); 93 pAst->openBranch();
94 pAst->addNode( AstNode::typeFunction ); 94 pAst->addNode( AstNode::typeFunction );
95 pAst->openBranch(); 95 pAst->openBranch();
96 pAst->addNode( AstNode::typeString, "targets" ); 96 pAst->addNode( AstNode::typeString, "targets" );
97 pAst->closeNode(); 97 pAst->closeNode();
98 pAst->closeNode(); 98 pAst->closeNode();
99 pAst->closeNode(); 99 pAst->closeNode();
100 Action *pRet = new Action( 100 Action *pRet = new Action(
101 dynamic_cast<const AstBranch *>( *pAst->getNodeBegin() ) 101 dynamic_cast<const AstBranch *>( *pAst->getNodeBegin() )
102 ); 102 );
103 pRet->pAst = pAst; 103 pRet->pAst = pAst;
104 104
105 return pRet; 105 return pRet;
106} 106}
107 107
108Action *Action::genDefaultDefault() 108Action *Action::genDefaultDefault()
109{ 109{
110 Ast *pAst = new Ast(); 110 Ast *pAst = new Ast();
111 pAst->addNode( AstNode::typeActionDef ); 111 pAst->addNode( AstNode::typeActionDef );
112 pAst->openBranch(); 112 pAst->openBranch();
113 pAst->addNode( AstNode::typeString, "default" ); 113 pAst->addNode( AstNode::typeString, "default" );
114 pAst->openBranch(); 114 pAst->openBranch();
115 pAst->addNode( AstNode::typeProcessTarget ); 115 pAst->addNode( AstNode::typeProcessTarget );
116 pAst->openBranch(); 116 pAst->openBranch();
117 pAst->addNode( AstNode::typeString, "build" ); 117 pAst->addNode( AstNode::typeString, "build" );
118 pAst->openBranch(); 118 pAst->openBranch();
119 pAst->addNode( AstNode::typeFunction ); 119 pAst->addNode( AstNode::typeFunction );
120 pAst->openBranch(); 120 pAst->openBranch();
121 pAst->addNode( AstNode::typeString, "targets" ); 121 pAst->addNode( AstNode::typeString, "targets" );
122 pAst->closeNode(); 122 pAst->closeNode();
123 pAst->closeNode(); 123 pAst->closeNode();
124 pAst->closeNode(); 124 pAst->closeNode();
125 Action *pRet = new Action( 125 Action *pRet = new Action(
126 dynamic_cast<const AstBranch *>( *pAst->getNodeBegin() ) 126 dynamic_cast<const AstBranch *>( *pAst->getNodeBegin() )
127 ); 127 );
128 pRet->pAst = pAst; 128 pRet->pAst = pAst;
129 129
130 return pRet; 130 return pRet;
131} 131}
132 132