From 418a1fd443027a35589fe175e29dd02dff8667b2 Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Wed, 9 Aug 2017 11:15:33 +0200 Subject: [PATCH] - improvement repeated delimiter like {{ and }} will be treated as literal https://groups.google.com/forum/#!topic/smarty-developers/h9r82Bx4KZw --- change_log.txt | 4 + lexer/smarty_internal_configfilelexer.plex | 4 + lexer/smarty_internal_templatelexer.plex | 59 +- libs/Smarty.class.php | 2 +- .../smarty_internal_configfilelexer.php | 306 +- .../smarty_internal_configfileparser.php | 1143 +++---- .../smarty_internal_templatelexer.php | 471 ++- .../smarty_internal_templateparser.php | 3042 +++++++++-------- 8 files changed, 2501 insertions(+), 2530 deletions(-) diff --git a/change_log.txt b/change_log.txt index fbdf0ab5..19fccc1b 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,8 @@ ===== 3.1.32 - dev === +09.8.2017 + - improvement repeated delimiter like {{ and }} will be treated as literal + https://groups.google.com/forum/#!topic/smarty-developers/h9r82Bx4KZw + 05.8.2017 - bugfix wordwrap modifier could fail if used in nocache code. converted plugin file shared.mb_wordwrap.php into modifier.mb_wordwrap.php diff --git a/lexer/smarty_internal_configfilelexer.plex b/lexer/smarty_internal_configfilelexer.plex index 5b494084..1741206a 100644 --- a/lexer/smarty_internal_configfilelexer.plex +++ b/lexer/smarty_internal_configfilelexer.plex @@ -138,6 +138,10 @@ class Smarty_Internal_Configfilelexer $this->configBooleanize = $this->smarty->config_booleanize; } + public function replace ($input) { + return $input; + } + public function PrintTrace() { $this->yyTraceFILE = fopen('php://output', 'w'); diff --git a/lexer/smarty_internal_templatelexer.plex b/lexer/smarty_internal_templatelexer.plex index 98ff6f40..cb2ec22e 100644 --- a/lexer/smarty_internal_templatelexer.plex +++ b/lexer/smarty_internal_templatelexer.plex @@ -240,9 +240,11 @@ class Smarty_Internal_Templatelexer $this->line = 1; $this->smarty = $compiler->smarty; $this->compiler = $compiler; - $this->ldel = preg_quote($this->smarty->left_delimiter, '/'); + $this->pldel = preg_quote($this->smarty->left_delimiter, '/'); + $this->ldel = $this->pldel . ($this->smarty->auto_literal ? '(?!\\s+)' : '\\s*'); $this->ldel_length = strlen($this->smarty->left_delimiter); - $this->rdel = preg_quote($this->smarty->right_delimiter, '/'); + $rdel = preg_quote($this->smarty->right_delimiter, '/'); + $this->rdel = "(?rdel_length = strlen($this->smarty->right_delimiter); $this->smarty_token_names['LDEL'] = $this->smarty->left_delimiter; $this->smarty_token_names['RDEL'] = $this->smarty->right_delimiter; @@ -253,13 +255,8 @@ class Smarty_Internal_Templatelexer $this->yyTraceFILE = fopen('php://output', 'w'); $this->yyTracePrompt = '
'; } - - /* - * Check if this tag is autoliteral - */ - public function isAutoLiteral () - { - return $this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false; + public function replace ($input) { + return str_replace(array('SMARTYldel','SMARTYrawldel','SMARTYrdel'),array($this->ldel,$this->pldel,$this->rdel),$input); } /*!lex2php @@ -269,15 +266,16 @@ class Smarty_Internal_Templatelexer %value $this->value %line $this->line linebreak = ~[\t ]*[\r\n]+[\t ]*~ + ldelrepeat = ~SMARTYrawldel{2,}~ text = ~[\S\s]~ textdoublequoted = ~([^"\\]*?)((?:\\.[^"\\]*?)*?)(?=(SMARTYldel|\$|`\$|"))~ namespace = ~([0-9]*[a-zA-Z_]\w*)?(\\[0-9]*[a-zA-Z_]\w*)+~ all = ~[\S\s]+~ emptyjava = ~[{][}]~ - phptag = ~(SMARTYldel\s*php([ ].*?)?SMARTYrdel)|(SMARTYldel\s*[/]phpSMARTYrdel)~ + phptag = ~(SMARTYldelphp([ ].*?)?SMARTYrdel)|(SMARTYldel[/]phpSMARTYrdel)~ phpstart = ~(<[?]((php\s+|=)|\s+))|(<[%])|(<[?]xml\s+)|()|([?][>])|([%][>])~ slash = ~[/]~ - ldel = ~SMARTYldel\s*~ + ldel = ~SMARTYldel~ rdel = ~\s*SMARTYrdel~ nocacherdel = ~(\s+nocache)?\s*SMARTYrdel~ notblockid = ~(?:(?!block)[0-9]*[a-zA-Z_]\w*)~ @@ -351,31 +349,27 @@ class Smarty_Internal_Templatelexer phptag { $this->compiler->getTagCompiler('private_php')->parsePhp($this); } + ldelrepeat { + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } ldel literal rdel { - if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } else { $this->token = Smarty_Internal_Templateparser::TP_LITERALSTART; $this->yypushstate(self::LITERAL); - } + } + ldel slash literal rdel { + $this->token = Smarty_Internal_Templateparser::TP_LITERALEND; + $this->yypushstate(self::LITERAL); } ldel { - if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } else { $this->yypushstate(self::TAG); return true; - } - } - rdel { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; } phpstart { $this->compiler->getTagCompiler('private_php')->parsePhp($this); } text { $to = $this->dataLength; - preg_match("/($this->ldel)|(<[?]((php\s+|=)|\s+))|(<[%])|(<[?]xml\s+)|()|([?][>])|([%][>])/i",$this->data,$match,PREG_OFFSET_CAPTURE,$this->counter); + preg_match("/((?pldel){$this->ldel})|(<[?]((php\s+|=)|\s+))|(<[%])|(<[?]xml\s+)|()|([?][>])|([%][>])/i",$this->data,$match,PREG_OFFSET_CAPTURE,$this->counter); if (isset($match[0][1])) { $to = $match[0][1]; } @@ -450,12 +444,8 @@ class Smarty_Internal_Templatelexer $this->yypopstate(); } ldel { - if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } else { $this->yypushstate(self::TAG); return true; - } } double_quote { $this->token = Smarty_Internal_Templateparser::TP_QUOTE; @@ -627,6 +617,9 @@ class Smarty_Internal_Templatelexer */ /*!lex2php %statename DOUBLEQUOTEDSTRING + ldelrepeat { + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } ldel literal rdel { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } @@ -634,29 +627,17 @@ class Smarty_Internal_Templatelexer $this->token = Smarty_Internal_Templateparser::TP_TEXT; } ldel slash { - if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } else { $this->yypushstate(self::TAG); return true; - } } ldel id { - if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } else { $this->yypushstate(self::TAG); return true; - } } ldel { - if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } else { $this->token = Smarty_Internal_Templateparser::TP_LDEL; $this->taglineno = $this->line; $this->yypushstate(self::TAGBODY); - } } double_quote { $this->token = Smarty_Internal_Templateparser::TP_QUOTE; diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 6916782d..ab866ea0 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -108,7 +108,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.32-dev-18'; + const SMARTY_VERSION = '3.1.32-dev-19'; /** * define variable scopes diff --git a/libs/sysplugins/smarty_internal_configfilelexer.php b/libs/sysplugins/smarty_internal_configfilelexer.php index 942f37cd..d22b5146 100644 --- a/libs/sysplugins/smarty_internal_configfilelexer.php +++ b/libs/sysplugins/smarty_internal_configfilelexer.php @@ -3,9 +3,10 @@ * Smarty Internal Plugin Configfilelexer * * This is the lexer to break the config file source into tokens - * @package Smarty + * + * @package Smarty * @subpackage Config - * @author Uwe Tews + * @author Uwe Tews */ /** @@ -14,12 +15,18 @@ * This is the config file lexer. * It is generated from the smarty_internal_configfilelexer.plex file * - * @package Smarty + * @package Smarty * @subpackage Compiler - * @author Uwe Tews + * @author Uwe Tews */ class Smarty_Internal_Configfilelexer { + const START = 1; + const VALUE = 2; + const NAKED_STRING_VALUE = 3; + const COMMENT = 4; + const SECTION = 5; + const TRIPPLE = 6; /** * Source * @@ -68,18 +75,6 @@ class Smarty_Internal_Configfilelexer * @var Smarty */ public $smarty = null; - /** - * compiler object - * - * @var Smarty_Internal_Config_File_Compiler - */ - private $compiler = null; - /** - * copy of config_booleanize - * - * @var bool - */ - private $configBooleanize = false; /** * trace file * @@ -97,8 +92,27 @@ class Smarty_Internal_Configfilelexer * * @var array */ - public $state_name = array(1 => 'START', 2 => 'VALUE', 3 => 'NAKED_STRING_VALUE', 4 => 'COMMENT', 5 => 'SECTION', 6 => 'TRIPPLE'); - + public $state_name = array(1 => 'START', 2 => 'VALUE', 3 => 'NAKED_STRING_VALUE', 4 => 'COMMENT', 5 => 'SECTION', + 6 => 'TRIPPLE'); + /** + * token names + * + * @var array + */ + public $smarty_token_names = array( // Text for parser error messages + ); + /** + * compiler object + * + * @var Smarty_Internal_Config_File_Compiler + */ + private $compiler = null; + /** + * copy of config_booleanize + * + * @var bool + */ + private $configBooleanize = false; /** * storage for assembled token patterns * @@ -110,14 +124,8 @@ class Smarty_Internal_Configfilelexer private $yy_global_pattern4 = null; private $yy_global_pattern5 = null; private $yy_global_pattern6 = null; - - /** - * token names - * - * @var array - */ - public $smarty_token_names = array( // Text for parser error messages - ); + private $_yy_state = 1; + private $_yy_stack = array(); /** * constructor @@ -143,54 +151,25 @@ class Smarty_Internal_Configfilelexer { $this->yyTraceFILE = fopen('php://output', 'w'); $this->yyTracePrompt = '
'; - } - - - private $_yy_state = 1; - private $_yy_stack = array(); - - public function yylex() - { - return $this->{'yylex' . $this->_yy_state}(); - } - - public function yypushstate($state) - { - if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, "%sState push %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state); - } - array_push($this->_yy_stack, $this->_yy_state); - $this->_yy_state = $state; - if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, "%snew State %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state); - } - } - - public function yypopstate() - { - if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, "%sState pop %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state); - } - $this->_yy_state = array_pop($this->_yy_stack); - if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, "%snew State %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state); - } - - } + } // end function public function yybegin($state) { $this->_yy_state = $state; if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, "%sState set %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state); + fprintf($this->yyTraceFILE, + "%sState set %s\n", + $this->yyTracePrompt, + isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : + $this->_yy_state); } } - - public function yylex1() +public function yylex1() { if (!isset($this->yy_global_pattern1)) { - $this->yy_global_pattern1 = "/\G(#|;)|\G(\\[)|\G(\\])|\G(=)|\G([ \t\r]+)|\G(\n)|\G([0-9]*[a-zA-Z_]\\w*)|\G([\S\s])/isS"; + $this->yy_global_pattern1 = + $this->replace("/\G(#|;)|\G(\\[)|\G(\\])|\G(=)|\G([ \t\r]+)|\G(\n)|\G([0-9]*[a-zA-Z_]\\w*)|\G([\S\s])/isS"); } if (!isset($this->dataLength)) { $this->dataLength = strlen($this->data); @@ -207,9 +186,10 @@ class Smarty_Internal_Configfilelexer $yymatches = array_filter($yymatches); } if (empty($yymatches)) { - throw new Exception('Error: lexing failed because a rule matched' . - ' an empty string. Input "' . substr($this->data, - $this->counter, 5) . '... state START'); + throw new Exception('Error: lexing failed because a rule matched' . ' an empty string. Input "' . + substr($this->data, + $this->counter, + 5) . '... state START'); } next($yymatches); // skip global match $this->token = key($yymatches); // token number @@ -220,11 +200,11 @@ class Smarty_Internal_Configfilelexer $this->line += substr_count($this->value, "\n"); // accept this token return true; - } elseif ($r === true) { + } else if ($r === true) { // we have changed state // process this token in the new state return $this->yylex(); - } elseif ($r === false) { + } else if ($r === false) { $this->counter += strlen($this->value); $this->line += substr_count($this->value, "\n"); if ($this->counter >= $this->dataLength) { @@ -234,16 +214,22 @@ class Smarty_Internal_Configfilelexer continue; } } else { - throw new Exception('Unexpected input at line' . $this->line . - ': ' . $this->data[$this->counter]); + throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[ $this->counter ]); } break; } while (true); - } // end function + } + public function replace($input) + { + return $input; + } - const START = 1; + public function yylex() + { + return $this->{'yylex' . $this->_yy_state}(); + } function yy_r1_1() { @@ -252,6 +238,26 @@ class Smarty_Internal_Configfilelexer $this->yypushstate(self::COMMENT); } + public function yypushstate($state) + { + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, + "%sState push %s\n", + $this->yyTracePrompt, + isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : + $this->_yy_state); + } + array_push($this->_yy_stack, $this->_yy_state); + $this->_yy_state = $state; + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, + "%snew State %s\n", + $this->yyTracePrompt, + isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : + $this->_yy_state); + } + } + function yy_r1_2() { @@ -276,7 +282,7 @@ class Smarty_Internal_Configfilelexer { return false; - } + } // end function function yy_r1_6() { @@ -296,11 +302,11 @@ class Smarty_Internal_Configfilelexer $this->token = Smarty_Internal_Configfileparser::TPC_OTHER; } - - public function yylex2() +public function yylex2() { if (!isset($this->yy_global_pattern2)) { - $this->yy_global_pattern2 = "/\G([ \t\r]+)|\G(\\d+\\.\\d+(?=[ \t\r]*[\n#;]))|\G(\\d+(?=[ \t\r]*[\n#;]))|\G(\"\"\")|\G('[^'\\\\]*(?:\\\\.[^'\\\\]*)*'(?=[ \t\r]*[\n#;]))|\G(\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\"(?=[ \t\r]*[\n#;]))|\G([a-zA-Z]+(?=[ \t\r]*[\n#;]))|\G([^\n]+?(?=[ \t\r]*\n))|\G(\n)/isS"; + $this->yy_global_pattern2 = + $this->replace("/\G([ \t\r]+)|\G(\\d+\\.\\d+(?=[ \t\r]*[\n#;]))|\G(\\d+(?=[ \t\r]*[\n#;]))|\G(\"\"\")|\G('[^'\\\\]*(?:\\\\.[^'\\\\]*)*'(?=[ \t\r]*[\n#;]))|\G(\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\"(?=[ \t\r]*[\n#;]))|\G([a-zA-Z]+(?=[ \t\r]*[\n#;]))|\G([^\n]+?(?=[ \t\r]*\n))|\G(\n)/isS"); } if (!isset($this->dataLength)) { $this->dataLength = strlen($this->data); @@ -317,9 +323,10 @@ class Smarty_Internal_Configfilelexer $yymatches = array_filter($yymatches); } if (empty($yymatches)) { - throw new Exception('Error: lexing failed because a rule matched' . - ' an empty string. Input "' . substr($this->data, - $this->counter, 5) . '... state VALUE'); + throw new Exception('Error: lexing failed because a rule matched' . ' an empty string. Input "' . + substr($this->data, + $this->counter, + 5) . '... state VALUE'); } next($yymatches); // skip global match $this->token = key($yymatches); // token number @@ -330,11 +337,11 @@ class Smarty_Internal_Configfilelexer $this->line += substr_count($this->value, "\n"); // accept this token return true; - } elseif ($r === true) { + } else if ($r === true) { // we have changed state // process this token in the new state return $this->yylex(); - } elseif ($r === false) { + } else if ($r === false) { $this->counter += strlen($this->value); $this->line += substr_count($this->value, "\n"); if ($this->counter >= $this->dataLength) { @@ -344,16 +351,12 @@ class Smarty_Internal_Configfilelexer continue; } } else { - throw new Exception('Unexpected input at line' . $this->line . - ': ' . $this->data[$this->counter]); + throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[ $this->counter ]); } break; } while (true); - } // end function - - - const VALUE = 2; + } function yy_r2_1() { @@ -368,6 +371,26 @@ class Smarty_Internal_Configfilelexer $this->yypopstate(); } + public function yypopstate() + { + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, + "%sState pop %s\n", + $this->yyTracePrompt, + isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : + $this->_yy_state); + } + $this->_yy_state = array_pop($this->_yy_stack); + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, + "%snew State %s\n", + $this->yyTracePrompt, + isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : + $this->_yy_state); + } + + } + function yy_r2_3() { @@ -394,12 +417,13 @@ class Smarty_Internal_Configfilelexer $this->token = Smarty_Internal_Configfileparser::TPC_DOUBLE_QUOTED_STRING; $this->yypopstate(); - } + } // end function function yy_r2_7() { - if (!$this->configBooleanize || !in_array(strtolower($this->value), Array("true", "false", "on", "off", "yes", "no"))) { + if (!$this->configBooleanize || + !in_array(strtolower($this->value), Array("true", "false", "on", "off", "yes", "no"))) { $this->yypopstate(); $this->yypushstate(self::NAKED_STRING_VALUE); return true; //reprocess in new state @@ -422,13 +446,12 @@ class Smarty_Internal_Configfilelexer $this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING; $this->value = ""; $this->yypopstate(); - } + } // end function - - public function yylex3() +public function yylex3() { if (!isset($this->yy_global_pattern3)) { - $this->yy_global_pattern3 = "/\G([^\n]+?(?=[ \t\r]*\n))/isS"; + $this->yy_global_pattern3 = $this->replace("/\G([^\n]+?(?=[ \t\r]*\n))/isS"); } if (!isset($this->dataLength)) { $this->dataLength = strlen($this->data); @@ -445,9 +468,10 @@ class Smarty_Internal_Configfilelexer $yymatches = array_filter($yymatches); } if (empty($yymatches)) { - throw new Exception('Error: lexing failed because a rule matched' . - ' an empty string. Input "' . substr($this->data, - $this->counter, 5) . '... state NAKED_STRING_VALUE'); + throw new Exception('Error: lexing failed because a rule matched' . ' an empty string. Input "' . + substr($this->data, + $this->counter, + 5) . '... state NAKED_STRING_VALUE'); } next($yymatches); // skip global match $this->token = key($yymatches); // token number @@ -458,11 +482,11 @@ class Smarty_Internal_Configfilelexer $this->line += substr_count($this->value, "\n"); // accept this token return true; - } elseif ($r === true) { + } else if ($r === true) { // we have changed state // process this token in the new state return $this->yylex(); - } elseif ($r === false) { + } else if ($r === false) { $this->counter += strlen($this->value); $this->line += substr_count($this->value, "\n"); if ($this->counter >= $this->dataLength) { @@ -472,16 +496,12 @@ class Smarty_Internal_Configfilelexer continue; } } else { - throw new Exception('Unexpected input at line' . $this->line . - ': ' . $this->data[$this->counter]); + throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[ $this->counter ]); } break; } while (true); - } // end function - - - const NAKED_STRING_VALUE = 3; + } function yy_r3_1() { @@ -490,11 +510,10 @@ class Smarty_Internal_Configfilelexer $this->yypopstate(); } - - public function yylex4() +public function yylex4() { if (!isset($this->yy_global_pattern4)) { - $this->yy_global_pattern4 = "/\G([ \t\r]+)|\G([^\n]+?(?=[ \t\r]*\n))|\G(\n)/isS"; + $this->yy_global_pattern4 = $this->replace("/\G([ \t\r]+)|\G([^\n]+?(?=[ \t\r]*\n))|\G(\n)/isS"); } if (!isset($this->dataLength)) { $this->dataLength = strlen($this->data); @@ -511,9 +530,10 @@ class Smarty_Internal_Configfilelexer $yymatches = array_filter($yymatches); } if (empty($yymatches)) { - throw new Exception('Error: lexing failed because a rule matched' . - ' an empty string. Input "' . substr($this->data, - $this->counter, 5) . '... state COMMENT'); + throw new Exception('Error: lexing failed because a rule matched' . ' an empty string. Input "' . + substr($this->data, + $this->counter, + 5) . '... state COMMENT'); } next($yymatches); // skip global match $this->token = key($yymatches); // token number @@ -524,11 +544,11 @@ class Smarty_Internal_Configfilelexer $this->line += substr_count($this->value, "\n"); // accept this token return true; - } elseif ($r === true) { + } else if ($r === true) { // we have changed state // process this token in the new state return $this->yylex(); - } elseif ($r === false) { + } else if ($r === false) { $this->counter += strlen($this->value); $this->line += substr_count($this->value, "\n"); if ($this->counter >= $this->dataLength) { @@ -538,16 +558,12 @@ class Smarty_Internal_Configfilelexer continue; } } else { - throw new Exception('Unexpected input at line' . $this->line . - ': ' . $this->data[$this->counter]); + throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[ $this->counter ]); } break; } while (true); - } // end function - - - const COMMENT = 4; + } function yy_r4_1() { @@ -559,7 +575,7 @@ class Smarty_Internal_Configfilelexer { $this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING; - } + } // end function function yy_r4_3() { @@ -568,11 +584,10 @@ class Smarty_Internal_Configfilelexer $this->yypopstate(); } - - public function yylex5() +public function yylex5() { if (!isset($this->yy_global_pattern5)) { - $this->yy_global_pattern5 = "/\G(\\.)|\G(.*?(?=[\.=[\]\r\n]))/isS"; + $this->yy_global_pattern5 = $this->replace("/\G(\\.)|\G(.*?(?=[\.=[\]\r\n]))/isS"); } if (!isset($this->dataLength)) { $this->dataLength = strlen($this->data); @@ -589,9 +604,10 @@ class Smarty_Internal_Configfilelexer $yymatches = array_filter($yymatches); } if (empty($yymatches)) { - throw new Exception('Error: lexing failed because a rule matched' . - ' an empty string. Input "' . substr($this->data, - $this->counter, 5) . '... state SECTION'); + throw new Exception('Error: lexing failed because a rule matched' . ' an empty string. Input "' . + substr($this->data, + $this->counter, + 5) . '... state SECTION'); } next($yymatches); // skip global match $this->token = key($yymatches); // token number @@ -602,11 +618,11 @@ class Smarty_Internal_Configfilelexer $this->line += substr_count($this->value, "\n"); // accept this token return true; - } elseif ($r === true) { + } else if ($r === true) { // we have changed state // process this token in the new state return $this->yylex(); - } elseif ($r === false) { + } else if ($r === false) { $this->counter += strlen($this->value); $this->line += substr_count($this->value, "\n"); if ($this->counter >= $this->dataLength) { @@ -616,16 +632,12 @@ class Smarty_Internal_Configfilelexer continue; } } else { - throw new Exception('Unexpected input at line' . $this->line . - ': ' . $this->data[$this->counter]); + throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[ $this->counter ]); } break; } while (true); - } // end function - - - const SECTION = 5; + } function yy_r5_1() { @@ -638,13 +650,12 @@ class Smarty_Internal_Configfilelexer $this->token = Smarty_Internal_Configfileparser::TPC_SECTION; $this->yypopstate(); - } + } // end function - - public function yylex6() +public function yylex6() { if (!isset($this->yy_global_pattern6)) { - $this->yy_global_pattern6 = "/\G(\"\"\"(?=[ \t\r]*[\n#;]))|\G([\S\s])/isS"; + $this->yy_global_pattern6 = $this->replace("/\G(\"\"\"(?=[ \t\r]*[\n#;]))|\G([\S\s])/isS"); } if (!isset($this->dataLength)) { $this->dataLength = strlen($this->data); @@ -661,9 +672,10 @@ class Smarty_Internal_Configfilelexer $yymatches = array_filter($yymatches); } if (empty($yymatches)) { - throw new Exception('Error: lexing failed because a rule matched' . - ' an empty string. Input "' . substr($this->data, - $this->counter, 5) . '... state TRIPPLE'); + throw new Exception('Error: lexing failed because a rule matched' . ' an empty string. Input "' . + substr($this->data, + $this->counter, + 5) . '... state TRIPPLE'); } next($yymatches); // skip global match $this->token = key($yymatches); // token number @@ -674,11 +686,11 @@ class Smarty_Internal_Configfilelexer $this->line += substr_count($this->value, "\n"); // accept this token return true; - } elseif ($r === true) { + } else if ($r === true) { // we have changed state // process this token in the new state return $this->yylex(); - } elseif ($r === false) { + } else if ($r === false) { $this->counter += strlen($this->value); $this->line += substr_count($this->value, "\n"); if ($this->counter >= $this->dataLength) { @@ -688,16 +700,12 @@ class Smarty_Internal_Configfilelexer continue; } } else { - throw new Exception('Unexpected input at line' . $this->line . - ': ' . $this->data[$this->counter]); + throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[ $this->counter ]); } break; } while (true); - } // end function - - - const TRIPPLE = 6; + } function yy_r6_1() { diff --git a/libs/sysplugins/smarty_internal_configfileparser.php b/libs/sysplugins/smarty_internal_configfileparser.php index b7551a2b..4ffc854a 100644 --- a/libs/sysplugins/smarty_internal_configfileparser.php +++ b/libs/sysplugins/smarty_internal_configfileparser.php @@ -2,8 +2,7 @@ class TPC_yyToken implements ArrayAccess { - public $string = ''; - + public $string = ''; public $metadata = array(); public function __construct($s, $m = array()) @@ -12,10 +11,10 @@ class TPC_yyToken implements ArrayAccess $this->string = $s->string; $this->metadata = $s->metadata; } else { - $this->string = (string) $s; + $this->string = (string)$s; if ($m instanceof TPC_yyToken) { $this->metadata = $m->metadata; - } elseif (is_array($m)) { + } else if (is_array($m)) { $this->metadata = $m; } } @@ -39,7 +38,7 @@ class TPC_yyToken implements ArrayAccess public function offsetSet($offset, $value) { if ($offset === null) { - if (isset($value[ 0 ])) { + if (isset($value[0])) { $x = ($value instanceof TPC_yyToken) ? $value->metadata : $value; $this->metadata = array_merge($this->metadata, $x); @@ -54,7 +53,7 @@ class TPC_yyToken implements ArrayAccess if ($value->metadata) { $this->metadata[ $offset ] = $value->metadata; } - } elseif ($value) { + } else if ($value) { $this->metadata[ $offset ] = $value; } } @@ -76,6 +75,7 @@ class TPC_yyStackEntry ; + #line 12 "../smarty/lexer/smarty_internal_configfileparser.y" /** @@ -92,73 +92,145 @@ class Smarty_Internal_Configfileparser { #line 25 "../smarty/lexer/smarty_internal_configfileparser.y" - /** - * result status - * - * @var bool - */ - public $successful = true; - - /** - * return value - * - * @var mixed - */ - public $retvalue = 0; - - /** - * @var - */ - public $yymajor; - - /** - * lexer object - * - * @var Smarty_Internal_Configfilelexer - */ - private $lex; - - /** - * internal error flag - * - * @var bool - */ - private $internalError = false; - - /** - * compiler object - * - * @var Smarty_Internal_Config_File_Compiler - */ - public $compiler = null; - - /** - * smarty object - * - * @var Smarty - */ - public $smarty = null; - - /** - * copy of config_overwrite property - * - * @var bool - */ - private $configOverwrite = false; - - /** - * copy of config_read_hidden property - * - * @var bool - */ - private $configReadHidden = false; - + const TPC_OPENB = 1; + const TPC_SECTION = 2; + const TPC_CLOSEB = 3; + const TPC_DOT = 4; + const TPC_ID = 5; + const TPC_EQUAL = 6; + const TPC_FLOAT = 7; + const TPC_INT = 8; + const TPC_BOOL = 9; + const TPC_SINGLE_QUOTED_STRING = 10; + const TPC_DOUBLE_QUOTED_STRING = 11; + const TPC_TRIPPLE_QUOTES = 12; + const TPC_TRIPPLE_TEXT = 13; + const TPC_TRIPPLE_QUOTES_END = 14; + const TPC_NAKED_STRING = 15; + const TPC_OTHER = 16; + const TPC_NEWLINE = 17; + const TPC_COMMENTSTART = 18; + const YY_NO_ACTION = 60; + const YY_ACCEPT_ACTION = 59; + const YY_ERROR_ACTION = 58; + const YY_SZ_ACTTAB = 38; + const YY_SHIFT_USE_DFLT = -8; + const YY_SHIFT_MAX = 19; + const YY_REDUCE_USE_DFLT = -17; + const YY_REDUCE_MAX = 10; + const YYNOCODE = 29; + const YYSTACKDEPTH = 100; + const YYNSTATE = 36; + const YYNRULE = 22; + const YYERRORSYMBOL = 19; + const YYERRSYMDT = 'yy0'; + const YYFALLBACK = 0; + static public $yy_action = array(32, 31, 30, 29, 35, 13, 19, 3, 24, 26, 59, 9, 14, 1, 16, 25, 11, 28, 25, 11, 17, + 27, 34, 20, 18, 15, 23, 5, 6, 22, 10, 8, 4, 12, 2, 33, 7, 21,); + static public $yy_lookahead = array(7, 8, 9, 10, 11, 12, 5, 23, 15, 16, 20, 21, 2, 23, 4, 17, 18, 14, 17, 18, 13, + 14, 25, 26, 15, 2, 17, 3, 3, 17, 25, 25, 6, 1, 23, 27, 22, 24,); + static public $yy_shift_ofst = array(-8, 1, 1, 1, -7, -2, -2, 32, -8, -8, -8, 9, 10, 7, 25, 24, 23, 3, 12, 26,); + static public $yy_reduce_ofst = array(-10, -3, -3, -3, 8, 6, 5, 13, 11, 14, -16,); + static public $yyExpectedTokens = array(array(), array(5, 17, 18,), array(5, 17, 18,), array(5, 17, 18,), + array(7, 8, 9, 10, 11, 12, 15, 16,), array(17, 18,), array(17, 18,), + array(1,), array(), array(), array(), array(15, 17,), array(2, 4,), + array(13, 14,), array(3,), array(3,), array(2,), array(14,), array(17,), + array(6,), array(), array(), array(), array(), array(), array(), array(), + array(), array(), array(), array(), array(), array(), array(), array(), + array(),); + static public $yy_default = array(44, 37, 41, 40, 58, 58, 58, 36, 44, 39, 44, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 43, 38, 57, 56, 53, 55, 54, 52, 51, 49, 48, 47, 46, 45, 42, 50,); + public static $yyFallback = array(); + public static $yyRuleName = array('start ::= global_vars sections', 'global_vars ::= var_list', + 'sections ::= sections section', 'sections ::=', + 'section ::= OPENB SECTION CLOSEB newline var_list', + 'section ::= OPENB DOT SECTION CLOSEB newline var_list', + 'var_list ::= var_list newline', 'var_list ::= var_list var', 'var_list ::=', + 'var ::= ID EQUAL value', 'value ::= FLOAT', 'value ::= INT', 'value ::= BOOL', + 'value ::= SINGLE_QUOTED_STRING', 'value ::= DOUBLE_QUOTED_STRING', + 'value ::= TRIPPLE_QUOTES TRIPPLE_TEXT TRIPPLE_QUOTES_END', + 'value ::= TRIPPLE_QUOTES TRIPPLE_QUOTES_END', 'value ::= NAKED_STRING', + 'value ::= OTHER', 'newline ::= NEWLINE', 'newline ::= COMMENTSTART NEWLINE', + 'newline ::= COMMENTSTART NAKED_STRING NEWLINE',); + public static $yyRuleInfo = array(array(0 => 20, 1 => 2), array(0 => 21, 1 => 1), array(0 => 22, 1 => 2), + array(0 => 22, 1 => 0), array(0 => 24, 1 => 5), array(0 => 24, 1 => 6), + array(0 => 23, 1 => 2), array(0 => 23, 1 => 2), array(0 => 23, 1 => 0), + array(0 => 26, 1 => 3), array(0 => 27, 1 => 1), array(0 => 27, 1 => 1), + array(0 => 27, 1 => 1), array(0 => 27, 1 => 1), array(0 => 27, 1 => 1), + array(0 => 27, 1 => 3), array(0 => 27, 1 => 2), array(0 => 27, 1 => 1), + array(0 => 27, 1 => 1), array(0 => 25, 1 => 1), array(0 => 25, 1 => 2), + array(0 => 25, 1 => 3),); + public static $yyReduceMap = array(0 => 0, 2 => 0, 3 => 0, 19 => 0, 20 => 0, 21 => 0, 1 => 1, 4 => 4, 5 => 5, + 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 11 => 11, 12 => 12, 13 => 13, 14 => 14, + 15 => 15, 16 => 16, 17 => 17, 18 => 17,); /** * helper map * * @var array */ private static $escapes_single = Array('\\' => '\\', '\'' => '\''); + /** + * result status + * + * @var bool + */ + public $successful = true; + /** + * return value + * + * @var mixed + */ + public $retvalue = 0; + /** + * @var + */ + public $yymajor; + /** + * compiler object + * + * @var Smarty_Internal_Config_File_Compiler + */ + public $compiler = null; + /** + * smarty object + * + * @var Smarty + */ + public $smarty = null; + public $yyTraceFILE; + public $yyTracePrompt; +public $yyidx; +public $yyerrcnt; +public $yystack = array(); + public $yyTokenName = array('$', 'OPENB', 'SECTION', 'CLOSEB', 'DOT', 'ID', 'EQUAL', 'FLOAT', 'INT', 'BOOL', + 'SINGLE_QUOTED_STRING', 'DOUBLE_QUOTED_STRING', 'TRIPPLE_QUOTES', 'TRIPPLE_TEXT', + 'TRIPPLE_QUOTES_END', 'NAKED_STRING', 'OTHER', 'NEWLINE', 'COMMENTSTART', 'error', + 'start', 'global_vars', 'sections', 'var_list', 'section', 'newline', 'var', 'value',); + /** + * lexer object + * + * @var Smarty_Internal_Configfilelexer + */ + private $lex; + /** + * internal error flag + * + * @var bool + */ + private $internalError = false; + /** + * copy of config_overwrite property + * + * @var bool + */ + private $configOverwrite = false; + /** + * copy of config_read_hidden property + * + * @var bool + */ + private $configReadHidden = false; + private $_retvalue; /** * constructor @@ -175,221 +247,11 @@ class Smarty_Internal_Configfileparser $this->configReadHidden = $this->smarty->config_read_hidden; } - /** - * parse optional boolean keywords - * - * @param string $str - * - * @return bool - */ - private function parse_bool($str) - { - $str = strtolower($str); - if (in_array($str, array('on', 'yes', 'true'))) { - $res = true; - } else { - $res = false; - } - return $res; - } - - /** - * parse single quoted string - * remove outer quotes - * unescape inner quotes - * - * @param string $qstr - * - * @return string - */ - private static function parse_single_quoted_string($qstr) - { - $escaped_string = substr($qstr, 1, strlen($qstr) - 2); //remove outer quotes - - $ss = preg_split('/(\\\\.)/', $escaped_string, - 1, PREG_SPLIT_DELIM_CAPTURE); - - $str = ""; - foreach ($ss as $s) { - if (strlen($s) === 2 && $s[ 0 ] === '\\') { - if (isset(self::$escapes_single[ $s[ 1 ] ])) { - $s = self::$escapes_single[ $s[ 1 ] ]; - } - } - $str .= $s; - } - return $str; - } - - /** - * parse double quoted string - * - * @param string $qstr - * - * @return string - */ - private static function parse_double_quoted_string($qstr) - { - $inner_str = substr($qstr, 1, strlen($qstr) - 2); - return stripcslashes($inner_str); - } - - /** - * parse triple quoted string - * - * @param string $qstr - * - * @return string - */ - private static function parse_tripple_double_quoted_string($qstr) - { - return stripcslashes($qstr); - } - - /** - * set a config variable in target array - * - * @param array $var - * @param array $target_array - */ - private function set_var(Array $var, Array &$target_array) - { - $key = $var[ "key" ]; - $value = $var[ "value" ]; - - if ($this->configOverwrite || !isset($target_array[ 'vars' ][ $key ])) { - $target_array[ 'vars' ][ $key ] = $value; - } else { - settype($target_array[ 'vars' ][ $key ], 'array'); - $target_array[ 'vars' ][ $key ][] = $value; - } - } - - /** - * add config variable to global vars - * - * @param array $vars - */ - private function add_global_vars(Array $vars) - { - if (!isset($this->compiler->config_data[ 'vars' ])) { - $this->compiler->config_data[ 'vars' ] = Array(); - } - foreach ($vars as $var) { - $this->set_var($var, $this->compiler->config_data); - } - } - - /** - * add config variable to section - * - * @param string $section_name - * @param array $vars - */ - private function add_section_vars($section_name, Array $vars) - { - if (!isset($this->compiler->config_data[ 'sections' ][ $section_name ][ 'vars' ])) { - $this->compiler->config_data[ 'sections' ][ $section_name ][ 'vars' ] = Array(); - } - foreach ($vars as $var) { - $this->set_var($var, $this->compiler->config_data[ 'sections' ][ $section_name ]); - } - } - - const TPC_OPENB = 1; - - const TPC_SECTION = 2; - - const TPC_CLOSEB = 3; - - const TPC_DOT = 4; - - const TPC_ID = 5; - - const TPC_EQUAL = 6; - - const TPC_FLOAT = 7; - - const TPC_INT = 8; - - const TPC_BOOL = 9; - - const TPC_SINGLE_QUOTED_STRING = 10; - - const TPC_DOUBLE_QUOTED_STRING = 11; - - const TPC_TRIPPLE_QUOTES = 12; - - const TPC_TRIPPLE_TEXT = 13; - - const TPC_TRIPPLE_QUOTES_END = 14; - - const TPC_NAKED_STRING = 15; - - const TPC_OTHER = 16; - - const TPC_NEWLINE = 17; - - const TPC_COMMENTSTART = 18; - - const YY_NO_ACTION = 60; - - const YY_ACCEPT_ACTION = 59; - - const YY_ERROR_ACTION = 58; - - const YY_SZ_ACTTAB = 38; - - static public $yy_action = array(29, 30, 34, 33, 24, 13, 19, 25, 35, 21, 59, 8, 3, 1, 20, 12, 14, 31, 20, 12, 15, - 17, 23, 18, 27, 26, 4, 5, 6, 32, 2, 11, 28, 22, 16, 9, 7, 10,); - - static public $yy_lookahead = array(7, 8, 9, 10, 11, 12, 5, 27, 15, 16, 20, 21, 23, 23, 17, 18, 13, 14, 17, 18, 15, - 2, 17, 4, 25, 26, 6, 3, 3, 14, 23, 1, 24, 17, 2, 25, 22, 25,); - - const YY_SHIFT_USE_DFLT = - 8; - - const YY_SHIFT_MAX = 19; - - static public $yy_shift_ofst = array(- 8, 1, 1, 1, - 7, - 3, - 3, 30, - 8, - 8, - 8, 19, 5, 3, 15, 16, 24, 25, 32, - 20,); - - const YY_REDUCE_USE_DFLT = - 21; - - const YY_REDUCE_MAX = 10; - - static public $yy_reduce_ofst = array(- 10, - 1, - 1, - 1, - 20, 10, 12, 8, 14, 7, - 11,); - - static public $yyExpectedTokens = array(array(), array(5, 17, 18,), array(5, 17, 18,), array(5, 17, 18,), - array(7, 8, 9, 10, 11, 12, 15, 16,), array(17, 18,), array(17, 18,), - array(1,), array(), array(), array(), array(2, 4,), array(15, 17,), - array(13, 14,), array(14,), array(17,), array(3,), array(3,), array(2,), - array(6,), array(), array(), array(), array(), array(), array(), array(), - array(), array(), array(), array(), array(), array(), array(), array(), - array(),); - - static public $yy_default = array(44, 37, 41, 40, 58, 58, 58, 36, 39, 44, 44, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 55, 54, 57, 56, 50, 45, 43, 42, 38, 46, 47, 52, 51, 49, 48, 53,); - - const YYNOCODE = 29; - - const YYSTACKDEPTH = 100; - - const YYNSTATE = 36; - - const YYNRULE = 22; - - const YYERRORSYMBOL = 19; - - const YYERRSYMDT = 'yy0'; - - const YYFALLBACK = 0; - - public static $yyFallback = array(); - public function Trace($TraceFILE, $zTracePrompt) { if (!$TraceFILE) { $zTracePrompt = 0; - } elseif (!$zTracePrompt) { + } else if (!$zTracePrompt) { $TraceFILE = 0; } $this->yyTraceFILE = $TraceFILE; @@ -400,32 +262,7 @@ class Smarty_Internal_Configfileparser { $this->yyTraceFILE = fopen('php://output', 'w'); $this->yyTracePrompt = '
'; - } - - public $yyTraceFILE; - - public $yyTracePrompt; - - public $yyidx; /* Index of top element in stack */ - public $yyerrcnt; /* Shifts left before out of the error */ - public $yystack = array(); /* The parser's stack */ - - public $yyTokenName = array('$', 'OPENB', 'SECTION', 'CLOSEB', 'DOT', 'ID', 'EQUAL', 'FLOAT', 'INT', 'BOOL', - 'SINGLE_QUOTED_STRING', 'DOUBLE_QUOTED_STRING', 'TRIPPLE_QUOTES', 'TRIPPLE_TEXT', - 'TRIPPLE_QUOTES_END', 'NAKED_STRING', 'OTHER', 'NEWLINE', 'COMMENTSTART', 'error', - 'start', 'global_vars', 'sections', 'var_list', 'section', 'newline', 'var', 'value',); - - public static $yyRuleName = array('start ::= global_vars sections', 'global_vars ::= var_list', - 'sections ::= sections section', 'sections ::=', - 'section ::= OPENB SECTION CLOSEB newline var_list', - 'section ::= OPENB DOT SECTION CLOSEB newline var_list', - 'var_list ::= var_list newline', 'var_list ::= var_list var', 'var_list ::=', - 'var ::= ID EQUAL value', 'value ::= FLOAT', 'value ::= INT', 'value ::= BOOL', - 'value ::= SINGLE_QUOTED_STRING', 'value ::= DOUBLE_QUOTED_STRING', - 'value ::= TRIPPLE_QUOTES TRIPPLE_TEXT TRIPPLE_QUOTES_END', - 'value ::= TRIPPLE_QUOTES TRIPPLE_QUOTES_END', 'value ::= NAKED_STRING', - 'value ::= OTHER', 'newline ::= NEWLINE', 'newline ::= COMMENTSTART NEWLINE', - 'newline ::= COMMENTSTART NAKED_STRING NEWLINE',); + } /* Index of top element in stack */ public function tokenName($tokenType) { @@ -437,31 +274,7 @@ class Smarty_Internal_Configfileparser } else { return "Unknown"; } - } - - public static function yy_destructor($yymajor, $yypminor) - { - switch ($yymajor) { - default: - break; /* If no destructor action specified: do nothing */ - } - } - - public function yy_pop_parser_stack() - { - if (empty($this->yystack)) { - return; - } - $yytos = array_pop($this->yystack); - if ($this->yyTraceFILE && $this->yyidx >= 0) { - fwrite($this->yyTraceFILE, $this->yyTracePrompt . 'Popping ' . $this->yyTokenName[ $yytos->major ] . "\n"); - } - $yymajor = $yytos->major; - self::yy_destructor($yymajor, $yytos->minor); - $this->yyidx --; - - return $yymajor; - } + } /* Shifts left before out of the error */ public function __destruct() { @@ -471,6 +284,31 @@ class Smarty_Internal_Configfileparser if (is_resource($this->yyTraceFILE)) { fclose($this->yyTraceFILE); } + } /* The parser's stack */ + + public function yy_pop_parser_stack() + { + if (empty($this->yystack)) { + return; + } + $yytos = array_pop($this->yystack); + if ($this->yyTraceFILE && $this->yyidx >= 0) { + fwrite($this->yyTraceFILE, + $this->yyTracePrompt . 'Popping ' . $this->yyTokenName[ $yytos->major ] . "\n"); + } + $yymajor = $yytos->major; + self::yy_destructor($yymajor, $yytos->minor); + $this->yyidx--; + + return $yymajor; + } + + public static function yy_destructor($yymajor, $yypminor) + { + switch ($yymajor) { + default: + break; /* If no destructor action specified: do nothing */ + } } public function yy_get_expected_tokens($token) @@ -496,7 +334,7 @@ class Smarty_Internal_Configfileparser // reduce action $done = 0; do { - if ($done ++ == 100) { + if ($done++ == 100) { $this->yyidx = $yyidx; $this->yystack = $stack; // too much recursion prevents proper detection @@ -504,9 +342,9 @@ class Smarty_Internal_Configfileparser return array_unique($expected); } $yyruleno = $yyact - self::YYNSTATE; - $this->yyidx -= self::$yyRuleInfo[ $yyruleno ][ 1 ]; + $this->yyidx -= self::$yyRuleInfo[ $yyruleno ][1]; $nextstate = $this->yy_find_reduce_action($this->yystack[ $this->yyidx ]->stateno, - self::$yyRuleInfo[ $yyruleno ][ 0 ]); + self::$yyRuleInfo[ $yyruleno ][0]); if (isset(self::$yyExpectedTokens[ $nextstate ])) { $expected = array_merge($expected, self::$yyExpectedTokens[ $nextstate ]); if (isset($res4[ $nextstate ][ $token ])) { @@ -517,8 +355,7 @@ class Smarty_Internal_Configfileparser } } else { if ($res4[ $nextstate ][ $token ] = - in_array($token, self::$yyExpectedTokens[ $nextstate ], true) - ) { + in_array($token, self::$yyExpectedTokens[ $nextstate ], true)) { $this->yyidx = $yyidx; $this->yystack = $stack; return array_unique($expected); @@ -527,20 +364,20 @@ class Smarty_Internal_Configfileparser } if ($nextstate < self::YYNSTATE) { // we need to shift a non-terminal - $this->yyidx ++; + $this->yyidx++; $x = new TPC_yyStackEntry; $x->stateno = $nextstate; - $x->major = self::$yyRuleInfo[ $yyruleno ][ 0 ]; + $x->major = self::$yyRuleInfo[ $yyruleno ][0]; $this->yystack[ $this->yyidx ] = $x; continue 2; - } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) { + } else if ($nextstate == self::YYNSTATE + self::YYNRULE + 1) { $this->yyidx = $yyidx; $this->yystack = $stack; // the last token was just ignored, we can't accept // by ignoring input, this is in essence ignoring a // syntax error! return array_unique($expected); - } elseif ($nextstate === self::YY_NO_ACTION) { + } else if ($nextstate === self::YY_NO_ACTION) { $this->yyidx = $yyidx; $this->yystack = $stack; // input accepted, but not shifted (I guess) @@ -548,109 +385,16 @@ class Smarty_Internal_Configfileparser } else { $yyact = $nextstate; } - } - while (true); + } while (true); } break; - } - while (true); + } while (true); $this->yyidx = $yyidx; $this->yystack = $stack; return array_unique($expected); } - public function yy_is_expected_token($token) - { - static $res = array(); - static $res2 = array(); - if ($token === 0) { - return true; // 0 is not part of this - } - $state = $this->yystack[ $this->yyidx ]->stateno; - if (isset($res[ $state ][ $token ])) { - if ($res[ $state ][ $token ]) { - return true; - } - } else { - if ($res[ $state ][ $token ] = in_array($token, self::$yyExpectedTokens[ $state ], true)) { - return true; - } - } - $stack = $this->yystack; - $yyidx = $this->yyidx; - do { - $yyact = $this->yy_find_shift_action($token); - if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) { - // reduce action - $done = 0; - do { - if ($done ++ == 100) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - // too much recursion prevents proper detection - // so give up - return true; - } - $yyruleno = $yyact - self::YYNSTATE; - $this->yyidx -= self::$yyRuleInfo[ $yyruleno ][ 1 ]; - $nextstate = $this->yy_find_reduce_action($this->yystack[ $this->yyidx ]->stateno, - self::$yyRuleInfo[ $yyruleno ][ 0 ]); - if (isset($res2[ $nextstate ][ $token ])) { - if ($res2[ $nextstate ][ $token ]) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - return true; - } - } else { - if ($res2[ $nextstate ][ $token ] = (isset(self::$yyExpectedTokens[ $nextstate ]) && - in_array($token, self::$yyExpectedTokens[ $nextstate ], - true)) - ) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - return true; - } - } - if ($nextstate < self::YYNSTATE) { - // we need to shift a non-terminal - $this->yyidx ++; - $x = new TPC_yyStackEntry; - $x->stateno = $nextstate; - $x->major = self::$yyRuleInfo[ $yyruleno ][ 0 ]; - $this->yystack[ $this->yyidx ] = $x; - continue 2; - } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - if (!$token) { - // end of input: this is valid - return true; - } - // the last token was just ignored, we can't accept - // by ignoring input, this is in essence ignoring a - // syntax error! - return false; - } elseif ($nextstate === self::YY_NO_ACTION) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - // input accepted, but not shifted (I guess) - return true; - } else { - $yyact = $nextstate; - } - } - while (true); - } - break; - } - while (true); - $this->yyidx = $yyidx; - $this->yystack = $stack; - - return true; - } - public function yy_find_shift_action($iLookAhead) { $stateno = $this->yystack[ $this->yyidx ]->stateno; @@ -670,8 +414,7 @@ class Smarty_Internal_Configfileparser $i += $iLookAhead; if ($i < 0 || $i >= self::YY_SZ_ACTTAB || self::$yy_lookahead[ $i ] != $iLookAhead) { if (count(self::$yyFallback) && $iLookAhead < count(self::$yyFallback) && - ($iFallback = self::$yyFallback[ $iLookAhead ]) != 0 - ) { + ($iFallback = self::$yyFallback[ $iLookAhead ]) != 0) { if ($this->yyTraceFILE) { fwrite($this->yyTraceFILE, $this->yyTracePrompt . "FALLBACK " . $this->yyTokenName[ $iLookAhead ] . " => " . @@ -709,229 +452,245 @@ class Smarty_Internal_Configfileparser } } - public function yy_shift($yyNewState, $yyMajor, $yypMinor) - { - $this->yyidx ++; - if ($this->yyidx >= self::YYSTACKDEPTH) { - $this->yyidx --; - if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, "%sStack Overflow!\n", $this->yyTracePrompt); - } - while ($this->yyidx >= 0) { - $this->yy_pop_parser_stack(); - } - #line 239 "../smarty/lexer/smarty_internal_configfileparser.y" - - $this->internalError = true; - $this->compiler->trigger_config_file_error("Stack overflow in configfile parser"); - - return; - } - $yytos = new TPC_yyStackEntry; - $yytos->stateno = $yyNewState; - $yytos->major = $yyMajor; - $yytos->minor = $yypMinor; - $this->yystack[] = $yytos; - if ($this->yyTraceFILE && $this->yyidx > 0) { - fprintf($this->yyTraceFILE, "%sShift %d\n", $this->yyTracePrompt, $yyNewState); - fprintf($this->yyTraceFILE, "%sStack:", $this->yyTracePrompt); - for ($i = 1; $i <= $this->yyidx; $i ++) { - fprintf($this->yyTraceFILE, " %s", $this->yyTokenName[ $this->yystack[ $i ]->major ]); - } - fwrite($this->yyTraceFILE, "\n"); - } - } - - public static $yyRuleInfo = array(array(0 => 20, 1 => 2), array(0 => 21, 1 => 1), array(0 => 22, 1 => 2), - array(0 => 22, 1 => 0), array(0 => 24, 1 => 5), array(0 => 24, 1 => 6), - array(0 => 23, 1 => 2), array(0 => 23, 1 => 2), array(0 => 23, 1 => 0), - array(0 => 26, 1 => 3), array(0 => 27, 1 => 1), array(0 => 27, 1 => 1), - array(0 => 27, 1 => 1), array(0 => 27, 1 => 1), array(0 => 27, 1 => 1), - array(0 => 27, 1 => 3), array(0 => 27, 1 => 2), array(0 => 27, 1 => 1), - array(0 => 27, 1 => 1), array(0 => 25, 1 => 1), array(0 => 25, 1 => 2), - array(0 => 25, 1 => 3),); - - public static $yyReduceMap = array(0 => 0, 2 => 0, 3 => 0, 19 => 0, 20 => 0, 21 => 0, 1 => 1, 4 => 4, 5 => 5, - 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 11 => 11, 12 => 12, 13 => 13, 14 => 14, - 15 => 15, 16 => 16, 17 => 17, 18 => 17,); - - #line 245 "../smarty/lexer/smarty_internal_configfileparser.y" function yy_r0() { $this->_retvalue = null; } - #line 250 "../smarty/lexer/smarty_internal_configfileparser.y" function yy_r1() { $this->add_global_vars($this->yystack[ $this->yyidx + 0 ]->minor); $this->_retvalue = null; } - #line 264 "../smarty/lexer/smarty_internal_configfileparser.y" + /** + * add config variable to global vars + * + * @param array $vars + */ + private function add_global_vars(Array $vars) + { + if (!isset($this->compiler->config_data['vars'])) { + $this->compiler->config_data['vars'] = Array(); + } + foreach ($vars as $var) { + $this->set_var($var, $this->compiler->config_data); + } + } + + /** + * set a config variable in target array + * + * @param array $var + * @param array $target_array + */ + private function set_var(Array $var, Array &$target_array) + { + $key = $var["key"]; + $value = $var["value"]; + + if ($this->configOverwrite || !isset($target_array['vars'][ $key ])) { + $target_array['vars'][ $key ] = $value; + } else { + settype($target_array['vars'][ $key ], 'array'); + $target_array['vars'][ $key ][] = $value; + } + } + function yy_r4() { - $this->add_section_vars($this->yystack[ $this->yyidx + - 3 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor); + $this->add_section_vars($this->yystack[ $this->yyidx + -3 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor); $this->_retvalue = null; } - #line 269 "../smarty/lexer/smarty_internal_configfileparser.y" + /** + * add config variable to section + * + * @param string $section_name + * @param array $vars + */ + private function add_section_vars($section_name, Array $vars) + { + if (!isset($this->compiler->config_data['sections'][ $section_name ]['vars'])) { + $this->compiler->config_data['sections'][ $section_name ]['vars'] = Array(); + } + foreach ($vars as $var) { + $this->set_var($var, $this->compiler->config_data['sections'][ $section_name ]); + } + } + function yy_r5() { if ($this->configReadHidden) { - $this->add_section_vars($this->yystack[ $this->yyidx + - 3 ]->minor, + $this->add_section_vars($this->yystack[ $this->yyidx + -3 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor); } $this->_retvalue = null; } - #line 277 "../smarty/lexer/smarty_internal_configfileparser.y" function yy_r6() { - $this->_retvalue = $this->yystack[ $this->yyidx + - 1 ]->minor; + $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor; } - #line 281 "../smarty/lexer/smarty_internal_configfileparser.y" + #line 245 "../smarty/lexer/smarty_internal_configfileparser.y" + function yy_r7() { $this->_retvalue = - array_merge($this->yystack[ $this->yyidx + - 1 ]->minor, Array($this->yystack[ $this->yyidx + 0 ]->minor)); + array_merge($this->yystack[ $this->yyidx + -1 ]->minor, Array($this->yystack[ $this->yyidx + 0 ]->minor)); } - #line 285 "../smarty/lexer/smarty_internal_configfileparser.y" + #line 250 "../smarty/lexer/smarty_internal_configfileparser.y" + function yy_r8() { $this->_retvalue = Array(); } - #line 291 "../smarty/lexer/smarty_internal_configfileparser.y" + #line 264 "../smarty/lexer/smarty_internal_configfileparser.y" + function yy_r9() { - $this->_retvalue = Array("key" => $this->yystack[ $this->yyidx + - 2 ]->minor, + $this->_retvalue = Array("key" => $this->yystack[ $this->yyidx + -2 ]->minor, "value" => $this->yystack[ $this->yyidx + 0 ]->minor); } - #line 296 "../smarty/lexer/smarty_internal_configfileparser.y" + #line 269 "../smarty/lexer/smarty_internal_configfileparser.y" + function yy_r10() { - $this->_retvalue = (float) $this->yystack[ $this->yyidx + 0 ]->minor; + $this->_retvalue = (float)$this->yystack[ $this->yyidx + 0 ]->minor; } - #line 300 "../smarty/lexer/smarty_internal_configfileparser.y" + #line 277 "../smarty/lexer/smarty_internal_configfileparser.y" + function yy_r11() { - $this->_retvalue = (int) $this->yystack[ $this->yyidx + 0 ]->minor; + $this->_retvalue = (int)$this->yystack[ $this->yyidx + 0 ]->minor; } - #line 304 "../smarty/lexer/smarty_internal_configfileparser.y" + #line 281 "../smarty/lexer/smarty_internal_configfileparser.y" + function yy_r12() { $this->_retvalue = $this->parse_bool($this->yystack[ $this->yyidx + 0 ]->minor); } - #line 308 "../smarty/lexer/smarty_internal_configfileparser.y" + #line 285 "../smarty/lexer/smarty_internal_configfileparser.y" + + /** + * parse optional boolean keywords + * + * @param string $str + * + * @return bool + */ + private function parse_bool($str) + { + $str = strtolower($str); + if (in_array($str, array('on', 'yes', 'true'))) { + $res = true; + } else { + $res = false; + } + return $res; + } + + #line 291 "../smarty/lexer/smarty_internal_configfileparser.y" + function yy_r13() { $this->_retvalue = self::parse_single_quoted_string($this->yystack[ $this->yyidx + 0 ]->minor); } - #line 312 "../smarty/lexer/smarty_internal_configfileparser.y" + #line 296 "../smarty/lexer/smarty_internal_configfileparser.y" + + /** + * parse single quoted string + * remove outer quotes + * unescape inner quotes + * + * @param string $qstr + * + * @return string + */ + private static function parse_single_quoted_string($qstr) + { + $escaped_string = substr($qstr, 1, strlen($qstr) - 2); //remove outer quotes + + $ss = preg_split('/(\\\\.)/', $escaped_string, -1, PREG_SPLIT_DELIM_CAPTURE); + + $str = ""; + foreach ($ss as $s) { + if (strlen($s) === 2 && $s[0] === '\\') { + if (isset(self::$escapes_single[ $s[1] ])) { + $s = self::$escapes_single[ $s[1] ]; + } + } + $str .= $s; + } + return $str; + } + + #line 300 "../smarty/lexer/smarty_internal_configfileparser.y" + function yy_r14() { $this->_retvalue = self::parse_double_quoted_string($this->yystack[ $this->yyidx + 0 ]->minor); } - #line 316 "../smarty/lexer/smarty_internal_configfileparser.y" - function yy_r15() + #line 304 "../smarty/lexer/smarty_internal_configfileparser.y" + + /** + * parse double quoted string + * + * @param string $qstr + * + * @return string + */ + private static function parse_double_quoted_string($qstr) { - $this->_retvalue = self::parse_tripple_double_quoted_string($this->yystack[ $this->yyidx + - 1 ]->minor); + $inner_str = substr($qstr, 1, strlen($qstr) - 2); + return stripcslashes($inner_str); } - #line 320 "../smarty/lexer/smarty_internal_configfileparser.y" + #line 308 "../smarty/lexer/smarty_internal_configfileparser.y" + + function yy_r15() + { + $this->_retvalue = self::parse_tripple_double_quoted_string($this->yystack[ $this->yyidx + -1 ]->minor); + } + + #line 312 "../smarty/lexer/smarty_internal_configfileparser.y" + + /** + * parse triple quoted string + * + * @param string $qstr + * + * @return string + */ + private static function parse_tripple_double_quoted_string($qstr) + { + return stripcslashes($qstr); + } + + #line 316 "../smarty/lexer/smarty_internal_configfileparser.y" + function yy_r16() { $this->_retvalue = ''; } - #line 324 "../smarty/lexer/smarty_internal_configfileparser.y" + #line 320 "../smarty/lexer/smarty_internal_configfileparser.y" + function yy_r17() { $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor; } - private $_retvalue; - - public function yy_reduce($yyruleno) - { - if ($this->yyTraceFILE && $yyruleno >= 0 && $yyruleno < count(self::$yyRuleName)) { - fprintf($this->yyTraceFILE, "%sReduce (%d) [%s].\n", $this->yyTracePrompt, $yyruleno, - self::$yyRuleName[ $yyruleno ]); - } - - $this->_retvalue = $yy_lefthand_side = null; - if (isset(self::$yyReduceMap[ $yyruleno ])) { - // call the action - $this->_retvalue = null; - $this->{'yy_r' . self::$yyReduceMap[ $yyruleno ]}(); - $yy_lefthand_side = $this->_retvalue; - } - $yygoto = self::$yyRuleInfo[ $yyruleno ][ 0 ]; - $yysize = self::$yyRuleInfo[ $yyruleno ][ 1 ]; - $this->yyidx -= $yysize; - for ($i = $yysize; $i; $i --) { - // pop all of the right-hand side parameters - array_pop($this->yystack); - } - $yyact = $this->yy_find_reduce_action($this->yystack[ $this->yyidx ]->stateno, $yygoto); - if ($yyact < self::YYNSTATE) { - if (!$this->yyTraceFILE && $yysize) { - $this->yyidx ++; - $x = new TPC_yyStackEntry; - $x->stateno = $yyact; - $x->major = $yygoto; - $x->minor = $yy_lefthand_side; - $this->yystack[ $this->yyidx ] = $x; - } else { - $this->yy_shift($yyact, $yygoto, $yy_lefthand_side); - } - } elseif ($yyact == self::YYNSTATE + self::YYNRULE + 1) { - $this->yy_accept(); - } - } - - public function yy_parse_failed() - { - if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, "%sFail!\n", $this->yyTracePrompt); - } - while ($this->yyidx >= 0) { - $this->yy_pop_parser_stack(); - } - } - - public function yy_syntax_error($yymajor, $TOKEN) - { - #line 232 "../smarty/lexer/smarty_internal_configfileparser.y" - - $this->internalError = true; - $this->yymajor = $yymajor; - $this->compiler->trigger_config_file_error(); - } - - public function yy_accept() - { - if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, "%sAccept!\n", $this->yyTracePrompt); - } - while ($this->yyidx >= 0) { - $this->yy_pop_parser_stack(); - } - #line 225 "../smarty/lexer/smarty_internal_configfileparser.y" - - $this->successful = !$this->internalError; - $this->internalError = false; - $this->retvalue = $this->_retvalue; - } + #line 324 "../smarty/lexer/smarty_internal_configfileparser.y" public function doParse($yymajor, $yytokenvalue) { @@ -939,7 +698,7 @@ class Smarty_Internal_Configfileparser if ($this->yyidx === null || $this->yyidx < 0) { $this->yyidx = 0; - $this->yyerrcnt = - 1; + $this->yyerrcnt = -1; $x = new TPC_yyStackEntry; $x->stateno = 0; $x->major = 0; @@ -949,7 +708,10 @@ class Smarty_Internal_Configfileparser $yyendofinput = ($yymajor == 0); if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, "%sInput %s\n", $this->yyTracePrompt, $this->yyTokenName[ $yymajor ]); + fprintf($this->yyTraceFILE, + "%sInput %s\n", + $this->yyTracePrompt, + $this->yyTokenName[ $yymajor ]); } do { @@ -960,17 +722,19 @@ class Smarty_Internal_Configfileparser } if ($yyact < self::YYNSTATE) { $this->yy_shift($yyact, $yymajor, $yytokenvalue); - $this->yyerrcnt --; + $this->yyerrcnt--; if ($yyendofinput && $this->yyidx >= 0) { $yymajor = 0; } else { $yymajor = self::YYNOCODE; } - } elseif ($yyact < self::YYNSTATE + self::YYNRULE) { + } else if ($yyact < self::YYNSTATE + self::YYNRULE) { $this->yy_reduce($yyact - self::YYNSTATE); - } elseif ($yyact == self::YY_ERROR_ACTION) { + } else if ($yyact == self::YY_ERROR_ACTION) { if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, "%sSyntax Error!\n", $this->yyTracePrompt); + fprintf($this->yyTraceFILE, + "%sSyntax Error!\n", + $this->yyTracePrompt); } if (self::YYERRORSYMBOL) { if ($this->yyerrcnt < 0) { @@ -979,7 +743,9 @@ class Smarty_Internal_Configfileparser $yymx = $this->yystack[ $this->yyidx ]->major; if ($yymx == self::YYERRORSYMBOL || $yyerrorhit) { if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, "%sDiscard input token %s\n", $this->yyTracePrompt, + fprintf($this->yyTraceFILE, + "%sDiscard input token %s\n", + $this->yyTracePrompt, $this->yyTokenName[ $yymajor ]); } $this->yy_destructor($yymajor, $yytokenvalue); @@ -993,7 +759,7 @@ class Smarty_Internal_Configfileparser $this->yy_destructor($yymajor, $yytokenvalue); $this->yy_parse_failed(); $yymajor = self::YYNOCODE; - } elseif ($yymx != self::YYERRORSYMBOL) { + } else if ($yymx != self::YYERRORSYMBOL) { $u2 = 0; $this->yy_shift($yyact, self::YYERRORSYMBOL, $u2); } @@ -1015,8 +781,209 @@ class Smarty_Internal_Configfileparser $this->yy_accept(); $yymajor = self::YYNOCODE; } + } while ($yymajor != self::YYNOCODE && $this->yyidx >= 0); + } + + public function yy_is_expected_token($token) + { + static $res = array(); + static $res2 = array(); + if ($token === 0) { + return true; // 0 is not part of this + } + $state = $this->yystack[ $this->yyidx ]->stateno; + if (isset($res[ $state ][ $token ])) { + if ($res[ $state ][ $token ]) { + return true; + } + } else { + if ($res[ $state ][ $token ] = in_array($token, self::$yyExpectedTokens[ $state ], true)) { + return true; + } + } + $stack = $this->yystack; + $yyidx = $this->yyidx; + do { + $yyact = $this->yy_find_shift_action($token); + if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) { + // reduce action + $done = 0; + do { + if ($done++ == 100) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + // too much recursion prevents proper detection + // so give up + return true; + } + $yyruleno = $yyact - self::YYNSTATE; + $this->yyidx -= self::$yyRuleInfo[ $yyruleno ][1]; + $nextstate = $this->yy_find_reduce_action($this->yystack[ $this->yyidx ]->stateno, + self::$yyRuleInfo[ $yyruleno ][0]); + if (isset($res2[ $nextstate ][ $token ])) { + if ($res2[ $nextstate ][ $token ]) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + return true; + } + } else { + if ($res2[ $nextstate ][ $token ] = (isset(self::$yyExpectedTokens[ $nextstate ]) && + in_array($token, + self::$yyExpectedTokens[ $nextstate ], + true))) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + return true; + } + } + if ($nextstate < self::YYNSTATE) { + // we need to shift a non-terminal + $this->yyidx++; + $x = new TPC_yyStackEntry; + $x->stateno = $nextstate; + $x->major = self::$yyRuleInfo[ $yyruleno ][0]; + $this->yystack[ $this->yyidx ] = $x; + continue 2; + } else if ($nextstate == self::YYNSTATE + self::YYNRULE + 1) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + if (!$token) { + // end of input: this is valid + return true; + } + // the last token was just ignored, we can't accept + // by ignoring input, this is in essence ignoring a + // syntax error! + return false; + } else if ($nextstate === self::YY_NO_ACTION) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + // input accepted, but not shifted (I guess) + return true; + } else { + $yyact = $nextstate; + } + } while (true); + } + break; + } while (true); + $this->yyidx = $yyidx; + $this->yystack = $stack; + + return true; + } + + public function yy_shift($yyNewState, $yyMajor, $yypMinor) + { + $this->yyidx++; + if ($this->yyidx >= self::YYSTACKDEPTH) { + $this->yyidx--; + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sStack Overflow!\n", $this->yyTracePrompt); + } + while ($this->yyidx >= 0) { + $this->yy_pop_parser_stack(); + } + #line 239 "../smarty/lexer/smarty_internal_configfileparser.y" + + $this->internalError = true; + $this->compiler->trigger_config_file_error("Stack overflow in configfile parser"); + + return; + } + $yytos = new TPC_yyStackEntry; + $yytos->stateno = $yyNewState; + $yytos->major = $yyMajor; + $yytos->minor = $yypMinor; + $this->yystack[] = $yytos; + if ($this->yyTraceFILE && $this->yyidx > 0) { + fprintf($this->yyTraceFILE, + "%sShift %d\n", + $this->yyTracePrompt, + $yyNewState); + fprintf($this->yyTraceFILE, "%sStack:", $this->yyTracePrompt); + for ($i = 1; $i <= $this->yyidx; $i++) { + fprintf($this->yyTraceFILE, + " %s", + $this->yyTokenName[ $this->yystack[ $i ]->major ]); + } + fwrite($this->yyTraceFILE, "\n"); + } + } + + public function yy_reduce($yyruleno) + { + if ($this->yyTraceFILE && $yyruleno >= 0 && $yyruleno < count(self::$yyRuleName)) { + fprintf($this->yyTraceFILE, + "%sReduce (%d) [%s].\n", + $this->yyTracePrompt, + $yyruleno, + self::$yyRuleName[ $yyruleno ]); + } + + $this->_retvalue = $yy_lefthand_side = null; + if (isset(self::$yyReduceMap[ $yyruleno ])) { + // call the action + $this->_retvalue = null; + $this->{'yy_r' . self::$yyReduceMap[ $yyruleno ]}(); + $yy_lefthand_side = $this->_retvalue; + } + $yygoto = self::$yyRuleInfo[ $yyruleno ][0]; + $yysize = self::$yyRuleInfo[ $yyruleno ][1]; + $this->yyidx -= $yysize; + for ($i = $yysize; $i; $i--) { + // pop all of the right-hand side parameters + array_pop($this->yystack); + } + $yyact = $this->yy_find_reduce_action($this->yystack[ $this->yyidx ]->stateno, $yygoto); + if ($yyact < self::YYNSTATE) { + if (!$this->yyTraceFILE && $yysize) { + $this->yyidx++; + $x = new TPC_yyStackEntry; + $x->stateno = $yyact; + $x->major = $yygoto; + $x->minor = $yy_lefthand_side; + $this->yystack[ $this->yyidx ] = $x; + } else { + $this->yy_shift($yyact, $yygoto, $yy_lefthand_side); + } + } else if ($yyact == self::YYNSTATE + self::YYNRULE + 1) { + $this->yy_accept(); + } + } + + public function yy_accept() + { + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sAccept!\n", $this->yyTracePrompt); + } + while ($this->yyidx >= 0) { + $this->yy_pop_parser_stack(); + } + #line 225 "../smarty/lexer/smarty_internal_configfileparser.y" + + $this->successful = !$this->internalError; + $this->internalError = false; + $this->retvalue = $this->_retvalue; + } + + public function yy_syntax_error($yymajor, $TOKEN) + { + #line 232 "../smarty/lexer/smarty_internal_configfileparser.y" + + $this->internalError = true; + $this->yymajor = $yymajor; + $this->compiler->trigger_config_file_error(); + } + + public function yy_parse_failed() + { + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sFail!\n", $this->yyTracePrompt); + } + while ($this->yyidx >= 0) { + $this->yy_pop_parser_stack(); } - while ($yymajor != self::YYNOCODE && $this->yyidx >= 0); } } diff --git a/libs/sysplugins/smarty_internal_templatelexer.php b/libs/sysplugins/smarty_internal_templatelexer.php index bb171fa7..60b9ed77 100644 --- a/libs/sysplugins/smarty_internal_templatelexer.php +++ b/libs/sysplugins/smarty_internal_templatelexer.php @@ -18,76 +18,71 @@ */ class Smarty_Internal_Templatelexer { + const TEXT = 1; + const TAG = 2; + const TAGBODY = 3; + const LITERAL = 4; + const DOUBLEQUOTEDSTRING = 5; /** * Source * * @var string */ public $data; - /** * Source length * * @var int */ public $dataLength = null; - /** * byte counter * * @var int */ public $counter; - /** * token number * * @var int */ public $token; - /** * token value * * @var string */ public $value; - /** * current line * * @var int */ public $line; - /** * tag start line * * @var */ public $taglineno; - /** * php code type * * @var string */ public $phpType = ''; - /** * escaped left delimiter * * @var string */ public $ldel = ''; - /** * escaped left delimiter length * * @var int */ public $ldel_length = 0; - /** * escaped right delimiter * @@ -95,133 +90,97 @@ class Smarty_Internal_Templatelexer */ public $rdel = ''; + /** + * PHP start tag string + * + * @var string + */ /** * escaped right delimiter length * * @var int */ public $rdel_length = 0; - /** * state number * * @var int */ public $state = 1; - /** * Smarty object * * @var Smarty */ public $smarty = null; - /** * compiler object * * @var Smarty_Internal_TemplateCompilerBase */ public $compiler = null; - - /** - * literal tag nesting level - * - * @var int - */ - private $literal_cnt = 0; - - /** - * PHP start tag string - * - * @var string - */ - /** * trace file * * @var resource */ public $yyTraceFILE; - /** * trace prompt * * @var string */ public $yyTracePrompt; - /** * XML flag true while processing xml * * @var bool */ public $is_xml = false; - /** * state names * * @var array */ public $state_name = array(1 => 'TEXT', 2 => 'TAG', 3 => 'TAGBODY', 4 => 'LITERAL', 5 => 'DOUBLEQUOTEDSTRING',); - - /** - * storage for assembled token patterns - * - * @var string - */ - private $yy_global_pattern1 = null; - - private $yy_global_pattern2 = null; - - private $yy_global_pattern3 = null; - - private $yy_global_pattern4 = null; - - private $yy_global_pattern5 = null; - /** * token names * * @var array */ public $smarty_token_names = array( // Text for parser error messages - 'NOT' => '(!,not)', - 'OPENP' => '(', - 'CLOSEP' => ')', - 'OPENB' => '[', - 'CLOSEB' => ']', - 'PTR' => '->', - 'APTR' => '=>', - 'EQUAL' => '=', - 'NUMBER' => 'number', - 'UNIMATH' => '+" , "-', - 'MATH' => '*" , "/" , "%', - 'INCDEC' => '++" , "--', - 'SPACE' => ' ', - 'DOLLAR' => '$', - 'SEMICOLON' => ';', - 'COLON' => ':', - 'DOUBLECOLON' => '::', - 'AT' => '@', - 'HATCH' => '#', - 'QUOTE' => '"', - 'BACKTICK' => '`', - 'VERT' => '"|" modifier', - 'DOT' => '.', - 'COMMA' => '","', - 'QMARK' => '"?"', - 'ID' => 'id, name', - 'TEXT' => 'text', - 'LDELSLASH' => '{/..} closing tag', - 'LDEL' => '{...} Smarty tag', - 'COMMENT' => 'comment', - 'AS' => 'as', - 'TO' => 'to', - 'PHP' => '" '"<", "==" ... logical operator', - 'TLOGOP' => '"lt", "eq" ... logical operator; "is div by" ... if condition', - 'SCOND' => '"is even" ... if condition', - ); + 'NOT' => '(!,not)', 'OPENP' => '(', 'CLOSEP' => ')', 'OPENB' => '[', + 'CLOSEB' => ']', 'PTR' => '->', 'APTR' => '=>', 'EQUAL' => '=', + 'NUMBER' => 'number', 'UNIMATH' => '+" , "-', 'MATH' => '*" , "/" , "%', + 'INCDEC' => '++" , "--', 'SPACE' => ' ', 'DOLLAR' => '$', + 'SEMICOLON' => ';', 'COLON' => ':', 'DOUBLECOLON' => '::', 'AT' => '@', + 'HATCH' => '#', 'QUOTE' => '"', 'BACKTICK' => '`', + 'VERT' => '"|" modifier', 'DOT' => '.', 'COMMA' => '","', + 'QMARK' => '"?"', 'ID' => 'id, name', 'TEXT' => 'text', + 'LDELSLASH' => '{/..} closing tag', 'LDEL' => '{...} Smarty tag', + 'COMMENT' => 'comment', 'AS' => 'as', 'TO' => 'to', + 'PHP' => '" '"<", "==" ... logical operator', + 'TLOGOP' => '"lt", "eq" ... logical operator; "is div by" ... if condition', + 'SCOND' => '"is even" ... if condition',); + /** + * literal tag nesting level + * + * @var int + */ + private $literal_cnt = 0; + /** + * storage for assembled token patterns + * + * @var string + */ + private $yy_global_pattern1 = null; + private $yy_global_pattern2 = null; + private $yy_global_pattern3 = null; + private $yy_global_pattern4 = null; + private $yy_global_pattern5 = null; + private $_yy_state = 1; + private $_yy_stack = array(); /** * constructor @@ -240,9 +199,11 @@ class Smarty_Internal_Templatelexer $this->line = 1; $this->smarty = $compiler->smarty; $this->compiler = $compiler; - $this->ldel = preg_quote($this->smarty->left_delimiter, '/'); + $this->pldel = preg_quote($this->smarty->left_delimiter, '/'); + $this->ldel = $this->pldel . ($this->smarty->auto_literal ? '(?!\\s+)' : '\\s*'); $this->ldel_length = strlen($this->smarty->left_delimiter); - $this->rdel = preg_quote($this->smarty->right_delimiter, '/'); + $rdel = preg_quote($this->smarty->right_delimiter, '/'); + $this->rdel = "(?rdel_length = strlen($this->smarty->right_delimiter); $this->smarty_token_names['LDEL'] = $this->smarty->left_delimiter; $this->smarty_token_names['RDEL'] = $this->smarty->right_delimiter; @@ -254,60 +215,11 @@ class Smarty_Internal_Templatelexer $this->yyTracePrompt = '
'; } - /* - * Check if this tag is autoliteral - */ - public function isAutoLiteral() - { - return $this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false; - } - - - private $_yy_state = 1; - private $_yy_stack = array(); - - public function yylex() - { - return $this->{'yylex' . $this->_yy_state}(); - } - - public function yypushstate($state) - { - if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, "%sState push %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state); - } - array_push($this->_yy_stack, $this->_yy_state); - $this->_yy_state = $state; - if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, "%snew State %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state); - } - } - - public function yypopstate() - { - if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, "%sState pop %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state); - } - $this->_yy_state = array_pop($this->_yy_stack); - if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, "%snew State %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state); - } - - } - - public function yybegin($state) - { - $this->_yy_state = $state; - if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, "%sState set %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state); - } - } - - - public function yylex1() +public function yylex1() { if (!isset($this->yy_global_pattern1)) { - $this->yy_global_pattern1 = "/\G([{][}])|\G(" . $this->ldel . "[*])|\G((" . $this->ldel . "\\s*php([ ].*?)?" . $this->rdel . ")|(" . $this->ldel . "\\s*[\/]php" . $this->rdel . "))|\G(" . $this->ldel . "\\s*literal\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*)|\G(\\s*" . $this->rdel . ")|\G((<[?]((php\\s+|=)|\\s+))|(<[%])|(<[?]xml\\s+)|()|([?][>])|([%][>]))|\G([\S\s])/isS"; + $this->yy_global_pattern1 = + $this->replace("/\G([{][}])|\G(SMARTYldel[*])|\G((SMARTYldelphp([ ].*?)?SMARTYrdel)|(SMARTYldel[\/]phpSMARTYrdel))|\G(SMARTYrawldel{2,})|\G(SMARTYldelliteral\\s*SMARTYrdel)|\G(SMARTYldel[\/]literal\\s*SMARTYrdel)|\G(SMARTYldel)|\G((<[?]((php\\s+|=)|\\s+))|(<[%])|(<[?]xml\\s+)|()|([?][>])|([%][>]))|\G([\S\s])/isS"); } if (!isset($this->dataLength)) { $this->dataLength = strlen($this->data); @@ -324,9 +236,10 @@ class Smarty_Internal_Templatelexer $yymatches = array_filter($yymatches); } if (empty($yymatches)) { - throw new Exception('Error: lexing failed because a rule matched' . - ' an empty string. Input "' . substr($this->data, - $this->counter, 5) . '... state TEXT'); + throw new Exception('Error: lexing failed because a rule matched' . ' an empty string. Input "' . + substr($this->data, + $this->counter, + 5) . '... state TEXT'); } next($yymatches); // skip global match $this->token = key($yymatches); // token number @@ -337,11 +250,11 @@ class Smarty_Internal_Templatelexer $this->line += substr_count($this->value, "\n"); // accept this token return true; - } elseif ($r === true) { + } else if ($r === true) { // we have changed state // process this token in the new state return $this->yylex(); - } elseif ($r === false) { + } else if ($r === false) { $this->counter += strlen($this->value); $this->line += substr_count($this->value, "\n"); if ($this->counter >= $this->dataLength) { @@ -351,16 +264,24 @@ class Smarty_Internal_Templatelexer continue; } } else { - throw new Exception('Unexpected input at line' . $this->line . - ': ' . $this->data[$this->counter]); + throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[ $this->counter ]); } break; } while (true); } // end function + public function replace($input) + { + return str_replace(array('SMARTYldel', 'SMARTYrawldel', 'SMARTYrdel'), + array($this->ldel, $this->pldel, $this->rdel), + $input); + } - const TEXT = 1; + public function yylex() + { + return $this->{'yylex' . $this->_yy_state}(); + } function yy_r1_1() { @@ -390,42 +311,65 @@ class Smarty_Internal_Templatelexer function yy_r1_7() { - if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } else { - $this->token = Smarty_Internal_Templateparser::TP_LITERALSTART; - $this->yypushstate(self::LITERAL); - } + $this->token = Smarty_Internal_Templateparser::TP_TEXT; } function yy_r1_8() { - if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } else { - $this->yypushstate(self::TAG); - return true; + $this->token = Smarty_Internal_Templateparser::TP_LITERALSTART; + $this->yypushstate(self::LITERAL); + } + + public function yypushstate($state) + { + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, + "%sState push %s\n", + $this->yyTracePrompt, + isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : + $this->_yy_state); + } + array_push($this->_yy_stack, $this->_yy_state); + $this->_yy_state = $state; + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, + "%snew State %s\n", + $this->yyTracePrompt, + isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : + $this->_yy_state); } } function yy_r1_9() { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; + $this->token = Smarty_Internal_Templateparser::TP_LITERALEND; + $this->yypushstate(self::LITERAL); } function yy_r1_10() { - $this->compiler->getTagCompiler('private_php')->parsePhp($this); + $this->yypushstate(self::TAG); + return true; } - function yy_r1_19() + function yy_r1_11() + { + + $this->compiler->getTagCompiler('private_php')->parsePhp($this); + } // end function + + function yy_r1_20() { $to = $this->dataLength; - preg_match("/($this->ldel)|(<[?]((php\s+|=)|\s+))|(<[%])|(<[?]xml\s+)|()|([?][>])|([%][>])/i", $this->data, $match, PREG_OFFSET_CAPTURE, $this->counter); + preg_match("/((?pldel){$this->ldel})|(<[?]((php\s+|=)|\s+))|(<[%])|(<[?]xml\s+)|()|([?][>])|([%][>])/i", + $this->data, + $match, + PREG_OFFSET_CAPTURE, + $this->counter); if (isset($match[0][1])) { $to = $match[0][1]; } @@ -433,11 +377,11 @@ class Smarty_Internal_Templatelexer $this->token = Smarty_Internal_Templateparser::TP_TEXT; } - - public function yylex2() +public function yylex2() { if (!isset($this->yy_global_pattern2)) { - $this->yy_global_pattern2 = "/\G(" . $this->ldel . "\\s*(if|elseif|else if|while)\\s+)|\G(" . $this->ldel . "\\s*for\\s+)|\G(" . $this->ldel . "\\s*foreach(?![^\s]))|\G(" . $this->ldel . "\\s*setfilter\\s+)|\G(" . $this->ldel . "\\s*make_nocache\\s+)|\G(" . $this->ldel . "\\s*[0-9]*[a-zA-Z_]\\w*(\\s+nocache)?\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*[\/](?:(?!block)[0-9]*[a-zA-Z_]\\w*)\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*[$][0-9]*[a-zA-Z_]\\w*(\\s+nocache)?\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*[\/])|\G(" . $this->ldel . "\\s*)/isS"; + $this->yy_global_pattern2 = + $this->replace("/\G(SMARTYldel(if|elseif|else if|while)\\s+)|\G(SMARTYldelfor\\s+)|\G(SMARTYldelforeach(?![^\s]))|\G(SMARTYldelsetfilter\\s+)|\G(SMARTYldelmake_nocache\\s+)|\G(SMARTYldel[0-9]*[a-zA-Z_]\\w*(\\s+nocache)?\\s*SMARTYrdel)|\G(SMARTYldel[\/](?:(?!block)[0-9]*[a-zA-Z_]\\w*)\\s*SMARTYrdel)|\G(SMARTYldel[$][0-9]*[a-zA-Z_]\\w*(\\s+nocache)?\\s*SMARTYrdel)|\G(SMARTYldel[\/])|\G(SMARTYldel)/isS"); } if (!isset($this->dataLength)) { $this->dataLength = strlen($this->data); @@ -454,9 +398,10 @@ class Smarty_Internal_Templatelexer $yymatches = array_filter($yymatches); } if (empty($yymatches)) { - throw new Exception('Error: lexing failed because a rule matched' . - ' an empty string. Input "' . substr($this->data, - $this->counter, 5) . '... state TAG'); + throw new Exception('Error: lexing failed because a rule matched' . ' an empty string. Input "' . + substr($this->data, + $this->counter, + 5) . '... state TAG'); } next($yymatches); // skip global match $this->token = key($yymatches); // token number @@ -467,11 +412,11 @@ class Smarty_Internal_Templatelexer $this->line += substr_count($this->value, "\n"); // accept this token return true; - } elseif ($r === true) { + } else if ($r === true) { // we have changed state // process this token in the new state return $this->yylex(); - } elseif ($r === false) { + } else if ($r === false) { $this->counter += strlen($this->value); $this->line += substr_count($this->value, "\n"); if ($this->counter >= $this->dataLength) { @@ -481,16 +426,12 @@ class Smarty_Internal_Templatelexer continue; } } else { - throw new Exception('Unexpected input at line' . $this->line . - ': ' . $this->data[$this->counter]); + throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[ $this->counter ]); } break; } while (true); - } // end function - - - const TAG = 2; + } function yy_r2_1() { @@ -500,6 +441,18 @@ class Smarty_Internal_Templatelexer $this->taglineno = $this->line; } + public function yybegin($state) + { + $this->_yy_state = $state; + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, + "%sState set %s\n", + $this->yyTracePrompt, + isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : + $this->_yy_state); + } + } + function yy_r2_3() { @@ -540,6 +493,26 @@ class Smarty_Internal_Templatelexer $this->taglineno = $this->line; } + public function yypopstate() + { + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, + "%sState pop %s\n", + $this->yyTracePrompt, + isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : + $this->_yy_state); + } + $this->_yy_state = array_pop($this->_yy_stack); + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, + "%snew State %s\n", + $this->yyTracePrompt, + isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : + $this->_yy_state); + } + + } + function yy_r2_9() { @@ -551,7 +524,7 @@ class Smarty_Internal_Templatelexer function yy_r2_10() { - if ($this->_yy_stack[count($this->_yy_stack) - 1] == self::TEXT) { + if ($this->_yy_stack[ count($this->_yy_stack) - 1 ] == self::TEXT) { $this->yypopstate(); $this->token = Smarty_Internal_Templateparser::TP_SIMPELOUTPUT; $this->taglineno = $this->line; @@ -561,7 +534,7 @@ class Smarty_Internal_Templatelexer $this->yybegin(self::TAGBODY); $this->taglineno = $this->line; } - } + } // end function function yy_r2_12() { @@ -579,11 +552,11 @@ class Smarty_Internal_Templatelexer $this->taglineno = $this->line; } - - public function yylex3() +public function yylex3() { if (!isset($this->yy_global_pattern3)) { - $this->yy_global_pattern3 = "/\G(\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*)|\G([\"])|\G('[^'\\\\]*(?:\\\\.[^'\\\\]*)*')|\G([$]smarty\\.block\\.(child|parent))|\G([$][0-9]*[a-zA-Z_]\\w*)|\G([$])|\G(\\s+is\\s+in\\s+)|\G(\\s+as\\s+)|\G(\\s+to\\s+)|\G(\\s+step\\s+)|\G(\\s+instanceof\\s+)|\G(\\s*(([!=][=]{1,2})|([<][=>]?)|([>][=]?)|[&|]{2})\\s*)|\G(\\s+(eq|ne|neq|gt|ge|gte|lt|le|lte|mod|and|or|xor)\\s+)|\G(\\s+(is\\s+(not\\s+)?(odd|even|div)\\s+by)\\s+)|\G(\\s+is\\s+(not\\s+)?(odd|even))|\G(([!]\\s*)|(not\\s+))|\G([(](int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)[)]\\s*)|\G(\\s*[(]\\s*)|\G(\\s*[)])|\G(\\[\\s*)|\G(\\s*\\])|\G(\\s*[-][>]\\s*)|\G(\\s*[=][>]\\s*)|\G(\\s*[=]\\s*)|\G(([+]|[-]){2})|\G(\\s*([+]|[-])\\s*)|\G(\\s*([*]{1,2}|[%\/^&]|[<>]{2})\\s*)|\G([@])|\G([#])|\G(\\s+[0-9]*[a-zA-Z_][a-zA-Z0-9_\-:]*\\s*[=]\\s*)|\G(([0-9]*[a-zA-Z_]\\w*)?(\\\\[0-9]*[a-zA-Z_]\\w*)+)|\G([0-9]*[a-zA-Z_]\\w*)|\G(\\d+)|\G([`])|\G([|])|\G([.])|\G(\\s*[,]\\s*)|\G(\\s*[;]\\s*)|\G([:]{2})|\G(\\s*[:]\\s*)|\G(\\s*[?]\\s*)|\G(0[xX][0-9a-fA-F]+)|\G(\\s+)|\G([\S\s])/isS"; + $this->yy_global_pattern3 = + $this->replace("/\G(\\s*SMARTYrdel)|\G(SMARTYldel)|\G([\"])|\G('[^'\\\\]*(?:\\\\.[^'\\\\]*)*')|\G([$]smarty\\.block\\.(child|parent))|\G([$][0-9]*[a-zA-Z_]\\w*)|\G([$])|\G(\\s+is\\s+in\\s+)|\G(\\s+as\\s+)|\G(\\s+to\\s+)|\G(\\s+step\\s+)|\G(\\s+instanceof\\s+)|\G(\\s*(([!=][=]{1,2})|([<][=>]?)|([>][=]?)|[&|]{2})\\s*)|\G(\\s+(eq|ne|neq|gt|ge|gte|lt|le|lte|mod|and|or|xor)\\s+)|\G(\\s+(is\\s+(not\\s+)?(odd|even|div)\\s+by)\\s+)|\G(\\s+is\\s+(not\\s+)?(odd|even))|\G(([!]\\s*)|(not\\s+))|\G([(](int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)[)]\\s*)|\G(\\s*[(]\\s*)|\G(\\s*[)])|\G(\\[\\s*)|\G(\\s*\\])|\G(\\s*[-][>]\\s*)|\G(\\s*[=][>]\\s*)|\G(\\s*[=]\\s*)|\G(([+]|[-]){2})|\G(\\s*([+]|[-])\\s*)|\G(\\s*([*]{1,2}|[%\/^&]|[<>]{2})\\s*)|\G([@])|\G([#])|\G(\\s+[0-9]*[a-zA-Z_][a-zA-Z0-9_\-:]*\\s*[=]\\s*)|\G(([0-9]*[a-zA-Z_]\\w*)?(\\\\[0-9]*[a-zA-Z_]\\w*)+)|\G([0-9]*[a-zA-Z_]\\w*)|\G(\\d+)|\G([`])|\G([|])|\G([.])|\G(\\s*[,]\\s*)|\G(\\s*[;]\\s*)|\G([:]{2})|\G(\\s*[:]\\s*)|\G(\\s*[?]\\s*)|\G(0[xX][0-9a-fA-F]+)|\G(\\s+)|\G([\S\s])/isS"); } if (!isset($this->dataLength)) { $this->dataLength = strlen($this->data); @@ -600,9 +573,10 @@ class Smarty_Internal_Templatelexer $yymatches = array_filter($yymatches); } if (empty($yymatches)) { - throw new Exception('Error: lexing failed because a rule matched' . - ' an empty string. Input "' . substr($this->data, - $this->counter, 5) . '... state TAGBODY'); + throw new Exception('Error: lexing failed because a rule matched' . ' an empty string. Input "' . + substr($this->data, + $this->counter, + 5) . '... state TAGBODY'); } next($yymatches); // skip global match $this->token = key($yymatches); // token number @@ -613,11 +587,11 @@ class Smarty_Internal_Templatelexer $this->line += substr_count($this->value, "\n"); // accept this token return true; - } elseif ($r === true) { + } else if ($r === true) { // we have changed state // process this token in the new state return $this->yylex(); - } elseif ($r === false) { + } else if ($r === false) { $this->counter += strlen($this->value); $this->line += substr_count($this->value, "\n"); if ($this->counter >= $this->dataLength) { @@ -627,16 +601,12 @@ class Smarty_Internal_Templatelexer continue; } } else { - throw new Exception('Unexpected input at line' . $this->line . - ': ' . $this->data[$this->counter]); + throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[ $this->counter ]); } break; } while (true); - } // end function - - - const TAGBODY = 3; + } function yy_r3_1() { @@ -648,12 +618,8 @@ class Smarty_Internal_Templatelexer function yy_r3_2() { - if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } else { - $this->yypushstate(self::TAG); - return true; - } + $this->yypushstate(self::TAG); + return true; } function yy_r3_3() @@ -830,7 +796,8 @@ class Smarty_Internal_Templatelexer { // resolve conflicts with shorttag and right_delimiter starting with '=' - if (substr($this->data, $this->counter + strlen($this->value) - 1, $this->rdel_length) == $this->smarty->right_delimiter) { + if (substr($this->data, $this->counter + strlen($this->value) - 1, $this->rdel_length) == + $this->smarty->right_delimiter) { preg_match("/\s+/", $this->value, $match); $this->value = $match[0]; $this->token = Smarty_Internal_Templateparser::TP_SPACE; @@ -916,7 +883,7 @@ class Smarty_Internal_Templatelexer { $this->token = Smarty_Internal_Templateparser::TP_SPACE; - } + } // end function function yy_r3_66() { @@ -924,11 +891,11 @@ class Smarty_Internal_Templatelexer $this->token = Smarty_Internal_Templateparser::TP_TEXT; } - - public function yylex4() +public function yylex4() { if (!isset($this->yy_global_pattern4)) { - $this->yy_global_pattern4 = "/\G(" . $this->ldel . "\\s*literal\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*[\/]literal\\s*" . $this->rdel . ")|\G([\S\s])/isS"; + $this->yy_global_pattern4 = + $this->replace("/\G(SMARTYldelliteral\\s*SMARTYrdel)|\G(SMARTYldel[\/]literal\\s*SMARTYrdel)|\G([\S\s])/isS"); } if (!isset($this->dataLength)) { $this->dataLength = strlen($this->data); @@ -945,9 +912,10 @@ class Smarty_Internal_Templatelexer $yymatches = array_filter($yymatches); } if (empty($yymatches)) { - throw new Exception('Error: lexing failed because a rule matched' . - ' an empty string. Input "' . substr($this->data, - $this->counter, 5) . '... state LITERAL'); + throw new Exception('Error: lexing failed because a rule matched' . ' an empty string. Input "' . + substr($this->data, + $this->counter, + 5) . '... state LITERAL'); } next($yymatches); // skip global match $this->token = key($yymatches); // token number @@ -958,11 +926,11 @@ class Smarty_Internal_Templatelexer $this->line += substr_count($this->value, "\n"); // accept this token return true; - } elseif ($r === true) { + } else if ($r === true) { // we have changed state // process this token in the new state return $this->yylex(); - } elseif ($r === false) { + } else if ($r === false) { $this->counter += strlen($this->value); $this->line += substr_count($this->value, "\n"); if ($this->counter >= $this->dataLength) { @@ -972,16 +940,12 @@ class Smarty_Internal_Templatelexer continue; } } else { - throw new Exception('Unexpected input at line' . $this->line . - ': ' . $this->data[$this->counter]); + throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[ $this->counter ]); } break; } while (true); - } // end function - - - const LITERAL = 4; + } function yy_r4_1() { @@ -1006,7 +970,11 @@ class Smarty_Internal_Templatelexer { $to = $this->dataLength; - preg_match("/{$this->ldel}[\/]?literal{$this->rdel}/i", $this->data, $match, PREG_OFFSET_CAPTURE, $this->counter); + preg_match("/{$this->ldel}[\/]?literal{$this->rdel}/i", + $this->data, + $match, + PREG_OFFSET_CAPTURE, + $this->counter); if (isset($match[0][1])) { $to = $match[0][1]; } else { @@ -1014,13 +982,13 @@ class Smarty_Internal_Templatelexer } $this->value = substr($this->data, $this->counter, $to - $this->counter); $this->token = Smarty_Internal_Templateparser::TP_LITERAL; - } + } // end function - - public function yylex5() +public function yylex5() { if (!isset($this->yy_global_pattern5)) { - $this->yy_global_pattern5 = "/\G(" . $this->ldel . "\\s*literal\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*[\/]literal\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*[\/])|\G(" . $this->ldel . "\\s*[0-9]*[a-zA-Z_]\\w*)|\G(" . $this->ldel . "\\s*)|\G([\"])|\G([`][$])|\G([$][0-9]*[a-zA-Z_]\\w*)|\G([$])|\G(([^\"\\\\]*?)((?:\\\\.[^\"\\\\]*?)*?)(?=(" . $this->ldel . "|\\$|`\\$|\")))|\G([\S\s])/isS"; + $this->yy_global_pattern5 = + $this->replace("/\G(SMARTYrawldel{2,})|\G(SMARTYldelliteral\\s*SMARTYrdel)|\G(SMARTYldel[\/]literal\\s*SMARTYrdel)|\G(SMARTYldel[\/])|\G(SMARTYldel[0-9]*[a-zA-Z_]\\w*)|\G(SMARTYldel)|\G([\"])|\G([`][$])|\G([$][0-9]*[a-zA-Z_]\\w*)|\G([$])|\G(([^\"\\\\]*?)((?:\\\\.[^\"\\\\]*?)*?)(?=(SMARTYldel|\\$|`\\$|\")))|\G([\S\s])/isS"); } if (!isset($this->dataLength)) { $this->dataLength = strlen($this->data); @@ -1037,9 +1005,10 @@ class Smarty_Internal_Templatelexer $yymatches = array_filter($yymatches); } if (empty($yymatches)) { - throw new Exception('Error: lexing failed because a rule matched' . - ' an empty string. Input "' . substr($this->data, - $this->counter, 5) . '... state DOUBLEQUOTEDSTRING'); + throw new Exception('Error: lexing failed because a rule matched' . ' an empty string. Input "' . + substr($this->data, + $this->counter, + 5) . '... state DOUBLEQUOTEDSTRING'); } next($yymatches); // skip global match $this->token = key($yymatches); // token number @@ -1050,11 +1019,11 @@ class Smarty_Internal_Templatelexer $this->line += substr_count($this->value, "\n"); // accept this token return true; - } elseif ($r === true) { + } else if ($r === true) { // we have changed state // process this token in the new state return $this->yylex(); - } elseif ($r === false) { + } else if ($r === false) { $this->counter += strlen($this->value); $this->line += substr_count($this->value, "\n"); if ($this->counter >= $this->dataLength) { @@ -1064,16 +1033,12 @@ class Smarty_Internal_Templatelexer continue; } } else { - throw new Exception('Unexpected input at line' . $this->line . - ': ' . $this->data[$this->counter]); + throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[ $this->counter ]); } break; } while (true); - } // end function - - - const DOUBLEQUOTEDSTRING = 5; + } function yy_r5_1() { @@ -1090,45 +1055,39 @@ class Smarty_Internal_Templatelexer function yy_r5_3() { - if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } else { - $this->yypushstate(self::TAG); - return true; - } + $this->token = Smarty_Internal_Templateparser::TP_TEXT; } function yy_r5_4() { - if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } else { - $this->yypushstate(self::TAG); - return true; - } + $this->yypushstate(self::TAG); + return true; } function yy_r5_5() { - if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } else { - $this->token = Smarty_Internal_Templateparser::TP_LDEL; - $this->taglineno = $this->line; - $this->yypushstate(self::TAGBODY); - } + $this->yypushstate(self::TAG); + return true; } function yy_r5_6() + { + + $this->token = Smarty_Internal_Templateparser::TP_LDEL; + $this->taglineno = $this->line; + $this->yypushstate(self::TAGBODY); + } + + function yy_r5_7() { $this->token = Smarty_Internal_Templateparser::TP_QUOTE; $this->yypopstate(); } - function yy_r5_7() + function yy_r5_8() { $this->token = Smarty_Internal_Templateparser::TP_BACKTICK; @@ -1137,16 +1096,10 @@ class Smarty_Internal_Templatelexer $this->taglineno = $this->line; } - function yy_r5_8() - { - - $this->token = Smarty_Internal_Templateparser::TP_DOLLARID; - } - function yy_r5_9() { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; + $this->token = Smarty_Internal_Templateparser::TP_DOLLARID; } function yy_r5_10() @@ -1155,7 +1108,13 @@ class Smarty_Internal_Templatelexer $this->token = Smarty_Internal_Templateparser::TP_TEXT; } - function yy_r5_14() + function yy_r5_11() + { + + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } + + function yy_r5_15() { $to = $this->dataLength; diff --git a/libs/sysplugins/smarty_internal_templateparser.php b/libs/sysplugins/smarty_internal_templateparser.php index bc74fe44..94727829 100644 --- a/libs/sysplugins/smarty_internal_templateparser.php +++ b/libs/sysplugins/smarty_internal_templateparser.php @@ -2,8 +2,7 @@ class TP_yyToken implements ArrayAccess { - public $string = ''; - + public $string = ''; public $metadata = array(); public function __construct($s, $m = array()) @@ -12,10 +11,10 @@ class TP_yyToken implements ArrayAccess $this->string = $s->string; $this->metadata = $s->metadata; } else { - $this->string = (string) $s; + $this->string = (string)$s; if ($m instanceof TP_yyToken) { $this->metadata = $m->metadata; - } elseif (is_array($m)) { + } else if (is_array($m)) { $this->metadata = $m; } } @@ -39,7 +38,7 @@ class TP_yyToken implements ArrayAccess public function offsetSet($offset, $value) { if ($offset === null) { - if (isset($value[ 0 ])) { + if (isset($value[0])) { $x = ($value instanceof TP_yyToken) ? $value->metadata : $value; $this->metadata = array_merge($this->metadata, $x); @@ -54,7 +53,7 @@ class TP_yyToken implements ArrayAccess if ($value->metadata) { $this->metadata[ $offset ] = $value->metadata; } - } elseif ($value) { + } else if ($value) { $this->metadata[ $offset ] = $value; } } @@ -76,6 +75,7 @@ class TP_yyStackEntry ; + #line 11 "../smarty/lexer/smarty_internal_templateparser.y" /** @@ -91,581 +91,341 @@ class Smarty_Internal_Templateparser #line 23 "../smarty/lexer/smarty_internal_templateparser.y" const Err1 = "Security error: Call to private object member not allowed"; - const Err2 = "Security error: Call to dynamic object member not allowed"; - const Err3 = "PHP in template not allowed. Use SmartyBC to enable it"; - - /** - * result status - * - * @var bool - */ - public $successful = true; - - /** - * return value - * - * @var mixed - */ - public $retvalue = 0; - - /** - * @var - */ - public $yymajor; - - /** - * last index of array variable - * - * @var mixed - */ - public $last_index; - - /** - * last variable name - * - * @var string - */ - public $last_variable; - - /** - * root parse tree buffer - * - * @var Smarty_Internal_ParseTree - */ - public $root_buffer; - - /** - * current parse tree object - * - * @var Smarty_Internal_ParseTree - */ - public $current_buffer; - - /** - * lexer object - * - * @var Smarty_Internal_Templatelexer - */ - public $lex; - - /** - * internal error flag - * - * @var bool - */ - private $internalError = false; - - /** - * {strip} status - * - * @var bool - */ - public $strip = false; - - /** - * compiler object - * - * @var Smarty_Internal_TemplateCompilerBase - */ - public $compiler = null; - - /** - * smarty object - * - * @var Smarty - */ - public $smarty = null; - - /** - * template object - * - * @var Smarty_Internal_Template - */ - public $template = null; - - /** - * block nesting level - * - * @var int - */ - public $block_nesting_level = 0; - - /** - * security object - * - * @var Smarty_Security - */ - public $security = null; - - /** - * template prefix array - * - * @var \Smarty_Internal_ParseTree[] - */ - public $template_prefix = array(); - - /** - * security object - * - * @var \Smarty_Internal_ParseTree[] - */ - public $template_postfix = array(); - - /** - * constructor - * - * @param Smarty_Internal_Templatelexer $lex - * @param Smarty_Internal_TemplateCompilerBase $compiler - */ - function __construct(Smarty_Internal_Templatelexer $lex, Smarty_Internal_TemplateCompilerBase $compiler) - { - $this->lex = $lex; - $this->compiler = $compiler; - $this->template = $this->compiler->template; - $this->smarty = $this->template->smarty; - $this->security = isset($this->smarty->security_policy) ? $this->smarty->security_policy : false; - $this->current_buffer = $this->root_buffer = new Smarty_Internal_ParseTree_Template(); - } - - /** - * insert PHP code in current buffer - * - * @param string $code - */ - public function insertPhpCode($code) - { - $this->current_buffer->append_subtree($this, new Smarty_Internal_ParseTree_Tag($this, $code)); - } - - /** - * merge PHP code with prefix code and return parse tree tag object - * - * @param string $code - * - * @return Smarty_Internal_ParseTree_Tag - */ - public function mergePrefixCode($code) - { - $tmp = ''; - foreach ($this->compiler->prefix_code as $preCode) { - $tmp .= $preCode; - } - $this->compiler->prefix_code = array(); - $tmp .= $code; - return new Smarty_Internal_ParseTree_Tag($this, $this->compiler->processNocacheCode($tmp, true)); - } - - const TP_VERT = 1; - - const TP_COLON = 2; - - const TP_PHP = 3; - - const TP_TEXT = 4; - - const TP_STRIPON = 5; - - const TP_STRIPOFF = 6; - - const TP_LITERALSTART = 7; - - const TP_LITERALEND = 8; - - const TP_LITERAL = 9; - - const TP_RDEL = 10; - - const TP_SIMPELOUTPUT = 11; - - const TP_LDEL = 12; - - const TP_DOLLARID = 13; - - const TP_EQUAL = 14; - - const TP_SIMPLETAG = 15; - - const TP_ID = 16; - - const TP_PTR = 17; - - const TP_LDELMAKENOCACHE = 18; - - const TP_LDELIF = 19; - - const TP_LDELFOR = 20; - - const TP_SEMICOLON = 21; - - const TP_INCDEC = 22; - - const TP_TO = 23; - - const TP_STEP = 24; - - const TP_LDELFOREACH = 25; - - const TP_SPACE = 26; - - const TP_AS = 27; - - const TP_APTR = 28; - - const TP_LDELSETFILTER = 29; - + const TP_VERT = 1; + const TP_COLON = 2; + const TP_PHP = 3; + const TP_TEXT = 4; + const TP_STRIPON = 5; + const TP_STRIPOFF = 6; + const TP_LITERALSTART = 7; + const TP_LITERALEND = 8; + const TP_LITERAL = 9; + const TP_RDEL = 10; + const TP_SIMPELOUTPUT = 11; + const TP_LDEL = 12; + const TP_DOLLARID = 13; + const TP_EQUAL = 14; + const TP_SIMPLETAG = 15; + const TP_ID = 16; + const TP_PTR = 17; + const TP_LDELMAKENOCACHE = 18; + const TP_LDELIF = 19; + const TP_LDELFOR = 20; + const TP_SEMICOLON = 21; + const TP_INCDEC = 22; + const TP_TO = 23; + const TP_STEP = 24; + const TP_LDELFOREACH = 25; + const TP_SPACE = 26; + const TP_AS = 27; + const TP_APTR = 28; + const TP_LDELSETFILTER = 29; const TP_SMARTYBLOCKCHILDPARENT = 30; - - const TP_CLOSETAG = 31; - - const TP_LDELSLASH = 32; - - const TP_ATTR = 33; - - const TP_INTEGER = 34; - - const TP_COMMA = 35; - - const TP_OPENP = 36; - - const TP_CLOSEP = 37; - - const TP_MATH = 38; - - const TP_UNIMATH = 39; - - const TP_ISIN = 40; - - const TP_QMARK = 41; - - const TP_NOT = 42; - - const TP_TYPECAST = 43; - - const TP_HEX = 44; - - const TP_DOT = 45; - - const TP_INSTANCEOF = 46; - - const TP_SINGLEQUOTESTRING = 47; - - const TP_DOUBLECOLON = 48; - - const TP_NAMESPACE = 49; - - const TP_AT = 50; - - const TP_HATCH = 51; - - const TP_OPENB = 52; - - const TP_CLOSEB = 53; - - const TP_DOLLAR = 54; - - const TP_LOGOP = 55; - - const TP_SLOGOP = 56; - - const TP_TLOGOP = 57; - - const TP_SINGLECOND = 58; - - const TP_QUOTE = 59; - - const TP_BACKTICK = 60; - - const YY_NO_ACTION = 532; - - const YY_ACCEPT_ACTION = 531; - - const YY_ERROR_ACTION = 530; - - const YY_SZ_ACTTAB = 2114; - - static public $yy_action = array(268, 8, 132, 210, 245, 197, 183, 228, 7, 84, 176, 264, 275, 302, 112, 44, 36, 278, - 233, 136, 305, 221, 281, 203, 237, 26, 234, 202, 41, 104, 189, 39, 42, 256, 213, - 216, 224, 78, 207, 129, 82, 1, 316, 297, 102, 268, 8, 133, 79, 245, 80, 302, 228, - 7, 84, 330, 299, 82, 272, 112, 297, 273, 325, 233, 285, 305, 221, 214, 231, 34, 26, - 3, 101, 41, 230, 78, 39, 42, 256, 213, 35, 239, 314, 207, 300, 82, 1, 13, 297, 333, - 268, 8, 135, 79, 245, 201, 302, 228, 7, 84, 35, 85, 322, 109, 112, 29, 196, 13, - 233, 269, 305, 221, 237, 231, 249, 26, 136, 104, 41, 219, 78, 39, 42, 256, 213, - 459, 239, 267, 207, 355, 82, 1, 459, 297, 446, 268, 8, 135, 79, 245, 193, 302, 228, - 7, 84, 35, 446, 297, 28, 112, 247, 263, 13, 233, 82, 305, 221, 297, 231, 309, 26, - 185, 292, 41, 298, 78, 39, 42, 256, 213, 27, 239, 237, 207, 232, 82, 1, 104, 297, - 459, 268, 8, 135, 79, 245, 195, 459, 228, 7, 84, 446, 297, 283, 11, 112, 25, 188, - 282, 233, 236, 305, 221, 446, 204, 294, 26, 32, 318, 41, 90, 210, 39, 42, 256, 213, - 174, 239, 137, 207, 402, 82, 1, 210, 297, 9, 268, 8, 136, 79, 245, 201, 223, 228, - 7, 84, 402, 142, 235, 225, 112, 22, 227, 402, 233, 166, 305, 221, 35, 231, 27, 33, - 210, 101, 41, 13, 210, 39, 42, 256, 213, 361, 239, 302, 207, 399, 82, 1, 210, 297, - 101, 268, 8, 135, 79, 245, 201, 402, 228, 7, 84, 399, 235, 297, 109, 112, 447, 78, - 399, 233, 319, 305, 221, 402, 194, 172, 26, 279, 447, 41, 402, 307, 39, 42, 256, - 213, 182, 239, 16, 207, 296, 82, 1, 210, 297, 101, 268, 8, 131, 79, 245, 201, 357, - 228, 7, 84, 283, 11, 475, 475, 112, 282, 303, 475, 233, 24, 305, 221, 35, 231, 175, - 4, 279, 271, 41, 13, 109, 39, 42, 256, 213, 181, 239, 178, 207, 12, 82, 1, 16, 297, - 274, 268, 8, 135, 79, 245, 200, 475, 228, 7, 84, 475, 475, 283, 11, 112, 475, 189, - 282, 233, 210, 305, 221, 20, 231, 38, 26, 179, 292, 41, 148, 446, 39, 42, 256, 213, - 229, 239, 180, 207, 332, 82, 1, 446, 297, 190, 268, 8, 134, 79, 245, 201, 215, 228, - 7, 84, 168, 16, 188, 243, 112, 104, 189, 303, 233, 140, 305, 221, 325, 231, 255, - 26, 177, 214, 41, 218, 312, 39, 42, 256, 213, 277, 239, 128, 207, 101, 82, 1, 92, - 297, 2, 268, 8, 136, 79, 245, 201, 23, 228, 7, 84, 210, 108, 251, 184, 112, 297, - 304, 289, 233, 367, 305, 221, 137, 231, 315, 33, 220, 5, 41, 9, 5, 39, 42, 256, - 213, 35, 239, 189, 207, 113, 82, 311, 13, 297, 106, 446, 214, 212, 79, 116, 72, - 114, 258, 260, 261, 222, 102, 446, 214, 257, 280, 187, 308, 334, 270, 206, 242, - 152, 299, 210, 128, 83, 262, 250, 252, 253, 176, 332, 211, 329, 268, 8, 151, 143, - 245, 189, 178, 228, 7, 84, 210, 265, 332, 332, 112, 188, 21, 311, 233, 153, 305, - 221, 214, 212, 17, 122, 67, 114, 164, 141, 189, 13, 102, 149, 266, 257, 280, 183, - 332, 332, 270, 206, 242, 332, 299, 295, 44, 36, 278, 235, 311, 208, 279, 145, 169, - 214, 212, 91, 122, 67, 114, 189, 320, 332, 167, 102, 146, 139, 257, 280, 94, 171, - 159, 270, 206, 242, 332, 299, 210, 38, 311, 189, 332, 155, 209, 214, 212, 317, 122, - 53, 107, 123, 232, 332, 189, 102, 291, 400, 257, 280, 6, 217, 276, 270, 206, 242, - 311, 299, 297, 158, 313, 214, 212, 400, 122, 49, 107, 154, 117, 332, 400, 102, 30, - 446, 257, 280, 248, 332, 173, 270, 206, 242, 279, 299, 324, 446, 186, 292, 332, 95, - 279, 268, 10, 326, 170, 245, 88, 87, 228, 7, 84, 279, 138, 89, 279, 112, 86, 309, - 311, 233, 115, 305, 221, 214, 212, 254, 122, 67, 114, 105, 303, 163, 165, 102, 303, - 93, 257, 280, 303, 303, 303, 270, 206, 242, 303, 299, 303, 303, 303, 286, 19, 311, - 205, 303, 303, 303, 214, 212, 303, 116, 72, 114, 303, 43, 40, 37, 102, 303, 303, - 257, 280, 303, 303, 303, 270, 206, 242, 303, 299, 324, 327, 323, 288, 287, 303, - 303, 268, 10, 326, 331, 245, 303, 303, 228, 7, 84, 303, 303, 303, 303, 112, 303, - 303, 311, 233, 303, 305, 221, 214, 212, 303, 122, 70, 114, 303, 303, 303, 303, 102, - 303, 303, 257, 280, 303, 283, 11, 270, 206, 242, 282, 299, 303, 311, 303, 290, 19, - 303, 214, 212, 35, 122, 54, 114, 303, 303, 303, 13, 102, 162, 303, 257, 280, 183, - 303, 303, 270, 206, 242, 332, 299, 311, 44, 36, 278, 303, 214, 212, 303, 122, 68, - 114, 303, 303, 303, 303, 102, 189, 303, 257, 280, 303, 303, 303, 270, 206, 242, - 303, 299, 311, 303, 303, 303, 303, 214, 212, 303, 100, 73, 114, 303, 303, 303, 303, - 102, 303, 303, 257, 280, 303, 303, 303, 270, 206, 242, 303, 299, 311, 303, 303, - 303, 303, 214, 212, 303, 122, 77, 114, 303, 303, 303, 303, 102, 147, 303, 257, 280, - 183, 303, 303, 270, 206, 242, 332, 299, 311, 44, 36, 278, 303, 214, 212, 303, 122, - 76, 114, 303, 303, 303, 303, 102, 189, 303, 257, 280, 303, 303, 303, 270, 206, 242, - 303, 299, 311, 303, 303, 303, 303, 214, 212, 303, 99, 71, 114, 303, 303, 303, 303, - 102, 161, 303, 257, 280, 183, 303, 303, 270, 206, 242, 332, 299, 311, 44, 36, 278, - 303, 214, 212, 303, 122, 47, 114, 303, 303, 303, 303, 102, 189, 303, 257, 280, 303, - 303, 303, 270, 206, 242, 303, 299, 311, 303, 303, 303, 303, 214, 212, 303, 122, 59, - 114, 303, 303, 303, 303, 102, 150, 303, 257, 280, 183, 303, 303, 270, 206, 242, - 332, 299, 311, 44, 36, 278, 303, 214, 198, 303, 118, 55, 114, 303, 303, 303, 303, - 102, 189, 303, 257, 280, 303, 303, 303, 270, 206, 242, 303, 299, 311, 303, 303, - 303, 303, 214, 212, 303, 122, 69, 114, 303, 303, 303, 303, 102, 160, 303, 257, 280, - 183, 303, 303, 270, 206, 242, 332, 299, 311, 44, 36, 278, 303, 214, 97, 303, 81, - 48, 103, 303, 303, 303, 303, 102, 189, 303, 257, 280, 303, 303, 303, 270, 206, 242, - 303, 299, 311, 303, 303, 303, 303, 214, 212, 303, 122, 57, 114, 303, 303, 303, 303, - 102, 303, 303, 257, 280, 303, 303, 303, 270, 206, 242, 303, 299, 311, 303, 303, - 303, 303, 214, 212, 303, 122, 65, 114, 303, 303, 303, 303, 102, 303, 303, 257, 280, - 303, 303, 303, 270, 206, 242, 303, 299, 311, 303, 303, 303, 303, 214, 96, 303, 81, - 46, 103, 303, 303, 303, 303, 102, 303, 303, 257, 280, 303, 303, 303, 270, 206, 242, - 303, 299, 311, 303, 303, 303, 303, 214, 212, 303, 111, 50, 114, 303, 303, 303, 303, - 102, 303, 303, 257, 280, 303, 303, 303, 270, 206, 242, 303, 299, 311, 303, 303, - 303, 303, 214, 212, 303, 98, 61, 114, 303, 303, 303, 303, 102, 303, 303, 257, 280, - 303, 303, 303, 270, 206, 242, 303, 299, 311, 303, 303, 303, 303, 214, 199, 303, - 122, 56, 114, 303, 303, 303, 303, 102, 303, 303, 257, 280, 303, 303, 303, 270, 206, - 242, 303, 299, 311, 303, 303, 303, 303, 214, 212, 303, 122, 51, 114, 303, 303, 303, - 303, 102, 303, 303, 257, 280, 303, 303, 303, 270, 206, 242, 303, 299, 311, 303, - 303, 303, 303, 214, 212, 303, 122, 58, 114, 303, 303, 303, 303, 102, 303, 303, 257, - 280, 303, 303, 303, 270, 206, 242, 303, 299, 311, 303, 303, 303, 303, 214, 212, - 303, 122, 74, 114, 303, 303, 303, 303, 102, 303, 303, 257, 280, 303, 303, 303, 270, - 206, 242, 303, 299, 311, 303, 303, 303, 303, 214, 212, 303, 122, 62, 114, 303, 303, - 303, 303, 102, 303, 303, 257, 280, 303, 303, 303, 270, 206, 242, 303, 299, 311, - 303, 303, 303, 303, 214, 212, 303, 122, 60, 114, 303, 303, 303, 303, 102, 303, 303, - 257, 280, 303, 303, 303, 270, 206, 242, 303, 299, 311, 303, 303, 303, 303, 214, - 212, 303, 122, 45, 114, 303, 303, 303, 303, 102, 303, 303, 257, 280, 303, 303, 303, - 270, 206, 242, 303, 299, 311, 303, 303, 303, 303, 214, 212, 303, 122, 64, 114, 303, - 303, 303, 303, 102, 303, 303, 257, 280, 303, 303, 303, 270, 206, 242, 303, 299, - 311, 303, 303, 303, 303, 214, 212, 303, 122, 75, 114, 303, 303, 303, 303, 102, 303, - 303, 257, 280, 303, 303, 303, 270, 206, 242, 303, 299, 311, 303, 303, 303, 303, - 214, 212, 303, 122, 63, 114, 303, 303, 303, 303, 102, 303, 303, 257, 280, 303, 303, - 303, 270, 206, 242, 303, 299, 311, 303, 303, 303, 303, 214, 212, 303, 122, 66, 114, - 303, 303, 303, 303, 102, 303, 303, 257, 280, 303, 412, 412, 270, 206, 242, 303, - 299, 311, 303, 303, 303, 303, 214, 212, 303, 122, 53, 114, 303, 303, 303, 303, 102, - 303, 303, 257, 280, 210, 303, 303, 270, 206, 242, 303, 299, 446, 301, 412, 412, - 412, 303, 531, 52, 259, 260, 261, 222, 446, 303, 214, 303, 303, 35, 303, 412, 412, - 412, 412, 303, 13, 303, 303, 303, 303, 43, 40, 37, 210, 303, 303, 311, 303, 303, - 303, 303, 214, 212, 210, 130, 303, 114, 327, 323, 288, 287, 102, 303, 303, 303, - 241, 31, 303, 35, 270, 206, 242, 303, 299, 303, 13, 303, 303, 35, 303, 43, 40, 37, - 303, 303, 13, 303, 303, 303, 303, 43, 40, 37, 303, 303, 303, 311, 327, 323, 288, - 287, 214, 212, 210, 124, 303, 114, 327, 323, 288, 287, 102, 192, 303, 303, 310, - 303, 303, 303, 270, 206, 242, 311, 299, 226, 303, 303, 214, 212, 303, 120, 303, - 114, 475, 475, 303, 28, 102, 475, 459, 43, 40, 37, 303, 303, 270, 206, 242, 303, - 299, 303, 303, 303, 303, 303, 303, 311, 327, 323, 288, 287, 214, 212, 303, 126, - 303, 114, 459, 303, 303, 459, 102, 475, 303, 459, 226, 303, 303, 303, 270, 206, - 242, 303, 299, 475, 475, 226, 18, 303, 475, 459, 303, 303, 303, 303, 475, 475, 303, - 303, 226, 475, 459, 283, 11, 303, 303, 303, 282, 475, 475, 303, 303, 303, 475, 459, - 303, 303, 35, 459, 144, 303, 459, 303, 475, 13, 459, 303, 303, 303, 459, 303, 303, - 459, 311, 475, 303, 459, 321, 214, 212, 303, 119, 459, 114, 303, 459, 303, 475, - 102, 459, 303, 303, 303, 303, 303, 303, 270, 206, 242, 303, 299, 311, 210, 14, 303, - 303, 214, 212, 303, 127, 303, 114, 303, 284, 303, 303, 102, 129, 303, 303, 303, - 303, 102, 303, 270, 206, 242, 311, 299, 210, 303, 293, 214, 212, 299, 121, 303, - 114, 311, 43, 40, 37, 102, 214, 212, 303, 125, 303, 114, 303, 270, 206, 242, 102, - 299, 156, 327, 323, 288, 287, 210, 270, 206, 242, 210, 299, 43, 40, 37, 210, 303, - 303, 303, 244, 303, 303, 303, 303, 303, 303, 110, 303, 303, 327, 323, 288, 287, - 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, 43, 40, 37, 210, 43, 40, 37, 210, - 303, 43, 40, 37, 240, 210, 303, 303, 191, 327, 323, 288, 287, 327, 323, 288, 287, - 303, 327, 323, 288, 287, 303, 306, 303, 303, 303, 303, 303, 303, 303, 303, 43, 40, - 37, 303, 43, 40, 37, 210, 303, 238, 43, 40, 37, 303, 303, 303, 303, 327, 323, 288, - 287, 327, 323, 288, 287, 15, 303, 327, 323, 288, 287, 303, 303, 303, 475, 475, 303, - 303, 303, 475, 459, 210, 303, 246, 43, 40, 37, 210, 303, 303, 303, 303, 303, 475, - 475, 283, 11, 303, 475, 459, 282, 327, 323, 288, 287, 303, 303, 303, 459, 303, 35, - 459, 157, 475, 303, 459, 303, 13, 43, 40, 37, 303, 303, 303, 43, 40, 37, 459, 303, - 303, 459, 303, 475, 328, 459, 327, 323, 288, 287, 303, 303, 327, 323, 288, 287, - 303, 406, 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, 406, 303, 406, 303, - 303, 406, 303, 303, 303, 303, 303, 303, 406, 303, 406, 303, 406, 303, 303, 303, - 303, 303, 303, 303, 235,); - - static public $yy_lookahead = array(11, 12, 13, 1, 15, 16, 76, 18, 19, 20, 7, 8, 9, 22, 25, 85, 86, 87, 29, 13, 31, - 32, 16, 34, 75, 36, 77, 78, 39, 80, 100, 42, 43, 44, 45, 71, 47, 46, 49, 75, 51, - 52, 53, 54, 80, 11, 12, 13, 59, 15, 16, 22, 18, 19, 20, 49, 92, 51, 66, 25, 54, - 69, 65, 29, 30, 31, 32, 70, 34, 14, 36, 35, 17, 39, 16, 46, 42, 43, 44, 45, 26, - 47, 53, 49, 10, 51, 52, 33, 54, 53, 11, 12, 13, 59, 15, 16, 22, 18, 19, 20, 26, - 104, 105, 48, 25, 12, 13, 33, 29, 16, 31, 32, 75, 34, 77, 36, 13, 80, 39, 16, - 46, 42, 43, 44, 45, 45, 47, 34, 49, 10, 51, 52, 52, 54, 36, 11, 12, 13, 59, 15, - 16, 22, 18, 19, 20, 26, 48, 54, 14, 25, 13, 34, 33, 29, 51, 31, 32, 54, 34, 94, - 36, 96, 97, 39, 97, 46, 42, 43, 44, 45, 14, 47, 75, 49, 77, 51, 52, 80, 54, 45, - 11, 12, 13, 59, 15, 16, 52, 18, 19, 20, 36, 54, 11, 12, 25, 21, 100, 16, 29, 45, - 31, 32, 48, 34, 16, 36, 14, 53, 39, 35, 1, 42, 43, 44, 45, 93, 47, 45, 49, 10, - 51, 52, 1, 54, 52, 11, 12, 13, 59, 15, 16, 50, 18, 19, 20, 26, 27, 45, 50, 25, - 12, 13, 33, 29, 16, 31, 32, 26, 34, 14, 36, 1, 17, 39, 33, 1, 42, 43, 44, 45, - 10, 47, 22, 49, 10, 51, 52, 1, 54, 17, 11, 12, 13, 59, 15, 16, 10, 18, 19, 20, - 26, 45, 54, 48, 25, 36, 46, 33, 29, 53, 31, 32, 26, 34, 93, 36, 95, 48, 39, 33, - 60, 42, 43, 44, 45, 81, 47, 35, 49, 37, 51, 52, 1, 54, 17, 11, 12, 13, 59, 15, - 16, 10, 18, 19, 20, 11, 12, 11, 12, 25, 16, 101, 16, 29, 14, 31, 32, 26, 34, 93, - 36, 95, 22, 39, 33, 48, 42, 43, 44, 45, 81, 47, 76, 49, 41, 51, 52, 35, 54, 37, - 11, 12, 13, 59, 15, 16, 50, 18, 19, 20, 11, 12, 11, 12, 25, 16, 100, 16, 29, 1, - 31, 32, 28, 34, 2, 36, 96, 97, 39, 72, 36, 42, 43, 44, 45, 17, 47, 76, 49, 82, - 51, 52, 48, 54, 16, 11, 12, 13, 59, 15, 16, 50, 18, 19, 20, 75, 35, 100, 37, 25, - 80, 100, 101, 29, 13, 31, 32, 65, 34, 37, 36, 13, 70, 39, 16, 91, 42, 43, 44, - 45, 16, 47, 98, 49, 17, 51, 52, 36, 54, 36, 11, 12, 13, 59, 15, 16, 12, 18, 19, - 20, 1, 48, 4, 76, 25, 54, 16, 105, 29, 10, 31, 32, 45, 34, 53, 36, 17, 36, 39, - 52, 36, 42, 43, 44, 45, 26, 47, 100, 49, 16, 51, 65, 33, 54, 80, 36, 70, 71, 59, - 73, 74, 75, 64, 65, 66, 67, 80, 48, 70, 83, 84, 76, 98, 91, 88, 89, 90, 72, 92, - 1, 98, 16, 3, 4, 5, 6, 7, 82, 102, 103, 11, 12, 72, 72, 15, 100, 76, 18, 19, 20, - 1, 16, 82, 82, 25, 100, 28, 65, 29, 51, 31, 32, 70, 71, 26, 73, 74, 75, 72, 72, - 100, 33, 80, 72, 10, 83, 84, 76, 82, 82, 88, 89, 90, 82, 92, 16, 85, 86, 87, 45, - 65, 99, 95, 72, 51, 70, 71, 76, 73, 74, 75, 100, 53, 82, 93, 80, 72, 13, 83, 84, - 76, 93, 72, 88, 89, 90, 82, 92, 1, 2, 65, 100, 82, 72, 99, 70, 71, 53, 73, 74, - 75, 16, 77, 82, 100, 80, 16, 10, 83, 84, 36, 14, 34, 88, 89, 90, 65, 92, 54, 72, - 13, 70, 71, 26, 73, 74, 75, 72, 77, 82, 33, 80, 23, 36, 83, 84, 82, 82, 72, 88, - 89, 90, 95, 92, 4, 48, 96, 97, 82, 81, 95, 11, 12, 13, 93, 15, 80, 80, 18, 19, - 20, 95, 80, 80, 95, 25, 80, 94, 65, 29, 79, 31, 32, 70, 71, 8, 73, 74, 75, 68, - 106, 93, 93, 80, 106, 93, 83, 84, 106, 106, 106, 88, 89, 90, 106, 92, 106, 106, - 106, 59, 60, 65, 99, 106, 106, 106, 70, 71, 106, 73, 74, 75, 106, 38, 39, 40, - 80, 106, 106, 83, 84, 106, 106, 106, 88, 89, 90, 106, 92, 4, 55, 56, 57, 58, - 106, 106, 11, 12, 13, 103, 15, 106, 106, 18, 19, 20, 106, 106, 106, 106, 25, - 106, 106, 65, 29, 106, 31, 32, 70, 71, 106, 73, 74, 75, 106, 106, 106, 106, 80, - 106, 106, 83, 84, 106, 11, 12, 88, 89, 90, 16, 92, 106, 65, 106, 59, 60, 106, - 70, 71, 26, 73, 74, 75, 106, 106, 106, 33, 80, 72, 106, 83, 84, 76, 106, 106, - 88, 89, 90, 82, 92, 65, 85, 86, 87, 106, 70, 71, 106, 73, 74, 75, 106, 106, 106, - 106, 80, 100, 106, 83, 84, 106, 106, 106, 88, 89, 90, 106, 92, 65, 106, 106, - 106, 106, 70, 71, 106, 73, 74, 75, 106, 106, 106, 106, 80, 106, 106, 83, 84, - 106, 106, 106, 88, 89, 90, 106, 92, 65, 106, 106, 106, 106, 70, 71, 106, 73, 74, - 75, 106, 106, 106, 106, 80, 72, 106, 83, 84, 76, 106, 106, 88, 89, 90, 82, 92, - 65, 85, 86, 87, 106, 70, 71, 106, 73, 74, 75, 106, 106, 106, 106, 80, 100, 106, - 83, 84, 106, 106, 106, 88, 89, 90, 106, 92, 65, 106, 106, 106, 106, 70, 71, 106, - 73, 74, 75, 106, 106, 106, 106, 80, 72, 106, 83, 84, 76, 106, 106, 88, 89, 90, - 82, 92, 65, 85, 86, 87, 106, 70, 71, 106, 73, 74, 75, 106, 106, 106, 106, 80, - 100, 106, 83, 84, 106, 106, 106, 88, 89, 90, 106, 92, 65, 106, 106, 106, 106, - 70, 71, 106, 73, 74, 75, 106, 106, 106, 106, 80, 72, 106, 83, 84, 76, 106, 106, - 88, 89, 90, 82, 92, 65, 85, 86, 87, 106, 70, 71, 106, 73, 74, 75, 106, 106, 106, - 106, 80, 100, 106, 83, 84, 106, 106, 106, 88, 89, 90, 106, 92, 65, 106, 106, - 106, 106, 70, 71, 106, 73, 74, 75, 106, 106, 106, 106, 80, 72, 106, 83, 84, 76, - 106, 106, 88, 89, 90, 82, 92, 65, 85, 86, 87, 106, 70, 71, 106, 73, 74, 75, 106, - 106, 106, 106, 80, 100, 106, 83, 84, 106, 106, 106, 88, 89, 90, 106, 92, 65, - 106, 106, 106, 106, 70, 71, 106, 73, 74, 75, 106, 106, 106, 106, 80, 106, 106, - 83, 84, 106, 106, 106, 88, 89, 90, 106, 92, 65, 106, 106, 106, 106, 70, 71, 106, - 73, 74, 75, 106, 106, 106, 106, 80, 106, 106, 83, 84, 106, 106, 106, 88, 89, 90, - 106, 92, 65, 106, 106, 106, 106, 70, 71, 106, 73, 74, 75, 106, 106, 106, 106, - 80, 106, 106, 83, 84, 106, 106, 106, 88, 89, 90, 106, 92, 65, 106, 106, 106, - 106, 70, 71, 106, 73, 74, 75, 106, 106, 106, 106, 80, 106, 106, 83, 84, 106, + const TP_CLOSETAG = 31; + const TP_LDELSLASH = 32; + const TP_ATTR = 33; + const TP_INTEGER = 34; + const TP_COMMA = 35; + const TP_OPENP = 36; + const TP_CLOSEP = 37; + const TP_MATH = 38; + const TP_UNIMATH = 39; + const TP_ISIN = 40; + const TP_QMARK = 41; + const TP_NOT = 42; + const TP_TYPECAST = 43; + const TP_HEX = 44; + const TP_DOT = 45; + const TP_INSTANCEOF = 46; + const TP_SINGLEQUOTESTRING = 47; + const TP_DOUBLECOLON = 48; + const TP_NAMESPACE = 49; + const TP_AT = 50; + const TP_HATCH = 51; + const TP_OPENB = 52; + const TP_CLOSEB = 53; + const TP_DOLLAR = 54; + const TP_LOGOP = 55; + const TP_SLOGOP = 56; + const TP_TLOGOP = 57; + const TP_SINGLECOND = 58; + const TP_QUOTE = 59; + const TP_BACKTICK = 60; + const YY_NO_ACTION = 532; + const YY_ACCEPT_ACTION = 531; + const YY_ERROR_ACTION = 530; + const YY_SZ_ACTTAB = 1993; + const YY_SHIFT_USE_DFLT = -43; + const YY_SHIFT_MAX = 238; + const YY_REDUCE_USE_DFLT = -71; + const YY_REDUCE_MAX = 192; + const YYNOCODE = 107; + const YYSTACKDEPTH = 500; + const YYNSTATE = 335; + const YYNRULE = 195; + const YYERRORSYMBOL = 61; + const YYERRSYMDT = 'yy0'; + const YYFALLBACK = 0; + static public $yy_action = array(272, 8, 131, 237, 275, 80, 179, 230, 6, 84, 20, 324, 175, 101, 116, 41, 16, 327, + 225, 299, 257, 232, 277, 235, 214, 26, 216, 202, 42, 106, 190, 40, 43, 314, 234, + 278, 310, 244, 212, 355, 82, 1, 204, 291, 114, 272, 8, 132, 79, 275, 196, 246, + 230, 6, 84, 11, 177, 267, 269, 116, 21, 197, 14, 225, 252, 257, 232, 11, 205, + 31, 26, 223, 101, 42, 14, 78, 40, 43, 314, 234, 290, 220, 245, 212, 293, 82, 1, + 316, 291, 446, 272, 8, 134, 79, 275, 208, 246, 230, 6, 84, 11, 446, 291, 114, + 116, 15, 204, 14, 225, 136, 257, 232, 251, 235, 254, 26, 185, 298, 42, 90, 78, + 40, 43, 314, 234, 213, 310, 181, 212, 120, 82, 1, 204, 291, 99, 272, 8, 136, 79, + 275, 208, 402, 230, 6, 84, 253, 289, 82, 246, 116, 291, 190, 280, 225, 204, 257, + 232, 402, 235, 189, 12, 18, 17, 42, 402, 204, 40, 43, 314, 234, 228, 310, 78, + 212, 402, 82, 1, 204, 291, 326, 272, 8, 134, 79, 275, 208, 399, 230, 6, 84, 402, + 154, 459, 237, 116, 182, 23, 402, 225, 459, 257, 232, 399, 194, 239, 26, 184, + 298, 42, 399, 158, 40, 43, 314, 234, 106, 310, 246, 212, 190, 82, 1, 204, 291, + 7, 272, 8, 134, 79, 275, 195, 357, 230, 6, 84, 256, 19, 256, 19, 116, 279, 78, + 279, 225, 137, 257, 232, 11, 211, 183, 26, 9, 227, 42, 14, 306, 40, 43, 314, + 234, 93, 310, 214, 212, 270, 82, 1, 106, 291, 2, 272, 8, 134, 79, 275, 193, 224, + 230, 6, 84, 101, 109, 256, 19, 116, 29, 231, 279, 225, 141, 257, 232, 304, 235, + 214, 26, 217, 233, 42, 106, 11, 40, 43, 314, 234, 172, 310, 14, 212, 243, 82, 1, + 36, 291, 313, 272, 8, 135, 79, 275, 208, 222, 230, 6, 84, 446, 36, 291, 292, + 116, 246, 85, 302, 225, 218, 257, 232, 446, 235, 95, 26, 136, 321, 42, 221, 447, + 40, 43, 314, 234, 291, 310, 459, 212, 78, 82, 1, 447, 291, 459, 272, 8, 134, 79, + 275, 199, 35, 230, 6, 84, 475, 475, 475, 475, 116, 475, 140, 475, 225, 82, 257, + 232, 291, 235, 304, 26, 5, 101, 42, 233, 3, 40, 43, 314, 234, 36, 310, 311, 212, + 92, 82, 1, 105, 291, 297, 272, 8, 133, 79, 275, 208, 475, 230, 6, 84, 137, 149, + 291, 278, 116, 296, 180, 9, 225, 312, 257, 232, 27, 235, 176, 4, 139, 148, 42, + 147, 446, 40, 43, 314, 234, 242, 310, 33, 212, 277, 82, 1, 446, 291, 14, 272, 8, + 136, 79, 275, 208, 163, 230, 6, 84, 204, 171, 189, 178, 116, 204, 277, 161, 225, + 367, 257, 232, 291, 235, 361, 12, 236, 277, 42, 278, 101, 40, 43, 314, 234, 11, + 310, 190, 212, 204, 82, 329, 14, 291, 204, 446, 233, 209, 79, 117, 70, 113, 287, + 259, 260, 238, 99, 446, 233, 240, 286, 114, 325, 274, 320, 210, 323, 144, 289, + 129, 119, 24, 261, 263, 264, 265, 177, 277, 203, 294, 272, 8, 145, 143, 275, 3, + 94, 230, 6, 84, 247, 331, 277, 277, 116, 189, 188, 329, 225, 157, 257, 232, 233, + 209, 317, 117, 70, 113, 146, 277, 190, 258, 99, 319, 268, 240, 286, 25, 277, + 150, 320, 210, 323, 179, 289, 204, 38, 282, 165, 277, 219, 329, 41, 16, 327, + 284, 233, 209, 277, 122, 63, 103, 248, 217, 186, 298, 99, 190, 400, 240, 286, + 278, 215, 142, 320, 210, 323, 91, 289, 20, 329, 167, 30, 277, 400, 233, 209, + 276, 122, 67, 113, 400, 110, 330, 446, 99, 271, 187, 240, 286, 129, 190, 318, + 320, 210, 323, 446, 289, 237, 152, 329, 278, 83, 315, 206, 233, 209, 262, 122, + 67, 113, 190, 288, 280, 273, 99, 256, 19, 240, 286, 162, 279, 155, 320, 210, + 323, 182, 289, 303, 86, 168, 11, 277, 160, 201, 272, 10, 305, 14, 275, 254, 138, + 230, 6, 84, 159, 256, 19, 88, 116, 190, 279, 278, 225, 329, 257, 232, 166, 38, + 233, 209, 11, 122, 67, 113, 475, 475, 277, 14, 99, 475, 459, 240, 286, 111, 169, + 266, 320, 210, 323, 278, 289, 303, 300, 13, 104, 87, 89, 207, 272, 10, 305, 303, + 275, 303, 303, 230, 6, 84, 459, 303, 303, 459, 116, 475, 303, 459, 225, 329, + 257, 232, 303, 303, 233, 209, 303, 122, 47, 103, 303, 112, 303, 303, 99, 303, + 303, 240, 286, 303, 303, 303, 320, 210, 323, 303, 289, 303, 301, 13, 329, 303, + 303, 303, 303, 233, 209, 303, 108, 50, 113, 256, 19, 303, 303, 99, 279, 303, + 240, 286, 303, 303, 303, 320, 210, 323, 11, 289, 173, 303, 329, 303, 303, 14, + 303, 233, 209, 303, 122, 54, 113, 204, 303, 303, 303, 99, 303, 303, 240, 286, + 191, 303, 303, 320, 210, 323, 303, 289, 329, 303, 303, 303, 303, 233, 209, 303, + 122, 77, 113, 303, 303, 303, 303, 99, 303, 303, 240, 286, 44, 39, 37, 320, 210, + 323, 329, 289, 303, 303, 303, 233, 209, 303, 122, 74, 113, 322, 308, 307, 285, + 99, 303, 303, 240, 286, 303, 303, 303, 320, 210, 323, 303, 289, 303, 303, 329, + 303, 303, 303, 303, 233, 209, 303, 122, 49, 113, 204, 22, 303, 303, 99, 156, + 303, 240, 286, 179, 303, 303, 320, 210, 323, 277, 289, 329, 41, 16, 327, 303, + 233, 209, 303, 96, 53, 113, 303, 303, 303, 303, 99, 190, 303, 240, 286, 44, 39, + 37, 320, 210, 323, 329, 289, 303, 303, 303, 233, 209, 303, 122, 60, 113, 322, + 308, 307, 285, 99, 303, 303, 240, 286, 303, 303, 303, 320, 210, 323, 303, 289, + 303, 303, 329, 303, 303, 303, 303, 233, 209, 303, 122, 71, 113, 204, 303, 303, + 303, 99, 170, 303, 240, 286, 179, 303, 303, 320, 210, 323, 277, 289, 329, 41, + 16, 327, 303, 233, 198, 303, 115, 61, 113, 303, 303, 303, 303, 99, 190, 303, + 240, 286, 44, 39, 37, 320, 210, 323, 329, 289, 303, 303, 303, 233, 97, 303, 81, + 45, 107, 322, 308, 307, 285, 99, 255, 303, 240, 286, 303, 303, 303, 320, 210, + 323, 303, 289, 303, 303, 329, 303, 303, 303, 303, 233, 209, 303, 122, 62, 113, + 204, 303, 303, 303, 99, 303, 303, 240, 286, 283, 303, 303, 320, 210, 323, 303, + 289, 329, 303, 303, 303, 303, 233, 209, 303, 100, 69, 113, 303, 303, 303, 303, + 99, 303, 303, 240, 286, 44, 39, 37, 320, 210, 323, 329, 289, 303, 303, 303, 233, + 200, 303, 122, 58, 113, 322, 308, 307, 285, 99, 303, 303, 240, 286, 303, 303, + 303, 320, 210, 323, 303, 289, 303, 303, 329, 303, 303, 303, 303, 233, 209, 303, + 102, 68, 113, 204, 303, 303, 303, 99, 303, 303, 240, 286, 241, 303, 303, 320, + 210, 323, 303, 289, 329, 303, 303, 303, 303, 233, 209, 303, 122, 55, 113, 303, + 303, 303, 303, 99, 303, 303, 240, 286, 44, 39, 37, 320, 210, 323, 329, 289, 303, + 303, 303, 233, 209, 303, 122, 65, 113, 322, 308, 307, 285, 99, 303, 303, 240, + 286, 303, 303, 303, 320, 210, 323, 303, 289, 303, 303, 329, 303, 303, 303, 303, + 233, 209, 303, 122, 66, 113, 204, 303, 303, 303, 99, 303, 303, 240, 286, 192, + 303, 303, 320, 210, 323, 303, 289, 329, 303, 303, 303, 303, 233, 209, 303, 122, + 59, 113, 303, 303, 303, 303, 99, 303, 303, 240, 286, 44, 39, 37, 320, 210, 323, + 329, 289, 303, 303, 303, 233, 209, 303, 122, 56, 113, 322, 308, 307, 285, 99, + 303, 303, 240, 286, 303, 303, 303, 320, 210, 323, 303, 289, 303, 303, 329, 303, + 303, 303, 303, 233, 209, 303, 122, 75, 113, 204, 303, 303, 303, 99, 303, 303, + 240, 286, 303, 303, 303, 320, 210, 323, 303, 289, 329, 303, 303, 118, 303, 233, + 209, 303, 122, 51, 113, 303, 303, 303, 303, 99, 303, 303, 240, 286, 44, 39, 37, + 320, 210, 323, 329, 289, 303, 303, 303, 233, 209, 303, 122, 72, 113, 322, 308, + 307, 285, 99, 303, 303, 240, 286, 303, 303, 303, 320, 210, 323, 303, 289, 303, + 303, 329, 303, 303, 303, 303, 233, 209, 303, 122, 63, 113, 204, 303, 303, 303, + 99, 151, 303, 240, 286, 179, 303, 303, 320, 210, 323, 277, 289, 329, 41, 16, + 327, 303, 233, 209, 303, 122, 64, 113, 303, 303, 303, 303, 99, 190, 303, 240, + 286, 44, 39, 37, 320, 210, 323, 329, 289, 303, 303, 303, 233, 209, 303, 122, 46, + 113, 322, 308, 307, 285, 99, 303, 303, 240, 286, 303, 303, 303, 320, 210, 323, + 303, 289, 303, 303, 329, 303, 303, 303, 303, 233, 98, 303, 81, 48, 107, 303, + 303, 303, 303, 99, 153, 303, 240, 286, 179, 303, 303, 320, 210, 323, 277, 289, + 329, 41, 16, 327, 303, 233, 209, 303, 122, 73, 113, 303, 303, 303, 303, 99, 190, + 303, 240, 286, 44, 39, 37, 320, 210, 323, 329, 289, 303, 303, 303, 233, 209, + 303, 122, 57, 113, 322, 308, 307, 285, 99, 303, 303, 240, 286, 303, 303, 303, + 320, 210, 323, 303, 289, 303, 204, 329, 303, 303, 303, 303, 233, 209, 204, 122, + 76, 113, 303, 412, 412, 303, 99, 303, 303, 240, 286, 303, 303, 250, 320, 210, + 323, 120, 289, 303, 303, 28, 99, 11, 303, 303, 229, 44, 39, 37, 14, 249, 303, + 303, 289, 44, 39, 37, 446, 303, 412, 412, 412, 303, 322, 308, 307, 285, 303, + 303, 446, 303, 322, 308, 307, 285, 303, 412, 412, 412, 412, 303, 303, 329, 303, + 303, 303, 303, 233, 209, 303, 123, 303, 113, 303, 303, 303, 303, 99, 303, 406, + 303, 328, 303, 303, 303, 320, 210, 323, 329, 289, 406, 204, 406, 233, 209, 406, + 130, 303, 113, 303, 295, 303, 406, 99, 406, 303, 406, 281, 303, 303, 226, 320, + 210, 323, 237, 289, 11, 303, 303, 475, 475, 303, 18, 14, 475, 459, 303, 204, 44, + 39, 37, 303, 303, 531, 52, 334, 259, 260, 238, 303, 303, 233, 303, 303, 303, + 322, 308, 307, 285, 303, 303, 303, 11, 459, 303, 303, 459, 303, 475, 14, 459, + 303, 329, 303, 44, 39, 37, 233, 209, 303, 125, 303, 113, 303, 303, 303, 303, 99, + 303, 303, 303, 322, 308, 307, 285, 320, 210, 323, 329, 289, 303, 303, 303, 233, + 209, 303, 124, 303, 113, 303, 303, 303, 303, 99, 303, 303, 303, 303, 303, 303, + 303, 320, 210, 323, 329, 289, 303, 303, 303, 233, 209, 303, 121, 303, 113, 329, + 303, 303, 303, 99, 233, 209, 303, 127, 303, 113, 303, 320, 210, 323, 99, 289, + 303, 303, 226, 303, 303, 303, 320, 210, 323, 303, 289, 475, 475, 329, 303, 226, + 475, 459, 233, 209, 303, 128, 303, 113, 475, 475, 303, 34, 99, 475, 459, 204, + 303, 303, 303, 303, 320, 210, 323, 303, 289, 303, 204, 303, 303, 459, 303, 303, + 459, 329, 475, 303, 459, 332, 233, 209, 303, 126, 459, 113, 303, 459, 303, 475, + 99, 459, 303, 303, 44, 39, 37, 303, 320, 210, 323, 303, 289, 303, 309, 44, 39, + 37, 303, 333, 303, 322, 308, 307, 285, 303, 303, 226, 303, 303, 303, 303, 322, + 308, 307, 285, 475, 475, 32, 303, 303, 475, 459, 303, 303, 303, 164, 475, 475, + 303, 179, 303, 475, 459, 204, 303, 277, 303, 303, 41, 16, 327, 303, 303, 303, + 303, 303, 303, 303, 303, 459, 303, 303, 459, 190, 475, 303, 459, 303, 303, 174, + 459, 303, 303, 459, 303, 475, 303, 459, 303, 303, 44, 39, 37, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, 322, 308, 307, 285,); + static public $yy_lookahead = array(11, 12, 13, 45, 15, 16, 76, 18, 19, 20, 14, 53, 72, 17, 25, 85, 86, 87, 29, 30, + 31, 32, 82, 34, 75, 36, 77, 78, 39, 80, 100, 42, 43, 44, 45, 95, 47, 16, 49, 10, + 51, 52, 1, 54, 48, 11, 12, 13, 59, 15, 16, 22, 18, 19, 20, 26, 7, 8, 9, 25, 12, + 13, 33, 29, 16, 31, 32, 26, 34, 14, 36, 50, 17, 39, 33, 46, 42, 43, 44, 45, 97, + 47, 34, 49, 10, 51, 52, 53, 54, 36, 11, 12, 13, 59, 15, 16, 22, 18, 19, 20, 26, + 48, 54, 48, 25, 21, 1, 33, 29, 13, 31, 32, 16, 34, 94, 36, 96, 97, 39, 35, 46, + 42, 43, 44, 45, 71, 47, 76, 49, 75, 51, 52, 1, 54, 80, 11, 12, 13, 59, 15, 16, + 10, 18, 19, 20, 49, 92, 51, 22, 25, 54, 100, 101, 29, 1, 31, 32, 26, 34, 100, + 36, 14, 14, 39, 33, 1, 42, 43, 44, 45, 17, 47, 46, 49, 10, 51, 52, 1, 54, 53, + 11, 12, 13, 59, 15, 16, 10, 18, 19, 20, 26, 27, 45, 45, 25, 76, 14, 33, 29, 52, + 31, 32, 26, 34, 22, 36, 96, 97, 39, 33, 75, 42, 43, 44, 45, 80, 47, 22, 49, 100, + 51, 52, 1, 54, 36, 11, 12, 13, 59, 15, 16, 10, 18, 19, 20, 11, 12, 11, 12, 25, + 16, 46, 16, 29, 45, 31, 32, 26, 34, 13, 36, 52, 16, 39, 33, 60, 42, 43, 44, 45, + 93, 47, 75, 49, 77, 51, 52, 80, 54, 36, 11, 12, 13, 59, 15, 16, 50, 18, 19, 20, + 17, 48, 11, 12, 25, 12, 13, 16, 29, 16, 31, 32, 65, 34, 75, 36, 77, 70, 39, 80, + 26, 42, 43, 44, 45, 93, 47, 33, 49, 13, 51, 52, 35, 54, 37, 11, 12, 13, 59, 15, + 16, 50, 18, 19, 20, 36, 35, 54, 37, 25, 22, 104, 105, 29, 45, 31, 32, 48, 34, + 81, 36, 13, 53, 39, 16, 36, 42, 43, 44, 45, 54, 47, 45, 49, 46, 51, 52, 48, 54, + 52, 11, 12, 13, 59, 15, 16, 12, 18, 19, 20, 11, 12, 11, 12, 25, 16, 13, 16, 29, + 51, 31, 32, 54, 34, 65, 36, 35, 17, 39, 70, 36, 42, 43, 44, 45, 35, 47, 37, 49, + 36, 51, 52, 80, 54, 53, 11, 12, 13, 59, 15, 16, 50, 18, 19, 20, 45, 93, 54, 95, + 25, 98, 81, 52, 29, 105, 31, 32, 28, 34, 81, 36, 13, 93, 39, 72, 36, 42, 43, 44, + 45, 16, 47, 26, 49, 82, 51, 52, 48, 54, 33, 11, 12, 13, 59, 15, 16, 72, 18, 19, + 20, 1, 51, 100, 76, 25, 1, 82, 72, 29, 10, 31, 32, 54, 34, 10, 36, 17, 82, 39, + 95, 17, 42, 43, 44, 45, 26, 47, 100, 49, 1, 51, 65, 33, 54, 1, 36, 70, 71, 59, + 73, 74, 75, 64, 65, 66, 67, 80, 48, 70, 83, 84, 48, 91, 37, 88, 89, 90, 72, 92, + 98, 16, 28, 3, 4, 5, 6, 7, 82, 102, 103, 11, 12, 72, 72, 15, 36, 76, 18, 19, 20, + 16, 53, 82, 82, 25, 100, 16, 65, 29, 72, 31, 32, 70, 71, 53, 73, 74, 75, 72, 82, + 100, 66, 80, 53, 69, 83, 84, 23, 82, 72, 88, 89, 90, 76, 92, 1, 2, 16, 72, 82, + 16, 65, 85, 86, 87, 103, 70, 71, 82, 73, 74, 75, 16, 77, 96, 97, 80, 100, 10, + 83, 84, 95, 14, 72, 88, 89, 90, 76, 92, 14, 65, 51, 41, 82, 26, 70, 71, 13, 73, + 74, 75, 33, 16, 91, 36, 80, 10, 76, 83, 84, 98, 100, 34, 88, 89, 90, 48, 92, 45, + 93, 65, 95, 16, 34, 99, 70, 71, 4, 73, 74, 75, 100, 16, 101, 82, 80, 11, 12, 83, + 84, 93, 16, 72, 88, 89, 90, 76, 92, 4, 80, 93, 26, 82, 28, 99, 11, 12, 13, 33, + 15, 94, 80, 18, 19, 20, 93, 11, 12, 80, 25, 100, 16, 95, 29, 65, 31, 32, 72, 2, + 70, 71, 26, 73, 74, 75, 11, 12, 82, 33, 80, 16, 17, 83, 84, 79, 93, 8, 88, 89, + 90, 95, 92, 4, 59, 60, 68, 80, 80, 99, 11, 12, 13, 106, 15, 106, 106, 18, 19, + 20, 45, 106, 106, 48, 25, 50, 106, 52, 29, 65, 31, 32, 106, 106, 70, 71, 106, + 73, 74, 75, 106, 77, 106, 106, 80, 106, 106, 83, 84, 106, 106, 106, 88, 89, 90, + 106, 92, 106, 59, 60, 65, 106, 106, 106, 106, 70, 71, 106, 73, 74, 75, 11, 12, + 106, 106, 80, 16, 106, 83, 84, 106, 106, 106, 88, 89, 90, 26, 92, 28, 106, 65, + 106, 106, 33, 106, 70, 71, 106, 73, 74, 75, 1, 106, 106, 106, 80, 106, 106, 83, + 84, 10, 106, 106, 88, 89, 90, 106, 92, 65, 106, 106, 106, 106, 70, 71, 106, 73, + 74, 75, 106, 106, 106, 106, 80, 106, 106, 83, 84, 38, 39, 40, 88, 89, 90, 65, + 92, 106, 106, 106, 70, 71, 106, 73, 74, 75, 55, 56, 57, 58, 80, 106, 106, 83, + 84, 106, 106, 106, 88, 89, 90, 106, 92, 106, 106, 65, 106, 106, 106, 106, 70, + 71, 106, 73, 74, 75, 1, 2, 106, 106, 80, 72, 106, 83, 84, 76, 106, 106, 88, 89, + 90, 82, 92, 65, 85, 86, 87, 106, 70, 71, 106, 73, 74, 75, 106, 106, 106, 106, + 80, 100, 106, 83, 84, 38, 39, 40, 88, 89, 90, 65, 92, 106, 106, 106, 70, 71, + 106, 73, 74, 75, 55, 56, 57, 58, 80, 106, 106, 83, 84, 106, 106, 106, 88, 89, + 90, 106, 92, 106, 106, 65, 106, 106, 106, 106, 70, 71, 106, 73, 74, 75, 1, 106, + 106, 106, 80, 72, 106, 83, 84, 76, 106, 106, 88, 89, 90, 82, 92, 65, 85, 86, 87, + 106, 70, 71, 106, 73, 74, 75, 106, 106, 106, 106, 80, 100, 106, 83, 84, 38, 39, + 40, 88, 89, 90, 65, 92, 106, 106, 106, 70, 71, 106, 73, 74, 75, 55, 56, 57, 58, + 80, 60, 106, 83, 84, 106, 106, 106, 88, 89, 90, 106, 92, 106, 106, 65, 106, 106, + 106, 106, 70, 71, 106, 73, 74, 75, 1, 106, 106, 106, 80, 106, 106, 83, 84, 10, 106, 106, 88, 89, 90, 106, 92, 65, 106, 106, 106, 106, 70, 71, 106, 73, 74, 75, - 106, 106, 106, 106, 80, 106, 106, 83, 84, 106, 106, 106, 88, 89, 90, 106, 92, - 65, 106, 106, 106, 106, 70, 71, 106, 73, 74, 75, 106, 106, 106, 106, 80, 106, - 106, 83, 84, 106, 106, 106, 88, 89, 90, 106, 92, 65, 106, 106, 106, 106, 70, 71, - 106, 73, 74, 75, 106, 106, 106, 106, 80, 106, 106, 83, 84, 106, 106, 106, 88, - 89, 90, 106, 92, 65, 106, 106, 106, 106, 70, 71, 106, 73, 74, 75, 106, 106, 106, - 106, 80, 106, 106, 83, 84, 106, 106, 106, 88, 89, 90, 106, 92, 65, 106, 106, - 106, 106, 70, 71, 106, 73, 74, 75, 106, 106, 106, 106, 80, 106, 106, 83, 84, - 106, 106, 106, 88, 89, 90, 106, 92, 65, 106, 106, 106, 106, 70, 71, 106, 73, 74, - 75, 106, 106, 106, 106, 80, 106, 106, 83, 84, 106, 106, 106, 88, 89, 90, 106, - 92, 65, 106, 106, 106, 106, 70, 71, 106, 73, 74, 75, 106, 106, 106, 106, 80, - 106, 106, 83, 84, 106, 106, 106, 88, 89, 90, 106, 92, 65, 106, 106, 106, 106, - 70, 71, 106, 73, 74, 75, 106, 106, 106, 106, 80, 106, 106, 83, 84, 106, 106, - 106, 88, 89, 90, 106, 92, 65, 106, 106, 106, 106, 70, 71, 106, 73, 74, 75, 106, - 106, 106, 106, 80, 106, 106, 83, 84, 106, 106, 106, 88, 89, 90, 106, 92, 65, - 106, 106, 106, 106, 70, 71, 106, 73, 74, 75, 106, 106, 106, 106, 80, 106, 106, - 83, 84, 106, 106, 106, 88, 89, 90, 106, 92, 65, 106, 106, 106, 106, 70, 71, 106, - 73, 74, 75, 106, 106, 106, 106, 80, 106, 106, 83, 84, 106, 106, 106, 88, 89, 90, + 106, 106, 106, 106, 80, 106, 106, 83, 84, 38, 39, 40, 88, 89, 90, 65, 92, 106, + 106, 106, 70, 71, 106, 73, 74, 75, 55, 56, 57, 58, 80, 106, 106, 83, 84, 106, + 106, 106, 88, 89, 90, 106, 92, 106, 106, 65, 106, 106, 106, 106, 70, 71, 106, + 73, 74, 75, 1, 106, 106, 106, 80, 106, 106, 83, 84, 10, 106, 106, 88, 89, 90, 106, 92, 65, 106, 106, 106, 106, 70, 71, 106, 73, 74, 75, 106, 106, 106, 106, - 80, 106, 106, 83, 84, 106, 1, 2, 88, 89, 90, 106, 92, 65, 106, 106, 106, 106, - 70, 71, 106, 73, 74, 75, 106, 106, 106, 106, 80, 106, 106, 83, 84, 1, 106, 106, - 88, 89, 90, 106, 92, 36, 10, 38, 39, 40, 106, 62, 63, 64, 65, 66, 67, 48, 106, - 70, 106, 106, 26, 106, 55, 56, 57, 58, 106, 33, 106, 106, 106, 106, 38, 39, 40, - 1, 106, 106, 65, 106, 106, 106, 106, 70, 71, 1, 73, 106, 75, 55, 56, 57, 58, 80, - 106, 106, 106, 84, 24, 106, 26, 88, 89, 90, 106, 92, 106, 33, 106, 106, 26, 106, - 38, 39, 40, 106, 106, 33, 106, 106, 106, 106, 38, 39, 40, 106, 106, 106, 65, 55, - 56, 57, 58, 70, 71, 1, 73, 106, 75, 55, 56, 57, 58, 80, 10, 106, 106, 84, 106, - 106, 106, 88, 89, 90, 65, 92, 2, 106, 106, 70, 71, 106, 73, 106, 75, 11, 12, - 106, 14, 80, 16, 17, 38, 39, 40, 106, 106, 88, 89, 90, 106, 92, 106, 106, 106, - 106, 106, 106, 65, 55, 56, 57, 58, 70, 71, 106, 73, 106, 75, 45, 106, 106, 48, - 80, 50, 106, 52, 2, 106, 106, 106, 88, 89, 90, 106, 92, 11, 12, 2, 14, 106, 16, - 17, 106, 106, 106, 106, 11, 12, 106, 106, 2, 16, 17, 11, 12, 106, 106, 106, 16, - 11, 12, 106, 106, 106, 16, 17, 106, 106, 26, 45, 28, 106, 48, 106, 50, 33, 52, - 106, 106, 106, 45, 106, 106, 48, 65, 50, 106, 52, 53, 70, 71, 106, 73, 45, 75, - 106, 48, 106, 50, 80, 52, 106, 106, 106, 106, 106, 106, 88, 89, 90, 106, 92, 65, - 1, 2, 106, 106, 70, 71, 106, 73, 106, 75, 106, 71, 106, 106, 80, 75, 106, 106, - 106, 106, 80, 106, 88, 89, 90, 65, 92, 1, 106, 89, 70, 71, 92, 73, 106, 75, 65, - 38, 39, 40, 80, 70, 71, 106, 73, 106, 75, 106, 88, 89, 90, 80, 92, 27, 55, 56, - 57, 58, 1, 88, 89, 90, 1, 92, 38, 39, 40, 1, 106, 106, 106, 10, 106, 106, 106, - 106, 106, 106, 21, 106, 106, 55, 56, 57, 58, 106, 106, 106, 106, 106, 106, 106, - 106, 106, 106, 38, 39, 40, 1, 38, 39, 40, 1, 106, 38, 39, 40, 10, 1, 106, 106, - 10, 55, 56, 57, 58, 55, 56, 57, 58, 106, 55, 56, 57, 58, 106, 60, 106, 106, 106, - 106, 106, 106, 106, 106, 38, 39, 40, 106, 38, 39, 40, 1, 106, 37, 38, 39, 40, - 106, 106, 106, 106, 55, 56, 57, 58, 55, 56, 57, 58, 2, 106, 55, 56, 57, 58, 106, - 106, 106, 11, 12, 106, 106, 106, 16, 17, 1, 106, 37, 38, 39, 40, 1, 106, 106, - 106, 106, 106, 11, 12, 11, 12, 106, 16, 17, 16, 55, 56, 57, 58, 106, 106, 106, - 45, 106, 26, 48, 28, 50, 106, 52, 106, 33, 38, 39, 40, 106, 106, 106, 38, 39, - 40, 45, 106, 106, 48, 106, 50, 53, 52, 55, 56, 57, 58, 106, 106, 55, 56, 57, 58, - 106, 10, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 21, 106, 23, 106, - 106, 26, 106, 106, 106, 106, 106, 106, 33, 106, 35, 106, 37, 106, 106, 106, 106, - 106, 106, 106, 45,); - - const YY_SHIFT_USE_DFLT = - 12; - - const YY_SHIFT_MAX = 238; - - static public $yy_shift_ofst = array(519, 349, 79, 349, 304, 79, 79, 304, 34, - 11, 34, 79, 394, 79, 79, 124, 79, - 169, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 259, 79, 79, 79, 79, 79, 79, 169, - 79, 214, 214, 439, 439, 439, 439, 439, 439, 1617, 1577, 1627, 1627, 1627, 1627, - 1627, 519, 1944, 1978, 2012, 1903, 1938, 1677, 1836, 1934, 1863, 1898, 1894, - 2018, 2018, 2018, 2018, 2018, 2018, 2018, 2018, 2018, 2018, 2018, 2018, 695, - 695, 6, 660, 459, 311, 103, 221, 411, 745, 1766, 2016, 783, 783, 411, 221, 411, - 427, 221, 607, 74, 119, 209, 266, 254, 228, 181, 55, 314, 3, 314, 235, 418, - 418, 584, 250, 528, 378, 297, 54, 518, 54, 539, 2, 2, 2, 2, 2, 2, 2, 2, 2, 252, - 252, - 12, 1697, 1759, 1748, 1995, 1772, 2014, 93, 361, 359, 134, 54, 137, 54, - 137, 54, 54, 54, 54, 54, 54, 54, 54, 80, 54, 54, 137, 137, 54, 54, 54, 54, 54, - 172, 54, 172, 444, 172, 320, 80, 172, 172, 172, 54, 172, 172, 687, 594, 2, 252, - 2, 382, 382, 2, 2, 252, 252, 2, - 12, - 12, - 12, - 12, - 12, 1550, 2068, 617, - 316, 154, 29, 240, 354, 98, 174, 236, 192, 272, 413, 249, 322, 381, 188, 36, - - 9, 598, 554, 424, 533, 525, 441, 498, 505, 473, 458, 450, 421, 559, 610, 594, - 627, 605, 564, 534, 392, 388, 629, 117, 58, 156, 313,); - - const YY_REDUCE_USE_DFLT = - 71; - - const YY_REDUCE_MAX = 192; - - static public $yy_reduce_ofst = array(1530, 426, 482, 656, 545, 515, 623, 571, 1017, 961, 1101, 1325, 933, 793, 849, - 821, 1465, 1157, 1129, 1185, 1073, 989, 1045, 1241, 1381, 1437, 1493, 1409, - 1269, 1297, 1353, 1213, 708, 737, 905, 877, 765, 1606, 1556, 1632, 1808, 1797, - 1771, 1666, 1743, 886, 491, 830, 491, 746, 942, 998, 438, - 70, - 70, - 70, - - 70, - 70, - 70, - 70, - 70, - 70, - 70, - 70, - 70, - 70, - 70, - 70, - 70, - - 70, - 70, - 70, - 70, - 70, - 70, - 70, - 70, - 70, 1777, - 3, 524, 460, - - 36, 511, - 51, 362, 487, 575, 567, 586, 37, 445, 97, 65, 317, 321, 541, 541, - 276, 276, 276, 414, 246, 290, 246, - 8, 201, 290, 344, 422, 340, 276, 461, - 387, 290, 486, 276, 530, 276, 276, 276, 276, 276, 435, 276, 276, 276, 276, - 570, 290, 276, 122, 122, 122, 122, 122, 122, 602, 589, 122, 122, 574, 606, - 574, 603, 574, 574, 574, 574, 574, 574, 574, 574, 581, 574, 574, 597, 596, - 574, 574, 574, 574, 574, 593, 574, 593, 609, 593, 611, 608, 593, 593, 593, - 574, 593, 593, 631, 612, 96, 67, 96, 230, 230, 96, 96, 67, 67, 96, 269, 224, - 588, 508, 501,); - + 80, 106, 106, 83, 84, 38, 39, 40, 88, 89, 90, 65, 92, 106, 106, 106, 70, 71, + 106, 73, 74, 75, 55, 56, 57, 58, 80, 106, 106, 83, 84, 106, 106, 106, 88, 89, + 90, 106, 92, 106, 106, 65, 106, 106, 106, 106, 70, 71, 106, 73, 74, 75, 1, 106, + 106, 106, 80, 106, 106, 83, 84, 10, 106, 106, 88, 89, 90, 106, 92, 65, 106, 106, + 106, 106, 70, 71, 106, 73, 74, 75, 106, 106, 106, 106, 80, 106, 106, 83, 84, 38, + 39, 40, 88, 89, 90, 65, 92, 106, 106, 106, 70, 71, 106, 73, 74, 75, 55, 56, 57, + 58, 80, 106, 106, 83, 84, 106, 106, 106, 88, 89, 90, 106, 92, 106, 106, 65, 106, + 106, 106, 106, 70, 71, 106, 73, 74, 75, 1, 106, 106, 106, 80, 106, 106, 83, 84, + 106, 106, 106, 88, 89, 90, 106, 92, 65, 106, 106, 21, 106, 70, 71, 106, 73, 74, + 75, 106, 106, 106, 106, 80, 106, 106, 83, 84, 38, 39, 40, 88, 89, 90, 65, 92, + 106, 106, 106, 70, 71, 106, 73, 74, 75, 55, 56, 57, 58, 80, 106, 106, 83, 84, + 106, 106, 106, 88, 89, 90, 106, 92, 106, 106, 65, 106, 106, 106, 106, 70, 71, + 106, 73, 74, 75, 1, 106, 106, 106, 80, 72, 106, 83, 84, 76, 106, 106, 88, 89, + 90, 82, 92, 65, 85, 86, 87, 106, 70, 71, 106, 73, 74, 75, 106, 106, 106, 106, + 80, 100, 106, 83, 84, 38, 39, 40, 88, 89, 90, 65, 92, 106, 106, 106, 70, 71, + 106, 73, 74, 75, 55, 56, 57, 58, 80, 106, 106, 83, 84, 106, 106, 106, 88, 89, + 90, 106, 92, 106, 106, 65, 106, 106, 106, 106, 70, 71, 106, 73, 74, 75, 106, + 106, 106, 106, 80, 72, 106, 83, 84, 76, 106, 106, 88, 89, 90, 82, 92, 65, 85, + 86, 87, 106, 70, 71, 106, 73, 74, 75, 106, 106, 106, 106, 80, 100, 106, 83, 84, + 38, 39, 40, 88, 89, 90, 65, 92, 106, 106, 106, 70, 71, 106, 73, 74, 75, 55, 56, + 57, 58, 80, 106, 106, 83, 84, 106, 106, 106, 88, 89, 90, 106, 92, 106, 1, 65, + 106, 106, 106, 106, 70, 71, 1, 73, 74, 75, 106, 1, 2, 106, 80, 106, 106, 83, 84, + 106, 106, 71, 88, 89, 90, 75, 92, 106, 106, 24, 80, 26, 106, 106, 37, 38, 39, + 40, 33, 89, 106, 106, 92, 38, 39, 40, 36, 106, 38, 39, 40, 106, 55, 56, 57, 58, + 106, 106, 48, 106, 55, 56, 57, 58, 106, 55, 56, 57, 58, 106, 106, 65, 106, 106, + 106, 106, 70, 71, 106, 73, 106, 75, 106, 106, 106, 106, 80, 106, 10, 106, 84, + 106, 106, 106, 88, 89, 90, 65, 92, 21, 1, 23, 70, 71, 26, 73, 106, 75, 106, 10, + 106, 33, 80, 35, 106, 37, 84, 106, 106, 2, 88, 89, 90, 45, 92, 26, 106, 106, 11, + 12, 106, 14, 33, 16, 17, 106, 1, 38, 39, 40, 106, 106, 62, 63, 64, 65, 66, 67, + 106, 106, 70, 106, 106, 106, 55, 56, 57, 58, 106, 106, 106, 26, 45, 106, 106, + 48, 106, 50, 33, 52, 106, 65, 106, 38, 39, 40, 70, 71, 106, 73, 106, 75, 106, + 106, 106, 106, 80, 106, 106, 106, 55, 56, 57, 58, 88, 89, 90, 65, 92, 106, 106, + 106, 70, 71, 106, 73, 106, 75, 106, 106, 106, 106, 80, 106, 106, 106, 106, 106, + 106, 106, 88, 89, 90, 65, 92, 106, 106, 106, 70, 71, 106, 73, 106, 75, 65, 106, + 106, 106, 80, 70, 71, 106, 73, 106, 75, 106, 88, 89, 90, 80, 92, 106, 106, 2, + 106, 106, 106, 88, 89, 90, 106, 92, 11, 12, 65, 106, 2, 16, 17, 70, 71, 106, 73, + 106, 75, 11, 12, 106, 14, 80, 16, 17, 1, 106, 106, 106, 106, 88, 89, 90, 106, + 92, 106, 1, 106, 106, 45, 106, 106, 48, 65, 50, 106, 52, 53, 70, 71, 106, 73, + 45, 75, 106, 48, 106, 50, 80, 52, 106, 106, 38, 39, 40, 106, 88, 89, 90, 106, + 92, 106, 37, 38, 39, 40, 106, 53, 106, 55, 56, 57, 58, 106, 106, 2, 106, 106, + 106, 106, 55, 56, 57, 58, 11, 12, 2, 106, 106, 16, 17, 106, 106, 106, 72, 11, + 12, 106, 76, 106, 16, 17, 1, 106, 82, 106, 106, 85, 86, 87, 106, 106, 106, 106, + 106, 106, 106, 106, 45, 106, 106, 48, 100, 50, 106, 52, 106, 106, 27, 45, 106, + 106, 48, 106, 50, 106, 52, 106, 106, 38, 39, 40, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 55, 56, 57, 58,); + static public $yy_shift_ofst = array(519, 349, 79, 79, 394, 349, 394, 79, -11, 34, -11, 214, 79, 79, 79, 79, 79, 79, + 169, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 304, 79, 259, 214, 79, 79, 79, + 124, 124, 439, 439, 439, 439, 439, 439, 1665, 1571, 1701, 1701, 1701, 1701, + 1701, 519, 1934, 1239, 1323, 1155, 1071, 987, 1858, 903, 1847, 819, 1563, 1407, + 1407, 1407, 1407, 1407, 1407, 1407, 1407, 1407, 1407, 1407, 1407, 1491, 1491, + 96, 664, 459, 221, 328, 41, 363, 718, 779, 645, 675, 675, 363, 41, 363, 370, + 41, 574, 164, 74, 29, 271, 131, 273, 176, -4, 49, 224, 224, 55, 464, 236, 153, + 274, 274, 463, 236, 488, 416, 493, 418, 105, 263, 105, 105, 105, 105, 105, 105, + 105, 105, 263, -43, 1830, 1817, 1683, 1906, 1917, 694, 48, 226, 359, 147, 354, + 274, 274, 274, 274, 274, 274, 199, 199, 274, 274, 199, 274, 296, 274, 274, 274, + 182, 199, 296, 274, 199, 274, 274, 274, 274, 307, 199, 199, 274, 307, 199, 296, + 296, 274, 696, 708, 105, 105, 696, 105, 105, 188, 263, 263, 263, 105, -43, -43, + -43, -43, -43, 1576, 1644, 588, 289, 361, 126, 399, 195, 360, 84, 351, 21, -42, + 291, 277, 53, 308, 233, 148, 309, 560, 595, 576, 544, 476, 564, 510, 501, 410, + 636, 424, 524, 530, 561, 499, 504, 571, 604, 188, 606, 616, 598, 593, 626, 609, + 643,); + static public $yy_reduce_ofst = array(1646, 426, 629, 575, 516, 482, 683, 545, 1416, 940, 966, 1024, 1192, 1050, + 1080, 1108, 1134, 1164, 912, 1218, 1360, 1470, 1500, 1444, 1248, 1386, 1332, + 1302, 1276, 996, 882, 828, 772, 856, 714, 744, 798, 1572, 1598, 1765, 1672, + 1724, 1735, 1698, 1801, 1425, 921, 1855, 1425, 1341, 497, 837, 438, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, 1516, 227, 531, 590, 54, 460, + -51, 319, 625, 506, 384, -60, 187, 362, 219, 20, 445, 51, 119, 395, 395, + 323, 119, 322, 119, 110, 495, 546, 323, 110, 119, 532, 551, 486, 477, 110, + 421, 119, 461, 119, 135, 387, 110, 119, 119, 119, 119, 119, 119, 119, 119, + 498, 119, 577, 577, 577, 577, 577, 577, 601, 597, 577, 577, 592, 572, 572, + 572, 572, 572, 572, 586, 586, 572, 572, 586, 572, 589, 572, 572, 572, 635, + 586, 647, 572, 586, 572, 572, 572, 572, 567, 586, 586, 572, 622, 586, 608, + 646, 572, 552, 657, 59, 59, 552, 59, 59, 167, -17, -17, -17, 59, 258, 348, + 340, 212, 339,); static public $yyExpectedTokens = array(array(3, 4, 5, 6, 7, 11, 12, 15, 18, 19, 20, 25, 29, 31, 32,), array(11, 12, 13, 15, 16, 18, 19, 20, 25, 29, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), @@ -755,25 +515,25 @@ class Smarty_Internal_Templateparser 44, 45, 47, 49, 51, 54, 59,), array(11, 12, 13, 15, 16, 18, 19, 20, 25, 29, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 54, 59,), - array(1, 24, 26, 33, 38, 39, 40, 55, 56, 57, 58,), array(1, 10, 26, 33, 38, 39, 40, 55, 56, 57, 58,), + array(1, 24, 26, 33, 38, 39, 40, 55, 56, 57, 58,), array(1, 26, 33, 38, 39, 40, 55, 56, 57, 58,), array(1, 26, 33, 38, 39, 40, 55, 56, 57, 58,), array(1, 26, 33, 38, 39, 40, 55, 56, 57, 58,), array(1, 26, 33, 38, 39, 40, 55, 56, 57, 58,), array(1, 26, 33, 38, 39, 40, 55, 56, 57, 58,), array(3, 4, 5, 6, 7, 11, 12, 15, 18, 19, 20, 25, 29, 31, 32,), - array(1, 37, 38, 39, 40, 55, 56, 57, 58,), - array(1, 37, 38, 39, 40, 55, 56, 57, 58,), - array(1, 38, 39, 40, 53, 55, 56, 57, 58,), - array(1, 38, 39, 40, 55, 56, 57, 58, 60,), - array(1, 10, 38, 39, 40, 55, 56, 57, 58,), - array(1, 10, 38, 39, 40, 55, 56, 57, 58,), - array(1, 2, 38, 39, 40, 55, 56, 57, 58,), - array(1, 10, 38, 39, 40, 55, 56, 57, 58,), array(1, 27, 38, 39, 40, 55, 56, 57, 58,), array(1, 10, 38, 39, 40, 55, 56, 57, 58,), array(1, 21, 38, 39, 40, 55, 56, 57, 58,), + array(1, 10, 38, 39, 40, 55, 56, 57, 58,), + array(1, 10, 38, 39, 40, 55, 56, 57, 58,), + array(1, 38, 39, 40, 55, 56, 57, 58, 60,), + array(1, 37, 38, 39, 40, 55, 56, 57, 58,), + array(1, 2, 38, 39, 40, 55, 56, 57, 58,), + array(1, 38, 39, 40, 53, 55, 56, 57, 58,), + array(1, 10, 38, 39, 40, 55, 56, 57, 58,), + array(1, 37, 38, 39, 40, 55, 56, 57, 58,), array(1, 38, 39, 40, 55, 56, 57, 58,), array(1, 38, 39, 40, 55, 56, 57, 58,), array(1, 38, 39, 40, 55, 56, 57, 58,), @@ -794,15 +554,15 @@ class Smarty_Internal_Templateparser array(11, 12, 16, 26, 28, 33,), array(11, 12, 16, 26, 28, 33,), array(11, 12, 16, 26, 33,), array(11, 12, 16, 26, 33,), array(13, 36, 54,), array(1, 26, 33,), array(13, 36, 54,), array(17, 45, 52,), - array(1, 26, 33,), array(1, 2,), array(10, 22, 26, 33, 46,), - array(10, 22, 26, 33, 46,), array(1, 10, 26, 27, 33,), - array(1, 10, 26, 33,), array(1, 10, 26, 33,), array(12, 13, 16, 54,), - array(11, 12, 16, 50,), array(14, 17, 48,), array(11, 12, 16,), - array(7, 8, 9,), array(11, 12, 16,), array(14, 17, 48,), array(13, 16,), - array(13, 16,), array(13, 54,), array(1, 10,), array(26, 33,), - array(1, 17,), array(17, 48,), array(26, 33,), array(1, 28,), - array(26, 33,), array(1, 53,), array(1,), array(1,), array(1,), array(1,), - array(1,), array(1,), array(1,), array(1,), array(1,), array(17,), + array(1, 26, 33,), array(1, 2,), array(1, 10, 26, 27, 33,), + array(10, 22, 26, 33, 46,), array(10, 22, 26, 33, 46,), + array(11, 12, 16, 50,), array(1, 10, 26, 33,), array(12, 13, 16, 54,), + array(1, 10, 26, 33,), array(14, 17, 48,), array(7, 8, 9,), + array(11, 12, 16,), array(11, 12, 16,), array(14, 17, 48,), array(1, 10,), + array(13, 16,), array(1, 17,), array(26, 33,), array(26, 33,), + array(17, 48,), array(13, 16,), array(1, 53,), array(26, 33,), + array(1, 28,), array(13, 54,), array(1,), array(17,), array(1,), array(1,), + array(1,), array(1,), array(1,), array(1,), array(1,), array(1,), array(17,), array(), array(2, 11, 12, 14, 16, 17, 45, 48, 50, 52,), array(2, 11, 12, 16, 17, 45, 48, 50, 52, 53,), array(2, 11, 12, 14, 16, 17, 45, 48, 50, 52,), @@ -810,28 +570,28 @@ class Smarty_Internal_Templateparser array(2, 11, 12, 16, 17, 45, 48, 50, 52,), array(11, 12, 16, 17, 45, 48, 50, 52,), array(12, 13, 16, 34, 54,), array(11, 12, 16, 50,), array(11, 12, 16,), array(14, 45, 52,), - array(26, 33,), array(13, 54,), array(26, 33,), array(13, 54,), - array(26, 33,), array(26, 33,), array(26, 33,), array(26, 33,), - array(26, 33,), array(26, 33,), array(26, 33,), array(26, 33,), - array(45, 52,), array(26, 33,), array(26, 33,), array(13, 54,), - array(13, 54,), array(26, 33,), array(26, 33,), array(26, 33,), - array(26, 33,), array(26, 33,), array(45, 52,), array(26, 33,), - array(45, 52,), array(12, 36,), array(45, 52,), array(14, 22,), - array(45, 52,), array(45, 52,), array(45, 52,), array(45, 52,), - array(26, 33,), array(45, 52,), array(45, 52,), array(8,), array(36,), - array(1,), array(17,), array(1,), array(2,), array(2,), array(1,), - array(1,), array(17,), array(17,), array(1,), array(), array(), array(), + array(12, 36,), array(26, 33,), array(26, 33,), array(26, 33,), + array(26, 33,), array(26, 33,), array(26, 33,), array(45, 52,), + array(45, 52,), array(26, 33,), array(26, 33,), array(45, 52,), + array(26, 33,), array(13, 54,), array(26, 33,), array(26, 33,), + array(26, 33,), array(14, 22,), array(45, 52,), array(13, 54,), + array(26, 33,), array(45, 52,), array(26, 33,), array(26, 33,), + array(26, 33,), array(26, 33,), array(45, 52,), array(45, 52,), + array(45, 52,), array(26, 33,), array(45, 52,), array(45, 52,), + array(13, 54,), array(13, 54,), array(26, 33,), array(2,), array(8,), + array(1,), array(1,), array(2,), array(1,), array(1,), array(36,), + array(17,), array(17,), array(17,), array(1,), array(), array(), array(), array(), array(), array(1, 2, 36, 38, 39, 40, 48, 55, 56, 57, 58,), array(10, 21, 23, 26, 33, 35, 37, 45,), array(10, 14, 26, 33, 36, 48,), - array(11, 12, 16, 50,), array(36, 45, 48, 53,), array(22, 46, 53,), - array(22, 46, 60,), array(28, 36, 48,), array(36, 48,), array(21, 35,), - array(45, 53,), array(14, 45,), array(35, 37,), array(36, 48,), - array(36, 48,), array(35, 37,), array(35, 37,), array(16, 50,), - array(35, 53,), array(22, 46,), array(34,), array(10,), array(16,), - array(51,), array(16,), array(36,), array(51,), array(16,), array(16,), - array(4,), array(16,), array(53,), array(16,), array(16,), array(36,), - array(13,), array(16,), array(53,), array(45,), array(37,), array(16,), - array(23,), array(34,), array(16,), array(14,), array(41,), array(), + array(36, 45, 48, 53,), array(11, 12, 16, 50,), array(22, 46, 53,), + array(28, 36, 48,), array(22, 46, 60,), array(35, 37,), array(21, 35,), + array(35, 53,), array(16, 50,), array(45, 53,), array(35, 37,), + array(35, 37,), array(36, 48,), array(22, 46,), array(36, 48,), + array(14, 45,), array(36, 48,), array(51,), array(14,), array(16,), + array(23,), array(37,), array(16,), array(53,), array(53,), array(51,), + array(16,), array(16,), array(16,), array(16,), array(16,), array(36,), + array(16,), array(41,), array(13,), array(36,), array(16,), array(10,), + array(34,), array(45,), array(16,), array(34,), array(4,), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), @@ -843,88 +603,31 @@ class Smarty_Internal_Templateparser array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), - array(), array(), array(), array(), array(), array(), array(),); - - static public $yy_default = array(338, 515, 494, 530, 530, 494, 494, 530, 530, 530, 530, 530, 530, 530, 530, 530, - 530, 530, 530, 530, 530, 530, 530, 530, 530, 530, 530, 530, 530, 530, 530, 530, - 530, 530, 530, 530, 530, 530, 530, 530, 530, 530, 530, 530, 530, 396, 530, 396, - 359, 372, 362, 396, 335, 530, 530, 530, 530, 530, 530, 530, 530, 401, 530, 530, - 377, 517, 492, 493, 418, 516, 403, 401, 518, 398, 407, 408, 423, 422, 530, 530, - 434, 410, 530, 396, 530, 530, 396, 396, 396, 396, 530, 396, 530, 506, 396, 386, - 424, 424, 410, 410, 410, 530, 459, 449, 459, 530, 459, 449, 530, 530, 530, 410, - 396, 390, 449, 396, 410, 374, 410, 417, 426, 425, 410, 392, 421, 414, 413, 427, - 503, 449, 501, 448, 448, 448, 448, 448, 448, 530, 461, 459, 475, 382, 530, 381, - 530, 369, 366, 364, 368, 360, 363, 358, 370, 452, 384, 356, 530, 530, 385, 375, - 380, 379, 373, 455, 376, 484, 459, 487, 530, 454, 453, 486, 485, 383, 456, 457, - 350, 459, 443, 481, 387, 495, 496, 416, 391, 507, 504, 393, 500, 500, 500, 459, - 459, 434, 430, 434, 460, 434, 424, 424, 434, 434, 530, 430, 430, 530, 530, 444, - 530, 530, 530, 530, 424, 530, 530, 530, 530, 530, 505, 530, 530, 530, 342, 530, - 439, 530, 530, 475, 530, 530, 530, 430, 530, 530, 404, 432, 530, 530, 436, 439, - 480, 502, 440, 490, 465, 365, 436, 475, 394, 405, 343, 344, 345, 346, 347, 409, - 429, 411, 337, 336, 339, 340, 341, 431, 348, 397, 353, 464, 354, 463, 435, 378, - 351, 349, 489, 352, 433, 462, 419, 477, 415, 446, 478, 479, 438, 388, 519, 511, - 510, 521, 520, 412, 482, 437, 498, 497, 491, 476, 483, 451, 526, 527, 428, 499, - 450, 389, 524, 523, 488, 458, 420, 442, 445, 371, 471, 468, 474, 467, 466, 469, - 472, 470, 522, 509, 529, 528, 525, 508, 473, 513, 447, 514, 395, 512, 441,); - - const YYNOCODE = 107; - - const YYSTACKDEPTH = 500; - - const YYNSTATE = 335; - - const YYNRULE = 195; - - const YYERRORSYMBOL = 61; - - const YYERRSYMDT = 'yy0'; - - const YYFALLBACK = 0; - + array(), array(), array(), array(), array(), array(),); + static public $yy_default = array(338, 515, 494, 494, 530, 530, 530, 494, 530, 530, 530, 530, 530, 530, 530, + 530, 530, 530, 530, 530, 530, 530, 530, 530, 530, 530, 530, 530, 530, 530, + 530, 530, 530, 530, 530, 530, 530, 530, 530, 530, 530, 530, 530, 530, 530, + 530, 396, 372, 359, 396, 362, 396, 335, 401, 530, 530, 530, 530, 530, 530, + 530, 530, 530, 530, 408, 418, 403, 493, 398, 401, 518, 407, 517, 377, 492, + 516, 423, 422, 530, 530, 434, 410, 530, 396, 530, 530, 396, 396, 396, 396, + 530, 396, 530, 506, 396, 386, 410, 424, 424, 459, 410, 530, 410, 449, 530, + 459, 459, 449, 410, 530, 390, 396, 374, 449, 530, 410, 396, 410, 530, 392, + 449, 417, 410, 421, 427, 426, 413, 425, 414, 503, 501, 448, 448, 448, 448, + 448, 448, 530, 461, 459, 475, 459, 366, 381, 370, 369, 376, 368, 487, 457, + 363, 364, 485, 360, 530, 358, 380, 375, 530, 484, 530, 356, 455, 383, 373, + 384, 382, 454, 456, 453, 379, 452, 486, 530, 530, 385, 495, 350, 393, 416, + 496, 387, 443, 459, 481, 507, 504, 391, 500, 500, 500, 459, 459, 434, 430, + 434, 434, 460, 424, 434, 424, 530, 530, 530, 530, 430, 530, 530, 434, 424, + 530, 430, 444, 530, 530, 530, 404, 530, 530, 530, 439, 530, 530, 530, 530, + 530, 530, 505, 530, 436, 530, 475, 530, 530, 530, 430, 530, 432, 342, 378, + 411, 480, 497, 475, 498, 464, 428, 462, 397, 437, 438, 446, 463, 447, 458, + 524, 479, 389, 351, 339, 340, 341, 344, 343, 345, 346, 347, 348, 349, 352, + 405, 353, 354, 394, 409, 365, 371, 395, 477, 478, 499, 502, 412, 465, 514, + 511, 415, 337, 450, 451, 483, 476, 491, 526, 513, 527, 488, 512, 482, 388, + 519, 520, 522, 529, 528, 525, 523, 510, 509, 436, 439, 490, 521, 489, 429, + 431, 474, 468, 433, 467, 435, 466, 508, 440, 469, 441, 471, 419, 420, 442, + 445, 472, 470, 473, 336,); public static $yyFallback = array(); - - public function Trace($TraceFILE, $zTracePrompt) - { - if (!$TraceFILE) { - $zTracePrompt = 0; - } elseif (!$zTracePrompt) { - $TraceFILE = 0; - } - $this->yyTraceFILE = $TraceFILE; - $this->yyTracePrompt = $zTracePrompt; - } - - public function PrintTrace() - { - $this->yyTraceFILE = fopen('php://output', 'w'); - $this->yyTracePrompt = '
'; - } - - public $yyTraceFILE; - - public $yyTracePrompt; - - public $yyidx; /* Index of top element in stack */ - public $yyerrcnt; /* Shifts left before out of the error */ - public $yystack = array(); /* The parser's stack */ - - public $yyTokenName = array('$', 'VERT', 'COLON', 'PHP', 'TEXT', 'STRIPON', 'STRIPOFF', 'LITERALSTART', - 'LITERALEND', 'LITERAL', 'RDEL', 'SIMPELOUTPUT', 'LDEL', 'DOLLARID', 'EQUAL', - 'SIMPLETAG', 'ID', 'PTR', 'LDELMAKENOCACHE', 'LDELIF', 'LDELFOR', 'SEMICOLON', 'INCDEC', - 'TO', 'STEP', 'LDELFOREACH', 'SPACE', 'AS', 'APTR', 'LDELSETFILTER', - 'SMARTYBLOCKCHILDPARENT', 'CLOSETAG', 'LDELSLASH', 'ATTR', 'INTEGER', 'COMMA', 'OPENP', - 'CLOSEP', 'MATH', 'UNIMATH', 'ISIN', 'QMARK', 'NOT', 'TYPECAST', 'HEX', 'DOT', - 'INSTANCEOF', 'SINGLEQUOTESTRING', 'DOUBLECOLON', 'NAMESPACE', 'AT', 'HATCH', 'OPENB', - 'CLOSEB', 'DOLLAR', 'LOGOP', 'SLOGOP', 'TLOGOP', 'SINGLECOND', 'QUOTE', 'BACKTICK', - 'error', 'start', 'template', 'template_element', 'smartytag', 'literal', - 'text_content', 'literal_elements', 'literal_element', 'tag', 'variable', 'attributes', - 'value', 'expr', 'varindexed', 'modifierlist', 'statement', 'statements', 'foraction', - 'varvar', 'modparameters', 'attribute', 'ternary', 'array', 'tlop', 'lop', 'scond', - 'function', 'ns1', 'doublequoted_with_quotes', 'static_class_access', 'object', - 'arrayindex', 'indexdef', 'varvarele', 'objectchain', 'objectelement', 'method', - 'params', 'modifier', 'modparameter', 'arrayelements', 'arrayelement', 'doublequoted', - 'doublequotedcontent',); - public static $yyRuleName = array('start ::= template', 'template ::= template_element', 'template ::= template template_element', 'template ::=', 'template_element ::= smartytag', 'template_element ::= literal', @@ -1029,322 +732,6 @@ class Smarty_Internal_Templateparser 'doublequotedcontent ::= DOLLARID', 'doublequotedcontent ::= LDEL variable RDEL', 'doublequotedcontent ::= LDEL expr RDEL', 'doublequotedcontent ::= smartytag', 'doublequotedcontent ::= TEXT',); - - public function tokenName($tokenType) - { - if ($tokenType === 0) { - return 'End of Input'; - } - if ($tokenType > 0 && $tokenType < count($this->yyTokenName)) { - return $this->yyTokenName[ $tokenType ]; - } else { - return "Unknown"; - } - } - - public static function yy_destructor($yymajor, $yypminor) - { - switch ($yymajor) { - default: - break; /* If no destructor action specified: do nothing */ - } - } - - public function yy_pop_parser_stack() - { - if (empty($this->yystack)) { - return; - } - $yytos = array_pop($this->yystack); - if ($this->yyTraceFILE && $this->yyidx >= 0) { - fwrite($this->yyTraceFILE, $this->yyTracePrompt . 'Popping ' . $this->yyTokenName[ $yytos->major ] . "\n"); - } - $yymajor = $yytos->major; - self::yy_destructor($yymajor, $yytos->minor); - $this->yyidx --; - - return $yymajor; - } - - public function __destruct() - { - while ($this->yystack !== Array()) { - $this->yy_pop_parser_stack(); - } - if (is_resource($this->yyTraceFILE)) { - fclose($this->yyTraceFILE); - } - } - - public function yy_get_expected_tokens($token) - { - static $res3 = array(); - static $res4 = array(); - $state = $this->yystack[ $this->yyidx ]->stateno; - $expected = self::$yyExpectedTokens[ $state ]; - if (isset($res3[ $state ][ $token ])) { - if ($res3[ $state ][ $token ]) { - return $expected; - } - } else { - if ($res3[ $state ][ $token ] = in_array($token, self::$yyExpectedTokens[ $state ], true)) { - return $expected; - } - } - $stack = $this->yystack; - $yyidx = $this->yyidx; - do { - $yyact = $this->yy_find_shift_action($token); - if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) { - // reduce action - $done = 0; - do { - if ($done ++ == 100) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - // too much recursion prevents proper detection - // so give up - return array_unique($expected); - } - $yyruleno = $yyact - self::YYNSTATE; - $this->yyidx -= self::$yyRuleInfo[ $yyruleno ][ 1 ]; - $nextstate = $this->yy_find_reduce_action($this->yystack[ $this->yyidx ]->stateno, - self::$yyRuleInfo[ $yyruleno ][ 0 ]); - if (isset(self::$yyExpectedTokens[ $nextstate ])) { - $expected = array_merge($expected, self::$yyExpectedTokens[ $nextstate ]); - if (isset($res4[ $nextstate ][ $token ])) { - if ($res4[ $nextstate ][ $token ]) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - return array_unique($expected); - } - } else { - if ($res4[ $nextstate ][ $token ] = - in_array($token, self::$yyExpectedTokens[ $nextstate ], true) - ) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - return array_unique($expected); - } - } - } - if ($nextstate < self::YYNSTATE) { - // we need to shift a non-terminal - $this->yyidx ++; - $x = new TP_yyStackEntry; - $x->stateno = $nextstate; - $x->major = self::$yyRuleInfo[ $yyruleno ][ 0 ]; - $this->yystack[ $this->yyidx ] = $x; - continue 2; - } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - // the last token was just ignored, we can't accept - // by ignoring input, this is in essence ignoring a - // syntax error! - return array_unique($expected); - } elseif ($nextstate === self::YY_NO_ACTION) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - // input accepted, but not shifted (I guess) - return $expected; - } else { - $yyact = $nextstate; - } - } - while (true); - } - break; - } - while (true); - $this->yyidx = $yyidx; - $this->yystack = $stack; - - return array_unique($expected); - } - - public function yy_is_expected_token($token) - { - static $res = array(); - static $res2 = array(); - if ($token === 0) { - return true; // 0 is not part of this - } - $state = $this->yystack[ $this->yyidx ]->stateno; - if (isset($res[ $state ][ $token ])) { - if ($res[ $state ][ $token ]) { - return true; - } - } else { - if ($res[ $state ][ $token ] = in_array($token, self::$yyExpectedTokens[ $state ], true)) { - return true; - } - } - $stack = $this->yystack; - $yyidx = $this->yyidx; - do { - $yyact = $this->yy_find_shift_action($token); - if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) { - // reduce action - $done = 0; - do { - if ($done ++ == 100) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - // too much recursion prevents proper detection - // so give up - return true; - } - $yyruleno = $yyact - self::YYNSTATE; - $this->yyidx -= self::$yyRuleInfo[ $yyruleno ][ 1 ]; - $nextstate = $this->yy_find_reduce_action($this->yystack[ $this->yyidx ]->stateno, - self::$yyRuleInfo[ $yyruleno ][ 0 ]); - if (isset($res2[ $nextstate ][ $token ])) { - if ($res2[ $nextstate ][ $token ]) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - return true; - } - } else { - if ($res2[ $nextstate ][ $token ] = (isset(self::$yyExpectedTokens[ $nextstate ]) && - in_array($token, self::$yyExpectedTokens[ $nextstate ], - true)) - ) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - return true; - } - } - if ($nextstate < self::YYNSTATE) { - // we need to shift a non-terminal - $this->yyidx ++; - $x = new TP_yyStackEntry; - $x->stateno = $nextstate; - $x->major = self::$yyRuleInfo[ $yyruleno ][ 0 ]; - $this->yystack[ $this->yyidx ] = $x; - continue 2; - } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - if (!$token) { - // end of input: this is valid - return true; - } - // the last token was just ignored, we can't accept - // by ignoring input, this is in essence ignoring a - // syntax error! - return false; - } elseif ($nextstate === self::YY_NO_ACTION) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - // input accepted, but not shifted (I guess) - return true; - } else { - $yyact = $nextstate; - } - } - while (true); - } - break; - } - while (true); - $this->yyidx = $yyidx; - $this->yystack = $stack; - - return true; - } - - public function yy_find_shift_action($iLookAhead) - { - $stateno = $this->yystack[ $this->yyidx ]->stateno; - - /* if ($this->yyidx < 0) return self::YY_NO_ACTION; */ - if (!isset(self::$yy_shift_ofst[ $stateno ])) { - // no shift actions - return self::$yy_default[ $stateno ]; - } - $i = self::$yy_shift_ofst[ $stateno ]; - if ($i === self::YY_SHIFT_USE_DFLT) { - return self::$yy_default[ $stateno ]; - } - if ($iLookAhead == self::YYNOCODE) { - return self::YY_NO_ACTION; - } - $i += $iLookAhead; - if ($i < 0 || $i >= self::YY_SZ_ACTTAB || self::$yy_lookahead[ $i ] != $iLookAhead) { - if (count(self::$yyFallback) && $iLookAhead < count(self::$yyFallback) && - ($iFallback = self::$yyFallback[ $iLookAhead ]) != 0 - ) { - if ($this->yyTraceFILE) { - fwrite($this->yyTraceFILE, - $this->yyTracePrompt . "FALLBACK " . $this->yyTokenName[ $iLookAhead ] . " => " . - $this->yyTokenName[ $iFallback ] . "\n"); - } - - return $this->yy_find_shift_action($iFallback); - } - - return self::$yy_default[ $stateno ]; - } else { - return self::$yy_action[ $i ]; - } - } - - public function yy_find_reduce_action($stateno, $iLookAhead) - { - /* $stateno = $this->yystack[$this->yyidx]->stateno; */ - - if (!isset(self::$yy_reduce_ofst[ $stateno ])) { - return self::$yy_default[ $stateno ]; - } - $i = self::$yy_reduce_ofst[ $stateno ]; - if ($i == self::YY_REDUCE_USE_DFLT) { - return self::$yy_default[ $stateno ]; - } - if ($iLookAhead == self::YYNOCODE) { - return self::YY_NO_ACTION; - } - $i += $iLookAhead; - if ($i < 0 || $i >= self::YY_SZ_ACTTAB || self::$yy_lookahead[ $i ] != $iLookAhead) { - return self::$yy_default[ $stateno ]; - } else { - return self::$yy_action[ $i ]; - } - } - - public function yy_shift($yyNewState, $yyMajor, $yypMinor) - { - $this->yyidx ++; - if ($this->yyidx >= self::YYSTACKDEPTH) { - $this->yyidx --; - if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, "%sStack Overflow!\n", $this->yyTracePrompt); - } - while ($this->yyidx >= 0) { - $this->yy_pop_parser_stack(); - } - #line 207 "../smarty/lexer/smarty_internal_templateparser.y" - - $this->internalError = true; - $this->compiler->trigger_template_error("Stack overflow in template parser"); - - return; - } - $yytos = new TP_yyStackEntry; - $yytos->stateno = $yyNewState; - $yytos->major = $yyMajor; - $yytos->minor = $yypMinor; - $this->yystack[] = $yytos; - if ($this->yyTraceFILE && $this->yyidx > 0) { - fprintf($this->yyTraceFILE, "%sShift %d\n", $this->yyTracePrompt, $yyNewState); - fprintf($this->yyTraceFILE, "%sStack:", $this->yyTracePrompt); - for ($i = 1; $i <= $this->yyidx; $i ++) { - fprintf($this->yyTraceFILE, " %s", $this->yyTokenName[ $this->yystack[ $i ]->major ]); - } - fwrite($this->yyTraceFILE, "\n"); - } - } - public static $yyRuleInfo = array(array(0 => 62, 1 => 1), array(0 => 63, 1 => 1), array(0 => 63, 1 => 2), array(0 => 63, 1 => 0), array(0 => 64, 1 => 1), array(0 => 64, 1 => 1), array(0 => 64, 1 => 1), array(0 => 64, 1 => 1), array(0 => 67, 1 => 1), @@ -1410,7 +797,6 @@ class Smarty_Internal_Templateparser array(0 => 104, 1 => 2), array(0 => 104, 1 => 1), array(0 => 105, 1 => 3), array(0 => 105, 1 => 3), array(0 => 105, 1 => 1), array(0 => 105, 1 => 3), array(0 => 105, 1 => 3), array(0 => 105, 1 => 1), array(0 => 105, 1 => 1),); - public static $yyReduceMap = array(0 => 0, 1 => 1, 2 => 2, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 16 => 8, 17 => 8, 43 => 8, 66 => 8, 67 => 8, 75 => 8, 76 => 8, 80 => 8, 89 => 8, 94 => 8, 95 => 8, 100 => 8, 104 => 8, 105 => 8, 109 => 8, 111 => 8, 116 => 8, 178 => 8, 183 => 8, @@ -1439,8 +825,360 @@ class Smarty_Internal_Templateparser 179 => 179, 181 => 181, 182 => 182, 185 => 185, 186 => 186, 187 => 187, 188 => 188, 189 => 188, 191 => 188, 190 => 190, 192 => 192, 193 => 193, 194 => 194,); + /** + * result status + * + * @var bool + */ + public $successful = true; + /** + * return value + * + * @var mixed + */ + public $retvalue = 0; + /** + * @var + */ + public $yymajor; + /** + * last index of array variable + * + * @var mixed + */ + public $last_index; + /** + * last variable name + * + * @var string + */ + public $last_variable; + /** + * root parse tree buffer + * + * @var Smarty_Internal_ParseTree + */ + public $root_buffer; + /** + * current parse tree object + * + * @var Smarty_Internal_ParseTree + */ + public $current_buffer; + /** + * lexer object + * + * @var Smarty_Internal_Templatelexer + */ + public $lex; + /** + * {strip} status + * + * @var bool + */ + public $strip = false; + /** + * compiler object + * + * @var Smarty_Internal_TemplateCompilerBase + */ + public $compiler = null; + /** + * smarty object + * + * @var Smarty + */ + public $smarty = null; + /** + * template object + * + * @var Smarty_Internal_Template + */ + public $template = null; + /** + * block nesting level + * + * @var int + */ + public $block_nesting_level = 0; + /** + * security object + * + * @var Smarty_Security + */ + public $security = null; + /** + * template prefix array + * + * @var \Smarty_Internal_ParseTree[] + */ + public $template_prefix = array(); + /** + * security object + * + * @var \Smarty_Internal_ParseTree[] + */ + public $template_postfix = array(); + public $yyTraceFILE; + public $yyTracePrompt; +public $yyidx; +public $yyerrcnt; +public $yystack = array(); + public $yyTokenName = array('$', 'VERT', 'COLON', 'PHP', 'TEXT', 'STRIPON', 'STRIPOFF', 'LITERALSTART', + 'LITERALEND', 'LITERAL', 'RDEL', 'SIMPELOUTPUT', 'LDEL', 'DOLLARID', 'EQUAL', + 'SIMPLETAG', 'ID', 'PTR', 'LDELMAKENOCACHE', 'LDELIF', 'LDELFOR', 'SEMICOLON', 'INCDEC', + 'TO', 'STEP', 'LDELFOREACH', 'SPACE', 'AS', 'APTR', 'LDELSETFILTER', + 'SMARTYBLOCKCHILDPARENT', 'CLOSETAG', 'LDELSLASH', 'ATTR', 'INTEGER', 'COMMA', 'OPENP', + 'CLOSEP', 'MATH', 'UNIMATH', 'ISIN', 'QMARK', 'NOT', 'TYPECAST', 'HEX', 'DOT', + 'INSTANCEOF', 'SINGLEQUOTESTRING', 'DOUBLECOLON', 'NAMESPACE', 'AT', 'HATCH', 'OPENB', + 'CLOSEB', 'DOLLAR', 'LOGOP', 'SLOGOP', 'TLOGOP', 'SINGLECOND', 'QUOTE', 'BACKTICK', + 'error', 'start', 'template', 'template_element', 'smartytag', 'literal', + 'text_content', 'literal_elements', 'literal_element', 'tag', 'variable', 'attributes', + 'value', 'expr', 'varindexed', 'modifierlist', 'statement', 'statements', 'foraction', + 'varvar', 'modparameters', 'attribute', 'ternary', 'array', 'tlop', 'lop', 'scond', + 'function', 'ns1', 'doublequoted_with_quotes', 'static_class_access', 'object', + 'arrayindex', 'indexdef', 'varvarele', 'objectchain', 'objectelement', 'method', + 'params', 'modifier', 'modparameter', 'arrayelements', 'arrayelement', 'doublequoted', + 'doublequotedcontent',); /* Index of top element in stack */ + /** + * internal error flag + * + * @var bool + */ + private $internalError = false; /* Shifts left before out of the error */ + private $_retvalue; /* The parser's stack */ + + /** + * constructor + * + * @param Smarty_Internal_Templatelexer $lex + * @param Smarty_Internal_TemplateCompilerBase $compiler + */ + function __construct(Smarty_Internal_Templatelexer $lex, Smarty_Internal_TemplateCompilerBase $compiler) + { + $this->lex = $lex; + $this->compiler = $compiler; + $this->template = $this->compiler->template; + $this->smarty = $this->template->smarty; + $this->security = isset($this->smarty->security_policy) ? $this->smarty->security_policy : false; + $this->current_buffer = $this->root_buffer = new Smarty_Internal_ParseTree_Template(); + } + + /** + * insert PHP code in current buffer + * + * @param string $code + */ + public function insertPhpCode($code) + { + $this->current_buffer->append_subtree($this, new Smarty_Internal_ParseTree_Tag($this, $code)); + } + + public function Trace($TraceFILE, $zTracePrompt) + { + if (!$TraceFILE) { + $zTracePrompt = 0; + } else if (!$zTracePrompt) { + $TraceFILE = 0; + } + $this->yyTraceFILE = $TraceFILE; + $this->yyTracePrompt = $zTracePrompt; + } + + public function PrintTrace() + { + $this->yyTraceFILE = fopen('php://output', 'w'); + $this->yyTracePrompt = '
'; + } + + public function tokenName($tokenType) + { + if ($tokenType === 0) { + return 'End of Input'; + } + if ($tokenType > 0 && $tokenType < count($this->yyTokenName)) { + return $this->yyTokenName[ $tokenType ]; + } else { + return "Unknown"; + } + } + + public function __destruct() + { + while ($this->yystack !== Array()) { + $this->yy_pop_parser_stack(); + } + if (is_resource($this->yyTraceFILE)) { + fclose($this->yyTraceFILE); + } + } + + public function yy_pop_parser_stack() + { + if (empty($this->yystack)) { + return; + } + $yytos = array_pop($this->yystack); + if ($this->yyTraceFILE && $this->yyidx >= 0) { + fwrite($this->yyTraceFILE, + $this->yyTracePrompt . 'Popping ' . $this->yyTokenName[ $yytos->major ] . "\n"); + } + $yymajor = $yytos->major; + self::yy_destructor($yymajor, $yytos->minor); + $this->yyidx--; + + return $yymajor; + } + + public static function yy_destructor($yymajor, $yypminor) + { + switch ($yymajor) { + default: + break; /* If no destructor action specified: do nothing */ + } + } + + public function yy_get_expected_tokens($token) + { + static $res3 = array(); + static $res4 = array(); + $state = $this->yystack[ $this->yyidx ]->stateno; + $expected = self::$yyExpectedTokens[ $state ]; + if (isset($res3[ $state ][ $token ])) { + if ($res3[ $state ][ $token ]) { + return $expected; + } + } else { + if ($res3[ $state ][ $token ] = in_array($token, self::$yyExpectedTokens[ $state ], true)) { + return $expected; + } + } + $stack = $this->yystack; + $yyidx = $this->yyidx; + do { + $yyact = $this->yy_find_shift_action($token); + if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) { + // reduce action + $done = 0; + do { + if ($done++ == 100) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + // too much recursion prevents proper detection + // so give up + return array_unique($expected); + } + $yyruleno = $yyact - self::YYNSTATE; + $this->yyidx -= self::$yyRuleInfo[ $yyruleno ][1]; + $nextstate = $this->yy_find_reduce_action($this->yystack[ $this->yyidx ]->stateno, + self::$yyRuleInfo[ $yyruleno ][0]); + if (isset(self::$yyExpectedTokens[ $nextstate ])) { + $expected = array_merge($expected, self::$yyExpectedTokens[ $nextstate ]); + if (isset($res4[ $nextstate ][ $token ])) { + if ($res4[ $nextstate ][ $token ]) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + return array_unique($expected); + } + } else { + if ($res4[ $nextstate ][ $token ] = + in_array($token, self::$yyExpectedTokens[ $nextstate ], true)) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + return array_unique($expected); + } + } + } + if ($nextstate < self::YYNSTATE) { + // we need to shift a non-terminal + $this->yyidx++; + $x = new TP_yyStackEntry; + $x->stateno = $nextstate; + $x->major = self::$yyRuleInfo[ $yyruleno ][0]; + $this->yystack[ $this->yyidx ] = $x; + continue 2; + } else if ($nextstate == self::YYNSTATE + self::YYNRULE + 1) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + // the last token was just ignored, we can't accept + // by ignoring input, this is in essence ignoring a + // syntax error! + return array_unique($expected); + } else if ($nextstate === self::YY_NO_ACTION) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + // input accepted, but not shifted (I guess) + return $expected; + } else { + $yyact = $nextstate; + } + } while (true); + } + break; + } while (true); + $this->yyidx = $yyidx; + $this->yystack = $stack; + + return array_unique($expected); + } + + public function yy_find_shift_action($iLookAhead) + { + $stateno = $this->yystack[ $this->yyidx ]->stateno; + + /* if ($this->yyidx < 0) return self::YY_NO_ACTION; */ + if (!isset(self::$yy_shift_ofst[ $stateno ])) { + // no shift actions + return self::$yy_default[ $stateno ]; + } + $i = self::$yy_shift_ofst[ $stateno ]; + if ($i === self::YY_SHIFT_USE_DFLT) { + return self::$yy_default[ $stateno ]; + } + if ($iLookAhead == self::YYNOCODE) { + return self::YY_NO_ACTION; + } + $i += $iLookAhead; + if ($i < 0 || $i >= self::YY_SZ_ACTTAB || self::$yy_lookahead[ $i ] != $iLookAhead) { + if (count(self::$yyFallback) && $iLookAhead < count(self::$yyFallback) && + ($iFallback = self::$yyFallback[ $iLookAhead ]) != 0) { + if ($this->yyTraceFILE) { + fwrite($this->yyTraceFILE, + $this->yyTracePrompt . "FALLBACK " . $this->yyTokenName[ $iLookAhead ] . " => " . + $this->yyTokenName[ $iFallback ] . "\n"); + } + + return $this->yy_find_shift_action($iFallback); + } + + return self::$yy_default[ $stateno ]; + } else { + return self::$yy_action[ $i ]; + } + } + + public function yy_find_reduce_action($stateno, $iLookAhead) + { + /* $stateno = $this->yystack[$this->yyidx]->stateno; */ + + if (!isset(self::$yy_reduce_ofst[ $stateno ])) { + return self::$yy_default[ $stateno ]; + } + $i = self::$yy_reduce_ofst[ $stateno ]; + if ($i == self::YY_REDUCE_USE_DFLT) { + return self::$yy_default[ $stateno ]; + } + if ($iLookAhead == self::YYNOCODE) { + return self::YY_NO_ACTION; + } + $i += $iLookAhead; + if ($i < 0 || $i >= self::YY_SZ_ACTTAB || self::$yy_lookahead[ $i ] != $iLookAhead) { + return self::$yy_default[ $stateno ]; + } else { + return self::$yy_action[ $i ]; + } + } - #line 218 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r0() { $this->root_buffer->prepend_array($this, $this->template_prefix); @@ -1448,7 +1186,6 @@ class Smarty_Internal_Templateparser $this->_retvalue = $this->root_buffer->to_smarty_php($this); } - #line 228 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r1() { if ($this->yystack[ $this->yyidx + 0 ]->minor != null) { @@ -1456,7 +1193,8 @@ class Smarty_Internal_Templateparser } } - #line 235 "../smarty/lexer/smarty_internal_templateparser.y" + #line 218 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r2() { if ($this->yystack[ $this->yyidx + 0 ]->minor != null) { @@ -1465,7 +1203,8 @@ class Smarty_Internal_Templateparser } } - #line 249 "../smarty/lexer/smarty_internal_templateparser.y" + #line 228 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r4() { if ($this->compiler->has_code) { @@ -1477,18 +1216,41 @@ class Smarty_Internal_Templateparser $this->block_nesting_level = count($this->compiler->_tag_stack); } - #line 260 "../smarty/lexer/smarty_internal_templateparser.y" + #line 235 "../smarty/lexer/smarty_internal_templateparser.y" + + /** + * merge PHP code with prefix code and return parse tree tag object + * + * @param string $code + * + * @return Smarty_Internal_ParseTree_Tag + */ + public function mergePrefixCode($code) + { + $tmp = ''; + foreach ($this->compiler->prefix_code as $preCode) { + $tmp .= $preCode; + } + $this->compiler->prefix_code = array(); + $tmp .= $code; + return new Smarty_Internal_ParseTree_Tag($this, $this->compiler->processNocacheCode($tmp, true)); + } + + #line 249 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r5() { $this->_retvalue = new Smarty_Internal_ParseTree_Text($this->yystack[ $this->yyidx + 0 ]->minor); } - #line 264 "../smarty/lexer/smarty_internal_templateparser.y" + #line 260 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r6() { $code = $this->compiler->compileTag('private_php', array(array('code' => $this->yystack[ $this->yyidx + 0 ]->minor), - array('type' => $this->lex->phpType)), array()); + array('type' => $this->lex->phpType)), + array()); if ($this->compiler->has_code && !empty($code)) { $tmp = ''; foreach ($this->compiler->prefix_code as $code) { @@ -1502,136 +1264,155 @@ class Smarty_Internal_Templateparser } } - #line 275 "../smarty/lexer/smarty_internal_templateparser.y" + #line 264 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r7() { $this->_retvalue = $this->compiler->processText($this->yystack[ $this->yyidx + 0 ]->minor); } - #line 279 "../smarty/lexer/smarty_internal_templateparser.y" + #line 275 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r8() { $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 283 "../smarty/lexer/smarty_internal_templateparser.y" + #line 279 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r9() { - $this->_retvalue = $this->yystack[ $this->yyidx + - 1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor; + $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 288 "../smarty/lexer/smarty_internal_templateparser.y" + #line 283 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r10() { $this->strip = true; } - #line 292 "../smarty/lexer/smarty_internal_templateparser.y" + #line 288 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r11() { $this->strip = false; } - #line 297 "../smarty/lexer/smarty_internal_templateparser.y" + #line 292 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r12() { $this->_retvalue = ''; } - #line 301 "../smarty/lexer/smarty_internal_templateparser.y" + #line 297 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r13() { - $this->_retvalue = $this->yystack[ $this->yyidx + - 1 ]->minor; + $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor; + } + + #line 301 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r14() + { + $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor; } #line 305 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r14() + + function yy_r18() { - $this->_retvalue = $this->yystack[ $this->yyidx + - 1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor; + $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor; } #line 321 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r18() - { - $this->_retvalue = $this->yystack[ $this->yyidx + - 1 ]->minor; - } - #line 327 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r19() { $var = - trim(substr($this->yystack[ $this->yyidx + 0 ]->minor, $this->lex->ldel_length, - $this->lex->rdel_length), + trim(substr($this->yystack[ $this->yyidx + 0 ]->minor, $this->lex->ldel_length, -$this->lex->rdel_length), ' $'); if (preg_match('/^(.*)(\s+nocache)$/', $var, $match)) { - $this->_retvalue = $this->compiler->compileTag('private_print_expression', array('nocache'), + $this->_retvalue = $this->compiler->compileTag('private_print_expression', + array('nocache'), array('value' => $this->compiler->compileVariable('\'' . - $match[ 1 ] . + $match[1] . '\''))); } else { - $this->_retvalue = $this->compiler->compileTag('private_print_expression', array(), + $this->_retvalue = $this->compiler->compileTag('private_print_expression', + array(), array('value' => $this->compiler->compileVariable('\'' . $var . '\''))); } } - #line 337 "../smarty/lexer/smarty_internal_templateparser.y" + #line 327 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r20() { - $this->_retvalue = $this->compiler->compileTag('private_print_expression', array(), + $this->_retvalue = $this->compiler->compileTag('private_print_expression', + array(), array('value' => $this->yystack[ $this->yyidx + 0 ]->minor)); } - #line 341 "../smarty/lexer/smarty_internal_templateparser.y" + #line 337 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r21() { - $this->_retvalue = - $this->compiler->compileTag('private_print_expression', $this->yystack[ $this->yyidx + 0 ]->minor, - array('value' => $this->yystack[ $this->yyidx + - 1 ]->minor)); + $this->_retvalue = $this->compiler->compileTag('private_print_expression', + $this->yystack[ $this->yyidx + 0 ]->minor, + array('value' => $this->yystack[ $this->yyidx + -1 ]->minor)); + } + + #line 341 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r26() + { + $this->_retvalue = $this->compiler->compileTag('assign', + array(array('value' => $this->yystack[ $this->yyidx + + 0 ]->minor), + array('var' => '\'' . substr($this->yystack[ $this->yyidx + + -2 ]->minor, + 1) . '\''))); } #line 364 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r26() - { - $this->_retvalue = $this->compiler->compileTag('assign', array(array('value' => $this->yystack[ $this->yyidx + - 0 ]->minor), - array('var' => '\'' . - substr($this->yystack[ $this->yyidx + - - 2 ]->minor, - 1) . '\''))); - } - #line 372 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r28() { $this->_retvalue = $this->compiler->compileTag('assign', array_merge(array(array('value' => $this->yystack[ $this->yyidx + - - 1 ]->minor), + -1 ]->minor), array('var' => '\'' . substr($this->yystack[ $this->yyidx + - - 3 ]->minor, + -3 ]->minor, 1) . '\'')), $this->yystack[ $this->yyidx + 0 ]->minor)); } - #line 376 "../smarty/lexer/smarty_internal_templateparser.y" + #line 372 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r29() { $this->_retvalue = $this->compiler->compileTag('assign', array_merge(array(array('value' => $this->yystack[ $this->yyidx + - - 1 ]->minor), + -1 ]->minor), array('var' => $this->yystack[ $this->yyidx + - - 3 ]->minor[ 'var' ])), + -3 ]->minor['var'])), $this->yystack[ $this->yyidx + 0 ]->minor), array('smarty_internal_index' => $this->yystack[ $this->yyidx + - - 3 ]->minor[ 'smarty_internal_index' ])); + -3 ]->minor['smarty_internal_index'])); } - #line 381 "../smarty/lexer/smarty_internal_templateparser.y" + #line 376 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r30() { $tag = - trim(substr($this->yystack[ $this->yyidx + 0 ]->minor, $this->lex->ldel_length, - $this->lex->rdel_length)); + trim(substr($this->yystack[ $this->yyidx + 0 ]->minor, $this->lex->ldel_length, -$this->lex->rdel_length)); if ($tag == 'strip') { $this->strip = true; $this->_retvalue = null;; @@ -1644,7 +1425,7 @@ class Smarty_Internal_Templateparser $this->compiler->compileTag('private_print_expression', array(), array('value' => $tag)); } else { if (preg_match('/^(.*)(\s+nocache)$/', $tag, $match)) { - $this->_retvalue = $this->compiler->compileTag($match[ 1 ], array("'nocache'")); + $this->_retvalue = $this->compiler->compileTag($match[1], array("'nocache'")); } else { $this->_retvalue = $this->compiler->compileTag($tag, array()); } @@ -1652,208 +1433,239 @@ class Smarty_Internal_Templateparser } } - #line 403 "../smarty/lexer/smarty_internal_templateparser.y" + #line 381 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r31() { - if (defined($this->yystack[ $this->yyidx + - 1 ]->minor)) { + if (defined($this->yystack[ $this->yyidx + -1 ]->minor)) { if ($this->security) { - $this->security->isTrustedConstant($this->yystack[ $this->yyidx + - 1 ]->minor, $this->compiler); + $this->security->isTrustedConstant($this->yystack[ $this->yyidx + -1 ]->minor, $this->compiler); } - $this->_retvalue = - $this->compiler->compileTag('private_print_expression', $this->yystack[ $this->yyidx + 0 ]->minor, - array('value' => $this->yystack[ $this->yyidx + - 1 ]->minor)); + $this->_retvalue = $this->compiler->compileTag('private_print_expression', + $this->yystack[ $this->yyidx + 0 ]->minor, + array('value' => $this->yystack[ $this->yyidx + + -1 ]->minor)); } else { - $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + - 1 ]->minor, + $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + -1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor); } } - #line 413 "../smarty/lexer/smarty_internal_templateparser.y" + #line 403 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r32() { if (defined($this->yystack[ $this->yyidx + 0 ]->minor)) { if ($this->security) { $this->security->isTrustedConstant($this->yystack[ $this->yyidx + 0 ]->minor, $this->compiler); } - $this->_retvalue = $this->compiler->compileTag('private_print_expression', array(), + $this->_retvalue = $this->compiler->compileTag('private_print_expression', + array(), array('value' => $this->yystack[ $this->yyidx + 0 ]->minor)); } else { $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + 0 ]->minor, array()); } } - #line 426 "../smarty/lexer/smarty_internal_templateparser.y" + #line 413 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r33() { - if (defined($this->yystack[ $this->yyidx + - 2 ]->minor)) { + if (defined($this->yystack[ $this->yyidx + -2 ]->minor)) { if ($this->security) { - $this->security->isTrustedConstant($this->yystack[ $this->yyidx + - 2 ]->minor, $this->compiler); + $this->security->isTrustedConstant($this->yystack[ $this->yyidx + -2 ]->minor, $this->compiler); } - $this->_retvalue = - $this->compiler->compileTag('private_print_expression', $this->yystack[ $this->yyidx + 0 ]->minor, - array('value' => $this->yystack[ $this->yyidx + - 2 ]->minor, - 'modifierlist' => $this->yystack[ $this->yyidx + - 1 ]->minor)); + $this->_retvalue = $this->compiler->compileTag('private_print_expression', + $this->yystack[ $this->yyidx + 0 ]->minor, + array('value' => $this->yystack[ $this->yyidx + -2 ]->minor, + 'modifierlist' => $this->yystack[ $this->yyidx + + -1 ]->minor)); } else { - $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + - 2 ]->minor, + $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + -2 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor, array('modifierlist' => $this->yystack[ $this->yyidx + - - 1 ]->minor)); + -1 ]->minor)); } } - #line 438 "../smarty/lexer/smarty_internal_templateparser.y" + #line 426 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r34() { - $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + - 3 ]->minor, + $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + -3 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor, array('object_method' => $this->yystack[ $this->yyidx + - - 1 ]->minor)); + -1 ]->minor)); + } + + #line 438 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r35() + { + $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + -4 ]->minor, + $this->yystack[ $this->yyidx + 0 ]->minor, + array('modifierlist' => $this->yystack[ $this->yyidx + + -1 ]->minor, + 'object_method' => $this->yystack[ $this->yyidx + + -2 ]->minor)); } #line 443 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r35() + + function yy_r36() { - $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + - 4 ]->minor, - $this->yystack[ $this->yyidx + 0 ]->minor, - array('modifierlist' => $this->yystack[ $this->yyidx + - - 1 ]->minor, - 'object_method' => $this->yystack[ $this->yyidx + - - 2 ]->minor)); + $this->_retvalue = $this->compiler->compileTag('make_nocache', + array(array('var' => '\'' . substr($this->yystack[ $this->yyidx + + 0 ]->minor, + 1) . '\''))); } #line 448 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r36() + + function yy_r37() { - $this->_retvalue = $this->compiler->compileTag('make_nocache', array(array('var' => '\'' . - substr($this->yystack[ $this->yyidx + - 0 ]->minor, - 1) . '\''))); + $tag = trim(substr($this->yystack[ $this->yyidx + -1 ]->minor, $this->lex->ldel_length)); + $this->_retvalue = $this->compiler->compileTag(($tag == 'else if') ? 'elseif' : $tag, + array(), + array('if condition' => $this->yystack[ $this->yyidx + + 0 ]->minor)); } #line 453 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r37() - { - $tag = trim(substr($this->yystack[ $this->yyidx + - 1 ]->minor, $this->lex->ldel_length)); - $this->_retvalue = $this->compiler->compileTag(($tag == 'else if') ? 'elseif' : $tag, array(), - array('if condition' => $this->yystack[ $this->yyidx + - 0 ]->minor)); - } - #line 458 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r38() { - $tag = trim(substr($this->yystack[ $this->yyidx + - 2 ]->minor, $this->lex->ldel_length)); + $tag = trim(substr($this->yystack[ $this->yyidx + -2 ]->minor, $this->lex->ldel_length)); $this->_retvalue = $this->compiler->compileTag(($tag == 'else if') ? 'elseif' : $tag, $this->yystack[ $this->yyidx + 0 ]->minor, array('if condition' => $this->yystack[ $this->yyidx + - - 1 ]->minor)); + -1 ]->minor)); } - #line 463 "../smarty/lexer/smarty_internal_templateparser.y" + #line 458 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r39() { - $tag = trim(substr($this->yystack[ $this->yyidx + - 1 ]->minor, $this->lex->ldel_length)); - $this->_retvalue = $this->compiler->compileTag(($tag == 'else if') ? 'elseif' : $tag, array(), + $tag = trim(substr($this->yystack[ $this->yyidx + -1 ]->minor, $this->lex->ldel_length)); + $this->_retvalue = $this->compiler->compileTag(($tag == 'else if') ? 'elseif' : $tag, + array(), array('if condition' => $this->yystack[ $this->yyidx + 0 ]->minor)); } - #line 474 "../smarty/lexer/smarty_internal_templateparser.y" + #line 463 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r41() { - $this->_retvalue = $this->compiler->compileTag('for', array_merge($this->yystack[ $this->yyidx + 0 ]->minor, - array(array('start' => $this->yystack[ $this->yyidx + - - 6 ]->minor), - array('ifexp' => $this->yystack[ $this->yyidx + - - 4 ]->minor), - array('var' => $this->yystack[ $this->yyidx + - - 2 ]->minor), - array('step' => $this->yystack[ $this->yyidx + - - 1 ]->minor))), + $this->_retvalue = $this->compiler->compileTag('for', + array_merge($this->yystack[ $this->yyidx + 0 ]->minor, + array(array('start' => $this->yystack[ $this->yyidx + + -6 ]->minor), + array('ifexp' => $this->yystack[ $this->yyidx + + -4 ]->minor), + array('var' => $this->yystack[ $this->yyidx + + -2 ]->minor), + array('step' => $this->yystack[ $this->yyidx + + -1 ]->minor))), 1); } - #line 478 "../smarty/lexer/smarty_internal_templateparser.y" + #line 474 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r42() { $this->_retvalue = '=' . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 486 "../smarty/lexer/smarty_internal_templateparser.y" + #line 478 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r44() { - $this->_retvalue = $this->compiler->compileTag('for', array_merge($this->yystack[ $this->yyidx + 0 ]->minor, - array(array('start' => $this->yystack[ $this->yyidx + - - 3 ]->minor), - array('to' => $this->yystack[ $this->yyidx + - - 1 ]->minor))), + $this->_retvalue = $this->compiler->compileTag('for', + array_merge($this->yystack[ $this->yyidx + 0 ]->minor, + array(array('start' => $this->yystack[ $this->yyidx + + -3 ]->minor), + array('to' => $this->yystack[ $this->yyidx + + -1 ]->minor))), + 0); + } + + #line 486 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r45() + { + $this->_retvalue = $this->compiler->compileTag('for', + array_merge($this->yystack[ $this->yyidx + 0 ]->minor, + array(array('start' => $this->yystack[ $this->yyidx + + -5 ]->minor), + array('to' => $this->yystack[ $this->yyidx + + -3 ]->minor), + array('step' => $this->yystack[ $this->yyidx + + -1 ]->minor))), 0); } #line 490 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r45() - { - $this->_retvalue = $this->compiler->compileTag('for', array_merge($this->yystack[ $this->yyidx + 0 ]->minor, - array(array('start' => $this->yystack[ $this->yyidx + - - 5 ]->minor), - array('to' => $this->yystack[ $this->yyidx + - - 3 ]->minor), - array('step' => $this->yystack[ $this->yyidx + - - 1 ]->minor))), - 0); - } - #line 495 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r46() { $this->_retvalue = $this->compiler->compileTag('foreach', $this->yystack[ $this->yyidx + 0 ]->minor); } - #line 500 "../smarty/lexer/smarty_internal_templateparser.y" + #line 495 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r47() { - $this->_retvalue = $this->compiler->compileTag('foreach', array_merge($this->yystack[ $this->yyidx + 0 ]->minor, - array(array('from' => $this->yystack[ $this->yyidx + - - 3 ]->minor), - array('item' => $this->yystack[ $this->yyidx + - - 1 ]->minor)))); + $this->_retvalue = $this->compiler->compileTag('foreach', + array_merge($this->yystack[ $this->yyidx + 0 ]->minor, + array(array('from' => $this->yystack[ $this->yyidx + + -3 ]->minor), + array('item' => $this->yystack[ $this->yyidx + + -1 ]->minor)))); + } + + #line 500 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r48() + { + $this->_retvalue = $this->compiler->compileTag('foreach', + array_merge($this->yystack[ $this->yyidx + 0 ]->minor, + array(array('from' => $this->yystack[ $this->yyidx + + -5 ]->minor), + array('item' => $this->yystack[ $this->yyidx + + -1 ]->minor), + array('key' => $this->yystack[ $this->yyidx + + -3 ]->minor)))); } #line 504 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r48() - { - $this->_retvalue = $this->compiler->compileTag('foreach', array_merge($this->yystack[ $this->yyidx + 0 ]->minor, - array(array('from' => $this->yystack[ $this->yyidx + - - 5 ]->minor), - array('item' => $this->yystack[ $this->yyidx + - - 1 ]->minor), - array('key' => $this->yystack[ $this->yyidx + - - 3 ]->minor)))); - } - #line 517 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r51() { - $this->_retvalue = $this->compiler->compileTag('setfilter', array(), + $this->_retvalue = $this->compiler->compileTag('setfilter', + array(), array('modifier_list' => array(array_merge(array($this->yystack[ $this->yyidx + - - 1 ]->minor), + -1 ]->minor), $this->yystack[ $this->yyidx + 0 ]->minor)))); } - #line 521 "../smarty/lexer/smarty_internal_templateparser.y" + #line 517 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r52() { - $this->_retvalue = $this->compiler->compileTag('setfilter', array(), + $this->_retvalue = $this->compiler->compileTag('setfilter', + array(), array('modifier_list' => array_merge(array(array_merge(array($this->yystack[ $this->yyidx + - - 2 ]->minor), + -2 ]->minor), $this->yystack[ $this->yyidx + - - 1 ]->minor)), + -1 ]->minor)), $this->yystack[ $this->yyidx + 0 ]->minor))); } - #line 526 "../smarty/lexer/smarty_internal_templateparser.y" + #line 521 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r53() { $j = strrpos($this->yystack[ $this->yyidx + 0 ]->minor, '.'); @@ -1866,11 +1678,12 @@ class Smarty_Internal_Templateparser } } - #line 539 "../smarty/lexer/smarty_internal_templateparser.y" + #line 526 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r54() { $tag = - trim(substr($this->yystack[ $this->yyidx + 0 ]->minor, $this->lex->ldel_length, - $this->lex->rdel_length), + trim(substr($this->yystack[ $this->yyidx + 0 ]->minor, $this->lex->ldel_length, -$this->lex->rdel_length), ' /'); if ($tag == 'strip') { $this->strip = false; @@ -1880,58 +1693,69 @@ class Smarty_Internal_Templateparser } } - #line 548 "../smarty/lexer/smarty_internal_templateparser.y" + #line 539 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r55() { $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + 0 ]->minor . 'close', array()); } - #line 552 "../smarty/lexer/smarty_internal_templateparser.y" + #line 548 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r56() { - $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + - 1 ]->minor . 'close', array(), + $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + -1 ]->minor . 'close', + array(), array('modifier_list' => $this->yystack[ $this->yyidx + 0 ]->minor)); } - #line 557 "../smarty/lexer/smarty_internal_templateparser.y" + #line 552 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r57() { - $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + - 2 ]->minor . 'close', array(), + $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + -2 ]->minor . 'close', + array(), array('object_method' => $this->yystack[ $this->yyidx + 0 ]->minor)); } - #line 561 "../smarty/lexer/smarty_internal_templateparser.y" + #line 557 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r58() { - $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + - 3 ]->minor . 'close', array(), + $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + -3 ]->minor . 'close', + array(), array('object_method' => $this->yystack[ $this->yyidx + - - 1 ]->minor, + -1 ]->minor, 'modifier_list' => $this->yystack[ $this->yyidx + 0 ]->minor)); } - #line 569 "../smarty/lexer/smarty_internal_templateparser.y" + #line 561 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r59() { - $this->_retvalue = $this->yystack[ $this->yyidx + - 1 ]->minor; + $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor; $this->_retvalue[] = $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 575 "../smarty/lexer/smarty_internal_templateparser.y" + #line 569 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r60() { $this->_retvalue = array($this->yystack[ $this->yyidx + 0 ]->minor); } - #line 580 "../smarty/lexer/smarty_internal_templateparser.y" + #line 575 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r61() { $this->_retvalue = array(); } - #line 585 "../smarty/lexer/smarty_internal_templateparser.y" + #line 580 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r62() { if (defined($this->yystack[ $this->yyidx + 0 ]->minor)) { @@ -1939,162 +1763,183 @@ class Smarty_Internal_Templateparser $this->security->isTrustedConstant($this->yystack[ $this->yyidx + 0 ]->minor, $this->compiler); } $this->_retvalue = - array($this->yystack[ $this->yyidx + - 2 ]->minor => $this->yystack[ $this->yyidx + 0 ]->minor); + array($this->yystack[ $this->yyidx + -2 ]->minor => $this->yystack[ $this->yyidx + 0 ]->minor); } else { $this->_retvalue = - array($this->yystack[ $this->yyidx + - 2 ]->minor => '\'' . $this->yystack[ $this->yyidx + 0 ]->minor . - '\''); + array($this->yystack[ $this->yyidx + -2 ]->minor => '\'' . $this->yystack[ $this->yyidx + 0 ]->minor . + '\''); } } - #line 596 "../smarty/lexer/smarty_internal_templateparser.y" + #line 585 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r63() { $this->_retvalue = - array(trim($this->yystack[ $this->yyidx + - 1 ]->minor, " =\n\r\t") => $this->yystack[ $this->yyidx + - 0 ]->minor); + array(trim($this->yystack[ $this->yyidx + -1 ]->minor, " =\n\r\t") => $this->yystack[ $this->yyidx + + 0 ]->minor); } - #line 604 "../smarty/lexer/smarty_internal_templateparser.y" + #line 596 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r65() { $this->_retvalue = '\'' . $this->yystack[ $this->yyidx + 0 ]->minor . '\''; } - #line 616 "../smarty/lexer/smarty_internal_templateparser.y" + #line 604 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r68() { $this->_retvalue = - array($this->yystack[ $this->yyidx + - 2 ]->minor => $this->yystack[ $this->yyidx + 0 ]->minor); + array($this->yystack[ $this->yyidx + -2 ]->minor => $this->yystack[ $this->yyidx + 0 ]->minor); + } + + #line 616 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r70() + { + $this->yystack[ $this->yyidx + -2 ]->minor[] = $this->yystack[ $this->yyidx + 0 ]->minor; + $this->_retvalue = $this->yystack[ $this->yyidx + -2 ]->minor; } #line 629 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r70() + + function yy_r71() { - $this->yystack[ $this->yyidx + - 2 ]->minor[] = $this->yystack[ $this->yyidx + 0 ]->minor; - $this->_retvalue = $this->yystack[ $this->yyidx + - 2 ]->minor; + $this->_retvalue = array('var' => '\'' . substr($this->yystack[ $this->yyidx + -2 ]->minor, 1) . '\'', + 'value' => $this->yystack[ $this->yyidx + 0 ]->minor); } #line 634 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r71() + + function yy_r73() { - $this->_retvalue = array('var' => '\'' . substr($this->yystack[ $this->yyidx + - 2 ]->minor, 1) . '\'', + $this->_retvalue = array('var' => $this->yystack[ $this->yyidx + -2 ]->minor, 'value' => $this->yystack[ $this->yyidx + 0 ]->minor); } #line 641 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r73() - { - $this->_retvalue = array('var' => $this->yystack[ $this->yyidx + - 2 ]->minor, - 'value' => $this->yystack[ $this->yyidx + 0 ]->minor); - } - #line 665 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r77() { $this->_retvalue = - '$_smarty_tpl->getStreamVariable(\'' . substr($this->yystack[ $this->yyidx + - 2 ]->minor, 1) . '://' . + '$_smarty_tpl->getStreamVariable(\'' . substr($this->yystack[ $this->yyidx + -2 ]->minor, 1) . '://' . $this->yystack[ $this->yyidx + 0 ]->minor . '\')'; } - #line 670 "../smarty/lexer/smarty_internal_templateparser.y" + #line 665 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r78() { $this->_retvalue = - $this->yystack[ $this->yyidx + - 2 ]->minor . trim($this->yystack[ $this->yyidx + - 1 ]->minor) . + $this->yystack[ $this->yyidx + -2 ]->minor . trim($this->yystack[ $this->yyidx + -1 ]->minor) . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 684 "../smarty/lexer/smarty_internal_templateparser.y" + #line 670 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r81() { - $this->_retvalue = $this->compiler->compileTag('private_modifier', array(), - array('value' => $this->yystack[ $this->yyidx + - 1 ]->minor, + $this->_retvalue = $this->compiler->compileTag('private_modifier', + array(), + array('value' => $this->yystack[ $this->yyidx + -1 ]->minor, 'modifierlist' => $this->yystack[ $this->yyidx + 0 ]->minor)); } - #line 690 "../smarty/lexer/smarty_internal_templateparser.y" + #line 684 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r82() { $this->_retvalue = - $this->yystack[ $this->yyidx + - 1 ]->minor[ 'pre' ] . $this->yystack[ $this->yyidx + - 2 ]->minor . - $this->yystack[ $this->yyidx + - 1 ]->minor[ 'op' ] . $this->yystack[ $this->yyidx + 0 ]->minor . ')'; + $this->yystack[ $this->yyidx + -1 ]->minor['pre'] . $this->yystack[ $this->yyidx + -2 ]->minor . + $this->yystack[ $this->yyidx + -1 ]->minor['op'] . $this->yystack[ $this->yyidx + 0 ]->minor . ')'; } - #line 694 "../smarty/lexer/smarty_internal_templateparser.y" + #line 690 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r83() { - $this->_retvalue = $this->yystack[ $this->yyidx + - 2 ]->minor . $this->yystack[ $this->yyidx + - 1 ]->minor . + $this->_retvalue = $this->yystack[ $this->yyidx + -2 ]->minor . $this->yystack[ $this->yyidx + -1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 698 "../smarty/lexer/smarty_internal_templateparser.y" + #line 694 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r84() + { + $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor . $this->yystack[ $this->yyidx + -1 ]->minor . ')'; + } + + #line 698 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r85() { $this->_retvalue = - $this->yystack[ $this->yyidx + 0 ]->minor . $this->yystack[ $this->yyidx + - 1 ]->minor . ')'; + 'in_array(' . $this->yystack[ $this->yyidx + -2 ]->minor . ',' . $this->yystack[ $this->yyidx + 0 ]->minor . + ')'; } #line 702 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r85() + + function yy_r86() { - $this->_retvalue = 'in_array(' . $this->yystack[ $this->yyidx + - 2 ]->minor . ',' . + $this->_retvalue = 'in_array(' . $this->yystack[ $this->yyidx + -2 ]->minor . ',(array)' . $this->yystack[ $this->yyidx + 0 ]->minor . ')'; } #line 706 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r86() - { - $this->_retvalue = 'in_array(' . $this->yystack[ $this->yyidx + - 2 ]->minor . ',(array)' . - $this->yystack[ $this->yyidx + 0 ]->minor . ')'; - } - #line 714 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r87() { - $this->_retvalue = $this->yystack[ $this->yyidx + - 5 ]->minor . ' ? ' . $this->compiler->compileVariable('\'' . - substr($this->yystack[ $this->yyidx + - - 2 ]->minor, - 1) . - '\'') . + $this->_retvalue = $this->yystack[ $this->yyidx + -5 ]->minor . ' ? ' . $this->compiler->compileVariable('\'' . + substr($this->yystack[ $this->yyidx + + -2 ]->minor, + 1) . + '\'') . ' : ' . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 718 "../smarty/lexer/smarty_internal_templateparser.y" + #line 714 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r88() { $this->_retvalue = - $this->yystack[ $this->yyidx + - 5 ]->minor . ' ? ' . $this->yystack[ $this->yyidx + - 2 ]->minor . ' : ' . + $this->yystack[ $this->yyidx + -5 ]->minor . ' ? ' . $this->yystack[ $this->yyidx + -2 ]->minor . ' : ' . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 733 "../smarty/lexer/smarty_internal_templateparser.y" + #line 718 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r91() { $this->_retvalue = '!' . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 754 "../smarty/lexer/smarty_internal_templateparser.y" + #line 733 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r96() { - $this->_retvalue = - $this->yystack[ $this->yyidx + - 2 ]->minor . '.' . $this->yystack[ $this->yyidx + 0 ]->minor; + $this->_retvalue = $this->yystack[ $this->yyidx + -2 ]->minor . '.' . $this->yystack[ $this->yyidx + 0 ]->minor; + } + + #line 754 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r97() + { + $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor . '.'; } #line 758 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r97() - { - $this->_retvalue = $this->yystack[ $this->yyidx + - 1 ]->minor . '.'; - } - #line 762 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r98() { $this->_retvalue = '.' . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 767 "../smarty/lexer/smarty_internal_templateparser.y" + #line 762 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r99() { if (defined($this->yystack[ $this->yyidx + 0 ]->minor)) { @@ -2107,41 +1952,46 @@ class Smarty_Internal_Templateparser } } - #line 784 "../smarty/lexer/smarty_internal_templateparser.y" + #line 767 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r101() { - $this->_retvalue = "(" . $this->yystack[ $this->yyidx + - 1 ]->minor . ")"; + $this->_retvalue = "(" . $this->yystack[ $this->yyidx + -1 ]->minor . ")"; } - #line 788 "../smarty/lexer/smarty_internal_templateparser.y" + #line 784 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r102() { - $this->_retvalue = $this->yystack[ $this->yyidx + - 2 ]->minor . $this->yystack[ $this->yyidx + - 1 ]->minor . + $this->_retvalue = $this->yystack[ $this->yyidx + -2 ]->minor . $this->yystack[ $this->yyidx + -1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 806 "../smarty/lexer/smarty_internal_templateparser.y" + #line 788 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r106() { $prefixVar = $this->compiler->getNewPrefixVariable(); - if ($this->yystack[ $this->yyidx + - 2 ]->minor[ 'var' ] == '\'smarty\'') { + if ($this->yystack[ $this->yyidx + -2 ]->minor['var'] == '\'smarty\'') { $this->compiler->appendPrefixCode("compiler->compileTag('private_special_variable', array(), + $this->compiler->compileTag('private_special_variable', + array(), $this->yystack[ $this->yyidx + - - 2 ]->minor[ 'smarty_internal_index' ]) . + -2 ]->minor['smarty_internal_index']) . ';?>'); } else { $this->compiler->appendPrefixCode("compiler->compileVariable($this->yystack[ $this->yyidx + - - 2 ]->minor[ 'var' ]) . - $this->yystack[ $this->yyidx + - 2 ]->minor[ 'smarty_internal_index' ] . + -2 ]->minor['var']) . + $this->yystack[ $this->yyidx + -2 ]->minor['smarty_internal_index'] . ';?>'); } - $this->_retvalue = $prefixVar . '::' . $this->yystack[ $this->yyidx + 0 ]->minor[ 0 ] . - $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ]; + $this->_retvalue = $prefixVar . '::' . $this->yystack[ $this->yyidx + 0 ]->minor[0] . + $this->yystack[ $this->yyidx + 0 ]->minor[1]; } - #line 817 "../smarty/lexer/smarty_internal_templateparser.y" + #line 806 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r107() { $prefixVar = $this->compiler->getNewPrefixVariable(); @@ -2150,117 +2000,130 @@ class Smarty_Internal_Templateparser $this->_retvalue = $prefixVar; } - #line 834 "../smarty/lexer/smarty_internal_templateparser.y" + #line 817 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r110() { - if (!in_array(strtolower($this->yystack[ $this->yyidx + - 2 ]->minor), array('self', 'parent')) && - (!$this->security || - $this->security->isTrustedStaticClassAccess($this->yystack[ $this->yyidx + - 2 ]->minor, - $this->yystack[ $this->yyidx + 0 ]->minor, $this->compiler)) - ) { - if (isset($this->smarty->registered_classes[ $this->yystack[ $this->yyidx + - 2 ]->minor ])) { + if (!in_array(strtolower($this->yystack[ $this->yyidx + -2 ]->minor), array('self', 'parent')) && + (!$this->security || $this->security->isTrustedStaticClassAccess($this->yystack[ $this->yyidx + -2 ]->minor, + $this->yystack[ $this->yyidx + 0 ]->minor, + $this->compiler))) { + if (isset($this->smarty->registered_classes[ $this->yystack[ $this->yyidx + -2 ]->minor ])) { $this->_retvalue = - $this->smarty->registered_classes[ $this->yystack[ $this->yyidx + - 2 ]->minor ] . '::' . - $this->yystack[ $this->yyidx + 0 ]->minor[ 0 ] . $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ]; + $this->smarty->registered_classes[ $this->yystack[ $this->yyidx + -2 ]->minor ] . '::' . + $this->yystack[ $this->yyidx + 0 ]->minor[0] . $this->yystack[ $this->yyidx + 0 ]->minor[1]; } else { - $this->_retvalue = $this->yystack[ $this->yyidx + - 2 ]->minor . '::' . - $this->yystack[ $this->yyidx + 0 ]->minor[ 0 ] . - $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ]; + $this->_retvalue = + $this->yystack[ $this->yyidx + -2 ]->minor . '::' . $this->yystack[ $this->yyidx + 0 ]->minor[0] . + $this->yystack[ $this->yyidx + 0 ]->minor[1]; } } else { - $this->compiler->trigger_template_error("static class '" . $this->yystack[ $this->yyidx + - 2 ]->minor . + $this->compiler->trigger_template_error("static class '" . $this->yystack[ $this->yyidx + -2 ]->minor . "' is undefined or not allowed by security setting"); } } - #line 853 "../smarty/lexer/smarty_internal_templateparser.y" + #line 834 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r112() { $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 864 "../smarty/lexer/smarty_internal_templateparser.y" + #line 853 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r113() { $this->_retvalue = $this->compiler->compileVariable('\'' . substr($this->yystack[ $this->yyidx + 0 ]->minor, 1) . '\''); } - #line 867 "../smarty/lexer/smarty_internal_templateparser.y" + #line 864 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r114() { - if ($this->yystack[ $this->yyidx + 0 ]->minor[ 'var' ] == '\'smarty\'') { - $smarty_var = $this->compiler->compileTag('private_special_variable', array(), + if ($this->yystack[ $this->yyidx + 0 ]->minor['var'] == '\'smarty\'') { + $smarty_var = $this->compiler->compileTag('private_special_variable', + array(), $this->yystack[ $this->yyidx + - 0 ]->minor[ 'smarty_internal_index' ]); + 0 ]->minor['smarty_internal_index']); $this->_retvalue = $smarty_var; } else { // used for array reset,next,prev,end,current - $this->last_variable = $this->yystack[ $this->yyidx + 0 ]->minor[ 'var' ]; - $this->last_index = $this->yystack[ $this->yyidx + 0 ]->minor[ 'smarty_internal_index' ]; - $this->_retvalue = $this->compiler->compileVariable($this->yystack[ $this->yyidx + 0 ]->minor[ 'var' ]) . - $this->yystack[ $this->yyidx + 0 ]->minor[ 'smarty_internal_index' ]; + $this->last_variable = $this->yystack[ $this->yyidx + 0 ]->minor['var']; + $this->last_index = $this->yystack[ $this->yyidx + 0 ]->minor['smarty_internal_index']; + $this->_retvalue = $this->compiler->compileVariable($this->yystack[ $this->yyidx + 0 ]->minor['var']) . + $this->yystack[ $this->yyidx + 0 ]->minor['smarty_internal_index']; } } - #line 880 "../smarty/lexer/smarty_internal_templateparser.y" + #line 867 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r115() { - $this->_retvalue = '$_smarty_tpl->tpl_vars[' . $this->yystack[ $this->yyidx + - 2 ]->minor . ']->' . + $this->_retvalue = '$_smarty_tpl->tpl_vars[' . $this->yystack[ $this->yyidx + -2 ]->minor . ']->' . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 890 "../smarty/lexer/smarty_internal_templateparser.y" + #line 880 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r117() { $this->_retvalue = - $this->compiler->compileConfigVariable("'" . $this->yystack[ $this->yyidx + - 1 ]->minor . "'"); + $this->compiler->compileConfigVariable("'" . $this->yystack[ $this->yyidx + -1 ]->minor . "'"); } - #line 894 "../smarty/lexer/smarty_internal_templateparser.y" + #line 890 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r118() { $this->_retvalue = '(is_array($tmp = ' . - $this->compiler->compileConfigVariable("'" . $this->yystack[ $this->yyidx + - 2 ]->minor . + $this->compiler->compileConfigVariable("'" . $this->yystack[ $this->yyidx + -2 ]->minor . "'") . ') ? $tmp' . $this->yystack[ $this->yyidx + 0 ]->minor . ' :null)'; } - #line 898 "../smarty/lexer/smarty_internal_templateparser.y" + #line 894 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r119() { - $this->_retvalue = $this->compiler->compileConfigVariable($this->yystack[ $this->yyidx + - 1 ]->minor); + $this->_retvalue = $this->compiler->compileConfigVariable($this->yystack[ $this->yyidx + -1 ]->minor); } - #line 902 "../smarty/lexer/smarty_internal_templateparser.y" + #line 898 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r120() { $this->_retvalue = - '(is_array($tmp = ' . $this->compiler->compileConfigVariable($this->yystack[ $this->yyidx + - 2 ]->minor) . + '(is_array($tmp = ' . $this->compiler->compileConfigVariable($this->yystack[ $this->yyidx + -2 ]->minor) . ') ? $tmp' . $this->yystack[ $this->yyidx + 0 ]->minor . ' : null)'; } - #line 906 "../smarty/lexer/smarty_internal_templateparser.y" + #line 902 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r121() { - $this->_retvalue = array('var' => '\'' . substr($this->yystack[ $this->yyidx + - 1 ]->minor, 1) . '\'', + $this->_retvalue = array('var' => '\'' . substr($this->yystack[ $this->yyidx + -1 ]->minor, 1) . '\'', + 'smarty_internal_index' => $this->yystack[ $this->yyidx + 0 ]->minor); + } + + #line 906 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r122() + { + $this->_retvalue = array('var' => $this->yystack[ $this->yyidx + -1 ]->minor, 'smarty_internal_index' => $this->yystack[ $this->yyidx + 0 ]->minor); } #line 909 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r122() - { - $this->_retvalue = array('var' => $this->yystack[ $this->yyidx + - 1 ]->minor, - 'smarty_internal_index' => $this->yystack[ $this->yyidx + 0 ]->minor); - } - #line 922 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r124() { return; } - #line 928 "../smarty/lexer/smarty_internal_templateparser.y" + #line 922 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r125() { $this->_retvalue = @@ -2268,205 +2131,229 @@ class Smarty_Internal_Templateparser ']'; } - #line 931 "../smarty/lexer/smarty_internal_templateparser.y" + #line 928 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r126() { $this->_retvalue = '[' . $this->compiler->compileVariable($this->yystack[ $this->yyidx + 0 ]->minor) . ']'; } - #line 935 "../smarty/lexer/smarty_internal_templateparser.y" + #line 931 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r127() { - $this->_retvalue = '[' . $this->compiler->compileVariable($this->yystack[ $this->yyidx + - 2 ]->minor) . '->' . + $this->_retvalue = '[' . $this->compiler->compileVariable($this->yystack[ $this->yyidx + -2 ]->minor) . '->' . $this->yystack[ $this->yyidx + 0 ]->minor . ']'; } - #line 939 "../smarty/lexer/smarty_internal_templateparser.y" + #line 935 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r128() { $this->_retvalue = "['" . $this->yystack[ $this->yyidx + 0 ]->minor . "']"; } - #line 943 "../smarty/lexer/smarty_internal_templateparser.y" + #line 939 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r129() { $this->_retvalue = '[' . $this->yystack[ $this->yyidx + 0 ]->minor . ']'; } - #line 948 "../smarty/lexer/smarty_internal_templateparser.y" + #line 943 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r130() { - $this->_retvalue = '[' . $this->yystack[ $this->yyidx + - 1 ]->minor . ']'; + $this->_retvalue = '[' . $this->yystack[ $this->yyidx + -1 ]->minor . ']'; + } + + #line 948 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r131() + { + $this->_retvalue = '[' . $this->compiler->compileTag('private_special_variable', + array(), + '[\'section\'][\'' . + $this->yystack[ $this->yyidx + -1 ]->minor . + '\'][\'index\']') . ']'; } #line 953 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r131() + + function yy_r132() { - $this->_retvalue = '[' . $this->compiler->compileTag('private_special_variable', array(), '[\'section\'][\'' . - $this->yystack[ $this->yyidx + - - 1 ]->minor . - '\'][\'index\']') . - ']'; + $this->_retvalue = '[' . $this->compiler->compileTag('private_special_variable', + array(), + '[\'section\'][\'' . + $this->yystack[ $this->yyidx + -3 ]->minor . '\'][\'' . + $this->yystack[ $this->yyidx + -1 ]->minor . '\']') . ']'; } #line 957 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r132() + + function yy_r133() { - $this->_retvalue = '[' . $this->compiler->compileTag('private_special_variable', array(), '[\'section\'][\'' . - $this->yystack[ $this->yyidx + - - 3 ]->minor . - '\'][\'' . - $this->yystack[ $this->yyidx + - - 1 ]->minor . - '\']') . ']'; + $this->_retvalue = '[' . $this->yystack[ $this->yyidx + -1 ]->minor . ']'; } #line 960 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r133() - { - $this->_retvalue = '[' . $this->yystack[ $this->yyidx + - 1 ]->minor . ']'; - } - #line 966 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r135() { $this->_retvalue = '[' . $this->compiler->compileVariable('\'' . - substr($this->yystack[ $this->yyidx + - 1 ]->minor, + substr($this->yystack[ $this->yyidx + -1 ]->minor, 1) . '\'') . ']';; } - #line 982 "../smarty/lexer/smarty_internal_templateparser.y" + #line 966 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r139() { $this->_retvalue = '[]'; } - #line 992 "../smarty/lexer/smarty_internal_templateparser.y" + #line 982 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r140() { $this->_retvalue = '\'' . substr($this->yystack[ $this->yyidx + 0 ]->minor, 1) . '\''; } - #line 996 "../smarty/lexer/smarty_internal_templateparser.y" + #line 992 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r141() { $this->_retvalue = "''"; } - #line 1001 "../smarty/lexer/smarty_internal_templateparser.y" + #line 996 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r142() { - $this->_retvalue = - $this->yystack[ $this->yyidx + - 1 ]->minor . '.' . $this->yystack[ $this->yyidx + 0 ]->minor; + $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor . '.' . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 1009 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1001 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r144() { $var = - trim(substr($this->yystack[ $this->yyidx + 0 ]->minor, $this->lex->ldel_length, - $this->lex->rdel_length), + trim(substr($this->yystack[ $this->yyidx + 0 ]->minor, $this->lex->ldel_length, -$this->lex->rdel_length), ' $'); $this->_retvalue = $this->compiler->compileVariable('\'' . $var . '\''); } - #line 1015 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1009 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r145() { - $this->_retvalue = '(' . $this->yystack[ $this->yyidx + - 1 ]->minor . ')'; + $this->_retvalue = '(' . $this->yystack[ $this->yyidx + -1 ]->minor . ')'; } - #line 1022 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1015 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r146() { - if ($this->yystack[ $this->yyidx + - 1 ]->minor[ 'var' ] == '\'smarty\'') { - $this->_retvalue = $this->compiler->compileTag('private_special_variable', array(), + if ($this->yystack[ $this->yyidx + -1 ]->minor['var'] == '\'smarty\'') { + $this->_retvalue = $this->compiler->compileTag('private_special_variable', + array(), $this->yystack[ $this->yyidx + - - 1 ]->minor[ 'smarty_internal_index' ]) . + -1 ]->minor['smarty_internal_index']) . $this->yystack[ $this->yyidx + 0 ]->minor; } else { - $this->_retvalue = $this->compiler->compileVariable($this->yystack[ $this->yyidx + - 1 ]->minor[ 'var' ]) . - $this->yystack[ $this->yyidx + - 1 ]->minor[ 'smarty_internal_index' ] . + $this->_retvalue = $this->compiler->compileVariable($this->yystack[ $this->yyidx + -1 ]->minor['var']) . + $this->yystack[ $this->yyidx + -1 ]->minor['smarty_internal_index'] . $this->yystack[ $this->yyidx + 0 ]->minor; } } - #line 1031 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1022 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r147() { $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 1036 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1031 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r148() { - $this->_retvalue = $this->yystack[ $this->yyidx + - 1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor; + $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 1041 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1036 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r149() { - if ($this->security && substr($this->yystack[ $this->yyidx + - 1 ]->minor, 0, 1) == '_') { + if ($this->security && substr($this->yystack[ $this->yyidx + -1 ]->minor, 0, 1) == '_') { $this->compiler->trigger_template_error(self::Err1); } $this->_retvalue = - '->' . $this->yystack[ $this->yyidx + - 1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor; + '->' . $this->yystack[ $this->yyidx + -1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 1048 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1041 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r150() { if ($this->security) { $this->compiler->trigger_template_error(self::Err2); } - $this->_retvalue = '->{' . $this->compiler->compileVariable($this->yystack[ $this->yyidx + - 1 ]->minor) . + $this->_retvalue = '->{' . $this->compiler->compileVariable($this->yystack[ $this->yyidx + -1 ]->minor) . $this->yystack[ $this->yyidx + 0 ]->minor . '}'; } - #line 1055 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1048 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r151() { if ($this->security) { $this->compiler->trigger_template_error(self::Err2); } $this->_retvalue = - '->{' . $this->yystack[ $this->yyidx + - 2 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor . '}'; + '->{' . $this->yystack[ $this->yyidx + -2 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor . '}'; } - #line 1062 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1055 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r152() { if ($this->security) { $this->compiler->trigger_template_error(self::Err2); } - $this->_retvalue = '->{\'' . $this->yystack[ $this->yyidx + - 4 ]->minor . '\'.' . - $this->yystack[ $this->yyidx + - 2 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor . - '}'; + $this->_retvalue = + '->{\'' . $this->yystack[ $this->yyidx + -4 ]->minor . '\'.' . $this->yystack[ $this->yyidx + -2 ]->minor . + $this->yystack[ $this->yyidx + 0 ]->minor . '}'; } - #line 1070 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1062 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r153() { $this->_retvalue = '->' . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 1078 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1070 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r154() { - $this->_retvalue = $this->compiler->compilePHPFunctionCall($this->yystack[ $this->yyidx + - 3 ]->minor, - $this->yystack[ $this->yyidx + - 1 ]->minor); + $this->_retvalue = $this->compiler->compilePHPFunctionCall($this->yystack[ $this->yyidx + -3 ]->minor, + $this->yystack[ $this->yyidx + -1 ]->minor); + } + + #line 1078 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r155() + { + if ($this->security && substr($this->yystack[ $this->yyidx + -3 ]->minor, 0, 1) == '_') { + $this->compiler->trigger_template_error(self::Err1); + } + $this->_retvalue = $this->yystack[ $this->yyidx + -3 ]->minor . "(" . + implode(',', $this->yystack[ $this->yyidx + -1 ]->minor) . ")"; } #line 1086 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r155() - { - if ($this->security && substr($this->yystack[ $this->yyidx + - 3 ]->minor, 0, 1) == '_') { - $this->compiler->trigger_template_error(self::Err1); - } - $this->_retvalue = $this->yystack[ $this->yyidx + - 3 ]->minor . "(" . - implode(',', $this->yystack[ $this->yyidx + - 1 ]->minor) . ")"; - } - #line 1093 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r156() { if ($this->security) { @@ -2475,88 +2362,100 @@ class Smarty_Internal_Templateparser $prefixVar = $this->compiler->getNewPrefixVariable(); $this->compiler->appendPrefixCode("compiler->compileVariable('\'' . substr($this->yystack[ $this->yyidx + - - 3 ]->minor, + -3 ]->minor, 1) . '\'') . ';?>'); - $this->_retvalue = $prefixVar . '(' . implode(',', $this->yystack[ $this->yyidx + - 1 ]->minor) . ')'; + $this->_retvalue = $prefixVar . '(' . implode(',', $this->yystack[ $this->yyidx + -1 ]->minor) . ')'; } - #line 1104 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1093 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r157() { $this->_retvalue = - array_merge($this->yystack[ $this->yyidx + - 2 ]->minor, array($this->yystack[ $this->yyidx + 0 ]->minor)); + array_merge($this->yystack[ $this->yyidx + -2 ]->minor, array($this->yystack[ $this->yyidx + 0 ]->minor)); } - #line 1121 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1104 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r160() { - $this->_retvalue = array_merge($this->yystack[ $this->yyidx + - 2 ]->minor, - array(array_merge($this->yystack[ $this->yyidx + - 1 ]->minor, + $this->_retvalue = array_merge($this->yystack[ $this->yyidx + -2 ]->minor, + array(array_merge($this->yystack[ $this->yyidx + -1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor))); } - #line 1125 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1121 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r161() { $this->_retvalue = - array(array_merge($this->yystack[ $this->yyidx + - 1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor)); + array(array_merge($this->yystack[ $this->yyidx + -1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor)); } - #line 1133 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1125 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r163() { $this->_retvalue = array($this->yystack[ $this->yyidx + 0 ]->minor); } - #line 1141 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1133 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r164() { $this->_retvalue = - array_merge($this->yystack[ $this->yyidx + - 1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor); + array_merge($this->yystack[ $this->yyidx + -1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor); } - #line 1160 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1141 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r168() { $this->_retvalue = array($this->yystack[ $this->yyidx + 0 ]->minor, '', 'method'); } - #line 1165 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1160 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r169() { $this->_retvalue = - array($this->yystack[ $this->yyidx + - 1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor, 'method'); + array($this->yystack[ $this->yyidx + -1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor, 'method'); } - #line 1170 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1165 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r170() { $this->_retvalue = array($this->yystack[ $this->yyidx + 0 ]->minor, ''); } - #line 1175 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1170 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r171() { $this->_retvalue = - array($this->yystack[ $this->yyidx + - 1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor, 'property'); + array($this->yystack[ $this->yyidx + -1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor, 'property'); + } + + #line 1175 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r172() + { + $this->_retvalue = array($this->yystack[ $this->yyidx + -2 ]->minor, + $this->yystack[ $this->yyidx + -1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor, + 'property'); } #line 1180 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r172() - { - $this->_retvalue = array($this->yystack[ $this->yyidx + - 2 ]->minor, - $this->yystack[ $this->yyidx + - 1 ]->minor . - $this->yystack[ $this->yyidx + 0 ]->minor, 'property'); - } - #line 1186 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r173() { $this->_retvalue = ' ' . trim($this->yystack[ $this->yyidx + 0 ]->minor) . ' '; } - #line 1190 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1186 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r174() { static $lops = @@ -2567,7 +2466,8 @@ class Smarty_Internal_Templateparser $this->_retvalue = $lops[ $op ]; } - #line 1209 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1190 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r175() { static $tlops = @@ -2580,7 +2480,8 @@ class Smarty_Internal_Templateparser $this->_retvalue = $tlops[ $op ]; } - #line 1222 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1209 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r176() { static $scond = @@ -2589,59 +2490,67 @@ class Smarty_Internal_Templateparser $this->_retvalue = $scond[ $op ]; } - #line 1236 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1222 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r177() { - $this->_retvalue = 'array(' . $this->yystack[ $this->yyidx + - 1 ]->minor . ')'; + $this->_retvalue = 'array(' . $this->yystack[ $this->yyidx + -1 ]->minor . ')'; + } + + #line 1236 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r179() + { + $this->_retvalue = $this->yystack[ $this->yyidx + -2 ]->minor . ',' . $this->yystack[ $this->yyidx + 0 ]->minor; } #line 1244 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r179() - { - $this->_retvalue = - $this->yystack[ $this->yyidx + - 2 ]->minor . ',' . $this->yystack[ $this->yyidx + 0 ]->minor; - } - #line 1252 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r181() { $this->_retvalue = - $this->yystack[ $this->yyidx + - 2 ]->minor . '=>' . $this->yystack[ $this->yyidx + 0 ]->minor; + $this->yystack[ $this->yyidx + -2 ]->minor . '=>' . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 1256 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1252 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r182() { $this->_retvalue = - '\'' . $this->yystack[ $this->yyidx + - 2 ]->minor . '\'=>' . $this->yystack[ $this->yyidx + 0 ]->minor; + '\'' . $this->yystack[ $this->yyidx + -2 ]->minor . '\'=>' . $this->yystack[ $this->yyidx + 0 ]->minor; + } + + #line 1256 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r185() + { + $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor->to_smarty_php($this); } #line 1272 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r185() + + function yy_r186() { - $this->_retvalue = $this->yystack[ $this->yyidx + - 1 ]->minor->to_smarty_php($this); + $this->yystack[ $this->yyidx + -1 ]->minor->append_subtree($this, $this->yystack[ $this->yyidx + 0 ]->minor); + $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor; } #line 1277 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r186() - { - $this->yystack[ $this->yyidx + - 1 ]->minor->append_subtree($this, $this->yystack[ $this->yyidx + 0 ]->minor); - $this->_retvalue = $this->yystack[ $this->yyidx + - 1 ]->minor; - } - #line 1282 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r187() { $this->_retvalue = new Smarty_Internal_ParseTree_Dq($this, $this->yystack[ $this->yyidx + 0 ]->minor); } - #line 1286 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1282 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r188() { - $this->_retvalue = new Smarty_Internal_ParseTree_Code('(string)' . $this->yystack[ $this->yyidx + - 1 ]->minor); + $this->_retvalue = new Smarty_Internal_ParseTree_Code('(string)' . $this->yystack[ $this->yyidx + -1 ]->minor); } - #line 1294 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1286 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r190() { $this->_retvalue = new Smarty_Internal_ParseTree_Code('(string)$_smarty_tpl->tpl_vars[\'' . @@ -2649,98 +2558,29 @@ class Smarty_Internal_Templateparser '\']->value'); } - #line 1302 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1294 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r192() { $this->_retvalue = - new Smarty_Internal_ParseTree_Code('(string)(' . $this->yystack[ $this->yyidx + - 1 ]->minor . ')'); + new Smarty_Internal_ParseTree_Code('(string)(' . $this->yystack[ $this->yyidx + -1 ]->minor . ')'); } - #line 1306 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1302 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r193() { $this->_retvalue = new Smarty_Internal_ParseTree_Tag($this, $this->yystack[ $this->yyidx + 0 ]->minor); } - #line 1310 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1306 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r194() { $this->_retvalue = new Smarty_Internal_ParseTree_DqContent($this->yystack[ $this->yyidx + 0 ]->minor); } - private $_retvalue; - - public function yy_reduce($yyruleno) - { - if ($this->yyTraceFILE && $yyruleno >= 0 && $yyruleno < count(self::$yyRuleName)) { - fprintf($this->yyTraceFILE, "%sReduce (%d) [%s].\n", $this->yyTracePrompt, $yyruleno, - self::$yyRuleName[ $yyruleno ]); - } - - $this->_retvalue = $yy_lefthand_side = null; - if (isset(self::$yyReduceMap[ $yyruleno ])) { - // call the action - $this->_retvalue = null; - $this->{'yy_r' . self::$yyReduceMap[ $yyruleno ]}(); - $yy_lefthand_side = $this->_retvalue; - } - $yygoto = self::$yyRuleInfo[ $yyruleno ][ 0 ]; - $yysize = self::$yyRuleInfo[ $yyruleno ][ 1 ]; - $this->yyidx -= $yysize; - for ($i = $yysize; $i; $i --) { - // pop all of the right-hand side parameters - array_pop($this->yystack); - } - $yyact = $this->yy_find_reduce_action($this->yystack[ $this->yyidx ]->stateno, $yygoto); - if ($yyact < self::YYNSTATE) { - if (!$this->yyTraceFILE && $yysize) { - $this->yyidx ++; - $x = new TP_yyStackEntry; - $x->stateno = $yyact; - $x->major = $yygoto; - $x->minor = $yy_lefthand_side; - $this->yystack[ $this->yyidx ] = $x; - } else { - $this->yy_shift($yyact, $yygoto, $yy_lefthand_side); - } - } elseif ($yyact == self::YYNSTATE + self::YYNRULE + 1) { - $this->yy_accept(); - } - } - - public function yy_parse_failed() - { - if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, "%sFail!\n", $this->yyTracePrompt); - } - while ($this->yyidx >= 0) { - $this->yy_pop_parser_stack(); - } - } - - public function yy_syntax_error($yymajor, $TOKEN) - { - #line 200 "../smarty/lexer/smarty_internal_templateparser.y" - - $this->internalError = true; - $this->yymajor = $yymajor; - $this->compiler->trigger_template_error(); - } - - public function yy_accept() - { - if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, "%sAccept!\n", $this->yyTracePrompt); - } - while ($this->yyidx >= 0) { - $this->yy_pop_parser_stack(); - } - #line 193 "../smarty/lexer/smarty_internal_templateparser.y" - - $this->successful = !$this->internalError; - $this->internalError = false; - $this->retvalue = $this->_retvalue; - } + #line 1310 "../smarty/lexer/smarty_internal_templateparser.y" public function doParse($yymajor, $yytokenvalue) { @@ -2748,7 +2588,7 @@ class Smarty_Internal_Templateparser if ($this->yyidx === null || $this->yyidx < 0) { $this->yyidx = 0; - $this->yyerrcnt = - 1; + $this->yyerrcnt = -1; $x = new TP_yyStackEntry; $x->stateno = 0; $x->major = 0; @@ -2758,7 +2598,10 @@ class Smarty_Internal_Templateparser $yyendofinput = ($yymajor == 0); if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, "%sInput %s\n", $this->yyTracePrompt, $this->yyTokenName[ $yymajor ]); + fprintf($this->yyTraceFILE, + "%sInput %s\n", + $this->yyTracePrompt, + $this->yyTokenName[ $yymajor ]); } do { @@ -2769,17 +2612,19 @@ class Smarty_Internal_Templateparser } if ($yyact < self::YYNSTATE) { $this->yy_shift($yyact, $yymajor, $yytokenvalue); - $this->yyerrcnt --; + $this->yyerrcnt--; if ($yyendofinput && $this->yyidx >= 0) { $yymajor = 0; } else { $yymajor = self::YYNOCODE; } - } elseif ($yyact < self::YYNSTATE + self::YYNRULE) { + } else if ($yyact < self::YYNSTATE + self::YYNRULE) { $this->yy_reduce($yyact - self::YYNSTATE); - } elseif ($yyact == self::YY_ERROR_ACTION) { + } else if ($yyact == self::YY_ERROR_ACTION) { if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, "%sSyntax Error!\n", $this->yyTracePrompt); + fprintf($this->yyTraceFILE, + "%sSyntax Error!\n", + $this->yyTracePrompt); } if (self::YYERRORSYMBOL) { if ($this->yyerrcnt < 0) { @@ -2788,7 +2633,9 @@ class Smarty_Internal_Templateparser $yymx = $this->yystack[ $this->yyidx ]->major; if ($yymx == self::YYERRORSYMBOL || $yyerrorhit) { if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, "%sDiscard input token %s\n", $this->yyTracePrompt, + fprintf($this->yyTraceFILE, + "%sDiscard input token %s\n", + $this->yyTracePrompt, $this->yyTokenName[ $yymajor ]); } $this->yy_destructor($yymajor, $yytokenvalue); @@ -2802,7 +2649,7 @@ class Smarty_Internal_Templateparser $this->yy_destructor($yymajor, $yytokenvalue); $this->yy_parse_failed(); $yymajor = self::YYNOCODE; - } elseif ($yymx != self::YYERRORSYMBOL) { + } else if ($yymx != self::YYERRORSYMBOL) { $u2 = 0; $this->yy_shift($yyact, self::YYERRORSYMBOL, $u2); } @@ -2824,8 +2671,209 @@ class Smarty_Internal_Templateparser $this->yy_accept(); $yymajor = self::YYNOCODE; } + } while ($yymajor != self::YYNOCODE && $this->yyidx >= 0); + } + + public function yy_is_expected_token($token) + { + static $res = array(); + static $res2 = array(); + if ($token === 0) { + return true; // 0 is not part of this + } + $state = $this->yystack[ $this->yyidx ]->stateno; + if (isset($res[ $state ][ $token ])) { + if ($res[ $state ][ $token ]) { + return true; + } + } else { + if ($res[ $state ][ $token ] = in_array($token, self::$yyExpectedTokens[ $state ], true)) { + return true; + } + } + $stack = $this->yystack; + $yyidx = $this->yyidx; + do { + $yyact = $this->yy_find_shift_action($token); + if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) { + // reduce action + $done = 0; + do { + if ($done++ == 100) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + // too much recursion prevents proper detection + // so give up + return true; + } + $yyruleno = $yyact - self::YYNSTATE; + $this->yyidx -= self::$yyRuleInfo[ $yyruleno ][1]; + $nextstate = $this->yy_find_reduce_action($this->yystack[ $this->yyidx ]->stateno, + self::$yyRuleInfo[ $yyruleno ][0]); + if (isset($res2[ $nextstate ][ $token ])) { + if ($res2[ $nextstate ][ $token ]) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + return true; + } + } else { + if ($res2[ $nextstate ][ $token ] = (isset(self::$yyExpectedTokens[ $nextstate ]) && + in_array($token, + self::$yyExpectedTokens[ $nextstate ], + true))) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + return true; + } + } + if ($nextstate < self::YYNSTATE) { + // we need to shift a non-terminal + $this->yyidx++; + $x = new TP_yyStackEntry; + $x->stateno = $nextstate; + $x->major = self::$yyRuleInfo[ $yyruleno ][0]; + $this->yystack[ $this->yyidx ] = $x; + continue 2; + } else if ($nextstate == self::YYNSTATE + self::YYNRULE + 1) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + if (!$token) { + // end of input: this is valid + return true; + } + // the last token was just ignored, we can't accept + // by ignoring input, this is in essence ignoring a + // syntax error! + return false; + } else if ($nextstate === self::YY_NO_ACTION) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + // input accepted, but not shifted (I guess) + return true; + } else { + $yyact = $nextstate; + } + } while (true); + } + break; + } while (true); + $this->yyidx = $yyidx; + $this->yystack = $stack; + + return true; + } + + public function yy_shift($yyNewState, $yyMajor, $yypMinor) + { + $this->yyidx++; + if ($this->yyidx >= self::YYSTACKDEPTH) { + $this->yyidx--; + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sStack Overflow!\n", $this->yyTracePrompt); + } + while ($this->yyidx >= 0) { + $this->yy_pop_parser_stack(); + } + #line 207 "../smarty/lexer/smarty_internal_templateparser.y" + + $this->internalError = true; + $this->compiler->trigger_template_error("Stack overflow in template parser"); + + return; + } + $yytos = new TP_yyStackEntry; + $yytos->stateno = $yyNewState; + $yytos->major = $yyMajor; + $yytos->minor = $yypMinor; + $this->yystack[] = $yytos; + if ($this->yyTraceFILE && $this->yyidx > 0) { + fprintf($this->yyTraceFILE, + "%sShift %d\n", + $this->yyTracePrompt, + $yyNewState); + fprintf($this->yyTraceFILE, "%sStack:", $this->yyTracePrompt); + for ($i = 1; $i <= $this->yyidx; $i++) { + fprintf($this->yyTraceFILE, + " %s", + $this->yyTokenName[ $this->yystack[ $i ]->major ]); + } + fwrite($this->yyTraceFILE, "\n"); + } + } + + public function yy_reduce($yyruleno) + { + if ($this->yyTraceFILE && $yyruleno >= 0 && $yyruleno < count(self::$yyRuleName)) { + fprintf($this->yyTraceFILE, + "%sReduce (%d) [%s].\n", + $this->yyTracePrompt, + $yyruleno, + self::$yyRuleName[ $yyruleno ]); + } + + $this->_retvalue = $yy_lefthand_side = null; + if (isset(self::$yyReduceMap[ $yyruleno ])) { + // call the action + $this->_retvalue = null; + $this->{'yy_r' . self::$yyReduceMap[ $yyruleno ]}(); + $yy_lefthand_side = $this->_retvalue; + } + $yygoto = self::$yyRuleInfo[ $yyruleno ][0]; + $yysize = self::$yyRuleInfo[ $yyruleno ][1]; + $this->yyidx -= $yysize; + for ($i = $yysize; $i; $i--) { + // pop all of the right-hand side parameters + array_pop($this->yystack); + } + $yyact = $this->yy_find_reduce_action($this->yystack[ $this->yyidx ]->stateno, $yygoto); + if ($yyact < self::YYNSTATE) { + if (!$this->yyTraceFILE && $yysize) { + $this->yyidx++; + $x = new TP_yyStackEntry; + $x->stateno = $yyact; + $x->major = $yygoto; + $x->minor = $yy_lefthand_side; + $this->yystack[ $this->yyidx ] = $x; + } else { + $this->yy_shift($yyact, $yygoto, $yy_lefthand_side); + } + } else if ($yyact == self::YYNSTATE + self::YYNRULE + 1) { + $this->yy_accept(); + } + } + + public function yy_accept() + { + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sAccept!\n", $this->yyTracePrompt); + } + while ($this->yyidx >= 0) { + $this->yy_pop_parser_stack(); + } + #line 193 "../smarty/lexer/smarty_internal_templateparser.y" + + $this->successful = !$this->internalError; + $this->internalError = false; + $this->retvalue = $this->_retvalue; + } + + public function yy_syntax_error($yymajor, $TOKEN) + { + #line 200 "../smarty/lexer/smarty_internal_templateparser.y" + + $this->internalError = true; + $this->yymajor = $yymajor; + $this->compiler->trigger_template_error(); + } + + public function yy_parse_failed() + { + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sFail!\n", $this->yyTracePrompt); + } + while ($this->yyidx >= 0) { + $this->yy_pop_parser_stack(); } - while ($yymajor != self::YYNOCODE && $this->yyidx >= 0); } }