- Added fixes to AST
[haanga.git] / lib / Haanga / Compiler / Parser.php
blob65f6390aa467e0112ccb7c189ec8fa59130c6ca4
1 <?php
2 /* Driver template for the PHP_Haanga_rGenerator parser generator. (PHP port of LEMON)
3 */
5 /**
6 * This can be used to store both the string representation of
7 * a token, and any useful meta-data associated with the token.
9 * meta-data should be stored as an array
11 class Haanga_yyToken implements ArrayAccess
13 public $string = '';
14 public $metadata = array();
16 function __construct($s, $m = array())
18 if ($s instanceof Haanga_yyToken) {
19 $this->string = $s->string;
20 $this->metadata = $s->metadata;
21 } else {
22 $this->string = (string) $s;
23 if ($m instanceof Haanga_yyToken) {
24 $this->metadata = $m->metadata;
25 } elseif (is_array($m)) {
26 $this->metadata = $m;
31 function __toString()
33 return $this->_string;
36 function offsetExists($offset)
38 return isset($this->metadata[$offset]);
41 function offsetGet($offset)
43 return $this->metadata[$offset];
46 function offsetSet($offset, $value)
48 if ($offset === null) {
49 if (isset($value[0])) {
50 $x = ($value instanceof Haanga_yyToken) ?
51 $value->metadata : $value;
52 $this->metadata = array_merge($this->metadata, $x);
53 return;
55 $offset = count($this->metadata);
57 if ($value === null) {
58 return;
60 if ($value instanceof Haanga_yyToken) {
61 if ($value->metadata) {
62 $this->metadata[$offset] = $value->metadata;
64 } elseif ($value) {
65 $this->metadata[$offset] = $value;
69 function offsetUnset($offset)
71 unset($this->metadata[$offset]);
75 /** The following structure represents a single element of the
76 * parser's stack. Information stored includes:
78 * + The state number for the parser at this level of the stack.
80 * + The value of the token stored at this level of the stack.
81 * (In other words, the "major" token.)
83 * + The semantic value stored at this level of the stack. This is
84 * the information used by the action routines in the grammar.
85 * It is sometimes called the "minor" token.
87 class Haanga_yyStackEntry
89 public $stateno; /* The state-number */
90 public $major; /* The major token value. This is the code
91 ** number for the token at this stack level */
92 public $minor; /* The user-supplied minor token value. This
93 ** is the value of the token */
96 // code external to the class is included here
97 #line 2 "lib/Haanga/Compiler/Parser.y"
100 +---------------------------------------------------------------------------------+
101 | Copyright (c) 2010 Haanga |
102 +---------------------------------------------------------------------------------+
103 | Redistribution and use in source and binary forms, with or without |
104 | modification, are permitted provided that the following conditions are met: |
105 | 1. Redistributions of source code must retain the above copyright |
106 | notice, this list of conditions and the following disclaimer. |
108 | 2. Redistributions in binary form must reproduce the above copyright |
109 | notice, this list of conditions and the following disclaimer in the |
110 | documentation and/or other materials provided with the distribution. |
112 | 3. All advertising materials mentioning features or use of this software |
113 | must display the following acknowledgement: |
114 | This product includes software developed by César D. Rodas. |
116 | 4. Neither the name of the César D. Rodas nor the |
117 | names of its contributors may be used to endorse or promote products |
118 | derived from this software without specific prior written permission. |
120 | THIS SOFTWARE IS PROVIDED BY CÉSAR D. RODAS ''AS IS'' AND ANY |
121 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
122 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
123 | DISCLAIMED. IN NO EVENT SHALL CÉSAR D. RODAS BE LIABLE FOR ANY |
124 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
125 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
126 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
127 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
128 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
129 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE |
130 +---------------------------------------------------------------------------------+
131 | Authors: César Rodas <crodas@php.net> |
132 +---------------------------------------------------------------------------------+
134 #line 136 "lib/Haanga/Compiler/Parser.php"
136 // declare_class is output here
137 #line 39 "lib/Haanga/Compiler/Parser.y"
138 class Haanga_Compiler_Parser #line 141 "lib/Haanga/Compiler/Parser.php"
140 /* First off, code is included which follows the "include_class" declaration
141 ** in the input file. */
142 #line 40 "lib/Haanga/Compiler/Parser.y"
145 #line 149 "lib/Haanga/Compiler/Parser.php"
147 /* Next is all token values, as class constants
150 ** These constants (all generated automatically by the parser generator)
151 ** specify the various kinds of tokens (terminals) that the parser
152 ** understands.
154 ** Each symbol here is a terminal symbol in the grammar.
156 const T_OPEN_TAG = 1;
157 const T_NOT = 2;
158 const T_AND = 3;
159 const T_OR = 4;
160 const T_EQ = 5;
161 const T_NE = 6;
162 const T_GT = 7;
163 const T_GE = 8;
164 const T_LT = 9;
165 const T_LE = 10;
166 const T_IN = 11;
167 const T_PLUS = 12;
168 const T_MINUS = 13;
169 const T_TIMES = 14;
170 const T_DIV = 15;
171 const T_MOD = 16;
172 const T_HTML = 17;
173 const T_COMMENT_OPEN = 18;
174 const T_COMMENT = 19;
175 const T_PRINT_OPEN = 20;
176 const T_PRINT_CLOSE = 21;
177 const T_EXTENDS = 22;
178 const T_CLOSE_TAG = 23;
179 const T_INCLUDE = 24;
180 const T_AUTOESCAPE = 25;
181 const T_OFF = 26;
182 const T_ON = 27;
183 const T_END_AUTOESCAPE = 28;
184 const T_CUSTOM_TAG = 29;
185 const T_AS = 30;
186 const T_CUSTOM_BLOCK = 31;
187 const T_CUSTOM_END = 32;
188 const T_BUFFER = 33;
189 const T_WITH = 34;
190 const T_ENDWITH = 35;
191 const T_LOAD = 36;
192 const T_FOR = 37;
193 const T_COMMA = 38;
194 const T_CLOSEFOR = 39;
195 const T_EMPTY = 40;
196 const T_IF = 41;
197 const T_ENDIF = 42;
198 const T_ELSE = 43;
199 const T_IFCHANGED = 44;
200 const T_ENDIFCHANGED = 45;
201 const T_IFEQUAL = 46;
202 const T_END_IFEQUAL = 47;
203 const T_IFNOTEQUAL = 48;
204 const T_END_IFNOTEQUAL = 49;
205 const T_BLOCK = 50;
206 const T_END_BLOCK = 51;
207 const T_NUMERIC = 52;
208 const T_FILTER = 53;
209 const T_END_FILTER = 54;
210 const T_REGROUP = 55;
211 const T_BY = 56;
212 const T_PIPE = 57;
213 const T_COLON = 58;
214 const T_INTL = 59;
215 const T_RPARENT = 60;
216 const T_STRING_SINGLE_INIT = 61;
217 const T_STRING_SINGLE_END = 62;
218 const T_STRING_DOUBLE_INIT = 63;
219 const T_STRING_DOUBLE_END = 64;
220 const T_STRING_CONTENT = 65;
221 const T_LPARENT = 66;
222 const T_OBJ = 67;
223 const T_ALPHA = 68;
224 const T_DOT = 69;
225 const T_BRACKETS_OPEN = 70;
226 const T_BRACKETS_CLOSE = 71;
227 const YY_NO_ACTION = 322;
228 const YY_ACCEPT_ACTION = 321;
229 const YY_ERROR_ACTION = 320;
231 /* Next are that tables used to determine what action to take based on the
232 ** current state and lookahead token. These tables are used to implement
233 ** functions that take a state number and lookahead value and return an
234 ** action integer.
236 ** Suppose the action integer is N. Then the action is determined as
237 ** follows
239 ** 0 <= N < self::YYNSTATE Shift N. That is,
240 ** push the lookahead
241 ** token onto the stack
242 ** and goto state N.
244 ** self::YYNSTATE <= N < self::YYNSTATE+self::YYNRULE Reduce by rule N-YYNSTATE.
246 ** N == self::YYNSTATE+self::YYNRULE A syntax error has occurred.
248 ** N == self::YYNSTATE+self::YYNRULE+1 The parser accepts its
249 ** input. (and concludes parsing)
251 ** N == self::YYNSTATE+self::YYNRULE+2 No such action. Denotes unused
252 ** slots in the yy_action[] table.
254 ** The action table is constructed as a single large static array $yy_action.
255 ** Given state S and lookahead X, the action is computed as
257 ** self::$yy_action[self::$yy_shift_ofst[S] + X ]
259 ** If the index value self::$yy_shift_ofst[S]+X is out of range or if the value
260 ** self::$yy_lookahead[self::$yy_shift_ofst[S]+X] is not equal to X or if
261 ** self::$yy_shift_ofst[S] is equal to self::YY_SHIFT_USE_DFLT, it means that
262 ** the action is not in the table and that self::$yy_default[S] should be used instead.
264 ** The formula above is for computing the action when the lookahead is
265 ** a terminal symbol. If the lookahead is a non-terminal (as occurs after
266 ** a reduce action) then the static $yy_reduce_ofst array is used in place of
267 ** the static $yy_shift_ofst array and self::YY_REDUCE_USE_DFLT is used in place of
268 ** self::YY_SHIFT_USE_DFLT.
270 ** The following are the tables generated in this section:
272 ** self::$yy_action A single table containing all actions.
273 ** self::$yy_lookahead A table containing the lookahead for each entry in
274 ** yy_action. Used to detect hash collisions.
275 ** self::$yy_shift_ofst For each state, the offset into self::$yy_action for
276 ** shifting terminals.
277 ** self::$yy_reduce_ofst For each state, the offset into self::$yy_action for
278 ** shifting non-terminals after a reduce.
279 ** self::$yy_default Default action for each state.
281 const YY_SZ_ACTTAB = 963;
282 static public $yy_action = array(
283 /* 0 */ 38, 170, 41, 125, 1, 192, 177, 33, 177, 150,
284 /* 10 */ 200, 79, 73, 215, 71, 75, 230, 159, 158, 28,
285 /* 20 */ 171, 142, 34, 43, 30, 49, 32, 198, 67, 189,
286 /* 30 */ 206, 42, 38, 46, 41, 125, 80, 47, 82, 33,
287 /* 40 */ 81, 150, 219, 79, 73, 180, 71, 75, 177, 89,
288 /* 50 */ 177, 28, 216, 145, 34, 186, 30, 83, 32, 149,
289 /* 60 */ 67, 78, 47, 42, 38, 46, 41, 125, 199, 215,
290 /* 70 */ 177, 33, 177, 150, 112, 79, 73, 90, 71, 75,
291 /* 80 */ 177, 235, 177, 28, 147, 133, 34, 180, 30, 143,
292 /* 90 */ 32, 47, 67, 220, 187, 42, 38, 46, 41, 125,
293 /* 100 */ 80, 86, 82, 33, 81, 150, 214, 79, 73, 180,
294 /* 110 */ 71, 75, 21, 21, 21, 28, 157, 156, 34, 180,
295 /* 120 */ 30, 185, 32, 213, 67, 321, 58, 42, 38, 46,
296 /* 130 */ 41, 125, 221, 206, 177, 33, 177, 150, 197, 79,
297 /* 140 */ 73, 169, 71, 75, 138, 138, 87, 28, 204, 163,
298 /* 150 */ 34, 154, 30, 181, 32, 201, 67, 139, 205, 42,
299 /* 160 */ 38, 46, 41, 125, 190, 119, 35, 33, 228, 150,
300 /* 170 */ 88, 79, 73, 180, 71, 75, 80, 202, 82, 28,
301 /* 180 */ 81, 165, 34, 136, 30, 203, 32, 201, 67, 94,
302 /* 190 */ 92, 42, 38, 46, 41, 125, 7, 119, 36, 33,
303 /* 200 */ 228, 150, 152, 79, 73, 196, 71, 75, 210, 224,
304 /* 210 */ 37, 28, 171, 142, 34, 43, 30, 178, 32, 164,
305 /* 220 */ 67, 137, 39, 42, 38, 46, 41, 125, 191, 217,
306 /* 230 */ 225, 33, 207, 150, 91, 79, 73, 99, 71, 75,
307 /* 240 */ 194, 95, 47, 28, 101, 4, 34, 168, 30, 175,
308 /* 250 */ 32, 164, 67, 137, 39, 42, 38, 46, 41, 125,
309 /* 260 */ 13, 171, 142, 33, 43, 150, 47, 79, 73, 237,
310 /* 270 */ 71, 75, 227, 47, 183, 28, 171, 142, 34, 43,
311 /* 280 */ 30, 135, 32, 141, 67, 195, 57, 42, 38, 46,
312 /* 290 */ 41, 125, 8, 119, 229, 33, 228, 150, 166, 79,
313 /* 300 */ 73, 117, 71, 75, 56, 232, 52, 28, 171, 142,
314 /* 310 */ 34, 43, 30, 120, 32, 119, 67, 66, 228, 42,
315 /* 320 */ 38, 46, 41, 125, 55, 130, 63, 33, 53, 150,
316 /* 330 */ 109, 79, 73, 160, 71, 75, 112, 60, 164, 28,
317 /* 340 */ 137, 39, 34, 208, 30, 116, 32, 153, 67, 123,
318 /* 350 */ 54, 42, 38, 46, 41, 125, 122, 119, 108, 33,
319 /* 360 */ 228, 150, 114, 79, 73, 110, 71, 75, 111, 115,
320 /* 370 */ 118, 28, 113, 2, 34, 155, 30, 131, 32, 211,
321 /* 380 */ 67, 59, 51, 42, 38, 46, 41, 125, 6, 171,
322 /* 390 */ 142, 33, 43, 150, 65, 79, 73, 180, 71, 75,
323 /* 400 */ 48, 231, 61, 28, 171, 142, 34, 43, 30, 64,
324 /* 410 */ 32, 119, 67, 124, 228, 42, 38, 46, 41, 125,
325 /* 420 */ 20, 50, 144, 33, 62, 150, 69, 79, 73, 180,
326 /* 430 */ 71, 75, 180, 209, 180, 28, 171, 142, 34, 43,
327 /* 440 */ 30, 180, 32, 119, 67, 180, 228, 42, 38, 46,
328 /* 450 */ 41, 125, 10, 180, 180, 33, 180, 150, 180, 79,
329 /* 460 */ 73, 180, 71, 75, 180, 180, 180, 28, 171, 142,
330 /* 470 */ 34, 43, 30, 180, 32, 162, 67, 68, 180, 42,
331 /* 480 */ 38, 46, 41, 125, 16, 119, 180, 33, 228, 150,
332 /* 490 */ 180, 79, 73, 180, 71, 75, 180, 161, 129, 28,
333 /* 500 */ 171, 142, 34, 43, 30, 180, 32, 180, 67, 112,
334 /* 510 */ 180, 42, 38, 46, 41, 125, 208, 128, 180, 33,
335 /* 520 */ 180, 150, 180, 79, 73, 180, 71, 75, 112, 180,
336 /* 530 */ 180, 28, 151, 14, 34, 208, 30, 180, 32, 180,
337 /* 540 */ 67, 180, 180, 42, 38, 46, 41, 125, 5, 171,
338 /* 550 */ 142, 33, 43, 150, 180, 79, 73, 180, 71, 75,
339 /* 560 */ 180, 180, 180, 28, 171, 142, 34, 43, 30, 180,
340 /* 570 */ 32, 180, 67, 127, 180, 42, 140, 46, 38, 17,
341 /* 580 */ 41, 125, 180, 180, 112, 33, 180, 150, 180, 79,
342 /* 590 */ 73, 208, 71, 75, 180, 171, 142, 28, 43, 9,
343 /* 600 */ 34, 180, 30, 180, 32, 148, 67, 180, 180, 42,
344 /* 610 */ 38, 46, 41, 125, 18, 171, 142, 33, 43, 150,
345 /* 620 */ 180, 79, 73, 3, 71, 75, 180, 70, 180, 28,
346 /* 630 */ 171, 142, 34, 43, 30, 180, 32, 180, 67, 171,
347 /* 640 */ 142, 42, 43, 46, 15, 25, 26, 22, 22, 22,
348 /* 650 */ 22, 22, 22, 22, 27, 27, 21, 21, 21, 180,
349 /* 660 */ 171, 142, 180, 43, 164, 93, 137, 39, 180, 25,
350 /* 670 */ 26, 22, 22, 22, 22, 22, 22, 22, 27, 27,
351 /* 680 */ 21, 21, 21, 25, 26, 22, 22, 22, 22, 22,
352 /* 690 */ 22, 22, 27, 27, 21, 21, 21, 26, 22, 22,
353 /* 700 */ 22, 22, 22, 22, 22, 27, 27, 21, 21, 21,
354 /* 710 */ 22, 22, 22, 22, 22, 22, 22, 27, 27, 21,
355 /* 720 */ 21, 21, 180, 24, 176, 180, 172, 134, 182, 188,
356 /* 730 */ 193, 173, 238, 226, 223, 222, 233, 180, 212, 180,
357 /* 740 */ 85, 180, 177, 76, 177, 126, 180, 180, 180, 180,
358 /* 750 */ 177, 40, 177, 146, 236, 180, 112, 180, 180, 180,
359 /* 760 */ 177, 74, 177, 208, 112, 220, 180, 184, 180, 106,
360 /* 770 */ 179, 208, 80, 189, 82, 180, 81, 180, 180, 180,
361 /* 780 */ 80, 180, 82, 220, 81, 84, 180, 23, 180, 180,
362 /* 790 */ 80, 177, 82, 177, 81, 146, 180, 97, 180, 180,
363 /* 800 */ 40, 180, 180, 177, 180, 177, 112, 180, 180, 184,
364 /* 810 */ 180, 103, 179, 208, 220, 11, 180, 180, 180, 180,
365 /* 820 */ 180, 80, 180, 82, 180, 81, 220, 180, 180, 146,
366 /* 830 */ 180, 171, 142, 80, 43, 82, 180, 81, 146, 180,
367 /* 840 */ 112, 45, 180, 184, 12, 107, 179, 208, 146, 112,
368 /* 850 */ 180, 180, 184, 180, 174, 179, 208, 180, 146, 112,
369 /* 860 */ 171, 142, 184, 43, 104, 179, 208, 146, 77, 112,
370 /* 870 */ 234, 180, 184, 180, 105, 179, 208, 146, 112, 180,
371 /* 880 */ 180, 184, 180, 102, 179, 208, 180, 146, 112, 98,
372 /* 890 */ 44, 184, 146, 121, 179, 208, 218, 164, 112, 137,
373 /* 900 */ 39, 184, 180, 112, 132, 208, 184, 100, 146, 31,
374 /* 910 */ 208, 180, 180, 146, 164, 96, 137, 39, 72, 112,
375 /* 920 */ 180, 180, 184, 180, 112, 29, 208, 184, 19, 180,
376 /* 930 */ 167, 208, 180, 164, 180, 137, 39, 180, 180, 180,
377 /* 940 */ 164, 180, 137, 39, 171, 142, 164, 43, 137, 39,
378 /* 950 */ 180, 164, 180, 137, 39, 164, 180, 137, 39, 164,
379 /* 960 */ 180, 137, 39,
381 static public $yy_lookahead = array(
382 /* 0 */ 22, 21, 24, 25, 1, 23, 29, 29, 31, 31,
383 /* 10 */ 62, 33, 34, 65, 36, 37, 23, 39, 40, 41,
384 /* 20 */ 17, 18, 44, 20, 46, 74, 48, 62, 50, 52,
385 /* 30 */ 65, 53, 22, 55, 24, 25, 59, 57, 61, 29,
386 /* 40 */ 63, 31, 23, 33, 34, 68, 36, 37, 29, 23,
387 /* 50 */ 31, 41, 60, 43, 44, 23, 46, 23, 48, 49,
388 /* 60 */ 50, 56, 57, 53, 22, 55, 24, 25, 64, 65,
389 /* 70 */ 29, 29, 31, 31, 88, 33, 34, 23, 36, 37,
390 /* 80 */ 29, 95, 31, 41, 52, 43, 44, 68, 46, 47,
391 /* 90 */ 48, 57, 50, 52, 23, 53, 22, 55, 24, 25,
392 /* 100 */ 59, 23, 61, 29, 63, 31, 23, 33, 34, 68,
393 /* 110 */ 36, 37, 14, 15, 16, 41, 42, 43, 44, 68,
394 /* 120 */ 46, 68, 48, 23, 50, 73, 74, 53, 22, 55,
395 /* 130 */ 24, 25, 64, 65, 29, 29, 31, 31, 23, 33,
396 /* 140 */ 34, 71, 36, 37, 26, 27, 23, 41, 23, 43,
397 /* 150 */ 44, 45, 46, 23, 48, 78, 50, 52, 23, 53,
398 /* 160 */ 22, 55, 24, 25, 23, 88, 89, 29, 91, 31,
399 /* 170 */ 23, 33, 34, 68, 36, 37, 59, 23, 61, 41,
400 /* 180 */ 63, 43, 44, 45, 46, 23, 48, 78, 50, 23,
401 /* 190 */ 23, 53, 22, 55, 24, 25, 1, 88, 89, 29,
402 /* 200 */ 91, 31, 32, 33, 34, 23, 36, 37, 23, 23,
403 /* 210 */ 58, 41, 17, 18, 44, 20, 46, 19, 48, 67,
404 /* 220 */ 50, 69, 70, 53, 22, 55, 24, 25, 68, 23,
405 /* 230 */ 23, 29, 23, 31, 23, 33, 34, 23, 36, 37,
406 /* 240 */ 23, 23, 57, 41, 23, 1, 44, 45, 46, 75,
407 /* 250 */ 48, 67, 50, 69, 70, 53, 22, 55, 24, 25,
408 /* 260 */ 1, 17, 18, 29, 20, 31, 57, 33, 34, 23,
409 /* 270 */ 36, 37, 23, 57, 23, 41, 17, 18, 44, 20,
410 /* 280 */ 46, 47, 48, 78, 50, 23, 74, 53, 22, 55,
411 /* 290 */ 24, 25, 1, 88, 23, 29, 91, 31, 32, 33,
412 /* 300 */ 34, 88, 36, 37, 74, 78, 74, 41, 17, 18,
413 /* 310 */ 44, 20, 46, 88, 48, 88, 50, 74, 91, 53,
414 /* 320 */ 22, 55, 24, 25, 74, 77, 74, 29, 74, 31,
415 /* 330 */ 88, 33, 34, 35, 36, 37, 88, 74, 67, 41,
416 /* 340 */ 69, 70, 44, 95, 46, 88, 48, 78, 50, 96,
417 /* 350 */ 74, 53, 22, 55, 24, 25, 96, 88, 88, 29,
418 /* 360 */ 91, 31, 88, 33, 34, 88, 36, 37, 88, 88,
419 /* 370 */ 88, 41, 88, 1, 44, 45, 46, 91, 48, 91,
420 /* 380 */ 50, 74, 74, 53, 22, 55, 24, 25, 1, 17,
421 /* 390 */ 18, 29, 20, 31, 74, 33, 34, 97, 36, 37,
422 /* 400 */ 74, 78, 74, 41, 17, 18, 44, 20, 46, 74,
423 /* 410 */ 48, 88, 50, 51, 91, 53, 22, 55, 24, 25,
424 /* 420 */ 1, 74, 28, 29, 74, 31, 74, 33, 34, 97,
425 /* 430 */ 36, 37, 97, 78, 97, 41, 17, 18, 44, 20,
426 /* 440 */ 46, 97, 48, 88, 50, 97, 91, 53, 22, 55,
427 /* 450 */ 24, 25, 1, 97, 97, 29, 97, 31, 97, 33,
428 /* 460 */ 34, 97, 36, 37, 97, 97, 97, 41, 17, 18,
429 /* 470 */ 44, 20, 46, 97, 48, 78, 50, 51, 97, 53,
430 /* 480 */ 22, 55, 24, 25, 1, 88, 97, 29, 91, 31,
431 /* 490 */ 97, 33, 34, 97, 36, 37, 97, 39, 77, 41,
432 /* 500 */ 17, 18, 44, 20, 46, 97, 48, 97, 50, 88,
433 /* 510 */ 97, 53, 22, 55, 24, 25, 95, 77, 97, 29,
434 /* 520 */ 97, 31, 97, 33, 34, 97, 36, 37, 88, 97,
435 /* 530 */ 97, 41, 42, 1, 44, 95, 46, 97, 48, 97,
436 /* 540 */ 50, 97, 97, 53, 22, 55, 24, 25, 1, 17,
437 /* 550 */ 18, 29, 20, 31, 97, 33, 34, 97, 36, 37,
438 /* 560 */ 97, 97, 97, 41, 17, 18, 44, 20, 46, 97,
439 /* 570 */ 48, 97, 50, 77, 97, 53, 54, 55, 22, 1,
440 /* 580 */ 24, 25, 97, 97, 88, 29, 97, 31, 97, 33,
441 /* 590 */ 34, 95, 36, 37, 97, 17, 18, 41, 20, 1,
442 /* 600 */ 44, 97, 46, 97, 48, 49, 50, 97, 97, 53,
443 /* 610 */ 22, 55, 24, 25, 1, 17, 18, 29, 20, 31,
444 /* 620 */ 97, 33, 34, 1, 36, 37, 97, 30, 97, 41,
445 /* 630 */ 17, 18, 44, 20, 46, 97, 48, 97, 50, 17,
446 /* 640 */ 18, 53, 20, 55, 1, 3, 4, 5, 6, 7,
447 /* 650 */ 8, 9, 10, 11, 12, 13, 14, 15, 16, 97,
448 /* 660 */ 17, 18, 97, 20, 67, 23, 69, 70, 97, 3,
449 /* 670 */ 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
450 /* 680 */ 14, 15, 16, 3, 4, 5, 6, 7, 8, 9,
451 /* 690 */ 10, 11, 12, 13, 14, 15, 16, 4, 5, 6,
452 /* 700 */ 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
453 /* 710 */ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
454 /* 720 */ 15, 16, 97, 2, 76, 97, 60, 79, 80, 81,
455 /* 730 */ 82, 83, 84, 85, 86, 87, 23, 97, 90, 97,
456 /* 740 */ 92, 97, 29, 30, 31, 77, 97, 97, 97, 97,
457 /* 750 */ 29, 38, 31, 77, 23, 97, 88, 97, 97, 97,
458 /* 760 */ 29, 30, 31, 95, 88, 52, 97, 91, 97, 93,
459 /* 770 */ 94, 95, 59, 52, 61, 97, 63, 97, 97, 97,
460 /* 780 */ 59, 68, 61, 52, 63, 23, 97, 66, 97, 68,
461 /* 790 */ 59, 29, 61, 31, 63, 77, 97, 23, 97, 68,
462 /* 800 */ 38, 97, 97, 29, 97, 31, 88, 97, 97, 91,
463 /* 810 */ 97, 93, 94, 95, 52, 1, 97, 97, 97, 97,
464 /* 820 */ 97, 59, 97, 61, 97, 63, 52, 97, 97, 77,
465 /* 830 */ 68, 17, 18, 59, 20, 61, 97, 63, 77, 97,
466 /* 840 */ 88, 11, 68, 91, 1, 93, 94, 95, 77, 88,
467 /* 850 */ 97, 97, 91, 97, 93, 94, 95, 97, 77, 88,
468 /* 860 */ 17, 18, 91, 20, 93, 94, 95, 77, 38, 88,
469 /* 870 */ 23, 97, 91, 97, 93, 94, 95, 77, 88, 97,
470 /* 880 */ 97, 91, 97, 93, 94, 95, 97, 77, 88, 23,
471 /* 890 */ 11, 91, 77, 93, 94, 95, 23, 67, 88, 69,
472 /* 900 */ 70, 91, 97, 88, 94, 95, 91, 23, 77, 94,
473 /* 910 */ 95, 97, 97, 77, 67, 23, 69, 70, 30, 88,
474 /* 920 */ 97, 97, 91, 97, 88, 94, 95, 91, 1, 97,
475 /* 930 */ 94, 95, 97, 67, 97, 69, 70, 97, 97, 97,
476 /* 940 */ 67, 97, 69, 70, 17, 18, 67, 20, 69, 70,
477 /* 950 */ 97, 67, 97, 69, 70, 67, 97, 69, 70, 67,
478 /* 960 */ 97, 69, 70,
480 const YY_SHIFT_USE_DFLT = -53;
481 const YY_SHIFT_MAX = 168;
482 static public $yy_shift_ofst = array(
483 /* 0 */ -53, 138, 42, 10, 106, 74, -22, 170, 234, 266,
484 /* 10 */ 298, 202, 556, 490, 458, 426, 394, 362, 330, 522,
485 /* 20 */ 588, 721, 721, 721, 721, 721, 721, 721, 721, -23,
486 /* 30 */ -23, -23, -23, 731, 774, 713, 762, 41, 41, 41,
487 /* 40 */ 41, 41, 51, 51, 51, 51, 51, 51, 814, 598,
488 /* 50 */ 291, 244, 3, 372, 547, 532, 387, 451, 419, 578,
489 /* 60 */ 259, 195, 613, 622, 843, 643, 927, 105, 19, 483,
490 /* 70 */ 51, 117, 51, 51, 51, 51, 51, 51, 51, 51,
491 /* 80 */ 117, 4, -52, -53, -53, -53, -53, -53, -53, -53,
492 /* 90 */ -53, -53, -53, -53, -53, -53, -53, -53, -53, -53,
493 /* 100 */ -53, -53, 642, 666, 680, 693, 705, 705, 830, 892,
494 /* 110 */ 888, 884, 152, 597, 847, 879, 271, 873, 866, 184,
495 /* 120 */ 184, 98, 68, -35, 32, 118, 209, 185, -20, 5,
496 /* 130 */ 34, -8, 26, 54, -18, -7, 71, 160, 214, 211,
497 /* 140 */ 207, 186, 198, 206, 217, 218, 216, 251, 249, 246,
498 /* 150 */ 221, 262, 182, 70, 125, 130, 123, 115, 78, 83,
499 /* 160 */ 100, 135, 141, 167, 53, 166, 162, 147, 154,
501 const YY_REDUCE_USE_DFLT = -50;
502 const YY_REDUCE_MAX = 101;
503 static public $yy_reduce_ofst = array(
504 /* 0 */ 52, 648, 648, 648, 648, 648, 648, 648, 648, 648,
505 /* 10 */ 648, 648, 648, 648, 648, 648, 648, 648, 648, 648,
506 /* 20 */ 648, 761, 752, 718, 771, 781, 676, 800, 790, 836,
507 /* 30 */ 831, 810, 815, 77, 109, 323, 323, 355, 397, 269,
508 /* 40 */ 227, 205, 248, 440, 668, 496, 421, -14, 174, 174,
509 /* 50 */ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
510 /* 60 */ 174, 174, 174, 174, 174, 174, 174, 242, 213, 174,
511 /* 70 */ 225, 288, 280, 277, 274, 270, 257, 281, 284, 282,
512 /* 80 */ 286, 260, 253, 243, 232, 230, 250, 263, 254, 252,
513 /* 90 */ 347, 307, 326, 276, 350, 335, 320, 308, 328, 352,
514 /* 100 */ 212, -49,
516 static public $yyExpectedTokens = array(
517 /* 0 */ array(),
518 /* 1 */ array(22, 24, 25, 29, 31, 33, 34, 36, 37, 41, 43, 44, 45, 46, 48, 50, 53, 55, ),
519 /* 2 */ array(22, 24, 25, 29, 31, 33, 34, 36, 37, 41, 43, 44, 46, 47, 48, 50, 53, 55, ),
520 /* 3 */ array(22, 24, 25, 29, 31, 33, 34, 36, 37, 41, 43, 44, 46, 48, 49, 50, 53, 55, ),
521 /* 4 */ array(22, 24, 25, 29, 31, 33, 34, 36, 37, 41, 43, 44, 45, 46, 48, 50, 53, 55, ),
522 /* 5 */ array(22, 24, 25, 29, 31, 33, 34, 36, 37, 41, 42, 43, 44, 46, 48, 50, 53, 55, ),
523 /* 6 */ array(22, 24, 25, 29, 31, 33, 34, 36, 37, 39, 40, 41, 44, 46, 48, 50, 53, 55, ),
524 /* 7 */ array(22, 24, 25, 29, 31, 32, 33, 34, 36, 37, 41, 44, 46, 48, 50, 53, 55, ),
525 /* 8 */ array(22, 24, 25, 29, 31, 33, 34, 36, 37, 41, 44, 46, 47, 48, 50, 53, 55, ),
526 /* 9 */ array(22, 24, 25, 29, 31, 32, 33, 34, 36, 37, 41, 44, 46, 48, 50, 53, 55, ),
527 /* 10 */ array(22, 24, 25, 29, 31, 33, 34, 35, 36, 37, 41, 44, 46, 48, 50, 53, 55, ),
528 /* 11 */ array(22, 24, 25, 29, 31, 33, 34, 36, 37, 41, 44, 45, 46, 48, 50, 53, 55, ),
529 /* 12 */ array(22, 24, 25, 29, 31, 33, 34, 36, 37, 41, 44, 46, 48, 49, 50, 53, 55, ),
530 /* 13 */ array(22, 24, 25, 29, 31, 33, 34, 36, 37, 41, 42, 44, 46, 48, 50, 53, 55, ),
531 /* 14 */ array(22, 24, 25, 29, 31, 33, 34, 36, 37, 39, 41, 44, 46, 48, 50, 53, 55, ),
532 /* 15 */ array(22, 24, 25, 29, 31, 33, 34, 36, 37, 41, 44, 46, 48, 50, 51, 53, 55, ),
533 /* 16 */ array(22, 24, 25, 28, 29, 31, 33, 34, 36, 37, 41, 44, 46, 48, 50, 53, 55, ),
534 /* 17 */ array(22, 24, 25, 29, 31, 33, 34, 36, 37, 41, 44, 46, 48, 50, 51, 53, 55, ),
535 /* 18 */ array(22, 24, 25, 29, 31, 33, 34, 36, 37, 41, 44, 45, 46, 48, 50, 53, 55, ),
536 /* 19 */ array(22, 24, 25, 29, 31, 33, 34, 36, 37, 41, 44, 46, 48, 50, 53, 54, 55, ),
537 /* 20 */ array(22, 24, 25, 29, 31, 33, 34, 36, 37, 41, 44, 46, 48, 50, 53, 55, ),
538 /* 21 */ array(2, 29, 31, 52, 59, 61, 63, 66, 68, ),
539 /* 22 */ array(2, 29, 31, 52, 59, 61, 63, 66, 68, ),
540 /* 23 */ array(2, 29, 31, 52, 59, 61, 63, 66, 68, ),
541 /* 24 */ array(2, 29, 31, 52, 59, 61, 63, 66, 68, ),
542 /* 25 */ array(2, 29, 31, 52, 59, 61, 63, 66, 68, ),
543 /* 26 */ array(2, 29, 31, 52, 59, 61, 63, 66, 68, ),
544 /* 27 */ array(2, 29, 31, 52, 59, 61, 63, 66, 68, ),
545 /* 28 */ array(2, 29, 31, 52, 59, 61, 63, 66, 68, ),
546 /* 29 */ array(29, 31, 52, 59, 61, 63, 68, ),
547 /* 30 */ array(29, 31, 52, 59, 61, 63, 68, ),
548 /* 31 */ array(29, 31, 52, 59, 61, 63, 68, ),
549 /* 32 */ array(29, 31, 52, 59, 61, 63, 68, ),
550 /* 33 */ array(23, 29, 30, 31, 52, 59, 61, 63, 68, ),
551 /* 34 */ array(23, 29, 31, 52, 59, 61, 63, 68, ),
552 /* 35 */ array(23, 29, 30, 31, 38, 52, 59, 61, 63, 68, ),
553 /* 36 */ array(23, 29, 31, 38, 52, 59, 61, 63, 68, ),
554 /* 37 */ array(29, 31, 52, 59, 61, 63, 68, ),
555 /* 38 */ array(29, 31, 52, 59, 61, 63, 68, ),
556 /* 39 */ array(29, 31, 52, 59, 61, 63, 68, ),
557 /* 40 */ array(29, 31, 52, 59, 61, 63, 68, ),
558 /* 41 */ array(29, 31, 52, 59, 61, 63, 68, ),
559 /* 42 */ array(29, 31, 68, ),
560 /* 43 */ array(29, 31, 68, ),
561 /* 44 */ array(29, 31, 68, ),
562 /* 45 */ array(29, 31, 68, ),
563 /* 46 */ array(29, 31, 68, ),
564 /* 47 */ array(29, 31, 68, ),
565 /* 48 */ array(1, 17, 18, 20, ),
566 /* 49 */ array(1, 17, 18, 20, ),
567 /* 50 */ array(1, 17, 18, 20, ),
568 /* 51 */ array(1, 17, 18, 20, ),
569 /* 52 */ array(1, 17, 18, 20, ),
570 /* 53 */ array(1, 17, 18, 20, ),
571 /* 54 */ array(1, 17, 18, 20, ),
572 /* 55 */ array(1, 17, 18, 20, ),
573 /* 56 */ array(1, 17, 18, 20, ),
574 /* 57 */ array(1, 17, 18, 20, ),
575 /* 58 */ array(1, 17, 18, 20, ),
576 /* 59 */ array(1, 17, 18, 20, ),
577 /* 60 */ array(1, 17, 18, 20, ),
578 /* 61 */ array(1, 17, 18, 20, ),
579 /* 62 */ array(1, 17, 18, 20, ),
580 /* 63 */ array(1, 17, 18, 20, ),
581 /* 64 */ array(1, 17, 18, 20, ),
582 /* 65 */ array(1, 17, 18, 20, ),
583 /* 66 */ array(1, 17, 18, 20, ),
584 /* 67 */ array(29, 31, 52, 68, ),
585 /* 68 */ array(23, 29, 31, 68, ),
586 /* 69 */ array(1, 17, 18, 20, ),
587 /* 70 */ array(29, 31, 68, ),
588 /* 71 */ array(59, 61, 63, ),
589 /* 72 */ array(29, 31, 68, ),
590 /* 73 */ array(29, 31, 68, ),
591 /* 74 */ array(29, 31, 68, ),
592 /* 75 */ array(29, 31, 68, ),
593 /* 76 */ array(29, 31, 68, ),
594 /* 77 */ array(29, 31, 68, ),
595 /* 78 */ array(29, 31, 68, ),
596 /* 79 */ array(29, 31, 68, ),
597 /* 80 */ array(59, 61, 63, ),
598 /* 81 */ array(64, 65, ),
599 /* 82 */ array(62, 65, ),
600 /* 83 */ array(),
601 /* 84 */ array(),
602 /* 85 */ array(),
603 /* 86 */ array(),
604 /* 87 */ array(),
605 /* 88 */ array(),
606 /* 89 */ array(),
607 /* 90 */ array(),
608 /* 91 */ array(),
609 /* 92 */ array(),
610 /* 93 */ array(),
611 /* 94 */ array(),
612 /* 95 */ array(),
613 /* 96 */ array(),
614 /* 97 */ array(),
615 /* 98 */ array(),
616 /* 99 */ array(),
617 /* 100 */ array(),
618 /* 101 */ array(),
619 /* 102 */ array(3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 23, ),
620 /* 103 */ array(3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 60, ),
621 /* 104 */ array(3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, ),
622 /* 105 */ array(4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, ),
623 /* 106 */ array(5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, ),
624 /* 107 */ array(5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, ),
625 /* 108 */ array(11, 38, 67, 69, 70, ),
626 /* 109 */ array(23, 67, 69, 70, ),
627 /* 110 */ array(30, 67, 69, 70, ),
628 /* 111 */ array(23, 67, 69, 70, ),
629 /* 112 */ array(58, 67, 69, 70, ),
630 /* 113 */ array(30, 67, 69, 70, ),
631 /* 114 */ array(23, 67, 69, 70, ),
632 /* 115 */ array(11, 67, 69, 70, ),
633 /* 116 */ array(23, 67, 69, 70, ),
634 /* 117 */ array(23, 67, 69, 70, ),
635 /* 118 */ array(23, 67, 69, 70, ),
636 /* 119 */ array(67, 69, 70, ),
637 /* 120 */ array(67, 69, 70, ),
638 /* 121 */ array(14, 15, 16, ),
639 /* 122 */ array(64, 65, ),
640 /* 123 */ array(62, 65, ),
641 /* 124 */ array(23, 52, ),
642 /* 125 */ array(26, 27, ),
643 /* 126 */ array(23, 57, ),
644 /* 127 */ array(23, 57, ),
645 /* 128 */ array(21, 57, ),
646 /* 129 */ array(56, 57, ),
647 /* 130 */ array(23, 57, ),
648 /* 131 */ array(60, ),
649 /* 132 */ array(23, ),
650 /* 133 */ array(23, ),
651 /* 134 */ array(23, ),
652 /* 135 */ array(23, ),
653 /* 136 */ array(23, ),
654 /* 137 */ array(68, ),
655 /* 138 */ array(23, ),
656 /* 139 */ array(23, ),
657 /* 140 */ array(23, ),
658 /* 141 */ array(23, ),
659 /* 142 */ array(19, ),
660 /* 143 */ array(23, ),
661 /* 144 */ array(23, ),
662 /* 145 */ array(23, ),
663 /* 146 */ array(57, ),
664 /* 147 */ array(23, ),
665 /* 148 */ array(23, ),
666 /* 149 */ array(23, ),
667 /* 150 */ array(23, ),
668 /* 151 */ array(23, ),
669 /* 152 */ array(23, ),
670 /* 153 */ array(71, ),
671 /* 154 */ array(23, ),
672 /* 155 */ array(23, ),
673 /* 156 */ array(23, ),
674 /* 157 */ array(23, ),
675 /* 158 */ array(23, ),
676 /* 159 */ array(23, ),
677 /* 160 */ array(23, ),
678 /* 161 */ array(23, ),
679 /* 162 */ array(23, ),
680 /* 163 */ array(23, ),
681 /* 164 */ array(68, ),
682 /* 165 */ array(23, ),
683 /* 166 */ array(23, ),
684 /* 167 */ array(23, ),
685 /* 168 */ array(23, ),
686 /* 169 */ array(),
687 /* 170 */ array(),
688 /* 171 */ array(),
689 /* 172 */ array(),
690 /* 173 */ array(),
691 /* 174 */ array(),
692 /* 175 */ array(),
693 /* 176 */ array(),
694 /* 177 */ array(),
695 /* 178 */ array(),
696 /* 179 */ array(),
697 /* 180 */ array(),
698 /* 181 */ array(),
699 /* 182 */ array(),
700 /* 183 */ array(),
701 /* 184 */ array(),
702 /* 185 */ array(),
703 /* 186 */ array(),
704 /* 187 */ array(),
705 /* 188 */ array(),
706 /* 189 */ array(),
707 /* 190 */ array(),
708 /* 191 */ array(),
709 /* 192 */ array(),
710 /* 193 */ array(),
711 /* 194 */ array(),
712 /* 195 */ array(),
713 /* 196 */ array(),
714 /* 197 */ array(),
715 /* 198 */ array(),
716 /* 199 */ array(),
717 /* 200 */ array(),
718 /* 201 */ array(),
719 /* 202 */ array(),
720 /* 203 */ array(),
721 /* 204 */ array(),
722 /* 205 */ array(),
723 /* 206 */ array(),
724 /* 207 */ array(),
725 /* 208 */ array(),
726 /* 209 */ array(),
727 /* 210 */ array(),
728 /* 211 */ array(),
729 /* 212 */ array(),
730 /* 213 */ array(),
731 /* 214 */ array(),
732 /* 215 */ array(),
733 /* 216 */ array(),
734 /* 217 */ array(),
735 /* 218 */ array(),
736 /* 219 */ array(),
737 /* 220 */ array(),
738 /* 221 */ array(),
739 /* 222 */ array(),
740 /* 223 */ array(),
741 /* 224 */ array(),
742 /* 225 */ array(),
743 /* 226 */ array(),
744 /* 227 */ array(),
745 /* 228 */ array(),
746 /* 229 */ array(),
747 /* 230 */ array(),
748 /* 231 */ array(),
749 /* 232 */ array(),
750 /* 233 */ array(),
751 /* 234 */ array(),
752 /* 235 */ array(),
753 /* 236 */ array(),
754 /* 237 */ array(),
755 /* 238 */ array(),
757 static public $yy_default = array(
758 /* 0 */ 241, 320, 320, 320, 320, 320, 320, 320, 320, 320,
759 /* 10 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
760 /* 20 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
761 /* 30 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
762 /* 40 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
763 /* 50 */ 320, 320, 320, 320, 320, 320, 320, 320, 239, 320,
764 /* 60 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
765 /* 70 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
766 /* 80 */ 320, 320, 320, 241, 241, 241, 241, 241, 241, 241,
767 /* 90 */ 241, 241, 241, 241, 241, 241, 241, 241, 241, 241,
768 /* 100 */ 241, 241, 320, 320, 307, 308, 309, 311, 320, 320,
769 /* 110 */ 320, 320, 290, 320, 320, 320, 320, 320, 320, 294,
770 /* 120 */ 286, 310, 320, 320, 320, 320, 320, 320, 320, 320,
771 /* 130 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
772 /* 140 */ 320, 320, 320, 320, 320, 320, 297, 320, 320, 320,
773 /* 150 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
774 /* 160 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 317,
775 /* 170 */ 245, 243, 313, 251, 312, 240, 242, 319, 244, 314,
776 /* 180 */ 318, 276, 248, 284, 299, 315, 283, 274, 249, 298,
777 /* 190 */ 246, 316, 247, 250, 257, 272, 263, 271, 303, 302,
778 /* 200 */ 301, 293, 275, 262, 273, 270, 305, 268, 288, 289,
779 /* 210 */ 267, 266, 265, 264, 269, 306, 300, 277, 282, 281,
780 /* 220 */ 295, 304, 256, 255, 253, 285, 254, 280, 296, 261,
781 /* 230 */ 278, 291, 292, 260, 259, 287, 258, 279, 252,
783 /* The next thing included is series of defines which control
784 ** various aspects of the generated parser.
785 ** self::YYNOCODE is a number which corresponds
786 ** to no legal terminal or nonterminal number. This
787 ** number is used to fill in empty slots of the hash
788 ** table.
789 ** self::YYFALLBACK If defined, this indicates that one or more tokens
790 ** have fall-back values which should be used if the
791 ** original value of the token will not parse.
792 ** self::YYSTACKDEPTH is the maximum depth of the parser's stack.
793 ** self::YYNSTATE the combined number of states.
794 ** self::YYNRULE the number of rules in the grammar
795 ** self::YYERRORSYMBOL is the code number of the error symbol. If not
796 ** defined, then do no error processing.
798 const YYNOCODE = 98;
799 const YYSTACKDEPTH = 100;
800 const YYNSTATE = 239;
801 const YYNRULE = 81;
802 const YYERRORSYMBOL = 72;
803 const YYERRSYMDT = 'yy0';
804 const YYFALLBACK = 0;
805 /** The next table maps tokens into fallback tokens. If a construct
806 * like the following:
808 * %fallback ID X Y Z.
810 * appears in the grammer, then ID becomes a fallback token for X, Y,
811 * and Z. Whenever one of the tokens X, Y, or Z is input to the parser
812 * but it does not parse, the type of the token is changed to ID and
813 * the parse is retried before an error is thrown.
815 static public $yyFallback = array(
818 * Turn parser tracing on by giving a stream to which to write the trace
819 * and a prompt to preface each trace message. Tracing is turned off
820 * by making either argument NULL
822 * Inputs:
824 * - A stream resource to which trace output should be written.
825 * If NULL, then tracing is turned off.
826 * - A prefix string written at the beginning of every
827 * line of trace output. If NULL, then tracing is
828 * turned off.
830 * Outputs:
832 * - None.
833 * @param resource
834 * @param string
836 static function Trace($TraceFILE, $zTracePrompt)
838 if (!$TraceFILE) {
839 $zTracePrompt = 0;
840 } elseif (!$zTracePrompt) {
841 $TraceFILE = 0;
843 self::$yyTraceFILE = $TraceFILE;
844 self::$yyTracePrompt = $zTracePrompt;
848 * Output debug information to output (php://output stream)
850 static function PrintTrace()
852 self::$yyTraceFILE = fopen('php://output', 'w');
853 self::$yyTracePrompt = '';
857 * @var resource|0
859 static public $yyTraceFILE;
861 * String to prepend to debug output
862 * @var string|0
864 static public $yyTracePrompt;
866 * @var int
868 public $yyidx; /* Index of top element in stack */
870 * @var int
872 public $yyerrcnt; /* Shifts left before out of the error */
874 * @var array
876 public $yystack = array(); /* The parser's stack */
879 * For tracing shifts, the names of all terminals and nonterminals
880 * are required. The following table supplies these names
881 * @var array
883 static public $yyTokenName = array(
884 '$', 'T_OPEN_TAG', 'T_NOT', 'T_AND',
885 'T_OR', 'T_EQ', 'T_NE', 'T_GT',
886 'T_GE', 'T_LT', 'T_LE', 'T_IN',
887 'T_PLUS', 'T_MINUS', 'T_TIMES', 'T_DIV',
888 'T_MOD', 'T_HTML', 'T_COMMENT_OPEN', 'T_COMMENT',
889 'T_PRINT_OPEN', 'T_PRINT_CLOSE', 'T_EXTENDS', 'T_CLOSE_TAG',
890 'T_INCLUDE', 'T_AUTOESCAPE', 'T_OFF', 'T_ON',
891 'T_END_AUTOESCAPE', 'T_CUSTOM_TAG', 'T_AS', 'T_CUSTOM_BLOCK',
892 'T_CUSTOM_END', 'T_BUFFER', 'T_WITH', 'T_ENDWITH',
893 'T_LOAD', 'T_FOR', 'T_COMMA', 'T_CLOSEFOR',
894 'T_EMPTY', 'T_IF', 'T_ENDIF', 'T_ELSE',
895 'T_IFCHANGED', 'T_ENDIFCHANGED', 'T_IFEQUAL', 'T_END_IFEQUAL',
896 'T_IFNOTEQUAL', 'T_END_IFNOTEQUAL', 'T_BLOCK', 'T_END_BLOCK',
897 'T_NUMERIC', 'T_FILTER', 'T_END_FILTER', 'T_REGROUP',
898 'T_BY', 'T_PIPE', 'T_COLON', 'T_INTL',
899 'T_RPARENT', 'T_STRING_SINGLE_INIT', 'T_STRING_SINGLE_END', 'T_STRING_DOUBLE_INIT',
900 'T_STRING_DOUBLE_END', 'T_STRING_CONTENT', 'T_LPARENT', 'T_OBJ',
901 'T_ALPHA', 'T_DOT', 'T_BRACKETS_OPEN', 'T_BRACKETS_CLOSE',
902 'error', 'start', 'body', 'code',
903 'stmts', 'filtered_var', 'var_or_string', 'stmt',
904 'for_stmt', 'ifchanged_stmt', 'block_stmt', 'filter_stmt',
905 'if_stmt', 'custom_tag', 'alias', 'ifequal',
906 'varname', 'var_list', 'regroup', 'string',
907 'for_def', 'expr', 'fvar_or_string', 'varname_args',
908 's_content',
912 * For tracing reduce actions, the names of all rules are required.
913 * @var array
915 static public $yyRuleName = array(
916 /* 0 */ "start ::= body",
917 /* 1 */ "body ::= body code",
918 /* 2 */ "body ::=",
919 /* 3 */ "code ::= T_OPEN_TAG stmts",
920 /* 4 */ "code ::= T_HTML",
921 /* 5 */ "code ::= T_COMMENT_OPEN T_COMMENT",
922 /* 6 */ "code ::= T_PRINT_OPEN filtered_var T_PRINT_CLOSE",
923 /* 7 */ "stmts ::= T_EXTENDS var_or_string T_CLOSE_TAG",
924 /* 8 */ "stmts ::= stmt T_CLOSE_TAG",
925 /* 9 */ "stmts ::= for_stmt",
926 /* 10 */ "stmts ::= ifchanged_stmt",
927 /* 11 */ "stmts ::= block_stmt",
928 /* 12 */ "stmts ::= filter_stmt",
929 /* 13 */ "stmts ::= if_stmt",
930 /* 14 */ "stmts ::= T_INCLUDE var_or_string T_CLOSE_TAG",
931 /* 15 */ "stmts ::= custom_tag",
932 /* 16 */ "stmts ::= alias",
933 /* 17 */ "stmts ::= ifequal",
934 /* 18 */ "stmts ::= T_AUTOESCAPE T_OFF|T_ON T_CLOSE_TAG body T_OPEN_TAG T_END_AUTOESCAPE T_CLOSE_TAG",
935 /* 19 */ "custom_tag ::= T_CUSTOM_TAG T_CLOSE_TAG",
936 /* 20 */ "custom_tag ::= T_CUSTOM_TAG T_AS varname T_CLOSE_TAG",
937 /* 21 */ "custom_tag ::= T_CUSTOM_TAG var_list T_CLOSE_TAG",
938 /* 22 */ "custom_tag ::= T_CUSTOM_TAG var_list T_AS varname T_CLOSE_TAG",
939 /* 23 */ "custom_tag ::= T_CUSTOM_BLOCK T_CLOSE_TAG body T_OPEN_TAG T_CUSTOM_END T_CLOSE_TAG",
940 /* 24 */ "custom_tag ::= T_BUFFER varname T_CLOSE_TAG body T_OPEN_TAG T_CUSTOM_END T_CLOSE_TAG",
941 /* 25 */ "alias ::= T_WITH varname T_AS varname T_CLOSE_TAG body T_OPEN_TAG T_ENDWITH T_CLOSE_TAG",
942 /* 26 */ "stmt ::= regroup",
943 /* 27 */ "stmt ::= T_LOAD string",
944 /* 28 */ "for_def ::= T_FOR varname T_IN filtered_var T_CLOSE_TAG",
945 /* 29 */ "for_def ::= T_FOR varname T_COMMA varname T_IN filtered_var T_CLOSE_TAG",
946 /* 30 */ "for_stmt ::= for_def body T_OPEN_TAG T_CLOSEFOR T_CLOSE_TAG",
947 /* 31 */ "for_stmt ::= for_def body T_OPEN_TAG T_EMPTY T_CLOSE_TAG body T_OPEN_TAG T_CLOSEFOR T_CLOSE_TAG",
948 /* 32 */ "if_stmt ::= T_IF expr T_CLOSE_TAG body T_OPEN_TAG T_ENDIF T_CLOSE_TAG",
949 /* 33 */ "if_stmt ::= T_IF expr T_CLOSE_TAG body T_OPEN_TAG T_ELSE T_CLOSE_TAG body T_OPEN_TAG T_ENDIF T_CLOSE_TAG",
950 /* 34 */ "ifchanged_stmt ::= T_IFCHANGED T_CLOSE_TAG body T_OPEN_TAG T_ENDIFCHANGED T_CLOSE_TAG",
951 /* 35 */ "ifchanged_stmt ::= T_IFCHANGED var_list T_CLOSE_TAG body T_OPEN_TAG T_ENDIFCHANGED T_CLOSE_TAG",
952 /* 36 */ "ifchanged_stmt ::= T_IFCHANGED T_CLOSE_TAG body T_OPEN_TAG T_ELSE T_CLOSE_TAG body T_OPEN_TAG T_ENDIFCHANGED T_CLOSE_TAG",
953 /* 37 */ "ifchanged_stmt ::= T_IFCHANGED var_list T_CLOSE_TAG body T_OPEN_TAG T_ELSE T_CLOSE_TAG body T_OPEN_TAG T_ENDIFCHANGED T_CLOSE_TAG",
954 /* 38 */ "ifequal ::= T_IFEQUAL fvar_or_string fvar_or_string T_CLOSE_TAG body T_OPEN_TAG T_END_IFEQUAL T_CLOSE_TAG",
955 /* 39 */ "ifequal ::= T_IFEQUAL fvar_or_string fvar_or_string T_CLOSE_TAG body T_OPEN_TAG T_ELSE T_CLOSE_TAG body T_OPEN_TAG T_END_IFEQUAL T_CLOSE_TAG",
956 /* 40 */ "ifequal ::= T_IFNOTEQUAL fvar_or_string fvar_or_string T_CLOSE_TAG body T_OPEN_TAG T_END_IFNOTEQUAL T_CLOSE_TAG",
957 /* 41 */ "ifequal ::= T_IFNOTEQUAL fvar_or_string fvar_or_string T_CLOSE_TAG body T_OPEN_TAG T_ELSE T_CLOSE_TAG body T_OPEN_TAG T_END_IFNOTEQUAL T_CLOSE_TAG",
958 /* 42 */ "block_stmt ::= T_BLOCK varname T_CLOSE_TAG body T_OPEN_TAG T_END_BLOCK T_CLOSE_TAG",
959 /* 43 */ "block_stmt ::= T_BLOCK varname T_CLOSE_TAG body T_OPEN_TAG T_END_BLOCK varname T_CLOSE_TAG",
960 /* 44 */ "block_stmt ::= T_BLOCK T_NUMERIC T_CLOSE_TAG body T_OPEN_TAG T_END_BLOCK T_CLOSE_TAG",
961 /* 45 */ "block_stmt ::= T_BLOCK T_NUMERIC T_CLOSE_TAG body T_OPEN_TAG T_END_BLOCK T_NUMERIC T_CLOSE_TAG",
962 /* 46 */ "filter_stmt ::= T_FILTER filtered_var T_CLOSE_TAG body T_OPEN_TAG T_END_FILTER T_CLOSE_TAG",
963 /* 47 */ "regroup ::= T_REGROUP filtered_var T_BY varname T_AS varname",
964 /* 48 */ "filtered_var ::= filtered_var T_PIPE varname_args",
965 /* 49 */ "filtered_var ::= varname_args",
966 /* 50 */ "varname_args ::= varname T_COLON var_or_string",
967 /* 51 */ "varname_args ::= varname",
968 /* 52 */ "var_list ::= var_list var_or_string",
969 /* 53 */ "var_list ::= var_list T_COMMA var_or_string",
970 /* 54 */ "var_list ::= var_or_string",
971 /* 55 */ "var_or_string ::= varname",
972 /* 56 */ "var_or_string ::= T_NUMERIC",
973 /* 57 */ "var_or_string ::= string",
974 /* 58 */ "fvar_or_string ::= filtered_var",
975 /* 59 */ "fvar_or_string ::= T_NUMERIC",
976 /* 60 */ "fvar_or_string ::= string",
977 /* 61 */ "string ::= T_INTL string T_RPARENT",
978 /* 62 */ "string ::= T_STRING_SINGLE_INIT T_STRING_SINGLE_END",
979 /* 63 */ "string ::= T_STRING_DOUBLE_INIT T_STRING_DOUBLE_END",
980 /* 64 */ "string ::= T_STRING_SINGLE_INIT s_content T_STRING_SINGLE_END",
981 /* 65 */ "string ::= T_STRING_DOUBLE_INIT s_content T_STRING_DOUBLE_END",
982 /* 66 */ "s_content ::= s_content T_STRING_CONTENT",
983 /* 67 */ "s_content ::= T_STRING_CONTENT",
984 /* 68 */ "expr ::= T_NOT expr",
985 /* 69 */ "expr ::= expr T_AND expr",
986 /* 70 */ "expr ::= expr T_OR expr",
987 /* 71 */ "expr ::= expr T_PLUS|T_MINUS expr",
988 /* 72 */ "expr ::= expr T_EQ|T_NE|T_GT|T_GE|T_LT|T_LE|T_IN expr",
989 /* 73 */ "expr ::= expr T_TIMES|T_DIV|T_MOD expr",
990 /* 74 */ "expr ::= T_LPARENT expr T_RPARENT",
991 /* 75 */ "expr ::= fvar_or_string",
992 /* 76 */ "varname ::= varname T_OBJ T_ALPHA",
993 /* 77 */ "varname ::= varname T_DOT T_ALPHA",
994 /* 78 */ "varname ::= varname T_BRACKETS_OPEN var_or_string T_BRACKETS_CLOSE",
995 /* 79 */ "varname ::= T_ALPHA",
996 /* 80 */ "varname ::= T_CUSTOM_TAG|T_CUSTOM_BLOCK",
1000 * This function returns the symbolic name associated with a token
1001 * value.
1002 * @param int
1003 * @return string
1005 function tokenName($tokenType)
1007 if ($tokenType === 0) {
1008 return 'End of Input';
1010 if ($tokenType > 0 && $tokenType < count(self::$yyTokenName)) {
1011 return self::$yyTokenName[$tokenType];
1012 } else {
1013 return "Unknown";
1018 * The following function deletes the value associated with a
1019 * symbol. The symbol can be either a terminal or nonterminal.
1020 * @param int the symbol code
1021 * @param mixed the symbol's value
1023 static function yy_destructor($yymajor, $yypminor)
1025 switch ($yymajor) {
1026 /* Here is inserted the actions which take place when a
1027 ** terminal or non-terminal is destroyed. This can happen
1028 ** when the symbol is popped from the stack during a
1029 ** reduce or during error processing or when a parser is
1030 ** being destroyed before it is finished parsing.
1032 ** Note: during a reduce, the only symbols destroyed are those
1033 ** which appear on the RHS of the rule, but which are not used
1034 ** inside the C code.
1036 default: break; /* If no destructor action specified: do nothing */
1041 * Pop the parser's stack once.
1043 * If there is a destructor routine associated with the token which
1044 * is popped from the stack, then call it.
1046 * Return the major token number for the symbol popped.
1047 * @param Haanga_yyParser
1048 * @return int
1050 function yy_pop_parser_stack()
1052 if (!count($this->yystack)) {
1053 return;
1055 $yytos = array_pop($this->yystack);
1056 if (self::$yyTraceFILE && $this->yyidx >= 0) {
1057 fwrite(self::$yyTraceFILE,
1058 self::$yyTracePrompt . 'Popping ' . self::$yyTokenName[$yytos->major] .
1059 "\n");
1061 $yymajor = $yytos->major;
1062 self::yy_destructor($yymajor, $yytos->minor);
1063 $this->yyidx--;
1064 return $yymajor;
1068 * Deallocate and destroy a parser. Destructors are all called for
1069 * all stack elements before shutting the parser down.
1071 function __destruct()
1073 while ($this->yyidx >= 0) {
1074 $this->yy_pop_parser_stack();
1076 if (is_resource(self::$yyTraceFILE)) {
1077 fclose(self::$yyTraceFILE);
1082 * Based on the current state and parser stack, get a list of all
1083 * possible lookahead tokens
1084 * @param int
1085 * @return array
1087 function yy_get_expected_tokens($token)
1089 $state = $this->yystack[$this->yyidx]->stateno;
1090 $expected = self::$yyExpectedTokens[$state];
1091 if (in_array($token, self::$yyExpectedTokens[$state], true)) {
1092 return $expected;
1094 $stack = $this->yystack;
1095 $yyidx = $this->yyidx;
1096 do {
1097 $yyact = $this->yy_find_shift_action($token);
1098 if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) {
1099 // reduce action
1100 $done = 0;
1101 do {
1102 if ($done++ == 100) {
1103 $this->yyidx = $yyidx;
1104 $this->yystack = $stack;
1105 // too much recursion prevents proper detection
1106 // so give up
1107 return array_unique($expected);
1109 $yyruleno = $yyact - self::YYNSTATE;
1110 $this->yyidx -= self::$yyRuleInfo[$yyruleno]['rhs'];
1111 $nextstate = $this->yy_find_reduce_action(
1112 $this->yystack[$this->yyidx]->stateno,
1113 self::$yyRuleInfo[$yyruleno]['lhs']);
1114 if (isset(self::$yyExpectedTokens[$nextstate])) {
1115 $expected += self::$yyExpectedTokens[$nextstate];
1116 if (in_array($token,
1117 self::$yyExpectedTokens[$nextstate], true)) {
1118 $this->yyidx = $yyidx;
1119 $this->yystack = $stack;
1120 return array_unique($expected);
1123 if ($nextstate < self::YYNSTATE) {
1124 // we need to shift a non-terminal
1125 $this->yyidx++;
1126 $x = new Haanga_yyStackEntry;
1127 $x->stateno = $nextstate;
1128 $x->major = self::$yyRuleInfo[$yyruleno]['lhs'];
1129 $this->yystack[$this->yyidx] = $x;
1130 continue 2;
1131 } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) {
1132 $this->yyidx = $yyidx;
1133 $this->yystack = $stack;
1134 // the last token was just ignored, we can't accept
1135 // by ignoring input, this is in essence ignoring a
1136 // syntax error!
1137 return array_unique($expected);
1138 } elseif ($nextstate === self::YY_NO_ACTION) {
1139 $this->yyidx = $yyidx;
1140 $this->yystack = $stack;
1141 // input accepted, but not shifted (I guess)
1142 return $expected;
1143 } else {
1144 $yyact = $nextstate;
1146 } while (true);
1148 break;
1149 } while (true);
1150 return array_unique($expected);
1154 * Based on the parser state and current parser stack, determine whether
1155 * the lookahead token is possible.
1157 * The parser will convert the token value to an error token if not. This
1158 * catches some unusual edge cases where the parser would fail.
1159 * @param int
1160 * @return bool
1162 function yy_is_expected_token($token)
1164 if ($token === 0) {
1165 return true; // 0 is not part of this
1167 $state = $this->yystack[$this->yyidx]->stateno;
1168 if (in_array($token, self::$yyExpectedTokens[$state], true)) {
1169 return true;
1171 $stack = $this->yystack;
1172 $yyidx = $this->yyidx;
1173 do {
1174 $yyact = $this->yy_find_shift_action($token);
1175 if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) {
1176 // reduce action
1177 $done = 0;
1178 do {
1179 if ($done++ == 100) {
1180 $this->yyidx = $yyidx;
1181 $this->yystack = $stack;
1182 // too much recursion prevents proper detection
1183 // so give up
1184 return true;
1186 $yyruleno = $yyact - self::YYNSTATE;
1187 $this->yyidx -= self::$yyRuleInfo[$yyruleno]['rhs'];
1188 $nextstate = $this->yy_find_reduce_action(
1189 $this->yystack[$this->yyidx]->stateno,
1190 self::$yyRuleInfo[$yyruleno]['lhs']);
1191 if (isset(self::$yyExpectedTokens[$nextstate]) &&
1192 in_array($token, self::$yyExpectedTokens[$nextstate], true)) {
1193 $this->yyidx = $yyidx;
1194 $this->yystack = $stack;
1195 return true;
1197 if ($nextstate < self::YYNSTATE) {
1198 // we need to shift a non-terminal
1199 $this->yyidx++;
1200 $x = new Haanga_yyStackEntry;
1201 $x->stateno = $nextstate;
1202 $x->major = self::$yyRuleInfo[$yyruleno]['lhs'];
1203 $this->yystack[$this->yyidx] = $x;
1204 continue 2;
1205 } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) {
1206 $this->yyidx = $yyidx;
1207 $this->yystack = $stack;
1208 if (!$token) {
1209 // end of input: this is valid
1210 return true;
1212 // the last token was just ignored, we can't accept
1213 // by ignoring input, this is in essence ignoring a
1214 // syntax error!
1215 return false;
1216 } elseif ($nextstate === self::YY_NO_ACTION) {
1217 $this->yyidx = $yyidx;
1218 $this->yystack = $stack;
1219 // input accepted, but not shifted (I guess)
1220 return true;
1221 } else {
1222 $yyact = $nextstate;
1224 } while (true);
1226 break;
1227 } while (true);
1228 $this->yyidx = $yyidx;
1229 $this->yystack = $stack;
1230 return true;
1234 * Find the appropriate action for a parser given the terminal
1235 * look-ahead token iLookAhead.
1237 * If the look-ahead token is YYNOCODE, then check to see if the action is
1238 * independent of the look-ahead. If it is, return the action, otherwise
1239 * return YY_NO_ACTION.
1240 * @param int The look-ahead token
1242 function yy_find_shift_action($iLookAhead)
1244 $stateno = $this->yystack[$this->yyidx]->stateno;
1246 /* if ($this->yyidx < 0) return self::YY_NO_ACTION; */
1247 if (!isset(self::$yy_shift_ofst[$stateno])) {
1248 // no shift actions
1249 return self::$yy_default[$stateno];
1251 $i = self::$yy_shift_ofst[$stateno];
1252 if ($i === self::YY_SHIFT_USE_DFLT) {
1253 return self::$yy_default[$stateno];
1255 if ($iLookAhead == self::YYNOCODE) {
1256 return self::YY_NO_ACTION;
1258 $i += $iLookAhead;
1259 if ($i < 0 || $i >= self::YY_SZ_ACTTAB ||
1260 self::$yy_lookahead[$i] != $iLookAhead) {
1261 if (count(self::$yyFallback) && $iLookAhead < count(self::$yyFallback)
1262 && ($iFallback = self::$yyFallback[$iLookAhead]) != 0) {
1263 if (self::$yyTraceFILE) {
1264 fwrite(self::$yyTraceFILE, self::$yyTracePrompt . "FALLBACK " .
1265 self::$yyTokenName[$iLookAhead] . " => " .
1266 self::$yyTokenName[$iFallback] . "\n");
1268 return $this->yy_find_shift_action($iFallback);
1270 return self::$yy_default[$stateno];
1271 } else {
1272 return self::$yy_action[$i];
1277 * Find the appropriate action for a parser given the non-terminal
1278 * look-ahead token $iLookAhead.
1280 * If the look-ahead token is self::YYNOCODE, then check to see if the action is
1281 * independent of the look-ahead. If it is, return the action, otherwise
1282 * return self::YY_NO_ACTION.
1283 * @param int Current state number
1284 * @param int The look-ahead token
1286 function yy_find_reduce_action($stateno, $iLookAhead)
1288 /* $stateno = $this->yystack[$this->yyidx]->stateno; */
1290 if (!isset(self::$yy_reduce_ofst[$stateno])) {
1291 return self::$yy_default[$stateno];
1293 $i = self::$yy_reduce_ofst[$stateno];
1294 if ($i == self::YY_REDUCE_USE_DFLT) {
1295 return self::$yy_default[$stateno];
1297 if ($iLookAhead == self::YYNOCODE) {
1298 return self::YY_NO_ACTION;
1300 $i += $iLookAhead;
1301 if ($i < 0 || $i >= self::YY_SZ_ACTTAB ||
1302 self::$yy_lookahead[$i] != $iLookAhead) {
1303 return self::$yy_default[$stateno];
1304 } else {
1305 return self::$yy_action[$i];
1310 * Perform a shift action.
1311 * @param int The new state to shift in
1312 * @param int The major token to shift in
1313 * @param mixed the minor token to shift in
1315 function yy_shift($yyNewState, $yyMajor, $yypMinor)
1317 $this->yyidx++;
1318 if ($this->yyidx >= self::YYSTACKDEPTH) {
1319 $this->yyidx--;
1320 if (self::$yyTraceFILE) {
1321 fprintf(self::$yyTraceFILE, "%sStack Overflow!\n", self::$yyTracePrompt);
1323 while ($this->yyidx >= 0) {
1324 $this->yy_pop_parser_stack();
1326 /* Here code is inserted which will execute if the parser
1327 ** stack ever overflows */
1328 return;
1330 $yytos = new Haanga_yyStackEntry;
1331 $yytos->stateno = $yyNewState;
1332 $yytos->major = $yyMajor;
1333 $yytos->minor = $yypMinor;
1334 array_push($this->yystack, $yytos);
1335 if (self::$yyTraceFILE && $this->yyidx > 0) {
1336 fprintf(self::$yyTraceFILE, "%sShift %d\n", self::$yyTracePrompt,
1337 $yyNewState);
1338 fprintf(self::$yyTraceFILE, "%sStack:", self::$yyTracePrompt);
1339 for($i = 1; $i <= $this->yyidx; $i++) {
1340 fprintf(self::$yyTraceFILE, " %s",
1341 self::$yyTokenName[$this->yystack[$i]->major]);
1343 fwrite(self::$yyTraceFILE,"\n");
1348 * The following table contains information about every rule that
1349 * is used during the reduce.
1351 * <pre>
1352 * array(
1353 * array(
1354 * int $lhs; Symbol on the left-hand side of the rule
1355 * int $nrhs; Number of right-hand side symbols in the rule
1356 * ),...
1357 * );
1358 * </pre>
1360 static public $yyRuleInfo = array(
1361 array( 'lhs' => 73, 'rhs' => 1 ),
1362 array( 'lhs' => 74, 'rhs' => 2 ),
1363 array( 'lhs' => 74, 'rhs' => 0 ),
1364 array( 'lhs' => 75, 'rhs' => 2 ),
1365 array( 'lhs' => 75, 'rhs' => 1 ),
1366 array( 'lhs' => 75, 'rhs' => 2 ),
1367 array( 'lhs' => 75, 'rhs' => 3 ),
1368 array( 'lhs' => 76, 'rhs' => 3 ),
1369 array( 'lhs' => 76, 'rhs' => 2 ),
1370 array( 'lhs' => 76, 'rhs' => 1 ),
1371 array( 'lhs' => 76, 'rhs' => 1 ),
1372 array( 'lhs' => 76, 'rhs' => 1 ),
1373 array( 'lhs' => 76, 'rhs' => 1 ),
1374 array( 'lhs' => 76, 'rhs' => 1 ),
1375 array( 'lhs' => 76, 'rhs' => 3 ),
1376 array( 'lhs' => 76, 'rhs' => 1 ),
1377 array( 'lhs' => 76, 'rhs' => 1 ),
1378 array( 'lhs' => 76, 'rhs' => 1 ),
1379 array( 'lhs' => 76, 'rhs' => 7 ),
1380 array( 'lhs' => 85, 'rhs' => 2 ),
1381 array( 'lhs' => 85, 'rhs' => 4 ),
1382 array( 'lhs' => 85, 'rhs' => 3 ),
1383 array( 'lhs' => 85, 'rhs' => 5 ),
1384 array( 'lhs' => 85, 'rhs' => 6 ),
1385 array( 'lhs' => 85, 'rhs' => 7 ),
1386 array( 'lhs' => 86, 'rhs' => 9 ),
1387 array( 'lhs' => 79, 'rhs' => 1 ),
1388 array( 'lhs' => 79, 'rhs' => 2 ),
1389 array( 'lhs' => 92, 'rhs' => 5 ),
1390 array( 'lhs' => 92, 'rhs' => 7 ),
1391 array( 'lhs' => 80, 'rhs' => 5 ),
1392 array( 'lhs' => 80, 'rhs' => 9 ),
1393 array( 'lhs' => 84, 'rhs' => 7 ),
1394 array( 'lhs' => 84, 'rhs' => 11 ),
1395 array( 'lhs' => 81, 'rhs' => 6 ),
1396 array( 'lhs' => 81, 'rhs' => 7 ),
1397 array( 'lhs' => 81, 'rhs' => 10 ),
1398 array( 'lhs' => 81, 'rhs' => 11 ),
1399 array( 'lhs' => 87, 'rhs' => 8 ),
1400 array( 'lhs' => 87, 'rhs' => 12 ),
1401 array( 'lhs' => 87, 'rhs' => 8 ),
1402 array( 'lhs' => 87, 'rhs' => 12 ),
1403 array( 'lhs' => 82, 'rhs' => 7 ),
1404 array( 'lhs' => 82, 'rhs' => 8 ),
1405 array( 'lhs' => 82, 'rhs' => 7 ),
1406 array( 'lhs' => 82, 'rhs' => 8 ),
1407 array( 'lhs' => 83, 'rhs' => 7 ),
1408 array( 'lhs' => 90, 'rhs' => 6 ),
1409 array( 'lhs' => 77, 'rhs' => 3 ),
1410 array( 'lhs' => 77, 'rhs' => 1 ),
1411 array( 'lhs' => 95, 'rhs' => 3 ),
1412 array( 'lhs' => 95, 'rhs' => 1 ),
1413 array( 'lhs' => 89, 'rhs' => 2 ),
1414 array( 'lhs' => 89, 'rhs' => 3 ),
1415 array( 'lhs' => 89, 'rhs' => 1 ),
1416 array( 'lhs' => 78, 'rhs' => 1 ),
1417 array( 'lhs' => 78, 'rhs' => 1 ),
1418 array( 'lhs' => 78, 'rhs' => 1 ),
1419 array( 'lhs' => 94, 'rhs' => 1 ),
1420 array( 'lhs' => 94, 'rhs' => 1 ),
1421 array( 'lhs' => 94, 'rhs' => 1 ),
1422 array( 'lhs' => 91, 'rhs' => 3 ),
1423 array( 'lhs' => 91, 'rhs' => 2 ),
1424 array( 'lhs' => 91, 'rhs' => 2 ),
1425 array( 'lhs' => 91, 'rhs' => 3 ),
1426 array( 'lhs' => 91, 'rhs' => 3 ),
1427 array( 'lhs' => 96, 'rhs' => 2 ),
1428 array( 'lhs' => 96, 'rhs' => 1 ),
1429 array( 'lhs' => 93, 'rhs' => 2 ),
1430 array( 'lhs' => 93, 'rhs' => 3 ),
1431 array( 'lhs' => 93, 'rhs' => 3 ),
1432 array( 'lhs' => 93, 'rhs' => 3 ),
1433 array( 'lhs' => 93, 'rhs' => 3 ),
1434 array( 'lhs' => 93, 'rhs' => 3 ),
1435 array( 'lhs' => 93, 'rhs' => 3 ),
1436 array( 'lhs' => 93, 'rhs' => 1 ),
1437 array( 'lhs' => 88, 'rhs' => 3 ),
1438 array( 'lhs' => 88, 'rhs' => 3 ),
1439 array( 'lhs' => 88, 'rhs' => 4 ),
1440 array( 'lhs' => 88, 'rhs' => 1 ),
1441 array( 'lhs' => 88, 'rhs' => 1 ),
1445 * The following table contains a mapping of reduce action to method name
1446 * that handles the reduction.
1448 * If a rule is not set, it has no handler.
1450 static public $yyReduceMap = array(
1451 0 => 0,
1452 1 => 1,
1453 2 => 2,
1454 3 => 3,
1455 9 => 3,
1456 10 => 3,
1457 11 => 3,
1458 12 => 3,
1459 13 => 3,
1460 15 => 3,
1461 16 => 3,
1462 17 => 3,
1463 26 => 3,
1464 51 => 3,
1465 67 => 3,
1466 75 => 3,
1467 79 => 3,
1468 80 => 3,
1469 4 => 4,
1470 5 => 5,
1471 6 => 6,
1472 7 => 7,
1473 8 => 8,
1474 61 => 8,
1475 14 => 14,
1476 18 => 18,
1477 19 => 19,
1478 20 => 20,
1479 21 => 21,
1480 22 => 22,
1481 23 => 23,
1482 24 => 24,
1483 25 => 25,
1484 27 => 27,
1485 28 => 28,
1486 29 => 29,
1487 30 => 30,
1488 31 => 31,
1489 32 => 32,
1490 33 => 33,
1491 34 => 34,
1492 35 => 35,
1493 36 => 36,
1494 37 => 37,
1495 38 => 38,
1496 39 => 39,
1497 40 => 40,
1498 41 => 41,
1499 42 => 42,
1500 44 => 42,
1501 43 => 43,
1502 45 => 43,
1503 46 => 46,
1504 47 => 47,
1505 48 => 48,
1506 53 => 48,
1507 49 => 49,
1508 54 => 49,
1509 50 => 50,
1510 52 => 52,
1511 55 => 55,
1512 56 => 56,
1513 59 => 56,
1514 57 => 57,
1515 60 => 57,
1516 58 => 58,
1517 62 => 62,
1518 63 => 62,
1519 64 => 64,
1520 65 => 64,
1521 66 => 66,
1522 68 => 68,
1523 69 => 69,
1524 70 => 69,
1525 71 => 69,
1526 73 => 69,
1527 72 => 72,
1528 74 => 74,
1529 76 => 76,
1530 77 => 77,
1531 78 => 78,
1533 /* Beginning here are the reduction cases. A typical example
1534 ** follows:
1535 ** #line <lineno> <grammarfile>
1536 ** function yy_r0($yymsp){ ... } // User supplied code
1537 ** #line <lineno> <thisfile>
1539 #line 66 "lib/Haanga/Compiler/Parser.y"
1540 function yy_r0(){ $this->body = $this->yystack[$this->yyidx + 0]->minor; }
1541 #line 1547 "lib/Haanga/Compiler/Parser.php"
1542 #line 68 "lib/Haanga/Compiler/Parser.y"
1543 function yy_r1(){ $this->_retvalue=$this->yystack[$this->yyidx + -1]->minor; $this->_retvalue[] = $this->yystack[$this->yyidx + 0]->minor; }
1544 #line 1550 "lib/Haanga/Compiler/Parser.php"
1545 #line 69 "lib/Haanga/Compiler/Parser.y"
1546 function yy_r2(){ $this->_retvalue = array(); }
1547 #line 1553 "lib/Haanga/Compiler/Parser.php"
1548 #line 72 "lib/Haanga/Compiler/Parser.y"
1549 function yy_r3(){ $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; }
1550 #line 1556 "lib/Haanga/Compiler/Parser.php"
1551 #line 73 "lib/Haanga/Compiler/Parser.y"
1552 function yy_r4(){ $this->_retvalue = array('operation' => 'html', 'html' => $this->yystack[$this->yyidx + 0]->minor); }
1553 #line 1559 "lib/Haanga/Compiler/Parser.php"
1554 #line 74 "lib/Haanga/Compiler/Parser.y"
1555 function yy_r5(){ $this->yystack[$this->yyidx + 0]->minor=rtrim($this->yystack[$this->yyidx + 0]->minor); $this->_retvalue = array('operation' => 'comment', 'comment' => substr($this->yystack[$this->yyidx + 0]->minor, 0, strlen($this->yystack[$this->yyidx + 0]->minor)-2)); }
1556 #line 1562 "lib/Haanga/Compiler/Parser.php"
1557 #line 75 "lib/Haanga/Compiler/Parser.y"
1558 function yy_r6(){ $this->_retvalue = array('operation' => 'print_var', 'variable' => $this->yystack[$this->yyidx + -1]->minor); }
1559 #line 1565 "lib/Haanga/Compiler/Parser.php"
1560 #line 77 "lib/Haanga/Compiler/Parser.y"
1561 function yy_r7(){ $this->_retvalue = array('operation' => 'base', $this->yystack[$this->yyidx + -1]->minor); }
1562 #line 1568 "lib/Haanga/Compiler/Parser.php"
1563 #line 78 "lib/Haanga/Compiler/Parser.y"
1564 function yy_r8(){ $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; }
1565 #line 1571 "lib/Haanga/Compiler/Parser.php"
1566 #line 84 "lib/Haanga/Compiler/Parser.y"
1567 function yy_r14(){ $this->_retvalue = array('operation' => 'include', $this->yystack[$this->yyidx + -1]->minor); }
1568 #line 1574 "lib/Haanga/Compiler/Parser.php"
1569 #line 88 "lib/Haanga/Compiler/Parser.y"
1570 function yy_r18(){ $this->_retvalue = array('operation' => 'autoescape', 'value' => strtolower(@$this->yystack[$this->yyidx + -5]->minor), 'body' => $this->yystack[$this->yyidx + -3]->minor); }
1571 #line 1577 "lib/Haanga/Compiler/Parser.php"
1572 #line 93 "lib/Haanga/Compiler/Parser.y"
1573 function yy_r19(){ $this->_retvalue = array('operation' => 'custom_tag', 'name' => $this->yystack[$this->yyidx + -1]->minor, 'list'=>array()); }
1574 #line 1580 "lib/Haanga/Compiler/Parser.php"
1575 #line 94 "lib/Haanga/Compiler/Parser.y"
1576 function yy_r20(){ $this->_retvalue = array('operation' => 'custom_tag', 'name' => $this->yystack[$this->yyidx + -3]->minor, 'as' => $this->yystack[$this->yyidx + -1]->minor, 'list'=>array()); }
1577 #line 1583 "lib/Haanga/Compiler/Parser.php"
1578 #line 95 "lib/Haanga/Compiler/Parser.y"
1579 function yy_r21(){ $this->_retvalue = array('operation' => 'custom_tag', 'name' => $this->yystack[$this->yyidx + -2]->minor, 'list' => $this->yystack[$this->yyidx + -1]->minor); }
1580 #line 1586 "lib/Haanga/Compiler/Parser.php"
1581 #line 96 "lib/Haanga/Compiler/Parser.y"
1582 function yy_r22(){ $this->_retvalue = array('operation' => 'custom_tag', 'name' => $this->yystack[$this->yyidx + -4]->minor, 'as' => $this->yystack[$this->yyidx + -1]->minor, 'list' => $this->yystack[$this->yyidx + -3]->minor); }
1583 #line 1589 "lib/Haanga/Compiler/Parser.php"
1584 #line 98 "lib/Haanga/Compiler/Parser.y"
1585 function yy_r23(){ if ('end'.$this->yystack[$this->yyidx + -5]->minor != $this->yystack[$this->yyidx + -1]->minor) { throw new Exception("Unexpected ".$this->yystack[$this->yyidx + -1]->minor); } $this->_retvalue = array('operation' => 'custom_tag', 'name' => $this->yystack[$this->yyidx + -5]->minor, 'body' => $this->yystack[$this->yyidx + -3]->minor, 'list' => array()); }
1586 #line 1592 "lib/Haanga/Compiler/Parser.php"
1587 #line 99 "lib/Haanga/Compiler/Parser.y"
1588 function yy_r24(){ if ('endbuffer' != $this->yystack[$this->yyidx + -1]->minor) { throw new Exception("Unexpected ".$this->yystack[$this->yyidx + -1]->minor); } $this->_retvalue = array('operation' => 'buffer', 'name' => $this->yystack[$this->yyidx + -5]->minor, 'body' => $this->yystack[$this->yyidx + -3]->minor); }
1589 #line 1595 "lib/Haanga/Compiler/Parser.php"
1590 #line 102 "lib/Haanga/Compiler/Parser.y"
1591 function yy_r25(){ $this->_retvalue = array('operation' => 'alias', 'var' => $this->yystack[$this->yyidx + -7]->minor, 'as' => $this->yystack[$this->yyidx + -5]->minor, 'body' => $this->yystack[$this->yyidx + -3]->minor); }
1592 #line 1598 "lib/Haanga/Compiler/Parser.php"
1593 #line 106 "lib/Haanga/Compiler/Parser.y"
1594 function yy_r27(){
1595 if (!is_file($this->yystack[$this->yyidx + 0]->minor)) {
1596 throw new Haanga_Compiler_Exception($this->yystack[$this->yyidx + 0]->minor." is not a valid file");
1598 require_once $this->yystack[$this->yyidx + 0]->minor;
1600 #line 1606 "lib/Haanga/Compiler/Parser.php"
1601 #line 114 "lib/Haanga/Compiler/Parser.y"
1602 function yy_r28(){
1603 $this->compiler->set_context($this->yystack[$this->yyidx + -3]->minor, array());
1604 $this->_retvalue = array('operation' => 'loop', 'variable' => $this->yystack[$this->yyidx + -3]->minor, 'index' => NULL, 'array' => $this->yystack[$this->yyidx + -1]->minor);
1606 #line 1612 "lib/Haanga/Compiler/Parser.php"
1607 #line 119 "lib/Haanga/Compiler/Parser.y"
1608 function yy_r29(){
1609 $this->compiler->set_context($this->yystack[$this->yyidx + -3]->minor, array());
1610 $this->_retvalue = array('operation' => 'loop', 'variable' => $this->yystack[$this->yyidx + -3]->minor, 'index' => $this->yystack[$this->yyidx + -5]->minor, 'array' => $this->yystack[$this->yyidx + -1]->minor);
1612 #line 1618 "lib/Haanga/Compiler/Parser.php"
1613 #line 125 "lib/Haanga/Compiler/Parser.y"
1614 function yy_r30(){
1615 $this->_retvalue = $this->yystack[$this->yyidx + -4]->minor;
1616 $this->_retvalue['body'] = $this->yystack[$this->yyidx + -3]->minor;
1618 #line 1624 "lib/Haanga/Compiler/Parser.php"
1619 #line 130 "lib/Haanga/Compiler/Parser.y"
1620 function yy_r31(){
1621 $this->_retvalue = $this->yystack[$this->yyidx + -8]->minor;
1622 $this->_retvalue['body'] = $this->yystack[$this->yyidx + -7]->minor;
1623 $this->_retvalue['empty'] = $this->yystack[$this->yyidx + -3]->minor;
1625 #line 1631 "lib/Haanga/Compiler/Parser.php"
1626 #line 136 "lib/Haanga/Compiler/Parser.y"
1627 function yy_r32(){ $this->_retvalue = array('operation' => 'if', 'expr' => $this->yystack[$this->yyidx + -5]->minor, 'body' => $this->yystack[$this->yyidx + -3]->minor); }
1628 #line 1634 "lib/Haanga/Compiler/Parser.php"
1629 #line 137 "lib/Haanga/Compiler/Parser.y"
1630 function yy_r33(){ $this->_retvalue = array('operation' => 'if', 'expr' => $this->yystack[$this->yyidx + -9]->minor, 'body' => $this->yystack[$this->yyidx + -7]->minor, 'else' => $this->yystack[$this->yyidx + -3]->minor); }
1631 #line 1637 "lib/Haanga/Compiler/Parser.php"
1632 #line 140 "lib/Haanga/Compiler/Parser.y"
1633 function yy_r34(){
1634 $this->_retvalue = array('operation' => 'ifchanged', 'body' => $this->yystack[$this->yyidx + -3]->minor);
1636 #line 1642 "lib/Haanga/Compiler/Parser.php"
1637 #line 144 "lib/Haanga/Compiler/Parser.y"
1638 function yy_r35(){
1639 $this->_retvalue = array('operation' => 'ifchanged', 'body' => $this->yystack[$this->yyidx + -3]->minor, 'check' => $this->yystack[$this->yyidx + -5]->minor);
1641 #line 1647 "lib/Haanga/Compiler/Parser.php"
1642 #line 147 "lib/Haanga/Compiler/Parser.y"
1643 function yy_r36(){
1644 $this->_retvalue = array('operation' => 'ifchanged', 'body' => $this->yystack[$this->yyidx + -7]->minor, 'else' => $this->yystack[$this->yyidx + -3]->minor);
1646 #line 1652 "lib/Haanga/Compiler/Parser.php"
1647 #line 151 "lib/Haanga/Compiler/Parser.y"
1648 function yy_r37(){
1649 $this->_retvalue = array('operation' => 'ifchanged', 'body' => $this->yystack[$this->yyidx + -7]->minor, 'check' => $this->yystack[$this->yyidx + -9]->minor, 'else' => $this->yystack[$this->yyidx + -3]->minor);
1651 #line 1657 "lib/Haanga/Compiler/Parser.php"
1652 #line 156 "lib/Haanga/Compiler/Parser.y"
1653 function yy_r38(){ $this->_retvalue = array('operation' => 'ifequal', 'cmp' => '==', 1 => $this->yystack[$this->yyidx + -6]->minor, 2 => $this->yystack[$this->yyidx + -5]->minor, 'body' => $this->yystack[$this->yyidx + -3]->minor); }
1654 #line 1660 "lib/Haanga/Compiler/Parser.php"
1655 #line 157 "lib/Haanga/Compiler/Parser.y"
1656 function yy_r39(){ $this->_retvalue = array('operation' => 'ifequal', 'cmp' => '==', 1 => $this->yystack[$this->yyidx + -10]->minor, 2 => $this->yystack[$this->yyidx + -9]->minor, 'body' => $this->yystack[$this->yyidx + -7]->minor, 'else' => $this->yystack[$this->yyidx + -3]->minor); }
1657 #line 1663 "lib/Haanga/Compiler/Parser.php"
1658 #line 158 "lib/Haanga/Compiler/Parser.y"
1659 function yy_r40(){ $this->_retvalue = array('operation' => 'ifequal', 'cmp' => '!=', 1 => $this->yystack[$this->yyidx + -6]->minor, 2 => $this->yystack[$this->yyidx + -5]->minor, 'body' => $this->yystack[$this->yyidx + -3]->minor); }
1660 #line 1666 "lib/Haanga/Compiler/Parser.php"
1661 #line 159 "lib/Haanga/Compiler/Parser.y"
1662 function yy_r41(){ $this->_retvalue = array('operation' => 'ifequal', 'cmp' => '!=', 1 => $this->yystack[$this->yyidx + -10]->minor, 2 => $this->yystack[$this->yyidx + -9]->minor, 'body' => $this->yystack[$this->yyidx + -7]->minor, 'else' => $this->yystack[$this->yyidx + -3]->minor); }
1663 #line 1669 "lib/Haanga/Compiler/Parser.php"
1664 #line 163 "lib/Haanga/Compiler/Parser.y"
1665 function yy_r42(){ $this->_retvalue = array('operation' => 'block', 'name' => $this->yystack[$this->yyidx + -5]->minor, 'body' => $this->yystack[$this->yyidx + -3]->minor); }
1666 #line 1672 "lib/Haanga/Compiler/Parser.php"
1667 #line 165 "lib/Haanga/Compiler/Parser.y"
1668 function yy_r43(){ $this->_retvalue = array('operation' => 'block', 'name' => $this->yystack[$this->yyidx + -6]->minor, 'body' => $this->yystack[$this->yyidx + -4]->minor); }
1669 #line 1675 "lib/Haanga/Compiler/Parser.php"
1670 #line 172 "lib/Haanga/Compiler/Parser.y"
1671 function yy_r46(){ $this->_retvalue = array('operation' => 'filter', 'functions' => $this->yystack[$this->yyidx + -5]->minor, 'body' => $this->yystack[$this->yyidx + -3]->minor); }
1672 #line 1678 "lib/Haanga/Compiler/Parser.php"
1673 #line 175 "lib/Haanga/Compiler/Parser.y"
1674 function yy_r47(){ $this->_retvalue=array('operation' => 'regroup', 'array' => $this->yystack[$this->yyidx + -4]->minor, 'row' => $this->yystack[$this->yyidx + -2]->minor, 'as' => $this->yystack[$this->yyidx + 0]->minor); }
1675 #line 1681 "lib/Haanga/Compiler/Parser.php"
1676 #line 178 "lib/Haanga/Compiler/Parser.y"
1677 function yy_r48(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor; $this->_retvalue[] = $this->yystack[$this->yyidx + 0]->minor; }
1678 #line 1684 "lib/Haanga/Compiler/Parser.php"
1679 #line 179 "lib/Haanga/Compiler/Parser.y"
1680 function yy_r49(){ $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor); }
1681 #line 1687 "lib/Haanga/Compiler/Parser.php"
1682 #line 181 "lib/Haanga/Compiler/Parser.y"
1683 function yy_r50(){ $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor, 'args'=>array($this->yystack[$this->yyidx + 0]->minor)); }
1684 #line 1690 "lib/Haanga/Compiler/Parser.php"
1685 #line 185 "lib/Haanga/Compiler/Parser.y"
1686 function yy_r52(){ $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; $this->_retvalue[] = $this->yystack[$this->yyidx + 0]->minor; }
1687 #line 1693 "lib/Haanga/Compiler/Parser.php"
1688 #line 191 "lib/Haanga/Compiler/Parser.y"
1689 function yy_r55(){ $this->_retvalue = array('var' => $this->yystack[$this->yyidx + 0]->minor); }
1690 #line 1696 "lib/Haanga/Compiler/Parser.php"
1691 #line 192 "lib/Haanga/Compiler/Parser.y"
1692 function yy_r56(){ $this->_retvalue = array('number' => $this->yystack[$this->yyidx + 0]->minor); }
1693 #line 1699 "lib/Haanga/Compiler/Parser.php"
1694 #line 193 "lib/Haanga/Compiler/Parser.y"
1695 function yy_r57(){ $this->_retvalue = array('string' => $this->yystack[$this->yyidx + 0]->minor); }
1696 #line 1702 "lib/Haanga/Compiler/Parser.php"
1697 #line 195 "lib/Haanga/Compiler/Parser.y"
1698 function yy_r58(){ $this->_retvalue = array('var_filter' => $this->yystack[$this->yyidx + 0]->minor); }
1699 #line 1705 "lib/Haanga/Compiler/Parser.php"
1700 #line 201 "lib/Haanga/Compiler/Parser.y"
1701 function yy_r62(){ $this->_retvalue = ""; }
1702 #line 1708 "lib/Haanga/Compiler/Parser.php"
1703 #line 203 "lib/Haanga/Compiler/Parser.y"
1704 function yy_r64(){ $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; }
1705 #line 1711 "lib/Haanga/Compiler/Parser.php"
1706 #line 205 "lib/Haanga/Compiler/Parser.y"
1707 function yy_r66(){ $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; }
1708 #line 1714 "lib/Haanga/Compiler/Parser.php"
1709 #line 209 "lib/Haanga/Compiler/Parser.y"
1710 function yy_r68(){ $this->_retvalue = array('op_expr' => 'not', $this->yystack[$this->yyidx + 0]->minor); }
1711 #line 1717 "lib/Haanga/Compiler/Parser.php"
1712 #line 210 "lib/Haanga/Compiler/Parser.y"
1713 function yy_r69(){ $this->_retvalue = array('op_expr' => @$this->yystack[$this->yyidx + -1]->minor, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor); }
1714 #line 1720 "lib/Haanga/Compiler/Parser.php"
1715 #line 213 "lib/Haanga/Compiler/Parser.y"
1716 function yy_r72(){ $this->_retvalue = array('op_expr' => trim(@$this->yystack[$this->yyidx + -1]->minor), $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor); }
1717 #line 1723 "lib/Haanga/Compiler/Parser.php"
1718 #line 215 "lib/Haanga/Compiler/Parser.y"
1719 function yy_r74(){ $this->_retvalue = array('op_expr' => 'expr', $this->yystack[$this->yyidx + -1]->minor); }
1720 #line 1726 "lib/Haanga/Compiler/Parser.php"
1721 #line 219 "lib/Haanga/Compiler/Parser.y"
1722 function yy_r76(){ if (!is_array($this->yystack[$this->yyidx + -2]->minor)) { $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor); } else { $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor; } $this->_retvalue[]=array('object' => $this->yystack[$this->yyidx + 0]->minor); }
1723 #line 1729 "lib/Haanga/Compiler/Parser.php"
1724 #line 220 "lib/Haanga/Compiler/Parser.y"
1725 function yy_r77(){ if (!is_array($this->yystack[$this->yyidx + -2]->minor)) { $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor); } else { $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor; } $this->_retvalue[] = ($this->compiler->var_is_object($this->_retvalue)) ? array('object' => $this->yystack[$this->yyidx + 0]->minor) : $this->yystack[$this->yyidx + 0]->minor; }
1726 #line 1732 "lib/Haanga/Compiler/Parser.php"
1727 #line 221 "lib/Haanga/Compiler/Parser.y"
1728 function yy_r78(){ if (!is_array($this->yystack[$this->yyidx + -3]->minor)) { $this->_retvalue = array($this->yystack[$this->yyidx + -3]->minor); } else { $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor; } $this->_retvalue[]=$this->yystack[$this->yyidx + -1]->minor; }
1729 #line 1735 "lib/Haanga/Compiler/Parser.php"
1732 * placeholder for the left hand side in a reduce operation.
1734 * For a parser with a rule like this:
1735 * <pre>
1736 * rule(A) ::= B. { A = 1; }
1737 * </pre>
1739 * The parser will translate to something like:
1741 * <code>
1742 * function yy_r0(){$this->_retvalue = 1;}
1743 * </code>
1745 private $_retvalue;
1748 * Perform a reduce action and the shift that must immediately
1749 * follow the reduce.
1751 * For a rule such as:
1753 * <pre>
1754 * A ::= B blah C. { dosomething(); }
1755 * </pre>
1757 * This function will first call the action, if any, ("dosomething();" in our
1758 * example), and then it will pop three states from the stack,
1759 * one for each entry on the right-hand side of the expression
1760 * (B, blah, and C in our example rule), and then push the result of the action
1761 * back on to the stack with the resulting state reduced to (as described in the .out
1762 * file)
1763 * @param int Number of the rule by which to reduce
1765 function yy_reduce($yyruleno)
1767 //int $yygoto; /* The next state */
1768 //int $yyact; /* The next action */
1769 //mixed $yygotominor; /* The LHS of the rule reduced */
1770 //Haanga_yyStackEntry $yymsp; /* The top of the parser's stack */
1771 //int $yysize; /* Amount to pop the stack */
1772 $yymsp = $this->yystack[$this->yyidx];
1773 if (self::$yyTraceFILE && $yyruleno >= 0
1774 && $yyruleno < count(self::$yyRuleName)) {
1775 fprintf(self::$yyTraceFILE, "%sReduce (%d) [%s].\n",
1776 self::$yyTracePrompt, $yyruleno,
1777 self::$yyRuleName[$yyruleno]);
1780 $this->_retvalue = $yy_lefthand_side = null;
1781 if (array_key_exists($yyruleno, self::$yyReduceMap)) {
1782 // call the action
1783 $this->_retvalue = null;
1784 $this->{'yy_r' . self::$yyReduceMap[$yyruleno]}();
1785 $yy_lefthand_side = $this->_retvalue;
1787 $yygoto = self::$yyRuleInfo[$yyruleno]['lhs'];
1788 $yysize = self::$yyRuleInfo[$yyruleno]['rhs'];
1789 $this->yyidx -= $yysize;
1790 for($i = $yysize; $i; $i--) {
1791 // pop all of the right-hand side parameters
1792 array_pop($this->yystack);
1794 $yyact = $this->yy_find_reduce_action($this->yystack[$this->yyidx]->stateno, $yygoto);
1795 if ($yyact < self::YYNSTATE) {
1796 /* If we are not debugging and the reduce action popped at least
1797 ** one element off the stack, then we can push the new element back
1798 ** onto the stack here, and skip the stack overflow test in yy_shift().
1799 ** That gives a significant speed improvement. */
1800 if (!self::$yyTraceFILE && $yysize) {
1801 $this->yyidx++;
1802 $x = new Haanga_yyStackEntry;
1803 $x->stateno = $yyact;
1804 $x->major = $yygoto;
1805 $x->minor = $yy_lefthand_side;
1806 $this->yystack[$this->yyidx] = $x;
1807 } else {
1808 $this->yy_shift($yyact, $yygoto, $yy_lefthand_side);
1810 } elseif ($yyact == self::YYNSTATE + self::YYNRULE + 1) {
1811 $this->yy_accept();
1816 * The following code executes when the parse fails
1818 * Code from %parse_fail is inserted here
1820 function yy_parse_failed()
1822 if (self::$yyTraceFILE) {
1823 fprintf(self::$yyTraceFILE, "%sFail!\n", self::$yyTracePrompt);
1825 while ($this->yyidx >= 0) {
1826 $this->yy_pop_parser_stack();
1828 /* Here code is inserted which will be executed whenever the
1829 ** parser fails */
1833 * The following code executes when a syntax error first occurs.
1835 * %syntax_error code is inserted here
1836 * @param int The major type of the error token
1837 * @param mixed The minor type of the error token
1839 function yy_syntax_error($yymajor, $TOKEN)
1841 #line 57 "lib/Haanga/Compiler/Parser.y"
1843 $expect = array();
1844 foreach ($this->yy_get_expected_tokens($yymajor) as $token) {
1845 $expect[] = self::$yyTokenName[$token];
1847 throw new Exception('Unexpected ' . $this->tokenName($yymajor) . '(' . $TOKEN. '), expected one of: ' . implode(',', $expect));
1848 #line 1855 "lib/Haanga/Compiler/Parser.php"
1852 * The following is executed when the parser accepts
1854 * %parse_accept code is inserted here
1856 function yy_accept()
1858 if (self::$yyTraceFILE) {
1859 fprintf(self::$yyTraceFILE, "%sAccept!\n", self::$yyTracePrompt);
1861 while ($this->yyidx >= 0) {
1862 $stack = $this->yy_pop_parser_stack();
1864 /* Here code is inserted which will be executed whenever the
1865 ** parser accepts */
1866 #line 44 "lib/Haanga/Compiler/Parser.y"
1868 #line 1876 "lib/Haanga/Compiler/Parser.php"
1872 * The main parser program.
1874 * The first argument is the major token number. The second is
1875 * the token value string as scanned from the input.
1877 * @param int the token number
1878 * @param mixed the token value
1879 * @param mixed any extra arguments that should be passed to handlers
1881 function doParse($yymajor, $yytokenvalue)
1883 // $yyact; /* The parser action. */
1884 // $yyendofinput; /* True if we are at the end of input */
1885 $yyerrorhit = 0; /* True if yymajor has invoked an error */
1887 /* (re)initialize the parser, if necessary */
1888 if ($this->yyidx === null || $this->yyidx < 0) {
1889 /* if ($yymajor == 0) return; // not sure why this was here... */
1890 $this->yyidx = 0;
1891 $this->yyerrcnt = -1;
1892 $x = new Haanga_yyStackEntry;
1893 $x->stateno = 0;
1894 $x->major = 0;
1895 $this->yystack = array();
1896 array_push($this->yystack, $x);
1898 $yyendofinput = ($yymajor==0);
1900 if (self::$yyTraceFILE) {
1901 fprintf(self::$yyTraceFILE, "%sInput %s\n",
1902 self::$yyTracePrompt, self::$yyTokenName[$yymajor]);
1905 do {
1906 $yyact = $this->yy_find_shift_action($yymajor);
1907 if ($yymajor < self::YYERRORSYMBOL &&
1908 !$this->yy_is_expected_token($yymajor)) {
1909 // force a syntax error
1910 $yyact = self::YY_ERROR_ACTION;
1912 if ($yyact < self::YYNSTATE) {
1913 $this->yy_shift($yyact, $yymajor, $yytokenvalue);
1914 $this->yyerrcnt--;
1915 if ($yyendofinput && $this->yyidx >= 0) {
1916 $yymajor = 0;
1917 } else {
1918 $yymajor = self::YYNOCODE;
1920 } elseif ($yyact < self::YYNSTATE + self::YYNRULE) {
1921 $this->yy_reduce($yyact - self::YYNSTATE);
1922 } elseif ($yyact == self::YY_ERROR_ACTION) {
1923 if (self::$yyTraceFILE) {
1924 fprintf(self::$yyTraceFILE, "%sSyntax Error!\n",
1925 self::$yyTracePrompt);
1927 if (self::YYERRORSYMBOL) {
1928 /* A syntax error has occurred.
1929 ** The response to an error depends upon whether or not the
1930 ** grammar defines an error token "ERROR".
1932 ** This is what we do if the grammar does define ERROR:
1934 ** * Call the %syntax_error function.
1936 ** * Begin popping the stack until we enter a state where
1937 ** it is legal to shift the error symbol, then shift
1938 ** the error symbol.
1940 ** * Set the error count to three.
1942 ** * Begin accepting and shifting new tokens. No new error
1943 ** processing will occur until three tokens have been
1944 ** shifted successfully.
1947 if ($this->yyerrcnt < 0) {
1948 $this->yy_syntax_error($yymajor, $yytokenvalue);
1950 $yymx = $this->yystack[$this->yyidx]->major;
1951 if ($yymx == self::YYERRORSYMBOL || $yyerrorhit ){
1952 if (self::$yyTraceFILE) {
1953 fprintf(self::$yyTraceFILE, "%sDiscard input token %s\n",
1954 self::$yyTracePrompt, self::$yyTokenName[$yymajor]);
1956 $this->yy_destructor($yymajor, $yytokenvalue);
1957 $yymajor = self::YYNOCODE;
1958 } else {
1959 while ($this->yyidx >= 0 &&
1960 $yymx != self::YYERRORSYMBOL &&
1961 ($yyact = $this->yy_find_shift_action(self::YYERRORSYMBOL)) >= self::YYNSTATE
1963 $this->yy_pop_parser_stack();
1965 if ($this->yyidx < 0 || $yymajor==0) {
1966 $this->yy_destructor($yymajor, $yytokenvalue);
1967 $this->yy_parse_failed();
1968 $yymajor = self::YYNOCODE;
1969 } elseif ($yymx != self::YYERRORSYMBOL) {
1970 $u2 = 0;
1971 $this->yy_shift($yyact, self::YYERRORSYMBOL, $u2);
1974 $this->yyerrcnt = 3;
1975 $yyerrorhit = 1;
1976 } else {
1977 /* YYERRORSYMBOL is not defined */
1978 /* This is what we do if the grammar does not define ERROR:
1980 ** * Report an error message, and throw away the input token.
1982 ** * If the input token is $, then fail the parse.
1984 ** As before, subsequent error messages are suppressed until
1985 ** three input tokens have been successfully shifted.
1987 if ($this->yyerrcnt <= 0) {
1988 $this->yy_syntax_error($yymajor, $yytokenvalue);
1990 $this->yyerrcnt = 3;
1991 $this->yy_destructor($yymajor, $yytokenvalue);
1992 if ($yyendofinput) {
1993 $this->yy_parse_failed();
1995 $yymajor = self::YYNOCODE;
1997 } else {
1998 $this->yy_accept();
1999 $yymajor = self::YYNOCODE;
2001 } while ($yymajor != self::YYNOCODE && $this->yyidx >= 0);