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;
34 return $this->_string;
39 return isset($this->metadata[$offset]);
44 return $this->metadata[$offset];
49 if ($offset === null) {
50 if (isset($value[0])) {
52 $value->metadata : $value;
53 $this->metadata = array_merge($this->metadata, $x);
56 $offset = count($this->metadata);
58 if ($value === null) {
62 if ($value->metadata) {
63 $this->metadata[$offset] = $value->metadata;
66 $this->metadata[$offset] = $value;
72 unset($this->metadata[$offset]);
86 #line 12 "smarty_internal_configfileparser.y"
89 #line 14 "smarty_internal_configfileparser.y"
95 private $internalError =
false;
99 self::instance($this);
101 $this->smarty = $compiler->smarty;
102 $this->compiler = $compiler;
104 public static function &
instance($new_instance = null)
106 static $instance = null;
107 if (isset($new_instance) && is_object($new_instance))
108 $instance = $new_instance;
112 private function parse_bool($str) {
113 if (in_array(strtolower($str) ,array(
'on',
'yes',
'true'))) {
121 private static $escapes_single = Array(
'\\' =>
'\\',
123 private static function parse_single_quoted_string($qstr) {
124 $escaped_string = substr($qstr, 1, strlen($qstr)-2);
126 $ss = preg_split(
'/(\\\\.)/', $escaped_string, -1, PREG_SPLIT_DELIM_CAPTURE);
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]];
142 private static function parse_double_quoted_string($qstr) {
143 $inner_str = substr($qstr, 1, strlen($qstr)-2);
144 return stripcslashes($inner_str);
147 private static function parse_tripple_double_quoted_string($qstr) {
148 return stripcslashes($qstr);
151 private function set_var(Array $var, Array &$target_array) {
153 $value = $var[
"value"];
155 if ($this->smarty->config_overwrite || !isset($target_array[
'vars'][$key])) {
156 $target_array[
'vars'][$key] = $value;
158 settype($target_array[
'vars'][$key],
'array');
159 $target_array[
'vars'][$key][] = $value;
163 private function add_global_vars(Array $vars) {
164 if (!isset($this->compiler->config_data[
'vars'])) {
165 $this->compiler->config_data[
'vars'] = Array();
167 foreach ($vars as $var) {
168 $this->set_var($var, $this->compiler->config_data);
172 private function add_section_vars($section_name, Array $vars) {
173 if (!isset($this->compiler->config_data[
'sections'][$section_name][
'vars'])) {
174 $this->compiler->config_data[
'sections'][$section_name][
'vars'] = Array();
176 foreach ($vars as $var) {
177 $this->set_var($var, $this->compiler->config_data[
'sections'][$section_name]);
180 #line 173 "smarty_internal_configfileparser.php"
206 29, 30, 34, 33, 24, 13, 19, 25, 35, 21,
207 59, 8, 3, 1, 20, 12, 14, 31, 20, 12,
208 15, 17, 23, 18, 27, 26, 4, 5, 6, 32,
209 2, 11, 28, 22, 16, 9, 7, 10,
212 7, 8, 9, 10, 11, 12, 5, 27, 15, 16,
213 20, 21, 23, 23, 17, 18, 13, 14, 17, 18,
214 15, 2, 17, 4, 25, 26, 6, 3, 3, 14,
215 23, 1, 24, 17, 2, 25, 22, 25,
220 -8, 1, 1, 1, -7, -3, -3, 30, -8, -8,
221 -8, 19, 5, 3, 15, 16, 24, 25, 32, 20,
226 -10, -1, -1, -1, -20, 10, 12, 8, 14, 7,
234 array(7, 8, 9, 10, 11, 12, 15, 16, ),
268 44, 37, 41, 40, 58, 58, 58, 36, 39, 44,
269 44, 58, 58, 58, 58, 58, 58, 58, 58, 58,
270 55, 54, 57, 56, 50, 45, 43, 42, 38, 46,
271 47, 52, 51, 49, 48, 53,
282 static function Trace($TraceFILE, $zTracePrompt)
286 }
elseif (!$zTracePrompt) {
289 self::$yyTraceFILE = $TraceFILE;
290 self::$yyTracePrompt = $zTracePrompt;
295 self::$yyTraceFILE = fopen(
'php://output',
'w');
296 self::$yyTracePrompt =
'<br>';
306 '$',
'OPENB',
'SECTION',
'CLOSEB',
307 'DOT',
'ID',
'EQUAL',
'FLOAT',
308 'INT',
'BOOL',
'SINGLE_QUOTED_STRING',
'DOUBLE_QUOTED_STRING',
309 'TRIPPLE_QUOTES',
'TRIPPLE_TEXT',
'TRIPPLE_QUOTES_END',
'NAKED_STRING',
310 'OTHER',
'NEWLINE',
'COMMENTSTART',
'error',
311 'start',
'global_vars',
'sections',
'var_list',
312 'section',
'newline',
'var',
'value',
316 "start ::= global_vars sections",
317 "global_vars ::= var_list",
318 "sections ::= sections section",
320 "section ::= OPENB SECTION CLOSEB newline var_list",
321 "section ::= OPENB DOT SECTION CLOSEB newline var_list",
322 "var_list ::= var_list newline",
323 "var_list ::= var_list var",
325 "var ::= ID EQUAL value",
329 "value ::= SINGLE_QUOTED_STRING",
330 "value ::= DOUBLE_QUOTED_STRING",
331 "value ::= TRIPPLE_QUOTES TRIPPLE_TEXT TRIPPLE_QUOTES_END",
332 "value ::= TRIPPLE_QUOTES TRIPPLE_QUOTES_END",
333 "value ::= NAKED_STRING",
335 "newline ::= NEWLINE",
336 "newline ::= COMMENTSTART NEWLINE",
337 "newline ::= COMMENTSTART NAKED_STRING NEWLINE",
342 if ($tokenType === 0) {
343 return 'End of Input';
345 if ($tokenType > 0 && $tokenType < count($this->yyTokenName)) {
346 return $this->yyTokenName[$tokenType];
361 if (!count($this->yystack)) {
364 $yytos = array_pop($this->yystack);
365 if (self::$yyTraceFILE && $this->yyidx >= 0) {
366 fwrite(self::$yyTraceFILE,
367 self::$yyTracePrompt .
'Popping ' . $this->yyTokenName[$yytos->major] .
370 $yymajor = $yytos->major;
371 self::yy_destructor($yymajor, $yytos->minor);
378 while ($this->yystack !== Array()) {
381 if (is_resource(self::$yyTraceFILE)) {
382 fclose(self::$yyTraceFILE);
389 $expected = self::$yyExpectedTokens[$state];
390 if (in_array($token, self::$yyExpectedTokens[$state],
true)) {
397 if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) {
401 if ($done++ == 100) {
403 $this->yystack = $stack;
406 return array_unique($expected);
408 $yyruleno = $yyact - self::YYNSTATE;
409 $this->yyidx -= self::$yyRuleInfo[$yyruleno][
'rhs'];
411 $this->yystack[$this->yyidx]->stateno,
412 self::$yyRuleInfo[$yyruleno][
'lhs']);
413 if (isset(self::$yyExpectedTokens[$nextstate])) {
414 $expected = array_merge($expected, self::$yyExpectedTokens[$nextstate]);
416 self::$yyExpectedTokens[$nextstate],
true)) {
418 $this->yystack = $stack;
419 return array_unique($expected);
422 if ($nextstate < self::YYNSTATE) {
426 $x->stateno = $nextstate;
427 $x->major = self::$yyRuleInfo[$yyruleno][
'lhs'];
430 }
elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) {
432 $this->yystack = $stack;
436 return array_unique($expected);
437 }
elseif ($nextstate === self::YY_NO_ACTION) {
439 $this->yystack = $stack;
450 $this->yystack = $stack;
451 return array_unique($expected);
460 if (in_array($token, self::$yyExpectedTokens[$state],
true)) {
467 if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) {
471 if ($done++ == 100) {
473 $this->yystack = $stack;
478 $yyruleno = $yyact - self::YYNSTATE;
479 $this->yyidx -= self::$yyRuleInfo[$yyruleno][
'rhs'];
481 $this->yystack[$this->yyidx]->stateno,
482 self::$yyRuleInfo[$yyruleno][
'lhs']);
483 if (isset(self::$yyExpectedTokens[$nextstate]) &&
484 in_array($token, self::$yyExpectedTokens[$nextstate],
true)) {
486 $this->yystack = $stack;
489 if ($nextstate < self::YYNSTATE) {
493 $x->stateno = $nextstate;
494 $x->major = self::$yyRuleInfo[$yyruleno][
'lhs'];
497 }
elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) {
499 $this->yystack = $stack;
508 }
elseif ($nextstate === self::YY_NO_ACTION) {
510 $this->yystack = $stack;
521 $this->yystack = $stack;
530 if (!isset(self::$yy_shift_ofst[$stateno])) {
532 return self::$yy_default[$stateno];
534 $i = self::$yy_shift_ofst[$stateno];
535 if (
$i === self::YY_SHIFT_USE_DFLT) {
536 return self::$yy_default[$stateno];
538 if ($iLookAhead == self::YYNOCODE) {
539 return self::YY_NO_ACTION;
542 if ($i < 0 || $i >= self::YY_SZ_ACTTAB ||
543 self::$yy_lookahead[
$i] != $iLookAhead) {
544 if (count(self::$yyFallback) && $iLookAhead < count(self::$yyFallback)
545 && ($iFallback = self::$yyFallback[$iLookAhead]) != 0) {
546 if (self::$yyTraceFILE) {
547 fwrite(self::$yyTraceFILE, self::$yyTracePrompt .
"FALLBACK " .
548 $this->yyTokenName[$iLookAhead] .
" => " .
549 $this->yyTokenName[$iFallback] .
"\n");
553 return self::$yy_default[$stateno];
555 return self::$yy_action[
$i];
563 if (!isset(self::$yy_reduce_ofst[$stateno])) {
564 return self::$yy_default[$stateno];
566 $i = self::$yy_reduce_ofst[$stateno];
567 if (
$i == self::YY_REDUCE_USE_DFLT) {
568 return self::$yy_default[$stateno];
570 if ($iLookAhead == self::YYNOCODE) {
571 return self::YY_NO_ACTION;
574 if ($i < 0 || $i >= self::YY_SZ_ACTTAB ||
575 self::$yy_lookahead[
$i] != $iLookAhead) {
576 return self::$yy_default[$stateno];
578 return self::$yy_action[
$i];
582 function yy_shift($yyNewState, $yyMajor, $yypMinor)
585 if ($this->yyidx >= self::YYSTACKDEPTH) {
587 if (self::$yyTraceFILE) {
588 fprintf(self::$yyTraceFILE,
"%sStack Overflow!\n", self::$yyTracePrompt);
590 while ($this->yyidx >= 0) {
593 #line 125 "smarty_internal_configfileparser.y"
595 $this->internalError =
true;
596 $this->compiler->trigger_config_file_error(
"Stack overflow in configfile parser");
597 #line 593 "smarty_internal_configfileparser.php"
601 $yytos->stateno = $yyNewState;
602 $yytos->major = $yyMajor;
603 $yytos->minor = $yypMinor;
604 array_push($this->yystack, $yytos);
605 if (self::$yyTraceFILE && $this->yyidx > 0) {
606 fprintf(self::$yyTraceFILE,
"%sShift %d\n", self::$yyTracePrompt,
608 fprintf(self::$yyTraceFILE,
"%sStack:", self::$yyTracePrompt);
610 fprintf(self::$yyTraceFILE,
" %s",
611 $this->yyTokenName[$this->yystack[
$i]->major]);
613 fwrite(self::$yyTraceFILE,
"\n");
618 array(
'lhs' => 20,
'rhs' => 2 ),
619 array(
'lhs' => 21,
'rhs' => 1 ),
620 array(
'lhs' => 22,
'rhs' => 2 ),
621 array(
'lhs' => 22,
'rhs' => 0 ),
622 array(
'lhs' => 24,
'rhs' => 5 ),
623 array(
'lhs' => 24,
'rhs' => 6 ),
624 array(
'lhs' => 23,
'rhs' => 2 ),
625 array(
'lhs' => 23,
'rhs' => 2 ),
626 array(
'lhs' => 23,
'rhs' => 0 ),
627 array(
'lhs' => 26,
'rhs' => 3 ),
628 array(
'lhs' => 27,
'rhs' => 1 ),
629 array(
'lhs' => 27,
'rhs' => 1 ),
630 array(
'lhs' => 27,
'rhs' => 1 ),
631 array(
'lhs' => 27,
'rhs' => 1 ),
632 array(
'lhs' => 27,
'rhs' => 1 ),
633 array(
'lhs' => 27,
'rhs' => 3 ),
634 array(
'lhs' => 27,
'rhs' => 2 ),
635 array(
'lhs' => 27,
'rhs' => 1 ),
636 array(
'lhs' => 27,
'rhs' => 1 ),
637 array(
'lhs' => 25,
'rhs' => 1 ),
638 array(
'lhs' => 25,
'rhs' => 2 ),
639 array(
'lhs' => 25,
'rhs' => 3 ),
666 #line 131 "smarty_internal_configfileparser.y"
668 $this->_retvalue = null;
670 #line 666 "smarty_internal_configfileparser.php"
671 #line 136 "smarty_internal_configfileparser.y"
673 $this->add_global_vars($this->yystack[$this->yyidx + 0]->minor); $this->_retvalue = null;
675 #line 671 "smarty_internal_configfileparser.php"
676 #line 149 "smarty_internal_configfileparser.y"
678 $this->add_section_vars($this->yystack[$this->yyidx + -3]->minor, $this->yystack[$this->yyidx + 0]->minor);
679 $this->_retvalue = null;
681 #line 677 "smarty_internal_configfileparser.php"
682 #line 154 "smarty_internal_configfileparser.y"
684 if ($this->smarty->config_read_hidden) {
685 $this->add_section_vars($this->yystack[$this->yyidx + -3]->minor, $this->yystack[$this->yyidx + 0]->minor);
687 $this->_retvalue = null;
689 #line 685 "smarty_internal_configfileparser.php"
690 #line 162 "smarty_internal_configfileparser.y"
692 $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor;
694 #line 690 "smarty_internal_configfileparser.php"
695 #line 166 "smarty_internal_configfileparser.y"
697 $this->_retvalue = array_merge($this->yystack[$this->yyidx + -1]->minor, Array($this->yystack[$this->yyidx + 0]->minor));
699 #line 695 "smarty_internal_configfileparser.php"
700 #line 170 "smarty_internal_configfileparser.y"
702 $this->_retvalue = Array();
704 #line 700 "smarty_internal_configfileparser.php"
705 #line 176 "smarty_internal_configfileparser.y"
707 $this->_retvalue = Array(
"key" => $this->yystack[$this->yyidx + -2]->minor,
"value" => $this->yystack[$this->yyidx + 0]->minor);
709 #line 705 "smarty_internal_configfileparser.php"
710 #line 181 "smarty_internal_configfileparser.y"
712 $this->_retvalue = (float) $this->yystack[$this->yyidx + 0]->minor;
714 #line 710 "smarty_internal_configfileparser.php"
715 #line 185 "smarty_internal_configfileparser.y"
717 $this->_retvalue = (int) $this->yystack[$this->yyidx + 0]->minor;
719 #line 715 "smarty_internal_configfileparser.php"
720 #line 189 "smarty_internal_configfileparser.y"
722 $this->_retvalue = $this->parse_bool($this->yystack[$this->yyidx + 0]->minor);
724 #line 720 "smarty_internal_configfileparser.php"
725 #line 193 "smarty_internal_configfileparser.y"
727 $this->_retvalue = self::parse_single_quoted_string($this->yystack[$this->yyidx + 0]->minor);
729 #line 725 "smarty_internal_configfileparser.php"
730 #line 197 "smarty_internal_configfileparser.y"
732 $this->_retvalue = self::parse_double_quoted_string($this->yystack[$this->yyidx + 0]->minor);
734 #line 730 "smarty_internal_configfileparser.php"
735 #line 201 "smarty_internal_configfileparser.y"
737 $this->_retvalue = self::parse_tripple_double_quoted_string($this->yystack[$this->yyidx + -1]->minor);
739 #line 735 "smarty_internal_configfileparser.php"
740 #line 205 "smarty_internal_configfileparser.y"
742 $this->_retvalue =
'';
744 #line 740 "smarty_internal_configfileparser.php"
745 #line 209 "smarty_internal_configfileparser.y"
747 $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor;
749 #line 745 "smarty_internal_configfileparser.php"
756 if (self::$yyTraceFILE && $yyruleno >= 0
757 && $yyruleno < count(self::$yyRuleName)) {
758 fprintf(self::$yyTraceFILE,
"%sReduce (%d) [%s].\n",
759 self::$yyTracePrompt, $yyruleno,
760 self::$yyRuleName[$yyruleno]);
763 $this->_retvalue = $yy_lefthand_side = null;
764 if (array_key_exists($yyruleno, self::$yyReduceMap)) {
766 $this->_retvalue = null;
767 $this->{
'yy_r' . self::$yyReduceMap[$yyruleno]}();
768 $yy_lefthand_side = $this->_retvalue;
770 $yygoto = self::$yyRuleInfo[$yyruleno][
'lhs'];
771 $yysize = self::$yyRuleInfo[$yyruleno][
'rhs'];
772 $this->yyidx -= $yysize;
773 for(
$i = $yysize;
$i;
$i--) {
775 array_pop($this->yystack);
778 if ($yyact < self::YYNSTATE) {
779 if (!self::$yyTraceFILE && $yysize) {
782 $x->stateno = $yyact;
784 $x->minor = $yy_lefthand_side;
787 $this->
yy_shift($yyact, $yygoto, $yy_lefthand_side);
789 }
elseif ($yyact == self::YYNSTATE + self::YYNRULE + 1) {
796 if (self::$yyTraceFILE) {
797 fprintf(self::$yyTraceFILE,
"%sFail!\n", self::$yyTracePrompt);
799 while ($this->yyidx >= 0) {
806 #line 118 "smarty_internal_configfileparser.y"
808 $this->internalError =
true;
809 $this->yymajor = $yymajor;
810 $this->compiler->trigger_config_file_error();
811 #line 808 "smarty_internal_configfileparser.php"
816 if (self::$yyTraceFILE) {
817 fprintf(self::$yyTraceFILE,
"%sAccept!\n", self::$yyTracePrompt);
819 while ($this->yyidx >= 0) {
822 #line 110 "smarty_internal_configfileparser.y"
824 $this->successful = !$this->internalError;
825 $this->internalError =
false;
826 $this->retvalue = $this->_retvalue;
828 #line 826 "smarty_internal_configfileparser.php"
835 if ($this->yyidx === null || $this->yyidx < 0) {
837 $this->yyerrcnt = -1;
841 $this->yystack = array();
842 array_push($this->yystack, $x);
844 $yyendofinput = ($yymajor==0);
846 if (self::$yyTraceFILE) {
847 fprintf(self::$yyTraceFILE,
"%sInput %s\n",
848 self::$yyTracePrompt, $this->yyTokenName[$yymajor]);
853 if ($yymajor < self::YYERRORSYMBOL &&
856 $yyact = self::YY_ERROR_ACTION;
858 if ($yyact < self::YYNSTATE) {
859 $this->
yy_shift($yyact, $yymajor, $yytokenvalue);
861 if ($yyendofinput && $this->yyidx >= 0) {
864 $yymajor = self::YYNOCODE;
866 }
elseif ($yyact < self::YYNSTATE + self::YYNRULE) {
867 $this->
yy_reduce($yyact - self::YYNSTATE);
868 }
elseif ($yyact == self::YY_ERROR_ACTION) {
869 if (self::$yyTraceFILE) {
870 fprintf(self::$yyTraceFILE,
"%sSyntax Error!\n",
871 self::$yyTracePrompt);
873 if (self::YYERRORSYMBOL) {
874 if ($this->yyerrcnt < 0) {
878 if ($yymx == self::YYERRORSYMBOL || $yyerrorhit ){
879 if (self::$yyTraceFILE) {
880 fprintf(self::$yyTraceFILE,
"%sDiscard input token %s\n",
881 self::$yyTracePrompt, $this->yyTokenName[$yymajor]);
884 $yymajor = self::YYNOCODE;
886 while ($this->yyidx >= 0 &&
887 $yymx != self::YYERRORSYMBOL &&
892 if ($this->yyidx < 0 || $yymajor==0) {
895 $yymajor = self::YYNOCODE;
896 }
elseif ($yymx != self::YYERRORSYMBOL) {
898 $this->
yy_shift($yyact, self::YYERRORSYMBOL, $u2);
904 if ($this->yyerrcnt <= 0) {
912 $yymajor = self::YYNOCODE;
916 $yymajor = self::YYNOCODE;
918 }
while ($yymajor != self::YYNOCODE && $this->yyidx >= 0);
doParse($yymajor, $yytokenvalue)
__construct($lex, $compiler)
yy_shift($yyNewState, $yyMajor, $yypMinor)
const TPC_SINGLE_QUOTED_STRING
const TPC_DOUBLE_QUOTED_STRING
yy_is_expected_token($token)
yy_find_reduce_action($stateno, $iLookAhead)
static & instance($new_instance=null)
static yy_destructor($yymajor, $yypminor)
if(strlen($date2)== '10') if($type== 'users-by-age'&&a_priv('admin_users', true)) elseif($type== 'forums-count'&&a_priv('admin_content', true)) elseif($type== 'forums-categories'&&a_priv('admin_content', true)) elseif($type== 'users-count'&&a_priv('admin_users', true)) elseif($type== 'product-categories'&&a_priv('admin_products', true)) elseif($type== 'users-by-sex'&&a_priv('admin_users', true)) elseif($type== 'users-by-country'&&a_priv('admin_users', true)) elseif($type== 'sales'&&a_priv('admin_sales', true))
yy_syntax_error($yymajor, $TOKEN)
const TPC_TRIPPLE_QUOTES_END
static Trace($TraceFILE, $zTracePrompt)
yy_find_shift_action($iLookAhead)
__construct($s, $m=array())
yy_get_expected_tokens($token)
offsetSet($offset, $value)