diff options
| author | Uwe Tews <uwe.tews@googlemail.com> | 2014-12-14 00:49:42 +0100 |
|---|---|---|
| committer | Uwe Tews <uwe.tews@googlemail.com> | 2014-12-14 00:49:42 +0100 |
| commit | 5e4f55d121b741fc1c2c7f8ebf00349cddedf1c8 (patch) | |
| tree | fe80c81d2c832bd4fec36b960508fd127beaeda9 /lexer/smarty_internal_templatelexer.plex | |
| parent | 46654268ef3098143097b47bccbd10e1fbcb6298 (diff) | |
| download | smarty-5e4f55d121b741fc1c2c7f8ebf00349cddedf1c8.tar.gz smarty-5e4f55d121b741fc1c2c7f8ebf00349cddedf1c8.tar.bz2 smarty-5e4f55d121b741fc1c2c7f8ebf00349cddedf1c8.zip | |
add .plex and .y files
add lexer .plex and parser .y files to distribution for easier version
control
Diffstat (limited to 'lexer/smarty_internal_templatelexer.plex')
| -rw-r--r-- | lexer/smarty_internal_templatelexer.plex | 900 |
1 files changed, 900 insertions, 0 deletions
diff --git a/lexer/smarty_internal_templatelexer.plex b/lexer/smarty_internal_templatelexer.plex new file mode 100644 index 00000000..d988c12b --- /dev/null +++ b/lexer/smarty_internal_templatelexer.plex @@ -0,0 +1,900 @@ +<?php +/** + * Smarty Internal Plugin Templatelexer + * This is the lexer to break the template source into tokens + * + * @package Smarty + * @subpackage Compiler + * @author Uwe Tews + */ + +/** + * Smarty_Internal_Templatelexer + * This is the template file lexer. + * It is generated from the smarty_internal_templatelexer.plex file + * + * @package Smarty + * @subpackage Compiler + * @author Uwe Tews + */ +class Smarty_Internal_Templatelexer +{ + /** + * Source + * + * @var string + */ + public $data; + /** + * 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; + /** + * flag if parsing php script + * + * @var bool + */ + public $is_phpScript = false; + /** + * escaped left delimiter + * + * @var string + */ + public $ldel = ''; + /** + * escaped left delimiter length + * + * @var int + */ + public $ldel_length = 0; + /** + * escaped right delimiter + * + * @var string + */ + public $rdel = ''; + /** + * 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 + */ + private $compiler = null; + /** + * literal tag nesting level + * + * @var int + */ + private $literal_cnt = 0; + /** + * trace file + * + * @var resource + */ + public $yyTraceFILE; + /** + * trace prompt + * + * @var string + */ + public $yyTracePrompt; + /** + * state names + * + * @var array + */ + public $state_name = array(1 => 'TEXT', 2 => 'SMARTY', 3 => 'LITERAL', 4 => 'DOUBLEQUOTEDSTRING', 5 => 'CHILDBODY'); + /** + * token names + * + * @var array + */ + public $smarty_token_names = array( // Text for parser error messages + 'IDENTITY' => '===', + 'NONEIDENTITY' => '!==', + 'EQUALS' => '==', + 'NOTEQUALS' => '!=', + 'GREATEREQUAL' => '(>=,ge)', + 'LESSEQUAL' => '(<=,le)', + 'GREATERTHAN' => '(>,gt)', + 'LESSTHAN' => '(<,lt)', + 'MOD' => '(%,mod)', + 'NOT' => '(!,not)', + 'LAND' => '(&&,and)', + 'LOR' => '(||,or)', + 'LXOR' => 'xor', + 'OPENP' => '(', + 'CLOSEP' => ')', + 'OPENB' => '[', + 'CLOSEB' => ']', + 'PTR' => '->', + 'APTR' => '=>', + 'EQUAL' => '=', + 'NUMBER' => 'number', + 'UNIMATH' => '+" , "-', + 'MATH' => '*" , "/" , "%', + 'INCDEC' => '++" , "--', + 'SPACE' => ' ', + 'DOLLAR' => '$', + 'SEMICOLON' => ';', + 'COLON' => ':', + 'DOUBLECOLON' => '::', + 'AT' => '@', + 'HATCH' => '#', + 'QUOTE' => '"', + 'BACKTICK' => '`', + 'VERT' => '|', + 'DOT' => '.', + 'COMMA' => '","', + 'ANDSYM' => '"&"', + 'QMARK' => '"?"', + 'ID' => 'identifier', + 'TEXT' => 'text', + 'FAKEPHPSTARTTAG' => 'Fake PHP start tag', + 'PHPSTARTTAG' => 'PHP start tag', + 'PHPENDTAG' => 'PHP end tag', + 'LITERALSTART' => 'Literal start', + 'LITERALEND' => 'Literal end', + 'LDELSLASH' => 'closing tag', + 'COMMENT' => 'comment', + 'AS' => 'as', + 'TO' => 'to', + ); + + /** + * constructor + * + * @param string $data template source + * @param Smarty_Internal_TemplateCompilerBase $compiler + */ + function __construct($data, Smarty_Internal_TemplateCompilerBase $compiler) + { + $this->data = $data; + $this->counter = 0; + if (preg_match('/^\xEF\xBB\xBF/', $this->data, $match)) { + $this->counter += strlen($match[0]); + } + $this->line = 1; + $this->smarty = $compiler->smarty; + $this->compiler = $compiler; + $this->ldel = preg_quote($this->smarty->left_delimiter, '/'); + $this->ldel_length = strlen($this->smarty->left_delimiter); + $this->rdel = preg_quote($this->smarty->right_delimiter, '/'); + $this->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; + } + + public function PrintTrace() + { + $this->yyTraceFILE = fopen('php://output', 'w'); + $this->yyTracePrompt = '<br>'; + } + + /*!lex2php + %input $this->data + %counter $this->counter + %token $this->token + %value $this->value + %line $this->line + linebreak = /[\t ]*[\r\n]+[\t ]*/ + text = /[\S\s]/ + textdoublequoted = /([^"\\]*?)((?:\\.[^"\\]*?)*?)(?=(SMARTYldel|\$|`\$|"))/ + dollarid = /\$[0-9]*[a-zA-Z_]\w*/ + namespace = /([0-9]*[a-zA-Z_]\w*)?(\\[0-9]*[a-zA-Z_]\w*)+/ + all = /[\S\s]+/ + emptyjava = /\{\}/ + phpstarttag = /(<script\s+language\s*=\s*[\"\']?\s*php\s*[\"\']?\s*>)|(<\?(?:php\w+|=|[a-zA-Z]+)?)/ + phpendtag = /\?>/ + phpendscript = /<\/script>/ + aspstarttag = /<%/ + aspendtag = /%>/ + slash = /\// + ldel = /SMARTYldel\s*/ + rdel = /\s*SMARTYrdel/ + smartyblockchildparent = /[\$]smarty\.block\.(child|parent)/ + integer = /\d+/ + hex = /0[xX][0-9a-fA-F]+/ + math = /\s*(\*|\/|\%)\s*/ + comment = /SMARTYldel\*([\S\s]*?)\*SMARTYrdel/ + incdec = /\+\+|\-\-/ + unimath = /\s*(\+|\-)\s*/ + openP = /\s*\(\s*/ + closeP = /\s*\)/ + openB = /\[\s*/ + closeB = /\s*\]/ + dollar = /\$/ + dot = /\./ + comma = /\s*\,\s*/ + doublecolon = /\:\:/ + colon = /\s*\:\s*/ + at = /@/ + hatch = /#/ + semicolon = /\s*\;/ + equal = /\s*=\s*/ + space = /\s+/ + ptr = /\s*\->\s*/ + aptr = /\s*=>\s*/ + singlequotestring = /'[^'\\]*(?:\\.[^'\\]*)*'/ + backtick = /`/ + backtickdollar = /`\$/ + vert = /\|/ + andsym = /\s*\&\s*/ + qmark = /\s*\?\s*/ + constant = /([_]+[A-Z0-9][0-9A-Z_]*|[A-Z][0-9A-Z_]*)(?![0-9A-Z_]*[a-z])/ + attr = /\s+[0-9]*[a-zA-Z_][a-zA-Z0-9_\-:]*\s*=\s*/ + id = /[0-9]*[a-zA-Z_]\w*/ + literal = /literal/ + strip = /strip/ + equals = /\s*==\s*|\s+eq\s+/ + notequals = /\s*!=\s*|\s*<>\s*|\s+(ne|neq)\s+/ + greaterthan = /\s*>\s*|\s+gt\s+/ + lessthan = /\s*<\s*|\s+lt\s+/ + greaterequal = /\s*>=\s*|\s+(ge|gte)\s+/ + lessequal = /\s*<=\s*|\s+(le|lte)\s+/ + mod = /\s+mod\s+/ + identity = /\s*===\s*/ + noneidentity = /\s*!==\s*/ + isoddby = /\s+is\s+odd\s+by\s+/ + isnotoddby = /\s+is\s+not\s+odd\s+by\s+/ + isodd = /\s+is\s+odd/ + isnotodd = /\s+is\s+not\s+odd/ + isevenby = /\s+is\s+even\s+by\s+/ + isnotevenby = /\s+is\s+not\s+even\s+by\s+/ + iseven = /\s+is\s+even/ + isnoteven = /\s+is\s+not\s+even/ + isdivby = /\s+is\s+div\s+by\s+/ + isnotdivby = /\s+is\s+not\s+div\s+by\s+/ + isin = /\s+is\s+in\s+/ + as = /\s+as\s+/ + to = /\s+to\s+/ + step = /\s+step\s+/ + block = /block/ + if = /(if|elseif|else if|while)\s+/ + for = /for\s+/ + foreach = /foreach(?![^\s])/ + setfilter = /setfilter\s+/ + instanceof = /\s+instanceof\s+/ + not = /!\s*|not\s+/ + land = /\s*\&\&\s*|\s*and\s+/ + lor = /\s*\|\|\s*|\s*or\s+/ + lxor = /\s*xor\s+/ + typecast = /\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\)\s*/ + double_quote = /"/ + single_quote = /'/ + */ + /*!lex2php + %statename TEXT + emptyjava { + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } + comment { + $this->token = Smarty_Internal_Templateparser::TP_COMMENT; + } + ldel strip 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_STRIPON; + } + } + ldel slash strip 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_STRIPOFF; + } + } + 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 if { + 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_LDELIF; + $this->yypushstate(self::SMARTY); + $this->taglineno = $this->line; + } + } + ldel for { + 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_LDELFOR; + $this->yypushstate(self::SMARTY); + $this->taglineno = $this->line; + } + } + ldel foreach { + 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_LDELFOREACH; + $this->yypushstate(self::SMARTY); + $this->taglineno = $this->line; + } + } + ldel setfilter { + 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_LDELSETFILTER; + $this->yypushstate(self::SMARTY); + $this->taglineno = $this->line; + } + } + 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->token = Smarty_Internal_Templateparser::TP_LDELSLASH; + $this->yypushstate(self::SMARTY); + $this->taglineno = $this->line; + } + } + 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->yypushstate(self::SMARTY); + $this->taglineno = $this->line; + } + } + phpstarttag { + if (($script = strpos($this->value, '<s') === 0) || in_array($this->value, Array('<?', '<?=', '<?php'))) { + if ($script) { + $this->is_phpScript = true; + } + $this->token = Smarty_Internal_Templateparser::TP_PHPSTARTTAG; + } elseif ($this->value == '<?xml') { + $this->token = Smarty_Internal_Templateparser::TP_XMLTAG; + } else { + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + //$this->value = substr($this->value, 0, 2); + } + } + phpendtag { + $this->token = Smarty_Internal_Templateparser::TP_PHPENDTAG; + } + phpendscript { + $this->token = Smarty_Internal_Templateparser::TP_PHPENDSCRIPT; + } + rdel { + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } + aspstarttag { + $this->token = Smarty_Internal_Templateparser::TP_ASPSTARTTAG; + } + aspendtag { + $this->token = Smarty_Internal_Templateparser::TP_ASPENDTAG; + } + text { + $phpEndScript = $this->is_phpScript ? '|<\\/script>' : ''; + $to = strlen($this->data); + preg_match("/{$this->ldel}|<\?|<%|\?>|%>|<script\s+language\s*=\s*[\"\']?\s*php\s*[\"\']?\s*>{$phpEndScript}/",$this->data,$match,PREG_OFFSET_CAPTURE,$this->counter); + if (isset($match[0][1])) { + $to = $match[0][1]; + } + $this->value = substr($this->data,$this->counter,$to-$this->counter); + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } + + + */ + /*!lex2php + %statename SMARTY + double_quote { + $this->token = Smarty_Internal_Templateparser::TP_QUOTE; + $this->yypushstate(self::DOUBLEQUOTEDSTRING); + } + singlequotestring { + $this->token = Smarty_Internal_Templateparser::TP_SINGLEQUOTESTRING; + } + smartyblockchildparent { + $this->token = Smarty_Internal_Templateparser::TP_SMARTYBLOCKCHILDPARENT; + $this->taglineno = $this->line; + } + dollar { + $this->token = Smarty_Internal_Templateparser::TP_DOLLAR; + } + rdel { + $this->token = Smarty_Internal_Templateparser::TP_RDEL; + $this->yypopstate(); + } + isin { + $this->token = Smarty_Internal_Templateparser::TP_ISIN; + } + as { + $this->token = Smarty_Internal_Templateparser::TP_AS; + } + to { + $this->token = Smarty_Internal_Templateparser::TP_TO; + } + step { + $this->token = Smarty_Internal_Templateparser::TP_STEP; + } + instanceof { + $this->token = Smarty_Internal_Templateparser::TP_INSTANCEOF; + } + identity{ + $this->token = Smarty_Internal_Templateparser::TP_IDENTITY; + } + noneidentity{ + $this->token = Smarty_Internal_Templateparser::TP_NONEIDENTITY; + } + equals{ + $this->token = Smarty_Internal_Templateparser::TP_EQUALS; + } + notequals{ + $this->token = Smarty_Internal_Templateparser::TP_NOTEQUALS; + } + greaterequal{ + $this->token = Smarty_Internal_Templateparser::TP_GREATEREQUAL; + } + lessequal{ + $this->token = Smarty_Internal_Templateparser::TP_LESSEQUAL; + } + greaterthan{ + $this->token = Smarty_Internal_Templateparser::TP_GREATERTHAN; + } + lessthan{ + $this->token = Smarty_Internal_Templateparser::TP_LESSTHAN; + } + mod{ + $this->token = Smarty_Internal_Templateparser::TP_MOD; + } + not{ + $this->token = Smarty_Internal_Templateparser::TP_NOT; + } + land { + $this->token = Smarty_Internal_Templateparser::TP_LAND; + } + lor { + $this->token = Smarty_Internal_Templateparser::TP_LOR; + } + lxor { + $this->token = Smarty_Internal_Templateparser::TP_LXOR; + } + isoddby { + $this->token = Smarty_Internal_Templateparser::TP_ISODDBY; + } + isnotoddby { + $this->token = Smarty_Internal_Templateparser::TP_ISNOTODDBY; + } + + isodd { + $this->token = Smarty_Internal_Templateparser::TP_ISODD; + } + isnotodd { + $this->token = Smarty_Internal_Templateparser::TP_ISNOTODD; + } + isevenby { + $this->token = Smarty_Internal_Templateparser::TP_ISEVENBY; + } + isnotevenby { + $this->token = Smarty_Internal_Templateparser::TP_ISNOTEVENBY; + } + iseven{ + $this->token = Smarty_Internal_Templateparser::TP_ISEVEN; + } + isnoteven { + $this->token = Smarty_Internal_Templateparser::TP_ISNOTEVEN; + } + isdivby { + $this->token = Smarty_Internal_Templateparser::TP_ISDIVBY; + } + isnotdivby { + $this->token = Smarty_Internal_Templateparser::TP_ISNOTDIVBY; + } + typecast { + $this->token = Smarty_Internal_Templateparser::TP_TYPECAST; + } + openP { + $this->token = Smarty_Internal_Templateparser::TP_OPENP; + } + closeP { + $this->token = Smarty_Internal_Templateparser::TP_CLOSEP; + } + openB { + $this->token = Smarty_Internal_Templateparser::TP_OPENB; + } + + closeB { + $this->token = Smarty_Internal_Templateparser::TP_CLOSEB; + } + ptr { + $this->token = Smarty_Internal_Templateparser::TP_PTR; + } + aptr { + $this->token = Smarty_Internal_Templateparser::TP_APTR; + } + equal { + $this->token = Smarty_Internal_Templateparser::TP_EQUAL; + } + incdec { + $this->token = Smarty_Internal_Templateparser::TP_INCDEC; + } + unimath { + $this->token = Smarty_Internal_Templateparser::TP_UNIMATH; + } + math { + $this->token = Smarty_Internal_Templateparser::TP_MATH; + } + at { + $this->token = Smarty_Internal_Templateparser::TP_AT; + } + hatch { + $this->token = Smarty_Internal_Templateparser::TP_HATCH; + } + attr { + // 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) { + preg_match("/\s+/",$this->value,$match); + $this->value = $match[0]; + $this->token = Smarty_Internal_Templateparser::TP_SPACE; + } else { + $this->token = Smarty_Internal_Templateparser::TP_ATTR; + } + } + namespace { + $this->token = Smarty_Internal_Templateparser::TP_NAMESPACE; + } + id { + $this->token = Smarty_Internal_Templateparser::TP_ID; + } + integer { + $this->token = Smarty_Internal_Templateparser::TP_INTEGER; + } + backtick { + $this->token = Smarty_Internal_Templateparser::TP_BACKTICK; + $this->yypopstate(); + } + vert { + $this->token = Smarty_Internal_Templateparser::TP_VERT; + } + dot { + $this->token = Smarty_Internal_Templateparser::TP_DOT; + } + comma { + $this->token = Smarty_Internal_Templateparser::TP_COMMA; + } + semicolon { + $this->token = Smarty_Internal_Templateparser::TP_SEMICOLON; + } + doublecolon { + $this->token = Smarty_Internal_Templateparser::TP_DOUBLECOLON; + } + colon { + $this->token = Smarty_Internal_Templateparser::TP_COLON; + } + andsym { + $this->token = Smarty_Internal_Templateparser::TP_ANDSYM; + } + qmark { + $this->token = Smarty_Internal_Templateparser::TP_QMARK; + } + hex { + $this->token = Smarty_Internal_Templateparser::TP_HEX; + } + space { + $this->token = Smarty_Internal_Templateparser::TP_SPACE; + } + ldel if { + 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_LDELIF; + $this->yypushstate(self::SMARTY); + $this->taglineno = $this->line; + } + } + ldel for { + 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_LDELFOR; + $this->yypushstate(self::SMARTY); + $this->taglineno = $this->line; + } + } + ldel foreach { + 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_LDELFOREACH; + $this->yypushstate(self::SMARTY); + $this->taglineno = $this->line; + } + } + 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->token = Smarty_Internal_Templateparser::TP_LDELSLASH; + $this->yypushstate(self::SMARTY); + $this->taglineno = $this->line; + } + } + 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->yypushstate(self::SMARTY); + $this->taglineno = $this->line; + } + } + text { + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } + */ + + /*!lex2php + %statename LITERAL + ldel literal rdel { + $this->literal_cnt++; + $this->token = Smarty_Internal_Templateparser::TP_LITERAL; + } + ldel slash literal rdel { + if ($this->literal_cnt) { + $this->literal_cnt--; + $this->token = Smarty_Internal_Templateparser::TP_LITERAL; + } else { + $this->token = Smarty_Internal_Templateparser::TP_LITERALEND; + $this->yypopstate(); + } + } + text { + $to = strlen($this->data); + preg_match("/{$this->ldel}\/?literal{$this->rdel}/",$this->data,$match,PREG_OFFSET_CAPTURE,$this->counter); + if (isset($match[0][1])) { + $to = $match[0][1]; + } else { + $this->compiler->trigger_template_error ("missing or misspelled literal closing tag"); + } + $this->value = substr($this->data,$this->counter,$to-$this->counter); + $this->token = Smarty_Internal_Templateparser::TP_LITERAL; + } + */ + /*!lex2php + %statename DOUBLEQUOTEDSTRING + ldel if { + 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_LDELIF; + $this->yypushstate(self::SMARTY); + $this->taglineno = $this->line; + } + } + ldel for { + 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_LDELFOR; + $this->yypushstate(self::SMARTY); + $this->taglineno = $this->line; + } + } + ldel foreach { + 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_LDELFOREACH; + $this->yypushstate(self::SMARTY); + $this->taglineno = $this->line; + } + } + ldel literal rdel { + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } + ldel slash literal rdel { + $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->token = Smarty_Internal_Templateparser::TP_LDELSLASH; + $this->yypushstate(self::SMARTY); + $this->taglineno = $this->line; + } + } + 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->yypushstate(self::SMARTY); + $this->taglineno = $this->line; + } + } + double_quote { + $this->token = Smarty_Internal_Templateparser::TP_QUOTE; + $this->yypopstate(); + } + backtickdollar { + $this->token = Smarty_Internal_Templateparser::TP_BACKTICK; + $this->value = substr($this->value,0,-1); + $this->yypushstate(self::SMARTY); + $this->taglineno = $this->line; + } + dollarid { + $this->token = Smarty_Internal_Templateparser::TP_DOLLARID; + } + + dollar { + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } + textdoublequoted { + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } + text { + $to = strlen($this->data); + $this->value = substr($this->data,$this->counter,$to-$this->counter); + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } + */ + /*!lex2php + %statename CHILDBODY + ldel strip rdel { + if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) { + return false; + } else { + $this->token = Smarty_Internal_Templateparser::TP_STRIPON; + } + } + ldel slash strip rdel { + if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) { + return false; + } else { + $this->token = Smarty_Internal_Templateparser::TP_STRIPOFF; + } + } + ldel block { + if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) { + return false; + } else { + $this->yypopstate(); + return true; + } + } + text { + $to = strlen($this->data); + preg_match("/SMARTYldel\s*((\/)?strip\s*SMARTYrdel|block\s+)/",$this->data,$match,PREG_OFFSET_CAPTURE,$this->counter); + if (isset($match[0][1])) { + $to = $match[0][1]; + } + $this->value = substr($this->data,$this->counter,$to-$this->counter); + return false; + } + + */ + /*!lex2php + %statename CHILDBLOCK + 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_BLOCKSOURCE; + } else { + $this->token = Smarty_Internal_Templateparser::TP_BLOCKSOURCE; + $this->yypushstate(self::CHILDLITERAL); + } + } + ldel block { + 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_BLOCKSOURCE; + } else { + $this->yypopstate(); + return true; + } + } + ldel slash block { + 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_BLOCKSOURCE; + } else { + $this->yypopstate(); + return true; + } + } + ldel smartyblockchildparent { + 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_BLOCKSOURCE; + } else { + $this->yypopstate(); + return true; + } + } + text { + $to = strlen($this->data); + preg_match("/SMARTYldel\s*(literal\s*SMARTYrdel|(\/)?block(\s|SMARTYrdel)|[\$]smarty\.block\.(child|parent))/",$this->data,$match,PREG_OFFSET_CAPTURE,$this->counter); + if (isset($match[0][1])) { + $to = $match[0][1]; + } + $this->value = substr($this->data,$this->counter,$to-$this->counter); + $this->token = Smarty_Internal_Templateparser::TP_BLOCKSOURCE; + } + */ + /*!lex2php + %statename CHILDLITERAL + 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_BLOCKSOURCE; + } else { + $this->token = Smarty_Internal_Templateparser::TP_BLOCKSOURCE; + $this->yypushstate(self::CHILDLITERAL); + } + } + ldel slash 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_BLOCKSOURCE; + } else { + $this->token = Smarty_Internal_Templateparser::TP_BLOCKSOURCE; + $this->yypopstate(); + } + } + text { + $to = strlen($this->data); + preg_match("/{$this->ldel}\/?literal\s*{$this->rdel}/",$this->data,$match,PREG_OFFSET_CAPTURE,$this->counter); + if (isset($match[0][1])) { + $to = $match[0][1]; + } else { + $this->compiler->trigger_template_error ("missing or misspelled literal closing tag"); + } + $this->value = substr($this->data,$this->counter,$to-$this->counter); + $this->token = Smarty_Internal_Templateparser::TP_BLOCKSOURCE; + } + */ + } + +
\ No newline at end of file |
