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.y179
1 files changed, 0 insertions, 179 deletions
diff --git a/bitbake/lib/bb/parse/parse_c/bitbakeparser.y b/bitbake/lib/bb/parse/parse_c/bitbakeparser.y
deleted file mode 100644
index c18e53543b..0000000000
--- a/bitbake/lib/bb/parse/parse_c/bitbakeparser.y
+++ /dev/null
@@ -1,179 +0,0 @@
1/* bbp.lemon
2
3 written by Marc Singer
4 6 January 2005
5
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License as
8 published by the Free Software Foundation; either version 2 of the
9 License, or (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19 USA.
20
21 DESCRIPTION
22 -----------
23
24 lemon parser specification file for a BitBake input file parser.
25
26 Most of the interesting shenanigans are done in the lexer. The
27 BitBake grammar is not regular. In order to emit tokens that
28 the parser can properly interpret in LALR fashion, the lexer
29 manages the interpretation state. This is why there are ISYMBOLs,
30 SYMBOLS, and TSYMBOLS.
31
32 This parser was developed by reading the limited available
33 documentation for BitBake and by analyzing the available BB files.
34 There is no assertion of correctness to be made about this parser.
35
36*/
37
38%token_type {token_t}
39%name bbparse
40%token_prefix T_
41%extra_argument {lex_t* lex}
42
43%include {
44#include "token.h"
45#include "lexer.h"
46#include "python_output.h"
47}
48
49
50%token_destructor { $$.release_this (); }
51
52%syntax_error { e_parse_error( lex ); }
53
54program ::= statements.
55
56statements ::= statements statement.
57statements ::= .
58
59variable(r) ::= SYMBOL(s).
60 { r.assignString( (char*)s.string() );
61 s.assignString( 0 );
62 s.release_this(); }
63variable(r) ::= VARIABLE(v).
64 {
65 r.assignString( (char*)v.string() );
66 v.assignString( 0 );
67 v.release_this(); }
68
69statement ::= EXPORT variable(s) OP_ASSIGN STRING(v).
70 { e_assign( lex, s.string(), v.string() );
71 e_export( lex, s.string() );
72 s.release_this(); v.release_this(); }
73statement ::= EXPORT variable(s) OP_PREDOT STRING(v).
74 { e_precat( lex, s.string(), v.string() );
75 e_export( lex, s.string() );
76 s.release_this(); v.release_this(); }
77statement ::= EXPORT variable(s) OP_POSTDOT STRING(v).
78 { e_postcat( lex, s.string(), v.string() );
79 e_export( lex, s.string() );
80 s.release_this(); v.release_this(); }
81statement ::= EXPORT variable(s) OP_IMMEDIATE STRING(v).
82 { e_immediate ( lex, s.string(), v.string() );
83 e_export( lex, s.string() );
84 s.release_this(); v.release_this(); }
85statement ::= EXPORT variable(s) OP_COND STRING(v).
86 { e_cond( lex, s.string(), v.string() );
87 s.release_this(); v.release_this(); }
88
89statement ::= variable(s) OP_ASSIGN STRING(v).
90 { e_assign( lex, s.string(), v.string() );
91 s.release_this(); v.release_this(); }
92statement ::= variable(s) OP_PREDOT STRING(v).
93 { e_precat( lex, s.string(), v.string() );
94 s.release_this(); v.release_this(); }
95statement ::= variable(s) OP_POSTDOT STRING(v).
96 { e_postcat( lex, s.string(), v.string() );
97 s.release_this(); v.release_this(); }
98statement ::= variable(s) OP_PREPEND STRING(v).
99 { e_prepend( lex, s.string(), v.string() );
100 s.release_this(); v.release_this(); }
101statement ::= variable(s) OP_APPEND STRING(v).
102 { e_append( lex, s.string() , v.string() );
103 s.release_this(); v.release_this(); }
104statement ::= variable(s) OP_IMMEDIATE STRING(v).
105 { e_immediate( lex, s.string(), v.string() );
106 s.release_this(); v.release_this(); }
107statement ::= variable(s) OP_COND STRING(v).
108 { e_cond( lex, s.string(), v.string() );
109 s.release_this(); v.release_this(); }
110
111task ::= TSYMBOL(t) BEFORE TSYMBOL(b) AFTER TSYMBOL(a).
112 { e_addtask( lex, t.string(), b.string(), a.string() );
113 t.release_this(); b.release_this(); a.release_this(); }
114task ::= TSYMBOL(t) AFTER TSYMBOL(a) BEFORE TSYMBOL(b).
115 { e_addtask( lex, t.string(), b.string(), a.string());
116 t.release_this(); a.release_this(); b.release_this(); }
117task ::= TSYMBOL(t).
118 { e_addtask( lex, t.string(), NULL, NULL);
119 t.release_this();}
120task ::= TSYMBOL(t) BEFORE TSYMBOL(b).
121 { e_addtask( lex, t.string(), b.string(), NULL);
122 t.release_this(); b.release_this(); }
123task ::= TSYMBOL(t) AFTER TSYMBOL(a).
124 { e_addtask( lex, t.string(), NULL, a.string());
125 t.release_this(); a.release_this(); }
126tasks ::= tasks task.
127tasks ::= task.
128statement ::= ADDTASK tasks.
129
130statement ::= ADDHANDLER SYMBOL(s).
131 { e_addhandler( lex, s.string()); s.release_this (); }
132
133func ::= FSYMBOL(f). { e_export_func( lex, f.string()); f.release_this(); }
134funcs ::= funcs func.
135funcs ::= func.
136statement ::= EXPORT_FUNC funcs.
137
138inherit ::= ISYMBOL(i). { e_inherit( lex, i.string() ); i.release_this (); }
139inherits ::= inherits inherit.
140inherits ::= inherit.
141statement ::= INHERIT inherits.
142
143statement ::= INCLUDE ISYMBOL(i).
144 { e_include( lex, i.string() ); i.release_this(); }
145
146statement ::= REQUIRE ISYMBOL(i).
147 { e_require( lex, i.string() ); i.release_this(); }
148
149proc_body(r) ::= proc_body(l) PROC_BODY(b).
150 { /* concatenate body lines */
151 r.assignString( token_t::concatString(l.string(), b.string()) );
152 l.release_this ();
153 b.release_this ();
154 }
155proc_body(b) ::= . { b.assignString(0); }
156statement ::= variable(p) PROC_OPEN proc_body(b) PROC_CLOSE.
157 { e_proc( lex, p.string(), b.string() );
158 p.release_this(); b.release_this(); }
159statement ::= PYTHON SYMBOL(p) PROC_OPEN proc_body(b) PROC_CLOSE.
160 { e_proc_python ( lex, p.string(), b.string() );
161 p.release_this(); b.release_this(); }
162statement ::= PYTHON PROC_OPEN proc_body(b) PROC_CLOSE.
163 { e_proc_python( lex, NULL, b.string());
164 b.release_this (); }
165
166statement ::= FAKEROOT SYMBOL(p) PROC_OPEN proc_body(b) PROC_CLOSE.
167 { e_proc_fakeroot( lex, p.string(), b.string() );
168 p.release_this (); b.release_this (); }
169
170def_body(r) ::= def_body(l) DEF_BODY(b).
171 { /* concatenate body lines */
172 r.assignString( token_t::concatString(l.string(), b.string()) );
173 l.release_this (); b.release_this ();
174 }
175def_body(b) ::= . { b.assignString( 0 ); }
176statement ::= SYMBOL(p) DEF_ARGS(a) def_body(b).
177 { e_def( lex, p.string(), a.string(), b.string());
178 p.release_this(); a.release_this(); b.release_this(); }
179