4 * Smarty Internal Plugin Configfileparser
5 * This is the config file parser.
6 * It is generated from the internal.configfileparser.y file
12 class TPC_yyToken implements ArrayAccess
15 public $metadata = array();
17 public function __construct($s, $m = array())
19 if ($s instanceof TPC_yyToken) {
20 $this->string = $s->string;
21 $this->metadata = $s->metadata;
23 $this->string = (string) $s;
24 if ($m instanceof TPC_yyToken) {
25 $this->metadata = $m->metadata;
26 } elseif (is_array($m)) {
32 public function __toString()
34 return $this->_string;
37 public function offsetExists($offset)
39 return isset($this->metadata[$offset]);
42 public function offsetGet($offset)
44 return $this->metadata[$offset];
47 public function offsetSet($offset, $value)
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);
57 $offset = count($this->metadata);
59 if ($value === null) {
62 if ($value instanceof TPC_yyToken) {
63 if ($value->metadata) {
64 $this->metadata[$offset] = $value->metadata;
67 $this->metadata[$offset] = $value;
71 public function offsetUnset($offset)
73 unset($this->metadata[$offset]);
77 class TPC_yyStackEntry
79 public $stateno; /* The state-number */
80 public $major; /* The major token value. This is the code
81 ** number for the token at this stack level */
82 public $minor; /* The user-supplied minor token value. This
83 ** is the value of the token */
88 #line 12 "smarty_internal_configfileparser.y"
89 class Smarty_Internal_Configfileparser #line 80 "smarty_internal_configfileparser.php"
91 #line 14 "smarty_internal_configfileparser.y"
93 // states whether the parse was successful or not
94 public $successful = true;
97 private $internalError = false;
99 function __construct($lex, $compiler)
101 // set instance object
102 self::instance($this);
104 $this->smarty = $compiler->smarty;
105 $this->compiler = $compiler;
108 public static function &instance($new_instance = null)
110 static $instance = null;
111 if (isset($new_instance) && is_object($new_instance)) {
112 $instance = $new_instance;
117 private function parse_bool($str)
119 if (in_array(strtolower($str), array('on', 'yes', 'true'))) {
127 private static $escapes_single = Array('\\' => '\\',
130 private static function parse_single_quoted_string($qstr)
132 $escaped_string = substr($qstr, 1, strlen($qstr) - 2); //remove outer quotes
134 $ss = preg_split('/(\\\\.)/', $escaped_string, - 1, PREG_SPLIT_DELIM_CAPTURE);
137 foreach ($ss as $s) {
138 if (strlen($s) === 2 && $s[0] === '\\') {
139 if (isset(self::$escapes_single[$s[1]])) {
140 $s = self::$escapes_single[$s[1]];
150 private static function parse_double_quoted_string($qstr)
152 $inner_str = substr($qstr, 1, strlen($qstr) - 2);
153 return stripcslashes($inner_str);
156 private static function parse_tripple_double_quoted_string($qstr)
158 return stripcslashes($qstr);
161 private function set_var(Array $var, Array &$target_array)
164 $value = $var["value"];
166 if ($this->smarty->config_overwrite || !isset($target_array['vars'][$key])) {
167 $target_array['vars'][$key] = $value;
169 settype($target_array['vars'][$key], 'array');
170 $target_array['vars'][$key][] = $value;
174 private function add_global_vars(Array $vars)
176 if (!isset($this->compiler->config_data['vars'])) {
177 $this->compiler->config_data['vars'] = Array();
179 foreach ($vars as $var) {
180 $this->set_var($var, $this->compiler->config_data);
184 private function add_section_vars($section_name, Array $vars)
186 if (!isset($this->compiler->config_data['sections'][$section_name]['vars'])) {
187 $this->compiler->config_data['sections'][$section_name]['vars'] = Array();
189 foreach ($vars as $var) {
190 $this->set_var($var, $this->compiler->config_data['sections'][$section_name]);
194 #line 174 "smarty_internal_configfileparser.php"
197 const TPC_SECTION = 2;
198 const TPC_CLOSEB = 3;
205 const TPC_SINGLE_QUOTED_STRING = 10;
206 const TPC_DOUBLE_QUOTED_STRING = 11;
207 const TPC_TRIPPLE_QUOTES = 12;
208 const TPC_TRIPPLE_TEXT = 13;
209 const TPC_TRIPPLE_QUOTES_END = 14;
210 const TPC_NAKED_STRING = 15;
211 const TPC_OTHER = 16;
212 const TPC_NEWLINE = 17;
213 const TPC_COMMENTSTART = 18;
214 const YY_NO_ACTION = 60;
215 const YY_ACCEPT_ACTION = 59;
216 const YY_ERROR_ACTION = 58;
218 const YY_SZ_ACTTAB = 38;
219 static public $yy_action = array(
221 29, 30, 34, 33, 24, 13, 19, 25, 35, 21,
223 59, 8, 3, 1, 20, 12, 14, 31, 20, 12,
225 15, 17, 23, 18, 27, 26, 4, 5, 6, 32,
227 2, 11, 28, 22, 16, 9, 7, 10,
229 static public $yy_lookahead = array(
231 7, 8, 9, 10, 11, 12, 5, 27, 15, 16,
233 20, 21, 23, 23, 17, 18, 13, 14, 17, 18,
235 15, 2, 17, 4, 25, 26, 6, 3, 3, 14,
237 23, 1, 24, 17, 2, 25, 22, 25,
239 const YY_SHIFT_USE_DFLT = - 8;
240 const YY_SHIFT_MAX = 19;
241 static public $yy_shift_ofst = array(
243 - 8, 1, 1, 1, - 7, - 3, - 3, 30, - 8, - 8,
245 - 8, 19, 5, 3, 15, 16, 24, 25, 32, 20,
247 const YY_REDUCE_USE_DFLT = - 21;
248 const YY_REDUCE_MAX = 10;
249 static public $yy_reduce_ofst = array(
251 - 10, - 1, - 1, - 1, - 20, 10, 12, 8, 14, 7,
255 static public $yyExpectedTokens = array(
265 array(7, 8, 9, 10, 11, 12, 15, 16,),
329 static public $yy_default = array(
331 44, 37, 41, 40, 58, 58, 58, 36, 39, 44,
333 44, 58, 58, 58, 58, 58, 58, 58, 58, 58,
335 55, 54, 57, 56, 50, 45, 43, 42, 38, 46,
337 47, 52, 51, 49, 48, 53,
340 const YYSTACKDEPTH = 100;
343 const YYERRORSYMBOL = 19;
344 const YYERRSYMDT = 'yy0';
345 const YYFALLBACK = 0;
346 public static $yyFallback = array();
348 public function Trace($TraceFILE, $zTracePrompt)
352 } elseif (!$zTracePrompt) {
355 $this->yyTraceFILE = $TraceFILE;
356 $this->yyTracePrompt = $zTracePrompt;
359 public function PrintTrace()
361 $this->yyTraceFILE = fopen('php://output', 'w');
362 $this->yyTracePrompt = '<br>';
366 public $yyTracePrompt;
367 public $yyidx; /* Index of top element in stack */
368 public $yyerrcnt; /* Shifts left before out of the error */
369 public $yystack = array(); /* The parser's stack */
371 public $yyTokenName = array(
372 '$', 'OPENB', 'SECTION', 'CLOSEB',
373 'DOT', 'ID', 'EQUAL', 'FLOAT',
374 'INT', 'BOOL', 'SINGLE_QUOTED_STRING', 'DOUBLE_QUOTED_STRING',
375 'TRIPPLE_QUOTES', 'TRIPPLE_TEXT', 'TRIPPLE_QUOTES_END', 'NAKED_STRING',
376 'OTHER', 'NEWLINE', 'COMMENTSTART', 'error',
377 'start', 'global_vars', 'sections', 'var_list',
378 'section', 'newline', 'var', 'value',
381 public static $yyRuleName = array(
383 "start ::= global_vars sections",
385 "global_vars ::= var_list",
387 "sections ::= sections section",
391 "section ::= OPENB SECTION CLOSEB newline var_list",
393 "section ::= OPENB DOT SECTION CLOSEB newline var_list",
395 "var_list ::= var_list newline",
397 "var_list ::= var_list var",
401 "var ::= ID EQUAL value",
409 "value ::= SINGLE_QUOTED_STRING",
411 "value ::= DOUBLE_QUOTED_STRING",
413 "value ::= TRIPPLE_QUOTES TRIPPLE_TEXT TRIPPLE_QUOTES_END",
415 "value ::= TRIPPLE_QUOTES TRIPPLE_QUOTES_END",
417 "value ::= NAKED_STRING",
421 "newline ::= NEWLINE",
423 "newline ::= COMMENTSTART NEWLINE",
425 "newline ::= COMMENTSTART NAKED_STRING NEWLINE",
428 public function tokenName($tokenType)
430 if ($tokenType === 0) {
431 return 'End of Input';
433 if ($tokenType > 0 && $tokenType < count($this->yyTokenName)) {
434 return $this->yyTokenName[$tokenType];
440 public static function yy_destructor($yymajor, $yypminor)
444 break; /* If no destructor action specified: do nothing */
448 public function yy_pop_parser_stack()
450 if (!count($this->yystack)) {
453 $yytos = array_pop($this->yystack);
454 if ($this->yyTraceFILE && $this->yyidx >= 0) {
455 fwrite($this->yyTraceFILE,
456 $this->yyTracePrompt . 'Popping ' . $this->yyTokenName[$yytos->major] .
459 $yymajor = $yytos->major;
460 self::yy_destructor($yymajor, $yytos->minor);
466 public function __destruct()
468 while ($this->yystack !== Array()) {
469 $this->yy_pop_parser_stack();
471 if (is_resource($this->yyTraceFILE)) {
472 fclose($this->yyTraceFILE);
476 public function yy_get_expected_tokens($token)
478 $state = $this->yystack[$this->yyidx]->stateno;
479 $expected = self::$yyExpectedTokens[$state];
480 if (in_array($token, self::$yyExpectedTokens[$state], true)) {
483 $stack = $this->yystack;
484 $yyidx = $this->yyidx;
486 $yyact = $this->yy_find_shift_action($token);
487 if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) {
491 if ($done ++ == 100) {
492 $this->yyidx = $yyidx;
493 $this->yystack = $stack;
494 // too much recursion prevents proper detection
496 return array_unique($expected);
498 $yyruleno = $yyact - self::YYNSTATE;
499 $this->yyidx -= self::$yyRuleInfo[$yyruleno]['rhs'];
500 $nextstate = $this->yy_find_reduce_action(
501 $this->yystack[$this->yyidx]->stateno,
502 self::$yyRuleInfo[$yyruleno]['lhs']);
503 if (isset(self::$yyExpectedTokens[$nextstate])) {
504 $expected = array_merge($expected, self::$yyExpectedTokens[$nextstate]);
506 self::$yyExpectedTokens[$nextstate], true)) {
507 $this->yyidx = $yyidx;
508 $this->yystack = $stack;
510 return array_unique($expected);
513 if ($nextstate < self::YYNSTATE) {
514 // we need to shift a non-terminal
516 $x = new TPC_yyStackEntry;
517 $x->stateno = $nextstate;
518 $x->major = self::$yyRuleInfo[$yyruleno]['lhs'];
519 $this->yystack[$this->yyidx] = $x;
521 } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) {
522 $this->yyidx = $yyidx;
523 $this->yystack = $stack;
524 // the last token was just ignored, we can't accept
525 // by ignoring input, this is in essence ignoring a
527 return array_unique($expected);
528 } elseif ($nextstate === self::YY_NO_ACTION) {
529 $this->yyidx = $yyidx;
530 $this->yystack = $stack;
531 // input accepted, but not shifted (I guess)
540 $this->yyidx = $yyidx;
541 $this->yystack = $stack;
543 return array_unique($expected);
546 public function yy_is_expected_token($token)
549 return true; // 0 is not part of this
551 $state = $this->yystack[$this->yyidx]->stateno;
552 if (in_array($token, self::$yyExpectedTokens[$state], true)) {
555 $stack = $this->yystack;
556 $yyidx = $this->yyidx;
558 $yyact = $this->yy_find_shift_action($token);
559 if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) {
563 if ($done ++ == 100) {
564 $this->yyidx = $yyidx;
565 $this->yystack = $stack;
566 // too much recursion prevents proper detection
570 $yyruleno = $yyact - self::YYNSTATE;
571 $this->yyidx -= self::$yyRuleInfo[$yyruleno]['rhs'];
572 $nextstate = $this->yy_find_reduce_action(
573 $this->yystack[$this->yyidx]->stateno,
574 self::$yyRuleInfo[$yyruleno]['lhs']);
575 if (isset(self::$yyExpectedTokens[$nextstate]) &&
576 in_array($token, self::$yyExpectedTokens[$nextstate], true)
578 $this->yyidx = $yyidx;
579 $this->yystack = $stack;
583 if ($nextstate < self::YYNSTATE) {
584 // we need to shift a non-terminal
586 $x = new TPC_yyStackEntry;
587 $x->stateno = $nextstate;
588 $x->major = self::$yyRuleInfo[$yyruleno]['lhs'];
589 $this->yystack[$this->yyidx] = $x;
591 } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) {
592 $this->yyidx = $yyidx;
593 $this->yystack = $stack;
595 // end of input: this is valid
598 // the last token was just ignored, we can't accept
599 // by ignoring input, this is in essence ignoring a
602 } elseif ($nextstate === self::YY_NO_ACTION) {
603 $this->yyidx = $yyidx;
604 $this->yystack = $stack;
605 // input accepted, but not shifted (I guess)
614 $this->yyidx = $yyidx;
615 $this->yystack = $stack;
620 public function yy_find_shift_action($iLookAhead)
622 $stateno = $this->yystack[$this->yyidx]->stateno;
624 /* if ($this->yyidx < 0) return self::YY_NO_ACTION; */
625 if (!isset(self::$yy_shift_ofst[$stateno])) {
627 return self::$yy_default[$stateno];
629 $i = self::$yy_shift_ofst[$stateno];
630 if ($i === self::YY_SHIFT_USE_DFLT) {
631 return self::$yy_default[$stateno];
633 if ($iLookAhead == self::YYNOCODE) {
634 return self::YY_NO_ACTION;
637 if ($i < 0 || $i >= self::YY_SZ_ACTTAB ||
638 self::$yy_lookahead[$i] != $iLookAhead
640 if (count(self::$yyFallback) && $iLookAhead < count(self::$yyFallback)
641 && ($iFallback = self::$yyFallback[$iLookAhead]) != 0
643 if ($this->yyTraceFILE) {
644 fwrite($this->yyTraceFILE, $this->yyTracePrompt . "FALLBACK " .
645 $this->yyTokenName[$iLookAhead] . " => " .
646 $this->yyTokenName[$iFallback] . "\n");
649 return $this->yy_find_shift_action($iFallback);
652 return self::$yy_default[$stateno];
654 return self::$yy_action[$i];
658 public function yy_find_reduce_action($stateno, $iLookAhead)
660 /* $stateno = $this->yystack[$this->yyidx]->stateno; */
662 if (!isset(self::$yy_reduce_ofst[$stateno])) {
663 return self::$yy_default[$stateno];
665 $i = self::$yy_reduce_ofst[$stateno];
666 if ($i == self::YY_REDUCE_USE_DFLT) {
667 return self::$yy_default[$stateno];
669 if ($iLookAhead == self::YYNOCODE) {
670 return self::YY_NO_ACTION;
673 if ($i < 0 || $i >= self::YY_SZ_ACTTAB ||
674 self::$yy_lookahead[$i] != $iLookAhead
676 return self::$yy_default[$stateno];
678 return self::$yy_action[$i];
682 public function yy_shift($yyNewState, $yyMajor, $yypMinor)
685 if ($this->yyidx >= self::YYSTACKDEPTH) {
687 if ($this->yyTraceFILE) {
688 fprintf($this->yyTraceFILE, "%sStack Overflow!\n", $this->yyTracePrompt);
690 while ($this->yyidx >= 0) {
691 $this->yy_pop_parser_stack();
693 #line 125 "smarty_internal_configfileparser.y"
695 $this->internalError = true;
696 $this->compiler->trigger_config_file_error("Stack overflow in configfile parser");
697 #line 601 "smarty_internal_configfileparser.php"
701 $yytos = new TPC_yyStackEntry;
702 $yytos->stateno = $yyNewState;
703 $yytos->major = $yyMajor;
704 $yytos->minor = $yypMinor;
705 array_push($this->yystack, $yytos);
706 if ($this->yyTraceFILE && $this->yyidx > 0) {
707 fprintf($this->yyTraceFILE, "%sShift %d\n", $this->yyTracePrompt,
709 fprintf($this->yyTraceFILE, "%sStack:", $this->yyTracePrompt);
710 for ($i = 1; $i <= $this->yyidx; $i ++) {
711 fprintf($this->yyTraceFILE, " %s",
712 $this->yyTokenName[$this->yystack[$i]->major]);
714 fwrite($this->yyTraceFILE, "\n");
718 public static $yyRuleInfo = array(
719 array('lhs' => 20, 'rhs' => 2),
720 array('lhs' => 21, 'rhs' => 1),
721 array('lhs' => 22, 'rhs' => 2),
722 array('lhs' => 22, 'rhs' => 0),
723 array('lhs' => 24, 'rhs' => 5),
724 array('lhs' => 24, 'rhs' => 6),
725 array('lhs' => 23, 'rhs' => 2),
726 array('lhs' => 23, 'rhs' => 2),
727 array('lhs' => 23, 'rhs' => 0),
728 array('lhs' => 26, 'rhs' => 3),
729 array('lhs' => 27, 'rhs' => 1),
730 array('lhs' => 27, 'rhs' => 1),
731 array('lhs' => 27, 'rhs' => 1),
732 array('lhs' => 27, 'rhs' => 1),
733 array('lhs' => 27, 'rhs' => 1),
734 array('lhs' => 27, 'rhs' => 3),
735 array('lhs' => 27, 'rhs' => 2),
736 array('lhs' => 27, 'rhs' => 1),
737 array('lhs' => 27, 'rhs' => 1),
738 array('lhs' => 25, 'rhs' => 1),
739 array('lhs' => 25, 'rhs' => 2),
740 array('lhs' => 25, 'rhs' => 3),
743 public static $yyReduceMap = array(
768 #line 131 "smarty_internal_configfileparser.y"
771 $this->_retvalue = null;
773 #line 675 "smarty_internal_configfileparser.php"
774 #line 136 "smarty_internal_configfileparser.y"
777 $this->add_global_vars($this->yystack[$this->yyidx + 0]->minor);
778 $this->_retvalue = null;
780 #line 680 "smarty_internal_configfileparser.php"
781 #line 149 "smarty_internal_configfileparser.y"
784 $this->add_section_vars($this->yystack[$this->yyidx + - 3]->minor, $this->yystack[$this->yyidx + 0]->minor);
785 $this->_retvalue = null;
787 #line 686 "smarty_internal_configfileparser.php"
788 #line 154 "smarty_internal_configfileparser.y"
791 if ($this->smarty->config_read_hidden) {
792 $this->add_section_vars($this->yystack[$this->yyidx + - 3]->minor, $this->yystack[$this->yyidx + 0]->minor);
794 $this->_retvalue = null;
796 #line 694 "smarty_internal_configfileparser.php"
797 #line 162 "smarty_internal_configfileparser.y"
800 $this->_retvalue = $this->yystack[$this->yyidx + - 1]->minor;
802 #line 699 "smarty_internal_configfileparser.php"
803 #line 166 "smarty_internal_configfileparser.y"
806 $this->_retvalue = array_merge($this->yystack[$this->yyidx + - 1]->minor, Array($this->yystack[$this->yyidx + 0]->minor));
808 #line 704 "smarty_internal_configfileparser.php"
809 #line 170 "smarty_internal_configfileparser.y"
812 $this->_retvalue = Array();
814 #line 709 "smarty_internal_configfileparser.php"
815 #line 176 "smarty_internal_configfileparser.y"
818 $this->_retvalue = Array("key" => $this->yystack[$this->yyidx + - 2]->minor, "value" => $this->yystack[$this->yyidx + 0]->minor);
820 #line 714 "smarty_internal_configfileparser.php"
821 #line 181 "smarty_internal_configfileparser.y"
824 $this->_retvalue = (float) $this->yystack[$this->yyidx + 0]->minor;
826 #line 719 "smarty_internal_configfileparser.php"
827 #line 185 "smarty_internal_configfileparser.y"
830 $this->_retvalue = (int) $this->yystack[$this->yyidx + 0]->minor;
832 #line 724 "smarty_internal_configfileparser.php"
833 #line 189 "smarty_internal_configfileparser.y"
836 $this->_retvalue = $this->parse_bool($this->yystack[$this->yyidx + 0]->minor);
838 #line 729 "smarty_internal_configfileparser.php"
839 #line 193 "smarty_internal_configfileparser.y"
842 $this->_retvalue = self::parse_single_quoted_string($this->yystack[$this->yyidx + 0]->minor);
844 #line 734 "smarty_internal_configfileparser.php"
845 #line 197 "smarty_internal_configfileparser.y"
848 $this->_retvalue = self::parse_double_quoted_string($this->yystack[$this->yyidx + 0]->minor);
850 #line 739 "smarty_internal_configfileparser.php"
851 #line 201 "smarty_internal_configfileparser.y"
854 $this->_retvalue = self::parse_tripple_double_quoted_string($this->yystack[$this->yyidx + - 1]->minor);
856 #line 744 "smarty_internal_configfileparser.php"
857 #line 205 "smarty_internal_configfileparser.y"
860 $this->_retvalue = '';
862 #line 749 "smarty_internal_configfileparser.php"
863 #line 209 "smarty_internal_configfileparser.y"
866 $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor;
869 #line 754 "smarty_internal_configfileparser.php"
873 public function yy_reduce($yyruleno)
875 $yymsp = $this->yystack[$this->yyidx];
876 if ($this->yyTraceFILE && $yyruleno >= 0
877 && $yyruleno < count(self::$yyRuleName)
879 fprintf($this->yyTraceFILE, "%sReduce (%d) [%s].\n",
880 $this->yyTracePrompt, $yyruleno,
881 self::$yyRuleName[$yyruleno]);
884 $this->_retvalue = $yy_lefthand_side = null;
885 if (array_key_exists($yyruleno, self::$yyReduceMap)) {
887 $this->_retvalue = null;
888 $this->{'yy_r' . self::$yyReduceMap[$yyruleno]}();
889 $yy_lefthand_side = $this->_retvalue;
891 $yygoto = self::$yyRuleInfo[$yyruleno]['lhs'];
892 $yysize = self::$yyRuleInfo[$yyruleno]['rhs'];
893 $this->yyidx -= $yysize;
894 for ($i = $yysize; $i; $i --) {
895 // pop all of the right-hand side parameters
896 array_pop($this->yystack);
898 $yyact = $this->yy_find_reduce_action($this->yystack[$this->yyidx]->stateno, $yygoto);
899 if ($yyact < self::YYNSTATE) {
900 if (!$this->yyTraceFILE && $yysize) {
902 $x = new TPC_yyStackEntry;
903 $x->stateno = $yyact;
905 $x->minor = $yy_lefthand_side;
906 $this->yystack[$this->yyidx] = $x;
908 $this->yy_shift($yyact, $yygoto, $yy_lefthand_side);
910 } elseif ($yyact == self::YYNSTATE + self::YYNRULE + 1) {
915 public function yy_parse_failed()
917 if ($this->yyTraceFILE) {
918 fprintf($this->yyTraceFILE, "%sFail!\n", $this->yyTracePrompt);
920 while ($this->yyidx >= 0) {
921 $this->yy_pop_parser_stack();
925 public function yy_syntax_error($yymajor, $TOKEN)
927 #line 118 "smarty_internal_configfileparser.y"
929 $this->internalError = true;
930 $this->yymajor = $yymajor;
931 $this->compiler->trigger_config_file_error();
932 #line 816 "smarty_internal_configfileparser.php"
935 public function yy_accept()
937 if ($this->yyTraceFILE) {
938 fprintf($this->yyTraceFILE, "%sAccept!\n", $this->yyTracePrompt);
940 while ($this->yyidx >= 0) {
941 $stack = $this->yy_pop_parser_stack();
943 #line 110 "smarty_internal_configfileparser.y"
945 $this->successful = !$this->internalError;
946 $this->internalError = false;
947 $this->retvalue = $this->_retvalue;
948 //echo $this->retvalue."\n\n";
949 #line 833 "smarty_internal_configfileparser.php"
952 public function doParse($yymajor, $yytokenvalue)
954 $yyerrorhit = 0; /* True if yymajor has invoked an error */
956 if ($this->yyidx === null || $this->yyidx < 0) {
958 $this->yyerrcnt = - 1;
959 $x = new TPC_yyStackEntry;
962 $this->yystack = array();
963 array_push($this->yystack, $x);
965 $yyendofinput = ($yymajor == 0);
967 if ($this->yyTraceFILE) {
968 fprintf($this->yyTraceFILE, "%sInput %s\n",
969 $this->yyTracePrompt, $this->yyTokenName[$yymajor]);
973 $yyact = $this->yy_find_shift_action($yymajor);
974 if ($yymajor < self::YYERRORSYMBOL &&
975 !$this->yy_is_expected_token($yymajor)
977 // force a syntax error
978 $yyact = self::YY_ERROR_ACTION;
980 if ($yyact < self::YYNSTATE) {
981 $this->yy_shift($yyact, $yymajor, $yytokenvalue);
983 if ($yyendofinput && $this->yyidx >= 0) {
986 $yymajor = self::YYNOCODE;
988 } elseif ($yyact < self::YYNSTATE + self::YYNRULE) {
989 $this->yy_reduce($yyact - self::YYNSTATE);
990 } elseif ($yyact == self::YY_ERROR_ACTION) {
991 if ($this->yyTraceFILE) {
992 fprintf($this->yyTraceFILE, "%sSyntax Error!\n",
993 $this->yyTracePrompt);
995 if (self::YYERRORSYMBOL) {
996 if ($this->yyerrcnt < 0) {
997 $this->yy_syntax_error($yymajor, $yytokenvalue);
999 $yymx = $this->yystack[$this->yyidx]->major;
1000 if ($yymx == self::YYERRORSYMBOL || $yyerrorhit) {
1001 if ($this->yyTraceFILE) {
1002 fprintf($this->yyTraceFILE, "%sDiscard input token %s\n",
1003 $this->yyTracePrompt, $this->yyTokenName[$yymajor]);
1005 $this->yy_destructor($yymajor, $yytokenvalue);
1006 $yymajor = self::YYNOCODE;
1008 while ($this->yyidx >= 0 &&
1009 $yymx != self::YYERRORSYMBOL &&
1010 ($yyact = $this->yy_find_shift_action(self::YYERRORSYMBOL)) >= self::YYNSTATE
1012 $this->yy_pop_parser_stack();
1014 if ($this->yyidx < 0 || $yymajor == 0) {
1015 $this->yy_destructor($yymajor, $yytokenvalue);
1016 $this->yy_parse_failed();
1017 $yymajor = self::YYNOCODE;
1018 } elseif ($yymx != self::YYERRORSYMBOL) {
1020 $this->yy_shift($yyact, self::YYERRORSYMBOL, $u2);
1023 $this->yyerrcnt = 3;
1026 if ($this->yyerrcnt <= 0) {
1027 $this->yy_syntax_error($yymajor, $yytokenvalue);
1029 $this->yyerrcnt = 3;
1030 $this->yy_destructor($yymajor, $yytokenvalue);
1031 if ($yyendofinput) {
1032 $this->yy_parse_failed();
1034 $yymajor = self::YYNOCODE;
1038 $yymajor = self::YYNOCODE;
1040 } while ($yymajor != self::YYNOCODE && $this->yyidx >= 0);