diff options
Diffstat (limited to 'src/build.y')
-rw-r--r-- | src/build.y | 148 |
1 files changed, 74 insertions, 74 deletions
diff --git a/src/build.y b/src/build.y index 3e9c8fd..8cfc526 100644 --- a/src/build.y +++ b/src/build.y | |||
@@ -147,19 +147,19 @@ include: TOK_INCLUDE STRING ';' { bld.include( $2, yyscanner, &yylloc ); } | |||
147 | * data related | 147 | * data related |
148 | */ | 148 | */ |
149 | 149 | ||
150 | string: STRING { bld.xAst.addNode( AstNode::typeString, $1 ); } | 150 | string: STRING { bld.xAst.addNode( @1, AstNode::typeString, $1 ); } |
151 | ; | 151 | ; |
152 | 152 | ||
153 | int: INT { bld.xAst.addNode( AstNode::typeInt, $1 ); } | 153 | int: INT { bld.xAst.addNode( @1, AstNode::typeInt, $1 ); } |
154 | ; | 154 | ; |
155 | 155 | ||
156 | float: FLOAT { bld.xAst.addNode( AstNode::typeFloat, $1 ); } | 156 | float: FLOAT { bld.xAst.addNode( @1, AstNode::typeFloat, $1 ); } |
157 | ; | 157 | ; |
158 | 158 | ||
159 | bool: BOOL { bld.xAst.addNode( AstNode::typeBool, (bool)$1 ); } | 159 | bool: BOOL { bld.xAst.addNode( @1, AstNode::typeBool, (bool)$1 ); } |
160 | ; | 160 | ; |
161 | 161 | ||
162 | null: TOK_NULL { bld.xAst.addNode( AstNode::typeNull ); } | 162 | null: TOK_NULL { bld.xAst.addNode( @1, AstNode::typeNull ); } |
163 | 163 | ||
164 | literal: string | 164 | literal: string |
165 | | int | 165 | | int |
@@ -168,7 +168,7 @@ literal: string | |||
168 | | null | 168 | | null |
169 | ; | 169 | ; |
170 | 170 | ||
171 | variable: UNDEF /*VARIABLE*/ { bld.xAst.addNode( AstNode::typeVariable, $1 ); } | 171 | variable: UNDEF { bld.xAst.addNode( @1, AstNode::typeVariable, $1 ); } |
172 | 172 | ||
173 | list_core: | 173 | list_core: |
174 | | { bld.xAst.openBranch(); } expr | 174 | | { bld.xAst.openBranch(); } expr |
@@ -176,7 +176,7 @@ list_core: | |||
176 | ; | 176 | ; |
177 | 177 | ||
178 | list: '[' { | 178 | list: '[' { |
179 | bld.xAst.addNode( AstNode::typeList ); | 179 | bld.xAst.addNode( @1, AstNode::typeList ); |
180 | } list_core ']' { | 180 | } list_core ']' { |
181 | bld.xAst.closeNode(); | 181 | bld.xAst.closeNode(); |
182 | } | 182 | } |
@@ -199,9 +199,9 @@ value: value_core value_mods | |||
199 | * misc global things | 199 | * misc global things |
200 | */ | 200 | */ |
201 | 201 | ||
202 | notify: TOK_ERROR STRING ';' { bld.xAst.addNode( AstNode::typeError, $2 ); } | 202 | notify: TOK_ERROR STRING ';' { bld.xAst.addNode( @$,AstNode::typeError, $2 ); } |
203 | | TOK_WARNING STRING ';' { bld.xAst.addNode( AstNode::typeWarning, $2 ); } | 203 | | TOK_WARNING STRING ';' { bld.xAst.addNode( @$, AstNode::typeWarning, $2 ); } |
204 | | TOK_NOTICE STRING ';' { bld.xAst.addNode( AstNode::typeNotice, $2 ); } | 204 | | TOK_NOTICE STRING ';' { bld.xAst.addNode( @$, AstNode::typeNotice, $2 ); } |
205 | ; | 205 | ; |
206 | /* | 206 | /* |
207 | set_rhs: '=' { bld.xAst.addNode( AstNode::typeOpEq ); } value | 207 | set_rhs: '=' { bld.xAst.addNode( AstNode::typeOpEq ); } value |
@@ -218,7 +218,7 @@ set: TOK_SET { | |||
218 | ;*/ | 218 | ;*/ |
219 | 219 | ||
220 | unset: TOK_UNSET { | 220 | unset: TOK_UNSET { |
221 | bld.xAst.addNode( AstNode::typeUnset ); | 221 | bld.xAst.addNode( @1, AstNode::typeUnset ); |
222 | bld.xAst.openBranch(); | 222 | bld.xAst.openBranch(); |
223 | } variable ';' { | 223 | } variable ';' { |
224 | bld.xAst.closeNode(); | 224 | bld.xAst.closeNode(); |
@@ -230,7 +230,7 @@ export_rhs: '=' value | |||
230 | ; | 230 | ; |
231 | 231 | ||
232 | export: TOK_EXPORT { | 232 | export: TOK_EXPORT { |
233 | bld.xAst.addNode( AstNode::typeExport ); | 233 | bld.xAst.addNode( @1, AstNode::typeExport ); |
234 | bld.xAst.openBranch(); | 234 | bld.xAst.openBranch(); |
235 | } variable export_rhs ';' { | 235 | } variable export_rhs ';' { |
236 | bld.xAst.closeNode(); | 236 | bld.xAst.closeNode(); |
@@ -246,37 +246,37 @@ func_param_list: { bld.xAst.openBranch(); } value | |||
246 | ; | 246 | ; |
247 | 247 | ||
248 | function: UNDEF '(' { | 248 | function: UNDEF '(' { |
249 | bld.xAst.addNode( AstNode::typeFunction ); | 249 | bld.xAst.addNode( @$, AstNode::typeFunction ); |
250 | bld.xAst.openBranch(); | 250 | bld.xAst.openBranch(); |
251 | bld.xAst.addNode( AstNode::typeString, $1 ); | 251 | bld.xAst.addNode( @$, AstNode::typeString, $1 ); |
252 | } func_params ')' { | 252 | } func_params ')' { |
253 | bld.xAst.closeNode(); | 253 | bld.xAst.closeNode(); |
254 | } | 254 | } |
255 | ; | 255 | ; |
256 | 256 | ||
257 | function_no_input: UNDEF '(' { | 257 | function_no_input: UNDEF '(' { |
258 | bld.xAst.addNode( AstNode::typeNull ); | 258 | bld.xAst.addNode( @$, AstNode::typeNull ); |
259 | bld.xAst.addNode( AstNode::typeFunction ); | 259 | bld.xAst.addNode( @$, AstNode::typeFunction ); |
260 | bld.xAst.openBranch(); | 260 | bld.xAst.openBranch(); |
261 | bld.xAst.addNode( AstNode::typeString, $1 ); | 261 | bld.xAst.addNode( @$, AstNode::typeString, $1 ); |
262 | } func_params ')' { | 262 | } func_params ')' { |
263 | bld.xAst.closeNode(); | 263 | bld.xAst.closeNode(); |
264 | } | 264 | } |
265 | ; | 265 | ; |
266 | 266 | ||
267 | requires: TOK_REQUIRES { | 267 | requires: TOK_REQUIRES { |
268 | bld.xAst.addNode( AstNode::typeRequires ); | 268 | bld.xAst.addNode( @$, AstNode::typeRequires ); |
269 | bld.xAst.openBranch(); | 269 | bld.xAst.openBranch(); |
270 | } value ';' { | 270 | } value ';' { |
271 | bld.xAst.closeNode(); | 271 | bld.xAst.closeNode(); |
272 | } | 272 | } |
273 | ; | 273 | ; |
274 | 274 | ||
275 | type: TOK_STRING { bld.xAst.addNode( AstNode::typeTypeString ); } | 275 | type: TOK_STRING { bld.xAst.addNode( @1, AstNode::typeTypeString ); } |
276 | | TOK_INT { bld.xAst.addNode( AstNode::typeTypeInt ); } | 276 | | TOK_INT { bld.xAst.addNode( @1, AstNode::typeTypeInt ); } |
277 | | TOK_FLOAT { bld.xAst.addNode( AstNode::typeTypeFloat ); } | 277 | | TOK_FLOAT { bld.xAst.addNode( @1, AstNode::typeTypeFloat ); } |
278 | | TOK_BOOL { bld.xAst.addNode( AstNode::typeTypeBool ); } | 278 | | TOK_BOOL { bld.xAst.addNode( @1, AstNode::typeTypeBool ); } |
279 | | TOK_VERSION { bld.xAst.addNode( AstNode::typeTypeVersion ); } | 279 | | TOK_VERSION { bld.xAst.addNode( @1, AstNode::typeTypeVersion ); } |
280 | ; | 280 | ; |
281 | 281 | ||
282 | /* | 282 | /* |
@@ -286,67 +286,67 @@ type: TOK_STRING { bld.xAst.addNode( AstNode::typeTypeString ); } | |||
286 | expr: value | 286 | expr: value |
287 | | '(' expr ')' | 287 | | '(' expr ')' |
288 | | UNDEF '=' { | 288 | | UNDEF '=' { |
289 | bld.xAst.addNode( AstNode::typeVariableRef, $1 ); | 289 | bld.xAst.addNode( @$, AstNode::typeVariableRef, $1 ); |
290 | } expr { | 290 | } expr { |
291 | bld.xAst.addNode( AstNode::typeOpEq ); | 291 | bld.xAst.addNode( @3, AstNode::typeOpEq ); |
292 | } | 292 | } |
293 | | UNDEF OP_ADDSETP { | 293 | | UNDEF OP_ADDSETP { |
294 | bld.xAst.addNode( AstNode::typeVariableRef, $1 ); | 294 | bld.xAst.addNode( @$, AstNode::typeVariableRef, $1 ); |
295 | } expr { | 295 | } expr { |
296 | bld.xAst.addNode( AstNode::typeOpPlusEq ); | 296 | bld.xAst.addNode( @3, AstNode::typeOpPlusEq ); |
297 | } | 297 | } |
298 | | expr OP_CMPEQUAL expr | 298 | | expr OP_CMPEQUAL expr |
299 | { | 299 | { |
300 | bld.xAst.addNode( AstNode::typeCmpEq ); | 300 | bld.xAst.addNode( @$, AstNode::typeCmpEq ); |
301 | } | 301 | } |
302 | | expr '<' expr | 302 | | expr '<' expr |
303 | { | 303 | { |
304 | bld.xAst.addNode( AstNode::typeCmpLt ); | 304 | bld.xAst.addNode( @$, AstNode::typeCmpLt ); |
305 | } | 305 | } |
306 | | expr '>' expr | 306 | | expr '>' expr |
307 | { | 307 | { |
308 | bld.xAst.addNode( AstNode::typeCmpGt ); | 308 | bld.xAst.addNode( @$, AstNode::typeCmpGt ); |
309 | } | 309 | } |
310 | | expr OP_INEQUAL expr | 310 | | expr OP_INEQUAL expr |
311 | { | 311 | { |
312 | bld.xAst.addNode( AstNode::typeCmpNe ); | 312 | bld.xAst.addNode( @$, AstNode::typeCmpNe ); |
313 | } | 313 | } |
314 | | expr OP_LTEQUAL expr | 314 | | expr OP_LTEQUAL expr |
315 | { | 315 | { |
316 | bld.xAst.addNode( AstNode::typeCmpLtEq ); | 316 | bld.xAst.addNode( @$, AstNode::typeCmpLtEq ); |
317 | } | 317 | } |
318 | | expr OP_GTEQUAL expr | 318 | | expr OP_GTEQUAL expr |
319 | { | 319 | { |
320 | bld.xAst.addNode( AstNode::typeCmpGtEq ); | 320 | bld.xAst.addNode( @$, AstNode::typeCmpGtEq ); |
321 | } | 321 | } |
322 | | expr '+' expr | 322 | | expr '+' expr |
323 | { | 323 | { |
324 | bld.xAst.addNode( AstNode::typeOpPlus ); | 324 | bld.xAst.addNode( @$, AstNode::typeOpPlus ); |
325 | } | 325 | } |
326 | | expr '-' expr | 326 | | expr '-' expr |
327 | { | 327 | { |
328 | bld.xAst.addNode( AstNode::typeOpMinus ); | 328 | bld.xAst.addNode( @$, AstNode::typeOpMinus ); |
329 | } | 329 | } |
330 | | expr '*' expr | 330 | | expr '*' expr |
331 | { | 331 | { |
332 | bld.xAst.addNode( AstNode::typeOpMultiply ); | 332 | bld.xAst.addNode( @$, AstNode::typeOpMultiply ); |
333 | } | 333 | } |
334 | | expr '/' expr | 334 | | expr '/' expr |
335 | { | 335 | { |
336 | bld.xAst.addNode( AstNode::typeOpDivide ); | 336 | bld.xAst.addNode( @$, AstNode::typeOpDivide ); |
337 | } | 337 | } |
338 | | '-' expr %prec IINEG | 338 | | '-' expr %prec IINEG |
339 | { | 339 | { |
340 | bld.xAst.addNode( AstNode::typeOpNegate ); | 340 | bld.xAst.addNode( @$, AstNode::typeOpNegate ); |
341 | } | 341 | } |
342 | | '!' expr %prec IINOT | 342 | | '!' expr %prec IINOT |
343 | { | 343 | { |
344 | bld.xAst.addNode( AstNode::typeOpNot ); | 344 | bld.xAst.addNode( @$, AstNode::typeOpNot ); |
345 | } | 345 | } |
346 | ; | 346 | ; |
347 | 347 | ||
348 | line_expr: { | 348 | line_expr: { |
349 | bld.xAst.addNode( AstNode::typeExpr ); | 349 | bld.xAst.addNode( @$, AstNode::typeExpr ); |
350 | bld.xAst.openBranch(); | 350 | bld.xAst.openBranch(); |
351 | } expr ';' | 351 | } expr ';' |
352 | { | 352 | { |
@@ -355,9 +355,9 @@ line_expr: { | |||
355 | ; | 355 | ; |
356 | 356 | ||
357 | if_core: TOK_IF { | 357 | if_core: TOK_IF { |
358 | bld.xAst.addNode( AstNode::typeIf ); | 358 | bld.xAst.addNode( @$, AstNode::typeIf ); |
359 | bld.xAst.openBranch(); | 359 | bld.xAst.openBranch(); |
360 | // bld.xAst.addNode( AstNode::typeExpr ); | 360 | // bld.xAst.addNode( @$, AstNode::typeExpr ); |
361 | // bld.xAst.openBranch(); | 361 | // bld.xAst.openBranch(); |
362 | } expr TOK_THEN { | 362 | } expr TOK_THEN { |
363 | // bld.xAst.closeNode(); | 363 | // bld.xAst.closeNode(); |
@@ -406,7 +406,7 @@ function_else: | |||
406 | */ | 406 | */ |
407 | 407 | ||
408 | for_base: TOK_FOR { | 408 | for_base: TOK_FOR { |
409 | bld.xAst.addNode( AstNode::typeFor ); | 409 | bld.xAst.addNode( @$, AstNode::typeFor ); |
410 | bld.xAst.openBranch(); | 410 | bld.xAst.openBranch(); |
411 | } variable TOK_IN { | 411 | } variable TOK_IN { |
412 | bld.xAst.openBranch(); | 412 | bld.xAst.openBranch(); |
@@ -432,9 +432,9 @@ function_for: for_base '{' function_exprs '}' { bld.xAst.closeNode(); } | |||
432 | */ | 432 | */ |
433 | 433 | ||
434 | function_def: TOK_FUNCTION UNDEF { | 434 | function_def: TOK_FUNCTION UNDEF { |
435 | bld.xAst.addNode( AstNode::typeFunctionDef ); | 435 | bld.xAst.addNode( @1, AstNode::typeFunctionDef ); |
436 | bld.xAst.openBranch(); | 436 | bld.xAst.openBranch(); |
437 | bld.xAst.addNode( AstNode::typeString, $2 ); | 437 | bld.xAst.addNode( @2, AstNode::typeString, $2 ); |
438 | bld.xAst.openBranch(); | 438 | bld.xAst.openBranch(); |
439 | } '(' param_defs ')' { | 439 | } '(' param_defs ')' { |
440 | bld.xAst.openBranch(); | 440 | bld.xAst.openBranch(); |
@@ -465,7 +465,7 @@ function_exprs: | |||
465 | ; | 465 | ; |
466 | 466 | ||
467 | return: TOK_RETURN { | 467 | return: TOK_RETURN { |
468 | bld.xAst.addNode( AstNode::typeReturn ); | 468 | bld.xAst.addNode( @$, AstNode::typeReturn ); |
469 | bld.xAst.openBranch(); | 469 | bld.xAst.openBranch(); |
470 | } expr { | 470 | } expr { |
471 | bld.xAst.closeNode(); | 471 | bld.xAst.closeNode(); |
@@ -477,9 +477,9 @@ return: TOK_RETURN { | |||
477 | */ | 477 | */ |
478 | 478 | ||
479 | action_def: TOK_ACTION STRING { | 479 | action_def: TOK_ACTION STRING { |
480 | bld.xAst.addNode( AstNode::typeActionDef ); | 480 | bld.xAst.addNode( @$, AstNode::typeActionDef ); |
481 | bld.xAst.openBranch(); | 481 | bld.xAst.openBranch(); |
482 | bld.xAst.addNode( AstNode::typeString, $2 ); | 482 | bld.xAst.addNode( @1, AstNode::typeString, $2 ); |
483 | bld.xAst.openBranch(); | 483 | bld.xAst.openBranch(); |
484 | } '{' function_exprs '}' { | 484 | } '{' function_exprs '}' { |
485 | bld.xAst.closeNode(); | 485 | bld.xAst.closeNode(); |
@@ -491,7 +491,7 @@ action_def: TOK_ACTION STRING { | |||
491 | */ | 491 | */ |
492 | 492 | ||
493 | profile: TOK_PROFILE { | 493 | profile: TOK_PROFILE { |
494 | bld.xAst.addNode( AstNode::typeProfile ); | 494 | bld.xAst.addNode( @$, AstNode::typeProfile ); |
495 | bld.xAst.openBranch(); | 495 | bld.xAst.openBranch(); |
496 | } string { | 496 | } string { |
497 | bld.xAst.openBranch(); | 497 | bld.xAst.openBranch(); |
@@ -518,7 +518,7 @@ profile_exprs: | |||
518 | */ | 518 | */ |
519 | 519 | ||
520 | target: TOK_TARGET { | 520 | target: TOK_TARGET { |
521 | bld.xAst.addNode( AstNode::typeTarget ); | 521 | bld.xAst.addNode( @$, AstNode::typeTarget ); |
522 | bld.xAst.openBranch(); | 522 | bld.xAst.openBranch(); |
523 | } expr { | 523 | } expr { |
524 | bld.xAst.openBranch(); | 524 | bld.xAst.openBranch(); |
@@ -544,7 +544,7 @@ target_exprs: | |||
544 | ; | 544 | ; |
545 | 545 | ||
546 | target_input: TOK_INPUT { | 546 | target_input: TOK_INPUT { |
547 | bld.xAst.addNode( AstNode::typeInput ); | 547 | bld.xAst.addNode( @$, AstNode::typeInput ); |
548 | bld.xAst.openBranch(); | 548 | bld.xAst.openBranch(); |
549 | } expr ';' { | 549 | } expr ';' { |
550 | bld.xAst.closeNode(); | 550 | bld.xAst.closeNode(); |
@@ -552,7 +552,7 @@ target_input: TOK_INPUT { | |||
552 | ; | 552 | ; |
553 | 553 | ||
554 | target_rule: TOK_RULE { | 554 | target_rule: TOK_RULE { |
555 | bld.xAst.addNode( AstNode::typeRule ); | 555 | bld.xAst.addNode( @$, AstNode::typeRule ); |
556 | bld.xAst.openBranch(); | 556 | bld.xAst.openBranch(); |
557 | } string ';' { | 557 | } string ';' { |
558 | bld.xAst.closeNode(); | 558 | bld.xAst.closeNode(); |
@@ -560,13 +560,13 @@ target_rule: TOK_RULE { | |||
560 | ; | 560 | ; |
561 | 561 | ||
562 | condition: TOK_CONDITION CONDITION ';' { | 562 | condition: TOK_CONDITION CONDITION ';' { |
563 | bld.xAst.addNode( AstNode::typeCondition, $2 ); | 563 | bld.xAst.addNode( @$, AstNode::typeCondition, $2 ); |
564 | } | 564 | } |
565 | | TOK_CONDITION TOK_ALWAYS ';'{ | 565 | | TOK_CONDITION TOK_ALWAYS ';'{ |
566 | bld.xAst.addNode( AstNode::typeCondition, "always" ); | 566 | bld.xAst.addNode( @$, AstNode::typeCondition, "always" ); |
567 | } | 567 | } |
568 | | TOK_CONDITION TOK_NEVER ';'{ | 568 | | TOK_CONDITION TOK_NEVER ';'{ |
569 | bld.xAst.addNode( AstNode::typeCondition, "never" ); | 569 | bld.xAst.addNode( @$, AstNode::typeCondition, "never" ); |
570 | } | 570 | } |
571 | ; | 571 | ; |
572 | 572 | ||
@@ -575,7 +575,7 @@ condition: TOK_CONDITION CONDITION ';' { | |||
575 | */ | 575 | */ |
576 | 576 | ||
577 | rule: TOK_RULE { | 577 | rule: TOK_RULE { |
578 | bld.xAst.addNode( AstNode::typeRuleDef ); | 578 | bld.xAst.addNode( @$, AstNode::typeRuleDef ); |
579 | bld.xAst.openBranch(); | 579 | bld.xAst.openBranch(); |
580 | } string { | 580 | } string { |
581 | bld.xAst.openBranch(); | 581 | bld.xAst.openBranch(); |
@@ -602,18 +602,18 @@ rule_input_func: function | |||
602 | /* In this case, when the input is just a string, | 602 | /* In this case, when the input is just a string, |
603 | lets actually turn it into a call to the matches function. | 603 | lets actually turn it into a call to the matches function. |
604 | */ | 604 | */ |
605 | bld.xAst.addNode( AstNode::typeFunction ); | 605 | bld.xAst.addNode( @1, AstNode::typeFunction ); |
606 | bld.xAst.openBranch(); | 606 | bld.xAst.openBranch(); |
607 | bld.xAst.addNode( AstNode::typeString, "matches" ); | 607 | bld.xAst.addNode( @1, AstNode::typeString, "matches" ); |
608 | bld.xAst.openBranch(); | 608 | bld.xAst.openBranch(); |
609 | bld.xAst.addNode( AstNode::typeString, $1 ); | 609 | bld.xAst.addNode( @1, AstNode::typeString, $1 ); |
610 | bld.xAst.closeNode(); | 610 | bld.xAst.closeNode(); |
611 | } | 611 | } |
612 | /* | string */ | 612 | /* | string */ |
613 | ; | 613 | ; |
614 | 614 | ||
615 | rule_input: TOK_INPUT { | 615 | rule_input: TOK_INPUT { |
616 | bld.xAst.addNode( AstNode::typeInput ); | 616 | bld.xAst.addNode( @$, AstNode::typeInput ); |
617 | bld.xAst.openBranch(); | 617 | bld.xAst.openBranch(); |
618 | } rule_input_func ';' { | 618 | } rule_input_func ';' { |
619 | bld.xAst.closeNode(); | 619 | bld.xAst.closeNode(); |
@@ -621,7 +621,7 @@ rule_input: TOK_INPUT { | |||
621 | ; | 621 | ; |
622 | 622 | ||
623 | output: TOK_OUTPUT { | 623 | output: TOK_OUTPUT { |
624 | bld.xAst.addNode( AstNode::typeOutput ); | 624 | bld.xAst.addNode( @$, AstNode::typeOutput ); |
625 | bld.xAst.openBranch(); | 625 | bld.xAst.openBranch(); |
626 | } value ';' { | 626 | } value ';' { |
627 | bld.xAst.closeNode(); | 627 | bld.xAst.closeNode(); |
@@ -632,7 +632,7 @@ output: TOK_OUTPUT { | |||
632 | * config | 632 | * config |
633 | */ | 633 | */ |
634 | config: TOK_CONFIG { | 634 | config: TOK_CONFIG { |
635 | bld.xAst.addNode( AstNode::typeConfig ); | 635 | bld.xAst.addNode( @$, AstNode::typeConfig ); |
636 | bld.xAst.openBranch(); | 636 | bld.xAst.openBranch(); |
637 | } string { | 637 | } string { |
638 | bld.xAst.openBranch(); | 638 | bld.xAst.openBranch(); |
@@ -640,7 +640,7 @@ config: TOK_CONFIG { | |||
640 | bld.xAst.closeNode(); | 640 | bld.xAst.closeNode(); |
641 | } | 641 | } |
642 | | TOK_AUTO TOK_CONFIG { | 642 | | TOK_AUTO TOK_CONFIG { |
643 | bld.xAst.addNode( AstNode::typeAutoConfig ); | 643 | bld.xAst.addNode( @$, AstNode::typeAutoConfig ); |
644 | bld.xAst.openBranch(); | 644 | bld.xAst.openBranch(); |
645 | } string { | 645 | } string { |
646 | bld.xAst.openBranch(); | 646 | bld.xAst.openBranch(); |
@@ -648,7 +648,7 @@ config: TOK_CONFIG { | |||
648 | bld.xAst.closeNode(); | 648 | bld.xAst.closeNode(); |
649 | } | 649 | } |
650 | | TOK_GLOBAL TOK_CONFIG { | 650 | | TOK_GLOBAL TOK_CONFIG { |
651 | bld.xAst.addNode( AstNode::typeGlobalConfig ); | 651 | bld.xAst.addNode( @$, AstNode::typeGlobalConfig ); |
652 | bld.xAst.openBranch(); | 652 | bld.xAst.openBranch(); |
653 | } string { | 653 | } string { |
654 | bld.xAst.openBranch(); | 654 | bld.xAst.openBranch(); |
@@ -667,12 +667,12 @@ config_exprs: | |||
667 | ; | 667 | ; |
668 | 668 | ||
669 | display: TOK_DISPLAY STRING ';' { | 669 | display: TOK_DISPLAY STRING ';' { |
670 | bld.xAst.addNode( AstNode::typeDisplay, $2 ); | 670 | bld.xAst.addNode( @$, AstNode::typeDisplay, $2 ); |
671 | } | 671 | } |
672 | ; | 672 | ; |
673 | 673 | ||
674 | config_type: TOK_TYPE { | 674 | config_type: TOK_TYPE { |
675 | bld.xAst.addNode( AstNode::typeType ); | 675 | bld.xAst.addNode( @$, AstNode::typeType ); |
676 | bld.xAst.openBranch(); | 676 | bld.xAst.openBranch(); |
677 | } type ';' { | 677 | } type ';' { |
678 | bld.xAst.closeNode(); | 678 | bld.xAst.closeNode(); |
@@ -680,7 +680,7 @@ config_type: TOK_TYPE { | |||
680 | ; | 680 | ; |
681 | 681 | ||
682 | default: TOK_DEFAULT { | 682 | default: TOK_DEFAULT { |
683 | bld.xAst.addNode( AstNode::typeDefault ); | 683 | bld.xAst.addNode( @$, AstNode::typeDefault ); |
684 | bld.xAst.openBranch(); | 684 | bld.xAst.openBranch(); |
685 | } literal ';' { | 685 | } literal ';' { |
686 | bld.xAst.closeNode(); | 686 | bld.xAst.closeNode(); |
@@ -691,7 +691,7 @@ value_key_val: value ';' | |||
691 | | '{' function_exprs '}' /* inline function */ | 691 | | '{' function_exprs '}' /* inline function */ |
692 | 692 | ||
693 | value_key: TOK_VALUE { | 693 | value_key: TOK_VALUE { |
694 | bld.xAst.addNode( AstNode::typeValue ); | 694 | bld.xAst.addNode( @$, AstNode::typeValue ); |
695 | bld.xAst.openBranch(); | 695 | bld.xAst.openBranch(); |
696 | } value_key_val { | 696 | } value_key_val { |
697 | bld.xAst.closeNode(); | 697 | bld.xAst.closeNode(); |
@@ -699,7 +699,7 @@ value_key: TOK_VALUE { | |||
699 | ; | 699 | ; |
700 | 700 | ||
701 | allow: TOK_ALLOW { | 701 | allow: TOK_ALLOW { |
702 | bld.xAst.addNode( AstNode::typeAllow ); | 702 | bld.xAst.addNode( @$, AstNode::typeAllow ); |
703 | bld.xAst.openBranch(); | 703 | bld.xAst.openBranch(); |
704 | } value ';' { | 704 | } value ';' { |
705 | bld.xAst.closeNode(); | 705 | bld.xAst.closeNode(); |
@@ -707,9 +707,9 @@ allow: TOK_ALLOW { | |||
707 | ; | 707 | ; |
708 | 708 | ||
709 | cache: TOK_CACHE TOK_ALWAYS ';' | 709 | cache: TOK_CACHE TOK_ALWAYS ';' |
710 | { bld.xAst.addNode( AstNode::typeCache, true ); } | 710 | { bld.xAst.addNode( @$, AstNode::typeCache, true ); } |
711 | | TOK_CACHE TOK_NEVER ';' | 711 | | TOK_CACHE TOK_NEVER ';' |
712 | { bld.xAst.addNode( AstNode::typeCache, false ); } | 712 | { bld.xAst.addNode( @$, AstNode::typeCache, false ); } |
713 | ; | 713 | ; |
714 | 714 | ||
715 | /* | 715 | /* |
@@ -717,9 +717,9 @@ cache: TOK_CACHE TOK_ALWAYS ';' | |||
717 | */ | 717 | */ |
718 | process_target: PROFILE | 718 | process_target: PROFILE |
719 | { | 719 | { |
720 | bld.xAst.addNode( AstNode::typeProcessTarget ); | 720 | bld.xAst.addNode( @$, AstNode::typeProcessTarget ); |
721 | bld.xAst.openBranch(); | 721 | bld.xAst.openBranch(); |
722 | bld.xAst.addNode( AstNode::typeString, $1 ); | 722 | bld.xAst.addNode( @$, AstNode::typeString, $1 ); |
723 | bld.xAst.openBranch(); | 723 | bld.xAst.openBranch(); |
724 | } value ';' { | 724 | } value ';' { |
725 | bld.xAst.closeNode(); | 725 | bld.xAst.closeNode(); |
@@ -728,7 +728,7 @@ process_target: PROFILE | |||
728 | 728 | ||
729 | tag: TOK_TAG | 729 | tag: TOK_TAG |
730 | { | 730 | { |
731 | bld.xAst.addNode( AstNode::typeTag ); | 731 | bld.xAst.addNode( @$, AstNode::typeTag ); |
732 | bld.xAst.openBranch(); | 732 | bld.xAst.openBranch(); |
733 | } value ';' { | 733 | } value ';' { |
734 | bld.xAst.closeNode(); | 734 | bld.xAst.closeNode(); |