diff options
author | Mike Buland <eichlan@xagasoft.com> | 2012-04-03 16:57:34 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2012-04-03 16:57:34 +0000 |
commit | 50a5873b95424e7c1a805e1cd4697c8df2153388 (patch) | |
tree | 9c24b6ff368f94520e5a22ea01d3f2b4a6f56c38 /src/build.y | |
parent | 159bb9b5d8ff281a3ea83f38e180688f6e3158b7 (diff) | |
download | build-50a5873b95424e7c1a805e1cd4697c8df2153388.tar.gz build-50a5873b95424e7c1a805e1cd4697c8df2153388.tar.bz2 build-50a5873b95424e7c1a805e1cd4697c8df2153388.tar.xz build-50a5873b95424e7c1a805e1cd4697c8df2153388.zip |
Tweaks to help with the new libbu++ and windows compatibility.
Diffstat (limited to '')
-rw-r--r-- | src/build.y | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/src/build.y b/src/build.y index 5a5e938..ae8a696 100644 --- a/src/build.y +++ b/src/build.y | |||
@@ -25,16 +25,16 @@ void yyerror( YYLTYPE *locp, yyscan_t yyscanner, BuildParser &bld, const char *m | |||
25 | bool bVal; | 25 | bool bVal; |
26 | } | 26 | } |
27 | 27 | ||
28 | %token <sVal> STRING "string literal" | 28 | %token <sVal> LTR_STRING "string literal" |
29 | %token <sVal> KEYWORD "keyword" | 29 | %token <sVal> LTR_KEYWORD "keyword" |
30 | %token <sVal> CONDITION "condition term" | 30 | %token <sVal> LTR_CONDITION "condition term" |
31 | %token <sVal> VARIABLE "variable name" | 31 | %token <sVal> LTR_VARIABLE "variable name" |
32 | %token <sVal> FUNCTION "function name" | 32 | %token <sVal> LTR_FUNCTION "function name" |
33 | %token <sVal> UNDEF "undefined identifier" | 33 | %token <sVal> LTR_UNDEF "undefined identifier" |
34 | %token <sVal> PROFILE "profile execute" | 34 | %token <sVal> LTR_PROFILE "profile execute" |
35 | %token <iVal> INT "integer literal" | 35 | %token <iVal> LTR_INT "integer literal" |
36 | %token <fVal> FLOAT "floating point literal" | 36 | %token <fVal> LTR_FLOAT "floating point literal" |
37 | %token <bVal> BOOL "boolean literal" | 37 | %token <bVal> LTR_BOOL "boolean literal" |
38 | 38 | ||
39 | %token TOK_TARGET "target" | 39 | %token TOK_TARGET "target" |
40 | %token TOK_INPUT "input" | 40 | %token TOK_INPUT "input" |
@@ -96,13 +96,13 @@ void yyerror( YYLTYPE *locp, yyscan_t yyscanner, BuildParser &bld, const char *m | |||
96 | %left '(' ')' '{' '}' '[' ']' | 96 | %left '(' ')' '{' '}' '[' ']' |
97 | %left IINEG IINOT | 97 | %left IINEG IINOT |
98 | 98 | ||
99 | %destructor { delete[] $$; } STRING | 99 | %destructor { delete[] $$; } LTR_STRING |
100 | %destructor { delete[] $$; } KEYWORD | 100 | %destructor { delete[] $$; } LTR_KEYWORD |
101 | %destructor { delete[] $$; } CONDITION | 101 | %destructor { delete[] $$; } LTR_CONDITION |
102 | %destructor { delete[] $$; } VARIABLE | 102 | %destructor { delete[] $$; } LTR_VARIABLE |
103 | %destructor { delete[] $$; } FUNCTION | 103 | %destructor { delete[] $$; } LTR_FUNCTION |
104 | %destructor { delete[] $$; } UNDEF | 104 | %destructor { delete[] $$; } LTR_UNDEF |
105 | %destructor { delete[] $$; } PROFILE | 105 | %destructor { delete[] $$; } LTR_PROFILE |
106 | 106 | ||
107 | %% /* Grammar rules */ | 107 | %% /* Grammar rules */ |
108 | 108 | ||
@@ -140,23 +140,23 @@ root_sub_exprs: | |||
140 | | root export | 140 | | root export |
141 | ; | 141 | ; |
142 | 142 | ||
143 | include: TOK_INCLUDE STRING ';' { bld.include( $2, yyscanner, &yylloc ); } | 143 | include: TOK_INCLUDE LTR_STRING ';' { bld.include( $2, yyscanner, &yylloc ); } |
144 | ; | 144 | ; |
145 | 145 | ||
146 | /* | 146 | /* |
147 | * data related | 147 | * data related |
148 | */ | 148 | */ |
149 | 149 | ||
150 | string: STRING { bld.xAst.addNode( @1, AstNode::typeString, $1 ); } | 150 | string: LTR_STRING { bld.xAst.addNode( @1, AstNode::typeString, $1 ); } |
151 | ; | 151 | ; |
152 | 152 | ||
153 | int: INT { bld.xAst.addNode( @1, AstNode::typeInt, $1 ); } | 153 | int: LTR_INT { bld.xAst.addNode( @1, AstNode::typeInt, $1 ); } |
154 | ; | 154 | ; |
155 | 155 | ||
156 | float: FLOAT { bld.xAst.addNode( @1, AstNode::typeFloat, $1 ); } | 156 | float: LTR_FLOAT { bld.xAst.addNode( @1, AstNode::typeFloat, $1 ); } |
157 | ; | 157 | ; |
158 | 158 | ||
159 | bool: BOOL { bld.xAst.addNode( @1, AstNode::typeBool, (bool)$1 ); } | 159 | bool: LTR_BOOL { bld.xAst.addNode( @1, AstNode::typeBool, (bool)$1 ); } |
160 | ; | 160 | ; |
161 | 161 | ||
162 | null: TOK_NULL { bld.xAst.addNode( @1, AstNode::typeNull ); } | 162 | null: TOK_NULL { bld.xAst.addNode( @1, AstNode::typeNull ); } |
@@ -168,7 +168,7 @@ literal: string | |||
168 | | null | 168 | | null |
169 | ; | 169 | ; |
170 | 170 | ||
171 | variable: UNDEF { bld.xAst.addNode( @1, AstNode::typeVariable, $1 ); } | 171 | variable: LTR_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 |
@@ -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 LTR_STRING ';' { bld.xAst.addNode( @$,AstNode::typeError, $2 ); } |
203 | | TOK_WARNING STRING ';' { bld.xAst.addNode( @$, AstNode::typeWarning, $2 ); } | 203 | | TOK_WARNING LTR_STRING ';' { bld.xAst.addNode( @$, AstNode::typeWarning, $2 ); } |
204 | | TOK_NOTICE STRING ';' { bld.xAst.addNode( @$, AstNode::typeNotice, $2 ); } | 204 | | TOK_NOTICE LTR_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 |
@@ -245,7 +245,7 @@ func_param_list: { bld.xAst.openBranch(); } expr | |||
245 | | func_param_list ',' { bld.xAst.openBranch(); } expr | 245 | | func_param_list ',' { bld.xAst.openBranch(); } expr |
246 | ; | 246 | ; |
247 | 247 | ||
248 | function: UNDEF '(' { | 248 | function: LTR_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 ); |
@@ -254,7 +254,7 @@ function: UNDEF '(' { | |||
254 | } | 254 | } |
255 | ; | 255 | ; |
256 | 256 | ||
257 | function_no_input: UNDEF '(' { | 257 | function_no_input: LTR_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(); |
@@ -285,17 +285,17 @@ type: TOK_STRING { bld.xAst.addNode( @1, AstNode::typeTypeString ); } | |||
285 | 285 | ||
286 | expr: value | 286 | expr: value |
287 | | '(' expr ')' | 287 | | '(' expr ')' |
288 | | UNDEF '=' { | 288 | | LTR_UNDEF '=' { |
289 | bld.xAst.addNode( @$, AstNode::typeVariableRef, $1 ); | 289 | bld.xAst.addNode( @$, AstNode::typeVariableRef, $1 ); |
290 | } expr { | 290 | } expr { |
291 | bld.xAst.addNode( @3, AstNode::typeOpEq ); | 291 | bld.xAst.addNode( @3, AstNode::typeOpEq ); |
292 | } | 292 | } |
293 | | UNDEF OP_ADDSETP { | 293 | | LTR_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( @3, AstNode::typeOpPlusEq ); | 296 | bld.xAst.addNode( @3, AstNode::typeOpPlusEq ); |
297 | } | 297 | } |
298 | | UNDEF OP_ADDSETR { | 298 | | LTR_UNDEF OP_ADDSETR { |
299 | bld.xAst.addNode( @$, AstNode::typeVariableRef, $1 ); | 299 | bld.xAst.addNode( @$, AstNode::typeVariableRef, $1 ); |
300 | } expr { | 300 | } expr { |
301 | bld.xAst.addNode( @3, AstNode::typeOpPlusEqRaw ); | 301 | bld.xAst.addNode( @3, AstNode::typeOpPlusEqRaw ); |
@@ -436,7 +436,7 @@ function_for: for_base '{' function_exprs '}' { bld.xAst.closeNode(); } | |||
436 | * functions | 436 | * functions |
437 | */ | 437 | */ |
438 | 438 | ||
439 | function_def: TOK_FUNCTION UNDEF { | 439 | function_def: TOK_FUNCTION LTR_UNDEF { |
440 | bld.xAst.addNode( @1, AstNode::typeFunctionDef ); | 440 | bld.xAst.addNode( @1, AstNode::typeFunctionDef ); |
441 | bld.xAst.openBranch(); | 441 | bld.xAst.openBranch(); |
442 | bld.xAst.addNode( @2, AstNode::typeString, $2 ); | 442 | bld.xAst.addNode( @2, AstNode::typeString, $2 ); |
@@ -481,7 +481,7 @@ return: TOK_RETURN { | |||
481 | * Actions, they're basically functions, no parameters | 481 | * Actions, they're basically functions, no parameters |
482 | */ | 482 | */ |
483 | 483 | ||
484 | action_def: TOK_ACTION STRING { | 484 | action_def: TOK_ACTION LTR_STRING { |
485 | bld.xAst.addNode( @$, AstNode::typeActionDef ); | 485 | bld.xAst.addNode( @$, AstNode::typeActionDef ); |
486 | bld.xAst.openBranch(); | 486 | bld.xAst.openBranch(); |
487 | bld.xAst.addNode( @1, AstNode::typeString, $2 ); | 487 | bld.xAst.addNode( @1, AstNode::typeString, $2 ); |
@@ -564,7 +564,7 @@ target_rule: TOK_RULE { | |||
564 | } | 564 | } |
565 | ; | 565 | ; |
566 | 566 | ||
567 | condition: TOK_CONDITION CONDITION ';' { | 567 | condition: TOK_CONDITION LTR_CONDITION ';' { |
568 | bld.xAst.addNode( @$, AstNode::typeCondition, $2 ); | 568 | bld.xAst.addNode( @$, AstNode::typeCondition, $2 ); |
569 | } | 569 | } |
570 | | TOK_CONDITION TOK_ALWAYS ';'{ | 570 | | TOK_CONDITION TOK_ALWAYS ';'{ |
@@ -603,7 +603,7 @@ rule_exprs: | |||
603 | ; | 603 | ; |
604 | 604 | ||
605 | rule_input_func: function | 605 | rule_input_func: function |
606 | | STRING { | 606 | | LTR_STRING { |
607 | /* In this case, when the input is just a string, | 607 | /* In this case, when the input is just a string, |
608 | lets actually turn it into a call to the matches function. | 608 | lets actually turn it into a call to the matches function. |
609 | */ | 609 | */ |
@@ -671,7 +671,7 @@ config_exprs: | |||
671 | | config_exprs cache | 671 | | config_exprs cache |
672 | ; | 672 | ; |
673 | 673 | ||
674 | display: TOK_DISPLAY STRING ';' { | 674 | display: TOK_DISPLAY LTR_STRING ';' { |
675 | bld.xAst.addNode( @$, AstNode::typeDisplay, $2 ); | 675 | bld.xAst.addNode( @$, AstNode::typeDisplay, $2 ); |
676 | } | 676 | } |
677 | ; | 677 | ; |
@@ -720,7 +720,7 @@ cache: TOK_CACHE TOK_ALWAYS ';' | |||
720 | /* | 720 | /* |
721 | * target/profile execute | 721 | * target/profile execute |
722 | */ | 722 | */ |
723 | process_target: PROFILE | 723 | process_target: LTR_PROFILE |
724 | { | 724 | { |
725 | bld.xAst.addNode( @$, AstNode::typeProcessTarget ); | 725 | bld.xAst.addNode( @$, AstNode::typeProcessTarget ); |
726 | bld.xAst.openBranch(); | 726 | bld.xAst.openBranch(); |