Initial repo created
[timetracker.git] / WEB-INF / lib / smarty / sysplugins / smarty_internal_configfileparser.php
1 <?php
2 /**
3 * Smarty Internal Plugin Configfileparser
4 *
5 * This is the config file parser.
6 * It is generated from the internal.configfileparser.y file
7 * @package Smarty
8 * @subpackage Compiler
9 * @author Uwe Tews
10 */
11
12 class TPC_yyToken implements ArrayAccess
13 {
14     public $string = '';
15     public $metadata = array();
16
17     function __construct($s, $m = array())
18     {
19         if ($s instanceof TPC_yyToken) {
20             $this->string = $s->string;
21             $this->metadata = $s->metadata;
22         } else {
23             $this->string = (string) $s;
24             if ($m instanceof TPC_yyToken) {
25                 $this->metadata = $m->metadata;
26             } elseif (is_array($m)) {
27                 $this->metadata = $m;
28             }
29         }
30     }
31
32     function __toString()
33     {
34         return $this->_string;
35     }
36
37     function offsetExists($offset)
38     {
39         return isset($this->metadata[$offset]);
40     }
41
42     function offsetGet($offset)
43     {
44         return $this->metadata[$offset];
45     }
46
47     function offsetSet($offset, $value)
48     {
49         if ($offset === null) {
50             if (isset($value[0])) {
51                 $x = ($value instanceof TPC_yyToken) ?
52                     $value->metadata : $value;
53                 $this->metadata = array_merge($this->metadata, $x);
54                 return;
55             }
56             $offset = count($this->metadata);
57         }
58         if ($value === null) {
59             return;
60         }
61         if ($value instanceof TPC_yyToken) {
62             if ($value->metadata) {
63                 $this->metadata[$offset] = $value->metadata;
64             }
65         } elseif ($value) {
66             $this->metadata[$offset] = $value;
67         }
68     }
69
70     function offsetUnset($offset)
71     {
72         unset($this->metadata[$offset]);
73     }
74 }
75
76 class TPC_yyStackEntry
77 {
78     public $stateno;       /* The state-number */
79     public $major;         /* The major token value.  This is the code
80                      ** number for the token at this stack level */
81     public $minor; /* The user-supplied minor token value.  This
82                      ** is the value of the token  */
83 };
84
85
86 #line 12 "smarty_internal_configfileparser.y"
87 class Smarty_Internal_Configfileparser#line 79 "smarty_internal_configfileparser.php"
88 {
89 #line 14 "smarty_internal_configfileparser.y"
90
91     // states whether the parse was successful or not
92     public $successful = true;
93     public $retvalue = 0;
94     private $lex;
95     private $internalError = false;
96
97     function __construct($lex, $compiler) {
98         // set instance object
99         self::instance($this); 
100         $this->lex = $lex;
101         $this->smarty = $compiler->smarty; 
102         $this->compiler = $compiler;
103     }
104     public static function &instance($new_instance = null)
105     {
106         static $instance = null;
107         if (isset($new_instance) && is_object($new_instance))
108             $instance = $new_instance;
109         return $instance;
110     }
111
112     private function parse_bool($str) {
113         if (in_array(strtolower($str) ,array('on','yes','true'))) {
114             $res = true;
115         } else {
116             $res = false;
117         }
118         return $res;
119     }
120
121     private static $escapes_single = Array('\\' => '\\',
122                                           '\'' => '\'');
123     private static function parse_single_quoted_string($qstr) {
124         $escaped_string = substr($qstr, 1, strlen($qstr)-2); //remove outer quotes
125
126         $ss = preg_split('/(\\\\.)/', $escaped_string, -1, PREG_SPLIT_DELIM_CAPTURE);
127
128         $str = "";
129         foreach ($ss as $s) {
130             if (strlen($s) === 2 && $s[0] === '\\') {
131                 if (isset(self::$escapes_single[$s[1]])) {
132                     $s = self::$escapes_single[$s[1]];
133                 }
134              }
135
136              $str .= $s;
137         }
138
139         return $str;
140     }
141
142     private static function parse_double_quoted_string($qstr) {
143         $inner_str = substr($qstr, 1, strlen($qstr)-2);
144         return stripcslashes($inner_str);
145     }
146
147     private static function parse_tripple_double_quoted_string($qstr) {
148         $inner_str = substr($qstr, 3, strlen($qstr)-6);
149         return stripcslashes($inner_str);
150     }
151
152     private function set_var(Array $var, Array &$target_array) {
153         $key = $var["key"];
154         $value = $var["value"];
155
156         if ($this->smarty->config_overwrite || !isset($target_array['vars'][$key])) {
157             $target_array['vars'][$key] = $value;
158         } else {
159             settype($target_array['vars'][$key], 'array');
160             $target_array['vars'][$key][] = $value;
161         }
162     }
163
164     private function add_global_vars(Array $vars) {
165         if (!isset($this->compiler->config_data['vars'])) {
166             $this->compiler->config_data['vars'] = Array();
167         }
168         foreach ($vars as $var) {
169             $this->set_var($var, $this->compiler->config_data);
170         }
171     }
172
173     private function add_section_vars($section_name, Array $vars) {
174         if (!isset($this->compiler->config_data['sections'][$section_name]['vars'])) {
175             $this->compiler->config_data['sections'][$section_name]['vars'] = Array();
176         }
177         foreach ($vars as $var) {
178             $this->set_var($var, $this->compiler->config_data['sections'][$section_name]);
179         }
180     }
181 #line 174 "smarty_internal_configfileparser.php"
182
183     const TPC_OPENB                          =  1;
184     const TPC_SECTION                        =  2;
185     const TPC_CLOSEB                         =  3;
186     const TPC_DOT                            =  4;
187     const TPC_ID                             =  5;
188     const TPC_EQUAL                          =  6;
189     const TPC_FLOAT                          =  7;
190     const TPC_INT                            =  8;
191     const TPC_BOOL                           =  9;
192     const TPC_SINGLE_QUOTED_STRING           = 10;
193     const TPC_DOUBLE_QUOTED_STRING           = 11;
194     const TPC_TRIPPLE_DOUBLE_QUOTED_STRING   = 12;
195     const TPC_NAKED_STRING                   = 13;
196     const TPC_NEWLINE                        = 14;
197     const TPC_COMMENTSTART                   = 15;
198     const YY_NO_ACTION = 54;
199     const YY_ACCEPT_ACTION = 53;
200     const YY_ERROR_ACTION = 52;
201
202     const YY_SZ_ACTTAB = 35;
203 static public $yy_action = array(
204  /*     0 */    26,   27,   21,   30,   29,   28,   31,   16,   53,    8,
205  /*    10 */    19,    2,   20,   11,   24,   23,   20,   11,   17,   15,
206  /*    20 */     3,   14,   13,   18,    4,    6,    5,    1,   12,   22,
207  /*    30 */     9,   47,   10,   25,    7,
208     );
209     static public $yy_lookahead = array(
210  /*     0 */     7,    8,    9,   10,   11,   12,   13,    5,   17,   18,
211  /*    10 */    14,   20,   14,   15,   22,   23,   14,   15,    2,    2,
212  /*    20 */    20,    4,   13,   14,    6,    3,    3,   20,    1,   24,
213  /*    30 */    22,   25,   22,   21,   19,
214 );
215     const YY_SHIFT_USE_DFLT = -8;
216     const YY_SHIFT_MAX = 17;
217     static public $yy_shift_ofst = array(
218  /*     0 */    -8,    2,    2,    2,   -7,   -2,   -2,   27,   -8,   -8,
219  /*    10 */    -8,    9,   17,   -4,   16,   23,   18,   22,
220 );
221     const YY_REDUCE_USE_DFLT = -10;
222     const YY_REDUCE_MAX = 10;
223     static public $yy_reduce_ofst = array(
224  /*     0 */    -9,   -8,   -8,   -8,    5,   10,    8,   12,   15,    0,
225  /*    10 */     7,
226 );
227     static public $yyExpectedTokens = array(
228         /* 0 */ array(),
229         /* 1 */ array(5, 14, 15, ),
230         /* 2 */ array(5, 14, 15, ),
231         /* 3 */ array(5, 14, 15, ),
232         /* 4 */ array(7, 8, 9, 10, 11, 12, 13, ),
233         /* 5 */ array(14, 15, ),
234         /* 6 */ array(14, 15, ),
235         /* 7 */ array(1, ),
236         /* 8 */ array(),
237         /* 9 */ array(),
238         /* 10 */ array(),
239         /* 11 */ array(13, 14, ),
240         /* 12 */ array(2, 4, ),
241         /* 13 */ array(14, ),
242         /* 14 */ array(2, ),
243         /* 15 */ array(3, ),
244         /* 16 */ array(6, ),
245         /* 17 */ array(3, ),
246         /* 18 */ array(),
247         /* 19 */ array(),
248         /* 20 */ array(),
249         /* 21 */ array(),
250         /* 22 */ array(),
251         /* 23 */ array(),
252         /* 24 */ array(),
253         /* 25 */ array(),
254         /* 26 */ array(),
255         /* 27 */ array(),
256         /* 28 */ array(),
257         /* 29 */ array(),
258         /* 30 */ array(),
259         /* 31 */ array(),
260 );
261     static public $yy_default = array(
262  /*     0 */    40,   36,   33,   37,   52,   52,   52,   32,   35,   40,
263  /*    10 */    40,   52,   52,   52,   52,   52,   52,   52,   50,   51,
264  /*    20 */    49,   44,   41,   39,   38,   34,   42,   43,   47,   46,
265  /*    30 */    45,   48,
266 );
267     const YYNOCODE = 26;
268     const YYSTACKDEPTH = 100;
269     const YYNSTATE = 32;
270     const YYNRULE = 20;
271     const YYERRORSYMBOL = 16;
272     const YYERRSYMDT = 'yy0';
273     const YYFALLBACK = 0;
274     static public $yyFallback = array(
275     );
276     static function Trace($TraceFILE, $zTracePrompt)
277     {
278         if (!$TraceFILE) {
279             $zTracePrompt = 0;
280         } elseif (!$zTracePrompt) {
281             $TraceFILE = 0;
282         }
283         self::$yyTraceFILE = $TraceFILE;
284         self::$yyTracePrompt = $zTracePrompt;
285     }
286
287     static function PrintTrace()
288     {
289         self::$yyTraceFILE = fopen('php://output', 'w');
290         self::$yyTracePrompt = '<br>';
291     }
292
293     static public $yyTraceFILE;
294     static public $yyTracePrompt;
295     public $yyidx;                    /* Index of top element in stack */
296     public $yyerrcnt;                 /* Shifts left before out of the error */
297     public $yystack = array();  /* The parser's stack */
298
299     public $yyTokenName = array( 
300   '$',             'OPENB',         'SECTION',       'CLOSEB',      
301   'DOT',           'ID',            'EQUAL',         'FLOAT',       
302   'INT',           'BOOL',          'SINGLE_QUOTED_STRING',  'DOUBLE_QUOTED_STRING',
303   'TRIPPLE_DOUBLE_QUOTED_STRING',  'NAKED_STRING',  'NEWLINE',       'COMMENTSTART',
304   'error',         'start',         'global_vars',   'sections',    
305   'var_list',      'section',       'newline',       'var',         
306   'value',       
307     );
308
309     static public $yyRuleName = array(
310  /*   0 */ "start ::= global_vars sections",
311  /*   1 */ "global_vars ::= var_list",
312  /*   2 */ "sections ::= sections section",
313  /*   3 */ "sections ::=",
314  /*   4 */ "section ::= OPENB SECTION CLOSEB newline var_list",
315  /*   5 */ "section ::= OPENB DOT SECTION CLOSEB newline var_list",
316  /*   6 */ "var_list ::= var_list newline",
317  /*   7 */ "var_list ::= var_list var",
318  /*   8 */ "var_list ::=",
319  /*   9 */ "var ::= ID EQUAL value",
320  /*  10 */ "value ::= FLOAT",
321  /*  11 */ "value ::= INT",
322  /*  12 */ "value ::= BOOL",
323  /*  13 */ "value ::= SINGLE_QUOTED_STRING",
324  /*  14 */ "value ::= DOUBLE_QUOTED_STRING",
325  /*  15 */ "value ::= TRIPPLE_DOUBLE_QUOTED_STRING",
326  /*  16 */ "value ::= NAKED_STRING",
327  /*  17 */ "newline ::= NEWLINE",
328  /*  18 */ "newline ::= COMMENTSTART NEWLINE",
329  /*  19 */ "newline ::= COMMENTSTART NAKED_STRING NEWLINE",
330     );
331
332     function tokenName($tokenType)
333     {
334         if ($tokenType === 0) {
335             return 'End of Input';
336         }
337         if ($tokenType > 0 && $tokenType < count($this->yyTokenName)) {
338             return $this->yyTokenName[$tokenType];
339         } else {
340             return "Unknown";
341         }
342     }
343
344     static function yy_destructor($yymajor, $yypminor)
345     {
346         switch ($yymajor) {
347             default:  break;   /* If no destructor action specified: do nothing */
348         }
349     }
350
351     function yy_pop_parser_stack()
352     {
353         if (!count($this->yystack)) {
354             return;
355         }
356         $yytos = array_pop($this->yystack);
357         if (self::$yyTraceFILE && $this->yyidx >= 0) {
358             fwrite(self::$yyTraceFILE,
359                 self::$yyTracePrompt . 'Popping ' . $this->yyTokenName[$yytos->major] .
360                     "\n");
361         }
362         $yymajor = $yytos->major;
363         self::yy_destructor($yymajor, $yytos->minor);
364         $this->yyidx--;
365         return $yymajor;
366     }
367
368     function __destruct()
369     {
370         while ($this->yystack !== Array()) {
371             $this->yy_pop_parser_stack();
372         }
373         if (is_resource(self::$yyTraceFILE)) {
374             fclose(self::$yyTraceFILE);
375         }
376     }
377
378     function yy_get_expected_tokens($token)
379     {
380         $state = $this->yystack[$this->yyidx]->stateno;
381         $expected = self::$yyExpectedTokens[$state];
382         if (in_array($token, self::$yyExpectedTokens[$state], true)) {
383             return $expected;
384         }
385         $stack = $this->yystack;
386         $yyidx = $this->yyidx;
387         do {
388             $yyact = $this->yy_find_shift_action($token);
389             if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) {
390                 // reduce action
391                 $done = 0;
392                 do {
393                     if ($done++ == 100) {
394                         $this->yyidx = $yyidx;
395                         $this->yystack = $stack;
396                         // too much recursion prevents proper detection
397                         // so give up
398                         return array_unique($expected);
399                     }
400                     $yyruleno = $yyact - self::YYNSTATE;
401                     $this->yyidx -= self::$yyRuleInfo[$yyruleno]['rhs'];
402                     $nextstate = $this->yy_find_reduce_action(
403                         $this->yystack[$this->yyidx]->stateno,
404                         self::$yyRuleInfo[$yyruleno]['lhs']);
405                     if (isset(self::$yyExpectedTokens[$nextstate])) {
406                         $expected = array_merge($expected, self::$yyExpectedTokens[$nextstate]);
407                             if (in_array($token,
408                                   self::$yyExpectedTokens[$nextstate], true)) {
409                             $this->yyidx = $yyidx;
410                             $this->yystack = $stack;
411                             return array_unique($expected);
412                         }
413                     }
414                     if ($nextstate < self::YYNSTATE) {
415                         // we need to shift a non-terminal
416                         $this->yyidx++;
417                         $x = new TPC_yyStackEntry;
418                         $x->stateno = $nextstate;
419                         $x->major = self::$yyRuleInfo[$yyruleno]['lhs'];
420                         $this->yystack[$this->yyidx] = $x;
421                         continue 2;
422                     } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) {
423                         $this->yyidx = $yyidx;
424                         $this->yystack = $stack;
425                         // the last token was just ignored, we can't accept
426                         // by ignoring input, this is in essence ignoring a
427                         // syntax error!
428                         return array_unique($expected);
429                     } elseif ($nextstate === self::YY_NO_ACTION) {
430                         $this->yyidx = $yyidx;
431                         $this->yystack = $stack;
432                         // input accepted, but not shifted (I guess)
433                         return $expected;
434                     } else {
435                         $yyact = $nextstate;
436                     }
437                 } while (true);
438             }
439             break;
440         } while (true);
441         $this->yyidx = $yyidx;
442         $this->yystack = $stack;
443         return array_unique($expected);
444     }
445
446     function yy_is_expected_token($token)
447     {
448         if ($token === 0) {
449             return true; // 0 is not part of this
450         }
451         $state = $this->yystack[$this->yyidx]->stateno;
452         if (in_array($token, self::$yyExpectedTokens[$state], true)) {
453             return true;
454         }
455         $stack = $this->yystack;
456         $yyidx = $this->yyidx;
457         do {
458             $yyact = $this->yy_find_shift_action($token);
459             if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) {
460                 // reduce action
461                 $done = 0;
462                 do {
463                     if ($done++ == 100) {
464                         $this->yyidx = $yyidx;
465                         $this->yystack = $stack;
466                         // too much recursion prevents proper detection
467                         // so give up
468                         return true;
469                     }
470                     $yyruleno = $yyact - self::YYNSTATE;
471                     $this->yyidx -= self::$yyRuleInfo[$yyruleno]['rhs'];
472                     $nextstate = $this->yy_find_reduce_action(
473                         $this->yystack[$this->yyidx]->stateno,
474                         self::$yyRuleInfo[$yyruleno]['lhs']);
475                     if (isset(self::$yyExpectedTokens[$nextstate]) &&
476                           in_array($token, self::$yyExpectedTokens[$nextstate], true)) {
477                         $this->yyidx = $yyidx;
478                         $this->yystack = $stack;
479                         return true;
480                     }
481                     if ($nextstate < self::YYNSTATE) {
482                         // we need to shift a non-terminal
483                         $this->yyidx++;
484                         $x = new TPC_yyStackEntry;
485                         $x->stateno = $nextstate;
486                         $x->major = self::$yyRuleInfo[$yyruleno]['lhs'];
487                         $this->yystack[$this->yyidx] = $x;
488                         continue 2;
489                     } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) {
490                         $this->yyidx = $yyidx;
491                         $this->yystack = $stack;
492                         if (!$token) {
493                             // end of input: this is valid
494                             return true;
495                         }
496                         // the last token was just ignored, we can't accept
497                         // by ignoring input, this is in essence ignoring a
498                         // syntax error!
499                         return false;
500                     } elseif ($nextstate === self::YY_NO_ACTION) {
501                         $this->yyidx = $yyidx;
502                         $this->yystack = $stack;
503                         // input accepted, but not shifted (I guess)
504                         return true;
505                     } else {
506                         $yyact = $nextstate;
507                     }
508                 } while (true);
509             }
510             break;
511         } while (true);
512         $this->yyidx = $yyidx;
513         $this->yystack = $stack;
514         return true;
515     }
516
517    function yy_find_shift_action($iLookAhead)
518     {
519         $stateno = $this->yystack[$this->yyidx]->stateno;
520      
521         /* if ($this->yyidx < 0) return self::YY_NO_ACTION;  */
522         if (!isset(self::$yy_shift_ofst[$stateno])) {
523             // no shift actions
524             return self::$yy_default[$stateno];
525         }
526         $i = self::$yy_shift_ofst[$stateno];
527         if ($i === self::YY_SHIFT_USE_DFLT) {
528             return self::$yy_default[$stateno];
529         }
530         if ($iLookAhead == self::YYNOCODE) {
531             return self::YY_NO_ACTION;
532         }
533         $i += $iLookAhead;
534         if ($i < 0 || $i >= self::YY_SZ_ACTTAB ||
535               self::$yy_lookahead[$i] != $iLookAhead) {
536             if (count(self::$yyFallback) && $iLookAhead < count(self::$yyFallback)
537                    && ($iFallback = self::$yyFallback[$iLookAhead]) != 0) {
538                 if (self::$yyTraceFILE) {
539                     fwrite(self::$yyTraceFILE, self::$yyTracePrompt . "FALLBACK " .
540                         $this->yyTokenName[$iLookAhead] . " => " .
541                         $this->yyTokenName[$iFallback] . "\n");
542                 }
543                 return $this->yy_find_shift_action($iFallback);
544             }
545             return self::$yy_default[$stateno];
546         } else {
547             return self::$yy_action[$i];
548         }
549     }
550
551     function yy_find_reduce_action($stateno, $iLookAhead)
552     {
553         /* $stateno = $this->yystack[$this->yyidx]->stateno; */
554
555         if (!isset(self::$yy_reduce_ofst[$stateno])) {
556             return self::$yy_default[$stateno];
557         }
558         $i = self::$yy_reduce_ofst[$stateno];
559         if ($i == self::YY_REDUCE_USE_DFLT) {
560             return self::$yy_default[$stateno];
561         }
562         if ($iLookAhead == self::YYNOCODE) {
563             return self::YY_NO_ACTION;
564         }
565         $i += $iLookAhead;
566         if ($i < 0 || $i >= self::YY_SZ_ACTTAB ||
567               self::$yy_lookahead[$i] != $iLookAhead) {
568             return self::$yy_default[$stateno];
569         } else {
570             return self::$yy_action[$i];
571         }
572     }
573
574     function yy_shift($yyNewState, $yyMajor, $yypMinor)
575     {
576         $this->yyidx++;
577         if ($this->yyidx >= self::YYSTACKDEPTH) {
578             $this->yyidx--;
579             if (self::$yyTraceFILE) {
580                 fprintf(self::$yyTraceFILE, "%sStack Overflow!\n", self::$yyTracePrompt);
581             }
582             while ($this->yyidx >= 0) {
583                 $this->yy_pop_parser_stack();
584             }
585 #line 126 "smarty_internal_configfileparser.y"
586
587     $this->internalError = true;
588     $this->compiler->trigger_config_file_error("Stack overflow in configfile parser");
589 #line 585 "smarty_internal_configfileparser.php"
590             return;
591         }
592         $yytos = new TPC_yyStackEntry;
593         $yytos->stateno = $yyNewState;
594         $yytos->major = $yyMajor;
595         $yytos->minor = $yypMinor;
596         array_push($this->yystack, $yytos);
597         if (self::$yyTraceFILE && $this->yyidx > 0) {
598             fprintf(self::$yyTraceFILE, "%sShift %d\n", self::$yyTracePrompt,
599                 $yyNewState);
600             fprintf(self::$yyTraceFILE, "%sStack:", self::$yyTracePrompt);
601             for($i = 1; $i <= $this->yyidx; $i++) {
602                 fprintf(self::$yyTraceFILE, " %s",
603                     $this->yyTokenName[$this->yystack[$i]->major]);
604             }
605             fwrite(self::$yyTraceFILE,"\n");
606         }
607     }
608
609     static public $yyRuleInfo = array(
610   array( 'lhs' => 17, 'rhs' => 2 ),
611   array( 'lhs' => 18, 'rhs' => 1 ),
612   array( 'lhs' => 19, 'rhs' => 2 ),
613   array( 'lhs' => 19, 'rhs' => 0 ),
614   array( 'lhs' => 21, 'rhs' => 5 ),
615   array( 'lhs' => 21, 'rhs' => 6 ),
616   array( 'lhs' => 20, 'rhs' => 2 ),
617   array( 'lhs' => 20, 'rhs' => 2 ),
618   array( 'lhs' => 20, 'rhs' => 0 ),
619   array( 'lhs' => 23, 'rhs' => 3 ),
620   array( 'lhs' => 24, 'rhs' => 1 ),
621   array( 'lhs' => 24, 'rhs' => 1 ),
622   array( 'lhs' => 24, 'rhs' => 1 ),
623   array( 'lhs' => 24, 'rhs' => 1 ),
624   array( 'lhs' => 24, 'rhs' => 1 ),
625   array( 'lhs' => 24, 'rhs' => 1 ),
626   array( 'lhs' => 24, 'rhs' => 1 ),
627   array( 'lhs' => 22, 'rhs' => 1 ),
628   array( 'lhs' => 22, 'rhs' => 2 ),
629   array( 'lhs' => 22, 'rhs' => 3 ),
630     );
631
632     static public $yyReduceMap = array(
633         0 => 0,
634         2 => 0,
635         3 => 0,
636         17 => 0,
637         18 => 0,
638         19 => 0,
639         1 => 1,
640         4 => 4,
641         5 => 5,
642         6 => 6,
643         7 => 7,
644         8 => 8,
645         9 => 9,
646         10 => 10,
647         11 => 11,
648         12 => 12,
649         13 => 13,
650         14 => 14,
651         15 => 15,
652         16 => 16,
653     );
654 #line 132 "smarty_internal_configfileparser.y"
655     function yy_r0(){ $this->_retvalue = null;     }
656 #line 652 "smarty_internal_configfileparser.php"
657 #line 135 "smarty_internal_configfileparser.y"
658     function yy_r1(){ $this->add_global_vars($this->yystack[$this->yyidx + 0]->minor); $this->_retvalue = null;     }
659 #line 655 "smarty_internal_configfileparser.php"
660 #line 141 "smarty_internal_configfileparser.y"
661     function yy_r4(){ $this->add_section_vars($this->yystack[$this->yyidx + -3]->minor, $this->yystack[$this->yyidx + 0]->minor); $this->_retvalue = null;     }
662 #line 658 "smarty_internal_configfileparser.php"
663 #line 142 "smarty_internal_configfileparser.y"
664     function yy_r5(){ if ($this->smarty->config_read_hidden) { $this->add_section_vars($this->yystack[$this->yyidx + -3]->minor, $this->yystack[$this->yyidx + 0]->minor); } $this->_retvalue = null;     }
665 #line 661 "smarty_internal_configfileparser.php"
666 #line 145 "smarty_internal_configfileparser.y"
667     function yy_r6(){ $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor;     }
668 #line 664 "smarty_internal_configfileparser.php"
669 #line 146 "smarty_internal_configfileparser.y"
670     function yy_r7(){ $this->_retvalue = array_merge($this->yystack[$this->yyidx + -1]->minor, Array($this->yystack[$this->yyidx + 0]->minor));     }
671 #line 667 "smarty_internal_configfileparser.php"
672 #line 147 "smarty_internal_configfileparser.y"
673     function yy_r8(){ $this->_retvalue = Array();     }
674 #line 670 "smarty_internal_configfileparser.php"
675 #line 151 "smarty_internal_configfileparser.y"
676     function yy_r9(){ $this->_retvalue = Array("key" => $this->yystack[$this->yyidx + -2]->minor, "value" => $this->yystack[$this->yyidx + 0]->minor);     }
677 #line 673 "smarty_internal_configfileparser.php"
678 #line 153 "smarty_internal_configfileparser.y"
679     function yy_r10(){ $this->_retvalue = (float) $this->yystack[$this->yyidx + 0]->minor;     }
680 #line 676 "smarty_internal_configfileparser.php"
681 #line 154 "smarty_internal_configfileparser.y"
682     function yy_r11(){ $this->_retvalue = (int) $this->yystack[$this->yyidx + 0]->minor;     }
683 #line 679 "smarty_internal_configfileparser.php"
684 #line 155 "smarty_internal_configfileparser.y"
685     function yy_r12(){ $this->_retvalue = $this->parse_bool($this->yystack[$this->yyidx + 0]->minor);     }
686 #line 682 "smarty_internal_configfileparser.php"
687 #line 156 "smarty_internal_configfileparser.y"
688     function yy_r13(){ $this->_retvalue = self::parse_single_quoted_string($this->yystack[$this->yyidx + 0]->minor);     }
689 #line 685 "smarty_internal_configfileparser.php"
690 #line 157 "smarty_internal_configfileparser.y"
691     function yy_r14(){ $this->_retvalue = self::parse_double_quoted_string($this->yystack[$this->yyidx + 0]->minor);     }
692 #line 688 "smarty_internal_configfileparser.php"
693 #line 158 "smarty_internal_configfileparser.y"
694     function yy_r15(){ $this->_retvalue = self::parse_tripple_double_quoted_string($this->yystack[$this->yyidx + 0]->minor);     }
695 #line 691 "smarty_internal_configfileparser.php"
696 #line 159 "smarty_internal_configfileparser.y"
697     function yy_r16(){ $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor;     }
698 #line 694 "smarty_internal_configfileparser.php"
699
700     private $_retvalue;
701
702     function yy_reduce($yyruleno)
703     {
704         $yymsp = $this->yystack[$this->yyidx];
705         if (self::$yyTraceFILE && $yyruleno >= 0 
706               && $yyruleno < count(self::$yyRuleName)) {
707             fprintf(self::$yyTraceFILE, "%sReduce (%d) [%s].\n",
708                 self::$yyTracePrompt, $yyruleno,
709                 self::$yyRuleName[$yyruleno]);
710         }
711
712         $this->_retvalue = $yy_lefthand_side = null;
713         if (array_key_exists($yyruleno, self::$yyReduceMap)) {
714             // call the action
715             $this->_retvalue = null;
716             $this->{'yy_r' . self::$yyReduceMap[$yyruleno]}();
717             $yy_lefthand_side = $this->_retvalue;
718         }
719         $yygoto = self::$yyRuleInfo[$yyruleno]['lhs'];
720         $yysize = self::$yyRuleInfo[$yyruleno]['rhs'];
721         $this->yyidx -= $yysize;
722         for($i = $yysize; $i; $i--) {
723             // pop all of the right-hand side parameters
724             array_pop($this->yystack);
725         }
726         $yyact = $this->yy_find_reduce_action($this->yystack[$this->yyidx]->stateno, $yygoto);
727         if ($yyact < self::YYNSTATE) {
728             if (!self::$yyTraceFILE && $yysize) {
729                 $this->yyidx++;
730                 $x = new TPC_yyStackEntry;
731                 $x->stateno = $yyact;
732                 $x->major = $yygoto;
733                 $x->minor = $yy_lefthand_side;
734                 $this->yystack[$this->yyidx] = $x;
735             } else {
736                 $this->yy_shift($yyact, $yygoto, $yy_lefthand_side);
737             }
738         } elseif ($yyact == self::YYNSTATE + self::YYNRULE + 1) {
739             $this->yy_accept();
740         }
741     }
742
743     function yy_parse_failed()
744     {
745         if (self::$yyTraceFILE) {
746             fprintf(self::$yyTraceFILE, "%sFail!\n", self::$yyTracePrompt);
747         }
748         while ($this->yyidx >= 0) {
749             $this->yy_pop_parser_stack();
750         }
751     }
752
753     function yy_syntax_error($yymajor, $TOKEN)
754     {
755 #line 119 "smarty_internal_configfileparser.y"
756
757     $this->internalError = true;
758     $this->yymajor = $yymajor;
759     $this->compiler->trigger_config_file_error();
760 #line 757 "smarty_internal_configfileparser.php"
761     }
762
763     function yy_accept()
764     {
765         if (self::$yyTraceFILE) {
766             fprintf(self::$yyTraceFILE, "%sAccept!\n", self::$yyTracePrompt);
767         }
768         while ($this->yyidx >= 0) {
769             $stack = $this->yy_pop_parser_stack();
770         }
771 #line 111 "smarty_internal_configfileparser.y"
772
773     $this->successful = !$this->internalError;
774     $this->internalError = false;
775     $this->retvalue = $this->_retvalue;
776     //echo $this->retvalue."\n\n";
777 #line 775 "smarty_internal_configfileparser.php"
778     }
779
780     function doParse($yymajor, $yytokenvalue)
781     {
782         $yyerrorhit = 0;   /* True if yymajor has invoked an error */
783         
784         if ($this->yyidx === null || $this->yyidx < 0) {
785             $this->yyidx = 0;
786             $this->yyerrcnt = -1;
787             $x = new TPC_yyStackEntry;
788             $x->stateno = 0;
789             $x->major = 0;
790             $this->yystack = array();
791             array_push($this->yystack, $x);
792         }
793         $yyendofinput = ($yymajor==0);
794         
795         if (self::$yyTraceFILE) {
796             fprintf(self::$yyTraceFILE, "%sInput %s\n",
797                 self::$yyTracePrompt, $this->yyTokenName[$yymajor]);
798         }
799         
800         do {
801             $yyact = $this->yy_find_shift_action($yymajor);
802             if ($yymajor < self::YYERRORSYMBOL &&
803                   !$this->yy_is_expected_token($yymajor)) {
804                 // force a syntax error
805                 $yyact = self::YY_ERROR_ACTION;
806             }
807             if ($yyact < self::YYNSTATE) {
808                 $this->yy_shift($yyact, $yymajor, $yytokenvalue);
809                 $this->yyerrcnt--;
810                 if ($yyendofinput && $this->yyidx >= 0) {
811                     $yymajor = 0;
812                 } else {
813                     $yymajor = self::YYNOCODE;
814                 }
815             } elseif ($yyact < self::YYNSTATE + self::YYNRULE) {
816                 $this->yy_reduce($yyact - self::YYNSTATE);
817             } elseif ($yyact == self::YY_ERROR_ACTION) {
818                 if (self::$yyTraceFILE) {
819                     fprintf(self::$yyTraceFILE, "%sSyntax Error!\n",
820                         self::$yyTracePrompt);
821                 }
822                 if (self::YYERRORSYMBOL) {
823                     if ($this->yyerrcnt < 0) {
824                         $this->yy_syntax_error($yymajor, $yytokenvalue);
825                     }
826                     $yymx = $this->yystack[$this->yyidx]->major;
827                     if ($yymx == self::YYERRORSYMBOL || $yyerrorhit ){
828                         if (self::$yyTraceFILE) {
829                             fprintf(self::$yyTraceFILE, "%sDiscard input token %s\n",
830                                 self::$yyTracePrompt, $this->yyTokenName[$yymajor]);
831                         }
832                         $this->yy_destructor($yymajor, $yytokenvalue);
833                         $yymajor = self::YYNOCODE;
834                     } else {
835                         while ($this->yyidx >= 0 &&
836                                  $yymx != self::YYERRORSYMBOL &&
837         ($yyact = $this->yy_find_shift_action(self::YYERRORSYMBOL)) >= self::YYNSTATE
838                               ){
839                             $this->yy_pop_parser_stack();
840                         }
841                         if ($this->yyidx < 0 || $yymajor==0) {
842                             $this->yy_destructor($yymajor, $yytokenvalue);
843                             $this->yy_parse_failed();
844                             $yymajor = self::YYNOCODE;
845                         } elseif ($yymx != self::YYERRORSYMBOL) {
846                             $u2 = 0;
847                             $this->yy_shift($yyact, self::YYERRORSYMBOL, $u2);
848                         }
849                     }
850                     $this->yyerrcnt = 3;
851                     $yyerrorhit = 1;
852                 } else {
853                     if ($this->yyerrcnt <= 0) {
854                         $this->yy_syntax_error($yymajor, $yytokenvalue);
855                     }
856                     $this->yyerrcnt = 3;
857                     $this->yy_destructor($yymajor, $yytokenvalue);
858                     if ($yyendofinput) {
859                         $this->yy_parse_failed();
860                     }
861                     $yymajor = self::YYNOCODE;
862                 }
863             } else {
864                 $this->yy_accept();
865                 $yymajor = self::YYNOCODE;
866             }            
867         } while ($yymajor != self::YYNOCODE && $this->yyidx >= 0);
868     }
869 }
870 ?>