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
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 "Parser.php"
136 // declare_class is output here
138 class Haanga_Compiler_Parser
#line 141 "Parser.php"
140 /* First off, code is included which follows the "include_class" declaration
141 ** in the input file. */
147 function __construct($lex, $file='')
153 function Error($text)
155 throw new Haanga_Compiler_Exception($text.' in '.$this->file
.':'.$this->lex
->getLine());
158 #line 162 "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_TAG_OPEN
= 1;
187 const T_BITWISE
= 19;
189 const T_COMMENT
= 21;
190 const T_PRINT_OPEN
= 22;
191 const T_PRINT_CLOSE
= 23;
192 const T_EXTENDS
= 24;
193 const T_TAG_CLOSE
= 25;
194 const T_INCLUDE
= 26;
195 const T_AUTOESCAPE
= 27;
196 const T_CUSTOM_END
= 28;
197 const T_CUSTOM_TAG
= 29;
199 const T_CUSTOM_BLOCK
= 31;
200 const T_SPACEFULL
= 32;
211 const T_IFCHANGED
= 43;
212 const T_IFEQUAL
= 44;
213 const T_IFNOTEQUAL
= 45;
216 const T_REGROUP
= 48;
223 const T_RPARENT
= 55;
224 const T_LPARENT
= 56;
229 const T_BRACKETS_OPEN
= 61;
230 const T_BRACKETS_CLOSE
= 62;
232 const T_NUMERIC
= 64;
233 const YY_NO_ACTION
= 356;
234 const YY_ACCEPT_ACTION
= 355;
235 const YY_ERROR_ACTION
= 354;
237 /* Next are that tables used to determine what action to take based on the
238 ** current state and lookahead token. These tables are used to implement
239 ** functions that take a state number and lookahead value and return an
242 ** Suppose the action integer is N. Then the action is determined as
245 ** 0 <= N < self::YYNSTATE Shift N. That is,
246 ** push the lookahead
247 ** token onto the stack
250 ** self::YYNSTATE <= N < self::YYNSTATE+self::YYNRULE Reduce by rule N-YYNSTATE.
252 ** N == self::YYNSTATE+self::YYNRULE A syntax error has occurred.
254 ** N == self::YYNSTATE+self::YYNRULE+1 The parser accepts its
255 ** input. (and concludes parsing)
257 ** N == self::YYNSTATE+self::YYNRULE+2 No such action. Denotes unused
258 ** slots in the yy_action[] table.
260 ** The action table is constructed as a single large static array $yy_action.
261 ** Given state S and lookahead X, the action is computed as
263 ** self::$yy_action[self::$yy_shift_ofst[S] + X ]
265 ** If the index value self::$yy_shift_ofst[S]+X is out of range or if the value
266 ** self::$yy_lookahead[self::$yy_shift_ofst[S]+X] is not equal to X or if
267 ** self::$yy_shift_ofst[S] is equal to self::YY_SHIFT_USE_DFLT, it means that
268 ** the action is not in the table and that self::$yy_default[S] should be used instead.
270 ** The formula above is for computing the action when the lookahead is
271 ** a terminal symbol. If the lookahead is a non-terminal (as occurs after
272 ** a reduce action) then the static $yy_reduce_ofst array is used in place of
273 ** the static $yy_shift_ofst array and self::YY_REDUCE_USE_DFLT is used in place of
274 ** self::YY_SHIFT_USE_DFLT.
276 ** The following are the tables generated in this section:
278 ** self::$yy_action A single table containing all actions.
279 ** self::$yy_lookahead A table containing the lookahead for each entry in
280 ** yy_action. Used to detect hash collisions.
281 ** self::$yy_shift_ofst For each state, the offset into self::$yy_action for
282 ** shifting terminals.
283 ** self::$yy_reduce_ofst For each state, the offset into self::$yy_action for
284 ** shifting non-terminals after a reduce.
285 ** self::$yy_default Default action for each state.
287 const YY_SZ_ACTTAB
= 1328;
288 static public $yy_action = array(
289 /* 0 */ 47, 57, 49, 65, 152, 39, 194, 40, 172, 64,
290 /* 10 */ 59, 195, 93, 67, 233, 155, 212, 29, 153, 41,
291 /* 20 */ 37, 36, 56, 53, 55, 47, 57, 49, 65, 177,
292 /* 30 */ 39, 247, 40, 172, 64, 59, 57, 93, 67, 25,
293 /* 40 */ 25, 178, 29, 202, 41, 37, 36, 56, 53, 55,
294 /* 50 */ 47, 161, 49, 65, 165, 39, 248, 40, 172, 64,
295 /* 60 */ 59, 224, 93, 67, 242, 126, 238, 29, 162, 41,
296 /* 70 */ 37, 36, 56, 53, 55, 47, 231, 49, 65, 182,
297 /* 80 */ 39, 97, 40, 172, 64, 59, 253, 93, 67, 109,
298 /* 90 */ 128, 201, 29, 189, 41, 37, 36, 56, 53, 55,
299 /* 100 */ 47, 231, 49, 65, 187, 39, 107, 40, 172, 64,
300 /* 110 */ 59, 204, 93, 67, 215, 124, 251, 29, 183, 41,
301 /* 120 */ 37, 36, 56, 53, 55, 47, 231, 49, 65, 169,
302 /* 130 */ 39, 191, 40, 172, 64, 59, 237, 93, 67, 196,
303 /* 140 */ 139, 111, 29, 171, 41, 37, 36, 56, 53, 55,
304 /* 150 */ 47, 231, 49, 65, 158, 39, 199, 40, 172, 64,
305 /* 160 */ 59, 57, 93, 67, 108, 127, 104, 29, 95, 41,
306 /* 170 */ 37, 36, 56, 53, 55, 47, 231, 49, 65, 151,
307 /* 180 */ 39, 197, 40, 172, 64, 59, 57, 93, 67, 106,
308 /* 190 */ 135, 193, 29, 239, 41, 37, 36, 56, 53, 55,
309 /* 200 */ 47, 231, 49, 65, 92, 39, 100, 40, 172, 64,
310 /* 210 */ 59, 244, 93, 67, 210, 125, 110, 29, 115, 41,
311 /* 220 */ 37, 36, 56, 53, 55, 47, 231, 49, 65, 160,
312 /* 230 */ 39, 243, 40, 172, 64, 59, 236, 93, 67, 252,
313 /* 240 */ 130, 209, 29, 50, 41, 37, 36, 56, 53, 55,
314 /* 250 */ 47, 231, 49, 65, 184, 39, 229, 40, 172, 64,
315 /* 260 */ 59, 246, 93, 67, 102, 131, 225, 29, 232, 41,
316 /* 270 */ 37, 36, 56, 53, 55, 47, 231, 49, 65, 173,
317 /* 280 */ 39, 241, 40, 172, 64, 59, 83, 93, 67, 88,
318 /* 290 */ 133, 87, 29, 179, 41, 37, 36, 56, 53, 55,
319 /* 300 */ 47, 231, 49, 65, 188, 39, 184, 40, 172, 64,
320 /* 310 */ 59, 90, 93, 67, 89, 129, 85, 29, 184, 41,
321 /* 320 */ 37, 36, 56, 53, 55, 47, 231, 49, 65, 168,
322 /* 330 */ 39, 84, 40, 172, 64, 59, 86, 93, 67, 355,
323 /* 340 */ 78, 79, 29, 184, 41, 37, 36, 56, 53, 55,
324 /* 350 */ 47, 76, 49, 65, 170, 39, 81, 40, 172, 64,
325 /* 360 */ 59, 74, 93, 67, 75, 71, 77, 29, 184, 41,
326 /* 370 */ 37, 36, 56, 53, 55, 47, 80, 49, 65, 181,
327 /* 380 */ 39, 73, 40, 172, 64, 59, 184, 93, 67, 82,
328 /* 390 */ 72, 70, 29, 184, 41, 37, 36, 56, 53, 55,
329 /* 400 */ 47, 91, 49, 65, 58, 39, 69, 40, 172, 64,
330 /* 410 */ 59, 184, 93, 67, 184, 184, 184, 29, 184, 41,
331 /* 420 */ 37, 36, 56, 53, 55, 47, 184, 49, 65, 185,
332 /* 430 */ 39, 184, 40, 172, 64, 59, 184, 93, 67, 184,
333 /* 440 */ 184, 184, 29, 184, 41, 37, 36, 56, 53, 55,
334 /* 450 */ 47, 184, 49, 65, 149, 39, 184, 40, 172, 64,
335 /* 460 */ 59, 184, 93, 67, 184, 184, 184, 29, 184, 41,
336 /* 470 */ 37, 36, 56, 53, 55, 47, 184, 49, 65, 175,
337 /* 480 */ 39, 184, 40, 172, 64, 59, 184, 93, 67, 184,
338 /* 490 */ 184, 184, 29, 57, 41, 37, 36, 56, 53, 55,
339 /* 500 */ 30, 31, 32, 32, 32, 32, 32, 32, 32, 27,
340 /* 510 */ 27, 27, 26, 26, 26, 25, 25, 26, 26, 26,
341 /* 520 */ 25, 25, 113, 47, 66, 49, 65, 156, 39, 184,
342 /* 530 */ 40, 172, 64, 59, 184, 93, 67, 184, 184, 184,
343 /* 540 */ 29, 184, 41, 37, 36, 56, 53, 55, 47, 184,
344 /* 550 */ 49, 65, 180, 39, 184, 40, 172, 64, 59, 184,
345 /* 560 */ 93, 67, 184, 184, 184, 29, 184, 41, 37, 36,
346 /* 570 */ 56, 53, 55, 30, 31, 32, 32, 32, 32, 32,
347 /* 580 */ 32, 32, 27, 27, 27, 26, 26, 26, 25, 25,
348 /* 590 */ 47, 184, 49, 65, 132, 39, 184, 40, 172, 64,
349 /* 600 */ 59, 184, 93, 67, 257, 231, 143, 29, 45, 41,
350 /* 610 */ 37, 36, 56, 53, 55, 140, 140, 123, 141, 48,
351 /* 620 */ 184, 351, 184, 148, 164, 250, 198, 263, 231, 30,
352 /* 630 */ 31, 32, 32, 32, 32, 32, 32, 32, 27, 27,
353 /* 640 */ 27, 26, 26, 26, 25, 25, 31, 32, 32, 32,
354 /* 650 */ 32, 32, 32, 32, 27, 27, 27, 26, 26, 26,
355 /* 660 */ 25, 25, 32, 32, 32, 32, 32, 32, 32, 27,
356 /* 670 */ 27, 27, 26, 26, 26, 25, 25, 167, 245, 223,
357 /* 680 */ 45, 223, 220, 184, 220, 174, 184, 140, 140, 234,
358 /* 690 */ 141, 48, 144, 220, 61, 220, 132, 28, 122, 220,
359 /* 700 */ 259, 15, 46, 132, 249, 262, 263, 231, 167, 223,
360 /* 710 */ 220, 94, 230, 263, 231, 227, 227, 233, 155, 184,
361 /* 720 */ 203, 200, 54, 230, 220, 51, 220, 226, 219, 184,
362 /* 730 */ 154, 208, 207, 205, 206, 211, 217, 218, 216, 147,
363 /* 740 */ 167, 220, 240, 4, 96, 184, 261, 261, 233, 155,
364 /* 750 */ 132, 24, 213, 184, 230, 184, 220, 62, 220, 219,
365 /* 760 */ 263, 231, 203, 200, 54, 184, 264, 184, 184, 184,
366 /* 770 */ 184, 167, 184, 220, 254, 184, 184, 184, 227, 227,
367 /* 780 */ 233, 155, 184, 99, 138, 42, 230, 220, 228, 220,
368 /* 790 */ 184, 219, 184, 222, 167, 231, 46, 112, 140, 140,
369 /* 800 */ 184, 141, 48, 167, 220, 174, 190, 184, 184, 227,
370 /* 810 */ 227, 233, 155, 184, 184, 98, 132, 230, 116, 220,
371 /* 820 */ 259, 220, 219, 105, 249, 262, 263, 231, 46, 140,
372 /* 830 */ 140, 184, 141, 48, 184, 167, 220, 184, 184, 184,
373 /* 840 */ 184, 227, 227, 233, 155, 219, 184, 101, 184, 230,
374 /* 850 */ 174, 220, 184, 220, 219, 140, 140, 184, 141, 48,
375 /* 860 */ 221, 132, 221, 117, 167, 259, 184, 167, 220, 249,
376 /* 870 */ 262, 263, 231, 227, 227, 233, 155, 254, 184, 103,
377 /* 880 */ 220, 230, 220, 220, 184, 220, 219, 138, 43, 184,
378 /* 890 */ 221, 228, 184, 167, 63, 184, 222, 220, 231, 220,
379 /* 900 */ 220, 220, 184, 184, 184, 227, 227, 233, 155, 220,
380 /* 910 */ 230, 220, 184, 230, 235, 219, 220, 184, 219, 167,
381 /* 920 */ 184, 140, 140, 184, 141, 48, 220, 134, 184, 230,
382 /* 930 */ 184, 227, 227, 233, 155, 220, 176, 220, 231, 230,
383 /* 940 */ 184, 184, 184, 184, 219, 184, 140, 140, 184, 141,
384 /* 950 */ 48, 184, 220, 184, 184, 137, 174, 261, 261, 233,
385 /* 960 */ 155, 184, 192, 184, 198, 230, 231, 132, 13, 260,
386 /* 970 */ 219, 259, 254, 184, 184, 249, 262, 263, 231, 174,
387 /* 980 */ 184, 184, 138, 44, 22, 142, 228, 203, 200, 54,
388 /* 990 */ 132, 222, 121, 231, 259, 184, 132, 174, 249, 262,
389 /* 1000 */ 263, 231, 9, 203, 200, 54, 263, 231, 132, 184,
390 /* 1010 */ 118, 184, 259, 184, 184, 174, 249, 262, 263, 231,
391 /* 1020 */ 184, 203, 200, 54, 38, 184, 132, 174, 145, 184,
392 /* 1030 */ 259, 184, 184, 184, 249, 262, 263, 231, 132, 184,
393 /* 1040 */ 120, 174, 259, 184, 184, 184, 249, 262, 263, 231,
394 /* 1050 */ 184, 68, 132, 184, 119, 184, 259, 184, 184, 184,
395 /* 1060 */ 249, 262, 263, 231, 184, 174, 33, 184, 184, 184,
396 /* 1070 */ 140, 140, 184, 141, 48, 184, 132, 184, 136, 174,
397 /* 1080 */ 259, 184, 184, 184, 249, 262, 263, 231, 140, 140,
398 /* 1090 */ 132, 141, 48, 146, 259, 184, 184, 174, 163, 262,
399 /* 1100 */ 263, 231, 52, 184, 132, 60, 184, 184, 132, 174,
400 /* 1110 */ 184, 184, 259, 184, 263, 231, 35, 262, 263, 231,
401 /* 1120 */ 132, 184, 184, 174, 259, 114, 184, 184, 186, 262,
402 /* 1130 */ 263, 231, 140, 140, 132, 141, 48, 184, 259, 184,
403 /* 1140 */ 184, 184, 34, 262, 263, 231, 214, 184, 140, 140,
404 /* 1150 */ 184, 141, 48, 184, 184, 184, 159, 140, 140, 184,
405 /* 1160 */ 141, 48, 184, 184, 184, 184, 138, 184, 184, 184,
406 /* 1170 */ 228, 184, 184, 166, 256, 222, 184, 231, 140, 140,
407 /* 1180 */ 184, 141, 48, 138, 138, 184, 21, 228, 228, 258,
408 /* 1190 */ 255, 184, 222, 222, 231, 231, 184, 184, 184, 138,
409 /* 1200 */ 138, 184, 150, 228, 228, 203, 200, 54, 222, 222,
410 /* 1210 */ 231, 231, 138, 3, 184, 137, 228, 184, 20, 184,
411 /* 1220 */ 184, 222, 157, 231, 198, 23, 231, 184, 184, 184,
412 /* 1230 */ 184, 184, 203, 200, 54, 18, 184, 203, 200, 54,
413 /* 1240 */ 11, 184, 184, 184, 203, 200, 54, 1, 140, 140,
414 /* 1250 */ 184, 141, 48, 2, 203, 200, 54, 17, 184, 203,
415 /* 1260 */ 200, 54, 10, 184, 184, 184, 203, 200, 54, 14,
416 /* 1270 */ 184, 184, 203, 200, 54, 5, 203, 200, 54, 16,
417 /* 1280 */ 184, 203, 200, 54, 6, 184, 184, 184, 203, 200,
418 /* 1290 */ 54, 19, 184, 184, 203, 200, 54, 7, 203, 200,
419 /* 1300 */ 54, 12, 184, 203, 200, 54, 8, 184, 184, 184,
420 /* 1310 */ 203, 200, 54, 184, 184, 184, 203, 200, 54, 184,
421 /* 1320 */ 203, 200, 54, 184, 184, 203, 200, 54,
423 static public $yy_lookahead = array(
424 /* 0 */ 24, 18, 26, 27, 28, 29, 23, 31, 32, 33,
425 /* 10 */ 34, 25, 36, 37, 53, 54, 25, 41, 42, 43,
426 /* 20 */ 44, 45, 46, 47, 48, 24, 18, 26, 27, 28,
427 /* 30 */ 29, 25, 31, 32, 33, 34, 18, 36, 37, 18,
428 /* 40 */ 19, 40, 41, 25, 43, 44, 45, 46, 47, 48,
429 /* 50 */ 24, 53, 26, 27, 28, 29, 25, 31, 32, 33,
430 /* 60 */ 34, 25, 36, 37, 25, 81, 25, 41, 42, 43,
431 /* 70 */ 44, 45, 46, 47, 48, 24, 92, 26, 27, 28,
432 /* 80 */ 29, 25, 31, 32, 33, 34, 25, 36, 37, 25,
433 /* 90 */ 81, 25, 41, 42, 43, 44, 45, 46, 47, 48,
434 /* 100 */ 24, 92, 26, 27, 28, 29, 25, 31, 32, 33,
435 /* 110 */ 34, 25, 36, 37, 25, 81, 25, 41, 42, 43,
436 /* 120 */ 44, 45, 46, 47, 48, 24, 92, 26, 27, 28,
437 /* 130 */ 29, 25, 31, 32, 33, 34, 25, 36, 37, 25,
438 /* 140 */ 81, 25, 41, 42, 43, 44, 45, 46, 47, 48,
439 /* 150 */ 24, 92, 26, 27, 28, 29, 25, 31, 32, 33,
440 /* 160 */ 34, 18, 36, 37, 25, 81, 25, 41, 25, 43,
441 /* 170 */ 44, 45, 46, 47, 48, 24, 92, 26, 27, 28,
442 /* 180 */ 29, 25, 31, 32, 33, 34, 18, 36, 37, 25,
443 /* 190 */ 81, 25, 41, 25, 43, 44, 45, 46, 47, 48,
444 /* 200 */ 24, 92, 26, 27, 28, 29, 25, 31, 32, 33,
445 /* 210 */ 34, 25, 36, 37, 25, 81, 25, 41, 25, 43,
446 /* 220 */ 44, 45, 46, 47, 48, 24, 92, 26, 27, 28,
447 /* 230 */ 29, 25, 31, 32, 33, 34, 25, 36, 37, 25,
448 /* 240 */ 81, 64, 41, 63, 43, 44, 45, 46, 47, 48,
449 /* 250 */ 24, 92, 26, 27, 28, 29, 62, 31, 32, 33,
450 /* 260 */ 34, 25, 36, 37, 25, 81, 68, 41, 55, 43,
451 /* 270 */ 44, 45, 46, 47, 48, 24, 92, 26, 27, 28,
452 /* 280 */ 29, 85, 31, 32, 33, 34, 67, 36, 37, 67,
453 /* 290 */ 81, 67, 41, 90, 43, 44, 45, 46, 47, 48,
454 /* 300 */ 24, 92, 26, 27, 28, 29, 93, 31, 32, 33,
455 /* 310 */ 34, 67, 36, 37, 67, 81, 67, 41, 93, 43,
456 /* 320 */ 44, 45, 46, 47, 48, 24, 92, 26, 27, 28,
457 /* 330 */ 29, 67, 31, 32, 33, 34, 67, 36, 37, 66,
458 /* 340 */ 67, 67, 41, 93, 43, 44, 45, 46, 47, 48,
459 /* 350 */ 24, 67, 26, 27, 28, 29, 67, 31, 32, 33,
460 /* 360 */ 34, 67, 36, 37, 67, 67, 67, 41, 93, 43,
461 /* 370 */ 44, 45, 46, 47, 48, 24, 67, 26, 27, 28,
462 /* 380 */ 29, 67, 31, 32, 33, 34, 93, 36, 37, 67,
463 /* 390 */ 67, 67, 41, 93, 43, 44, 45, 46, 47, 48,
464 /* 400 */ 24, 67, 26, 27, 28, 29, 67, 31, 32, 33,
465 /* 410 */ 34, 93, 36, 37, 93, 93, 93, 41, 93, 43,
466 /* 420 */ 44, 45, 46, 47, 48, 24, 93, 26, 27, 28,
467 /* 430 */ 29, 93, 31, 32, 33, 34, 93, 36, 37, 93,
468 /* 440 */ 93, 93, 41, 93, 43, 44, 45, 46, 47, 48,
469 /* 450 */ 24, 93, 26, 27, 28, 29, 93, 31, 32, 33,
470 /* 460 */ 34, 93, 36, 37, 93, 93, 93, 41, 93, 43,
471 /* 470 */ 44, 45, 46, 47, 48, 24, 93, 26, 27, 28,
472 /* 480 */ 29, 93, 31, 32, 33, 34, 93, 36, 37, 93,
473 /* 490 */ 93, 93, 41, 18, 43, 44, 45, 46, 47, 48,
474 /* 500 */ 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
475 /* 510 */ 13, 14, 15, 16, 17, 18, 19, 15, 16, 17,
476 /* 520 */ 18, 19, 25, 24, 49, 26, 27, 28, 29, 93,
477 /* 530 */ 31, 32, 33, 34, 93, 36, 37, 93, 93, 93,
478 /* 540 */ 41, 93, 43, 44, 45, 46, 47, 48, 24, 93,
479 /* 550 */ 26, 27, 28, 29, 93, 31, 32, 33, 34, 93,
480 /* 560 */ 36, 37, 93, 93, 93, 41, 93, 43, 44, 45,
481 /* 570 */ 46, 47, 48, 3, 4, 5, 6, 7, 8, 9,
482 /* 580 */ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
483 /* 590 */ 24, 93, 26, 27, 81, 29, 93, 31, 32, 33,
484 /* 600 */ 34, 93, 36, 37, 91, 92, 70, 41, 50, 43,
485 /* 610 */ 44, 45, 46, 47, 48, 57, 58, 81, 60, 61,
486 /* 620 */ 93, 63, 93, 87, 88, 55, 90, 91, 92, 3,
487 /* 630 */ 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
488 /* 640 */ 14, 15, 16, 17, 18, 19, 4, 5, 6, 7,
489 /* 650 */ 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
490 /* 660 */ 18, 19, 5, 6, 7, 8, 9, 10, 11, 12,
491 /* 670 */ 13, 14, 15, 16, 17, 18, 19, 13, 25, 29,
492 /* 680 */ 50, 31, 29, 93, 31, 70, 93, 57, 58, 25,
493 /* 690 */ 60, 61, 70, 29, 30, 31, 81, 2, 83, 46,
494 /* 700 */ 85, 1, 38, 81, 89, 90, 91, 92, 13, 59,
495 /* 710 */ 46, 25, 59, 91, 92, 51, 52, 53, 54, 93,
496 /* 720 */ 20, 21, 22, 59, 29, 39, 31, 69, 64, 93,
497 /* 730 */ 72, 73, 74, 75, 76, 77, 78, 79, 80, 70,
498 /* 740 */ 13, 46, 84, 1, 86, 93, 51, 52, 53, 54,
499 /* 750 */ 81, 56, 25, 93, 59, 93, 29, 30, 31, 64,
500 /* 760 */ 91, 92, 20, 21, 22, 93, 25, 93, 93, 93,
501 /* 770 */ 93, 13, 93, 46, 71, 93, 93, 93, 51, 52,
502 /* 780 */ 53, 54, 93, 25, 81, 82, 59, 29, 85, 31,
503 /* 790 */ 93, 64, 93, 90, 13, 92, 38, 25, 57, 58,
504 /* 800 */ 93, 60, 61, 13, 46, 70, 25, 93, 93, 51,
505 /* 810 */ 52, 53, 54, 93, 93, 25, 81, 59, 83, 29,
506 /* 820 */ 85, 31, 64, 25, 89, 90, 91, 92, 38, 57,
507 /* 830 */ 58, 93, 60, 61, 93, 13, 46, 93, 93, 93,
508 /* 840 */ 93, 51, 52, 53, 54, 64, 93, 25, 93, 59,
509 /* 850 */ 70, 29, 93, 31, 64, 57, 58, 93, 60, 61,
510 /* 860 */ 29, 81, 31, 83, 13, 85, 93, 13, 46, 89,
511 /* 870 */ 90, 91, 92, 51, 52, 53, 54, 71, 93, 25,
512 /* 880 */ 29, 59, 31, 29, 93, 31, 64, 81, 82, 93,
513 /* 890 */ 59, 85, 93, 13, 30, 93, 90, 46, 92, 29,
514 /* 900 */ 46, 31, 93, 93, 93, 51, 52, 53, 54, 29,
515 /* 910 */ 59, 31, 93, 59, 25, 64, 46, 93, 64, 13,
516 /* 920 */ 93, 57, 58, 93, 60, 61, 46, 81, 93, 59,
517 /* 930 */ 93, 51, 52, 53, 54, 29, 90, 31, 92, 59,
518 /* 940 */ 93, 93, 93, 93, 64, 93, 57, 58, 93, 60,
519 /* 950 */ 61, 93, 46, 93, 93, 81, 70, 51, 52, 53,
520 /* 960 */ 54, 93, 88, 93, 90, 59, 92, 81, 1, 83,
521 /* 970 */ 64, 85, 71, 93, 93, 89, 90, 91, 92, 70,
522 /* 980 */ 93, 93, 81, 82, 1, 70, 85, 20, 21, 22,
523 /* 990 */ 81, 90, 83, 92, 85, 93, 81, 70, 89, 90,
524 /* 1000 */ 91, 92, 1, 20, 21, 22, 91, 92, 81, 93,
525 /* 1010 */ 83, 93, 85, 93, 93, 70, 89, 90, 91, 92,
526 /* 1020 */ 93, 20, 21, 22, 11, 93, 81, 70, 83, 93,
527 /* 1030 */ 85, 93, 93, 93, 89, 90, 91, 92, 81, 93,
528 /* 1040 */ 83, 70, 85, 93, 93, 93, 89, 90, 91, 92,
529 /* 1050 */ 93, 38, 81, 93, 83, 93, 85, 93, 93, 93,
530 /* 1060 */ 89, 90, 91, 92, 93, 70, 35, 93, 93, 93,
531 /* 1070 */ 57, 58, 93, 60, 61, 93, 81, 93, 83, 70,
532 /* 1080 */ 85, 93, 93, 93, 89, 90, 91, 92, 57, 58,
533 /* 1090 */ 81, 60, 61, 70, 85, 93, 93, 70, 89, 90,
534 /* 1100 */ 91, 92, 11, 93, 81, 30, 93, 93, 81, 70,
535 /* 1110 */ 93, 93, 85, 93, 91, 92, 89, 90, 91, 92,
536 /* 1120 */ 81, 93, 93, 70, 85, 25, 93, 93, 89, 90,
537 /* 1130 */ 91, 92, 57, 58, 81, 60, 61, 93, 85, 93,
538 /* 1140 */ 93, 93, 89, 90, 91, 92, 25, 93, 57, 58,
539 /* 1150 */ 93, 60, 61, 93, 93, 93, 71, 57, 58, 93,
540 /* 1160 */ 60, 61, 93, 93, 93, 93, 81, 93, 93, 93,
541 /* 1170 */ 85, 93, 93, 71, 71, 90, 93, 92, 57, 58,
542 /* 1180 */ 93, 60, 61, 81, 81, 93, 1, 85, 85, 71,
543 /* 1190 */ 71, 93, 90, 90, 92, 92, 93, 93, 93, 81,
544 /* 1200 */ 81, 93, 71, 85, 85, 20, 21, 22, 90, 90,
545 /* 1210 */ 92, 92, 81, 1, 93, 81, 85, 93, 1, 93,
546 /* 1220 */ 93, 90, 88, 92, 90, 1, 92, 93, 93, 93,
547 /* 1230 */ 93, 93, 20, 21, 22, 1, 93, 20, 21, 22,
548 /* 1240 */ 1, 93, 93, 93, 20, 21, 22, 1, 57, 58,
549 /* 1250 */ 93, 60, 61, 1, 20, 21, 22, 1, 93, 20,
550 /* 1260 */ 21, 22, 1, 93, 93, 93, 20, 21, 22, 1,
551 /* 1270 */ 93, 93, 20, 21, 22, 1, 20, 21, 22, 1,
552 /* 1280 */ 93, 20, 21, 22, 1, 93, 93, 93, 20, 21,
553 /* 1290 */ 22, 1, 93, 93, 20, 21, 22, 1, 20, 21,
554 /* 1300 */ 22, 1, 93, 20, 21, 22, 1, 93, 93, 93,
555 /* 1310 */ 20, 21, 22, 93, 93, 93, 20, 21, 22, 93,
556 /* 1320 */ 20, 21, 22, 93, 93, 20, 21, 22,
558 const YY_SHIFT_USE_DFLT
= -40;
559 const YY_SHIFT_MAX
= 189;
560 static public $yy_shift_ofst = array(
561 /* 0 */ -40, 101, 51, -24, 76, 1, 26, 451, 499, 524,
562 /* 10 */ 351, 426, 201, 226, 176, 151, 126, 276, 376, 326,
563 /* 20 */ 401, 301, 251, 566, 695, 695, 695, 695, 695, 695,
564 /* 30 */ 695, 695, 695, 695, 906, 906, 906, 906, 851, 727,
565 /* 40 */ 822, 854, 664, 758, 790, 880, 880, 880, 880, 880,
566 /* 50 */ 851, 851, 870, 870, 870, 870, 851, 870, 653, 870,
567 /* 60 */ 870, 870, 870, 870, 870, 870, 870, 870, 870, 1296,
568 /* 70 */ 1283, 1278, 1274, 1290, 1305, 1300, 967, 1234, 1224, 1239,
569 /* 80 */ 1246, 1256, 1217, 1212, 742, 700, 983, 1252, 1185, 1001,
570 /* 90 */ 1261, 1268, 781, -39, -40, -40, -40, -40, -40, -40,
571 /* 100 */ -40, -40, -40, -40, -40, -40, -40, -40, -40, -40,
572 /* 110 */ -40, -40, -40, -40, -40, -40, 570, 497, 626, 626,
573 /* 120 */ 642, 657, 657, 558, 1013, 1100, 798, 1031, 889, 1075,
574 /* 130 */ 1121, 1091, 630, 864, 772, 741, 502, 1191, 1191, 1191,
575 /* 140 */ 650, 831, -17, 168, 143, 21, 475, 18, 686, 6,
576 /* 150 */ -9, -14, 31, 239, 189, -2, 186, 181, 156, 36,
577 /* 160 */ 166, 213, 191, 193, 180, 236, 194, 177, 206, 211,
578 /* 170 */ 214, 139, 64, 61, 8, 41, 56, 86, 116, 114,
579 /* 180 */ 111, 91, 106, 164, 89, 131, 81, 39, 66, 141,
581 const YY_REDUCE_USE_DFLT
= -17;
582 const YY_REDUCE_MAX
= 115;
583 static public $yy_reduce_ofst = array(
584 /* 0 */ 273, 658, 658, 658, 658, 658, 658, 658, 658, 658,
585 /* 10 */ 658, 658, 658, 658, 658, 658, 658, 658, 658, 658,
586 /* 20 */ 658, 658, 658, 658, 735, 886, 945, 995, 927, 780,
587 /* 30 */ 957, 909, 615, 971, 1039, 1009, 1027, 1053, 536, 703,
588 /* 40 */ 901, 806, 1119, 1119, 1119, 1118, 1103, 1085, 1102, 1131,
589 /* 50 */ 874, 1134, 669, 622, 915, 1023, 846, 513, 109, 84,
590 /* 60 */ 59, 9, 159, 134, 209, -16, 234, 34, 184, 198,
591 /* 70 */ 198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
592 /* 80 */ 198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
593 /* 90 */ 198, 198, 203, 196, 322, 298, 323, 334, 297, 224,
594 /* 100 */ 249, 269, 274, 264, 289, 284, 222, 219, 247, 244,
595 /* 110 */ 294, 339, 299, 309, 314, 324,
597 static public $yyExpectedTokens = array(
599 /* 1 */ array(24, 26, 27, 28, 29, 31, 32, 33, 34, 36, 37, 41, 42, 43, 44, 45, 46, 47, 48, ),
600 /* 2 */ array(24, 26, 27, 28, 29, 31, 32, 33, 34, 36, 37, 41, 42, 43, 44, 45, 46, 47, 48, ),
601 /* 3 */ array(24, 26, 27, 28, 29, 31, 32, 33, 34, 36, 37, 41, 42, 43, 44, 45, 46, 47, 48, ),
602 /* 4 */ array(24, 26, 27, 28, 29, 31, 32, 33, 34, 36, 37, 41, 42, 43, 44, 45, 46, 47, 48, ),
603 /* 5 */ array(24, 26, 27, 28, 29, 31, 32, 33, 34, 36, 37, 40, 41, 43, 44, 45, 46, 47, 48, ),
604 /* 6 */ array(24, 26, 27, 28, 29, 31, 32, 33, 34, 36, 37, 41, 42, 43, 44, 45, 46, 47, 48, ),
605 /* 7 */ array(24, 26, 27, 28, 29, 31, 32, 33, 34, 36, 37, 41, 43, 44, 45, 46, 47, 48, ),
606 /* 8 */ array(24, 26, 27, 28, 29, 31, 32, 33, 34, 36, 37, 41, 43, 44, 45, 46, 47, 48, ),
607 /* 9 */ array(24, 26, 27, 28, 29, 31, 32, 33, 34, 36, 37, 41, 43, 44, 45, 46, 47, 48, ),
608 /* 10 */ array(24, 26, 27, 28, 29, 31, 32, 33, 34, 36, 37, 41, 43, 44, 45, 46, 47, 48, ),
609 /* 11 */ array(24, 26, 27, 28, 29, 31, 32, 33, 34, 36, 37, 41, 43, 44, 45, 46, 47, 48, ),
610 /* 12 */ array(24, 26, 27, 28, 29, 31, 32, 33, 34, 36, 37, 41, 43, 44, 45, 46, 47, 48, ),
611 /* 13 */ array(24, 26, 27, 28, 29, 31, 32, 33, 34, 36, 37, 41, 43, 44, 45, 46, 47, 48, ),
612 /* 14 */ array(24, 26, 27, 28, 29, 31, 32, 33, 34, 36, 37, 41, 43, 44, 45, 46, 47, 48, ),
613 /* 15 */ array(24, 26, 27, 28, 29, 31, 32, 33, 34, 36, 37, 41, 43, 44, 45, 46, 47, 48, ),
614 /* 16 */ array(24, 26, 27, 28, 29, 31, 32, 33, 34, 36, 37, 41, 43, 44, 45, 46, 47, 48, ),
615 /* 17 */ array(24, 26, 27, 28, 29, 31, 32, 33, 34, 36, 37, 41, 43, 44, 45, 46, 47, 48, ),
616 /* 18 */ array(24, 26, 27, 28, 29, 31, 32, 33, 34, 36, 37, 41, 43, 44, 45, 46, 47, 48, ),
617 /* 19 */ array(24, 26, 27, 28, 29, 31, 32, 33, 34, 36, 37, 41, 43, 44, 45, 46, 47, 48, ),
618 /* 20 */ array(24, 26, 27, 28, 29, 31, 32, 33, 34, 36, 37, 41, 43, 44, 45, 46, 47, 48, ),
619 /* 21 */ array(24, 26, 27, 28, 29, 31, 32, 33, 34, 36, 37, 41, 43, 44, 45, 46, 47, 48, ),
620 /* 22 */ array(24, 26, 27, 28, 29, 31, 32, 33, 34, 36, 37, 41, 43, 44, 45, 46, 47, 48, ),
621 /* 23 */ array(24, 26, 27, 29, 31, 32, 33, 34, 36, 37, 41, 43, 44, 45, 46, 47, 48, ),
622 /* 24 */ array(2, 13, 29, 31, 46, 51, 52, 53, 54, 56, 59, 64, ),
623 /* 25 */ array(2, 13, 29, 31, 46, 51, 52, 53, 54, 56, 59, 64, ),
624 /* 26 */ array(2, 13, 29, 31, 46, 51, 52, 53, 54, 56, 59, 64, ),
625 /* 27 */ array(2, 13, 29, 31, 46, 51, 52, 53, 54, 56, 59, 64, ),
626 /* 28 */ array(2, 13, 29, 31, 46, 51, 52, 53, 54, 56, 59, 64, ),
627 /* 29 */ array(2, 13, 29, 31, 46, 51, 52, 53, 54, 56, 59, 64, ),
628 /* 30 */ array(2, 13, 29, 31, 46, 51, 52, 53, 54, 56, 59, 64, ),
629 /* 31 */ array(2, 13, 29, 31, 46, 51, 52, 53, 54, 56, 59, 64, ),
630 /* 32 */ array(2, 13, 29, 31, 46, 51, 52, 53, 54, 56, 59, 64, ),
631 /* 33 */ array(2, 13, 29, 31, 46, 51, 52, 53, 54, 56, 59, 64, ),
632 /* 34 */ array(13, 29, 31, 46, 51, 52, 53, 54, 59, 64, ),
633 /* 35 */ array(13, 29, 31, 46, 51, 52, 53, 54, 59, 64, ),
634 /* 36 */ array(13, 29, 31, 46, 51, 52, 53, 54, 59, 64, ),
635 /* 37 */ array(13, 29, 31, 46, 51, 52, 53, 54, 59, 64, ),
636 /* 38 */ array(13, 29, 31, 46, 59, 64, ),
637 /* 39 */ array(13, 25, 29, 30, 31, 46, 51, 52, 53, 54, 59, 64, ),
638 /* 40 */ array(13, 25, 29, 31, 46, 51, 52, 53, 54, 59, 64, ),
639 /* 41 */ array(13, 25, 29, 31, 46, 51, 52, 53, 54, 59, 64, ),
640 /* 42 */ array(13, 25, 29, 30, 31, 38, 46, 51, 52, 53, 54, 59, 64, ),
641 /* 43 */ array(13, 25, 29, 31, 38, 46, 51, 52, 53, 54, 59, 64, ),
642 /* 44 */ array(13, 25, 29, 31, 38, 46, 51, 52, 53, 54, 59, 64, ),
643 /* 45 */ array(13, 29, 31, 46, 51, 52, 53, 54, 59, 64, ),
644 /* 46 */ array(13, 29, 31, 46, 51, 52, 53, 54, 59, 64, ),
645 /* 47 */ array(13, 29, 31, 46, 51, 52, 53, 54, 59, 64, ),
646 /* 48 */ array(13, 29, 31, 46, 51, 52, 53, 54, 59, 64, ),
647 /* 49 */ array(13, 29, 31, 46, 51, 52, 53, 54, 59, 64, ),
648 /* 50 */ array(13, 29, 31, 46, 59, 64, ),
649 /* 51 */ array(13, 29, 31, 46, 59, 64, ),
650 /* 52 */ array(29, 31, 46, 59, ),
651 /* 53 */ array(29, 31, 46, 59, ),
652 /* 54 */ array(29, 31, 46, 59, ),
653 /* 55 */ array(29, 31, 46, 59, ),
654 /* 56 */ array(13, 29, 31, 46, 59, 64, ),
655 /* 57 */ array(29, 31, 46, 59, ),
656 /* 58 */ array(25, 29, 31, 46, 59, ),
657 /* 59 */ array(29, 31, 46, 59, ),
658 /* 60 */ array(29, 31, 46, 59, ),
659 /* 61 */ array(29, 31, 46, 59, ),
660 /* 62 */ array(29, 31, 46, 59, ),
661 /* 63 */ array(29, 31, 46, 59, ),
662 /* 64 */ array(29, 31, 46, 59, ),
663 /* 65 */ array(29, 31, 46, 59, ),
664 /* 66 */ array(29, 31, 46, 59, ),
665 /* 67 */ array(29, 31, 46, 59, ),
666 /* 68 */ array(29, 31, 46, 59, ),
667 /* 69 */ array(1, 20, 21, 22, ),
668 /* 70 */ array(1, 20, 21, 22, ),
669 /* 71 */ array(1, 20, 21, 22, ),
670 /* 72 */ array(1, 20, 21, 22, ),
671 /* 73 */ array(1, 20, 21, 22, ),
672 /* 74 */ array(1, 20, 21, 22, ),
673 /* 75 */ array(1, 20, 21, 22, ),
674 /* 76 */ array(1, 20, 21, 22, ),
675 /* 77 */ array(1, 20, 21, 22, ),
676 /* 78 */ array(1, 20, 21, 22, ),
677 /* 79 */ array(1, 20, 21, 22, ),
678 /* 80 */ array(1, 20, 21, 22, ),
679 /* 81 */ array(1, 20, 21, 22, ),
680 /* 82 */ array(1, 20, 21, 22, ),
681 /* 83 */ array(1, 20, 21, 22, ),
682 /* 84 */ array(1, 20, 21, 22, ),
683 /* 85 */ array(1, 20, 21, 22, ),
684 /* 86 */ array(1, 20, 21, 22, ),
685 /* 87 */ array(1, 20, 21, 22, ),
686 /* 88 */ array(1, 20, 21, 22, ),
687 /* 89 */ array(1, 20, 21, 22, ),
688 /* 90 */ array(1, 20, 21, 22, ),
689 /* 91 */ array(1, 20, 21, 22, ),
690 /* 92 */ array(13, 25, 64, ),
691 /* 93 */ array(53, 54, ),
714 /* 116 */ array(3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 55, ),
715 /* 117 */ array(3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 25, ),
716 /* 118 */ array(3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, ),
717 /* 119 */ array(3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, ),
718 /* 120 */ array(4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, ),
719 /* 121 */ array(5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, ),
720 /* 122 */ array(5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, ),
721 /* 123 */ array(50, 57, 58, 60, 61, 63, ),
722 /* 124 */ array(11, 38, 57, 58, 60, 61, ),
723 /* 125 */ array(25, 57, 58, 60, 61, ),
724 /* 126 */ array(25, 57, 58, 60, 61, ),
725 /* 127 */ array(35, 57, 58, 60, 61, ),
726 /* 128 */ array(25, 57, 58, 60, 61, ),
727 /* 129 */ array(30, 57, 58, 60, 61, ),
728 /* 130 */ array(25, 57, 58, 60, 61, ),
729 /* 131 */ array(11, 57, 58, 60, 61, ),
730 /* 132 */ array(50, 57, 58, 60, 61, ),
731 /* 133 */ array(30, 57, 58, 60, 61, ),
732 /* 134 */ array(25, 57, 58, 60, 61, ),
733 /* 135 */ array(25, 57, 58, 60, 61, ),
734 /* 136 */ array(15, 16, 17, 18, 19, ),
735 /* 137 */ array(57, 58, 60, 61, ),
736 /* 138 */ array(57, 58, 60, 61, ),
737 /* 139 */ array(57, 58, 60, 61, ),
738 /* 140 */ array(29, 31, 59, ),
739 /* 141 */ array(29, 31, 59, ),
740 /* 142 */ array(18, 23, ),
741 /* 143 */ array(18, 25, ),
742 /* 144 */ array(18, 25, ),
743 /* 145 */ array(18, 19, ),
744 /* 146 */ array(18, 49, ),
745 /* 147 */ array(18, 25, ),
746 /* 148 */ array(25, 39, ),
747 /* 149 */ array(25, ),
748 /* 150 */ array(25, ),
749 /* 151 */ array(25, ),
750 /* 152 */ array(25, ),
751 /* 153 */ array(25, ),
752 /* 154 */ array(25, ),
753 /* 155 */ array(53, ),
754 /* 156 */ array(25, ),
755 /* 157 */ array(25, ),
756 /* 158 */ array(25, ),
757 /* 159 */ array(25, ),
758 /* 160 */ array(25, ),
759 /* 161 */ array(55, ),
760 /* 162 */ array(25, ),
761 /* 163 */ array(25, ),
762 /* 164 */ array(63, ),
763 /* 165 */ array(25, ),
764 /* 166 */ array(62, ),
765 /* 167 */ array(64, ),
766 /* 168 */ array(25, ),
767 /* 169 */ array(25, ),
768 /* 170 */ array(25, ),
769 /* 171 */ array(25, ),
770 /* 172 */ array(25, ),
771 /* 173 */ array(25, ),
772 /* 174 */ array(18, ),
773 /* 175 */ array(25, ),
774 /* 176 */ array(25, ),
775 /* 177 */ array(25, ),
776 /* 178 */ array(25, ),
777 /* 179 */ array(25, ),
778 /* 180 */ array(25, ),
779 /* 181 */ array(25, ),
780 /* 182 */ array(25, ),
781 /* 183 */ array(25, ),
782 /* 184 */ array(25, ),
783 /* 185 */ array(25, ),
784 /* 186 */ array(25, ),
785 /* 187 */ array(25, ),
786 /* 188 */ array(25, ),
787 /* 189 */ array(25, ),
864 static public $yy_default = array(
865 /* 0 */ 267, 354, 354, 354, 354, 354, 354, 354, 354, 354,
866 /* 10 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354,
867 /* 20 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354,
868 /* 30 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354,
869 /* 40 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354,
870 /* 50 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354,
871 /* 60 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354,
872 /* 70 */ 354, 354, 354, 354, 354, 354, 354, 354, 265, 354,
873 /* 80 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354,
874 /* 90 */ 354, 354, 354, 354, 267, 267, 267, 267, 267, 267,
875 /* 100 */ 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
876 /* 110 */ 267, 267, 267, 267, 267, 267, 354, 354, 334, 292,
877 /* 120 */ 335, 336, 338, 320, 354, 354, 354, 354, 354, 354,
878 /* 130 */ 354, 354, 320, 354, 354, 354, 337, 351, 324, 316,
879 /* 140 */ 354, 354, 354, 354, 354, 339, 354, 354, 354, 354,
880 /* 150 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354,
881 /* 160 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354,
882 /* 170 */ 354, 354, 354, 354, 328, 354, 354, 354, 354, 354,
883 /* 180 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354,
884 /* 190 */ 313, 304, 349, 289, 271, 299, 314, 315, 350, 298,
885 /* 200 */ 270, 306, 296, 269, 297, 276, 277, 275, 274, 353,
886 /* 210 */ 273, 278, 279, 284, 285, 283, 282, 280, 281, 352,
887 /* 220 */ 348, 345, 325, 344, 272, 266, 268, 326, 327, 346,
888 /* 230 */ 347, 343, 333, 332, 286, 287, 301, 302, 300, 295,
889 /* 240 */ 293, 294, 303, 305, 310, 311, 309, 308, 307, 342,
890 /* 250 */ 341, 290, 291, 288, 323, 321, 322, 317, 319, 331,
891 /* 260 */ 340, 330, 329, 318, 312,
893 /* The next thing included is series of defines which control
894 ** various aspects of the generated parser.
895 ** self::YYNOCODE is a number which corresponds
896 ** to no legal terminal or nonterminal number. This
897 ** number is used to fill in empty slots of the hash
899 ** self::YYFALLBACK If defined, this indicates that one or more tokens
900 ** have fall-back values which should be used if the
901 ** original value of the token will not parse.
902 ** self::YYSTACKDEPTH is the maximum depth of the parser's stack.
903 ** self::YYNSTATE the combined number of states.
904 ** self::YYNRULE the number of rules in the grammar
905 ** self::YYERRORSYMBOL is the code number of the error symbol. If not
906 ** defined, then do no error processing.
909 const YYSTACKDEPTH
= 100;
910 const YYNSTATE
= 265;
912 const YYERRORSYMBOL
= 65;
913 const YYERRSYMDT
= 'yy0';
914 const YYFALLBACK
= 0;
915 /** The next table maps tokens into fallback tokens. If a construct
916 * like the following:
918 * %fallback ID X Y Z.
920 * appears in the grammer, then ID becomes a fallback token for X, Y,
921 * and Z. Whenever one of the tokens X, Y, or Z is input to the parser
922 * but it does not parse, the type of the token is changed to ID and
923 * the parse is retried before an error is thrown.
925 static public $yyFallback = array(
928 * Turn parser tracing on by giving a stream to which to write the trace
929 * and a prompt to preface each trace message. Tracing is turned off
930 * by making either argument NULL
934 * - A stream resource to which trace output should be written.
935 * If NULL, then tracing is turned off.
936 * - A prefix string written at the beginning of every
937 * line of trace output. If NULL, then tracing is
946 static function Trace($TraceFILE, $zTracePrompt)
950 } elseif (!$zTracePrompt) {
953 self
::$yyTraceFILE = $TraceFILE;
954 self
::$yyTracePrompt = $zTracePrompt;
958 * Output debug information to output (php://output stream)
960 static function PrintTrace()
962 self
::$yyTraceFILE = fopen('php://output', 'w');
963 self
::$yyTracePrompt = '';
969 static public $yyTraceFILE;
971 * String to prepend to debug output
974 static public $yyTracePrompt;
978 public $yyidx; /* Index of top element in stack */
982 public $yyerrcnt; /* Shifts left before out of the error */
986 public $yystack = array(); /* The parser's stack */
989 * For tracing shifts, the names of all terminals and nonterminals
990 * are required. The following table supplies these names
993 static public $yyTokenName = array(
994 '$', 'T_TAG_OPEN', 'T_NOT', 'T_AND',
995 'T_OR', 'T_EQ', 'T_NE', 'T_GT',
996 'T_GE', 'T_LT', 'T_LE', 'T_IN',
997 'T_PLUS', 'T_MINUS', 'T_CONCAT', 'T_TIMES',
998 'T_DIV', 'T_MOD', 'T_PIPE', 'T_BITWISE',
999 'T_HTML', 'T_COMMENT', 'T_PRINT_OPEN', 'T_PRINT_CLOSE',
1000 'T_EXTENDS', 'T_TAG_CLOSE', 'T_INCLUDE', 'T_AUTOESCAPE',
1001 'T_CUSTOM_END', 'T_CUSTOM_TAG', 'T_AS', 'T_CUSTOM_BLOCK',
1002 'T_SPACEFULL', 'T_WITH', 'T_SET', 'T_ASSIGN',
1003 'T_LOAD', 'T_FOR', 'T_COMMA', 'T_STEP',
1004 'T_EMPTY', 'T_IF', 'T_ELSE', 'T_IFCHANGED',
1005 'T_IFEQUAL', 'T_IFNOTEQUAL', 'T_BLOCK', 'T_FILTER',
1006 'T_REGROUP', 'T_BY', 'T_COLON', 'T_TRUE',
1007 'T_FALSE', 'T_STRING', 'T_INTL', 'T_RPARENT',
1008 'T_LPARENT', 'T_OBJ', 'T_DOT', 'T_ALPHA',
1009 'T_CLASS', 'T_BRACKETS_OPEN', 'T_BRACKETS_CLOSE', 'T_DOTDOT',
1010 'T_NUMERIC', 'error', 'start', 'body',
1011 'code', 'stmts', 'filtered_var', 'var_or_string',
1012 'stmt', 'for_stmt', 'ifchanged_stmt', 'block_stmt',
1013 'filter_stmt', 'if_stmt', 'custom_tag', 'alias',
1014 'ifequal', 'varname', 'params', 'expr',
1015 'regroup', 'string', 'for_def', 'range',
1016 'numvar', 'fvar_or_string', 'number', 'varname_args',
1021 * For tracing reduce actions, the names of all rules are required.
1024 static public $yyRuleName = array(
1025 /* 0 */ "start ::= body",
1026 /* 1 */ "body ::= body code",
1028 /* 3 */ "code ::= T_TAG_OPEN stmts",
1029 /* 4 */ "code ::= T_HTML",
1030 /* 5 */ "code ::= T_COMMENT",
1031 /* 6 */ "code ::= T_PRINT_OPEN filtered_var T_PRINT_CLOSE",
1032 /* 7 */ "stmts ::= T_EXTENDS var_or_string T_TAG_CLOSE",
1033 /* 8 */ "stmts ::= stmt T_TAG_CLOSE",
1034 /* 9 */ "stmts ::= for_stmt",
1035 /* 10 */ "stmts ::= ifchanged_stmt",
1036 /* 11 */ "stmts ::= block_stmt",
1037 /* 12 */ "stmts ::= filter_stmt",
1038 /* 13 */ "stmts ::= if_stmt",
1039 /* 14 */ "stmts ::= T_INCLUDE var_or_string T_TAG_CLOSE",
1040 /* 15 */ "stmts ::= custom_tag",
1041 /* 16 */ "stmts ::= alias",
1042 /* 17 */ "stmts ::= ifequal",
1043 /* 18 */ "stmts ::= T_AUTOESCAPE varname T_TAG_CLOSE body T_TAG_OPEN T_CUSTOM_END T_TAG_CLOSE",
1044 /* 19 */ "custom_tag ::= T_CUSTOM_TAG T_TAG_CLOSE",
1045 /* 20 */ "custom_tag ::= T_CUSTOM_TAG T_AS varname T_TAG_CLOSE",
1046 /* 21 */ "custom_tag ::= T_CUSTOM_TAG params T_TAG_CLOSE",
1047 /* 22 */ "custom_tag ::= T_CUSTOM_TAG params T_AS varname T_TAG_CLOSE",
1048 /* 23 */ "custom_tag ::= T_CUSTOM_BLOCK T_TAG_CLOSE body T_TAG_OPEN T_CUSTOM_END T_TAG_CLOSE",
1049 /* 24 */ "custom_tag ::= T_CUSTOM_BLOCK params T_TAG_CLOSE body T_TAG_OPEN T_CUSTOM_END T_TAG_CLOSE",
1050 /* 25 */ "custom_tag ::= T_SPACEFULL T_TAG_CLOSE body T_TAG_OPEN T_CUSTOM_END T_TAG_CLOSE",
1051 /* 26 */ "alias ::= T_WITH varname T_AS varname T_TAG_CLOSE body T_TAG_OPEN T_CUSTOM_END T_TAG_CLOSE",
1052 /* 27 */ "stmt ::= T_SET varname T_ASSIGN expr",
1053 /* 28 */ "stmt ::= regroup",
1054 /* 29 */ "stmt ::= T_LOAD string",
1055 /* 30 */ "for_def ::= T_FOR varname T_IN filtered_var T_TAG_CLOSE",
1056 /* 31 */ "for_def ::= T_FOR varname T_COMMA varname T_IN filtered_var T_TAG_CLOSE",
1057 /* 32 */ "for_stmt ::= for_def body T_TAG_OPEN T_CUSTOM_END T_TAG_CLOSE",
1058 /* 33 */ "for_stmt ::= T_FOR varname T_IN range T_TAG_CLOSE body T_TAG_OPEN T_CUSTOM_END T_TAG_CLOSE",
1059 /* 34 */ "for_stmt ::= T_FOR varname T_IN range T_STEP numvar T_TAG_CLOSE body T_TAG_OPEN T_CUSTOM_END T_TAG_CLOSE",
1060 /* 35 */ "for_stmt ::= for_def body T_TAG_OPEN T_EMPTY T_TAG_CLOSE body T_TAG_OPEN T_CUSTOM_END T_TAG_CLOSE",
1061 /* 36 */ "if_stmt ::= T_IF expr T_TAG_CLOSE body T_TAG_OPEN T_CUSTOM_END T_TAG_CLOSE",
1062 /* 37 */ "if_stmt ::= T_IF expr T_TAG_CLOSE body T_TAG_OPEN T_ELSE T_TAG_CLOSE body T_TAG_OPEN T_CUSTOM_END T_TAG_CLOSE",
1063 /* 38 */ "ifchanged_stmt ::= T_IFCHANGED T_TAG_CLOSE body T_TAG_OPEN T_CUSTOM_END T_TAG_CLOSE",
1064 /* 39 */ "ifchanged_stmt ::= T_IFCHANGED params T_TAG_CLOSE body T_TAG_OPEN T_CUSTOM_END T_TAG_CLOSE",
1065 /* 40 */ "ifchanged_stmt ::= T_IFCHANGED T_TAG_CLOSE body T_TAG_OPEN T_ELSE T_TAG_CLOSE body T_TAG_OPEN T_CUSTOM_END T_TAG_CLOSE",
1066 /* 41 */ "ifchanged_stmt ::= T_IFCHANGED params T_TAG_CLOSE body T_TAG_OPEN T_ELSE T_TAG_CLOSE body T_TAG_OPEN T_CUSTOM_END T_TAG_CLOSE",
1067 /* 42 */ "ifequal ::= T_IFEQUAL fvar_or_string fvar_or_string T_TAG_CLOSE body T_TAG_OPEN T_CUSTOM_END T_TAG_CLOSE",
1068 /* 43 */ "ifequal ::= T_IFEQUAL fvar_or_string fvar_or_string T_TAG_CLOSE body T_TAG_OPEN T_ELSE T_TAG_CLOSE body T_TAG_OPEN T_CUSTOM_END T_TAG_CLOSE",
1069 /* 44 */ "ifequal ::= T_IFNOTEQUAL fvar_or_string fvar_or_string T_TAG_CLOSE body T_TAG_OPEN T_CUSTOM_END T_TAG_CLOSE",
1070 /* 45 */ "ifequal ::= T_IFNOTEQUAL fvar_or_string fvar_or_string T_TAG_CLOSE body T_TAG_OPEN T_ELSE T_TAG_CLOSE body T_TAG_OPEN T_CUSTOM_END T_TAG_CLOSE",
1071 /* 46 */ "block_stmt ::= T_BLOCK varname T_TAG_CLOSE body T_TAG_OPEN T_CUSTOM_END T_TAG_CLOSE",
1072 /* 47 */ "block_stmt ::= T_BLOCK varname T_TAG_CLOSE body T_TAG_OPEN T_CUSTOM_END varname T_TAG_CLOSE",
1073 /* 48 */ "block_stmt ::= T_BLOCK number T_TAG_CLOSE body T_TAG_OPEN T_CUSTOM_END T_TAG_CLOSE",
1074 /* 49 */ "block_stmt ::= T_BLOCK number T_TAG_CLOSE body T_TAG_OPEN T_CUSTOM_END number T_TAG_CLOSE",
1075 /* 50 */ "filter_stmt ::= T_FILTER filtered_var T_TAG_CLOSE body T_TAG_OPEN T_CUSTOM_END T_TAG_CLOSE",
1076 /* 51 */ "regroup ::= T_REGROUP filtered_var T_BY varname T_AS varname",
1077 /* 52 */ "filtered_var ::= filtered_var T_PIPE varname_args",
1078 /* 53 */ "filtered_var ::= varname_args",
1079 /* 54 */ "varname_args ::= varname T_COLON var_or_string",
1080 /* 55 */ "varname_args ::= varname",
1081 /* 56 */ "params ::= params var_or_string",
1082 /* 57 */ "params ::= params T_COMMA var_or_string",
1083 /* 58 */ "params ::= var_or_string",
1084 /* 59 */ "var_or_string ::= varname",
1085 /* 60 */ "var_or_string ::= number",
1086 /* 61 */ "var_or_string ::= T_TRUE|T_FALSE",
1087 /* 62 */ "var_or_string ::= string",
1088 /* 63 */ "fvar_or_string ::= filtered_var",
1089 /* 64 */ "fvar_or_string ::= number",
1090 /* 65 */ "fvar_or_string ::= T_TRUE|T_FALSE",
1091 /* 66 */ "fvar_or_string ::= string",
1092 /* 67 */ "string ::= T_STRING",
1093 /* 68 */ "string ::= T_INTL T_STRING T_RPARENT",
1094 /* 69 */ "expr ::= T_NOT expr",
1095 /* 70 */ "expr ::= expr T_AND expr",
1096 /* 71 */ "expr ::= expr T_OR expr",
1097 /* 72 */ "expr ::= expr T_PLUS|T_MINUS|T_CONCAT expr",
1098 /* 73 */ "expr ::= expr T_EQ|T_NE|T_GT|T_GE|T_LT|T_LE|T_IN expr",
1099 /* 74 */ "expr ::= expr T_TIMES|T_DIV|T_MOD expr",
1100 /* 75 */ "expr ::= expr T_BITWISE|T_PIPE expr",
1101 /* 76 */ "expr ::= T_LPARENT expr T_RPARENT",
1102 /* 77 */ "expr ::= fvar_or_string",
1103 /* 78 */ "varname ::= varpart",
1104 /* 79 */ "varpart ::= varname T_OBJ|T_DOT T_ALPHA|T_CUSTOM_TAG|T_CUSTOM_BLOCK",
1105 /* 80 */ "varpart ::= varname T_CLASS T_ALPHA|T_CUSTOM_TAG|T_CUSTOM_BLOCK",
1106 /* 81 */ "varpart ::= varname T_BRACKETS_OPEN var_or_string T_BRACKETS_CLOSE",
1107 /* 82 */ "varpart ::= T_ALPHA",
1108 /* 83 */ "varpart ::= T_BLOCK|T_CUSTOM_TAG|T_CUSTOM_BLOCK",
1109 /* 84 */ "range ::= numvar T_DOTDOT numvar",
1110 /* 85 */ "numvar ::= number",
1111 /* 86 */ "numvar ::= varname",
1112 /* 87 */ "number ::= T_NUMERIC",
1113 /* 88 */ "number ::= T_MINUS T_NUMERIC",
1117 * This function returns the symbolic name associated with a token
1122 function tokenName($tokenType)
1124 if ($tokenType === 0) {
1125 return 'End of Input';
1127 if ($tokenType > 0 && $tokenType < count(self
::$yyTokenName)) {
1128 return self
::$yyTokenName[$tokenType];
1135 * The following function deletes the value associated with a
1136 * symbol. The symbol can be either a terminal or nonterminal.
1137 * @param int the symbol code
1138 * @param mixed the symbol's value
1140 static function yy_destructor($yymajor, $yypminor)
1143 /* Here is inserted the actions which take place when a
1144 ** terminal or non-terminal is destroyed. This can happen
1145 ** when the symbol is popped from the stack during a
1146 ** reduce or during error processing or when a parser is
1147 ** being destroyed before it is finished parsing.
1149 ** Note: during a reduce, the only symbols destroyed are those
1150 ** which appear on the RHS of the rule, but which are not used
1151 ** inside the C code.
1153 default: break; /* If no destructor action specified: do nothing */
1158 * Pop the parser's stack once.
1160 * If there is a destructor routine associated with the token which
1161 * is popped from the stack, then call it.
1163 * Return the major token number for the symbol popped.
1164 * @param Haanga_yyParser
1167 function yy_pop_parser_stack()
1169 if (!count($this->yystack
)) {
1172 $yytos = array_pop($this->yystack
);
1173 if (self
::$yyTraceFILE && $this->yyidx
>= 0) {
1174 fwrite(self
::$yyTraceFILE,
1175 self
::$yyTracePrompt . 'Popping ' . self
::$yyTokenName[$yytos->major
] .
1178 $yymajor = $yytos->major
;
1179 self
::yy_destructor($yymajor, $yytos->minor
);
1185 * Deallocate and destroy a parser. Destructors are all called for
1186 * all stack elements before shutting the parser down.
1188 function __destruct()
1190 while ($this->yyidx
>= 0) {
1191 $this->yy_pop_parser_stack();
1193 if (is_resource(self
::$yyTraceFILE)) {
1194 fclose(self
::$yyTraceFILE);
1199 * Based on the current state and parser stack, get a list of all
1200 * possible lookahead tokens
1204 function yy_get_expected_tokens($token)
1206 $state = $this->yystack
[$this->yyidx
]->stateno
;
1207 $expected = self
::$yyExpectedTokens[$state];
1208 if (in_array($token, self
::$yyExpectedTokens[$state], true)) {
1211 $stack = $this->yystack
;
1212 $yyidx = $this->yyidx
;
1214 $yyact = $this->yy_find_shift_action($token);
1215 if ($yyact >= self
::YYNSTATE
&& $yyact < self
::YYNSTATE + self
::YYNRULE
) {
1219 if ($done++
== 100) {
1220 $this->yyidx
= $yyidx;
1221 $this->yystack
= $stack;
1222 // too much recursion prevents proper detection
1224 return array_unique($expected);
1226 $yyruleno = $yyact - self
::YYNSTATE
;
1227 $this->yyidx
-= self
::$yyRuleInfo[$yyruleno]['rhs'];
1228 $nextstate = $this->yy_find_reduce_action(
1229 $this->yystack
[$this->yyidx
]->stateno
,
1230 self
::$yyRuleInfo[$yyruleno]['lhs']);
1231 if (isset(self
::$yyExpectedTokens[$nextstate])) {
1232 $expected +
= self
::$yyExpectedTokens[$nextstate];
1233 if (in_array($token,
1234 self
::$yyExpectedTokens[$nextstate], true)) {
1235 $this->yyidx
= $yyidx;
1236 $this->yystack
= $stack;
1237 return array_unique($expected);
1240 if ($nextstate < self
::YYNSTATE
) {
1241 // we need to shift a non-terminal
1243 $x = new Haanga_yyStackEntry
;
1244 $x->stateno
= $nextstate;
1245 $x->major
= self
::$yyRuleInfo[$yyruleno]['lhs'];
1246 $this->yystack
[$this->yyidx
] = $x;
1248 } elseif ($nextstate == self
::YYNSTATE + self
::YYNRULE +
1) {
1249 $this->yyidx
= $yyidx;
1250 $this->yystack
= $stack;
1251 // the last token was just ignored, we can't accept
1252 // by ignoring input, this is in essence ignoring a
1254 return array_unique($expected);
1255 } elseif ($nextstate === self
::YY_NO_ACTION
) {
1256 $this->yyidx
= $yyidx;
1257 $this->yystack
= $stack;
1258 // input accepted, but not shifted (I guess)
1261 $yyact = $nextstate;
1267 return array_unique($expected);
1271 * Based on the parser state and current parser stack, determine whether
1272 * the lookahead token is possible.
1274 * The parser will convert the token value to an error token if not. This
1275 * catches some unusual edge cases where the parser would fail.
1279 function yy_is_expected_token($token)
1282 return true; // 0 is not part of this
1284 $state = $this->yystack
[$this->yyidx
]->stateno
;
1285 if (in_array($token, self
::$yyExpectedTokens[$state], true)) {
1288 $stack = $this->yystack
;
1289 $yyidx = $this->yyidx
;
1291 $yyact = $this->yy_find_shift_action($token);
1292 if ($yyact >= self
::YYNSTATE
&& $yyact < self
::YYNSTATE + self
::YYNRULE
) {
1296 if ($done++
== 100) {
1297 $this->yyidx
= $yyidx;
1298 $this->yystack
= $stack;
1299 // too much recursion prevents proper detection
1303 $yyruleno = $yyact - self
::YYNSTATE
;
1304 $this->yyidx
-= self
::$yyRuleInfo[$yyruleno]['rhs'];
1305 $nextstate = $this->yy_find_reduce_action(
1306 $this->yystack
[$this->yyidx
]->stateno
,
1307 self
::$yyRuleInfo[$yyruleno]['lhs']);
1308 if (isset(self
::$yyExpectedTokens[$nextstate]) &&
1309 in_array($token, self
::$yyExpectedTokens[$nextstate], true)) {
1310 $this->yyidx
= $yyidx;
1311 $this->yystack
= $stack;
1314 if ($nextstate < self
::YYNSTATE
) {
1315 // we need to shift a non-terminal
1317 $x = new Haanga_yyStackEntry
;
1318 $x->stateno
= $nextstate;
1319 $x->major
= self
::$yyRuleInfo[$yyruleno]['lhs'];
1320 $this->yystack
[$this->yyidx
] = $x;
1322 } elseif ($nextstate == self
::YYNSTATE + self
::YYNRULE +
1) {
1323 $this->yyidx
= $yyidx;
1324 $this->yystack
= $stack;
1326 // end of input: this is valid
1329 // the last token was just ignored, we can't accept
1330 // by ignoring input, this is in essence ignoring a
1333 } elseif ($nextstate === self
::YY_NO_ACTION
) {
1334 $this->yyidx
= $yyidx;
1335 $this->yystack
= $stack;
1336 // input accepted, but not shifted (I guess)
1339 $yyact = $nextstate;
1345 $this->yyidx
= $yyidx;
1346 $this->yystack
= $stack;
1351 * Find the appropriate action for a parser given the terminal
1352 * look-ahead token iLookAhead.
1354 * If the look-ahead token is YYNOCODE, then check to see if the action is
1355 * independent of the look-ahead. If it is, return the action, otherwise
1356 * return YY_NO_ACTION.
1357 * @param int The look-ahead token
1359 function yy_find_shift_action($iLookAhead)
1361 $stateno = $this->yystack
[$this->yyidx
]->stateno
;
1363 /* if ($this->yyidx < 0) return self::YY_NO_ACTION; */
1364 if (!isset(self
::$yy_shift_ofst[$stateno])) {
1366 return self
::$yy_default[$stateno];
1368 $i = self
::$yy_shift_ofst[$stateno];
1369 if ($i === self
::YY_SHIFT_USE_DFLT
) {
1370 return self
::$yy_default[$stateno];
1372 if ($iLookAhead == self
::YYNOCODE
) {
1373 return self
::YY_NO_ACTION
;
1376 if ($i < 0 ||
$i >= self
::YY_SZ_ACTTAB ||
1377 self
::$yy_lookahead[$i] != $iLookAhead) {
1378 if (count(self
::$yyFallback) && $iLookAhead < count(self
::$yyFallback)
1379 && ($iFallback = self
::$yyFallback[$iLookAhead]) != 0) {
1380 if (self
::$yyTraceFILE) {
1381 fwrite(self
::$yyTraceFILE, self
::$yyTracePrompt . "FALLBACK " .
1382 self
::$yyTokenName[$iLookAhead] . " => " .
1383 self
::$yyTokenName[$iFallback] . "\n");
1385 return $this->yy_find_shift_action($iFallback);
1387 return self
::$yy_default[$stateno];
1389 return self
::$yy_action[$i];
1394 * Find the appropriate action for a parser given the non-terminal
1395 * look-ahead token $iLookAhead.
1397 * If the look-ahead token is self::YYNOCODE, then check to see if the action is
1398 * independent of the look-ahead. If it is, return the action, otherwise
1399 * return self::YY_NO_ACTION.
1400 * @param int Current state number
1401 * @param int The look-ahead token
1403 function yy_find_reduce_action($stateno, $iLookAhead)
1405 /* $stateno = $this->yystack[$this->yyidx]->stateno; */
1407 if (!isset(self
::$yy_reduce_ofst[$stateno])) {
1408 return self
::$yy_default[$stateno];
1410 $i = self
::$yy_reduce_ofst[$stateno];
1411 if ($i == self
::YY_REDUCE_USE_DFLT
) {
1412 return self
::$yy_default[$stateno];
1414 if ($iLookAhead == self
::YYNOCODE
) {
1415 return self
::YY_NO_ACTION
;
1418 if ($i < 0 ||
$i >= self
::YY_SZ_ACTTAB ||
1419 self
::$yy_lookahead[$i] != $iLookAhead) {
1420 return self
::$yy_default[$stateno];
1422 return self
::$yy_action[$i];
1427 * Perform a shift action.
1428 * @param int The new state to shift in
1429 * @param int The major token to shift in
1430 * @param mixed the minor token to shift in
1432 function yy_shift($yyNewState, $yyMajor, $yypMinor)
1435 if ($this->yyidx
>= self
::YYSTACKDEPTH
) {
1437 if (self
::$yyTraceFILE) {
1438 fprintf(self
::$yyTraceFILE, "%sStack Overflow!\n", self
::$yyTracePrompt);
1440 while ($this->yyidx
>= 0) {
1441 $this->yy_pop_parser_stack();
1443 /* Here code is inserted which will execute if the parser
1444 ** stack ever overflows */
1447 $yytos = new Haanga_yyStackEntry
;
1448 $yytos->stateno
= $yyNewState;
1449 $yytos->major
= $yyMajor;
1450 $yytos->minor
= $yypMinor;
1451 array_push($this->yystack
, $yytos);
1452 if (self
::$yyTraceFILE && $this->yyidx
> 0) {
1453 fprintf(self
::$yyTraceFILE, "%sShift %d\n", self
::$yyTracePrompt,
1455 fprintf(self
::$yyTraceFILE, "%sStack:", self
::$yyTracePrompt);
1456 for($i = 1; $i <= $this->yyidx
; $i++
) {
1457 fprintf(self
::$yyTraceFILE, " %s",
1458 self
::$yyTokenName[$this->yystack
[$i]->major
]);
1460 fwrite(self
::$yyTraceFILE,"\n");
1465 * The following table contains information about every rule that
1466 * is used during the reduce.
1471 * int $lhs; Symbol on the left-hand side of the rule
1472 * int $nrhs; Number of right-hand side symbols in the rule
1477 static public $yyRuleInfo = array(
1478 array( 'lhs' => 66, 'rhs' => 1 ),
1479 array( 'lhs' => 67, 'rhs' => 2 ),
1480 array( 'lhs' => 67, 'rhs' => 0 ),
1481 array( 'lhs' => 68, 'rhs' => 2 ),
1482 array( 'lhs' => 68, 'rhs' => 1 ),
1483 array( 'lhs' => 68, 'rhs' => 1 ),
1484 array( 'lhs' => 68, 'rhs' => 3 ),
1485 array( 'lhs' => 69, 'rhs' => 3 ),
1486 array( 'lhs' => 69, 'rhs' => 2 ),
1487 array( 'lhs' => 69, 'rhs' => 1 ),
1488 array( 'lhs' => 69, 'rhs' => 1 ),
1489 array( 'lhs' => 69, 'rhs' => 1 ),
1490 array( 'lhs' => 69, 'rhs' => 1 ),
1491 array( 'lhs' => 69, 'rhs' => 1 ),
1492 array( 'lhs' => 69, 'rhs' => 3 ),
1493 array( 'lhs' => 69, 'rhs' => 1 ),
1494 array( 'lhs' => 69, 'rhs' => 1 ),
1495 array( 'lhs' => 69, 'rhs' => 1 ),
1496 array( 'lhs' => 69, 'rhs' => 7 ),
1497 array( 'lhs' => 78, 'rhs' => 2 ),
1498 array( 'lhs' => 78, 'rhs' => 4 ),
1499 array( 'lhs' => 78, 'rhs' => 3 ),
1500 array( 'lhs' => 78, 'rhs' => 5 ),
1501 array( 'lhs' => 78, 'rhs' => 6 ),
1502 array( 'lhs' => 78, 'rhs' => 7 ),
1503 array( 'lhs' => 78, 'rhs' => 6 ),
1504 array( 'lhs' => 79, 'rhs' => 9 ),
1505 array( 'lhs' => 72, 'rhs' => 4 ),
1506 array( 'lhs' => 72, 'rhs' => 1 ),
1507 array( 'lhs' => 72, 'rhs' => 2 ),
1508 array( 'lhs' => 86, 'rhs' => 5 ),
1509 array( 'lhs' => 86, 'rhs' => 7 ),
1510 array( 'lhs' => 73, 'rhs' => 5 ),
1511 array( 'lhs' => 73, 'rhs' => 9 ),
1512 array( 'lhs' => 73, 'rhs' => 11 ),
1513 array( 'lhs' => 73, 'rhs' => 9 ),
1514 array( 'lhs' => 77, 'rhs' => 7 ),
1515 array( 'lhs' => 77, 'rhs' => 11 ),
1516 array( 'lhs' => 74, 'rhs' => 6 ),
1517 array( 'lhs' => 74, 'rhs' => 7 ),
1518 array( 'lhs' => 74, 'rhs' => 10 ),
1519 array( 'lhs' => 74, 'rhs' => 11 ),
1520 array( 'lhs' => 80, 'rhs' => 8 ),
1521 array( 'lhs' => 80, 'rhs' => 12 ),
1522 array( 'lhs' => 80, 'rhs' => 8 ),
1523 array( 'lhs' => 80, 'rhs' => 12 ),
1524 array( 'lhs' => 75, 'rhs' => 7 ),
1525 array( 'lhs' => 75, 'rhs' => 8 ),
1526 array( 'lhs' => 75, 'rhs' => 7 ),
1527 array( 'lhs' => 75, 'rhs' => 8 ),
1528 array( 'lhs' => 76, 'rhs' => 7 ),
1529 array( 'lhs' => 84, 'rhs' => 6 ),
1530 array( 'lhs' => 70, 'rhs' => 3 ),
1531 array( 'lhs' => 70, 'rhs' => 1 ),
1532 array( 'lhs' => 91, 'rhs' => 3 ),
1533 array( 'lhs' => 91, 'rhs' => 1 ),
1534 array( 'lhs' => 82, 'rhs' => 2 ),
1535 array( 'lhs' => 82, 'rhs' => 3 ),
1536 array( 'lhs' => 82, 'rhs' => 1 ),
1537 array( 'lhs' => 71, 'rhs' => 1 ),
1538 array( 'lhs' => 71, 'rhs' => 1 ),
1539 array( 'lhs' => 71, 'rhs' => 1 ),
1540 array( 'lhs' => 71, 'rhs' => 1 ),
1541 array( 'lhs' => 89, 'rhs' => 1 ),
1542 array( 'lhs' => 89, 'rhs' => 1 ),
1543 array( 'lhs' => 89, 'rhs' => 1 ),
1544 array( 'lhs' => 89, 'rhs' => 1 ),
1545 array( 'lhs' => 85, 'rhs' => 1 ),
1546 array( 'lhs' => 85, 'rhs' => 3 ),
1547 array( 'lhs' => 83, 'rhs' => 2 ),
1548 array( 'lhs' => 83, 'rhs' => 3 ),
1549 array( 'lhs' => 83, 'rhs' => 3 ),
1550 array( 'lhs' => 83, 'rhs' => 3 ),
1551 array( 'lhs' => 83, 'rhs' => 3 ),
1552 array( 'lhs' => 83, 'rhs' => 3 ),
1553 array( 'lhs' => 83, 'rhs' => 3 ),
1554 array( 'lhs' => 83, 'rhs' => 3 ),
1555 array( 'lhs' => 83, 'rhs' => 1 ),
1556 array( 'lhs' => 81, 'rhs' => 1 ),
1557 array( 'lhs' => 92, 'rhs' => 3 ),
1558 array( 'lhs' => 92, 'rhs' => 3 ),
1559 array( 'lhs' => 92, 'rhs' => 4 ),
1560 array( 'lhs' => 92, 'rhs' => 1 ),
1561 array( 'lhs' => 92, 'rhs' => 1 ),
1562 array( 'lhs' => 87, 'rhs' => 3 ),
1563 array( 'lhs' => 88, 'rhs' => 1 ),
1564 array( 'lhs' => 88, 'rhs' => 1 ),
1565 array( 'lhs' => 90, 'rhs' => 1 ),
1566 array( 'lhs' => 90, 'rhs' => 2 ),
1570 * The following table contains a mapping of reduce action to method name
1571 * that handles the reduction.
1573 * If a rule is not set, it has no handler.
1575 static public $yyReduceMap = array(
1666 /* Beginning here are the reduction cases. A typical example
1668 ** #line <lineno> <grammarfile>
1669 ** function yy_r0($yymsp){ ... } // User supplied code
1670 ** #line <lineno> <thisfile>
1673 function yy_r0(){ $this->body
= $this->yystack
[$this->yyidx +
0]->minor
; }
1674 #line 1680 "Parser.php"
1676 function yy_r1(){ $this->_retvalue
=$this->yystack
[$this->yyidx +
-1]->minor
; $this->_retvalue
[] = $this->yystack
[$this->yyidx +
0]->minor
; }
1677 #line 1683 "Parser.php"
1679 function yy_r2(){ $this->_retvalue
= array(); }
1680 #line 1686 "Parser.php"
1682 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
; }
1683 #line 1689 "Parser.php"
1686 $this->_retvalue
= array('operation' => 'html', 'html' => $this->yystack
[$this->yyidx +
0]->minor
, 'line' => $this->lex
->getLine() );
1688 #line 1694 "Parser.php"
1691 $this->yystack
[$this->yyidx +
0]->minor
=rtrim($this->yystack
[$this->yyidx +
0]->minor
); $this->_retvalue
= array('operation' => 'comment', 'comment' => $this->yystack
[$this->yyidx +
0]->minor
);
1693 #line 1699 "Parser.php"
1696 $this->_retvalue
= array('operation' => 'print_var', 'variable' => $this->yystack
[$this->yyidx +
-1]->minor
, 'line' => $this->lex
->getLine() );
1698 #line 1704 "Parser.php"
1700 function yy_r7(){ $this->_retvalue
= array('operation' => 'base', $this->yystack
[$this->yyidx +
-1]->minor
); }
1701 #line 1707 "Parser.php"
1703 function yy_r8(){ $this->_retvalue
= $this->yystack
[$this->yyidx +
-1]->minor
; }
1704 #line 1710 "Parser.php"
1706 function yy_r9(){ $this->_retvalue
= $this->yystack
[$this->yyidx +
0]->minor
; }
1707 #line 1713 "Parser.php"
1708 #line 104 "Parser.y"
1709 function yy_r14(){ $this->_retvalue
= array('operation' => 'include', $this->yystack
[$this->yyidx +
-1]->minor
); }
1710 #line 1716 "Parser.php"
1711 #line 108 "Parser.y"
1713 $this->yystack
[$this->yyidx +
-5]->minor
= strtolower($this->yystack
[$this->yyidx +
-5]->minor
);
1714 if ($this->yystack
[$this->yyidx +
-5]->minor
!= 'on' && $this->yystack
[$this->yyidx +
-5]->minor
!= 'off') {
1715 $this->Error("Invalid autoescape param (".$this->yystack
[$this->yyidx +
-5]->minor
."), it must be on or off");
1717 if ($this->yystack
[$this->yyidx +
-1]->minor
!= "endautoescape") {
1718 $this->Error("Invalid close tag ".$this->yystack
[$this->yyidx +
-1]->minor
.", it must be endautoescape");
1720 $this->_retvalue
= array('operation' => 'autoescape', 'value' => $this->yystack
[$this->yyidx +
-5]->minor
, 'body' => $this->yystack
[$this->yyidx +
-3]->minor
);
1722 #line 1728 "Parser.php"
1723 #line 122 "Parser.y"
1725 $this->_retvalue
= array('operation' => 'custom_tag', 'name' => $this->yystack
[$this->yyidx +
-1]->minor
, 'list'=>array());
1727 #line 1733 "Parser.php"
1728 #line 125 "Parser.y"
1730 $this->_retvalue
= array('operation' => 'custom_tag', 'name' => $this->yystack
[$this->yyidx +
-3]->minor
, 'as' => $this->yystack
[$this->yyidx +
-1]->minor
, 'list'=>array());
1732 #line 1738 "Parser.php"
1733 #line 128 "Parser.y"
1735 $this->_retvalue
= array('operation' => 'custom_tag', 'name' => $this->yystack
[$this->yyidx +
-2]->minor
, 'list' => $this->yystack
[$this->yyidx +
-1]->minor
);
1737 #line 1743 "Parser.php"
1738 #line 131 "Parser.y"
1740 $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
);
1742 #line 1748 "Parser.php"
1743 #line 136 "Parser.y"
1745 if ('end'.$this->yystack
[$this->yyidx +
-5]->minor
!= $this->yystack
[$this->yyidx +
-1]->minor
) {
1746 $this->error("Unexpected ".$this->yystack
[$this->yyidx +
-1]->minor
);
1748 $this->_retvalue
= array('operation' => 'custom_tag', 'name' => $this->yystack
[$this->yyidx +
-5]->minor
, 'body' => $this->yystack
[$this->yyidx +
-3]->minor
, 'list' => array());
1750 #line 1756 "Parser.php"
1751 #line 142 "Parser.y"
1753 if ('end'.$this->yystack
[$this->yyidx +
-6]->minor
!= $this->yystack
[$this->yyidx +
-1]->minor
) {
1754 $this->error("Unexpected ".$this->yystack
[$this->yyidx +
-1]->minor
);
1756 $this->_retvalue
= array('operation' => 'custom_tag', 'name' => $this->yystack
[$this->yyidx +
-6]->minor
, 'body' => $this->yystack
[$this->yyidx +
-3]->minor
, 'list' => $this->yystack
[$this->yyidx +
-5]->minor
);
1758 #line 1764 "Parser.php"
1759 #line 150 "Parser.y"
1761 if ('endspacefull' != $this->yystack
[$this->yyidx +
-1]->minor
) {
1762 $this->error("Unexpected ".$this->yystack
[$this->yyidx +
-1]->minor
);
1764 $this->_retvalue
= array('operation' => 'spacefull', 'body' => $this->yystack
[$this->yyidx +
-3]->minor
);
1766 #line 1772 "Parser.php"
1767 #line 158 "Parser.y"
1769 if ($this->yystack
[$this->yyidx +
-1]->minor
!= "endwith") {
1770 $this->Error("Unexpected ".$this->yystack
[$this->yyidx +
-1]->minor
.", expecting endwith");
1772 $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
);
1774 #line 1780 "Parser.php"
1775 #line 166 "Parser.y"
1776 function yy_r27(){ $this->_retvalue
= array('operation' => 'set', 'var' => $this->yystack
[$this->yyidx +
-2]->minor
,'expr' => $this->yystack
[$this->yyidx +
0]->minor
); }
1777 #line 1783 "Parser.php"
1778 #line 168 "Parser.y"
1780 if (!is_file($this->yystack
[$this->yyidx +
0]->minor
) ||
!Haanga_Compiler
::getOption('enable_load')) {
1781 $this->error($this->yystack
[$this->yyidx +
0]->minor
." is not a valid file");
1783 require_once $this->yystack
[$this->yyidx +
0]->minor
;
1785 #line 1791 "Parser.php"
1786 #line 177 "Parser.y"
1788 $var = $this->compiler
->get_context($this->yystack
[$this->yyidx +
-1]->minor
[0]);
1789 if (is_array($var) ||
$var instanceof Iterator
) {
1790 /* let's check if it is an object or array */
1791 $this->compiler
->set_context($this->yystack
[$this->yyidx +
-3]->minor
, current($var));
1793 $this->_retvalue
= array('operation' => 'loop', 'variable' => $this->yystack
[$this->yyidx +
-3]->minor
, 'index' => NULL, 'array' => $this->yystack
[$this->yyidx +
-1]->minor
);
1795 #line 1801 "Parser.php"
1796 #line 185 "Parser.y"
1798 $var = $this->compiler
->get_context($this->yystack
[$this->yyidx +
-1]->minor
[0]);
1799 if (is_array($var) ||
$var instanceof Iterator
) {
1800 /* let's check if it is an object or array */
1801 $this->compiler
->set_context($this->yystack
[$this->yyidx +
-3]->minor
, current($var));
1803 $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
);
1806 #line 1812 "Parser.php"
1807 #line 195 "Parser.y"
1809 if ($this->yystack
[$this->yyidx +
-1]->minor
!= "endfor") {
1810 $this->Error("Unexpected ".$this->yystack
[$this->yyidx +
-1]->minor
.", expecting endfor");
1812 $this->_retvalue
= $this->yystack
[$this->yyidx +
-4]->minor
;
1813 $this->_retvalue
['body'] = $this->yystack
[$this->yyidx +
-3]->minor
;
1815 #line 1821 "Parser.php"
1816 #line 203 "Parser.y"
1818 if ($this->yystack
[$this->yyidx +
-1]->minor
!= "endfor") {
1819 $this->Error("Unexpected ".$this->yystack
[$this->yyidx +
-1]->minor
.", expecting endfor");
1821 $this->_retvalue
= array('operation' => 'loop', 'variable' => $this->yystack
[$this->yyidx +
-7]->minor
, 'range' => $this->yystack
[$this->yyidx +
-5]->minor
, 'body' => $this->yystack
[$this->yyidx +
-3]->minor
, 'variable' => $this->yystack
[$this->yyidx +
-7]->minor
, 'step' => 1);
1823 #line 1829 "Parser.php"
1824 #line 210 "Parser.y"
1826 if ($this->yystack
[$this->yyidx +
-1]->minor
!= "endfor") {
1827 $this->Error("Unexpected ".$this->yystack
[$this->yyidx +
-1]->minor
.", expecting endfor");
1829 $this->_retvalue
= array('operation' => 'loop', 'variable' => $this->yystack
[$this->yyidx +
-9]->minor
, 'range' => $this->yystack
[$this->yyidx +
-7]->minor
, 'body' => $this->yystack
[$this->yyidx +
-3]->minor
, 'variable' => $this->yystack
[$this->yyidx +
-9]->minor
, 'step' => $this->yystack
[$this->yyidx +
-5]->minor
);
1831 #line 1837 "Parser.php"
1832 #line 217 "Parser.y"
1834 if ($this->yystack
[$this->yyidx +
-1]->minor
!= "endfor") {
1835 $this->Error("Unexpected ".$this->yystack
[$this->yyidx +
-1]->minor
.", expecting endfor");
1837 $this->_retvalue
= $this->yystack
[$this->yyidx +
-8]->minor
;
1838 $this->_retvalue
['body'] = $this->yystack
[$this->yyidx +
-7]->minor
;
1839 $this->_retvalue
['empty'] = $this->yystack
[$this->yyidx +
-3]->minor
;
1841 #line 1847 "Parser.php"
1842 #line 226 "Parser.y"
1844 if ($this->yystack
[$this->yyidx +
-1]->minor
!= "endif") {
1845 $this->Error("Unexpected ".$this->yystack
[$this->yyidx +
-1]->minor
.", expecting endif");
1847 $this->_retvalue
= array('operation' => 'if', 'expr' => $this->yystack
[$this->yyidx +
-5]->minor
, 'body' => $this->yystack
[$this->yyidx +
-3]->minor
);
1849 #line 1855 "Parser.php"
1850 #line 232 "Parser.y"
1852 if ($this->yystack
[$this->yyidx +
-1]->minor
!= "endif") {
1853 $this->Error("Unexpected ".$this->yystack
[$this->yyidx +
-1]->minor
.", expecting endif");
1855 $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
);
1857 #line 1863 "Parser.php"
1858 #line 240 "Parser.y"
1860 if ($this->yystack
[$this->yyidx +
-1]->minor
!= "endifchanged") {
1861 $this->Error("Unexpected ".$this->yystack
[$this->yyidx +
-1]->minor
.", expecting endifchanged");
1863 $this->_retvalue
= array('operation' => 'ifchanged', 'body' => $this->yystack
[$this->yyidx +
-3]->minor
);
1865 #line 1871 "Parser.php"
1866 #line 247 "Parser.y"
1868 if ($this->yystack
[$this->yyidx +
-1]->minor
!= "endifchanged") {
1869 $this->Error("Unexpected ".$this->yystack
[$this->yyidx +
-1]->minor
.", expecting endifchanged");
1871 $this->_retvalue
= array('operation' => 'ifchanged', 'body' => $this->yystack
[$this->yyidx +
-3]->minor
, 'check' => $this->yystack
[$this->yyidx +
-5]->minor
);
1873 #line 1879 "Parser.php"
1874 #line 253 "Parser.y"
1876 if ($this->yystack
[$this->yyidx +
-1]->minor
!= "endifchanged") {
1877 $this->Error("Unexpected ".$this->yystack
[$this->yyidx +
-1]->minor
.", expecting endifchanged");
1879 $this->_retvalue
= array('operation' => 'ifchanged', 'body' => $this->yystack
[$this->yyidx +
-7]->minor
, 'else' => $this->yystack
[$this->yyidx +
-3]->minor
);
1881 #line 1887 "Parser.php"
1882 #line 260 "Parser.y"
1884 if ($this->yystack
[$this->yyidx +
-1]->minor
!= "endifchanged") {
1885 $this->Error("Unexpected ".$this->yystack
[$this->yyidx +
-1]->minor
.", expecting endifchanged");
1887 $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
);
1889 #line 1895 "Parser.php"
1890 #line 268 "Parser.y"
1892 if ($this->yystack
[$this->yyidx +
-1]->minor
!= "endifequal") {
1893 $this->Error("Unexpected ".$this->yystack
[$this->yyidx +
-1]->minor
.", expecting endifequal");
1895 $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
);
1897 #line 1903 "Parser.php"
1898 #line 274 "Parser.y"
1900 if ($this->yystack
[$this->yyidx +
-1]->minor
!= "endifequal") {
1901 $this->Error("Unexpected ".$this->yystack
[$this->yyidx +
-1]->minor
.", expecting endifequal");
1903 $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
);
1905 #line 1911 "Parser.php"
1906 #line 280 "Parser.y"
1908 if ($this->yystack
[$this->yyidx +
-1]->minor
!= "endifnotequal") {
1909 $this->Error("Unexpected ".$this->yystack
[$this->yyidx +
-1]->minor
.", expecting endifnotequal");
1911 $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
);
1913 #line 1919 "Parser.php"
1914 #line 286 "Parser.y"
1916 if ($this->yystack
[$this->yyidx +
-1]->minor
!= "endifnotequal") {
1917 $this->Error("Unexpected ".$this->yystack
[$this->yyidx +
-1]->minor
.", expecting endifnotequal");
1919 $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
);
1921 #line 1927 "Parser.php"
1922 #line 294 "Parser.y"
1924 if ($this->yystack
[$this->yyidx +
-1]->minor
!= "endblock") {
1925 $this->Error("Unexpected ".$this->yystack
[$this->yyidx +
-1]->minor
.", expecting endblock");
1927 $this->_retvalue
= array('operation' => 'block', 'name' => $this->yystack
[$this->yyidx +
-5]->minor
, 'body' => $this->yystack
[$this->yyidx +
-3]->minor
);
1929 #line 1935 "Parser.php"
1930 #line 301 "Parser.y"
1932 if ($this->yystack
[$this->yyidx +
-2]->minor
!= "endblock") {
1933 $this->Error("Unexpected ".$this->yystack
[$this->yyidx +
-2]->minor
.", expecting endblock");
1935 $this->_retvalue
= array('operation' => 'block', 'name' => $this->yystack
[$this->yyidx +
-6]->minor
, 'body' => $this->yystack
[$this->yyidx +
-4]->minor
);
1937 #line 1943 "Parser.php"
1938 #line 308 "Parser.y"
1940 if ($this->yystack
[$this->yyidx +
-1]->minor
!= "endblock") {
1941 $this->Error("Unexpected ".$this->yystack
[$this->yyidx +
-1]->minor
.", expecting endblock");
1943 $this->_retvalue
= array('operation' => 'block', 'name' => $this->yystack
[$this->yyidx +
-5]->minor
, 'body' => $this->yystack
[$this->yyidx +
-3]->minor
);
1945 #line 1951 "Parser.php"
1946 #line 323 "Parser.y"
1948 if ($this->yystack
[$this->yyidx +
-1]->minor
!= "endfilter") {
1949 $this->Error("Unexpected ".$this->yystack
[$this->yyidx +
-1]->minor
.", expecting endfilter");
1951 $this->_retvalue
= array('operation' => 'filter', 'functions' => $this->yystack
[$this->yyidx +
-5]->minor
, 'body' => $this->yystack
[$this->yyidx +
-3]->minor
);
1953 #line 1959 "Parser.php"
1954 #line 331 "Parser.y"
1955 function yy_r51(){ $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
); }
1956 #line 1962 "Parser.php"
1957 #line 334 "Parser.y"
1958 function yy_r52(){ $this->_retvalue
= $this->yystack
[$this->yyidx +
-2]->minor
; $this->_retvalue
[] = $this->yystack
[$this->yyidx +
0]->minor
; }
1959 #line 1965 "Parser.php"
1960 #line 335 "Parser.y"
1961 function yy_r53(){ $this->_retvalue
= array($this->yystack
[$this->yyidx +
0]->minor
); }
1962 #line 1968 "Parser.php"
1963 #line 337 "Parser.y"
1964 function yy_r54(){ $this->_retvalue
= array($this->yystack
[$this->yyidx +
-2]->minor
, 'args'=>array($this->yystack
[$this->yyidx +
0]->minor
)); }
1965 #line 1971 "Parser.php"
1966 #line 341 "Parser.y"
1967 function yy_r56(){ $this->_retvalue
= $this->yystack
[$this->yyidx +
-1]->minor
; $this->_retvalue
[] = $this->yystack
[$this->yyidx +
0]->minor
; }
1968 #line 1974 "Parser.php"
1969 #line 347 "Parser.y"
1970 function yy_r59(){ $this->_retvalue
= array('var' => $this->yystack
[$this->yyidx +
0]->minor
); }
1971 #line 1977 "Parser.php"
1972 #line 348 "Parser.y"
1973 function yy_r60(){ $this->_retvalue
= array('number' => $this->yystack
[$this->yyidx +
0]->minor
); }
1974 #line 1980 "Parser.php"
1975 #line 349 "Parser.y"
1976 function yy_r61(){ $this->_retvalue
= trim(@$this->yystack
[$this->yyidx +
0]->minor
); }
1977 #line 1983 "Parser.php"
1978 #line 350 "Parser.y"
1979 function yy_r62(){ $this->_retvalue
= array('string' => $this->yystack
[$this->yyidx +
0]->minor
); }
1980 #line 1986 "Parser.php"
1981 #line 353 "Parser.y"
1982 function yy_r63(){ $this->_retvalue
= array('var_filter' => $this->yystack
[$this->yyidx +
0]->minor
); }
1983 #line 1989 "Parser.php"
1984 #line 363 "Parser.y"
1985 function yy_r69(){ $this->_retvalue
= array('op_expr' => 'not', $this->yystack
[$this->yyidx +
0]->minor
); }
1986 #line 1992 "Parser.php"
1987 #line 364 "Parser.y"
1988 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
); }
1989 #line 1995 "Parser.php"
1990 #line 367 "Parser.y"
1991 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
); }
1992 #line 1998 "Parser.php"
1993 #line 369 "Parser.y"
1994 function yy_r75(){ $this->_retvalue
= array('op_expr' => 'expr', array('op_expr' => @$this->yystack
[$this->yyidx +
-1]->minor
, $this->yystack
[$this->yyidx +
-2]->minor
, $this->yystack
[$this->yyidx +
0]->minor
)); }
1995 #line 2001 "Parser.php"
1996 #line 370 "Parser.y"
1997 function yy_r76(){ $this->_retvalue
= array('op_expr' => 'expr', $this->yystack
[$this->yyidx +
-1]->minor
); }
1998 #line 2004 "Parser.php"
1999 #line 375 "Parser.y"
2000 function yy_r78(){ $this->_retvalue
= current($this->compiler
->generate_variable_name($this->yystack
[$this->yyidx +
0]->minor
, false)); }
2001 #line 2007 "Parser.php"
2002 #line 376 "Parser.y"
2004 if (!is_array($this->yystack
[$this->yyidx +
-2]->minor
)) { $this->_retvalue
= array($this->yystack
[$this->yyidx +
-2]->minor
); }
2005 else { $this->_retvalue
= $this->yystack
[$this->yyidx +
-2]->minor
; } $this->_retvalue
[]=array('object' => $this->yystack
[$this->yyidx +
0]->minor
);
2007 #line 2013 "Parser.php"
2008 #line 380 "Parser.y"
2010 if (!is_array($this->yystack
[$this->yyidx +
-2]->minor
)) { $this->_retvalue
= array($this->yystack
[$this->yyidx +
-2]->minor
); }
2011 else { $this->_retvalue
= $this->yystack
[$this->yyidx +
-2]->minor
; } $this->_retvalue
[]=array('class' => '$'.$this->yystack
[$this->yyidx +
0]->minor
);
2013 #line 2019 "Parser.php"
2014 #line 384 "Parser.y"
2016 if (!is_array($this->yystack
[$this->yyidx +
-3]->minor
)) { $this->_retvalue
= array($this->yystack
[$this->yyidx +
-3]->minor
); }
2017 else { $this->_retvalue
= $this->yystack
[$this->yyidx +
-3]->minor
; } $this->_retvalue
[]=$this->yystack
[$this->yyidx +
-1]->minor
;
2019 #line 2025 "Parser.php"
2020 #line 392 "Parser.y"
2021 function yy_r84(){ $this->_retvalue
= array($this->yystack
[$this->yyidx +
-2]->minor
, $this->yystack
[$this->yyidx +
0]->minor
); }
2022 #line 2028 "Parser.php"
2023 #line 398 "Parser.y"
2024 function yy_r88(){ $this->_retvalue
= -1 * ($this->yystack
[$this->yyidx +
0]->minor
); }
2025 #line 2031 "Parser.php"
2028 * placeholder for the left hand side in a reduce operation.
2030 * For a parser with a rule like this:
2032 * rule(A) ::= B. { A = 1; }
2035 * The parser will translate to something like:
2038 * function yy_r0(){$this->_retvalue = 1;}
2044 * Perform a reduce action and the shift that must immediately
2045 * follow the reduce.
2047 * For a rule such as:
2050 * A ::= B blah C. { dosomething(); }
2053 * This function will first call the action, if any, ("dosomething();" in our
2054 * example), and then it will pop three states from the stack,
2055 * one for each entry on the right-hand side of the expression
2056 * (B, blah, and C in our example rule), and then push the result of the action
2057 * back on to the stack with the resulting state reduced to (as described in the .out
2059 * @param int Number of the rule by which to reduce
2061 function yy_reduce($yyruleno)
2063 //int $yygoto; /* The next state */
2064 //int $yyact; /* The next action */
2065 //mixed $yygotominor; /* The LHS of the rule reduced */
2066 //Haanga_yyStackEntry $yymsp; /* The top of the parser's stack */
2067 //int $yysize; /* Amount to pop the stack */
2068 $yymsp = $this->yystack
[$this->yyidx
];
2069 if (self
::$yyTraceFILE && $yyruleno >= 0
2070 && $yyruleno < count(self
::$yyRuleName)) {
2071 fprintf(self
::$yyTraceFILE, "%sReduce (%d) [%s].\n",
2072 self
::$yyTracePrompt, $yyruleno,
2073 self
::$yyRuleName[$yyruleno]);
2076 $this->_retvalue
= $yy_lefthand_side = null;
2077 if (array_key_exists($yyruleno, self
::$yyReduceMap)) {
2079 $this->_retvalue
= null;
2080 $this->{'yy_r' . self
::$yyReduceMap[$yyruleno]}();
2081 $yy_lefthand_side = $this->_retvalue
;
2083 $yygoto = self
::$yyRuleInfo[$yyruleno]['lhs'];
2084 $yysize = self
::$yyRuleInfo[$yyruleno]['rhs'];
2085 $this->yyidx
-= $yysize;
2086 for($i = $yysize; $i; $i--) {
2087 // pop all of the right-hand side parameters
2088 array_pop($this->yystack
);
2090 $yyact = $this->yy_find_reduce_action($this->yystack
[$this->yyidx
]->stateno
, $yygoto);
2091 if ($yyact < self
::YYNSTATE
) {
2092 /* If we are not debugging and the reduce action popped at least
2093 ** one element off the stack, then we can push the new element back
2094 ** onto the stack here, and skip the stack overflow test in yy_shift().
2095 ** That gives a significant speed improvement. */
2096 if (!self
::$yyTraceFILE && $yysize) {
2098 $x = new Haanga_yyStackEntry
;
2099 $x->stateno
= $yyact;
2100 $x->major
= $yygoto;
2101 $x->minor
= $yy_lefthand_side;
2102 $this->yystack
[$this->yyidx
] = $x;
2104 $this->yy_shift($yyact, $yygoto, $yy_lefthand_side);
2106 } elseif ($yyact == self
::YYNSTATE + self
::YYNRULE +
1) {
2112 * The following code executes when the parse fails
2114 * Code from %parse_fail is inserted here
2116 function yy_parse_failed()
2118 if (self
::$yyTraceFILE) {
2119 fprintf(self
::$yyTraceFILE, "%sFail!\n", self
::$yyTracePrompt);
2121 while ($this->yyidx
>= 0) {
2122 $this->yy_pop_parser_stack();
2124 /* Here code is inserted which will be executed whenever the
2129 * The following code executes when a syntax error first occurs.
2131 * %syntax_error code is inserted here
2132 * @param int The major type of the error token
2133 * @param mixed The minor type of the error token
2135 function yy_syntax_error($yymajor, $TOKEN)
2140 foreach ($this->yy_get_expected_tokens($yymajor) as $token) {
2141 $expect[] = self
::$yyTokenName[$token];
2143 $this->Error('Unexpected ' . $this->tokenName($yymajor) . '(' . $TOKEN. '), expected one of: ' . implode(',', $expect));
2144 #line 2151 "Parser.php"
2148 * The following is executed when the parser accepts
2150 * %parse_accept code is inserted here
2152 function yy_accept()
2154 if (self
::$yyTraceFILE) {
2155 fprintf(self
::$yyTraceFILE, "%sAccept!\n", self
::$yyTracePrompt);
2157 while ($this->yyidx
>= 0) {
2158 $stack = $this->yy_pop_parser_stack();
2160 /* Here code is inserted which will be executed whenever the
2161 ** parser accepts */
2164 #line 2172 "Parser.php"
2168 * The main parser program.
2170 * The first argument is the major token number. The second is
2171 * the token value string as scanned from the input.
2173 * @param int the token number
2174 * @param mixed the token value
2175 * @param mixed any extra arguments that should be passed to handlers
2177 function doParse($yymajor, $yytokenvalue)
2179 // $yyact; /* The parser action. */
2180 // $yyendofinput; /* True if we are at the end of input */
2181 $yyerrorhit = 0; /* True if yymajor has invoked an error */
2183 /* (re)initialize the parser, if necessary */
2184 if ($this->yyidx
=== null ||
$this->yyidx
< 0) {
2185 /* if ($yymajor == 0) return; // not sure why this was here... */
2187 $this->yyerrcnt
= -1;
2188 $x = new Haanga_yyStackEntry
;
2191 $this->yystack
= array();
2192 array_push($this->yystack
, $x);
2194 $yyendofinput = ($yymajor==0);
2196 if (self
::$yyTraceFILE) {
2197 fprintf(self
::$yyTraceFILE, "%sInput %s\n",
2198 self
::$yyTracePrompt, self
::$yyTokenName[$yymajor]);
2202 $yyact = $this->yy_find_shift_action($yymajor);
2203 if ($yymajor < self
::YYERRORSYMBOL
&&
2204 !$this->yy_is_expected_token($yymajor)) {
2205 // force a syntax error
2206 $yyact = self
::YY_ERROR_ACTION
;
2208 if ($yyact < self
::YYNSTATE
) {
2209 $this->yy_shift($yyact, $yymajor, $yytokenvalue);
2211 if ($yyendofinput && $this->yyidx
>= 0) {
2214 $yymajor = self
::YYNOCODE
;
2216 } elseif ($yyact < self
::YYNSTATE + self
::YYNRULE
) {
2217 $this->yy_reduce($yyact - self
::YYNSTATE
);
2218 } elseif ($yyact == self
::YY_ERROR_ACTION
) {
2219 if (self
::$yyTraceFILE) {
2220 fprintf(self
::$yyTraceFILE, "%sSyntax Error!\n",
2221 self
::$yyTracePrompt);
2223 if (self
::YYERRORSYMBOL
) {
2224 /* A syntax error has occurred.
2225 ** The response to an error depends upon whether or not the
2226 ** grammar defines an error token "ERROR".
2228 ** This is what we do if the grammar does define ERROR:
2230 ** * Call the %syntax_error function.
2232 ** * Begin popping the stack until we enter a state where
2233 ** it is legal to shift the error symbol, then shift
2234 ** the error symbol.
2236 ** * Set the error count to three.
2238 ** * Begin accepting and shifting new tokens. No new error
2239 ** processing will occur until three tokens have been
2240 ** shifted successfully.
2243 if ($this->yyerrcnt
< 0) {
2244 $this->yy_syntax_error($yymajor, $yytokenvalue);
2246 $yymx = $this->yystack
[$this->yyidx
]->major
;
2247 if ($yymx == self
::YYERRORSYMBOL ||
$yyerrorhit ){
2248 if (self
::$yyTraceFILE) {
2249 fprintf(self
::$yyTraceFILE, "%sDiscard input token %s\n",
2250 self
::$yyTracePrompt, self
::$yyTokenName[$yymajor]);
2252 $this->yy_destructor($yymajor, $yytokenvalue);
2253 $yymajor = self
::YYNOCODE
;
2255 while ($this->yyidx
>= 0 &&
2256 $yymx != self
::YYERRORSYMBOL
&&
2257 ($yyact = $this->yy_find_shift_action(self
::YYERRORSYMBOL
)) >= self
::YYNSTATE
2259 $this->yy_pop_parser_stack();
2261 if ($this->yyidx
< 0 ||
$yymajor==0) {
2262 $this->yy_destructor($yymajor, $yytokenvalue);
2263 $this->yy_parse_failed();
2264 $yymajor = self
::YYNOCODE
;
2265 } elseif ($yymx != self
::YYERRORSYMBOL
) {
2267 $this->yy_shift($yyact, self
::YYERRORSYMBOL
, $u2);
2270 $this->yyerrcnt
= 3;
2273 /* YYERRORSYMBOL is not defined */
2274 /* This is what we do if the grammar does not define ERROR:
2276 ** * Report an error message, and throw away the input token.
2278 ** * If the input token is $, then fail the parse.
2280 ** As before, subsequent error messages are suppressed until
2281 ** three input tokens have been successfully shifted.
2283 if ($this->yyerrcnt
<= 0) {
2284 $this->yy_syntax_error($yymajor, $yytokenvalue);
2286 $this->yyerrcnt
= 3;
2287 $this->yy_destructor($yymajor, $yytokenvalue);
2288 if ($yyendofinput) {
2289 $this->yy_parse_failed();
2291 $yymajor = self
::YYNOCODE
;
2295 $yymajor = self
::YYNOCODE
;
2297 } while ($yymajor != self
::YYNOCODE
&& $this->yyidx
>= 0);