diff options
author | Mike Buland <eichlan@xagasoft.com> | 2009-12-21 18:03:28 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2009-12-21 18:03:28 +0000 |
commit | 51e21a316be6e052251b3dfc7d671061ebd67cee (patch) | |
tree | 4b825dc642cb6eb9a060e54bf8d69288fbee4904 /src/build.y | |
parent | ad6f4dfcc671d3f8d458c42b0992956f2a2cf979 (diff) | |
download | build-51e21a316be6e052251b3dfc7d671061ebd67cee.tar.gz build-51e21a316be6e052251b3dfc7d671061ebd67cee.tar.bz2 build-51e21a316be6e052251b3dfc7d671061ebd67cee.tar.xz build-51e21a316be6e052251b3dfc7d671061ebd67cee.zip |
Removed the old trunk contents. About to load up m3
Diffstat (limited to '')
-rw-r--r-- | src/build.y | 278 |
1 files changed, 0 insertions, 278 deletions
diff --git a/src/build.y b/src/build.y deleted file mode 100644 index 55940e8..0000000 --- a/src/build.y +++ /dev/null | |||
@@ -1,278 +0,0 @@ | |||
1 | %defines | ||
2 | %{ | ||
3 | # include <string> | ||
4 | # include "buildparser.h" | ||
5 | # include "build.tab.h" | ||
6 | # include "action.h" | ||
7 | void yyerror( YYLTYPE *locp, BuildParser &bld, char const *msg ); | ||
8 | %} | ||
9 | |||
10 | %parse-param { BuildParser &bld } | ||
11 | %lex-param { BuildParser &bld } | ||
12 | %pure-parser | ||
13 | |||
14 | %locations | ||
15 | |||
16 | %debug | ||
17 | %error-verbose | ||
18 | %union { | ||
19 | char *strval; | ||
20 | } | ||
21 | |||
22 | %token <strval> STRING "string literal" | ||
23 | %token <strval> TARGETTYPE "target type" | ||
24 | %token <strval> FUNCTION "function name" | ||
25 | %token <strval> PERFORM "perform name" | ||
26 | |||
27 | %token TOK_ADDSET "+=" | ||
28 | %token TOK_DEFAULT "default" | ||
29 | %token TOK_ACTION "action" | ||
30 | %token TOK_CHECK "check" | ||
31 | %token TOK_CLEAN "clean" | ||
32 | %token TOK_RULE "rule" | ||
33 | %token TOK_TARGET "target" | ||
34 | %token TOK_SET "set" | ||
35 | %token TOK_INPUT "input" | ||
36 | %token TOK_FILTER "filter" | ||
37 | %token TOK_PREFIX "prefix" | ||
38 | %token TOK_REQUIRES "requires" | ||
39 | %token TOK_MATCHES "matches" | ||
40 | %token TOK_PERFORM "perform" | ||
41 | %token TOK_PRODUCES "produces" | ||
42 | %token TOK_AGGREGATE "aggregate" | ||
43 | %token TOK_GROUP "group" | ||
44 | |||
45 | %token ',' ':' '=' '(' ')' | ||
46 | |||
47 | %destructor { delete[] $$; } STRING FUNCTION | ||
48 | |||
49 | %% | ||
50 | |||
51 | // General input format | ||
52 | input: | ||
53 | | input rule | ||
54 | | input action | ||
55 | | input target | ||
56 | | input set | ||
57 | ; | ||
58 | |||
59 | // Rule interpretation | ||
60 | rule: TOK_RULE STRING ':' | ||
61 | { | ||
62 | bld.addRule( $2 ); | ||
63 | } | ||
64 | rulecmds | ||
65 | ; | ||
66 | |||
67 | rulecmds: rulecmd | ||
68 | | rulecmds ',' rulecmd | ||
69 | ; | ||
70 | |||
71 | rulecmd: TOK_MATCHES func | ||
72 | { | ||
73 | bld.addRuleMatches(); | ||
74 | } | ||
75 | | TOK_PRODUCES list | ||
76 | { | ||
77 | bld.addRuleProduces(); | ||
78 | } | ||
79 | | TOK_REQUIRES list | ||
80 | { | ||
81 | bld.addRuleRequires(); | ||
82 | } | ||
83 | | TOK_INPUT TOK_FILTER func | ||
84 | { | ||
85 | bld.addRuleInputFilter(); | ||
86 | } | ||
87 | | TOK_PERFORM perf | ||
88 | { | ||
89 | bld.addRulePerform(); | ||
90 | } | ||
91 | | TOK_AGGREGATE func | ||
92 | { | ||
93 | bld.setRuleAggregate(); | ||
94 | } | ||
95 | ; | ||
96 | |||
97 | // Action interpretation | ||
98 | action: TOK_DEFAULT TOK_ACTION ':' | ||
99 | { | ||
100 | bld.addAction(); | ||
101 | } | ||
102 | actioncmds | ||
103 | | STRING TOK_ACTION ':' | ||
104 | { | ||
105 | if( $1[0] == '\0' ) | ||
106 | bld.error( | ||
107 | &yylloc, | ||
108 | "You cannot use an empty string as the name of an action." | ||
109 | ); | ||
110 | bld.addAction( $1 ); | ||
111 | } | ||
112 | actioncmds | ||
113 | ; | ||
114 | |||
115 | actioncmds: actioncmd | ||
116 | | actioncmds ',' actioncmd | ||
117 | ; | ||
118 | |||
119 | actioncmd: TOK_CHECK list | ||
120 | { | ||
121 | bld.addCommand( Action::actCheck ); | ||
122 | } | ||
123 | | TOK_CLEAN list | ||
124 | { | ||
125 | bld.addCommand( Action::actClean ); | ||
126 | } | ||
127 | | TOK_CHECK TOK_GROUP STRING | ||
128 | { | ||
129 | bld.addGrpCommand( $3, Action::actCheck ); | ||
130 | } | ||
131 | | TOK_CLEAN TOK_GROUP STRING | ||
132 | { | ||
133 | bld.addGrpCommand( $3, Action::actClean ); | ||
134 | } | ||
135 | ; | ||
136 | |||
137 | // Target interpretation | ||
138 | target: list ':' | ||
139 | { | ||
140 | bld.newTarget(); | ||
141 | } | ||
142 | targetcmds | ||
143 | ; | ||
144 | |||
145 | targetcmds: targetcmd | ||
146 | | targetcmds ',' targetcmd | ||
147 | ; | ||
148 | |||
149 | targetcmd: TOK_RULE STRING | ||
150 | { | ||
151 | bld.setTargetRule( $2 ); | ||
152 | } | ||
153 | | TOK_TARGET TOK_PREFIX STRING | ||
154 | { | ||
155 | bld.setTargetPrefix( $3 ); | ||
156 | } | ||
157 | | TOK_TARGET TARGETTYPE | ||
158 | { | ||
159 | bld.setTargetType( $2 ); | ||
160 | } | ||
161 | | TOK_INPUT list | ||
162 | { | ||
163 | bld.addTargetInput(); | ||
164 | } | ||
165 | | TOK_REQUIRES list | ||
166 | { | ||
167 | bld.addTargetRequires(); | ||
168 | } | ||
169 | | TOK_SET targetset | ||
170 | | TOK_GROUP STRING | ||
171 | { | ||
172 | bld.addTargetGroup( $2 ); | ||
173 | } | ||
174 | ; | ||
175 | |||
176 | targetset: STRING '=' STRING | ||
177 | { | ||
178 | bld.addTargetSet( $1, $3, setSet ); | ||
179 | } | ||
180 | | STRING TOK_ADDSET STRING | ||
181 | { | ||
182 | bld.addTargetSet( $1, $3, setAdd ); | ||
183 | } | ||
184 | ; | ||
185 | |||
186 | // global set | ||
187 | set: TOK_SET setwhat | ||
188 | ; | ||
189 | |||
190 | setwhat: STRING '=' STRING | ||
191 | { | ||
192 | bld.addGlobalSet( $1, $3, setSet ); | ||
193 | } | ||
194 | | STRING TOK_ADDSET STRING | ||
195 | { | ||
196 | bld.addGlobalSet( $1, $3, setAdd ); | ||
197 | } | ||
198 | ; | ||
199 | |||
200 | // list goo | ||
201 | list: singlelistitem listfilter | ||
202 | | '[' | ||
203 | { | ||
204 | bld.newList(); | ||
205 | } | ||
206 | listitems ']' listfilter | ||
207 | ; | ||
208 | |||
209 | listfilter: | ||
210 | | TOK_FILTER func | ||
211 | { | ||
212 | bld.filterList(); | ||
213 | } | ||
214 | ; | ||
215 | |||
216 | listitems: listitem | ||
217 | | listitems ',' listitem | ||
218 | ; | ||
219 | |||
220 | listitem: STRING | ||
221 | { | ||
222 | bld.addListString( $1 ); | ||
223 | } | ||
224 | | func | ||
225 | { | ||
226 | bld.addListFunc(); | ||
227 | } | ||
228 | ; | ||
229 | |||
230 | singlelistitem: STRING | ||
231 | { | ||
232 | bld.newList(); | ||
233 | bld.addListString( $1 ); | ||
234 | } | ||
235 | | func | ||
236 | { | ||
237 | bld.newList(); | ||
238 | bld.addListFunc(); | ||
239 | } | ||
240 | ; | ||
241 | |||
242 | // Function | ||
243 | func: FUNCTION | ||
244 | { | ||
245 | bld.newFunctionCall( $1 ); | ||
246 | } | ||
247 | '(' funcparams ')' | ||
248 | ; | ||
249 | |||
250 | funcparams: | ||
251 | | STRING { bld.addFunctionParam( $1 ); } | ||
252 | | funcparams ',' STRING { bld.addFunctionParam( $3 ); } | ||
253 | ; | ||
254 | |||
255 | // Perform | ||
256 | perf: PERFORM | ||
257 | { | ||
258 | bld.newPerform( $1 ); | ||
259 | } | ||
260 | '(' perfparams ')' | ||
261 | ; | ||
262 | |||
263 | perfparams: | ||
264 | | STRING | ||
265 | { | ||
266 | bld.addPerformParam( $1 ); | ||
267 | } | ||
268 | | perfparams ',' STRING | ||
269 | { | ||
270 | bld.addPerformParam( $3 ); | ||
271 | } | ||
272 | ; | ||
273 | %% | ||
274 | |||
275 | void yyerror( YYLTYPE *locp, BuildParser &bld, char const *msg ) | ||
276 | { | ||
277 | bld.error( locp, msg ); | ||
278 | } | ||