aboutsummaryrefslogtreecommitdiff
path: root/src/build.y
diff options
context:
space:
mode:
Diffstat (limited to 'src/build.y')
-rw-r--r--src/build.y18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/build.y b/src/build.y
index 1621dbc..1424867 100644
--- a/src/build.y
+++ b/src/build.y
@@ -16,11 +16,10 @@ void yyerror( YYLTYPE *locp, Builder &bld, char const *msg );
16%error-verbose 16%error-verbose
17%union { 17%union {
18 char *strval; 18 char *strval;
19 int tval;
20} 19}
21 20
22%token <strval> STRING "string literal" 21%token <strval> STRING "string literal"
23%token <tval> TARGETTYPE "target type" 22%token <strval> TARGETTYPE "target type"
24%token <strval> FUNCTION "function name" 23%token <strval> FUNCTION "function name"
25%token <strval> PERFORM "perform name" 24%token <strval> PERFORM "perform name"
26 25
@@ -51,6 +50,7 @@ input:
51 | input rule 50 | input rule
52 | input action 51 | input action
53 | input target 52 | input target
53 | input set
54 ; 54 ;
55 55
56// Rule interpretation 56// Rule interpretation
@@ -61,7 +61,7 @@ rulecmds: rulecmd
61 | rulecmds ',' rulecmd 61 | rulecmds ',' rulecmd
62 ; 62 ;
63 63
64rulecmd: TOK_MATCHES { printf(" Matches: " ); } func 64rulecmd: TOK_MATCHES { printf(" Matches: " ); } func { printf("\n"); }
65 | TOK_PRODUCES STRING { printf(" Produces: %s\n", $2 ); } 65 | TOK_PRODUCES STRING { printf(" Produces: %s\n", $2 ); }
66 | TOK_REQUIRES { printf(" Requires:\n"); } list {printf("\n");} 66 | TOK_REQUIRES { printf(" Requires:\n"); } list {printf("\n");}
67 | TOK_INPUT TOK_FILTER { printf(" Input Filter: "); } func {printf("\n");} 67 | TOK_INPUT TOK_FILTER { printf(" Input Filter: "); } func {printf("\n");}
@@ -94,9 +94,9 @@ targetcmds: targetcmd
94 94
95targetcmd: TOK_RULE STRING { printf(" Rule %s\n", $2 ); } 95targetcmd: TOK_RULE STRING { printf(" Rule %s\n", $2 ); }
96 | TOK_TARGET TOK_PREFIX STRING { printf(" Target prefix: %s\n", $3 ); } 96 | TOK_TARGET TOK_PREFIX STRING { printf(" Target prefix: %s\n", $3 ); }
97 | TOK_TARGET TARGETTYPE { printf(" Target Type: %d\n", $2 ); } 97 | TOK_TARGET TARGETTYPE { printf(" Target Type: %s\n", $2 ); }
98 | TOK_INPUT { printf(" Input: "); } list { printf("\n"); } 98 | TOK_INPUT { printf(" Input: "); } list { printf("\n"); }
99 | TOK_INPUT TOK_FILTER { printf(" Input filter: "); } func 99 | TOK_INPUT TOK_FILTER { printf(" Input filter: "); } func { printf("\n"); }
100 | TOK_REQUIRES { printf(" Requires: "); } list { printf("\n"); } 100 | TOK_REQUIRES { printf(" Requires: "); } list { printf("\n"); }
101 | TOK_SET { printf(" Set: "); } targetset 101 | TOK_SET { printf(" Set: "); } targetset
102 ; 102 ;
@@ -105,6 +105,14 @@ targetset: STRING '=' STRING { printf("%s = %s\n", $1, $3 ); }
105 | STRING TOK_ADDSET STRING { printf("%s += %s\n", $1, $3 ); } 105 | STRING TOK_ADDSET STRING { printf("%s += %s\n", $1, $3 ); }
106 ; 106 ;
107 107
108// global set
109set: TOK_SET { printf("Set: "); } setwhat
110 ;
111
112setwhat: STRING '=' STRING { printf("%s = %s\n", $1, $3 ); }
113 | STRING TOK_ADDSET STRING { printf("%s += %s\n", $1, $3 ); }
114 ;
115
108// list goo 116// list goo
109list: listitem listfilter 117list: listitem listfilter
110 | '[' { printf("["); } listitems ']' { printf("]"); } listfilter 118 | '[' { printf("["); } listitems ']' { printf("]"); } listfilter