summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/parse/parse_c/bitbakeparser.y
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/parse/parse_c/bitbakeparser.y')
-rw-r--r--bitbake/lib/bb/parse/parse_c/bitbakeparser.y66
1 files changed, 35 insertions, 31 deletions
diff --git a/bitbake/lib/bb/parse/parse_c/bitbakeparser.y b/bitbake/lib/bb/parse/parse_c/bitbakeparser.y
index 4bc81a913a..252d87792f 100644
--- a/bitbake/lib/bb/parse/parse_c/bitbakeparser.y
+++ b/bitbake/lib/bb/parse/parse_c/bitbakeparser.y
@@ -42,13 +42,14 @@
42 42
43%include { 43%include {
44#include "token.h" 44#include "token.h"
45#include "lexer.h"
46#include "python_output.h"
45} 47}
46 48
47 49
48%token_destructor { $$.release_this (); } 50%token_destructor { $$.release_this (); }
49 51
50%syntax_error { printf ("%s:%d: syntax error\n", 52%syntax_error { e_parse_error( lex ); }
51 lex->filename (), lex->line ()); }
52 53
53program ::= statements. 54program ::= statements.
54 55
@@ -56,79 +57,82 @@ statements ::= statements statement.
56statements ::= . 57statements ::= .
57 58
58variable(r) ::= SYMBOL(s). 59variable(r) ::= SYMBOL(s).
59 { r.assignString( s.string() ); 60 { r.assignString( (char*)s.string() );
60 s.assignString( 0 ); 61 s.assignString( 0 );
61 s.release_this(); } 62 s.release_this(); }
62variable(r) ::= VARIABLE(v). 63variable(r) ::= VARIABLE(v).
63 { 64 {
64 r.assignString( v.string() ); 65 r.assignString( (char*)v.string() );
65 v.assignString( 0 ); 66 v.assignString( 0 );
66 v.release_this(); } 67 v.release_this(); }
67 68
68statement ::= EXPORT variable(s) OP_ASSIGN STRING(v). 69statement ::= EXPORT variable(s) OP_ASSIGN STRING(v).
69 { e_assign( s.string(), v.string() ); 70 { e_assign( lex, s.string(), v.string() );
70 e_export( s.string() ); 71 e_export( lex, s.string() );
71 s.release_this(); v.release_this(); } 72 s.release_this(); v.release_this(); }
72statement ::= EXPORT variable(s) OP_IMMEDIATE STRING(v). 73statement ::= EXPORT variable(s) OP_IMMEDIATE STRING(v).
73 { e_immediate (s.string(), v.string() ); 74 { e_immediate ( lex, s.string(), v.string() );
74 e_export( s.string() ); 75 e_export( lex, s.string() );
75 s.release_this(); v.release_this(); } 76 s.release_this(); v.release_this(); }
76statement ::= EXPORT variable(s) OP_COND STRING(v). 77statement ::= EXPORT variable(s) OP_COND STRING(v).
77 { e_cond( s.string(), v.string() ); 78 { e_cond( lex, s.string(), v.string() );
78 s.release_this(); v.release_this(); } 79 s.release_this(); v.release_this(); }
79 80
80statement ::= variable(s) OP_ASSIGN STRING(v). 81statement ::= variable(s) OP_ASSIGN STRING(v).
81 { e_assign( s.string(), v.string() ); 82 { e_assign( lex, s.string(), v.string() );
82 s.release_this(); v.release_this(); } 83 s.release_this(); v.release_this(); }
83statement ::= variable(s) OP_PREPEND STRING(v). 84statement ::= variable(s) OP_PREPEND STRING(v).
84 { e_prepend( s.string(), v.string() ); 85 { e_prepend( lex, s.string(), v.string() );
85 s.release_this(); v.release_this(); } 86 s.release_this(); v.release_this(); }
86statement ::= variable(s) OP_APPEND STRING(v). 87statement ::= variable(s) OP_APPEND STRING(v).
87 { e_append( s.string() , v.string() ); 88 { e_append( lex, s.string() , v.string() );
88 s.release_this(); v.release_this(); } 89 s.release_this(); v.release_this(); }
89statement ::= variable(s) OP_IMMEDIATE STRING(v). 90statement ::= variable(s) OP_IMMEDIATE STRING(v).
90 { e_immediate( s.string(), v.string() ); 91 { e_immediate( lex, s.string(), v.string() );
91 s.release_this(); v.release_this(); } 92 s.release_this(); v.release_this(); }
92statement ::= variable(s) OP_COND STRING(v). 93statement ::= variable(s) OP_COND STRING(v).
93 { e_cond( s.string(), v.string() ); 94 { e_cond( lex, s.string(), v.string() );
94 s.release_this(); v.release_this(); } 95 s.release_this(); v.release_this(); }
95 96
96task ::= TSYMBOL(t) BEFORE TSYMBOL(b) AFTER TSYMBOL(a). 97task ::= TSYMBOL(t) BEFORE TSYMBOL(b) AFTER TSYMBOL(a).
97 { e_addtask( t.string(), b.string(), a.string() ); 98 { e_addtask( lex, t.string(), b.string(), a.string() );
98 t.release_this(); b.release_this(); a.release_this(); } 99 t.release_this(); b.release_this(); a.release_this(); }
99task ::= TSYMBOL(t) AFTER TSYMBOL(a) BEFORE TSYMBOL(b). 100task ::= TSYMBOL(t) AFTER TSYMBOL(a) BEFORE TSYMBOL(b).
100 { e_addtask( t.string(), b.string(), a.string()); 101 { e_addtask( lex, t.string(), b.string(), a.string());
101 t.release_this(); a.release_this(); b.release_this(); } 102 t.release_this(); a.release_this(); b.release_this(); }
102task ::= TSYMBOL(t). 103task ::= TSYMBOL(t).
103 { e_addtask( t.string(), NULL, NULL); 104 { e_addtask( lex, t.string(), NULL, NULL);
104 t.release_this();} 105 t.release_this();}
105task ::= TSYMBOL(t) BEFORE TSYMBOL(b). 106task ::= TSYMBOL(t) BEFORE TSYMBOL(b).
106 { e_addtask( t.string(), b.string(), NULL); 107 { e_addtask( lex, t.string(), b.string(), NULL);
107 t.release_this(); b.release_this(); } 108 t.release_this(); b.release_this(); }
108task ::= TSYMBOL(t) AFTER TSYMBOL(a). 109task ::= TSYMBOL(t) AFTER TSYMBOL(a).
109 { e_addtask( t.string(), NULL, a.string()); 110 { e_addtask( lex, t.string(), NULL, a.string());
110 t.release_this(); a.release_this(); } 111 t.release_this(); a.release_this(); }
111tasks ::= tasks task. 112tasks ::= tasks task.
112tasks ::= task. 113tasks ::= task.
113statement ::= ADDTASK tasks. 114statement ::= ADDTASK tasks.
114 115
115statement ::= ADDHANDLER SYMBOL(s). 116statement ::= ADDHANDLER SYMBOL(s).
116 { e_addhandler( s.string()); s.release_this (); } 117 { e_addhandler( lex, s.string()); s.release_this (); }
117 118
118func ::= FSYMBOL(f). { e_export_func(f.string()); f.release_this(); } 119func ::= FSYMBOL(f). { e_export_func( lex, f.string()); f.release_this(); }
119funcs ::= funcs func. 120funcs ::= funcs func.
120funcs ::= func. 121funcs ::= func.
121statement ::= EXPORT_FUNC funcs. 122statement ::= EXPORT_FUNC funcs.
122 123
123inherit ::= ISYMBOL(i). { e_inherit(i.string() ); i.release_this (); } 124inherit ::= ISYMBOL(i). { e_inherit( lex, i.string() ); i.release_this (); }
124inherits ::= inherits inherit. 125inherits ::= inherits inherit.
125inherits ::= inherit. 126inherits ::= inherit.
126statement ::= INHERIT inherits. 127statement ::= INHERIT inherits.
127 128
128statement ::= INCLUDE ISYMBOL(i). 129statement ::= INCLUDE ISYMBOL(i).
129 { e_include(i.string() ); i.release_this(); } 130 { e_include( lex, i.string() ); i.release_this(); }
130 131
131proc_body(r) ::= proc_body(l) PROC_BODY(b). 132statement ::= REQUIRE ISYMBOL(i).
133 { e_require( lex, i.string() ); i.release_this(); }
134
135proc_body(r) ::= proc_body(l) PROC_BODY(b).
132 { /* concatenate body lines */ 136 { /* concatenate body lines */
133 r.assignString( token_t::concatString(l.string(), b.string()) ); 137 r.assignString( token_t::concatString(l.string(), b.string()) );
134 l.release_this (); 138 l.release_this ();
@@ -136,26 +140,26 @@ proc_body(r) ::= proc_body(l) PROC_BODY(b).
136 } 140 }
137proc_body(b) ::= . { b.assignString(0); } 141proc_body(b) ::= . { b.assignString(0); }
138statement ::= variable(p) PROC_OPEN proc_body(b) PROC_CLOSE. 142statement ::= variable(p) PROC_OPEN proc_body(b) PROC_CLOSE.
139 { e_proc( p.string(), b.string() ); 143 { e_proc( lex, p.string(), b.string() );
140 p.release_this(); b.release_this(); } 144 p.release_this(); b.release_this(); }
141statement ::= PYTHON SYMBOL(p) PROC_OPEN proc_body(b) PROC_CLOSE. 145statement ::= PYTHON SYMBOL(p) PROC_OPEN proc_body(b) PROC_CLOSE.
142 { e_proc_python (p.string(), b.string() ); 146 { e_proc_python ( lex, p.string(), b.string() );
143 p.release_this(); b.release_this(); } 147 p.release_this(); b.release_this(); }
144statement ::= PYTHON PROC_OPEN proc_body(b) PROC_CLOSE. 148statement ::= PYTHON PROC_OPEN proc_body(b) PROC_CLOSE.
145 { e_proc_python( NULL, b.string()); 149 { e_proc_python( lex, NULL, b.string());
146 b.release_this (); } 150 b.release_this (); }
147 151
148statement ::= FAKEROOT SYMBOL(p) PROC_OPEN proc_body(b) PROC_CLOSE. 152statement ::= FAKEROOT SYMBOL(p) PROC_OPEN proc_body(b) PROC_CLOSE.
149 { e_proc_fakeroot(p.string(), b.string() ); 153 { e_proc_fakeroot( lex, p.string(), b.string() );
150 p.release_this (); b.release_this (); } 154 p.release_this (); b.release_this (); }
151 155
152def_body(r) ::= def_body(l) DEF_BODY(b). 156def_body(r) ::= def_body(l) DEF_BODY(b).
153 { /* concatenate body lines */ 157 { /* concatenate body lines */
154 r.assignString( token_t::concatString(l.string(), b.string()); 158 r.assignString( token_t::concatString(l.string(), b.string()) );
155 l.release_this (); b.release_this (); 159 l.release_this (); b.release_this ();
156 } 160 }
157def_body(b) ::= . { b.sz = 0; } 161def_body(b) ::= . { b.assignString( 0 ); }
158statement ::= SYMBOL(p) DEF_ARGS(a) def_body(b). 162statement ::= SYMBOL(p) DEF_ARGS(a) def_body(b).
159 { e_def( p.string(), a.string(), b.string()); 163 { e_def( lex, p.string(), a.string(), b.string());
160 p.release_this(); a.release_this(); b.release_this(); } 164 p.release_this(); a.release_this(); b.release_this(); }
161 165