2 /* Driver template for the PHP_Haanga_rGenerator parser generator. (PHP port of LEMON)
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
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
;
22 $this->string = (string) $s;
23 if ($m instanceof Haanga_yyToken
) {
24 $this->metadata
= $m->metadata
;
25 } elseif (is_array($m)) {
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);
55 $offset = count($this->metadata
);
57 if ($value === null) {
60 if ($value instanceof Haanga_yyToken
) {
61 if ($value->metadata
) {
62 $this->metadata
[$offset] = $value->metadata
;
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 César Rodas and Menéame Comunicacions S.L. |
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"
147 function __construct($lex, $file='')
153 function Error($text)
155 throw new Compiler_Exception($text.' in '.$this->file
.':'.$this->lex
->getLine());
158 #line 162 "lib/Haanga/Compiler/Parser.php"
160 /* Next is all token values, as class constants
163 ** These constants (all generated automatically by the parser generator)
164 ** specify the various kinds of tokens (terminals) that the parser
167 ** Each symbol here is a terminal symbol in the grammar.
169 const T_OPEN_TAG
= 1;
186 const T_COMMENT_OPEN
= 18;
187 const T_COMMENT
= 19;
188 const T_PRINT_OPEN
= 20;
189 const T_PRINT_CLOSE
= 21;
190 const T_EXTENDS
= 22;
191 const T_CLOSE_TAG
= 23;
192 const T_INCLUDE
= 24;
193 const T_AUTOESCAPE
= 25;
196 const T_END_AUTOESCAPE
= 28;
197 const T_CUSTOM_TAG
= 29;
199 const T_CUSTOM_BLOCK
= 31;
200 const T_CUSTOM_END
= 32;
202 const T_SPACEFULL
= 34;
204 const T_ENDWITH
= 36;
208 const T_CLOSEFOR
= 40;
213 const T_IFCHANGED
= 45;
214 const T_ENDIFCHANGED
= 46;
215 const T_IFEQUAL
= 47;
216 const T_END_IFEQUAL
= 48;
217 const T_IFNOTEQUAL
= 49;
218 const T_END_IFNOTEQUAL
= 50;
220 const T_END_BLOCK
= 52;
221 const T_NUMERIC
= 53;
223 const T_END_FILTER
= 55;
224 const T_REGROUP
= 56;
229 const T_RPARENT
= 61;
230 const T_STRING_SINGLE_INIT
= 62;
231 const T_STRING_SINGLE_END
= 63;
232 const T_STRING_DOUBLE_INIT
= 64;
233 const T_STRING_DOUBLE_END
= 65;
234 const T_STRING_CONTENT
= 66;
235 const T_LPARENT
= 67;
239 const T_BRACKETS_OPEN
= 71;
240 const T_BRACKETS_CLOSE
= 72;
241 const YY_NO_ACTION
= 329;
242 const YY_ACCEPT_ACTION
= 328;
243 const YY_ERROR_ACTION
= 327;
245 /* Next are that tables used to determine what action to take based on the
246 ** current state and lookahead token. These tables are used to implement
247 ** functions that take a state number and lookahead value and return an
250 ** Suppose the action integer is N. Then the action is determined as
253 ** 0 <= N < self::YYNSTATE Shift N. That is,
254 ** push the lookahead
255 ** token onto the stack
258 ** self::YYNSTATE <= N < self::YYNSTATE+self::YYNRULE Reduce by rule N-YYNSTATE.
260 ** N == self::YYNSTATE+self::YYNRULE A syntax error has occurred.
262 ** N == self::YYNSTATE+self::YYNRULE+1 The parser accepts its
263 ** input. (and concludes parsing)
265 ** N == self::YYNSTATE+self::YYNRULE+2 No such action. Denotes unused
266 ** slots in the yy_action[] table.
268 ** The action table is constructed as a single large static array $yy_action.
269 ** Given state S and lookahead X, the action is computed as
271 ** self::$yy_action[self::$yy_shift_ofst[S] + X ]
273 ** If the index value self::$yy_shift_ofst[S]+X is out of range or if the value
274 ** self::$yy_lookahead[self::$yy_shift_ofst[S]+X] is not equal to X or if
275 ** self::$yy_shift_ofst[S] is equal to self::YY_SHIFT_USE_DFLT, it means that
276 ** the action is not in the table and that self::$yy_default[S] should be used instead.
278 ** The formula above is for computing the action when the lookahead is
279 ** a terminal symbol. If the lookahead is a non-terminal (as occurs after
280 ** a reduce action) then the static $yy_reduce_ofst array is used in place of
281 ** the static $yy_shift_ofst array and self::YY_REDUCE_USE_DFLT is used in place of
282 ** self::YY_SHIFT_USE_DFLT.
284 ** The following are the tables generated in this section:
286 ** self::$yy_action A single table containing all actions.
287 ** self::$yy_lookahead A table containing the lookahead for each entry in
288 ** yy_action. Used to detect hash collisions.
289 ** self::$yy_shift_ofst For each state, the offset into self::$yy_action for
290 ** shifting terminals.
291 ** self::$yy_reduce_ofst For each state, the offset into self::$yy_action for
292 ** shifting non-terminals after a reduce.
293 ** self::$yy_default Default action for each state.
295 const YY_SZ_ACTTAB
= 1014;
296 static public $yy_action = array(
297 /* 0 */ 42, 199, 38, 131, 142, 178, 74, 34, 84, 167,
298 /* 10 */ 83, 81, 154, 77, 123, 76, 72, 223, 158, 157,
299 /* 20 */ 26, 209, 150, 35, 115, 31, 50, 33, 198, 54,
300 /* 30 */ 198, 210, 45, 115, 43, 42, 181, 38, 131, 30,
301 /* 40 */ 217, 240, 34, 98, 167, 100, 81, 154, 77, 224,
302 /* 50 */ 76, 72, 143, 244, 41, 26, 48, 134, 35, 15,
303 /* 60 */ 31, 136, 33, 137, 54, 168, 40, 45, 193, 43,
304 /* 70 */ 42, 188, 38, 131, 196, 230, 145, 34, 44, 167,
305 /* 80 */ 48, 81, 154, 77, 48, 76, 72, 55, 104, 182,
306 /* 90 */ 26, 179, 148, 35, 138, 31, 85, 33, 137, 54,
307 /* 100 */ 168, 40, 45, 185, 43, 42, 207, 38, 131, 28,
308 /* 110 */ 28, 28, 34, 127, 167, 192, 81, 154, 77, 139,
309 /* 120 */ 76, 72, 164, 164, 115, 26, 173, 152, 35, 3,
310 /* 130 */ 31, 217, 33, 137, 54, 168, 40, 45, 177, 43,
311 /* 140 */ 42, 238, 38, 131, 90, 230, 145, 34, 44, 167,
312 /* 150 */ 52, 81, 154, 77, 205, 76, 72, 243, 102, 219,
313 /* 160 */ 26, 237, 140, 35, 2, 31, 211, 33, 144, 54,
314 /* 170 */ 195, 196, 45, 183, 43, 42, 123, 38, 131, 223,
315 /* 180 */ 230, 145, 34, 44, 167, 233, 81, 154, 77, 236,
316 /* 190 */ 76, 72, 194, 207, 198, 26, 198, 170, 35, 169,
317 /* 200 */ 31, 162, 33, 137, 54, 168, 40, 45, 239, 43,
318 /* 210 */ 42, 123, 38, 131, 223, 222, 46, 34, 133, 167,
319 /* 220 */ 97, 81, 154, 77, 242, 76, 72, 103, 231, 115,
320 /* 230 */ 26, 86, 150, 35, 193, 31, 217, 33, 123, 54,
321 /* 240 */ 129, 223, 45, 115, 43, 42, 181, 38, 131, 146,
322 /* 250 */ 217, 130, 34, 132, 167, 215, 81, 154, 77, 220,
323 /* 260 */ 76, 72, 115, 214, 115, 26, 172, 150, 35, 217,
324 /* 270 */ 31, 217, 33, 137, 54, 168, 40, 45, 115, 43,
325 /* 280 */ 42, 181, 38, 131, 32, 217, 228, 34, 87, 167,
326 /* 290 */ 159, 81, 154, 77, 234, 76, 72, 89, 216, 225,
327 /* 300 */ 26, 218, 10, 35, 198, 31, 198, 33, 137, 54,
328 /* 310 */ 168, 40, 45, 42, 43, 38, 131, 203, 230, 145,
329 /* 320 */ 34, 44, 167, 160, 81, 154, 77, 75, 76, 72,
330 /* 330 */ 92, 48, 128, 26, 101, 11, 35, 202, 31, 198,
331 /* 340 */ 33, 198, 54, 115, 193, 45, 42, 43, 38, 131,
332 /* 350 */ 217, 230, 145, 34, 44, 167, 241, 81, 154, 77,
333 /* 360 */ 94, 76, 72, 187, 166, 137, 26, 168, 40, 35,
334 /* 370 */ 74, 31, 84, 33, 83, 54, 82, 48, 45, 193,
335 /* 380 */ 43, 42, 111, 38, 131, 229, 14, 227, 34, 95,
336 /* 390 */ 167, 48, 81, 154, 77, 123, 76, 72, 223, 328,
337 /* 400 */ 57, 26, 230, 145, 35, 44, 31, 163, 33, 198,
338 /* 410 */ 54, 198, 186, 45, 135, 43, 42, 123, 38, 131,
339 /* 420 */ 223, 226, 165, 34, 235, 167, 58, 81, 154, 77,
340 /* 430 */ 65, 76, 72, 221, 123, 36, 26, 223, 114, 35,
341 /* 440 */ 74, 31, 84, 33, 83, 54, 60, 126, 45, 193,
342 /* 450 */ 43, 42, 66, 38, 131, 125, 21, 49, 34, 69,
343 /* 460 */ 167, 155, 81, 154, 77, 62, 76, 72, 112, 182,
344 /* 470 */ 70, 26, 230, 145, 35, 44, 31, 68, 33, 137,
345 /* 480 */ 54, 168, 40, 45, 42, 43, 38, 131, 59, 67,
346 /* 490 */ 113, 34, 61, 167, 117, 81, 154, 77, 153, 76,
347 /* 500 */ 72, 51, 232, 182, 26, 53, 150, 35, 212, 31,
348 /* 510 */ 116, 33, 141, 54, 124, 63, 45, 115, 43, 42,
349 /* 520 */ 181, 38, 131, 149, 217, 71, 34, 120, 167, 64,
350 /* 530 */ 81, 154, 77, 119, 76, 72, 118, 121, 182, 26,
351 /* 540 */ 182, 182, 35, 171, 31, 182, 33, 137, 54, 168,
352 /* 550 */ 40, 45, 182, 43, 42, 182, 38, 131, 182, 18,
353 /* 560 */ 182, 34, 182, 167, 182, 81, 154, 77, 182, 76,
354 /* 570 */ 72, 182, 88, 182, 26, 230, 145, 35, 44, 31,
355 /* 580 */ 182, 33, 182, 54, 56, 182, 45, 182, 43, 42,
356 /* 590 */ 182, 38, 131, 182, 16, 182, 34, 182, 167, 182,
357 /* 600 */ 81, 154, 77, 182, 76, 72, 182, 182, 182, 26,
358 /* 610 */ 230, 145, 35, 44, 31, 151, 33, 137, 54, 168,
359 /* 620 */ 40, 45, 182, 43, 42, 182, 38, 131, 182, 13,
360 /* 630 */ 182, 34, 182, 167, 182, 81, 154, 77, 156, 76,
361 /* 640 */ 72, 182, 182, 182, 26, 230, 145, 35, 44, 31,
362 /* 650 */ 182, 33, 182, 54, 235, 182, 45, 182, 43, 42,
363 /* 660 */ 182, 38, 131, 182, 123, 37, 34, 223, 167, 182,
364 /* 670 */ 81, 154, 77, 182, 76, 72, 182, 182, 182, 26,
365 /* 680 */ 182, 182, 35, 147, 31, 182, 33, 182, 54, 182,
366 /* 690 */ 182, 45, 182, 43, 42, 182, 38, 131, 182, 20,
367 /* 700 */ 182, 34, 182, 167, 182, 81, 154, 77, 17, 76,
368 /* 710 */ 72, 182, 182, 182, 26, 230, 145, 35, 44, 31,
369 /* 720 */ 182, 33, 79, 54, 230, 145, 45, 44, 43, 182,
370 /* 730 */ 24, 23, 25, 25, 25, 25, 25, 25, 25, 22,
371 /* 740 */ 22, 28, 28, 28, 24, 23, 25, 25, 25, 25,
372 /* 750 */ 25, 25, 25, 22, 22, 28, 28, 28, 182, 182,
373 /* 760 */ 137, 182, 168, 40, 96, 182, 182, 182, 24, 23,
374 /* 770 */ 25, 25, 25, 25, 25, 25, 25, 22, 22, 28,
375 /* 780 */ 28, 28, 182, 182, 182, 182, 182, 182, 191, 182,
376 /* 790 */ 47, 182, 182, 23, 25, 25, 25, 25, 25, 25,
377 /* 800 */ 25, 22, 22, 28, 28, 28, 184, 182, 182, 161,
378 /* 810 */ 206, 204, 201, 190, 189, 176, 174, 175, 73, 182,
379 /* 820 */ 213, 182, 99, 25, 25, 25, 25, 25, 25, 25,
380 /* 830 */ 22, 22, 28, 28, 28, 208, 182, 27, 200, 182,
381 /* 840 */ 9, 198, 78, 198, 198, 80, 198, 137, 182, 168,
382 /* 850 */ 40, 39, 93, 182, 182, 91, 230, 145, 198, 44,
383 /* 860 */ 198, 198, 182, 198, 198, 221, 198, 182, 221, 182,
384 /* 870 */ 182, 39, 74, 182, 84, 74, 83, 84, 182, 83,
385 /* 880 */ 182, 193, 221, 182, 193, 221, 182, 182, 187, 74,
386 /* 890 */ 7, 84, 74, 83, 84, 74, 83, 84, 193, 83,
387 /* 900 */ 182, 193, 29, 150, 193, 182, 230, 145, 182, 44,
388 /* 910 */ 182, 150, 182, 182, 115, 182, 12, 181, 182, 105,
389 /* 920 */ 180, 217, 115, 150, 182, 181, 182, 197, 180, 217,
390 /* 930 */ 182, 150, 230, 145, 115, 44, 4, 181, 182, 106,
391 /* 940 */ 180, 217, 115, 150, 182, 181, 182, 110, 180, 217,
392 /* 950 */ 182, 150, 230, 145, 115, 44, 1, 181, 182, 122,
393 /* 960 */ 180, 217, 115, 150, 182, 181, 182, 109, 180, 217,
394 /* 970 */ 182, 150, 230, 145, 115, 44, 5, 181, 182, 108,
395 /* 980 */ 180, 217, 115, 19, 182, 181, 182, 107, 180, 217,
396 /* 990 */ 6, 182, 230, 145, 8, 44, 182, 182, 182, 230,
397 /* 1000 */ 145, 182, 44, 182, 182, 182, 230, 145, 182, 44,
398 /* 1010 */ 230, 145, 182, 44,
400 static public $yy_lookahead = array(
401 /* 0 */ 22, 69, 24, 25, 79, 23, 60, 29, 62, 31,
402 /* 10 */ 64, 33, 34, 35, 89, 37, 38, 92, 40, 41,
403 /* 20 */ 42, 23, 78, 45, 89, 47, 75, 49, 29, 51,
404 /* 30 */ 31, 96, 54, 89, 56, 22, 92, 24, 25, 95,
405 /* 40 */ 96, 23, 29, 23, 31, 23, 33, 34, 35, 23,
406 /* 50 */ 37, 38, 53, 23, 59, 42, 58, 44, 45, 1,
407 /* 60 */ 47, 48, 49, 68, 51, 70, 71, 54, 69, 56,
408 /* 70 */ 22, 63, 24, 25, 66, 17, 18, 29, 20, 31,
409 /* 80 */ 58, 33, 34, 35, 58, 37, 38, 75, 23, 23,
410 /* 90 */ 42, 23, 44, 45, 46, 47, 23, 49, 68, 51,
411 /* 100 */ 70, 71, 54, 63, 56, 22, 66, 24, 25, 14,
412 /* 110 */ 15, 16, 29, 78, 31, 72, 33, 34, 35, 53,
413 /* 120 */ 37, 38, 26, 27, 89, 42, 43, 44, 45, 1,
414 /* 130 */ 47, 96, 49, 68, 51, 70, 71, 54, 23, 56,
415 /* 140 */ 22, 69, 24, 25, 23, 17, 18, 29, 20, 31,
416 /* 150 */ 75, 33, 34, 35, 23, 37, 38, 23, 23, 23,
417 /* 160 */ 42, 23, 44, 45, 1, 47, 79, 49, 50, 51,
418 /* 170 */ 65, 66, 54, 23, 56, 22, 89, 24, 25, 92,
419 /* 180 */ 17, 18, 29, 20, 31, 23, 33, 34, 35, 23,
420 /* 190 */ 37, 38, 65, 66, 29, 42, 31, 44, 45, 46,
421 /* 200 */ 47, 79, 49, 68, 51, 70, 71, 54, 23, 56,
422 /* 210 */ 22, 89, 24, 25, 92, 23, 11, 29, 78, 31,
423 /* 220 */ 23, 33, 34, 35, 23, 37, 38, 23, 79, 89,
424 /* 230 */ 42, 23, 78, 45, 69, 47, 96, 49, 89, 51,
425 /* 240 */ 52, 92, 54, 89, 56, 22, 92, 24, 25, 95,
426 /* 250 */ 96, 78, 29, 78, 31, 23, 33, 34, 35, 23,
427 /* 260 */ 37, 38, 89, 23, 89, 42, 43, 78, 45, 96,
428 /* 270 */ 47, 96, 49, 68, 51, 70, 71, 54, 89, 56,
429 /* 280 */ 22, 92, 24, 25, 95, 96, 19, 29, 23, 31,
430 /* 290 */ 32, 33, 34, 35, 21, 37, 38, 23, 23, 23,
431 /* 300 */ 42, 23, 1, 45, 29, 47, 31, 49, 68, 51,
432 /* 310 */ 70, 71, 54, 22, 56, 24, 25, 23, 17, 18,
433 /* 320 */ 29, 20, 31, 32, 33, 34, 35, 30, 37, 38,
434 /* 330 */ 23, 58, 78, 42, 23, 1, 45, 76, 47, 29,
435 /* 340 */ 49, 31, 51, 89, 69, 54, 22, 56, 24, 25,
436 /* 350 */ 96, 17, 18, 29, 20, 31, 61, 33, 34, 35,
437 /* 360 */ 23, 37, 38, 53, 40, 68, 42, 70, 71, 45,
438 /* 370 */ 60, 47, 62, 49, 64, 51, 57, 58, 54, 69,
439 /* 380 */ 56, 22, 89, 24, 25, 79, 1, 23, 29, 23,
440 /* 390 */ 31, 58, 33, 34, 35, 89, 37, 38, 92, 74,
441 /* 400 */ 75, 42, 17, 18, 45, 20, 47, 79, 49, 29,
442 /* 410 */ 51, 31, 23, 54, 55, 56, 22, 89, 24, 25,
443 /* 420 */ 92, 23, 28, 29, 79, 31, 75, 33, 34, 35,
444 /* 430 */ 75, 37, 38, 53, 89, 90, 42, 92, 89, 45,
445 /* 440 */ 60, 47, 62, 49, 64, 51, 75, 97, 54, 69,
446 /* 450 */ 56, 22, 75, 24, 25, 97, 1, 75, 29, 75,
447 /* 460 */ 31, 32, 33, 34, 35, 75, 37, 38, 89, 98,
448 /* 470 */ 75, 42, 17, 18, 45, 20, 47, 75, 49, 68,
449 /* 480 */ 51, 70, 71, 54, 22, 56, 24, 25, 75, 75,
450 /* 490 */ 89, 29, 75, 31, 89, 33, 34, 35, 92, 37,
451 /* 500 */ 38, 75, 23, 98, 42, 75, 78, 45, 92, 47,
452 /* 510 */ 89, 49, 50, 51, 89, 75, 54, 89, 56, 22,
453 /* 520 */ 92, 24, 25, 95, 96, 75, 29, 89, 31, 75,
454 /* 530 */ 33, 34, 35, 89, 37, 38, 89, 89, 98, 42,
455 /* 540 */ 98, 98, 45, 46, 47, 98, 49, 68, 51, 70,
456 /* 550 */ 71, 54, 98, 56, 22, 98, 24, 25, 98, 1,
457 /* 560 */ 98, 29, 98, 31, 98, 33, 34, 35, 98, 37,
458 /* 570 */ 38, 98, 23, 98, 42, 17, 18, 45, 20, 47,
459 /* 580 */ 98, 49, 98, 51, 52, 98, 54, 98, 56, 22,
460 /* 590 */ 98, 24, 25, 98, 1, 98, 29, 98, 31, 98,
461 /* 600 */ 33, 34, 35, 98, 37, 38, 98, 98, 98, 42,
462 /* 610 */ 17, 18, 45, 20, 47, 48, 49, 68, 51, 70,
463 /* 620 */ 71, 54, 98, 56, 22, 98, 24, 25, 98, 1,
464 /* 630 */ 98, 29, 98, 31, 98, 33, 34, 35, 36, 37,
465 /* 640 */ 38, 98, 98, 98, 42, 17, 18, 45, 20, 47,
466 /* 650 */ 98, 49, 98, 51, 79, 98, 54, 98, 56, 22,
467 /* 660 */ 98, 24, 25, 98, 89, 90, 29, 92, 31, 98,
468 /* 670 */ 33, 34, 35, 98, 37, 38, 98, 98, 98, 42,
469 /* 680 */ 98, 98, 45, 46, 47, 98, 49, 98, 51, 98,
470 /* 690 */ 98, 54, 98, 56, 22, 98, 24, 25, 98, 1,
471 /* 700 */ 98, 29, 98, 31, 98, 33, 34, 35, 1, 37,
472 /* 710 */ 38, 98, 98, 98, 42, 17, 18, 45, 20, 47,
473 /* 720 */ 98, 49, 30, 51, 17, 18, 54, 20, 56, 98,
474 /* 730 */ 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
475 /* 740 */ 13, 14, 15, 16, 3, 4, 5, 6, 7, 8,
476 /* 750 */ 9, 10, 11, 12, 13, 14, 15, 16, 98, 98,
477 /* 760 */ 68, 98, 70, 71, 23, 98, 98, 98, 3, 4,
478 /* 770 */ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
479 /* 780 */ 15, 16, 98, 98, 98, 98, 98, 98, 61, 98,
480 /* 790 */ 11, 98, 98, 4, 5, 6, 7, 8, 9, 10,
481 /* 800 */ 11, 12, 13, 14, 15, 16, 77, 98, 98, 80,
482 /* 810 */ 81, 82, 83, 84, 85, 86, 87, 88, 39, 98,
483 /* 820 */ 91, 98, 93, 5, 6, 7, 8, 9, 10, 11,
484 /* 830 */ 12, 13, 14, 15, 16, 23, 98, 2, 23, 98,
485 /* 840 */ 1, 29, 30, 31, 29, 30, 31, 68, 98, 70,
486 /* 850 */ 71, 39, 23, 98, 98, 23, 17, 18, 29, 20,
487 /* 860 */ 31, 29, 98, 31, 29, 53, 31, 98, 53, 98,
488 /* 870 */ 98, 39, 60, 98, 62, 60, 64, 62, 98, 64,
489 /* 880 */ 98, 69, 53, 98, 69, 53, 98, 98, 53, 60,
490 /* 890 */ 1, 62, 60, 64, 62, 60, 64, 62, 69, 64,
491 /* 900 */ 98, 69, 67, 78, 69, 98, 17, 18, 98, 20,
492 /* 910 */ 98, 78, 98, 98, 89, 98, 1, 92, 98, 94,
493 /* 920 */ 95, 96, 89, 78, 98, 92, 98, 94, 95, 96,
494 /* 930 */ 98, 78, 17, 18, 89, 20, 1, 92, 98, 94,
495 /* 940 */ 95, 96, 89, 78, 98, 92, 98, 94, 95, 96,
496 /* 950 */ 98, 78, 17, 18, 89, 20, 1, 92, 98, 94,
497 /* 960 */ 95, 96, 89, 78, 98, 92, 98, 94, 95, 96,
498 /* 970 */ 98, 78, 17, 18, 89, 20, 1, 92, 98, 94,
499 /* 980 */ 95, 96, 89, 1, 98, 92, 98, 94, 95, 96,
500 /* 990 */ 1, 98, 17, 18, 1, 20, 98, 98, 98, 17,
501 /* 1000 */ 18, 98, 20, 98, 98, 98, 17, 18, 98, 20,
502 /* 1010 */ 17, 18, 98, 20,
504 const YY_SHIFT_USE_DFLT
= -69;
505 const YY_SHIFT_MAX
= 173;
506 static public $yy_shift_ofst = array(
507 /* 0 */ -69, 153, 83, -22, 118, 13, 48, 637, 602, 429,
508 /* 10 */ 291, 258, 223, 188, 359, 462, 567, 394, 497, 532,
509 /* 20 */ 324, 672, 835, 835, 835, 835, 835, 835, 835, 835,
510 /* 30 */ 310, 310, 310, 310, 815, 829, 812, 832, 380, 380,
511 /* 40 */ 380, 380, 380, 165, 165, 165, 165, 165, 165, 982,
512 /* 50 */ 993, 839, 334, 385, -1, 301, 275, 455, 889, 915,
513 /* 60 */ 955, 593, 975, 558, 163, 989, 58, 128, 628, 698,
514 /* 70 */ 707, 935, 165, 165, -54, 165, -54, 165, 165, 165,
515 /* 80 */ 165, 165, 165, 105, 8, -69, -69, -69, -69, -69,
516 /* 90 */ -69, -69, -69, -69, -69, -69, -69, -69, -69, -69,
517 /* 100 */ -69, -69, -69, -69, -69, 727, 741, 765, 789, 818,
518 /* 110 */ 818, 779, 549, 479, 692, -5, 65, 297, 30, 135,
519 /* 120 */ 205, 240, 95, 411, 411, 40, 127, 319, 26, 66,
520 /* 130 */ -2, 96, 22, 273, 20, 18, 68, -68, -18, 389,
521 /* 140 */ 73, 278, 276, 274, 236, 267, 265, 294, 307, 366,
522 /* 150 */ 333, 364, 337, 295, 311, 398, 232, 208, 136, 138,
523 /* 160 */ 134, 131, 43, 115, 121, 150, 162, 204, 72, 201,
524 /* 170 */ 197, 166, 185, 192,
526 const YY_REDUCE_USE_DFLT
= -76;
527 const YY_REDUCE_MAX
= 104;
528 static public $yy_reduce_ofst = array(
529 /* 0 */ 325, 729, 729, 729, 729, 729, 729, 729, 729, 729,
530 /* 10 */ 729, 729, 729, 729, 729, 729, 729, 729, 729, 729,
531 /* 20 */ 729, 729, 865, 873, 885, 853, 845, 893, 833, 825,
532 /* 30 */ 428, 189, 154, -56, 345, 575, 149, 149, 328, 306,
533 /* 40 */ 122, 87, -75, 35, 140, 175, 254, 173, -65, 261,
534 /* 50 */ 261, 261, 261, 261, 379, 261, 448, 261, 261, 261,
535 /* 60 */ 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
536 /* 70 */ 261, 261, 293, 438, 406, 421, 416, 405, 401, 425,
537 /* 80 */ 447, 444, 349, 350, 358, 377, 384, 390, 382, 402,
538 /* 90 */ 395, 355, 351, 371, 413, 450, 454, 440, 417, 414,
539 /* 100 */ 430, 426, 75, 12, -49,
541 static public $yyExpectedTokens = array(
543 /* 1 */ array(22, 24, 25, 29, 31, 33, 34, 35, 37, 38, 42, 44, 45, 46, 47, 49, 51, 54, 56, ),
544 /* 2 */ array(22, 24, 25, 29, 31, 33, 34, 35, 37, 38, 42, 43, 44, 45, 47, 49, 51, 54, 56, ),
545 /* 3 */ array(22, 24, 25, 29, 31, 33, 34, 35, 37, 38, 40, 41, 42, 45, 47, 49, 51, 54, 56, ),
546 /* 4 */ array(22, 24, 25, 29, 31, 33, 34, 35, 37, 38, 42, 44, 45, 47, 49, 50, 51, 54, 56, ),
547 /* 5 */ array(22, 24, 25, 29, 31, 33, 34, 35, 37, 38, 42, 44, 45, 47, 48, 49, 51, 54, 56, ),
548 /* 6 */ array(22, 24, 25, 29, 31, 33, 34, 35, 37, 38, 42, 44, 45, 46, 47, 49, 51, 54, 56, ),
549 /* 7 */ array(22, 24, 25, 29, 31, 33, 34, 35, 37, 38, 42, 45, 46, 47, 49, 51, 54, 56, ),
550 /* 8 */ array(22, 24, 25, 29, 31, 33, 34, 35, 36, 37, 38, 42, 45, 47, 49, 51, 54, 56, ),
551 /* 9 */ array(22, 24, 25, 29, 31, 32, 33, 34, 35, 37, 38, 42, 45, 47, 49, 51, 54, 56, ),
552 /* 10 */ array(22, 24, 25, 29, 31, 32, 33, 34, 35, 37, 38, 42, 45, 47, 49, 51, 54, 56, ),
553 /* 11 */ array(22, 24, 25, 29, 31, 32, 33, 34, 35, 37, 38, 42, 45, 47, 49, 51, 54, 56, ),
554 /* 12 */ array(22, 24, 25, 29, 31, 33, 34, 35, 37, 38, 42, 43, 45, 47, 49, 51, 54, 56, ),
555 /* 13 */ array(22, 24, 25, 29, 31, 33, 34, 35, 37, 38, 42, 45, 47, 49, 51, 52, 54, 56, ),
556 /* 14 */ array(22, 24, 25, 29, 31, 33, 34, 35, 37, 38, 42, 45, 47, 49, 51, 54, 55, 56, ),
557 /* 15 */ array(22, 24, 25, 29, 31, 33, 34, 35, 37, 38, 42, 45, 47, 49, 50, 51, 54, 56, ),
558 /* 16 */ array(22, 24, 25, 29, 31, 33, 34, 35, 37, 38, 42, 45, 47, 48, 49, 51, 54, 56, ),
559 /* 17 */ array(22, 24, 25, 28, 29, 31, 33, 34, 35, 37, 38, 42, 45, 47, 49, 51, 54, 56, ),
560 /* 18 */ array(22, 24, 25, 29, 31, 33, 34, 35, 37, 38, 42, 45, 46, 47, 49, 51, 54, 56, ),
561 /* 19 */ array(22, 24, 25, 29, 31, 33, 34, 35, 37, 38, 42, 45, 47, 49, 51, 52, 54, 56, ),
562 /* 20 */ array(22, 24, 25, 29, 31, 33, 34, 35, 37, 38, 40, 42, 45, 47, 49, 51, 54, 56, ),
563 /* 21 */ array(22, 24, 25, 29, 31, 33, 34, 35, 37, 38, 42, 45, 47, 49, 51, 54, 56, ),
564 /* 22 */ array(2, 29, 31, 53, 60, 62, 64, 67, 69, ),
565 /* 23 */ array(2, 29, 31, 53, 60, 62, 64, 67, 69, ),
566 /* 24 */ array(2, 29, 31, 53, 60, 62, 64, 67, 69, ),
567 /* 25 */ array(2, 29, 31, 53, 60, 62, 64, 67, 69, ),
568 /* 26 */ array(2, 29, 31, 53, 60, 62, 64, 67, 69, ),
569 /* 27 */ array(2, 29, 31, 53, 60, 62, 64, 67, 69, ),
570 /* 28 */ array(2, 29, 31, 53, 60, 62, 64, 67, 69, ),
571 /* 29 */ array(2, 29, 31, 53, 60, 62, 64, 67, 69, ),
572 /* 30 */ array(29, 31, 53, 60, 62, 64, 69, ),
573 /* 31 */ array(29, 31, 53, 60, 62, 64, 69, ),
574 /* 32 */ array(29, 31, 53, 60, 62, 64, 69, ),
575 /* 33 */ array(29, 31, 53, 60, 62, 64, 69, ),
576 /* 34 */ array(23, 29, 30, 31, 53, 60, 62, 64, 69, ),
577 /* 35 */ array(23, 29, 31, 53, 60, 62, 64, 69, ),
578 /* 36 */ array(23, 29, 30, 31, 39, 53, 60, 62, 64, 69, ),
579 /* 37 */ array(23, 29, 31, 39, 53, 60, 62, 64, 69, ),
580 /* 38 */ array(29, 31, 53, 60, 62, 64, 69, ),
581 /* 39 */ array(29, 31, 53, 60, 62, 64, 69, ),
582 /* 40 */ array(29, 31, 53, 60, 62, 64, 69, ),
583 /* 41 */ array(29, 31, 53, 60, 62, 64, 69, ),
584 /* 42 */ array(29, 31, 53, 60, 62, 64, 69, ),
585 /* 43 */ array(29, 31, 69, ),
586 /* 44 */ array(29, 31, 69, ),
587 /* 45 */ array(29, 31, 69, ),
588 /* 46 */ array(29, 31, 69, ),
589 /* 47 */ array(29, 31, 69, ),
590 /* 48 */ array(29, 31, 69, ),
591 /* 49 */ array(1, 17, 18, 20, ),
592 /* 50 */ array(1, 17, 18, 20, ),
593 /* 51 */ array(1, 17, 18, 20, ),
594 /* 52 */ array(1, 17, 18, 20, ),
595 /* 53 */ array(1, 17, 18, 20, ),
596 /* 54 */ array(29, 31, 53, 69, ),
597 /* 55 */ array(1, 17, 18, 20, ),
598 /* 56 */ array(23, 29, 31, 69, ),
599 /* 57 */ array(1, 17, 18, 20, ),
600 /* 58 */ array(1, 17, 18, 20, ),
601 /* 59 */ array(1, 17, 18, 20, ),
602 /* 60 */ array(1, 17, 18, 20, ),
603 /* 61 */ array(1, 17, 18, 20, ),
604 /* 62 */ array(1, 17, 18, 20, ),
605 /* 63 */ array(1, 17, 18, 20, ),
606 /* 64 */ array(1, 17, 18, 20, ),
607 /* 65 */ array(1, 17, 18, 20, ),
608 /* 66 */ array(1, 17, 18, 20, ),
609 /* 67 */ array(1, 17, 18, 20, ),
610 /* 68 */ array(1, 17, 18, 20, ),
611 /* 69 */ array(1, 17, 18, 20, ),
612 /* 70 */ array(1, 17, 18, 20, ),
613 /* 71 */ array(1, 17, 18, 20, ),
614 /* 72 */ array(29, 31, 69, ),
615 /* 73 */ array(29, 31, 69, ),
616 /* 74 */ array(60, 62, 64, ),
617 /* 75 */ array(29, 31, 69, ),
618 /* 76 */ array(60, 62, 64, ),
619 /* 77 */ array(29, 31, 69, ),
620 /* 78 */ array(29, 31, 69, ),
621 /* 79 */ array(29, 31, 69, ),
622 /* 80 */ array(29, 31, 69, ),
623 /* 81 */ array(29, 31, 69, ),
624 /* 82 */ array(29, 31, 69, ),
625 /* 83 */ array(65, 66, ),
626 /* 84 */ array(63, 66, ),
647 /* 105 */ array(3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 61, ),
648 /* 106 */ array(3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 23, ),
649 /* 107 */ array(3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, ),
650 /* 108 */ array(4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, ),
651 /* 109 */ array(5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, ),
652 /* 110 */ array(5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, ),
653 /* 111 */ array(11, 39, 68, 70, 71, ),
654 /* 112 */ array(23, 68, 70, 71, ),
655 /* 113 */ array(23, 68, 70, 71, ),
656 /* 114 */ array(30, 68, 70, 71, ),
657 /* 115 */ array(59, 68, 70, 71, ),
658 /* 116 */ array(23, 68, 70, 71, ),
659 /* 117 */ array(30, 68, 70, 71, ),
660 /* 118 */ array(23, 68, 70, 71, ),
661 /* 119 */ array(23, 68, 70, 71, ),
662 /* 120 */ array(11, 68, 70, 71, ),
663 /* 121 */ array(23, 68, 70, 71, ),
664 /* 122 */ array(14, 15, 16, ),
665 /* 123 */ array(68, 70, 71, ),
666 /* 124 */ array(68, 70, 71, ),
667 /* 125 */ array(63, 66, ),
668 /* 126 */ array(65, 66, ),
669 /* 127 */ array(57, 58, ),
670 /* 128 */ array(23, 58, ),
671 /* 129 */ array(23, 53, ),
672 /* 130 */ array(23, 58, ),
673 /* 131 */ array(26, 27, ),
674 /* 132 */ array(23, 58, ),
675 /* 133 */ array(21, 58, ),
676 /* 134 */ array(23, ),
677 /* 135 */ array(23, ),
678 /* 136 */ array(23, ),
679 /* 137 */ array(69, ),
680 /* 138 */ array(23, ),
681 /* 139 */ array(23, ),
682 /* 140 */ array(23, ),
683 /* 141 */ array(23, ),
684 /* 142 */ array(23, ),
685 /* 143 */ array(23, ),
686 /* 144 */ array(23, ),
687 /* 145 */ array(19, ),
688 /* 146 */ array(23, ),
689 /* 147 */ array(23, ),
690 /* 148 */ array(23, ),
691 /* 149 */ array(23, ),
692 /* 150 */ array(58, ),
693 /* 151 */ array(23, ),
694 /* 152 */ array(23, ),
695 /* 153 */ array(61, ),
696 /* 154 */ array(23, ),
697 /* 155 */ array(23, ),
698 /* 156 */ array(23, ),
699 /* 157 */ array(23, ),
700 /* 158 */ array(23, ),
701 /* 159 */ array(23, ),
702 /* 160 */ array(23, ),
703 /* 161 */ array(23, ),
704 /* 162 */ array(72, ),
705 /* 163 */ array(23, ),
706 /* 164 */ array(23, ),
707 /* 165 */ array(23, ),
708 /* 166 */ array(23, ),
709 /* 167 */ array(23, ),
710 /* 168 */ array(69, ),
711 /* 169 */ array(23, ),
712 /* 170 */ array(23, ),
713 /* 171 */ array(23, ),
714 /* 172 */ array(23, ),
715 /* 173 */ array(23, ),
788 static public $yy_default = array(
789 /* 0 */ 247, 327, 327, 327, 327, 327, 327, 327, 327, 327,
790 /* 10 */ 327, 327, 327, 327, 327, 327, 327, 327, 327, 327,
791 /* 20 */ 327, 327, 327, 327, 327, 327, 327, 327, 327, 327,
792 /* 30 */ 327, 327, 327, 327, 327, 327, 327, 327, 327, 327,
793 /* 40 */ 327, 327, 327, 327, 327, 327, 327, 327, 327, 327,
794 /* 50 */ 327, 327, 327, 327, 327, 327, 327, 245, 327, 327,
795 /* 60 */ 327, 327, 327, 327, 327, 327, 327, 327, 327, 327,
796 /* 70 */ 327, 327, 327, 327, 327, 327, 327, 327, 327, 327,
797 /* 80 */ 327, 327, 327, 327, 327, 247, 247, 247, 247, 247,
798 /* 90 */ 247, 247, 247, 247, 247, 247, 247, 247, 247, 247,
799 /* 100 */ 247, 247, 247, 247, 247, 327, 327, 314, 315, 316,
800 /* 110 */ 318, 327, 327, 327, 327, 297, 327, 327, 327, 327,
801 /* 120 */ 327, 327, 317, 301, 293, 327, 327, 327, 327, 327,
802 /* 130 */ 327, 327, 327, 327, 327, 327, 327, 327, 327, 327,
803 /* 140 */ 327, 327, 327, 327, 327, 327, 327, 327, 327, 327,
804 /* 150 */ 304, 327, 327, 327, 327, 327, 327, 327, 327, 327,
805 /* 160 */ 327, 327, 327, 327, 327, 327, 327, 327, 327, 327,
806 /* 170 */ 327, 327, 327, 327, 261, 262, 260, 259, 281, 284,
807 /* 180 */ 321, 306, 290, 263, 248, 310, 291, 305, 308, 258,
808 /* 190 */ 257, 320, 324, 325, 311, 309, 313, 319, 326, 322,
809 /* 200 */ 264, 256, 246, 283, 255, 253, 254, 312, 266, 274,
810 /* 210 */ 294, 296, 273, 272, 289, 271, 288, 295, 287, 276,
811 /* 220 */ 286, 302, 278, 303, 275, 252, 270, 285, 250, 299,
812 /* 230 */ 249, 298, 267, 277, 251, 300, 282, 269, 323, 279,
813 /* 240 */ 292, 307, 280, 268, 265,
815 /* The next thing included is series of defines which control
816 ** various aspects of the generated parser.
817 ** self::YYNOCODE is a number which corresponds
818 ** to no legal terminal or nonterminal number. This
819 ** number is used to fill in empty slots of the hash
821 ** self::YYFALLBACK If defined, this indicates that one or more tokens
822 ** have fall-back values which should be used if the
823 ** original value of the token will not parse.
824 ** self::YYSTACKDEPTH is the maximum depth of the parser's stack.
825 ** self::YYNSTATE the combined number of states.
826 ** self::YYNRULE the number of rules in the grammar
827 ** self::YYERRORSYMBOL is the code number of the error symbol. If not
828 ** defined, then do no error processing.
831 const YYSTACKDEPTH
= 100;
832 const YYNSTATE
= 245;
834 const YYERRORSYMBOL
= 73;
835 const YYERRSYMDT
= 'yy0';
836 const YYFALLBACK
= 0;
837 /** The next table maps tokens into fallback tokens. If a construct
838 * like the following:
840 * %fallback ID X Y Z.
842 * appears in the grammer, then ID becomes a fallback token for X, Y,
843 * and Z. Whenever one of the tokens X, Y, or Z is input to the parser
844 * but it does not parse, the type of the token is changed to ID and
845 * the parse is retried before an error is thrown.
847 static public $yyFallback = array(
850 * Turn parser tracing on by giving a stream to which to write the trace
851 * and a prompt to preface each trace message. Tracing is turned off
852 * by making either argument NULL
856 * - A stream resource to which trace output should be written.
857 * If NULL, then tracing is turned off.
858 * - A prefix string written at the beginning of every
859 * line of trace output. If NULL, then tracing is
868 static function Trace($TraceFILE, $zTracePrompt)
872 } elseif (!$zTracePrompt) {
875 self
::$yyTraceFILE = $TraceFILE;
876 self
::$yyTracePrompt = $zTracePrompt;
880 * Output debug information to output (php://output stream)
882 static function PrintTrace()
884 self
::$yyTraceFILE = fopen('php://output', 'w');
885 self
::$yyTracePrompt = '';
891 static public $yyTraceFILE;
893 * String to prepend to debug output
896 static public $yyTracePrompt;
900 public $yyidx; /* Index of top element in stack */
904 public $yyerrcnt; /* Shifts left before out of the error */
908 public $yystack = array(); /* The parser's stack */
911 * For tracing shifts, the names of all terminals and nonterminals
912 * are required. The following table supplies these names
915 static public $yyTokenName = array(
916 '$', 'T_OPEN_TAG', 'T_NOT', 'T_AND',
917 'T_OR', 'T_EQ', 'T_NE', 'T_GT',
918 'T_GE', 'T_LT', 'T_LE', 'T_IN',
919 'T_PLUS', 'T_MINUS', 'T_TIMES', 'T_DIV',
920 'T_MOD', 'T_HTML', 'T_COMMENT_OPEN', 'T_COMMENT',
921 'T_PRINT_OPEN', 'T_PRINT_CLOSE', 'T_EXTENDS', 'T_CLOSE_TAG',
922 'T_INCLUDE', 'T_AUTOESCAPE', 'T_OFF', 'T_ON',
923 'T_END_AUTOESCAPE', 'T_CUSTOM_TAG', 'T_AS', 'T_CUSTOM_BLOCK',
924 'T_CUSTOM_END', 'T_BUFFER', 'T_SPACEFULL', 'T_WITH',
925 'T_ENDWITH', 'T_LOAD', 'T_FOR', 'T_COMMA',
926 'T_CLOSEFOR', 'T_EMPTY', 'T_IF', 'T_ENDIF',
927 'T_ELSE', 'T_IFCHANGED', 'T_ENDIFCHANGED', 'T_IFEQUAL',
928 'T_END_IFEQUAL', 'T_IFNOTEQUAL', 'T_END_IFNOTEQUAL', 'T_BLOCK',
929 'T_END_BLOCK', 'T_NUMERIC', 'T_FILTER', 'T_END_FILTER',
930 'T_REGROUP', 'T_BY', 'T_PIPE', 'T_COLON',
931 'T_INTL', 'T_RPARENT', 'T_STRING_SINGLE_INIT', 'T_STRING_SINGLE_END',
932 'T_STRING_DOUBLE_INIT', 'T_STRING_DOUBLE_END', 'T_STRING_CONTENT', 'T_LPARENT',
933 'T_OBJ', 'T_ALPHA', 'T_DOT', 'T_BRACKETS_OPEN',
934 'T_BRACKETS_CLOSE', 'error', 'start', 'body',
935 'code', 'stmts', 'filtered_var', 'var_or_string',
936 'stmt', 'for_stmt', 'ifchanged_stmt', 'block_stmt',
937 'filter_stmt', 'if_stmt', 'custom_tag', 'alias',
938 'ifequal', 'varname', 'var_list', 'regroup',
939 'string', 'for_def', 'expr', 'fvar_or_string',
940 'varname_args', 's_content',
944 * For tracing reduce actions, the names of all rules are required.
947 static public $yyRuleName = array(
948 /* 0 */ "start ::= body",
949 /* 1 */ "body ::= body code",
951 /* 3 */ "code ::= T_OPEN_TAG stmts",
952 /* 4 */ "code ::= T_HTML",
953 /* 5 */ "code ::= T_COMMENT_OPEN T_COMMENT",
954 /* 6 */ "code ::= T_PRINT_OPEN filtered_var T_PRINT_CLOSE",
955 /* 7 */ "stmts ::= T_EXTENDS var_or_string T_CLOSE_TAG",
956 /* 8 */ "stmts ::= stmt T_CLOSE_TAG",
957 /* 9 */ "stmts ::= for_stmt",
958 /* 10 */ "stmts ::= ifchanged_stmt",
959 /* 11 */ "stmts ::= block_stmt",
960 /* 12 */ "stmts ::= filter_stmt",
961 /* 13 */ "stmts ::= if_stmt",
962 /* 14 */ "stmts ::= T_INCLUDE var_or_string T_CLOSE_TAG",
963 /* 15 */ "stmts ::= custom_tag",
964 /* 16 */ "stmts ::= alias",
965 /* 17 */ "stmts ::= ifequal",
966 /* 18 */ "stmts ::= T_AUTOESCAPE T_OFF|T_ON T_CLOSE_TAG body T_OPEN_TAG T_END_AUTOESCAPE T_CLOSE_TAG",
967 /* 19 */ "custom_tag ::= T_CUSTOM_TAG T_CLOSE_TAG",
968 /* 20 */ "custom_tag ::= T_CUSTOM_TAG T_AS varname T_CLOSE_TAG",
969 /* 21 */ "custom_tag ::= T_CUSTOM_TAG var_list T_CLOSE_TAG",
970 /* 22 */ "custom_tag ::= T_CUSTOM_TAG var_list T_AS varname T_CLOSE_TAG",
971 /* 23 */ "custom_tag ::= T_CUSTOM_BLOCK T_CLOSE_TAG body T_OPEN_TAG T_CUSTOM_END T_CLOSE_TAG",
972 /* 24 */ "custom_tag ::= T_BUFFER varname T_CLOSE_TAG body T_OPEN_TAG T_CUSTOM_END T_CLOSE_TAG",
973 /* 25 */ "custom_tag ::= T_SPACEFULL T_CLOSE_TAG body T_OPEN_TAG T_CUSTOM_END T_CLOSE_TAG",
974 /* 26 */ "alias ::= T_WITH varname T_AS varname T_CLOSE_TAG body T_OPEN_TAG T_ENDWITH T_CLOSE_TAG",
975 /* 27 */ "stmt ::= regroup",
976 /* 28 */ "stmt ::= T_LOAD string",
977 /* 29 */ "for_def ::= T_FOR varname T_IN filtered_var T_CLOSE_TAG",
978 /* 30 */ "for_def ::= T_FOR varname T_COMMA varname T_IN filtered_var T_CLOSE_TAG",
979 /* 31 */ "for_stmt ::= for_def body T_OPEN_TAG T_CLOSEFOR T_CLOSE_TAG",
980 /* 32 */ "for_stmt ::= for_def body T_OPEN_TAG T_EMPTY T_CLOSE_TAG body T_OPEN_TAG T_CLOSEFOR T_CLOSE_TAG",
981 /* 33 */ "if_stmt ::= T_IF expr T_CLOSE_TAG body T_OPEN_TAG T_ENDIF T_CLOSE_TAG",
982 /* 34 */ "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",
983 /* 35 */ "ifchanged_stmt ::= T_IFCHANGED T_CLOSE_TAG body T_OPEN_TAG T_ENDIFCHANGED T_CLOSE_TAG",
984 /* 36 */ "ifchanged_stmt ::= T_IFCHANGED var_list T_CLOSE_TAG body T_OPEN_TAG T_ENDIFCHANGED T_CLOSE_TAG",
985 /* 37 */ "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",
986 /* 38 */ "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",
987 /* 39 */ "ifequal ::= T_IFEQUAL fvar_or_string fvar_or_string T_CLOSE_TAG body T_OPEN_TAG T_END_IFEQUAL T_CLOSE_TAG",
988 /* 40 */ "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",
989 /* 41 */ "ifequal ::= T_IFNOTEQUAL fvar_or_string fvar_or_string T_CLOSE_TAG body T_OPEN_TAG T_END_IFNOTEQUAL T_CLOSE_TAG",
990 /* 42 */ "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",
991 /* 43 */ "block_stmt ::= T_BLOCK varname T_CLOSE_TAG body T_OPEN_TAG T_END_BLOCK T_CLOSE_TAG",
992 /* 44 */ "block_stmt ::= T_BLOCK varname T_CLOSE_TAG body T_OPEN_TAG T_END_BLOCK varname T_CLOSE_TAG",
993 /* 45 */ "block_stmt ::= T_BLOCK T_NUMERIC T_CLOSE_TAG body T_OPEN_TAG T_END_BLOCK T_CLOSE_TAG",
994 /* 46 */ "block_stmt ::= T_BLOCK T_NUMERIC T_CLOSE_TAG body T_OPEN_TAG T_END_BLOCK T_NUMERIC T_CLOSE_TAG",
995 /* 47 */ "filter_stmt ::= T_FILTER filtered_var T_CLOSE_TAG body T_OPEN_TAG T_END_FILTER T_CLOSE_TAG",
996 /* 48 */ "regroup ::= T_REGROUP filtered_var T_BY varname T_AS varname",
997 /* 49 */ "filtered_var ::= filtered_var T_PIPE varname_args",
998 /* 50 */ "filtered_var ::= varname_args",
999 /* 51 */ "varname_args ::= varname T_COLON var_or_string",
1000 /* 52 */ "varname_args ::= varname",
1001 /* 53 */ "var_list ::= var_list var_or_string",
1002 /* 54 */ "var_list ::= var_list T_COMMA var_or_string",
1003 /* 55 */ "var_list ::= var_or_string",
1004 /* 56 */ "var_or_string ::= varname",
1005 /* 57 */ "var_or_string ::= T_NUMERIC",
1006 /* 58 */ "var_or_string ::= string",
1007 /* 59 */ "fvar_or_string ::= filtered_var",
1008 /* 60 */ "fvar_or_string ::= T_NUMERIC",
1009 /* 61 */ "fvar_or_string ::= string",
1010 /* 62 */ "string ::= T_INTL string T_RPARENT",
1011 /* 63 */ "string ::= T_STRING_SINGLE_INIT T_STRING_SINGLE_END",
1012 /* 64 */ "string ::= T_STRING_DOUBLE_INIT T_STRING_DOUBLE_END",
1013 /* 65 */ "string ::= T_STRING_SINGLE_INIT s_content T_STRING_SINGLE_END",
1014 /* 66 */ "string ::= T_STRING_DOUBLE_INIT s_content T_STRING_DOUBLE_END",
1015 /* 67 */ "s_content ::= s_content T_STRING_CONTENT",
1016 /* 68 */ "s_content ::= T_STRING_CONTENT",
1017 /* 69 */ "expr ::= T_NOT expr",
1018 /* 70 */ "expr ::= expr T_AND expr",
1019 /* 71 */ "expr ::= expr T_OR expr",
1020 /* 72 */ "expr ::= expr T_PLUS|T_MINUS expr",
1021 /* 73 */ "expr ::= expr T_EQ|T_NE|T_GT|T_GE|T_LT|T_LE|T_IN expr",
1022 /* 74 */ "expr ::= expr T_TIMES|T_DIV|T_MOD expr",
1023 /* 75 */ "expr ::= T_LPARENT expr T_RPARENT",
1024 /* 76 */ "expr ::= fvar_or_string",
1025 /* 77 */ "varname ::= varname T_OBJ T_ALPHA",
1026 /* 78 */ "varname ::= varname T_DOT T_ALPHA",
1027 /* 79 */ "varname ::= varname T_BRACKETS_OPEN var_or_string T_BRACKETS_CLOSE",
1028 /* 80 */ "varname ::= T_ALPHA",
1029 /* 81 */ "varname ::= T_CUSTOM_TAG|T_CUSTOM_BLOCK",
1033 * This function returns the symbolic name associated with a token
1038 function tokenName($tokenType)
1040 if ($tokenType === 0) {
1041 return 'End of Input';
1043 if ($tokenType > 0 && $tokenType < count(self
::$yyTokenName)) {
1044 return self
::$yyTokenName[$tokenType];
1051 * The following function deletes the value associated with a
1052 * symbol. The symbol can be either a terminal or nonterminal.
1053 * @param int the symbol code
1054 * @param mixed the symbol's value
1056 static function yy_destructor($yymajor, $yypminor)
1059 /* Here is inserted the actions which take place when a
1060 ** terminal or non-terminal is destroyed. This can happen
1061 ** when the symbol is popped from the stack during a
1062 ** reduce or during error processing or when a parser is
1063 ** being destroyed before it is finished parsing.
1065 ** Note: during a reduce, the only symbols destroyed are those
1066 ** which appear on the RHS of the rule, but which are not used
1067 ** inside the C code.
1069 default: break; /* If no destructor action specified: do nothing */
1074 * Pop the parser's stack once.
1076 * If there is a destructor routine associated with the token which
1077 * is popped from the stack, then call it.
1079 * Return the major token number for the symbol popped.
1080 * @param Haanga_yyParser
1083 function yy_pop_parser_stack()
1085 if (!count($this->yystack
)) {
1088 $yytos = array_pop($this->yystack
);
1089 if (self
::$yyTraceFILE && $this->yyidx
>= 0) {
1090 fwrite(self
::$yyTraceFILE,
1091 self
::$yyTracePrompt . 'Popping ' . self
::$yyTokenName[$yytos->major
] .
1094 $yymajor = $yytos->major
;
1095 self
::yy_destructor($yymajor, $yytos->minor
);
1101 * Deallocate and destroy a parser. Destructors are all called for
1102 * all stack elements before shutting the parser down.
1104 function __destruct()
1106 while ($this->yyidx
>= 0) {
1107 $this->yy_pop_parser_stack();
1109 if (is_resource(self
::$yyTraceFILE)) {
1110 fclose(self
::$yyTraceFILE);
1115 * Based on the current state and parser stack, get a list of all
1116 * possible lookahead tokens
1120 function yy_get_expected_tokens($token)
1122 $state = $this->yystack
[$this->yyidx
]->stateno
;
1123 $expected = self
::$yyExpectedTokens[$state];
1124 if (in_array($token, self
::$yyExpectedTokens[$state], true)) {
1127 $stack = $this->yystack
;
1128 $yyidx = $this->yyidx
;
1130 $yyact = $this->yy_find_shift_action($token);
1131 if ($yyact >= self
::YYNSTATE
&& $yyact < self
::YYNSTATE + self
::YYNRULE
) {
1135 if ($done++
== 100) {
1136 $this->yyidx
= $yyidx;
1137 $this->yystack
= $stack;
1138 // too much recursion prevents proper detection
1140 return array_unique($expected);
1142 $yyruleno = $yyact - self
::YYNSTATE
;
1143 $this->yyidx
-= self
::$yyRuleInfo[$yyruleno]['rhs'];
1144 $nextstate = $this->yy_find_reduce_action(
1145 $this->yystack
[$this->yyidx
]->stateno
,
1146 self
::$yyRuleInfo[$yyruleno]['lhs']);
1147 if (isset(self
::$yyExpectedTokens[$nextstate])) {
1148 $expected +
= self
::$yyExpectedTokens[$nextstate];
1149 if (in_array($token,
1150 self
::$yyExpectedTokens[$nextstate], true)) {
1151 $this->yyidx
= $yyidx;
1152 $this->yystack
= $stack;
1153 return array_unique($expected);
1156 if ($nextstate < self
::YYNSTATE
) {
1157 // we need to shift a non-terminal
1159 $x = new Haanga_yyStackEntry
;
1160 $x->stateno
= $nextstate;
1161 $x->major
= self
::$yyRuleInfo[$yyruleno]['lhs'];
1162 $this->yystack
[$this->yyidx
] = $x;
1164 } elseif ($nextstate == self
::YYNSTATE + self
::YYNRULE +
1) {
1165 $this->yyidx
= $yyidx;
1166 $this->yystack
= $stack;
1167 // the last token was just ignored, we can't accept
1168 // by ignoring input, this is in essence ignoring a
1170 return array_unique($expected);
1171 } elseif ($nextstate === self
::YY_NO_ACTION
) {
1172 $this->yyidx
= $yyidx;
1173 $this->yystack
= $stack;
1174 // input accepted, but not shifted (I guess)
1177 $yyact = $nextstate;
1183 return array_unique($expected);
1187 * Based on the parser state and current parser stack, determine whether
1188 * the lookahead token is possible.
1190 * The parser will convert the token value to an error token if not. This
1191 * catches some unusual edge cases where the parser would fail.
1195 function yy_is_expected_token($token)
1198 return true; // 0 is not part of this
1200 $state = $this->yystack
[$this->yyidx
]->stateno
;
1201 if (in_array($token, self
::$yyExpectedTokens[$state], true)) {
1204 $stack = $this->yystack
;
1205 $yyidx = $this->yyidx
;
1207 $yyact = $this->yy_find_shift_action($token);
1208 if ($yyact >= self
::YYNSTATE
&& $yyact < self
::YYNSTATE + self
::YYNRULE
) {
1212 if ($done++
== 100) {
1213 $this->yyidx
= $yyidx;
1214 $this->yystack
= $stack;
1215 // too much recursion prevents proper detection
1219 $yyruleno = $yyact - self
::YYNSTATE
;
1220 $this->yyidx
-= self
::$yyRuleInfo[$yyruleno]['rhs'];
1221 $nextstate = $this->yy_find_reduce_action(
1222 $this->yystack
[$this->yyidx
]->stateno
,
1223 self
::$yyRuleInfo[$yyruleno]['lhs']);
1224 if (isset(self
::$yyExpectedTokens[$nextstate]) &&
1225 in_array($token, self
::$yyExpectedTokens[$nextstate], true)) {
1226 $this->yyidx
= $yyidx;
1227 $this->yystack
= $stack;
1230 if ($nextstate < self
::YYNSTATE
) {
1231 // we need to shift a non-terminal
1233 $x = new Haanga_yyStackEntry
;
1234 $x->stateno
= $nextstate;
1235 $x->major
= self
::$yyRuleInfo[$yyruleno]['lhs'];
1236 $this->yystack
[$this->yyidx
] = $x;
1238 } elseif ($nextstate == self
::YYNSTATE + self
::YYNRULE +
1) {
1239 $this->yyidx
= $yyidx;
1240 $this->yystack
= $stack;
1242 // end of input: this is valid
1245 // the last token was just ignored, we can't accept
1246 // by ignoring input, this is in essence ignoring a
1249 } elseif ($nextstate === self
::YY_NO_ACTION
) {
1250 $this->yyidx
= $yyidx;
1251 $this->yystack
= $stack;
1252 // input accepted, but not shifted (I guess)
1255 $yyact = $nextstate;
1261 $this->yyidx
= $yyidx;
1262 $this->yystack
= $stack;
1267 * Find the appropriate action for a parser given the terminal
1268 * look-ahead token iLookAhead.
1270 * If the look-ahead token is YYNOCODE, then check to see if the action is
1271 * independent of the look-ahead. If it is, return the action, otherwise
1272 * return YY_NO_ACTION.
1273 * @param int The look-ahead token
1275 function yy_find_shift_action($iLookAhead)
1277 $stateno = $this->yystack
[$this->yyidx
]->stateno
;
1279 /* if ($this->yyidx < 0) return self::YY_NO_ACTION; */
1280 if (!isset(self
::$yy_shift_ofst[$stateno])) {
1282 return self
::$yy_default[$stateno];
1284 $i = self
::$yy_shift_ofst[$stateno];
1285 if ($i === self
::YY_SHIFT_USE_DFLT
) {
1286 return self
::$yy_default[$stateno];
1288 if ($iLookAhead == self
::YYNOCODE
) {
1289 return self
::YY_NO_ACTION
;
1292 if ($i < 0 ||
$i >= self
::YY_SZ_ACTTAB ||
1293 self
::$yy_lookahead[$i] != $iLookAhead) {
1294 if (count(self
::$yyFallback) && $iLookAhead < count(self
::$yyFallback)
1295 && ($iFallback = self
::$yyFallback[$iLookAhead]) != 0) {
1296 if (self
::$yyTraceFILE) {
1297 fwrite(self
::$yyTraceFILE, self
::$yyTracePrompt . "FALLBACK " .
1298 self
::$yyTokenName[$iLookAhead] . " => " .
1299 self
::$yyTokenName[$iFallback] . "\n");
1301 return $this->yy_find_shift_action($iFallback);
1303 return self
::$yy_default[$stateno];
1305 return self
::$yy_action[$i];
1310 * Find the appropriate action for a parser given the non-terminal
1311 * look-ahead token $iLookAhead.
1313 * If the look-ahead token is self::YYNOCODE, then check to see if the action is
1314 * independent of the look-ahead. If it is, return the action, otherwise
1315 * return self::YY_NO_ACTION.
1316 * @param int Current state number
1317 * @param int The look-ahead token
1319 function yy_find_reduce_action($stateno, $iLookAhead)
1321 /* $stateno = $this->yystack[$this->yyidx]->stateno; */
1323 if (!isset(self
::$yy_reduce_ofst[$stateno])) {
1324 return self
::$yy_default[$stateno];
1326 $i = self
::$yy_reduce_ofst[$stateno];
1327 if ($i == self
::YY_REDUCE_USE_DFLT
) {
1328 return self
::$yy_default[$stateno];
1330 if ($iLookAhead == self
::YYNOCODE
) {
1331 return self
::YY_NO_ACTION
;
1334 if ($i < 0 ||
$i >= self
::YY_SZ_ACTTAB ||
1335 self
::$yy_lookahead[$i] != $iLookAhead) {
1336 return self
::$yy_default[$stateno];
1338 return self
::$yy_action[$i];
1343 * Perform a shift action.
1344 * @param int The new state to shift in
1345 * @param int The major token to shift in
1346 * @param mixed the minor token to shift in
1348 function yy_shift($yyNewState, $yyMajor, $yypMinor)
1351 if ($this->yyidx
>= self
::YYSTACKDEPTH
) {
1353 if (self
::$yyTraceFILE) {
1354 fprintf(self
::$yyTraceFILE, "%sStack Overflow!\n", self
::$yyTracePrompt);
1356 while ($this->yyidx
>= 0) {
1357 $this->yy_pop_parser_stack();
1359 /* Here code is inserted which will execute if the parser
1360 ** stack ever overflows */
1363 $yytos = new Haanga_yyStackEntry
;
1364 $yytos->stateno
= $yyNewState;
1365 $yytos->major
= $yyMajor;
1366 $yytos->minor
= $yypMinor;
1367 array_push($this->yystack
, $yytos);
1368 if (self
::$yyTraceFILE && $this->yyidx
> 0) {
1369 fprintf(self
::$yyTraceFILE, "%sShift %d\n", self
::$yyTracePrompt,
1371 fprintf(self
::$yyTraceFILE, "%sStack:", self
::$yyTracePrompt);
1372 for($i = 1; $i <= $this->yyidx
; $i++
) {
1373 fprintf(self
::$yyTraceFILE, " %s",
1374 self
::$yyTokenName[$this->yystack
[$i]->major
]);
1376 fwrite(self
::$yyTraceFILE,"\n");
1381 * The following table contains information about every rule that
1382 * is used during the reduce.
1387 * int $lhs; Symbol on the left-hand side of the rule
1388 * int $nrhs; Number of right-hand side symbols in the rule
1393 static public $yyRuleInfo = array(
1394 array( 'lhs' => 74, 'rhs' => 1 ),
1395 array( 'lhs' => 75, 'rhs' => 2 ),
1396 array( 'lhs' => 75, 'rhs' => 0 ),
1397 array( 'lhs' => 76, 'rhs' => 2 ),
1398 array( 'lhs' => 76, 'rhs' => 1 ),
1399 array( 'lhs' => 76, 'rhs' => 2 ),
1400 array( 'lhs' => 76, 'rhs' => 3 ),
1401 array( 'lhs' => 77, 'rhs' => 3 ),
1402 array( 'lhs' => 77, 'rhs' => 2 ),
1403 array( 'lhs' => 77, 'rhs' => 1 ),
1404 array( 'lhs' => 77, 'rhs' => 1 ),
1405 array( 'lhs' => 77, 'rhs' => 1 ),
1406 array( 'lhs' => 77, 'rhs' => 1 ),
1407 array( 'lhs' => 77, 'rhs' => 1 ),
1408 array( 'lhs' => 77, 'rhs' => 3 ),
1409 array( 'lhs' => 77, 'rhs' => 1 ),
1410 array( 'lhs' => 77, 'rhs' => 1 ),
1411 array( 'lhs' => 77, 'rhs' => 1 ),
1412 array( 'lhs' => 77, 'rhs' => 7 ),
1413 array( 'lhs' => 86, 'rhs' => 2 ),
1414 array( 'lhs' => 86, 'rhs' => 4 ),
1415 array( 'lhs' => 86, 'rhs' => 3 ),
1416 array( 'lhs' => 86, 'rhs' => 5 ),
1417 array( 'lhs' => 86, 'rhs' => 6 ),
1418 array( 'lhs' => 86, 'rhs' => 7 ),
1419 array( 'lhs' => 86, 'rhs' => 6 ),
1420 array( 'lhs' => 87, 'rhs' => 9 ),
1421 array( 'lhs' => 80, 'rhs' => 1 ),
1422 array( 'lhs' => 80, 'rhs' => 2 ),
1423 array( 'lhs' => 93, 'rhs' => 5 ),
1424 array( 'lhs' => 93, 'rhs' => 7 ),
1425 array( 'lhs' => 81, 'rhs' => 5 ),
1426 array( 'lhs' => 81, 'rhs' => 9 ),
1427 array( 'lhs' => 85, 'rhs' => 7 ),
1428 array( 'lhs' => 85, 'rhs' => 11 ),
1429 array( 'lhs' => 82, 'rhs' => 6 ),
1430 array( 'lhs' => 82, 'rhs' => 7 ),
1431 array( 'lhs' => 82, 'rhs' => 10 ),
1432 array( 'lhs' => 82, 'rhs' => 11 ),
1433 array( 'lhs' => 88, 'rhs' => 8 ),
1434 array( 'lhs' => 88, 'rhs' => 12 ),
1435 array( 'lhs' => 88, 'rhs' => 8 ),
1436 array( 'lhs' => 88, 'rhs' => 12 ),
1437 array( 'lhs' => 83, 'rhs' => 7 ),
1438 array( 'lhs' => 83, 'rhs' => 8 ),
1439 array( 'lhs' => 83, 'rhs' => 7 ),
1440 array( 'lhs' => 83, 'rhs' => 8 ),
1441 array( 'lhs' => 84, 'rhs' => 7 ),
1442 array( 'lhs' => 91, 'rhs' => 6 ),
1443 array( 'lhs' => 78, 'rhs' => 3 ),
1444 array( 'lhs' => 78, 'rhs' => 1 ),
1445 array( 'lhs' => 96, 'rhs' => 3 ),
1446 array( 'lhs' => 96, 'rhs' => 1 ),
1447 array( 'lhs' => 90, 'rhs' => 2 ),
1448 array( 'lhs' => 90, 'rhs' => 3 ),
1449 array( 'lhs' => 90, 'rhs' => 1 ),
1450 array( 'lhs' => 79, 'rhs' => 1 ),
1451 array( 'lhs' => 79, 'rhs' => 1 ),
1452 array( 'lhs' => 79, 'rhs' => 1 ),
1453 array( 'lhs' => 95, 'rhs' => 1 ),
1454 array( 'lhs' => 95, 'rhs' => 1 ),
1455 array( 'lhs' => 95, 'rhs' => 1 ),
1456 array( 'lhs' => 92, 'rhs' => 3 ),
1457 array( 'lhs' => 92, 'rhs' => 2 ),
1458 array( 'lhs' => 92, 'rhs' => 2 ),
1459 array( 'lhs' => 92, 'rhs' => 3 ),
1460 array( 'lhs' => 92, 'rhs' => 3 ),
1461 array( 'lhs' => 97, 'rhs' => 2 ),
1462 array( 'lhs' => 97, 'rhs' => 1 ),
1463 array( 'lhs' => 94, 'rhs' => 2 ),
1464 array( 'lhs' => 94, 'rhs' => 3 ),
1465 array( 'lhs' => 94, 'rhs' => 3 ),
1466 array( 'lhs' => 94, 'rhs' => 3 ),
1467 array( 'lhs' => 94, 'rhs' => 3 ),
1468 array( 'lhs' => 94, 'rhs' => 3 ),
1469 array( 'lhs' => 94, 'rhs' => 3 ),
1470 array( 'lhs' => 94, 'rhs' => 1 ),
1471 array( 'lhs' => 89, 'rhs' => 3 ),
1472 array( 'lhs' => 89, 'rhs' => 3 ),
1473 array( 'lhs' => 89, 'rhs' => 4 ),
1474 array( 'lhs' => 89, 'rhs' => 1 ),
1475 array( 'lhs' => 89, 'rhs' => 1 ),
1479 * The following table contains a mapping of reduce action to method name
1480 * that handles the reduction.
1482 * If a rule is not set, it has no handler.
1484 static public $yyReduceMap = array(
1568 /* Beginning here are the reduction cases. A typical example
1570 ** #line <lineno> <grammarfile>
1571 ** function yy_r0($yymsp){ ... } // User supplied code
1572 ** #line <lineno> <thisfile>
1574 #line 79 "lib/Haanga/Compiler/Parser.y"
1575 function yy_r0(){ $this->body
= $this->yystack
[$this->yyidx +
0]->minor
; }
1576 #line 1582 "lib/Haanga/Compiler/Parser.php"
1577 #line 81 "lib/Haanga/Compiler/Parser.y"
1578 function yy_r1(){ $this->_retvalue
=$this->yystack
[$this->yyidx +
-1]->minor
; $this->_retvalue
[] = $this->yystack
[$this->yyidx +
0]->minor
; }
1579 #line 1585 "lib/Haanga/Compiler/Parser.php"
1580 #line 82 "lib/Haanga/Compiler/Parser.y"
1581 function yy_r2(){ $this->_retvalue
= array(); }
1582 #line 1588 "lib/Haanga/Compiler/Parser.php"
1583 #line 85 "lib/Haanga/Compiler/Parser.y"
1584 function yy_r3(){ if (count($this->yystack
[$this->yyidx +
0]->minor
)) $this->yystack
[$this->yyidx +
0]->minor
['line'] = $this->lex
->getLine(); $this->_retvalue
= $this->yystack
[$this->yyidx +
0]->minor
; }
1585 #line 1591 "lib/Haanga/Compiler/Parser.php"
1586 #line 86 "lib/Haanga/Compiler/Parser.y"
1587 function yy_r4(){ $this->_retvalue
= array('operation' => 'html', 'html' => $this->yystack
[$this->yyidx +
0]->minor
, 'line' => $this->lex
->getLine() ); }
1588 #line 1594 "lib/Haanga/Compiler/Parser.php"
1589 #line 87 "lib/Haanga/Compiler/Parser.y"
1590 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)); }
1591 #line 1597 "lib/Haanga/Compiler/Parser.php"
1592 #line 88 "lib/Haanga/Compiler/Parser.y"
1593 function yy_r6(){ $this->_retvalue
= array('operation' => 'print_var', 'variable' => $this->yystack
[$this->yyidx +
-1]->minor
, 'line' => $this->lex
->getLine() ); }
1594 #line 1600 "lib/Haanga/Compiler/Parser.php"
1595 #line 90 "lib/Haanga/Compiler/Parser.y"
1596 function yy_r7(){ $this->_retvalue
= array('operation' => 'base', $this->yystack
[$this->yyidx +
-1]->minor
); }
1597 #line 1603 "lib/Haanga/Compiler/Parser.php"
1598 #line 91 "lib/Haanga/Compiler/Parser.y"
1599 function yy_r8(){ $this->_retvalue
= $this->yystack
[$this->yyidx +
-1]->minor
; }
1600 #line 1606 "lib/Haanga/Compiler/Parser.php"
1601 #line 92 "lib/Haanga/Compiler/Parser.y"
1602 function yy_r9(){ $this->_retvalue
= $this->yystack
[$this->yyidx +
0]->minor
; }
1603 #line 1609 "lib/Haanga/Compiler/Parser.php"
1604 #line 97 "lib/Haanga/Compiler/Parser.y"
1605 function yy_r14(){ $this->_retvalue
= array('operation' => 'include', $this->yystack
[$this->yyidx +
-1]->minor
); }
1606 #line 1612 "lib/Haanga/Compiler/Parser.php"
1607 #line 101 "lib/Haanga/Compiler/Parser.y"
1608 function yy_r18(){ $this->_retvalue
= array('operation' => 'autoescape', 'value' => strtolower(@$this->yystack
[$this->yyidx +
-5]->minor
), 'body' => $this->yystack
[$this->yyidx +
-3]->minor
); }
1609 #line 1615 "lib/Haanga/Compiler/Parser.php"
1610 #line 106 "lib/Haanga/Compiler/Parser.y"
1611 function yy_r19(){ $this->_retvalue
= array('operation' => 'custom_tag', 'name' => $this->yystack
[$this->yyidx +
-1]->minor
, 'list'=>array()); }
1612 #line 1618 "lib/Haanga/Compiler/Parser.php"
1613 #line 107 "lib/Haanga/Compiler/Parser.y"
1614 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()); }
1615 #line 1621 "lib/Haanga/Compiler/Parser.php"
1616 #line 108 "lib/Haanga/Compiler/Parser.y"
1617 function yy_r21(){ $this->_retvalue
= array('operation' => 'custom_tag', 'name' => $this->yystack
[$this->yyidx +
-2]->minor
, 'list' => $this->yystack
[$this->yyidx +
-1]->minor
); }
1618 #line 1624 "lib/Haanga/Compiler/Parser.php"
1619 #line 109 "lib/Haanga/Compiler/Parser.y"
1620 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
); }
1621 #line 1627 "lib/Haanga/Compiler/Parser.php"
1622 #line 111 "lib/Haanga/Compiler/Parser.y"
1623 function yy_r23(){ if ('end'.$this->yystack
[$this->yyidx +
-5]->minor
!= $this->yystack
[$this->yyidx +
-1]->minor
) { $this->error("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()); }
1624 #line 1630 "lib/Haanga/Compiler/Parser.php"
1625 #line 112 "lib/Haanga/Compiler/Parser.y"
1626 function yy_r24(){ if ('endbuffer' != $this->yystack
[$this->yyidx +
-1]->minor
) { $this->error("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
); }
1627 #line 1633 "lib/Haanga/Compiler/Parser.php"
1628 #line 113 "lib/Haanga/Compiler/Parser.y"
1629 function yy_r25(){ if ('endspacefull' != $this->yystack
[$this->yyidx +
-1]->minor
) { $this->error("Unexpected ".$this->yystack
[$this->yyidx +
-1]->minor
); } $this->_retvalue
= array('operation' => 'spacefull', 'body' => $this->yystack
[$this->yyidx +
-3]->minor
); }
1630 #line 1636 "lib/Haanga/Compiler/Parser.php"
1631 #line 116 "lib/Haanga/Compiler/Parser.y"
1632 function yy_r26(){ $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
); }
1633 #line 1639 "lib/Haanga/Compiler/Parser.php"
1634 #line 120 "lib/Haanga/Compiler/Parser.y"
1636 if (!is_file($this->yystack
[$this->yyidx +
0]->minor
)) {
1637 $this->error($this->yystack
[$this->yyidx +
0]->minor
." is not a valid file");
1639 require_once $this->yystack
[$this->yyidx +
0]->minor
;
1641 #line 1647 "lib/Haanga/Compiler/Parser.php"
1642 #line 128 "lib/Haanga/Compiler/Parser.y"
1644 $this->compiler
->set_context($this->yystack
[$this->yyidx +
-3]->minor
, array());
1645 $this->_retvalue
= array('operation' => 'loop', 'variable' => $this->yystack
[$this->yyidx +
-3]->minor
, 'index' => NULL, 'array' => $this->yystack
[$this->yyidx +
-1]->minor
);
1647 #line 1653 "lib/Haanga/Compiler/Parser.php"
1648 #line 133 "lib/Haanga/Compiler/Parser.y"
1650 $this->compiler
->set_context($this->yystack
[$this->yyidx +
-3]->minor
, array());
1651 $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
);
1653 #line 1659 "lib/Haanga/Compiler/Parser.php"
1654 #line 139 "lib/Haanga/Compiler/Parser.y"
1656 $this->_retvalue
= $this->yystack
[$this->yyidx +
-4]->minor
;
1657 $this->_retvalue
['body'] = $this->yystack
[$this->yyidx +
-3]->minor
;
1659 #line 1665 "lib/Haanga/Compiler/Parser.php"
1660 #line 144 "lib/Haanga/Compiler/Parser.y"
1662 $this->_retvalue
= $this->yystack
[$this->yyidx +
-8]->minor
;
1663 $this->_retvalue
['body'] = $this->yystack
[$this->yyidx +
-7]->minor
;
1664 $this->_retvalue
['empty'] = $this->yystack
[$this->yyidx +
-3]->minor
;
1666 #line 1672 "lib/Haanga/Compiler/Parser.php"
1667 #line 150 "lib/Haanga/Compiler/Parser.y"
1668 function yy_r33(){ $this->_retvalue
= array('operation' => 'if', 'expr' => $this->yystack
[$this->yyidx +
-5]->minor
, 'body' => $this->yystack
[$this->yyidx +
-3]->minor
); }
1669 #line 1675 "lib/Haanga/Compiler/Parser.php"
1670 #line 151 "lib/Haanga/Compiler/Parser.y"
1671 function yy_r34(){ $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
); }
1672 #line 1678 "lib/Haanga/Compiler/Parser.php"
1673 #line 154 "lib/Haanga/Compiler/Parser.y"
1675 $this->_retvalue
= array('operation' => 'ifchanged', 'body' => $this->yystack
[$this->yyidx +
-3]->minor
);
1677 #line 1683 "lib/Haanga/Compiler/Parser.php"
1678 #line 158 "lib/Haanga/Compiler/Parser.y"
1680 $this->_retvalue
= array('operation' => 'ifchanged', 'body' => $this->yystack
[$this->yyidx +
-3]->minor
, 'check' => $this->yystack
[$this->yyidx +
-5]->minor
);
1682 #line 1688 "lib/Haanga/Compiler/Parser.php"
1683 #line 161 "lib/Haanga/Compiler/Parser.y"
1685 $this->_retvalue
= array('operation' => 'ifchanged', 'body' => $this->yystack
[$this->yyidx +
-7]->minor
, 'else' => $this->yystack
[$this->yyidx +
-3]->minor
);
1687 #line 1693 "lib/Haanga/Compiler/Parser.php"
1688 #line 165 "lib/Haanga/Compiler/Parser.y"
1690 $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
);
1692 #line 1698 "lib/Haanga/Compiler/Parser.php"
1693 #line 170 "lib/Haanga/Compiler/Parser.y"
1694 function yy_r39(){ $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
); }
1695 #line 1701 "lib/Haanga/Compiler/Parser.php"
1696 #line 171 "lib/Haanga/Compiler/Parser.y"
1697 function yy_r40(){ $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
); }
1698 #line 1704 "lib/Haanga/Compiler/Parser.php"
1699 #line 172 "lib/Haanga/Compiler/Parser.y"
1700 function yy_r41(){ $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
); }
1701 #line 1707 "lib/Haanga/Compiler/Parser.php"
1702 #line 173 "lib/Haanga/Compiler/Parser.y"
1703 function yy_r42(){ $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
); }
1704 #line 1710 "lib/Haanga/Compiler/Parser.php"
1705 #line 177 "lib/Haanga/Compiler/Parser.y"
1706 function yy_r43(){ $this->_retvalue
= array('operation' => 'block', 'name' => $this->yystack
[$this->yyidx +
-5]->minor
, 'body' => $this->yystack
[$this->yyidx +
-3]->minor
); }
1707 #line 1713 "lib/Haanga/Compiler/Parser.php"
1708 #line 179 "lib/Haanga/Compiler/Parser.y"
1709 function yy_r44(){ $this->_retvalue
= array('operation' => 'block', 'name' => $this->yystack
[$this->yyidx +
-6]->minor
, 'body' => $this->yystack
[$this->yyidx +
-4]->minor
); }
1710 #line 1716 "lib/Haanga/Compiler/Parser.php"
1711 #line 186 "lib/Haanga/Compiler/Parser.y"
1712 function yy_r47(){ $this->_retvalue
= array('operation' => 'filter', 'functions' => $this->yystack
[$this->yyidx +
-5]->minor
, 'body' => $this->yystack
[$this->yyidx +
-3]->minor
); }
1713 #line 1719 "lib/Haanga/Compiler/Parser.php"
1714 #line 189 "lib/Haanga/Compiler/Parser.y"
1715 function yy_r48(){ $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
); }
1716 #line 1722 "lib/Haanga/Compiler/Parser.php"
1717 #line 192 "lib/Haanga/Compiler/Parser.y"
1718 function yy_r49(){ $this->_retvalue
= $this->yystack
[$this->yyidx +
-2]->minor
; $this->_retvalue
[] = $this->yystack
[$this->yyidx +
0]->minor
; }
1719 #line 1725 "lib/Haanga/Compiler/Parser.php"
1720 #line 193 "lib/Haanga/Compiler/Parser.y"
1721 function yy_r50(){ $this->_retvalue
= array($this->yystack
[$this->yyidx +
0]->minor
); }
1722 #line 1728 "lib/Haanga/Compiler/Parser.php"
1723 #line 195 "lib/Haanga/Compiler/Parser.y"
1724 function yy_r51(){ $this->_retvalue
= array($this->yystack
[$this->yyidx +
-2]->minor
, 'args'=>array($this->yystack
[$this->yyidx +
0]->minor
)); }
1725 #line 1731 "lib/Haanga/Compiler/Parser.php"
1726 #line 199 "lib/Haanga/Compiler/Parser.y"
1727 function yy_r53(){ $this->_retvalue
= $this->yystack
[$this->yyidx +
-1]->minor
; $this->_retvalue
[] = $this->yystack
[$this->yyidx +
0]->minor
; }
1728 #line 1734 "lib/Haanga/Compiler/Parser.php"
1729 #line 205 "lib/Haanga/Compiler/Parser.y"
1730 function yy_r56(){ $this->_retvalue
= array('var' => $this->yystack
[$this->yyidx +
0]->minor
); }
1731 #line 1737 "lib/Haanga/Compiler/Parser.php"
1732 #line 206 "lib/Haanga/Compiler/Parser.y"
1733 function yy_r57(){ $this->_retvalue
= array('number' => $this->yystack
[$this->yyidx +
0]->minor
); }
1734 #line 1740 "lib/Haanga/Compiler/Parser.php"
1735 #line 207 "lib/Haanga/Compiler/Parser.y"
1736 function yy_r58(){ $this->_retvalue
= array('string' => $this->yystack
[$this->yyidx +
0]->minor
); }
1737 #line 1743 "lib/Haanga/Compiler/Parser.php"
1738 #line 209 "lib/Haanga/Compiler/Parser.y"
1739 function yy_r59(){ $this->_retvalue
= array('var_filter' => $this->yystack
[$this->yyidx +
0]->minor
); }
1740 #line 1746 "lib/Haanga/Compiler/Parser.php"
1741 #line 215 "lib/Haanga/Compiler/Parser.y"
1742 function yy_r63(){ $this->_retvalue
= ""; }
1743 #line 1749 "lib/Haanga/Compiler/Parser.php"
1744 #line 217 "lib/Haanga/Compiler/Parser.y"
1745 function yy_r65(){ $this->_retvalue
= $this->yystack
[$this->yyidx +
-1]->minor
; }
1746 #line 1752 "lib/Haanga/Compiler/Parser.php"
1747 #line 219 "lib/Haanga/Compiler/Parser.y"
1748 function yy_r67(){ $this->_retvalue
= $this->yystack
[$this->yyidx +
-1]->minor
.$this->yystack
[$this->yyidx +
0]->minor
; }
1749 #line 1755 "lib/Haanga/Compiler/Parser.php"
1750 #line 223 "lib/Haanga/Compiler/Parser.y"
1751 function yy_r69(){ $this->_retvalue
= array('op_expr' => 'not', $this->yystack
[$this->yyidx +
0]->minor
); }
1752 #line 1758 "lib/Haanga/Compiler/Parser.php"
1753 #line 224 "lib/Haanga/Compiler/Parser.y"
1754 function yy_r70(){ $this->_retvalue
= array('op_expr' => @$this->yystack
[$this->yyidx +
-1]->minor
, $this->yystack
[$this->yyidx +
-2]->minor
, $this->yystack
[$this->yyidx +
0]->minor
); }
1755 #line 1761 "lib/Haanga/Compiler/Parser.php"
1756 #line 227 "lib/Haanga/Compiler/Parser.y"
1757 function yy_r73(){ $this->_retvalue
= array('op_expr' => trim(@$this->yystack
[$this->yyidx +
-1]->minor
), $this->yystack
[$this->yyidx +
-2]->minor
, $this->yystack
[$this->yyidx +
0]->minor
); }
1758 #line 1764 "lib/Haanga/Compiler/Parser.php"
1759 #line 229 "lib/Haanga/Compiler/Parser.y"
1760 function yy_r75(){ $this->_retvalue
= array('op_expr' => 'expr', $this->yystack
[$this->yyidx +
-1]->minor
); }
1761 #line 1767 "lib/Haanga/Compiler/Parser.php"
1762 #line 233 "lib/Haanga/Compiler/Parser.y"
1763 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
[]=array('object' => $this->yystack
[$this->yyidx +
0]->minor
); }
1764 #line 1770 "lib/Haanga/Compiler/Parser.php"
1765 #line 234 "lib/Haanga/Compiler/Parser.y"
1766 function yy_r78(){ 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
; }
1767 #line 1773 "lib/Haanga/Compiler/Parser.php"
1768 #line 235 "lib/Haanga/Compiler/Parser.y"
1769 function yy_r79(){ 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
; }
1770 #line 1776 "lib/Haanga/Compiler/Parser.php"
1773 * placeholder for the left hand side in a reduce operation.
1775 * For a parser with a rule like this:
1777 * rule(A) ::= B. { A = 1; }
1780 * The parser will translate to something like:
1783 * function yy_r0(){$this->_retvalue = 1;}
1789 * Perform a reduce action and the shift that must immediately
1790 * follow the reduce.
1792 * For a rule such as:
1795 * A ::= B blah C. { dosomething(); }
1798 * This function will first call the action, if any, ("dosomething();" in our
1799 * example), and then it will pop three states from the stack,
1800 * one for each entry on the right-hand side of the expression
1801 * (B, blah, and C in our example rule), and then push the result of the action
1802 * back on to the stack with the resulting state reduced to (as described in the .out
1804 * @param int Number of the rule by which to reduce
1806 function yy_reduce($yyruleno)
1808 //int $yygoto; /* The next state */
1809 //int $yyact; /* The next action */
1810 //mixed $yygotominor; /* The LHS of the rule reduced */
1811 //Haanga_yyStackEntry $yymsp; /* The top of the parser's stack */
1812 //int $yysize; /* Amount to pop the stack */
1813 $yymsp = $this->yystack
[$this->yyidx
];
1814 if (self
::$yyTraceFILE && $yyruleno >= 0
1815 && $yyruleno < count(self
::$yyRuleName)) {
1816 fprintf(self
::$yyTraceFILE, "%sReduce (%d) [%s].\n",
1817 self
::$yyTracePrompt, $yyruleno,
1818 self
::$yyRuleName[$yyruleno]);
1821 $this->_retvalue
= $yy_lefthand_side = null;
1822 if (array_key_exists($yyruleno, self
::$yyReduceMap)) {
1824 $this->_retvalue
= null;
1825 $this->{'yy_r' . self
::$yyReduceMap[$yyruleno]}();
1826 $yy_lefthand_side = $this->_retvalue
;
1828 $yygoto = self
::$yyRuleInfo[$yyruleno]['lhs'];
1829 $yysize = self
::$yyRuleInfo[$yyruleno]['rhs'];
1830 $this->yyidx
-= $yysize;
1831 for($i = $yysize; $i; $i--) {
1832 // pop all of the right-hand side parameters
1833 array_pop($this->yystack
);
1835 $yyact = $this->yy_find_reduce_action($this->yystack
[$this->yyidx
]->stateno
, $yygoto);
1836 if ($yyact < self
::YYNSTATE
) {
1837 /* If we are not debugging and the reduce action popped at least
1838 ** one element off the stack, then we can push the new element back
1839 ** onto the stack here, and skip the stack overflow test in yy_shift().
1840 ** That gives a significant speed improvement. */
1841 if (!self
::$yyTraceFILE && $yysize) {
1843 $x = new Haanga_yyStackEntry
;
1844 $x->stateno
= $yyact;
1845 $x->major
= $yygoto;
1846 $x->minor
= $yy_lefthand_side;
1847 $this->yystack
[$this->yyidx
] = $x;
1849 $this->yy_shift($yyact, $yygoto, $yy_lefthand_side);
1851 } elseif ($yyact == self
::YYNSTATE + self
::YYNRULE +
1) {
1857 * The following code executes when the parse fails
1859 * Code from %parse_fail is inserted here
1861 function yy_parse_failed()
1863 if (self
::$yyTraceFILE) {
1864 fprintf(self
::$yyTraceFILE, "%sFail!\n", self
::$yyTracePrompt);
1866 while ($this->yyidx
>= 0) {
1867 $this->yy_pop_parser_stack();
1869 /* Here code is inserted which will be executed whenever the
1874 * The following code executes when a syntax error first occurs.
1876 * %syntax_error code is inserted here
1877 * @param int The major type of the error token
1878 * @param mixed The minor type of the error token
1880 function yy_syntax_error($yymajor, $TOKEN)
1882 #line 70 "lib/Haanga/Compiler/Parser.y"
1885 foreach ($this->yy_get_expected_tokens($yymajor) as $token) {
1886 $expect[] = self
::$yyTokenName[$token];
1888 throw new Compiler_Exception('Unexpected ' . $this->tokenName($yymajor) . '(' . $TOKEN. '), expected one of: ' . implode(',', $expect));
1889 #line 1896 "lib/Haanga/Compiler/Parser.php"
1893 * The following is executed when the parser accepts
1895 * %parse_accept code is inserted here
1897 function yy_accept()
1899 if (self
::$yyTraceFILE) {
1900 fprintf(self
::$yyTraceFILE, "%sAccept!\n", self
::$yyTracePrompt);
1902 while ($this->yyidx
>= 0) {
1903 $stack = $this->yy_pop_parser_stack();
1905 /* Here code is inserted which will be executed whenever the
1906 ** parser accepts */
1907 #line 57 "lib/Haanga/Compiler/Parser.y"
1909 #line 1917 "lib/Haanga/Compiler/Parser.php"
1913 * The main parser program.
1915 * The first argument is the major token number. The second is
1916 * the token value string as scanned from the input.
1918 * @param int the token number
1919 * @param mixed the token value
1920 * @param mixed any extra arguments that should be passed to handlers
1922 function doParse($yymajor, $yytokenvalue)
1924 // $yyact; /* The parser action. */
1925 // $yyendofinput; /* True if we are at the end of input */
1926 $yyerrorhit = 0; /* True if yymajor has invoked an error */
1928 /* (re)initialize the parser, if necessary */
1929 if ($this->yyidx
=== null ||
$this->yyidx
< 0) {
1930 /* if ($yymajor == 0) return; // not sure why this was here... */
1932 $this->yyerrcnt
= -1;
1933 $x = new Haanga_yyStackEntry
;
1936 $this->yystack
= array();
1937 array_push($this->yystack
, $x);
1939 $yyendofinput = ($yymajor==0);
1941 if (self
::$yyTraceFILE) {
1942 fprintf(self
::$yyTraceFILE, "%sInput %s\n",
1943 self
::$yyTracePrompt, self
::$yyTokenName[$yymajor]);
1947 $yyact = $this->yy_find_shift_action($yymajor);
1948 if ($yymajor < self
::YYERRORSYMBOL
&&
1949 !$this->yy_is_expected_token($yymajor)) {
1950 // force a syntax error
1951 $yyact = self
::YY_ERROR_ACTION
;
1953 if ($yyact < self
::YYNSTATE
) {
1954 $this->yy_shift($yyact, $yymajor, $yytokenvalue);
1956 if ($yyendofinput && $this->yyidx
>= 0) {
1959 $yymajor = self
::YYNOCODE
;
1961 } elseif ($yyact < self
::YYNSTATE + self
::YYNRULE
) {
1962 $this->yy_reduce($yyact - self
::YYNSTATE
);
1963 } elseif ($yyact == self
::YY_ERROR_ACTION
) {
1964 if (self
::$yyTraceFILE) {
1965 fprintf(self
::$yyTraceFILE, "%sSyntax Error!\n",
1966 self
::$yyTracePrompt);
1968 if (self
::YYERRORSYMBOL
) {
1969 /* A syntax error has occurred.
1970 ** The response to an error depends upon whether or not the
1971 ** grammar defines an error token "ERROR".
1973 ** This is what we do if the grammar does define ERROR:
1975 ** * Call the %syntax_error function.
1977 ** * Begin popping the stack until we enter a state where
1978 ** it is legal to shift the error symbol, then shift
1979 ** the error symbol.
1981 ** * Set the error count to three.
1983 ** * Begin accepting and shifting new tokens. No new error
1984 ** processing will occur until three tokens have been
1985 ** shifted successfully.
1988 if ($this->yyerrcnt
< 0) {
1989 $this->yy_syntax_error($yymajor, $yytokenvalue);
1991 $yymx = $this->yystack
[$this->yyidx
]->major
;
1992 if ($yymx == self
::YYERRORSYMBOL ||
$yyerrorhit ){
1993 if (self
::$yyTraceFILE) {
1994 fprintf(self
::$yyTraceFILE, "%sDiscard input token %s\n",
1995 self
::$yyTracePrompt, self
::$yyTokenName[$yymajor]);
1997 $this->yy_destructor($yymajor, $yytokenvalue);
1998 $yymajor = self
::YYNOCODE
;
2000 while ($this->yyidx
>= 0 &&
2001 $yymx != self
::YYERRORSYMBOL
&&
2002 ($yyact = $this->yy_find_shift_action(self
::YYERRORSYMBOL
)) >= self
::YYNSTATE
2004 $this->yy_pop_parser_stack();
2006 if ($this->yyidx
< 0 ||
$yymajor==0) {
2007 $this->yy_destructor($yymajor, $yytokenvalue);
2008 $this->yy_parse_failed();
2009 $yymajor = self
::YYNOCODE
;
2010 } elseif ($yymx != self
::YYERRORSYMBOL
) {
2012 $this->yy_shift($yyact, self
::YYERRORSYMBOL
, $u2);
2015 $this->yyerrcnt
= 3;
2018 /* YYERRORSYMBOL is not defined */
2019 /* This is what we do if the grammar does not define ERROR:
2021 ** * Report an error message, and throw away the input token.
2023 ** * If the input token is $, then fail the parse.
2025 ** As before, subsequent error messages are suppressed until
2026 ** three input tokens have been successfully shifted.
2028 if ($this->yyerrcnt
<= 0) {
2029 $this->yy_syntax_error($yymajor, $yytokenvalue);
2031 $this->yyerrcnt
= 3;
2032 $this->yy_destructor($yymajor, $yytokenvalue);
2033 if ($yyendofinput) {
2034 $this->yy_parse_failed();
2036 $yymajor = self
::YYNOCODE
;
2040 $yymajor = self
::YYNOCODE
;
2042 } while ($yymajor != self
::YYNOCODE
&& $this->yyidx
>= 0);