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