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 Haanga |
102 +---------------------------------------------------------------------------------+
103 | Redistribution and use in source and binary forms, with or without |
104 | modification, are permitted provided that the following conditions are met: |
105 | 1. Redistributions of source code must retain the above copyright |
106 | notice, this list of conditions and the following disclaimer. |
108 | 2. Redistributions in binary form must reproduce the above copyright |
109 | notice, this list of conditions and the following disclaimer in the |
110 | documentation and/or other materials provided with the distribution. |
112 | 3. All advertising materials mentioning features or use of this software |
113 | must display the following acknowledgement: |
114 | This product includes software developed by César D. Rodas. |
116 | 4. Neither the name of the César D. Rodas nor the |
117 | names of its contributors may be used to endorse or promote products |
118 | derived from this software without specific prior written permission. |
120 | THIS SOFTWARE IS PROVIDED BY CÉSAR D. RODAS ''AS IS'' AND ANY |
121 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
122 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
123 | DISCLAIMED. IN NO EVENT SHALL CÉSAR D. RODAS BE LIABLE FOR ANY |
124 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
125 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
126 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
127 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
128 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
129 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE |
130 +---------------------------------------------------------------------------------+
131 | Authors: César Rodas <crodas@php.net> |
132 +---------------------------------------------------------------------------------+
134 #line 136 "lib/Haanga/Compiler/Parser.php"
136 // declare_class is output here
137 #line 39 "lib/Haanga/Compiler/Parser.y"
138 class Haanga_Compiler_Parser
#line 141 "lib/Haanga/Compiler/Parser.php"
140 /* First off, code is included which follows the "include_class" declaration
141 ** in the input file. */
142 #line 40 "lib/Haanga/Compiler/Parser.y"
145 #line 149 "lib/Haanga/Compiler/Parser.php"
147 /* Next is all token values, as class constants
150 ** These constants (all generated automatically by the parser generator)
151 ** specify the various kinds of tokens (terminals) that the parser
154 ** Each symbol here is a terminal symbol in the grammar.
156 const T_OPEN_TAG
= 1;
172 const T_COMMENT_OPEN
= 17;
173 const T_COMMENT
= 18;
174 const T_PRINT_OPEN
= 19;
175 const T_PRINT_CLOSE
= 20;
176 const T_EXTENDS
= 21;
177 const T_CLOSE_TAG
= 22;
178 const T_INCLUDE
= 23;
179 const T_AUTOESCAPE
= 24;
182 const T_END_AUTOESCAPE
= 27;
183 const T_CUSTOM_TAG
= 28;
185 const T_CUSTOM_BLOCK
= 30;
186 const T_CUSTOM_END
= 31;
188 const T_ENDWITH
= 33;
192 const T_CLOSEFOR
= 37;
197 const T_IFCHANGED
= 42;
198 const T_ENDIFCHANGED
= 43;
199 const T_IFEQUAL
= 44;
200 const T_END_IFEQUAL
= 45;
201 const T_IFNOTEQUAL
= 46;
202 const T_END_IFNOTEQUAL
= 47;
204 const T_END_BLOCK
= 49;
205 const T_NUMERIC
= 50;
207 const T_END_FILTER
= 52;
208 const T_REGROUP
= 53;
213 const T_RPARENT
= 58;
214 const T_STRING_SINGLE_INIT
= 59;
215 const T_STRING_SINGLE_END
= 60;
216 const T_STRING_DOUBLE_INIT
= 61;
217 const T_STRING_DOUBLE_END
= 62;
218 const T_STRING_CONTENT
= 63;
219 const T_LPARENT
= 64;
223 const T_BRACKETS_OPEN
= 68;
224 const T_BRACKETS_CLOSE
= 69;
225 const YY_NO_ACTION
= 311;
226 const YY_ACCEPT_ACTION
= 310;
227 const YY_ERROR_ACTION
= 309;
229 /* Next are that tables used to determine what action to take based on the
230 ** current state and lookahead token. These tables are used to implement
231 ** functions that take a state number and lookahead value and return an
234 ** Suppose the action integer is N. Then the action is determined as
237 ** 0 <= N < self::YYNSTATE Shift N. That is,
238 ** push the lookahead
239 ** token onto the stack
242 ** self::YYNSTATE <= N < self::YYNSTATE+self::YYNRULE Reduce by rule N-YYNSTATE.
244 ** N == self::YYNSTATE+self::YYNRULE A syntax error has occurred.
246 ** N == self::YYNSTATE+self::YYNRULE+1 The parser accepts its
247 ** input. (and concludes parsing)
249 ** N == self::YYNSTATE+self::YYNRULE+2 No such action. Denotes unused
250 ** slots in the yy_action[] table.
252 ** The action table is constructed as a single large static array $yy_action.
253 ** Given state S and lookahead X, the action is computed as
255 ** self::$yy_action[self::$yy_shift_ofst[S] + X ]
257 ** If the index value self::$yy_shift_ofst[S]+X is out of range or if the value
258 ** self::$yy_lookahead[self::$yy_shift_ofst[S]+X] is not equal to X or if
259 ** self::$yy_shift_ofst[S] is equal to self::YY_SHIFT_USE_DFLT, it means that
260 ** the action is not in the table and that self::$yy_default[S] should be used instead.
262 ** The formula above is for computing the action when the lookahead is
263 ** a terminal symbol. If the lookahead is a non-terminal (as occurs after
264 ** a reduce action) then the static $yy_reduce_ofst array is used in place of
265 ** the static $yy_shift_ofst array and self::YY_REDUCE_USE_DFLT is used in place of
266 ** self::YY_SHIFT_USE_DFLT.
268 ** The following are the tables generated in this section:
270 ** self::$yy_action A single table containing all actions.
271 ** self::$yy_lookahead A table containing the lookahead for each entry in
272 ** yy_action. Used to detect hash collisions.
273 ** self::$yy_shift_ofst For each state, the offset into self::$yy_action for
274 ** shifting terminals.
275 ** self::$yy_reduce_ofst For each state, the offset into self::$yy_action for
276 ** shifting non-terminals after a reduce.
277 ** self::$yy_default Default action for each state.
279 const YY_SZ_ACTTAB
= 913;
280 static public $yy_action = array(
281 /* 0 */ 39, 121, 35, 116, 21, 21, 21, 31, 225, 149,
282 /* 10 */ 225, 76, 111, 67, 69, 111, 164, 37, 25, 186,
283 /* 20 */ 124, 32, 201, 29, 127, 30, 152, 46, 143, 36,
284 /* 30 */ 44, 39, 40, 35, 116, 12, 145, 145, 31, 71,
285 /* 40 */ 149, 77, 76, 78, 67, 69, 218, 147, 141, 25,
286 /* 50 */ 180, 131, 32, 43, 29, 81, 30, 227, 46, 75,
287 /* 60 */ 45, 44, 39, 40, 35, 116, 208, 112, 34, 31,
288 /* 70 */ 171, 149, 95, 76, 91, 67, 69, 225, 155, 225,
289 /* 80 */ 25, 162, 156, 32, 158, 29, 103, 30, 112, 46,
290 /* 90 */ 117, 171, 44, 39, 40, 35, 116, 173, 206, 136,
291 /* 100 */ 31, 111, 149, 185, 76, 45, 67, 69, 186, 125,
292 /* 110 */ 115, 25, 196, 133, 32, 218, 29, 52, 30, 134,
293 /* 120 */ 46, 111, 178, 44, 39, 40, 35, 116, 186, 229,
294 /* 130 */ 227, 31, 45, 149, 203, 76, 45, 67, 69, 174,
295 /* 140 */ 112, 33, 25, 171, 159, 32, 160, 29, 205, 30,
296 /* 150 */ 152, 46, 143, 36, 44, 39, 40, 35, 116, 118,
297 /* 160 */ 213, 119, 31, 211, 149, 176, 76, 45, 67, 69,
298 /* 170 */ 111, 197, 111, 25, 144, 153, 32, 186, 29, 186,
299 /* 180 */ 30, 112, 46, 204, 171, 44, 39, 40, 35, 116,
300 /* 190 */ 207, 211, 226, 31, 85, 149, 221, 76, 214, 67,
301 /* 200 */ 69, 212, 169, 225, 25, 225, 187, 32, 90, 29,
302 /* 210 */ 172, 30, 129, 46, 310, 59, 44, 39, 40, 35,
303 /* 220 */ 116, 209, 212, 166, 31, 168, 149, 228, 76, 92,
304 /* 230 */ 67, 69, 71, 137, 77, 25, 78, 181, 32, 157,
305 /* 240 */ 29, 218, 30, 112, 46, 199, 171, 44, 39, 40,
306 /* 250 */ 35, 116, 93, 83, 65, 31, 120, 149, 122, 76,
307 /* 260 */ 84, 67, 69, 105, 193, 225, 25, 225, 188, 32,
308 /* 270 */ 48, 29, 126, 30, 112, 46, 58, 171, 44, 39,
309 /* 280 */ 40, 35, 116, 66, 183, 50, 31, 175, 149, 114,
310 /* 290 */ 76, 150, 67, 69, 71, 151, 77, 25, 78, 45,
311 /* 300 */ 32, 138, 29, 218, 30, 112, 46, 104, 171, 44,
312 /* 310 */ 39, 40, 35, 116, 3, 108, 191, 31, 102, 149,
313 /* 320 */ 110, 76, 107, 67, 69, 106, 198, 109, 25, 180,
314 /* 330 */ 131, 32, 43, 29, 41, 30, 112, 46, 55, 171,
315 /* 340 */ 44, 39, 40, 35, 116, 51, 47, 140, 31, 177,
316 /* 350 */ 149, 57, 76, 86, 67, 69, 89, 216, 63, 25,
317 /* 360 */ 70, 182, 32, 225, 29, 225, 30, 54, 46, 210,
318 /* 370 */ 49, 44, 39, 40, 35, 116, 61, 56, 82, 31,
319 /* 380 */ 53, 149, 148, 76, 179, 67, 69, 60, 64, 152,
320 /* 390 */ 25, 143, 36, 32, 62, 29, 176, 30, 217, 46,
321 /* 400 */ 176, 218, 44, 39, 40, 35, 116, 5, 176, 176,
322 /* 410 */ 31, 176, 149, 176, 76, 176, 67, 69, 176, 176,
323 /* 420 */ 176, 25, 180, 131, 32, 43, 29, 42, 30, 176,
324 /* 430 */ 46, 123, 176, 44, 39, 40, 35, 116, 9, 176,
325 /* 440 */ 176, 31, 176, 149, 176, 76, 176, 67, 69, 176,
326 /* 450 */ 154, 176, 25, 180, 131, 32, 43, 29, 176, 30,
327 /* 460 */ 176, 46, 176, 176, 44, 39, 40, 35, 116, 176,
328 /* 470 */ 176, 176, 31, 176, 149, 176, 76, 176, 67, 69,
329 /* 480 */ 176, 176, 152, 25, 143, 36, 32, 146, 29, 176,
330 /* 490 */ 30, 176, 46, 176, 176, 44, 39, 40, 35, 116,
331 /* 500 */ 10, 176, 176, 31, 176, 149, 176, 76, 176, 67,
332 /* 510 */ 69, 176, 176, 176, 25, 180, 131, 32, 43, 29,
333 /* 520 */ 176, 30, 176, 46, 176, 176, 44, 132, 40, 39,
334 /* 530 */ 176, 35, 116, 176, 176, 176, 31, 176, 149, 176,
335 /* 540 */ 76, 176, 67, 69, 176, 176, 176, 25, 139, 176,
336 /* 550 */ 32, 176, 29, 176, 30, 225, 46, 225, 176, 44,
337 /* 560 */ 176, 40, 24, 26, 22, 22, 22, 22, 22, 22,
338 /* 570 */ 22, 23, 23, 21, 21, 21, 39, 168, 35, 116,
339 /* 580 */ 17, 176, 79, 31, 71, 149, 77, 76, 78, 67,
340 /* 590 */ 69, 20, 176, 218, 25, 180, 131, 32, 43, 29,
341 /* 600 */ 176, 30, 176, 46, 176, 176, 44, 176, 40, 24,
342 /* 610 */ 26, 22, 22, 22, 22, 22, 22, 22, 23, 23,
343 /* 620 */ 21, 21, 21, 26, 22, 22, 22, 22, 22, 22,
344 /* 630 */ 22, 23, 23, 21, 21, 21, 22, 22, 22, 22,
345 /* 640 */ 22, 22, 22, 23, 23, 21, 21, 21, 161, 176,
346 /* 650 */ 176, 128, 224, 223, 219, 220, 222, 189, 190, 192,
347 /* 660 */ 202, 6, 200, 184, 94, 167, 225, 73, 225, 225,
348 /* 670 */ 74, 225, 176, 176, 38, 88, 180, 131, 87, 43,
349 /* 680 */ 176, 225, 176, 225, 225, 176, 225, 176, 175, 38,
350 /* 690 */ 176, 175, 176, 176, 176, 71, 176, 77, 71, 78,
351 /* 700 */ 77, 176, 78, 175, 218, 176, 175, 218, 176, 142,
352 /* 710 */ 71, 176, 77, 71, 78, 77, 176, 78, 142, 218,
353 /* 720 */ 111, 176, 218, 170, 16, 97, 165, 186, 176, 111,
354 /* 730 */ 142, 176, 170, 176, 163, 165, 186, 176, 142, 180,
355 /* 740 */ 131, 111, 43, 176, 170, 176, 100, 165, 186, 111,
356 /* 750 */ 142, 176, 170, 176, 113, 165, 186, 176, 176, 142,
357 /* 760 */ 176, 111, 176, 176, 170, 176, 99, 165, 186, 176,
358 /* 770 */ 111, 142, 176, 170, 176, 101, 165, 186, 176, 142,
359 /* 780 */ 176, 176, 111, 176, 176, 170, 176, 98, 165, 186,
360 /* 790 */ 111, 142, 176, 170, 176, 176, 28, 186, 176, 142,
361 /* 800 */ 176, 142, 111, 176, 176, 170, 176, 1, 27, 186,
362 /* 810 */ 111, 11, 111, 170, 176, 170, 135, 186, 130, 186,
363 /* 820 */ 2, 176, 180, 131, 15, 43, 180, 131, 8, 43,
364 /* 830 */ 195, 176, 19, 176, 96, 180, 131, 7, 43, 180,
365 /* 840 */ 131, 18, 43, 180, 131, 72, 43, 180, 131, 13,
366 /* 850 */ 43, 194, 180, 131, 14, 43, 180, 131, 176, 43,
367 /* 860 */ 80, 176, 68, 176, 180, 131, 215, 43, 176, 180,
368 /* 870 */ 131, 4, 43, 152, 176, 143, 36, 152, 176, 143,
369 /* 880 */ 36, 152, 176, 143, 36, 176, 180, 131, 176, 43,
370 /* 890 */ 176, 176, 176, 176, 152, 176, 143, 36, 152, 176,
371 /* 900 */ 143, 36, 176, 152, 176, 143, 36, 176, 176, 152,
372 /* 910 */ 176, 143, 36,
374 static public $yy_lookahead = array(
375 /* 0 */ 21, 75, 23, 24, 13, 14, 15, 28, 28, 30,
376 /* 10 */ 30, 32, 86, 34, 35, 86, 73, 56, 39, 93,
377 /* 20 */ 41, 42, 93, 44, 45, 46, 65, 48, 67, 68,
378 /* 30 */ 51, 21, 53, 23, 24, 1, 25, 26, 28, 57,
379 /* 40 */ 30, 59, 32, 61, 34, 35, 66, 37, 38, 39,
380 /* 50 */ 16, 17, 42, 19, 44, 22, 46, 76, 48, 54,
381 /* 60 */ 55, 51, 21, 53, 23, 24, 22, 86, 87, 28,
382 /* 70 */ 89, 30, 22, 32, 22, 34, 35, 28, 76, 30,
383 /* 80 */ 39, 22, 41, 42, 43, 44, 86, 46, 86, 48,
384 /* 90 */ 75, 89, 51, 21, 53, 23, 24, 20, 22, 50,
385 /* 100 */ 28, 86, 30, 22, 32, 55, 34, 35, 93, 50,
386 /* 110 */ 75, 39, 22, 41, 42, 66, 44, 72, 46, 47,
387 /* 120 */ 48, 86, 18, 51, 21, 53, 23, 24, 93, 22,
388 /* 130 */ 76, 28, 55, 30, 22, 32, 55, 34, 35, 22,
389 /* 140 */ 86, 87, 39, 89, 41, 42, 43, 44, 22, 46,
390 /* 150 */ 65, 48, 67, 68, 51, 21, 53, 23, 24, 75,
391 /* 160 */ 60, 75, 28, 63, 30, 66, 32, 55, 34, 35,
392 /* 170 */ 86, 76, 86, 39, 40, 41, 42, 93, 44, 93,
393 /* 180 */ 46, 86, 48, 89, 89, 51, 21, 53, 23, 24,
394 /* 190 */ 62, 63, 22, 28, 22, 30, 22, 32, 60, 34,
395 /* 200 */ 35, 63, 22, 28, 39, 30, 22, 42, 22, 44,
396 /* 210 */ 66, 46, 47, 48, 71, 72, 51, 21, 53, 23,
397 /* 220 */ 24, 62, 63, 22, 28, 50, 30, 22, 32, 22,
398 /* 230 */ 34, 35, 57, 76, 59, 39, 61, 22, 42, 43,
399 /* 240 */ 44, 66, 46, 86, 48, 22, 89, 51, 21, 53,
400 /* 250 */ 23, 24, 22, 22, 72, 28, 94, 30, 94, 32,
401 /* 260 */ 22, 34, 35, 86, 76, 28, 39, 30, 22, 42,
402 /* 270 */ 72, 44, 45, 46, 86, 48, 72, 89, 51, 21,
403 /* 280 */ 53, 23, 24, 72, 22, 72, 28, 50, 30, 86,
404 /* 290 */ 32, 33, 34, 35, 57, 76, 59, 39, 61, 55,
405 /* 300 */ 42, 89, 44, 66, 46, 86, 48, 86, 89, 51,
406 /* 310 */ 21, 53, 23, 24, 1, 86, 22, 28, 86, 30,
407 /* 320 */ 86, 32, 86, 34, 35, 86, 76, 86, 39, 16,
408 /* 330 */ 17, 42, 19, 44, 10, 46, 86, 48, 49, 89,
409 /* 340 */ 51, 21, 53, 23, 24, 72, 72, 27, 28, 22,
410 /* 350 */ 30, 72, 32, 22, 34, 35, 22, 22, 72, 39,
411 /* 360 */ 36, 22, 42, 28, 44, 30, 46, 72, 48, 22,
412 /* 370 */ 72, 51, 21, 53, 23, 24, 72, 72, 22, 28,
413 /* 380 */ 72, 30, 31, 32, 58, 34, 35, 72, 72, 65,
414 /* 390 */ 39, 67, 68, 42, 72, 44, 95, 46, 69, 48,
415 /* 400 */ 95, 66, 51, 21, 53, 23, 24, 1, 95, 95,
416 /* 410 */ 28, 95, 30, 95, 32, 95, 34, 35, 95, 95,
417 /* 420 */ 95, 39, 16, 17, 42, 19, 44, 10, 46, 95,
418 /* 430 */ 48, 49, 95, 51, 21, 53, 23, 24, 1, 95,
419 /* 440 */ 95, 28, 95, 30, 95, 32, 95, 34, 35, 95,
420 /* 450 */ 37, 95, 39, 16, 17, 42, 19, 44, 95, 46,
421 /* 460 */ 95, 48, 95, 95, 51, 21, 53, 23, 24, 95,
422 /* 470 */ 95, 95, 28, 95, 30, 95, 32, 95, 34, 35,
423 /* 480 */ 95, 95, 65, 39, 67, 68, 42, 43, 44, 95,
424 /* 490 */ 46, 95, 48, 95, 95, 51, 21, 53, 23, 24,
425 /* 500 */ 1, 95, 95, 28, 95, 30, 95, 32, 95, 34,
426 /* 510 */ 35, 95, 95, 95, 39, 16, 17, 42, 19, 44,
427 /* 520 */ 95, 46, 95, 48, 95, 95, 51, 52, 53, 21,
428 /* 530 */ 95, 23, 24, 95, 95, 95, 28, 95, 30, 95,
429 /* 540 */ 32, 95, 34, 35, 95, 95, 95, 39, 40, 95,
430 /* 550 */ 42, 95, 44, 95, 46, 28, 48, 30, 95, 51,
431 /* 560 */ 95, 53, 2, 3, 4, 5, 6, 7, 8, 9,
432 /* 570 */ 10, 11, 12, 13, 14, 15, 21, 50, 23, 24,
433 /* 580 */ 1, 95, 22, 28, 57, 30, 59, 32, 61, 34,
434 /* 590 */ 35, 64, 95, 66, 39, 16, 17, 42, 19, 44,
435 /* 600 */ 95, 46, 95, 48, 95, 95, 51, 95, 53, 2,
436 /* 610 */ 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
437 /* 620 */ 13, 14, 15, 3, 4, 5, 6, 7, 8, 9,
438 /* 630 */ 10, 11, 12, 13, 14, 15, 4, 5, 6, 7,
439 /* 640 */ 8, 9, 10, 11, 12, 13, 14, 15, 74, 95,
440 /* 650 */ 95, 77, 78, 79, 80, 81, 82, 83, 84, 85,
441 /* 660 */ 22, 1, 88, 22, 90, 58, 28, 29, 30, 28,
442 /* 670 */ 29, 30, 95, 95, 36, 22, 16, 17, 22, 19,
443 /* 680 */ 95, 28, 95, 30, 28, 95, 30, 95, 50, 36,
444 /* 690 */ 95, 50, 95, 95, 95, 57, 95, 59, 57, 61,
445 /* 700 */ 59, 95, 61, 50, 66, 95, 50, 66, 95, 75,
446 /* 710 */ 57, 95, 59, 57, 61, 59, 95, 61, 75, 66,
447 /* 720 */ 86, 95, 66, 89, 1, 91, 92, 93, 95, 86,
448 /* 730 */ 75, 95, 89, 95, 91, 92, 93, 95, 75, 16,
449 /* 740 */ 17, 86, 19, 95, 89, 95, 91, 92, 93, 86,
450 /* 750 */ 75, 95, 89, 95, 91, 92, 93, 95, 95, 75,
451 /* 760 */ 95, 86, 95, 95, 89, 95, 91, 92, 93, 95,
452 /* 770 */ 86, 75, 95, 89, 95, 91, 92, 93, 95, 75,
453 /* 780 */ 95, 95, 86, 95, 95, 89, 95, 91, 92, 93,
454 /* 790 */ 86, 75, 95, 89, 95, 95, 92, 93, 95, 75,
455 /* 800 */ 95, 75, 86, 95, 95, 89, 95, 1, 92, 93,
456 /* 810 */ 86, 1, 86, 89, 95, 89, 92, 93, 92, 93,
457 /* 820 */ 1, 95, 16, 17, 1, 19, 16, 17, 1, 19,
458 /* 830 */ 22, 95, 1, 95, 22, 16, 17, 1, 19, 16,
459 /* 840 */ 17, 1, 19, 16, 17, 29, 19, 16, 17, 1,
460 /* 850 */ 19, 22, 16, 17, 1, 19, 16, 17, 95, 19,
461 /* 860 */ 22, 95, 29, 95, 16, 17, 22, 19, 95, 16,
462 /* 870 */ 17, 1, 19, 65, 95, 67, 68, 65, 95, 67,
463 /* 880 */ 68, 65, 95, 67, 68, 95, 16, 17, 95, 19,
464 /* 890 */ 95, 95, 95, 95, 65, 95, 67, 68, 65, 95,
465 /* 900 */ 67, 68, 95, 65, 95, 67, 68, 95, 95, 65,
466 /* 910 */ 95, 67, 68,
468 const YY_SHIFT_USE_DFLT
= -40;
469 const YY_SHIFT_MAX
= 160;
470 static public $yy_shift_ofst = array(
471 /* 0 */ -40, 134, 103, -21, 41, 72, 10, 475, 508, 196,
472 /* 10 */ 227, 165, 289, 382, 320, 351, 444, 258, 413, 555,
473 /* 20 */ 527, 527, 527, 527, 527, 527, 527, 175, 175, 175,
474 /* 30 */ 175, 641, 656, 638, 653, 237, 237, 237, 237, 237,
475 /* 40 */ -20, -20, -20, -20, -20, -20, 49, 313, 34, 499,
476 /* 50 */ 823, 810, 579, 723, 660, 335, 406, 827, 836, 831,
477 /* 60 */ 848, 840, 870, 437, 819, 806, 853, -18, -20, -20,
478 /* 70 */ -20, -18, -20, -20, -20, -20, -20, 100, 128, -40,
479 /* 80 */ -40, -40, -40, -40, -40, -40, -40, -40, -40, -40,
480 /* 90 */ -40, -40, -40, -40, -40, -40, -40, 607, 560, 620,
481 /* 100 */ 632, 632, 324, 844, 833, 816, 838, 829, 417, 808,
482 /* 110 */ 812, -39, 85, -9, 85, 50, 11, 77, 5, 81,
483 /* 120 */ 159, 112, 138, 59, 230, 201, 170, 205, 215, 44,
484 /* 130 */ 52, 104, 107, 231, 347, 334, 331, 329, 326, 294,
485 /* 140 */ 262, 238, 244, 144, 246, 356, 327, 339, 90, 33,
486 /* 150 */ 223, 180, 99, 186, 184, 126, 172, 174, 117, 207,
489 const YY_REDUCE_USE_DFLT
= -75;
490 const YY_REDUCE_MAX
= 96;
491 static public $yy_reduce_ofst = array(
492 /* 0 */ 143, 574, 574, 574, 574, 574, 574, 574, 574, 574,
493 /* 10 */ 574, 574, 574, 574, 574, 574, 574, 574, 574, 574,
494 /* 20 */ 634, 643, 655, 663, 675, 696, 684, 724, 726, 704,
495 /* 30 */ 716, 54, -19, 95, 95, 2, 157, 188, 250, 219,
496 /* 40 */ 84, -74, 86, 15, 35, -71, 239, -57, -57, -57,
497 /* 50 */ -57, -57, -57, -57, -57, 0, -57, -57, -57, -57,
498 /* 60 */ -57, -57, -57, -57, -57, -57, -57, 94, 203, 232,
499 /* 70 */ 229, 212, 234, 241, 236, 221, 177, 164, 162, 182,
500 /* 80 */ 198, 213, 211, 273, 304, 308, 315, 316, 322, 305,
501 /* 90 */ 279, 274, 286, 298, 295, 204, 45,
503 static public $yyExpectedTokens = array(
505 /* 1 */ array(21, 23, 24, 28, 30, 32, 34, 35, 39, 40, 41, 42, 44, 46, 48, 51, 53, ),
506 /* 2 */ array(21, 23, 24, 28, 30, 32, 34, 35, 39, 41, 42, 43, 44, 46, 48, 51, 53, ),
507 /* 3 */ array(21, 23, 24, 28, 30, 32, 34, 35, 39, 41, 42, 44, 45, 46, 48, 51, 53, ),
508 /* 4 */ array(21, 23, 24, 28, 30, 32, 34, 35, 39, 41, 42, 43, 44, 46, 48, 51, 53, ),
509 /* 5 */ array(21, 23, 24, 28, 30, 32, 34, 35, 39, 41, 42, 44, 46, 47, 48, 51, 53, ),
510 /* 6 */ array(21, 23, 24, 28, 30, 32, 34, 35, 37, 38, 39, 42, 44, 46, 48, 51, 53, ),
511 /* 7 */ array(21, 23, 24, 28, 30, 32, 34, 35, 39, 42, 44, 46, 48, 51, 52, 53, ),
512 /* 8 */ array(21, 23, 24, 28, 30, 32, 34, 35, 39, 40, 42, 44, 46, 48, 51, 53, ),
513 /* 9 */ array(21, 23, 24, 28, 30, 32, 34, 35, 39, 42, 43, 44, 46, 48, 51, 53, ),
514 /* 10 */ array(21, 23, 24, 28, 30, 32, 34, 35, 39, 42, 44, 45, 46, 48, 51, 53, ),
515 /* 11 */ array(21, 23, 24, 28, 30, 32, 34, 35, 39, 42, 44, 46, 47, 48, 51, 53, ),
516 /* 12 */ array(21, 23, 24, 28, 30, 32, 34, 35, 39, 42, 44, 46, 48, 49, 51, 53, ),
517 /* 13 */ array(21, 23, 24, 28, 30, 32, 34, 35, 39, 42, 44, 46, 48, 49, 51, 53, ),
518 /* 14 */ array(21, 23, 24, 27, 28, 30, 32, 34, 35, 39, 42, 44, 46, 48, 51, 53, ),
519 /* 15 */ array(21, 23, 24, 28, 30, 31, 32, 34, 35, 39, 42, 44, 46, 48, 51, 53, ),
520 /* 16 */ array(21, 23, 24, 28, 30, 32, 34, 35, 39, 42, 43, 44, 46, 48, 51, 53, ),
521 /* 17 */ array(21, 23, 24, 28, 30, 32, 33, 34, 35, 39, 42, 44, 46, 48, 51, 53, ),
522 /* 18 */ array(21, 23, 24, 28, 30, 32, 34, 35, 37, 39, 42, 44, 46, 48, 51, 53, ),
523 /* 19 */ array(21, 23, 24, 28, 30, 32, 34, 35, 39, 42, 44, 46, 48, 51, 53, ),
524 /* 20 */ array(28, 30, 50, 57, 59, 61, 64, 66, ),
525 /* 21 */ array(28, 30, 50, 57, 59, 61, 64, 66, ),
526 /* 22 */ array(28, 30, 50, 57, 59, 61, 64, 66, ),
527 /* 23 */ array(28, 30, 50, 57, 59, 61, 64, 66, ),
528 /* 24 */ array(28, 30, 50, 57, 59, 61, 64, 66, ),
529 /* 25 */ array(28, 30, 50, 57, 59, 61, 64, 66, ),
530 /* 26 */ array(28, 30, 50, 57, 59, 61, 64, 66, ),
531 /* 27 */ array(28, 30, 50, 57, 59, 61, 66, ),
532 /* 28 */ array(28, 30, 50, 57, 59, 61, 66, ),
533 /* 29 */ array(28, 30, 50, 57, 59, 61, 66, ),
534 /* 30 */ array(28, 30, 50, 57, 59, 61, 66, ),
535 /* 31 */ array(22, 28, 29, 30, 50, 57, 59, 61, 66, ),
536 /* 32 */ array(22, 28, 30, 50, 57, 59, 61, 66, ),
537 /* 33 */ array(22, 28, 29, 30, 36, 50, 57, 59, 61, 66, ),
538 /* 34 */ array(22, 28, 30, 36, 50, 57, 59, 61, 66, ),
539 /* 35 */ array(28, 30, 50, 57, 59, 61, 66, ),
540 /* 36 */ array(28, 30, 50, 57, 59, 61, 66, ),
541 /* 37 */ array(28, 30, 50, 57, 59, 61, 66, ),
542 /* 38 */ array(28, 30, 50, 57, 59, 61, 66, ),
543 /* 39 */ array(28, 30, 50, 57, 59, 61, 66, ),
544 /* 40 */ array(28, 30, 66, ),
545 /* 41 */ array(28, 30, 66, ),
546 /* 42 */ array(28, 30, 66, ),
547 /* 43 */ array(28, 30, 66, ),
548 /* 44 */ array(28, 30, 66, ),
549 /* 45 */ array(28, 30, 66, ),
550 /* 46 */ array(28, 30, 50, 66, ),
551 /* 47 */ array(1, 16, 17, 19, ),
552 /* 48 */ array(1, 16, 17, 19, ),
553 /* 49 */ array(1, 16, 17, 19, ),
554 /* 50 */ array(1, 16, 17, 19, ),
555 /* 51 */ array(1, 16, 17, 19, ),
556 /* 52 */ array(1, 16, 17, 19, ),
557 /* 53 */ array(1, 16, 17, 19, ),
558 /* 54 */ array(1, 16, 17, 19, ),
559 /* 55 */ array(22, 28, 30, 66, ),
560 /* 56 */ array(1, 16, 17, 19, ),
561 /* 57 */ array(1, 16, 17, 19, ),
562 /* 58 */ array(1, 16, 17, 19, ),
563 /* 59 */ array(1, 16, 17, 19, ),
564 /* 60 */ array(1, 16, 17, 19, ),
565 /* 61 */ array(1, 16, 17, 19, ),
566 /* 62 */ array(1, 16, 17, 19, ),
567 /* 63 */ array(1, 16, 17, 19, ),
568 /* 64 */ array(1, 16, 17, 19, ),
569 /* 65 */ array(1, 16, 17, 19, ),
570 /* 66 */ array(1, 16, 17, 19, ),
571 /* 67 */ array(57, 59, 61, ),
572 /* 68 */ array(28, 30, 66, ),
573 /* 69 */ array(28, 30, 66, ),
574 /* 70 */ array(28, 30, 66, ),
575 /* 71 */ array(57, 59, 61, ),
576 /* 72 */ array(28, 30, 66, ),
577 /* 73 */ array(28, 30, 66, ),
578 /* 74 */ array(28, 30, 66, ),
579 /* 75 */ array(28, 30, 66, ),
580 /* 76 */ array(28, 30, 66, ),
581 /* 77 */ array(60, 63, ),
582 /* 78 */ array(62, 63, ),
601 /* 97 */ array(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 58, ),
602 /* 98 */ array(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 22, ),
603 /* 99 */ array(3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, ),
604 /* 100 */ array(4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, ),
605 /* 101 */ array(4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, ),
606 /* 102 */ array(10, 36, 65, 67, 68, ),
607 /* 103 */ array(22, 65, 67, 68, ),
608 /* 104 */ array(29, 65, 67, 68, ),
609 /* 105 */ array(29, 65, 67, 68, ),
610 /* 106 */ array(22, 65, 67, 68, ),
611 /* 107 */ array(22, 65, 67, 68, ),
612 /* 108 */ array(10, 65, 67, 68, ),
613 /* 109 */ array(22, 65, 67, 68, ),
614 /* 110 */ array(22, 65, 67, 68, ),
615 /* 111 */ array(56, 65, 67, 68, ),
616 /* 112 */ array(65, 67, 68, ),
617 /* 113 */ array(13, 14, 15, ),
618 /* 114 */ array(65, 67, 68, ),
619 /* 115 */ array(22, 55, ),
620 /* 116 */ array(25, 26, ),
621 /* 117 */ array(20, 55, ),
622 /* 118 */ array(54, 55, ),
623 /* 119 */ array(22, 55, ),
624 /* 120 */ array(62, 63, ),
625 /* 121 */ array(22, 55, ),
626 /* 122 */ array(60, 63, ),
627 /* 123 */ array(22, 50, ),
628 /* 124 */ array(22, ),
629 /* 125 */ array(22, ),
630 /* 126 */ array(22, ),
631 /* 127 */ array(22, ),
632 /* 128 */ array(22, ),
633 /* 129 */ array(22, ),
634 /* 130 */ array(22, ),
635 /* 131 */ array(18, ),
636 /* 132 */ array(22, ),
637 /* 133 */ array(22, ),
638 /* 134 */ array(22, ),
639 /* 135 */ array(22, ),
640 /* 136 */ array(22, ),
641 /* 137 */ array(69, ),
642 /* 138 */ array(58, ),
643 /* 139 */ array(22, ),
644 /* 140 */ array(22, ),
645 /* 141 */ array(22, ),
646 /* 142 */ array(55, ),
647 /* 143 */ array(66, ),
648 /* 144 */ array(22, ),
649 /* 145 */ array(22, ),
650 /* 146 */ array(22, ),
651 /* 147 */ array(22, ),
652 /* 148 */ array(22, ),
653 /* 149 */ array(22, ),
654 /* 150 */ array(22, ),
655 /* 151 */ array(22, ),
656 /* 152 */ array(66, ),
657 /* 153 */ array(22, ),
658 /* 154 */ array(22, ),
659 /* 155 */ array(22, ),
660 /* 156 */ array(22, ),
661 /* 157 */ array(22, ),
662 /* 158 */ array(22, ),
663 /* 159 */ array(22, ),
664 /* 160 */ array(22, ),
735 static public $yy_default = array(
736 /* 0 */ 232, 309, 309, 309, 309, 309, 309, 309, 309, 309,
737 /* 10 */ 309, 309, 309, 309, 309, 309, 309, 309, 309, 309,
738 /* 20 */ 309, 309, 309, 309, 309, 309, 309, 309, 309, 309,
739 /* 30 */ 309, 309, 309, 309, 309, 309, 309, 309, 309, 309,
740 /* 40 */ 309, 309, 309, 309, 309, 309, 309, 309, 309, 309,
741 /* 50 */ 309, 309, 309, 309, 309, 309, 309, 309, 309, 230,
742 /* 60 */ 309, 309, 309, 309, 309, 309, 309, 309, 309, 309,
743 /* 70 */ 309, 309, 309, 309, 309, 309, 309, 309, 309, 232,
744 /* 80 */ 232, 232, 232, 232, 232, 232, 232, 232, 232, 232,
745 /* 90 */ 232, 232, 232, 232, 232, 232, 232, 309, 309, 297,
746 /* 100 */ 300, 298, 309, 309, 309, 309, 309, 309, 309, 309,
747 /* 110 */ 309, 280, 284, 299, 276, 309, 309, 309, 309, 309,
748 /* 120 */ 309, 309, 309, 309, 309, 309, 309, 309, 309, 309,
749 /* 130 */ 309, 309, 309, 309, 309, 309, 309, 309, 309, 309,
750 /* 140 */ 309, 309, 287, 309, 309, 309, 309, 309, 309, 309,
751 /* 150 */ 309, 309, 309, 309, 309, 309, 309, 309, 309, 309,
752 /* 160 */ 309, 233, 273, 301, 231, 303, 274, 302, 288, 237,
753 /* 170 */ 289, 286, 305, 236, 264, 285, 304, 266, 235, 290,
754 /* 180 */ 234, 238, 259, 248, 249, 258, 278, 260, 261, 245,
755 /* 190 */ 246, 262, 247, 279, 250, 252, 253, 281, 282, 254,
756 /* 200 */ 255, 277, 251, 257, 256, 244, 263, 292, 270, 294,
757 /* 210 */ 269, 296, 295, 291, 293, 272, 271, 306, 307, 241,
758 /* 220 */ 242, 265, 243, 240, 239, 308, 268, 283, 267, 275,
760 /* The next thing included is series of defines which control
761 ** various aspects of the generated parser.
762 ** self::YYNOCODE is a number which corresponds
763 ** to no legal terminal or nonterminal number. This
764 ** number is used to fill in empty slots of the hash
766 ** self::YYFALLBACK If defined, this indicates that one or more tokens
767 ** have fall-back values which should be used if the
768 ** original value of the token will not parse.
769 ** self::YYSTACKDEPTH is the maximum depth of the parser's stack.
770 ** self::YYNSTATE the combined number of states.
771 ** self::YYNRULE the number of rules in the grammar
772 ** self::YYERRORSYMBOL is the code number of the error symbol. If not
773 ** defined, then do no error processing.
776 const YYSTACKDEPTH
= 100;
777 const YYNSTATE
= 230;
779 const YYERRORSYMBOL
= 70;
780 const YYERRSYMDT
= 'yy0';
781 const YYFALLBACK
= 0;
782 /** The next table maps tokens into fallback tokens. If a construct
783 * like the following:
785 * %fallback ID X Y Z.
787 * appears in the grammer, then ID becomes a fallback token for X, Y,
788 * and Z. Whenever one of the tokens X, Y, or Z is input to the parser
789 * but it does not parse, the type of the token is changed to ID and
790 * the parse is retried before an error is thrown.
792 static public $yyFallback = array(
795 * Turn parser tracing on by giving a stream to which to write the trace
796 * and a prompt to preface each trace message. Tracing is turned off
797 * by making either argument NULL
801 * - A stream resource to which trace output should be written.
802 * If NULL, then tracing is turned off.
803 * - A prefix string written at the beginning of every
804 * line of trace output. If NULL, then tracing is
813 static function Trace($TraceFILE, $zTracePrompt)
817 } elseif (!$zTracePrompt) {
820 self
::$yyTraceFILE = $TraceFILE;
821 self
::$yyTracePrompt = $zTracePrompt;
825 * Output debug information to output (php://output stream)
827 static function PrintTrace()
829 self
::$yyTraceFILE = fopen('php://output', 'w');
830 self
::$yyTracePrompt = '';
836 static public $yyTraceFILE;
838 * String to prepend to debug output
841 static public $yyTracePrompt;
845 public $yyidx; /* Index of top element in stack */
849 public $yyerrcnt; /* Shifts left before out of the error */
853 public $yystack = array(); /* The parser's stack */
856 * For tracing shifts, the names of all terminals and nonterminals
857 * are required. The following table supplies these names
860 static public $yyTokenName = array(
861 '$', 'T_OPEN_TAG', 'T_AND', 'T_OR',
862 'T_EQ', 'T_NE', 'T_GT', 'T_GE',
863 'T_LT', 'T_LE', 'T_IN', 'T_PLUS',
864 'T_MINUS', 'T_TIMES', 'T_DIV', 'T_MOD',
865 'T_HTML', 'T_COMMENT_OPEN', 'T_COMMENT', 'T_PRINT_OPEN',
866 'T_PRINT_CLOSE', 'T_EXTENDS', 'T_CLOSE_TAG', 'T_INCLUDE',
867 'T_AUTOESCAPE', 'T_OFF', 'T_ON', 'T_END_AUTOESCAPE',
868 'T_CUSTOM_TAG', 'T_AS', 'T_CUSTOM_BLOCK', 'T_CUSTOM_END',
869 'T_WITH', 'T_ENDWITH', 'T_LOAD', 'T_FOR',
870 'T_COMMA', 'T_CLOSEFOR', 'T_EMPTY', 'T_IF',
871 'T_ENDIF', 'T_ELSE', 'T_IFCHANGED', 'T_ENDIFCHANGED',
872 'T_IFEQUAL', 'T_END_IFEQUAL', 'T_IFNOTEQUAL', 'T_END_IFNOTEQUAL',
873 'T_BLOCK', 'T_END_BLOCK', 'T_NUMERIC', 'T_FILTER',
874 'T_END_FILTER', 'T_REGROUP', 'T_BY', 'T_PIPE',
875 'T_COLON', 'T_INTL', 'T_RPARENT', 'T_STRING_SINGLE_INIT',
876 'T_STRING_SINGLE_END', 'T_STRING_DOUBLE_INIT', 'T_STRING_DOUBLE_END', 'T_STRING_CONTENT',
877 'T_LPARENT', 'T_OBJ', 'T_ALPHA', 'T_DOT',
878 'T_BRACKETS_OPEN', 'T_BRACKETS_CLOSE', 'error', 'start',
879 'body', 'code', 'stmts', 'filtered_var',
880 'var_or_string', 'stmt', 'for_stmt', 'ifchanged_stmt',
881 'block_stmt', 'filter_stmt', 'if_stmt', 'custom_tag',
882 'alias', 'ifequal', 'varname', 'var_list',
883 'regroup', 'string', 'for_def', 'expr',
884 'fvar_or_string', 'varname_args', 's_content',
888 * For tracing reduce actions, the names of all rules are required.
891 static public $yyRuleName = array(
892 /* 0 */ "start ::= body",
893 /* 1 */ "body ::= body code",
895 /* 3 */ "code ::= T_OPEN_TAG stmts",
896 /* 4 */ "code ::= T_HTML",
897 /* 5 */ "code ::= T_COMMENT_OPEN T_COMMENT",
898 /* 6 */ "code ::= T_PRINT_OPEN filtered_var T_PRINT_CLOSE",
899 /* 7 */ "stmts ::= T_EXTENDS var_or_string T_CLOSE_TAG",
900 /* 8 */ "stmts ::= stmt T_CLOSE_TAG",
901 /* 9 */ "stmts ::= for_stmt",
902 /* 10 */ "stmts ::= ifchanged_stmt",
903 /* 11 */ "stmts ::= block_stmt",
904 /* 12 */ "stmts ::= filter_stmt",
905 /* 13 */ "stmts ::= if_stmt",
906 /* 14 */ "stmts ::= T_INCLUDE var_or_string T_CLOSE_TAG",
907 /* 15 */ "stmts ::= custom_tag",
908 /* 16 */ "stmts ::= alias",
909 /* 17 */ "stmts ::= ifequal",
910 /* 18 */ "stmts ::= T_AUTOESCAPE T_OFF|T_ON T_CLOSE_TAG body T_OPEN_TAG T_END_AUTOESCAPE T_CLOSE_TAG",
911 /* 19 */ "custom_tag ::= T_CUSTOM_TAG T_CLOSE_TAG",
912 /* 20 */ "custom_tag ::= T_CUSTOM_TAG T_AS varname T_CLOSE_TAG",
913 /* 21 */ "custom_tag ::= T_CUSTOM_TAG var_list T_CLOSE_TAG",
914 /* 22 */ "custom_tag ::= T_CUSTOM_TAG var_list T_AS varname T_CLOSE_TAG",
915 /* 23 */ "custom_tag ::= T_CUSTOM_BLOCK T_CLOSE_TAG body T_OPEN_TAG T_CUSTOM_END T_CLOSE_TAG",
916 /* 24 */ "alias ::= T_WITH varname T_AS varname T_CLOSE_TAG body T_OPEN_TAG T_ENDWITH T_CLOSE_TAG",
917 /* 25 */ "stmt ::= regroup",
918 /* 26 */ "stmt ::= T_LOAD string",
919 /* 27 */ "for_def ::= T_FOR varname T_IN filtered_var T_CLOSE_TAG",
920 /* 28 */ "for_def ::= T_FOR varname T_COMMA varname T_IN filtered_var T_CLOSE_TAG",
921 /* 29 */ "for_stmt ::= for_def body T_OPEN_TAG T_CLOSEFOR T_CLOSE_TAG",
922 /* 30 */ "for_stmt ::= for_def body T_OPEN_TAG T_EMPTY T_CLOSE_TAG body T_OPEN_TAG T_CLOSEFOR T_CLOSE_TAG",
923 /* 31 */ "if_stmt ::= T_IF expr T_CLOSE_TAG body T_OPEN_TAG T_ENDIF T_CLOSE_TAG",
924 /* 32 */ "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",
925 /* 33 */ "ifchanged_stmt ::= T_IFCHANGED T_CLOSE_TAG body T_OPEN_TAG T_ENDIFCHANGED T_CLOSE_TAG",
926 /* 34 */ "ifchanged_stmt ::= T_IFCHANGED var_list T_CLOSE_TAG body T_OPEN_TAG T_ENDIFCHANGED T_CLOSE_TAG",
927 /* 35 */ "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",
928 /* 36 */ "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",
929 /* 37 */ "ifequal ::= T_IFEQUAL fvar_or_string fvar_or_string T_CLOSE_TAG body T_OPEN_TAG T_END_IFEQUAL T_CLOSE_TAG",
930 /* 38 */ "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",
931 /* 39 */ "ifequal ::= T_IFNOTEQUAL fvar_or_string fvar_or_string T_CLOSE_TAG body T_OPEN_TAG T_END_IFNOTEQUAL T_CLOSE_TAG",
932 /* 40 */ "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",
933 /* 41 */ "block_stmt ::= T_BLOCK varname T_CLOSE_TAG body T_OPEN_TAG T_END_BLOCK T_CLOSE_TAG",
934 /* 42 */ "block_stmt ::= T_BLOCK varname T_CLOSE_TAG body T_OPEN_TAG T_END_BLOCK varname T_CLOSE_TAG",
935 /* 43 */ "block_stmt ::= T_BLOCK T_NUMERIC T_CLOSE_TAG body T_OPEN_TAG T_END_BLOCK T_CLOSE_TAG",
936 /* 44 */ "block_stmt ::= T_BLOCK T_NUMERIC T_CLOSE_TAG body T_OPEN_TAG T_END_BLOCK T_NUMERIC T_CLOSE_TAG",
937 /* 45 */ "filter_stmt ::= T_FILTER filtered_var T_CLOSE_TAG body T_OPEN_TAG T_END_FILTER T_CLOSE_TAG",
938 /* 46 */ "regroup ::= T_REGROUP filtered_var T_BY varname T_AS varname",
939 /* 47 */ "filtered_var ::= filtered_var T_PIPE varname_args",
940 /* 48 */ "filtered_var ::= varname_args",
941 /* 49 */ "varname_args ::= varname T_COLON var_or_string",
942 /* 50 */ "varname_args ::= varname",
943 /* 51 */ "var_list ::= var_list var_or_string",
944 /* 52 */ "var_list ::= var_list T_COMMA var_or_string",
945 /* 53 */ "var_list ::= var_or_string",
946 /* 54 */ "var_or_string ::= varname",
947 /* 55 */ "var_or_string ::= T_NUMERIC",
948 /* 56 */ "var_or_string ::= string",
949 /* 57 */ "fvar_or_string ::= filtered_var",
950 /* 58 */ "fvar_or_string ::= T_NUMERIC",
951 /* 59 */ "fvar_or_string ::= string",
952 /* 60 */ "string ::= T_INTL string T_RPARENT",
953 /* 61 */ "string ::= T_STRING_SINGLE_INIT T_STRING_SINGLE_END",
954 /* 62 */ "string ::= T_STRING_DOUBLE_INIT T_STRING_DOUBLE_END",
955 /* 63 */ "string ::= T_STRING_SINGLE_INIT s_content T_STRING_SINGLE_END",
956 /* 64 */ "string ::= T_STRING_DOUBLE_INIT s_content T_STRING_DOUBLE_END",
957 /* 65 */ "s_content ::= s_content T_STRING_CONTENT",
958 /* 66 */ "s_content ::= T_STRING_CONTENT",
959 /* 67 */ "expr ::= expr T_AND expr",
960 /* 68 */ "expr ::= expr T_OR expr",
961 /* 69 */ "expr ::= expr T_PLUS|T_MINUS expr",
962 /* 70 */ "expr ::= expr T_EQ|T_NE|T_GT|T_GE|T_LT|T_LE|T_IN expr",
963 /* 71 */ "expr ::= expr T_TIMES|T_DIV|T_MOD expr",
964 /* 72 */ "expr ::= T_LPARENT expr T_RPARENT",
965 /* 73 */ "expr ::= fvar_or_string",
966 /* 74 */ "varname ::= varname T_OBJ T_ALPHA",
967 /* 75 */ "varname ::= varname T_DOT T_ALPHA",
968 /* 76 */ "varname ::= varname T_BRACKETS_OPEN var_or_string T_BRACKETS_CLOSE",
969 /* 77 */ "varname ::= T_ALPHA",
970 /* 78 */ "varname ::= T_CUSTOM_TAG|T_CUSTOM_BLOCK",
974 * This function returns the symbolic name associated with a token
979 function tokenName($tokenType)
981 if ($tokenType === 0) {
982 return 'End of Input';
984 if ($tokenType > 0 && $tokenType < count(self
::$yyTokenName)) {
985 return self
::$yyTokenName[$tokenType];
992 * The following function deletes the value associated with a
993 * symbol. The symbol can be either a terminal or nonterminal.
994 * @param int the symbol code
995 * @param mixed the symbol's value
997 static function yy_destructor($yymajor, $yypminor)
1000 /* Here is inserted the actions which take place when a
1001 ** terminal or non-terminal is destroyed. This can happen
1002 ** when the symbol is popped from the stack during a
1003 ** reduce or during error processing or when a parser is
1004 ** being destroyed before it is finished parsing.
1006 ** Note: during a reduce, the only symbols destroyed are those
1007 ** which appear on the RHS of the rule, but which are not used
1008 ** inside the C code.
1010 default: break; /* If no destructor action specified: do nothing */
1015 * Pop the parser's stack once.
1017 * If there is a destructor routine associated with the token which
1018 * is popped from the stack, then call it.
1020 * Return the major token number for the symbol popped.
1021 * @param Haanga_yyParser
1024 function yy_pop_parser_stack()
1026 if (!count($this->yystack
)) {
1029 $yytos = array_pop($this->yystack
);
1030 if (self
::$yyTraceFILE && $this->yyidx
>= 0) {
1031 fwrite(self
::$yyTraceFILE,
1032 self
::$yyTracePrompt . 'Popping ' . self
::$yyTokenName[$yytos->major
] .
1035 $yymajor = $yytos->major
;
1036 self
::yy_destructor($yymajor, $yytos->minor
);
1042 * Deallocate and destroy a parser. Destructors are all called for
1043 * all stack elements before shutting the parser down.
1045 function __destruct()
1047 while ($this->yyidx
>= 0) {
1048 $this->yy_pop_parser_stack();
1050 if (is_resource(self
::$yyTraceFILE)) {
1051 fclose(self
::$yyTraceFILE);
1056 * Based on the current state and parser stack, get a list of all
1057 * possible lookahead tokens
1061 function yy_get_expected_tokens($token)
1063 $state = $this->yystack
[$this->yyidx
]->stateno
;
1064 $expected = self
::$yyExpectedTokens[$state];
1065 if (in_array($token, self
::$yyExpectedTokens[$state], true)) {
1068 $stack = $this->yystack
;
1069 $yyidx = $this->yyidx
;
1071 $yyact = $this->yy_find_shift_action($token);
1072 if ($yyact >= self
::YYNSTATE
&& $yyact < self
::YYNSTATE + self
::YYNRULE
) {
1076 if ($done++
== 100) {
1077 $this->yyidx
= $yyidx;
1078 $this->yystack
= $stack;
1079 // too much recursion prevents proper detection
1081 return array_unique($expected);
1083 $yyruleno = $yyact - self
::YYNSTATE
;
1084 $this->yyidx
-= self
::$yyRuleInfo[$yyruleno]['rhs'];
1085 $nextstate = $this->yy_find_reduce_action(
1086 $this->yystack
[$this->yyidx
]->stateno
,
1087 self
::$yyRuleInfo[$yyruleno]['lhs']);
1088 if (isset(self
::$yyExpectedTokens[$nextstate])) {
1089 $expected +
= self
::$yyExpectedTokens[$nextstate];
1090 if (in_array($token,
1091 self
::$yyExpectedTokens[$nextstate], true)) {
1092 $this->yyidx
= $yyidx;
1093 $this->yystack
= $stack;
1094 return array_unique($expected);
1097 if ($nextstate < self
::YYNSTATE
) {
1098 // we need to shift a non-terminal
1100 $x = new Haanga_yyStackEntry
;
1101 $x->stateno
= $nextstate;
1102 $x->major
= self
::$yyRuleInfo[$yyruleno]['lhs'];
1103 $this->yystack
[$this->yyidx
] = $x;
1105 } elseif ($nextstate == self
::YYNSTATE + self
::YYNRULE +
1) {
1106 $this->yyidx
= $yyidx;
1107 $this->yystack
= $stack;
1108 // the last token was just ignored, we can't accept
1109 // by ignoring input, this is in essence ignoring a
1111 return array_unique($expected);
1112 } elseif ($nextstate === self
::YY_NO_ACTION
) {
1113 $this->yyidx
= $yyidx;
1114 $this->yystack
= $stack;
1115 // input accepted, but not shifted (I guess)
1118 $yyact = $nextstate;
1124 return array_unique($expected);
1128 * Based on the parser state and current parser stack, determine whether
1129 * the lookahead token is possible.
1131 * The parser will convert the token value to an error token if not. This
1132 * catches some unusual edge cases where the parser would fail.
1136 function yy_is_expected_token($token)
1139 return true; // 0 is not part of this
1141 $state = $this->yystack
[$this->yyidx
]->stateno
;
1142 if (in_array($token, self
::$yyExpectedTokens[$state], true)) {
1145 $stack = $this->yystack
;
1146 $yyidx = $this->yyidx
;
1148 $yyact = $this->yy_find_shift_action($token);
1149 if ($yyact >= self
::YYNSTATE
&& $yyact < self
::YYNSTATE + self
::YYNRULE
) {
1153 if ($done++
== 100) {
1154 $this->yyidx
= $yyidx;
1155 $this->yystack
= $stack;
1156 // too much recursion prevents proper detection
1160 $yyruleno = $yyact - self
::YYNSTATE
;
1161 $this->yyidx
-= self
::$yyRuleInfo[$yyruleno]['rhs'];
1162 $nextstate = $this->yy_find_reduce_action(
1163 $this->yystack
[$this->yyidx
]->stateno
,
1164 self
::$yyRuleInfo[$yyruleno]['lhs']);
1165 if (isset(self
::$yyExpectedTokens[$nextstate]) &&
1166 in_array($token, self
::$yyExpectedTokens[$nextstate], true)) {
1167 $this->yyidx
= $yyidx;
1168 $this->yystack
= $stack;
1171 if ($nextstate < self
::YYNSTATE
) {
1172 // we need to shift a non-terminal
1174 $x = new Haanga_yyStackEntry
;
1175 $x->stateno
= $nextstate;
1176 $x->major
= self
::$yyRuleInfo[$yyruleno]['lhs'];
1177 $this->yystack
[$this->yyidx
] = $x;
1179 } elseif ($nextstate == self
::YYNSTATE + self
::YYNRULE +
1) {
1180 $this->yyidx
= $yyidx;
1181 $this->yystack
= $stack;
1183 // end of input: this is valid
1186 // the last token was just ignored, we can't accept
1187 // by ignoring input, this is in essence ignoring a
1190 } elseif ($nextstate === self
::YY_NO_ACTION
) {
1191 $this->yyidx
= $yyidx;
1192 $this->yystack
= $stack;
1193 // input accepted, but not shifted (I guess)
1196 $yyact = $nextstate;
1202 $this->yyidx
= $yyidx;
1203 $this->yystack
= $stack;
1208 * Find the appropriate action for a parser given the terminal
1209 * look-ahead token iLookAhead.
1211 * If the look-ahead token is YYNOCODE, then check to see if the action is
1212 * independent of the look-ahead. If it is, return the action, otherwise
1213 * return YY_NO_ACTION.
1214 * @param int The look-ahead token
1216 function yy_find_shift_action($iLookAhead)
1218 $stateno = $this->yystack
[$this->yyidx
]->stateno
;
1220 /* if ($this->yyidx < 0) return self::YY_NO_ACTION; */
1221 if (!isset(self
::$yy_shift_ofst[$stateno])) {
1223 return self
::$yy_default[$stateno];
1225 $i = self
::$yy_shift_ofst[$stateno];
1226 if ($i === self
::YY_SHIFT_USE_DFLT
) {
1227 return self
::$yy_default[$stateno];
1229 if ($iLookAhead == self
::YYNOCODE
) {
1230 return self
::YY_NO_ACTION
;
1233 if ($i < 0 ||
$i >= self
::YY_SZ_ACTTAB ||
1234 self
::$yy_lookahead[$i] != $iLookAhead) {
1235 if (count(self
::$yyFallback) && $iLookAhead < count(self
::$yyFallback)
1236 && ($iFallback = self
::$yyFallback[$iLookAhead]) != 0) {
1237 if (self
::$yyTraceFILE) {
1238 fwrite(self
::$yyTraceFILE, self
::$yyTracePrompt . "FALLBACK " .
1239 self
::$yyTokenName[$iLookAhead] . " => " .
1240 self
::$yyTokenName[$iFallback] . "\n");
1242 return $this->yy_find_shift_action($iFallback);
1244 return self
::$yy_default[$stateno];
1246 return self
::$yy_action[$i];
1251 * Find the appropriate action for a parser given the non-terminal
1252 * look-ahead token $iLookAhead.
1254 * If the look-ahead token is self::YYNOCODE, then check to see if the action is
1255 * independent of the look-ahead. If it is, return the action, otherwise
1256 * return self::YY_NO_ACTION.
1257 * @param int Current state number
1258 * @param int The look-ahead token
1260 function yy_find_reduce_action($stateno, $iLookAhead)
1262 /* $stateno = $this->yystack[$this->yyidx]->stateno; */
1264 if (!isset(self
::$yy_reduce_ofst[$stateno])) {
1265 return self
::$yy_default[$stateno];
1267 $i = self
::$yy_reduce_ofst[$stateno];
1268 if ($i == self
::YY_REDUCE_USE_DFLT
) {
1269 return self
::$yy_default[$stateno];
1271 if ($iLookAhead == self
::YYNOCODE
) {
1272 return self
::YY_NO_ACTION
;
1275 if ($i < 0 ||
$i >= self
::YY_SZ_ACTTAB ||
1276 self
::$yy_lookahead[$i] != $iLookAhead) {
1277 return self
::$yy_default[$stateno];
1279 return self
::$yy_action[$i];
1284 * Perform a shift action.
1285 * @param int The new state to shift in
1286 * @param int The major token to shift in
1287 * @param mixed the minor token to shift in
1289 function yy_shift($yyNewState, $yyMajor, $yypMinor)
1292 if ($this->yyidx
>= self
::YYSTACKDEPTH
) {
1294 if (self
::$yyTraceFILE) {
1295 fprintf(self
::$yyTraceFILE, "%sStack Overflow!\n", self
::$yyTracePrompt);
1297 while ($this->yyidx
>= 0) {
1298 $this->yy_pop_parser_stack();
1300 /* Here code is inserted which will execute if the parser
1301 ** stack ever overflows */
1304 $yytos = new Haanga_yyStackEntry
;
1305 $yytos->stateno
= $yyNewState;
1306 $yytos->major
= $yyMajor;
1307 $yytos->minor
= $yypMinor;
1308 array_push($this->yystack
, $yytos);
1309 if (self
::$yyTraceFILE && $this->yyidx
> 0) {
1310 fprintf(self
::$yyTraceFILE, "%sShift %d\n", self
::$yyTracePrompt,
1312 fprintf(self
::$yyTraceFILE, "%sStack:", self
::$yyTracePrompt);
1313 for($i = 1; $i <= $this->yyidx
; $i++
) {
1314 fprintf(self
::$yyTraceFILE, " %s",
1315 self
::$yyTokenName[$this->yystack
[$i]->major
]);
1317 fwrite(self
::$yyTraceFILE,"\n");
1322 * The following table contains information about every rule that
1323 * is used during the reduce.
1328 * int $lhs; Symbol on the left-hand side of the rule
1329 * int $nrhs; Number of right-hand side symbols in the rule
1334 static public $yyRuleInfo = array(
1335 array( 'lhs' => 71, 'rhs' => 1 ),
1336 array( 'lhs' => 72, 'rhs' => 2 ),
1337 array( 'lhs' => 72, 'rhs' => 0 ),
1338 array( 'lhs' => 73, 'rhs' => 2 ),
1339 array( 'lhs' => 73, 'rhs' => 1 ),
1340 array( 'lhs' => 73, 'rhs' => 2 ),
1341 array( 'lhs' => 73, 'rhs' => 3 ),
1342 array( 'lhs' => 74, 'rhs' => 3 ),
1343 array( 'lhs' => 74, 'rhs' => 2 ),
1344 array( 'lhs' => 74, 'rhs' => 1 ),
1345 array( 'lhs' => 74, 'rhs' => 1 ),
1346 array( 'lhs' => 74, 'rhs' => 1 ),
1347 array( 'lhs' => 74, 'rhs' => 1 ),
1348 array( 'lhs' => 74, 'rhs' => 1 ),
1349 array( 'lhs' => 74, 'rhs' => 3 ),
1350 array( 'lhs' => 74, 'rhs' => 1 ),
1351 array( 'lhs' => 74, 'rhs' => 1 ),
1352 array( 'lhs' => 74, 'rhs' => 1 ),
1353 array( 'lhs' => 74, 'rhs' => 7 ),
1354 array( 'lhs' => 83, 'rhs' => 2 ),
1355 array( 'lhs' => 83, 'rhs' => 4 ),
1356 array( 'lhs' => 83, 'rhs' => 3 ),
1357 array( 'lhs' => 83, 'rhs' => 5 ),
1358 array( 'lhs' => 83, 'rhs' => 6 ),
1359 array( 'lhs' => 84, 'rhs' => 9 ),
1360 array( 'lhs' => 77, 'rhs' => 1 ),
1361 array( 'lhs' => 77, 'rhs' => 2 ),
1362 array( 'lhs' => 90, 'rhs' => 5 ),
1363 array( 'lhs' => 90, 'rhs' => 7 ),
1364 array( 'lhs' => 78, 'rhs' => 5 ),
1365 array( 'lhs' => 78, 'rhs' => 9 ),
1366 array( 'lhs' => 82, 'rhs' => 7 ),
1367 array( 'lhs' => 82, 'rhs' => 11 ),
1368 array( 'lhs' => 79, 'rhs' => 6 ),
1369 array( 'lhs' => 79, 'rhs' => 7 ),
1370 array( 'lhs' => 79, 'rhs' => 10 ),
1371 array( 'lhs' => 79, 'rhs' => 11 ),
1372 array( 'lhs' => 85, 'rhs' => 8 ),
1373 array( 'lhs' => 85, 'rhs' => 12 ),
1374 array( 'lhs' => 85, 'rhs' => 8 ),
1375 array( 'lhs' => 85, 'rhs' => 12 ),
1376 array( 'lhs' => 80, 'rhs' => 7 ),
1377 array( 'lhs' => 80, 'rhs' => 8 ),
1378 array( 'lhs' => 80, 'rhs' => 7 ),
1379 array( 'lhs' => 80, 'rhs' => 8 ),
1380 array( 'lhs' => 81, 'rhs' => 7 ),
1381 array( 'lhs' => 88, 'rhs' => 6 ),
1382 array( 'lhs' => 75, 'rhs' => 3 ),
1383 array( 'lhs' => 75, 'rhs' => 1 ),
1384 array( 'lhs' => 93, 'rhs' => 3 ),
1385 array( 'lhs' => 93, 'rhs' => 1 ),
1386 array( 'lhs' => 87, 'rhs' => 2 ),
1387 array( 'lhs' => 87, 'rhs' => 3 ),
1388 array( 'lhs' => 87, 'rhs' => 1 ),
1389 array( 'lhs' => 76, 'rhs' => 1 ),
1390 array( 'lhs' => 76, 'rhs' => 1 ),
1391 array( 'lhs' => 76, 'rhs' => 1 ),
1392 array( 'lhs' => 92, 'rhs' => 1 ),
1393 array( 'lhs' => 92, 'rhs' => 1 ),
1394 array( 'lhs' => 92, 'rhs' => 1 ),
1395 array( 'lhs' => 89, 'rhs' => 3 ),
1396 array( 'lhs' => 89, 'rhs' => 2 ),
1397 array( 'lhs' => 89, 'rhs' => 2 ),
1398 array( 'lhs' => 89, 'rhs' => 3 ),
1399 array( 'lhs' => 89, 'rhs' => 3 ),
1400 array( 'lhs' => 94, 'rhs' => 2 ),
1401 array( 'lhs' => 94, 'rhs' => 1 ),
1402 array( 'lhs' => 91, 'rhs' => 3 ),
1403 array( 'lhs' => 91, 'rhs' => 3 ),
1404 array( 'lhs' => 91, 'rhs' => 3 ),
1405 array( 'lhs' => 91, 'rhs' => 3 ),
1406 array( 'lhs' => 91, 'rhs' => 3 ),
1407 array( 'lhs' => 91, 'rhs' => 3 ),
1408 array( 'lhs' => 91, 'rhs' => 1 ),
1409 array( 'lhs' => 86, 'rhs' => 3 ),
1410 array( 'lhs' => 86, 'rhs' => 3 ),
1411 array( 'lhs' => 86, 'rhs' => 4 ),
1412 array( 'lhs' => 86, 'rhs' => 1 ),
1413 array( 'lhs' => 86, 'rhs' => 1 ),
1417 * The following table contains a mapping of reduce action to method name
1418 * that handles the reduction.
1420 * If a rule is not set, it has no handler.
1422 static public $yyReduceMap = array(
1503 /* Beginning here are the reduction cases. A typical example
1505 ** #line <lineno> <grammarfile>
1506 ** function yy_r0($yymsp){ ... } // User supplied code
1507 ** #line <lineno> <thisfile>
1509 #line 65 "lib/Haanga/Compiler/Parser.y"
1510 function yy_r0(){ $this->body
= $this->yystack
[$this->yyidx +
0]->minor
; }
1511 #line 1517 "lib/Haanga/Compiler/Parser.php"
1512 #line 67 "lib/Haanga/Compiler/Parser.y"
1513 function yy_r1(){ $this->_retvalue
=$this->yystack
[$this->yyidx +
-1]->minor
; $this->_retvalue
[] = $this->yystack
[$this->yyidx +
0]->minor
; }
1514 #line 1520 "lib/Haanga/Compiler/Parser.php"
1515 #line 68 "lib/Haanga/Compiler/Parser.y"
1516 function yy_r2(){ $this->_retvalue
= array(); }
1517 #line 1523 "lib/Haanga/Compiler/Parser.php"
1518 #line 71 "lib/Haanga/Compiler/Parser.y"
1519 function yy_r3(){ $this->_retvalue
= $this->yystack
[$this->yyidx +
0]->minor
; }
1520 #line 1526 "lib/Haanga/Compiler/Parser.php"
1521 #line 72 "lib/Haanga/Compiler/Parser.y"
1522 function yy_r4(){ $this->_retvalue
= array('operation' => 'html', 'html' => $this->yystack
[$this->yyidx +
0]->minor
); }
1523 #line 1529 "lib/Haanga/Compiler/Parser.php"
1524 #line 73 "lib/Haanga/Compiler/Parser.y"
1525 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)); }
1526 #line 1532 "lib/Haanga/Compiler/Parser.php"
1527 #line 74 "lib/Haanga/Compiler/Parser.y"
1528 function yy_r6(){ $this->_retvalue
= array('operation' => 'print_var', 'variable' => $this->yystack
[$this->yyidx +
-1]->minor
); }
1529 #line 1535 "lib/Haanga/Compiler/Parser.php"
1530 #line 76 "lib/Haanga/Compiler/Parser.y"
1531 function yy_r7(){ $this->_retvalue
= array('operation' => 'base', $this->yystack
[$this->yyidx +
-1]->minor
); }
1532 #line 1538 "lib/Haanga/Compiler/Parser.php"
1533 #line 77 "lib/Haanga/Compiler/Parser.y"
1534 function yy_r8(){ $this->_retvalue
= $this->yystack
[$this->yyidx +
-1]->minor
; }
1535 #line 1541 "lib/Haanga/Compiler/Parser.php"
1536 #line 83 "lib/Haanga/Compiler/Parser.y"
1537 function yy_r14(){ $this->_retvalue
= array('operation' => 'include', $this->yystack
[$this->yyidx +
-1]->minor
); }
1538 #line 1544 "lib/Haanga/Compiler/Parser.php"
1539 #line 87 "lib/Haanga/Compiler/Parser.y"
1540 function yy_r18(){ $this->_retvalue
= array('operation' => 'autoescape', 'value' => strtolower(@$this->yystack
[$this->yyidx +
-5]->minor
), 'body' => $this->yystack
[$this->yyidx +
-3]->minor
); }
1541 #line 1547 "lib/Haanga/Compiler/Parser.php"
1542 #line 92 "lib/Haanga/Compiler/Parser.y"
1543 function yy_r19(){ $this->_retvalue
= array('operation' => 'custom_tag', 'name' => $this->yystack
[$this->yyidx +
-1]->minor
, 'list'=>array()); }
1544 #line 1550 "lib/Haanga/Compiler/Parser.php"
1545 #line 93 "lib/Haanga/Compiler/Parser.y"
1546 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()); }
1547 #line 1553 "lib/Haanga/Compiler/Parser.php"
1548 #line 94 "lib/Haanga/Compiler/Parser.y"
1549 function yy_r21(){ $this->_retvalue
= array('operation' => 'custom_tag', 'name' => $this->yystack
[$this->yyidx +
-2]->minor
, 'list' => $this->yystack
[$this->yyidx +
-1]->minor
); }
1550 #line 1556 "lib/Haanga/Compiler/Parser.php"
1551 #line 95 "lib/Haanga/Compiler/Parser.y"
1552 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
); }
1553 #line 1559 "lib/Haanga/Compiler/Parser.php"
1554 #line 97 "lib/Haanga/Compiler/Parser.y"
1555 function yy_r23(){ if ('end'.$this->yystack
[$this->yyidx +
-5]->minor
!= $this->yystack
[$this->yyidx +
-1]->minor
) { throw new Exception("Unexpected ".$this->yystack
[$this->yyidx +
-1]->minor
); } $this->_retvalue
= array('operation' => 'custom_tag', 'name' => $this->yystack
[$this->yyidx +
-5]->minor
, 'body' => $this->yystack
[$this->yyidx +
-3]->minor
, 'list' => array()); }
1556 #line 1562 "lib/Haanga/Compiler/Parser.php"
1557 #line 100 "lib/Haanga/Compiler/Parser.y"
1558 function yy_r24(){ $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
); }
1559 #line 1565 "lib/Haanga/Compiler/Parser.php"
1560 #line 104 "lib/Haanga/Compiler/Parser.y"
1562 if (!is_file($this->yystack
[$this->yyidx +
0]->minor
)) {
1563 throw new Haanga_Compiler_Exception($this->yystack
[$this->yyidx +
0]->minor
." is not a valid file");
1565 require_once $this->yystack
[$this->yyidx +
0]->minor
;
1567 #line 1573 "lib/Haanga/Compiler/Parser.php"
1568 #line 112 "lib/Haanga/Compiler/Parser.y"
1570 $this->compiler
->set_context($this->yystack
[$this->yyidx +
-3]->minor
, array());
1571 $this->_retvalue
= array('operation' => 'loop', 'variable' => $this->yystack
[$this->yyidx +
-3]->minor
, 'index' => NULL, 'array' => $this->yystack
[$this->yyidx +
-1]->minor
);
1573 #line 1579 "lib/Haanga/Compiler/Parser.php"
1574 #line 117 "lib/Haanga/Compiler/Parser.y"
1576 $this->compiler
->set_context($this->yystack
[$this->yyidx +
-3]->minor
, array());
1577 $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
);
1579 #line 1585 "lib/Haanga/Compiler/Parser.php"
1580 #line 123 "lib/Haanga/Compiler/Parser.y"
1582 $this->_retvalue
= $this->yystack
[$this->yyidx +
-4]->minor
;
1583 $this->_retvalue
['body'] = $this->yystack
[$this->yyidx +
-3]->minor
;
1585 #line 1591 "lib/Haanga/Compiler/Parser.php"
1586 #line 128 "lib/Haanga/Compiler/Parser.y"
1588 $this->_retvalue
= $this->yystack
[$this->yyidx +
-8]->minor
;
1589 $this->_retvalue
['body'] = $this->yystack
[$this->yyidx +
-7]->minor
;
1590 $this->_retvalue
['empty'] = $this->yystack
[$this->yyidx +
-3]->minor
;
1592 #line 1598 "lib/Haanga/Compiler/Parser.php"
1593 #line 134 "lib/Haanga/Compiler/Parser.y"
1594 function yy_r31(){ $this->_retvalue
= array('operation' => 'if', 'expr' => $this->yystack
[$this->yyidx +
-5]->minor
, 'body' => $this->yystack
[$this->yyidx +
-3]->minor
); }
1595 #line 1601 "lib/Haanga/Compiler/Parser.php"
1596 #line 135 "lib/Haanga/Compiler/Parser.y"
1597 function yy_r32(){ $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
); }
1598 #line 1604 "lib/Haanga/Compiler/Parser.php"
1599 #line 138 "lib/Haanga/Compiler/Parser.y"
1601 $this->_retvalue
= array('operation' => 'ifchanged', 'body' => $this->yystack
[$this->yyidx +
-3]->minor
);
1603 #line 1609 "lib/Haanga/Compiler/Parser.php"
1604 #line 142 "lib/Haanga/Compiler/Parser.y"
1606 $this->_retvalue
= array('operation' => 'ifchanged', 'body' => $this->yystack
[$this->yyidx +
-3]->minor
, 'check' => $this->yystack
[$this->yyidx +
-5]->minor
);
1608 #line 1614 "lib/Haanga/Compiler/Parser.php"
1609 #line 145 "lib/Haanga/Compiler/Parser.y"
1611 $this->_retvalue
= array('operation' => 'ifchanged', 'body' => $this->yystack
[$this->yyidx +
-7]->minor
, 'else' => $this->yystack
[$this->yyidx +
-3]->minor
);
1613 #line 1619 "lib/Haanga/Compiler/Parser.php"
1614 #line 149 "lib/Haanga/Compiler/Parser.y"
1616 $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
);
1618 #line 1624 "lib/Haanga/Compiler/Parser.php"
1619 #line 154 "lib/Haanga/Compiler/Parser.y"
1620 function yy_r37(){ $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
); }
1621 #line 1627 "lib/Haanga/Compiler/Parser.php"
1622 #line 155 "lib/Haanga/Compiler/Parser.y"
1623 function yy_r38(){ $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
); }
1624 #line 1630 "lib/Haanga/Compiler/Parser.php"
1625 #line 156 "lib/Haanga/Compiler/Parser.y"
1626 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
); }
1627 #line 1633 "lib/Haanga/Compiler/Parser.php"
1628 #line 157 "lib/Haanga/Compiler/Parser.y"
1629 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
); }
1630 #line 1636 "lib/Haanga/Compiler/Parser.php"
1631 #line 161 "lib/Haanga/Compiler/Parser.y"
1632 function yy_r41(){ $this->_retvalue
= array('operation' => 'block', 'name' => $this->yystack
[$this->yyidx +
-5]->minor
, 'body' => $this->yystack
[$this->yyidx +
-3]->minor
); }
1633 #line 1639 "lib/Haanga/Compiler/Parser.php"
1634 #line 163 "lib/Haanga/Compiler/Parser.y"
1635 function yy_r42(){ $this->_retvalue
= array('operation' => 'block', 'name' => $this->yystack
[$this->yyidx +
-6]->minor
, 'body' => $this->yystack
[$this->yyidx +
-4]->minor
); }
1636 #line 1642 "lib/Haanga/Compiler/Parser.php"
1637 #line 170 "lib/Haanga/Compiler/Parser.y"
1638 function yy_r45(){ $this->_retvalue
= array('operation' => 'filter', 'functions' => $this->yystack
[$this->yyidx +
-5]->minor
, 'body' => $this->yystack
[$this->yyidx +
-3]->minor
); }
1639 #line 1645 "lib/Haanga/Compiler/Parser.php"
1640 #line 173 "lib/Haanga/Compiler/Parser.y"
1641 function yy_r46(){ $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
); }
1642 #line 1648 "lib/Haanga/Compiler/Parser.php"
1643 #line 176 "lib/Haanga/Compiler/Parser.y"
1644 function yy_r47(){ $this->_retvalue
= $this->yystack
[$this->yyidx +
-2]->minor
; $this->_retvalue
[] = $this->yystack
[$this->yyidx +
0]->minor
; }
1645 #line 1651 "lib/Haanga/Compiler/Parser.php"
1646 #line 177 "lib/Haanga/Compiler/Parser.y"
1647 function yy_r48(){ $this->_retvalue
= array($this->yystack
[$this->yyidx +
0]->minor
); }
1648 #line 1654 "lib/Haanga/Compiler/Parser.php"
1649 #line 179 "lib/Haanga/Compiler/Parser.y"
1650 function yy_r49(){ $this->_retvalue
= array($this->yystack
[$this->yyidx +
-2]->minor
, 'args'=>array($this->yystack
[$this->yyidx +
0]->minor
)); }
1651 #line 1657 "lib/Haanga/Compiler/Parser.php"
1652 #line 183 "lib/Haanga/Compiler/Parser.y"
1653 function yy_r51(){ $this->_retvalue
= $this->yystack
[$this->yyidx +
-1]->minor
; $this->_retvalue
[] = $this->yystack
[$this->yyidx +
0]->minor
; }
1654 #line 1660 "lib/Haanga/Compiler/Parser.php"
1655 #line 189 "lib/Haanga/Compiler/Parser.y"
1656 function yy_r54(){ $this->_retvalue
= array('var' => $this->yystack
[$this->yyidx +
0]->minor
); }
1657 #line 1663 "lib/Haanga/Compiler/Parser.php"
1658 #line 190 "lib/Haanga/Compiler/Parser.y"
1659 function yy_r55(){ $this->_retvalue
= array('number' => $this->yystack
[$this->yyidx +
0]->minor
); }
1660 #line 1666 "lib/Haanga/Compiler/Parser.php"
1661 #line 191 "lib/Haanga/Compiler/Parser.y"
1662 function yy_r56(){ $this->_retvalue
= array('string' => $this->yystack
[$this->yyidx +
0]->minor
); }
1663 #line 1669 "lib/Haanga/Compiler/Parser.php"
1664 #line 193 "lib/Haanga/Compiler/Parser.y"
1665 function yy_r57(){ $this->_retvalue
= array('var_filter' => $this->yystack
[$this->yyidx +
0]->minor
); }
1666 #line 1672 "lib/Haanga/Compiler/Parser.php"
1667 #line 199 "lib/Haanga/Compiler/Parser.y"
1668 function yy_r61(){ $this->_retvalue
= ""; }
1669 #line 1675 "lib/Haanga/Compiler/Parser.php"
1670 #line 201 "lib/Haanga/Compiler/Parser.y"
1671 function yy_r63(){ $this->_retvalue
= $this->yystack
[$this->yyidx +
-1]->minor
; }
1672 #line 1678 "lib/Haanga/Compiler/Parser.php"
1673 #line 203 "lib/Haanga/Compiler/Parser.y"
1674 function yy_r65(){ $this->_retvalue
= $this->yystack
[$this->yyidx +
-1]->minor
.$this->yystack
[$this->yyidx +
0]->minor
; }
1675 #line 1681 "lib/Haanga/Compiler/Parser.php"
1676 #line 207 "lib/Haanga/Compiler/Parser.y"
1677 function yy_r67(){ $this->_retvalue
= array('op_expr' => @$this->yystack
[$this->yyidx +
-1]->minor
, $this->yystack
[$this->yyidx +
-2]->minor
, $this->yystack
[$this->yyidx +
0]->minor
); }
1678 #line 1684 "lib/Haanga/Compiler/Parser.php"
1679 #line 210 "lib/Haanga/Compiler/Parser.y"
1680 function yy_r70(){ $this->_retvalue
= array('op_expr' => trim(@$this->yystack
[$this->yyidx +
-1]->minor
), $this->yystack
[$this->yyidx +
-2]->minor
, $this->yystack
[$this->yyidx +
0]->minor
); }
1681 #line 1687 "lib/Haanga/Compiler/Parser.php"
1682 #line 212 "lib/Haanga/Compiler/Parser.y"
1683 function yy_r72(){ $this->_retvalue
= array('op_expr' => 'expr', $this->yystack
[$this->yyidx +
-1]->minor
); }
1684 #line 1690 "lib/Haanga/Compiler/Parser.php"
1685 #line 216 "lib/Haanga/Compiler/Parser.y"
1686 function yy_r74(){ 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
); }
1687 #line 1693 "lib/Haanga/Compiler/Parser.php"
1688 #line 217 "lib/Haanga/Compiler/Parser.y"
1689 function yy_r75(){ 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
; }
1690 #line 1696 "lib/Haanga/Compiler/Parser.php"
1691 #line 218 "lib/Haanga/Compiler/Parser.y"
1692 function yy_r76(){ 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
; }
1693 #line 1699 "lib/Haanga/Compiler/Parser.php"
1696 * placeholder for the left hand side in a reduce operation.
1698 * For a parser with a rule like this:
1700 * rule(A) ::= B. { A = 1; }
1703 * The parser will translate to something like:
1706 * function yy_r0(){$this->_retvalue = 1;}
1712 * Perform a reduce action and the shift that must immediately
1713 * follow the reduce.
1715 * For a rule such as:
1718 * A ::= B blah C. { dosomething(); }
1721 * This function will first call the action, if any, ("dosomething();" in our
1722 * example), and then it will pop three states from the stack,
1723 * one for each entry on the right-hand side of the expression
1724 * (B, blah, and C in our example rule), and then push the result of the action
1725 * back on to the stack with the resulting state reduced to (as described in the .out
1727 * @param int Number of the rule by which to reduce
1729 function yy_reduce($yyruleno)
1731 //int $yygoto; /* The next state */
1732 //int $yyact; /* The next action */
1733 //mixed $yygotominor; /* The LHS of the rule reduced */
1734 //Haanga_yyStackEntry $yymsp; /* The top of the parser's stack */
1735 //int $yysize; /* Amount to pop the stack */
1736 $yymsp = $this->yystack
[$this->yyidx
];
1737 if (self
::$yyTraceFILE && $yyruleno >= 0
1738 && $yyruleno < count(self
::$yyRuleName)) {
1739 fprintf(self
::$yyTraceFILE, "%sReduce (%d) [%s].\n",
1740 self
::$yyTracePrompt, $yyruleno,
1741 self
::$yyRuleName[$yyruleno]);
1744 $this->_retvalue
= $yy_lefthand_side = null;
1745 if (array_key_exists($yyruleno, self
::$yyReduceMap)) {
1747 $this->_retvalue
= null;
1748 $this->{'yy_r' . self
::$yyReduceMap[$yyruleno]}();
1749 $yy_lefthand_side = $this->_retvalue
;
1751 $yygoto = self
::$yyRuleInfo[$yyruleno]['lhs'];
1752 $yysize = self
::$yyRuleInfo[$yyruleno]['rhs'];
1753 $this->yyidx
-= $yysize;
1754 for($i = $yysize; $i; $i--) {
1755 // pop all of the right-hand side parameters
1756 array_pop($this->yystack
);
1758 $yyact = $this->yy_find_reduce_action($this->yystack
[$this->yyidx
]->stateno
, $yygoto);
1759 if ($yyact < self
::YYNSTATE
) {
1760 /* If we are not debugging and the reduce action popped at least
1761 ** one element off the stack, then we can push the new element back
1762 ** onto the stack here, and skip the stack overflow test in yy_shift().
1763 ** That gives a significant speed improvement. */
1764 if (!self
::$yyTraceFILE && $yysize) {
1766 $x = new Haanga_yyStackEntry
;
1767 $x->stateno
= $yyact;
1768 $x->major
= $yygoto;
1769 $x->minor
= $yy_lefthand_side;
1770 $this->yystack
[$this->yyidx
] = $x;
1772 $this->yy_shift($yyact, $yygoto, $yy_lefthand_side);
1774 } elseif ($yyact == self
::YYNSTATE + self
::YYNRULE +
1) {
1780 * The following code executes when the parse fails
1782 * Code from %parse_fail is inserted here
1784 function yy_parse_failed()
1786 if (self
::$yyTraceFILE) {
1787 fprintf(self
::$yyTraceFILE, "%sFail!\n", self
::$yyTracePrompt);
1789 while ($this->yyidx
>= 0) {
1790 $this->yy_pop_parser_stack();
1792 /* Here code is inserted which will be executed whenever the
1797 * The following code executes when a syntax error first occurs.
1799 * %syntax_error code is inserted here
1800 * @param int The major type of the error token
1801 * @param mixed The minor type of the error token
1803 function yy_syntax_error($yymajor, $TOKEN)
1805 #line 56 "lib/Haanga/Compiler/Parser.y"
1808 foreach ($this->yy_get_expected_tokens($yymajor) as $token) {
1809 $expect[] = self
::$yyTokenName[$token];
1811 throw new Exception('Unexpected ' . $this->tokenName($yymajor) . '(' . $TOKEN. '), expected one of: ' . implode(',', $expect));
1812 #line 1819 "lib/Haanga/Compiler/Parser.php"
1816 * The following is executed when the parser accepts
1818 * %parse_accept code is inserted here
1820 function yy_accept()
1822 if (self
::$yyTraceFILE) {
1823 fprintf(self
::$yyTraceFILE, "%sAccept!\n", self
::$yyTracePrompt);
1825 while ($this->yyidx
>= 0) {
1826 $stack = $this->yy_pop_parser_stack();
1828 /* Here code is inserted which will be executed whenever the
1829 ** parser accepts */
1830 #line 44 "lib/Haanga/Compiler/Parser.y"
1832 #line 1840 "lib/Haanga/Compiler/Parser.php"
1836 * The main parser program.
1838 * The first argument is the major token number. The second is
1839 * the token value string as scanned from the input.
1841 * @param int the token number
1842 * @param mixed the token value
1843 * @param mixed any extra arguments that should be passed to handlers
1845 function doParse($yymajor, $yytokenvalue)
1847 // $yyact; /* The parser action. */
1848 // $yyendofinput; /* True if we are at the end of input */
1849 $yyerrorhit = 0; /* True if yymajor has invoked an error */
1851 /* (re)initialize the parser, if necessary */
1852 if ($this->yyidx
=== null ||
$this->yyidx
< 0) {
1853 /* if ($yymajor == 0) return; // not sure why this was here... */
1855 $this->yyerrcnt
= -1;
1856 $x = new Haanga_yyStackEntry
;
1859 $this->yystack
= array();
1860 array_push($this->yystack
, $x);
1862 $yyendofinput = ($yymajor==0);
1864 if (self
::$yyTraceFILE) {
1865 fprintf(self
::$yyTraceFILE, "%sInput %s\n",
1866 self
::$yyTracePrompt, self
::$yyTokenName[$yymajor]);
1870 $yyact = $this->yy_find_shift_action($yymajor);
1871 if ($yymajor < self
::YYERRORSYMBOL
&&
1872 !$this->yy_is_expected_token($yymajor)) {
1873 // force a syntax error
1874 $yyact = self
::YY_ERROR_ACTION
;
1876 if ($yyact < self
::YYNSTATE
) {
1877 $this->yy_shift($yyact, $yymajor, $yytokenvalue);
1879 if ($yyendofinput && $this->yyidx
>= 0) {
1882 $yymajor = self
::YYNOCODE
;
1884 } elseif ($yyact < self
::YYNSTATE + self
::YYNRULE
) {
1885 $this->yy_reduce($yyact - self
::YYNSTATE
);
1886 } elseif ($yyact == self
::YY_ERROR_ACTION
) {
1887 if (self
::$yyTraceFILE) {
1888 fprintf(self
::$yyTraceFILE, "%sSyntax Error!\n",
1889 self
::$yyTracePrompt);
1891 if (self
::YYERRORSYMBOL
) {
1892 /* A syntax error has occurred.
1893 ** The response to an error depends upon whether or not the
1894 ** grammar defines an error token "ERROR".
1896 ** This is what we do if the grammar does define ERROR:
1898 ** * Call the %syntax_error function.
1900 ** * Begin popping the stack until we enter a state where
1901 ** it is legal to shift the error symbol, then shift
1902 ** the error symbol.
1904 ** * Set the error count to three.
1906 ** * Begin accepting and shifting new tokens. No new error
1907 ** processing will occur until three tokens have been
1908 ** shifted successfully.
1911 if ($this->yyerrcnt
< 0) {
1912 $this->yy_syntax_error($yymajor, $yytokenvalue);
1914 $yymx = $this->yystack
[$this->yyidx
]->major
;
1915 if ($yymx == self
::YYERRORSYMBOL ||
$yyerrorhit ){
1916 if (self
::$yyTraceFILE) {
1917 fprintf(self
::$yyTraceFILE, "%sDiscard input token %s\n",
1918 self
::$yyTracePrompt, self
::$yyTokenName[$yymajor]);
1920 $this->yy_destructor($yymajor, $yytokenvalue);
1921 $yymajor = self
::YYNOCODE
;
1923 while ($this->yyidx
>= 0 &&
1924 $yymx != self
::YYERRORSYMBOL
&&
1925 ($yyact = $this->yy_find_shift_action(self
::YYERRORSYMBOL
)) >= self
::YYNSTATE
1927 $this->yy_pop_parser_stack();
1929 if ($this->yyidx
< 0 ||
$yymajor==0) {
1930 $this->yy_destructor($yymajor, $yytokenvalue);
1931 $this->yy_parse_failed();
1932 $yymajor = self
::YYNOCODE
;
1933 } elseif ($yymx != self
::YYERRORSYMBOL
) {
1935 $this->yy_shift($yyact, self
::YYERRORSYMBOL
, $u2);
1938 $this->yyerrcnt
= 3;
1941 /* YYERRORSYMBOL is not defined */
1942 /* This is what we do if the grammar does not define ERROR:
1944 ** * Report an error message, and throw away the input token.
1946 ** * If the input token is $, then fail the parse.
1948 ** As before, subsequent error messages are suppressed until
1949 ** three input tokens have been successfully shifted.
1951 if ($this->yyerrcnt
<= 0) {
1952 $this->yy_syntax_error($yymajor, $yytokenvalue);
1954 $this->yyerrcnt
= 3;
1955 $this->yy_destructor($yymajor, $yytokenvalue);
1956 if ($yyendofinput) {
1957 $this->yy_parse_failed();
1959 $yymajor = self
::YYNOCODE
;
1963 $yymajor = self
::YYNOCODE
;
1965 } while ($yymajor != self
::YYNOCODE
&& $this->yyidx
>= 0);