3 +---------------------------------------------------------------------------------+
4 | Copyright (c) 2010 Haanga |
5 +---------------------------------------------------------------------------------+
6 | Redistribution and use in source and binary forms, with or without |
7 | modification, are permitted provided that the following conditions are met: |
8 | 1. Redistributions of source code must retain the above copyright |
9 | notice, this list of conditions and the following disclaimer. |
11 | 2. Redistributions in binary form must reproduce the above copyright |
12 | notice, this list of conditions and the following disclaimer in the |
13 | documentation and/or other materials provided with the distribution. |
15 | 3. All advertising materials mentioning features or use of this software |
16 | must display the following acknowledgement: |
17 | This product includes software developed by César D. Rodas. |
19 | 4. Neither the name of the César D. Rodas nor the |
20 | names of its contributors may be used to endorse or promote products |
21 | derived from this software without specific prior written permission. |
23 | THIS SOFTWARE IS PROVIDED BY CÉSAR D. RODAS ''AS IS'' AND ANY |
24 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
25 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
26 | DISCLAIMED. IN NO EVENT SHALL CÉSAR D. RODAS BE LIABLE FOR ANY |
27 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
28 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
29 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
30 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
31 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
32 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE |
33 +---------------------------------------------------------------------------------+
34 | Authors: César Rodas <crodas@php.net> |
35 +---------------------------------------------------------------------------------+
38 require dirname(__FILE__
)."/parser.php";
40 function do_parsing($template, $ignore_whitespace=FALSE)
42 $lexer = new Haanga_Lexer($template, $ignore_whitespace);
46 if (!$lexer->yylex()) {
49 //var_dump(array($lexer->token, $lexer->value));
50 $parser->doParse($lexer->token
, $lexer->value
);
52 } catch (Exception
$e) {
53 throw new CompilerException($e->getMessage(). ' on line '.$lexer->getLine());
55 $parser->doParse(0, 0);
67 private $ignore_whitespace;
69 function __construct($data, $whitespace=FALSE)
73 $this->ignore_whitespace
= $whitespace;
82 public $custom_tags=array();
84 function is_custom_tag()
88 $tag = Extensions
::getInstance('Haanga_tag');
90 $value = $tag->isValid($this->value
);
91 $this->token
= $value ?
$value : Parser
::T_ALPHA
;
95 private $_yy_state = 1;
96 private $_yy_stack = array();
100 return $this->{'yylex' . $this->_yy_state
}();
103 function yypushstate($state)
105 array_push($this->_yy_stack
, $this->_yy_state
);
106 $this->_yy_state
= $state;
109 function yypopstate()
111 $this->_yy_state
= array_pop($this->_yy_stack
);
114 function yybegin($state)
116 $this->_yy_state
= $state;
129 if ($this->N
>= strlen($this->data
)) {
130 return false; // end of input
132 $yy_global_pattern = "/^(\\{%)|^(\\{#)|^(\\{\\{)|^(([^{]+(.[^%{#])?)+)/";
135 if (preg_match($yy_global_pattern, substr($this->data
, $this->N
), $yymatches)) {
136 $yysubmatches = $yymatches;
137 $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
138 if (!count($yymatches)) {
139 throw new Exception('Error: lexing failed because a rule matched' .
140 'an empty string. Input "' . substr($this->data
,
141 $this->N
, 5) . '... state IN_HTML');
143 next($yymatches); // skip global match
144 $this->token
= key($yymatches); // token number
145 if ($tokenMap[$this->token
]) {
146 // extract sub-patterns for passing to lex function
147 $yysubmatches = array_slice($yysubmatches, $this->token +
1,
148 $tokenMap[$this->token
]);
150 $yysubmatches = array();
152 $this->value
= current($yymatches); // token value
153 $r = $this->{'yy_r1_' . $this->token
}($yysubmatches);
155 $this->N +
= strlen($this->value
);
156 $this->line +
= substr_count($this->value
, "\n");
159 } elseif ($r === true) {
160 // we have changed state
161 // process this token in the new state
162 return $this->yylex();
163 } elseif ($r === false) {
164 $this->N +
= strlen($this->value
);
165 $this->line +
= substr_count($this->value
, "\n");
166 if ($this->N
>= strlen($this->data
)) {
167 return false; // end of input
171 } else { $yy_yymore_patterns = array(
172 1 => array(0, "^(\\{#)|^(\\{\\{)|^(([^{]+(.[^%{#])?)+)"),
173 2 => array(0, "^(\\{\\{)|^(([^{]+(.[^%{#])?)+)"),
174 3 => array(0, "^(([^{]+(.[^%{#])?)+)"),
180 if (!strlen($yy_yymore_patterns[$this->token
][1])) {
181 throw new Exception('cannot do yymore for the last token');
183 $yysubmatches = array();
184 if (preg_match('/' . $yy_yymore_patterns[$this->token
][1] . '/',
185 substr($this->data
, $this->N
), $yymatches)) {
186 $yysubmatches = $yymatches;
187 $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
188 next($yymatches); // skip global match
189 $this->token +
= key($yymatches) +
$yy_yymore_patterns[$this->token
][0]; // token number
190 $this->value
= current($yymatches); // token value
191 $this->line
= substr_count($this->value
, "\n");
192 if ($tokenMap[$this->token
]) {
193 // extract sub-patterns for passing to lex function
194 $yysubmatches = array_slice($yysubmatches, $this->token +
1,
195 $tokenMap[$this->token
]);
197 $yysubmatches = array();
200 $r = $this->{'yy_r1_' . $this->token
}($yysubmatches);
201 } while ($r !== null && !is_bool($r));
203 // we have changed state
204 // process this token in the new state
205 return $this->yylex();
206 } elseif ($r === false) {
207 $this->N +
= strlen($this->value
);
208 $this->line +
= substr_count($this->value
, "\n");
209 if ($this->N
>= strlen($this->data
)) {
210 return false; // end of input
216 $this->N +
= strlen($this->value
);
217 $this->line +
= substr_count($this->value
, "\n");
222 throw new Exception('Unexpected input at line' . $this->line
.
223 ': ' . $this->data
[$this->N
]);
232 function yy_r1_1($yy_subpatterns)
235 $this->token
= Parser
::T_OPEN_TAG
;
236 $this->yypushstate(self
::IN_CODE
);
238 function yy_r1_2($yy_subpatterns)
241 $this->token
= Parser
::T_COMMENT_OPEN
;
242 $this->yypushstate(self
::IN_COMMENT
);
244 function yy_r1_3($yy_subpatterns)
247 $this->token
= Parser
::T_PRINT_OPEN
;
248 $this->yypushstate(self
::IN_PRINT
);
250 function yy_r1_4($yy_subpatterns)
253 $this->token
= Parser
::T_HTML
;
317 if ($this->N
>= strlen($this->data
)) {
318 return false; // end of input
320 $yy_global_pattern = "/^(%\\})|^(\\.)|^(for[^a-zA-Z0-9])|^(empty[^a-zA-Z0-9])|^(firstof[^a-zA-Z0-9])|^(block[^a-zA-Z0-9])|^(&&)|^(AND)|^(\\|\\|)|^(OR)|^(==)|^(!=)|^(>=)|^(\\[)|^(\\])|^(>)|^(<)|^(=<)|^(\\|)|^(:)|^(filter[^a-zA-Z0-9])|^(regroup[^a-zA-Z0-9])|^(endfilter[^a-zA-Z0-9])|^(autoescape[^a-zA-Z0-9])|^(endautoescape[^a-zA-Z0-9])|^(endblock[^a-zA-Z0-9])|^(ifchanged[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endifchanged[^a-zA-Z0-9])|^(in[^a-zA-Z0-9])|^(endfor[^a-zA-Z0-9])|^(with[^a-zA-Z0-9])|^(endwith[^a-zA-Z0-9])|^(as)|^(on)|^(off)|^(by)|^(if[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)/";
323 if (preg_match($yy_global_pattern, substr($this->data
, $this->N
), $yymatches)) {
324 $yysubmatches = $yymatches;
325 $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
326 if (!count($yymatches)) {
327 throw new Exception('Error: lexing failed because a rule matched' .
328 'an empty string. Input "' . substr($this->data
,
329 $this->N
, 5) . '... state IN_CODE');
331 next($yymatches); // skip global match
332 $this->token
= key($yymatches); // token number
333 if ($tokenMap[$this->token
]) {
334 // extract sub-patterns for passing to lex function
335 $yysubmatches = array_slice($yysubmatches, $this->token +
1,
336 $tokenMap[$this->token
]);
338 $yysubmatches = array();
340 $this->value
= current($yymatches); // token value
341 $r = $this->{'yy_r2_' . $this->token
}($yysubmatches);
343 $this->N +
= strlen($this->value
);
344 $this->line +
= substr_count($this->value
, "\n");
347 } elseif ($r === true) {
348 // we have changed state
349 // process this token in the new state
350 return $this->yylex();
351 } elseif ($r === false) {
352 $this->N +
= strlen($this->value
);
353 $this->line +
= substr_count($this->value
, "\n");
354 if ($this->N
>= strlen($this->data
)) {
355 return false; // end of input
359 } else { $yy_yymore_patterns = array(
360 1 => array(0, "^(\\.)|^(for[^a-zA-Z0-9])|^(empty[^a-zA-Z0-9])|^(firstof[^a-zA-Z0-9])|^(block[^a-zA-Z0-9])|^(&&)|^(AND)|^(\\|\\|)|^(OR)|^(==)|^(!=)|^(>=)|^(\\[)|^(\\])|^(>)|^(<)|^(=<)|^(\\|)|^(:)|^(filter[^a-zA-Z0-9])|^(regroup[^a-zA-Z0-9])|^(endfilter[^a-zA-Z0-9])|^(autoescape[^a-zA-Z0-9])|^(endautoescape[^a-zA-Z0-9])|^(endblock[^a-zA-Z0-9])|^(ifchanged[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endifchanged[^a-zA-Z0-9])|^(in[^a-zA-Z0-9])|^(endfor[^a-zA-Z0-9])|^(with[^a-zA-Z0-9])|^(endwith[^a-zA-Z0-9])|^(as)|^(on)|^(off)|^(by)|^(if[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
361 2 => array(0, "^(for[^a-zA-Z0-9])|^(empty[^a-zA-Z0-9])|^(firstof[^a-zA-Z0-9])|^(block[^a-zA-Z0-9])|^(&&)|^(AND)|^(\\|\\|)|^(OR)|^(==)|^(!=)|^(>=)|^(\\[)|^(\\])|^(>)|^(<)|^(=<)|^(\\|)|^(:)|^(filter[^a-zA-Z0-9])|^(regroup[^a-zA-Z0-9])|^(endfilter[^a-zA-Z0-9])|^(autoescape[^a-zA-Z0-9])|^(endautoescape[^a-zA-Z0-9])|^(endblock[^a-zA-Z0-9])|^(ifchanged[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endifchanged[^a-zA-Z0-9])|^(in[^a-zA-Z0-9])|^(endfor[^a-zA-Z0-9])|^(with[^a-zA-Z0-9])|^(endwith[^a-zA-Z0-9])|^(as)|^(on)|^(off)|^(by)|^(if[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
362 3 => array(0, "^(empty[^a-zA-Z0-9])|^(firstof[^a-zA-Z0-9])|^(block[^a-zA-Z0-9])|^(&&)|^(AND)|^(\\|\\|)|^(OR)|^(==)|^(!=)|^(>=)|^(\\[)|^(\\])|^(>)|^(<)|^(=<)|^(\\|)|^(:)|^(filter[^a-zA-Z0-9])|^(regroup[^a-zA-Z0-9])|^(endfilter[^a-zA-Z0-9])|^(autoescape[^a-zA-Z0-9])|^(endautoescape[^a-zA-Z0-9])|^(endblock[^a-zA-Z0-9])|^(ifchanged[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endifchanged[^a-zA-Z0-9])|^(in[^a-zA-Z0-9])|^(endfor[^a-zA-Z0-9])|^(with[^a-zA-Z0-9])|^(endwith[^a-zA-Z0-9])|^(as)|^(on)|^(off)|^(by)|^(if[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
363 4 => array(0, "^(firstof[^a-zA-Z0-9])|^(block[^a-zA-Z0-9])|^(&&)|^(AND)|^(\\|\\|)|^(OR)|^(==)|^(!=)|^(>=)|^(\\[)|^(\\])|^(>)|^(<)|^(=<)|^(\\|)|^(:)|^(filter[^a-zA-Z0-9])|^(regroup[^a-zA-Z0-9])|^(endfilter[^a-zA-Z0-9])|^(autoescape[^a-zA-Z0-9])|^(endautoescape[^a-zA-Z0-9])|^(endblock[^a-zA-Z0-9])|^(ifchanged[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endifchanged[^a-zA-Z0-9])|^(in[^a-zA-Z0-9])|^(endfor[^a-zA-Z0-9])|^(with[^a-zA-Z0-9])|^(endwith[^a-zA-Z0-9])|^(as)|^(on)|^(off)|^(by)|^(if[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
364 5 => array(0, "^(block[^a-zA-Z0-9])|^(&&)|^(AND)|^(\\|\\|)|^(OR)|^(==)|^(!=)|^(>=)|^(\\[)|^(\\])|^(>)|^(<)|^(=<)|^(\\|)|^(:)|^(filter[^a-zA-Z0-9])|^(regroup[^a-zA-Z0-9])|^(endfilter[^a-zA-Z0-9])|^(autoescape[^a-zA-Z0-9])|^(endautoescape[^a-zA-Z0-9])|^(endblock[^a-zA-Z0-9])|^(ifchanged[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endifchanged[^a-zA-Z0-9])|^(in[^a-zA-Z0-9])|^(endfor[^a-zA-Z0-9])|^(with[^a-zA-Z0-9])|^(endwith[^a-zA-Z0-9])|^(as)|^(on)|^(off)|^(by)|^(if[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
365 6 => array(0, "^(&&)|^(AND)|^(\\|\\|)|^(OR)|^(==)|^(!=)|^(>=)|^(\\[)|^(\\])|^(>)|^(<)|^(=<)|^(\\|)|^(:)|^(filter[^a-zA-Z0-9])|^(regroup[^a-zA-Z0-9])|^(endfilter[^a-zA-Z0-9])|^(autoescape[^a-zA-Z0-9])|^(endautoescape[^a-zA-Z0-9])|^(endblock[^a-zA-Z0-9])|^(ifchanged[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endifchanged[^a-zA-Z0-9])|^(in[^a-zA-Z0-9])|^(endfor[^a-zA-Z0-9])|^(with[^a-zA-Z0-9])|^(endwith[^a-zA-Z0-9])|^(as)|^(on)|^(off)|^(by)|^(if[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
366 7 => array(0, "^(AND)|^(\\|\\|)|^(OR)|^(==)|^(!=)|^(>=)|^(\\[)|^(\\])|^(>)|^(<)|^(=<)|^(\\|)|^(:)|^(filter[^a-zA-Z0-9])|^(regroup[^a-zA-Z0-9])|^(endfilter[^a-zA-Z0-9])|^(autoescape[^a-zA-Z0-9])|^(endautoescape[^a-zA-Z0-9])|^(endblock[^a-zA-Z0-9])|^(ifchanged[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endifchanged[^a-zA-Z0-9])|^(in[^a-zA-Z0-9])|^(endfor[^a-zA-Z0-9])|^(with[^a-zA-Z0-9])|^(endwith[^a-zA-Z0-9])|^(as)|^(on)|^(off)|^(by)|^(if[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
367 8 => array(0, "^(\\|\\|)|^(OR)|^(==)|^(!=)|^(>=)|^(\\[)|^(\\])|^(>)|^(<)|^(=<)|^(\\|)|^(:)|^(filter[^a-zA-Z0-9])|^(regroup[^a-zA-Z0-9])|^(endfilter[^a-zA-Z0-9])|^(autoescape[^a-zA-Z0-9])|^(endautoescape[^a-zA-Z0-9])|^(endblock[^a-zA-Z0-9])|^(ifchanged[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endifchanged[^a-zA-Z0-9])|^(in[^a-zA-Z0-9])|^(endfor[^a-zA-Z0-9])|^(with[^a-zA-Z0-9])|^(endwith[^a-zA-Z0-9])|^(as)|^(on)|^(off)|^(by)|^(if[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
368 9 => array(0, "^(OR)|^(==)|^(!=)|^(>=)|^(\\[)|^(\\])|^(>)|^(<)|^(=<)|^(\\|)|^(:)|^(filter[^a-zA-Z0-9])|^(regroup[^a-zA-Z0-9])|^(endfilter[^a-zA-Z0-9])|^(autoescape[^a-zA-Z0-9])|^(endautoescape[^a-zA-Z0-9])|^(endblock[^a-zA-Z0-9])|^(ifchanged[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endifchanged[^a-zA-Z0-9])|^(in[^a-zA-Z0-9])|^(endfor[^a-zA-Z0-9])|^(with[^a-zA-Z0-9])|^(endwith[^a-zA-Z0-9])|^(as)|^(on)|^(off)|^(by)|^(if[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
369 10 => array(0, "^(==)|^(!=)|^(>=)|^(\\[)|^(\\])|^(>)|^(<)|^(=<)|^(\\|)|^(:)|^(filter[^a-zA-Z0-9])|^(regroup[^a-zA-Z0-9])|^(endfilter[^a-zA-Z0-9])|^(autoescape[^a-zA-Z0-9])|^(endautoescape[^a-zA-Z0-9])|^(endblock[^a-zA-Z0-9])|^(ifchanged[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endifchanged[^a-zA-Z0-9])|^(in[^a-zA-Z0-9])|^(endfor[^a-zA-Z0-9])|^(with[^a-zA-Z0-9])|^(endwith[^a-zA-Z0-9])|^(as)|^(on)|^(off)|^(by)|^(if[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
370 11 => array(0, "^(!=)|^(>=)|^(\\[)|^(\\])|^(>)|^(<)|^(=<)|^(\\|)|^(:)|^(filter[^a-zA-Z0-9])|^(regroup[^a-zA-Z0-9])|^(endfilter[^a-zA-Z0-9])|^(autoescape[^a-zA-Z0-9])|^(endautoescape[^a-zA-Z0-9])|^(endblock[^a-zA-Z0-9])|^(ifchanged[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endifchanged[^a-zA-Z0-9])|^(in[^a-zA-Z0-9])|^(endfor[^a-zA-Z0-9])|^(with[^a-zA-Z0-9])|^(endwith[^a-zA-Z0-9])|^(as)|^(on)|^(off)|^(by)|^(if[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
371 12 => array(0, "^(>=)|^(\\[)|^(\\])|^(>)|^(<)|^(=<)|^(\\|)|^(:)|^(filter[^a-zA-Z0-9])|^(regroup[^a-zA-Z0-9])|^(endfilter[^a-zA-Z0-9])|^(autoescape[^a-zA-Z0-9])|^(endautoescape[^a-zA-Z0-9])|^(endblock[^a-zA-Z0-9])|^(ifchanged[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endifchanged[^a-zA-Z0-9])|^(in[^a-zA-Z0-9])|^(endfor[^a-zA-Z0-9])|^(with[^a-zA-Z0-9])|^(endwith[^a-zA-Z0-9])|^(as)|^(on)|^(off)|^(by)|^(if[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
372 13 => array(0, "^(\\[)|^(\\])|^(>)|^(<)|^(=<)|^(\\|)|^(:)|^(filter[^a-zA-Z0-9])|^(regroup[^a-zA-Z0-9])|^(endfilter[^a-zA-Z0-9])|^(autoescape[^a-zA-Z0-9])|^(endautoescape[^a-zA-Z0-9])|^(endblock[^a-zA-Z0-9])|^(ifchanged[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endifchanged[^a-zA-Z0-9])|^(in[^a-zA-Z0-9])|^(endfor[^a-zA-Z0-9])|^(with[^a-zA-Z0-9])|^(endwith[^a-zA-Z0-9])|^(as)|^(on)|^(off)|^(by)|^(if[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
373 14 => array(0, "^(\\])|^(>)|^(<)|^(=<)|^(\\|)|^(:)|^(filter[^a-zA-Z0-9])|^(regroup[^a-zA-Z0-9])|^(endfilter[^a-zA-Z0-9])|^(autoescape[^a-zA-Z0-9])|^(endautoescape[^a-zA-Z0-9])|^(endblock[^a-zA-Z0-9])|^(ifchanged[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endifchanged[^a-zA-Z0-9])|^(in[^a-zA-Z0-9])|^(endfor[^a-zA-Z0-9])|^(with[^a-zA-Z0-9])|^(endwith[^a-zA-Z0-9])|^(as)|^(on)|^(off)|^(by)|^(if[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
374 15 => array(0, "^(>)|^(<)|^(=<)|^(\\|)|^(:)|^(filter[^a-zA-Z0-9])|^(regroup[^a-zA-Z0-9])|^(endfilter[^a-zA-Z0-9])|^(autoescape[^a-zA-Z0-9])|^(endautoescape[^a-zA-Z0-9])|^(endblock[^a-zA-Z0-9])|^(ifchanged[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endifchanged[^a-zA-Z0-9])|^(in[^a-zA-Z0-9])|^(endfor[^a-zA-Z0-9])|^(with[^a-zA-Z0-9])|^(endwith[^a-zA-Z0-9])|^(as)|^(on)|^(off)|^(by)|^(if[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
375 16 => array(0, "^(<)|^(=<)|^(\\|)|^(:)|^(filter[^a-zA-Z0-9])|^(regroup[^a-zA-Z0-9])|^(endfilter[^a-zA-Z0-9])|^(autoescape[^a-zA-Z0-9])|^(endautoescape[^a-zA-Z0-9])|^(endblock[^a-zA-Z0-9])|^(ifchanged[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endifchanged[^a-zA-Z0-9])|^(in[^a-zA-Z0-9])|^(endfor[^a-zA-Z0-9])|^(with[^a-zA-Z0-9])|^(endwith[^a-zA-Z0-9])|^(as)|^(on)|^(off)|^(by)|^(if[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
376 17 => array(0, "^(=<)|^(\\|)|^(:)|^(filter[^a-zA-Z0-9])|^(regroup[^a-zA-Z0-9])|^(endfilter[^a-zA-Z0-9])|^(autoescape[^a-zA-Z0-9])|^(endautoescape[^a-zA-Z0-9])|^(endblock[^a-zA-Z0-9])|^(ifchanged[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endifchanged[^a-zA-Z0-9])|^(in[^a-zA-Z0-9])|^(endfor[^a-zA-Z0-9])|^(with[^a-zA-Z0-9])|^(endwith[^a-zA-Z0-9])|^(as)|^(on)|^(off)|^(by)|^(if[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
377 18 => array(0, "^(\\|)|^(:)|^(filter[^a-zA-Z0-9])|^(regroup[^a-zA-Z0-9])|^(endfilter[^a-zA-Z0-9])|^(autoescape[^a-zA-Z0-9])|^(endautoescape[^a-zA-Z0-9])|^(endblock[^a-zA-Z0-9])|^(ifchanged[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endifchanged[^a-zA-Z0-9])|^(in[^a-zA-Z0-9])|^(endfor[^a-zA-Z0-9])|^(with[^a-zA-Z0-9])|^(endwith[^a-zA-Z0-9])|^(as)|^(on)|^(off)|^(by)|^(if[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
378 19 => array(0, "^(:)|^(filter[^a-zA-Z0-9])|^(regroup[^a-zA-Z0-9])|^(endfilter[^a-zA-Z0-9])|^(autoescape[^a-zA-Z0-9])|^(endautoescape[^a-zA-Z0-9])|^(endblock[^a-zA-Z0-9])|^(ifchanged[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endifchanged[^a-zA-Z0-9])|^(in[^a-zA-Z0-9])|^(endfor[^a-zA-Z0-9])|^(with[^a-zA-Z0-9])|^(endwith[^a-zA-Z0-9])|^(as)|^(on)|^(off)|^(by)|^(if[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
379 20 => array(0, "^(filter[^a-zA-Z0-9])|^(regroup[^a-zA-Z0-9])|^(endfilter[^a-zA-Z0-9])|^(autoescape[^a-zA-Z0-9])|^(endautoescape[^a-zA-Z0-9])|^(endblock[^a-zA-Z0-9])|^(ifchanged[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endifchanged[^a-zA-Z0-9])|^(in[^a-zA-Z0-9])|^(endfor[^a-zA-Z0-9])|^(with[^a-zA-Z0-9])|^(endwith[^a-zA-Z0-9])|^(as)|^(on)|^(off)|^(by)|^(if[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
380 21 => array(0, "^(regroup[^a-zA-Z0-9])|^(endfilter[^a-zA-Z0-9])|^(autoescape[^a-zA-Z0-9])|^(endautoescape[^a-zA-Z0-9])|^(endblock[^a-zA-Z0-9])|^(ifchanged[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endifchanged[^a-zA-Z0-9])|^(in[^a-zA-Z0-9])|^(endfor[^a-zA-Z0-9])|^(with[^a-zA-Z0-9])|^(endwith[^a-zA-Z0-9])|^(as)|^(on)|^(off)|^(by)|^(if[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
381 22 => array(0, "^(endfilter[^a-zA-Z0-9])|^(autoescape[^a-zA-Z0-9])|^(endautoescape[^a-zA-Z0-9])|^(endblock[^a-zA-Z0-9])|^(ifchanged[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endifchanged[^a-zA-Z0-9])|^(in[^a-zA-Z0-9])|^(endfor[^a-zA-Z0-9])|^(with[^a-zA-Z0-9])|^(endwith[^a-zA-Z0-9])|^(as)|^(on)|^(off)|^(by)|^(if[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
382 23 => array(0, "^(autoescape[^a-zA-Z0-9])|^(endautoescape[^a-zA-Z0-9])|^(endblock[^a-zA-Z0-9])|^(ifchanged[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endifchanged[^a-zA-Z0-9])|^(in[^a-zA-Z0-9])|^(endfor[^a-zA-Z0-9])|^(with[^a-zA-Z0-9])|^(endwith[^a-zA-Z0-9])|^(as)|^(on)|^(off)|^(by)|^(if[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
383 24 => array(0, "^(endautoescape[^a-zA-Z0-9])|^(endblock[^a-zA-Z0-9])|^(ifchanged[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endifchanged[^a-zA-Z0-9])|^(in[^a-zA-Z0-9])|^(endfor[^a-zA-Z0-9])|^(with[^a-zA-Z0-9])|^(endwith[^a-zA-Z0-9])|^(as)|^(on)|^(off)|^(by)|^(if[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
384 25 => array(0, "^(endblock[^a-zA-Z0-9])|^(ifchanged[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endifchanged[^a-zA-Z0-9])|^(in[^a-zA-Z0-9])|^(endfor[^a-zA-Z0-9])|^(with[^a-zA-Z0-9])|^(endwith[^a-zA-Z0-9])|^(as)|^(on)|^(off)|^(by)|^(if[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
385 26 => array(0, "^(ifchanged[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endifchanged[^a-zA-Z0-9])|^(in[^a-zA-Z0-9])|^(endfor[^a-zA-Z0-9])|^(with[^a-zA-Z0-9])|^(endwith[^a-zA-Z0-9])|^(as)|^(on)|^(off)|^(by)|^(if[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
386 27 => array(0, "^(else[^a-zA-Z0-9])|^(endifchanged[^a-zA-Z0-9])|^(in[^a-zA-Z0-9])|^(endfor[^a-zA-Z0-9])|^(with[^a-zA-Z0-9])|^(endwith[^a-zA-Z0-9])|^(as)|^(on)|^(off)|^(by)|^(if[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
387 28 => array(0, "^(endifchanged[^a-zA-Z0-9])|^(in[^a-zA-Z0-9])|^(endfor[^a-zA-Z0-9])|^(with[^a-zA-Z0-9])|^(endwith[^a-zA-Z0-9])|^(as)|^(on)|^(off)|^(by)|^(if[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
388 29 => array(0, "^(in[^a-zA-Z0-9])|^(endfor[^a-zA-Z0-9])|^(with[^a-zA-Z0-9])|^(endwith[^a-zA-Z0-9])|^(as)|^(on)|^(off)|^(by)|^(if[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
389 30 => array(0, "^(endfor[^a-zA-Z0-9])|^(with[^a-zA-Z0-9])|^(endwith[^a-zA-Z0-9])|^(as)|^(on)|^(off)|^(by)|^(if[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
390 31 => array(0, "^(with[^a-zA-Z0-9])|^(endwith[^a-zA-Z0-9])|^(as)|^(on)|^(off)|^(by)|^(if[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
391 32 => array(0, "^(endwith[^a-zA-Z0-9])|^(as)|^(on)|^(off)|^(by)|^(if[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
392 33 => array(0, "^(as)|^(on)|^(off)|^(by)|^(if[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
393 34 => array(0, "^(on)|^(off)|^(by)|^(if[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
394 35 => array(0, "^(off)|^(by)|^(if[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
395 36 => array(0, "^(by)|^(if[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
396 37 => array(0, "^(if[^a-zA-Z0-9])|^(else[^a-zA-Z0-9])|^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
397 38 => array(0, "^(else[^a-zA-Z0-9])|^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
398 39 => array(0, "^(endif[^a-zA-Z0-9])|^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
399 40 => array(0, "^(\\()|^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
400 41 => array(0, "^(\\))|^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
401 42 => array(0, "^(%)|^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
402 43 => array(0, "^(,)|^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
403 44 => array(0, "^(\\+)|^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
404 45 => array(0, "^(\\*)|^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
405 46 => array(0, "^(\/)|^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
406 47 => array(0, "^(')|^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
407 48 => array(0, "^(\")|^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
408 49 => array(0, "^(end([a-zA-Z][a-zA-Z0-9]*))|^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
409 50 => array(1, "^(extends[^a-zA-Z0-9])|^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
410 52 => array(1, "^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
411 53 => array(1, "^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
412 54 => array(2, "^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
413 56 => array(4, "^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
414 59 => array(5, "^([ \r\t\n]+)"),
420 if (!strlen($yy_yymore_patterns[$this->token
][1])) {
421 throw new Exception('cannot do yymore for the last token');
423 $yysubmatches = array();
424 if (preg_match('/' . $yy_yymore_patterns[$this->token
][1] . '/',
425 substr($this->data
, $this->N
), $yymatches)) {
426 $yysubmatches = $yymatches;
427 $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
428 next($yymatches); // skip global match
429 $this->token +
= key($yymatches) +
$yy_yymore_patterns[$this->token
][0]; // token number
430 $this->value
= current($yymatches); // token value
431 $this->line
= substr_count($this->value
, "\n");
432 if ($tokenMap[$this->token
]) {
433 // extract sub-patterns for passing to lex function
434 $yysubmatches = array_slice($yysubmatches, $this->token +
1,
435 $tokenMap[$this->token
]);
437 $yysubmatches = array();
440 $r = $this->{'yy_r2_' . $this->token
}($yysubmatches);
441 } while ($r !== null && !is_bool($r));
443 // we have changed state
444 // process this token in the new state
445 return $this->yylex();
446 } elseif ($r === false) {
447 $this->N +
= strlen($this->value
);
448 $this->line +
= substr_count($this->value
, "\n");
449 if ($this->N
>= strlen($this->data
)) {
450 return false; // end of input
456 $this->N +
= strlen($this->value
);
457 $this->line +
= substr_count($this->value
, "\n");
462 throw new Exception('Unexpected input at line' . $this->line
.
463 ': ' . $this->data
[$this->N
]);
472 function yy_r2_1($yy_subpatterns)
475 $this->token
= Parser
::T_CLOSE_TAG
;
478 function yy_r2_2($yy_subpatterns)
481 $this->token
= Parser
::T_DOT
;
483 function yy_r2_3($yy_subpatterns)
486 $this->token
= Parser
::T_FOR
;
488 function yy_r2_4($yy_subpatterns)
491 $this->token
= Parser
::T_EMPTY
;
493 function yy_r2_5($yy_subpatterns)
496 $this->token
= Parser
::T_FIRST_OF
;
498 function yy_r2_6($yy_subpatterns)
501 $this->token
= Parser
::T_BLOCK
;
503 function yy_r2_7($yy_subpatterns)
506 $this->token
= Parser
::T_AND
;
508 function yy_r2_8($yy_subpatterns)
511 $this->token
= Parser
::T_AND
;
513 function yy_r2_9($yy_subpatterns)
516 $this->token
= Parser
::T_OR
;
518 function yy_r2_10($yy_subpatterns)
521 $this->token
= Parser
::T_OR
;
523 function yy_r2_11($yy_subpatterns)
526 $this->token
= Parser
::T_EQ
;
528 function yy_r2_12($yy_subpatterns)
531 $this->token
= Parser
::T_NE
;
533 function yy_r2_13($yy_subpatterns)
536 $this->token
= Parser
::T_GE
;
538 function yy_r2_14($yy_subpatterns)
541 $this->token
= Parser
::T_BRACKETS_OPEN
;
543 function yy_r2_15($yy_subpatterns)
546 $this->token
= Parser
::T_BRACKETS_CLOSE
;
548 function yy_r2_16($yy_subpatterns)
551 $this->token
= Parser
::T_GT
;
553 function yy_r2_17($yy_subpatterns)
556 $this->token
= Parser
::T_LT
;
558 function yy_r2_18($yy_subpatterns)
561 $this->token
= Parser
::T_LE
;
563 function yy_r2_19($yy_subpatterns)
566 $this->token
= Parser
::T_PIPE
;
568 function yy_r2_20($yy_subpatterns)
571 $this->token
= Parser
::T_COLON
;
573 function yy_r2_21($yy_subpatterns)
576 $this->token
= Parser
::T_FILTER
;
578 function yy_r2_22($yy_subpatterns)
581 $this->token
= Parser
::T_REGROUP
;
583 function yy_r2_23($yy_subpatterns)
586 $this->token
= Parser
::T_END_FILTER
;
588 function yy_r2_24($yy_subpatterns)
591 $this->token
= Parser
::T_AUTOESCAPE
;
593 function yy_r2_25($yy_subpatterns)
596 $this->token
= Parser
::T_END_AUTOESCAPE
;
598 function yy_r2_26($yy_subpatterns)
601 $this->token
= Parser
::T_END_BLOCK
;
603 function yy_r2_27($yy_subpatterns)
606 $this->token
= Parser
::T_IFCHANGED
;
608 function yy_r2_28($yy_subpatterns)
611 $this->token
= Parser
::T_ELSE
;
613 function yy_r2_29($yy_subpatterns)
616 $this->token
= Parser
::T_ENDIFCHANGED
;
618 function yy_r2_30($yy_subpatterns)
621 $this->token
= Parser
::T_IN
;
623 function yy_r2_31($yy_subpatterns)
626 $this->token
= Parser
::T_CLOSEFOR
;
628 function yy_r2_32($yy_subpatterns)
631 $this->token
= Parser
::T_WITH
;
633 function yy_r2_33($yy_subpatterns)
636 $this->token
= Parser
::T_ENDWITH
;
638 function yy_r2_34($yy_subpatterns)
641 $this->token
= Parser
::T_AS
;
643 function yy_r2_35($yy_subpatterns)
646 $this->token
= Parser
::T_ON
;
648 function yy_r2_36($yy_subpatterns)
651 $this->token
= Parser
::T_OFF
;
653 function yy_r2_37($yy_subpatterns)
656 $this->token
= Parser
::T_BY
;
658 function yy_r2_38($yy_subpatterns)
661 $this->token
= Parser
::T_IF
;
663 function yy_r2_39($yy_subpatterns)
666 $this->token
= Parser
::T_ELSE
;
668 function yy_r2_40($yy_subpatterns)
671 $this->token
= Parser
::T_ENDIF
;
673 function yy_r2_41($yy_subpatterns)
676 $this->token
= Parser
::T_LPARENT
;
678 function yy_r2_42($yy_subpatterns)
681 $this->token
= Parser
::T_RPARENT
;
683 function yy_r2_43($yy_subpatterns)
686 $this->token
= Parser
::T_MOD
;
688 function yy_r2_44($yy_subpatterns)
691 $this->token
= Parser
::T_COMMA
;
693 function yy_r2_45($yy_subpatterns)
696 $this->token
= Parser
::T_PLUS
;
698 function yy_r2_46($yy_subpatterns)
701 $this->token
= Parser
::T_TIMES
;
703 function yy_r2_47($yy_subpatterns)
706 $this->token
= Parser
::T_DIV
;
708 function yy_r2_48($yy_subpatterns)
711 $this->token
= Parser
::T_STRING_SINGLE_INIT
;
712 $this->yypushstate(self
::IN_STRING_SINGLE
);
714 function yy_r2_49($yy_subpatterns)
717 $this->token
= Parser
::T_STRING_DOUBLE_INIT
;
718 $this->yypushstate(self
::IN_STRING_DOUBLE
);
720 function yy_r2_50($yy_subpatterns)
723 $this->token
= Parser
::T_CUSTOM_END
;
725 function yy_r2_52($yy_subpatterns)
728 $this->token
= Parser
::T_EXTENDS
;
730 function yy_r2_53($yy_subpatterns)
733 $this->token
= Parser
::T_INCLUDE
;
735 function yy_r2_54($yy_subpatterns)
738 $this->token
= Parser
::T_NUMERIC
;
740 function yy_r2_56($yy_subpatterns)
743 $this->token
= Parser
::T_NUMERIC
;
745 function yy_r2_59($yy_subpatterns)
748 $this->is_custom_tag();
750 function yy_r2_61($yy_subpatterns)
773 if ($this->N
>= strlen($this->data
)) {
774 return false; // end of input
776 $yy_global_pattern = "/^(\\}\\})|^(\\|)|^(:)|^(\\.)|^(\\[)|^(\\])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(')|^(\")|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)/";
779 if (preg_match($yy_global_pattern, substr($this->data
, $this->N
), $yymatches)) {
780 $yysubmatches = $yymatches;
781 $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
782 if (!count($yymatches)) {
783 throw new Exception('Error: lexing failed because a rule matched' .
784 'an empty string. Input "' . substr($this->data
,
785 $this->N
, 5) . '... state IN_PRINT');
787 next($yymatches); // skip global match
788 $this->token
= key($yymatches); // token number
789 if ($tokenMap[$this->token
]) {
790 // extract sub-patterns for passing to lex function
791 $yysubmatches = array_slice($yysubmatches, $this->token +
1,
792 $tokenMap[$this->token
]);
794 $yysubmatches = array();
796 $this->value
= current($yymatches); // token value
797 $r = $this->{'yy_r3_' . $this->token
}($yysubmatches);
799 $this->N +
= strlen($this->value
);
800 $this->line +
= substr_count($this->value
, "\n");
803 } elseif ($r === true) {
804 // we have changed state
805 // process this token in the new state
806 return $this->yylex();
807 } elseif ($r === false) {
808 $this->N +
= strlen($this->value
);
809 $this->line +
= substr_count($this->value
, "\n");
810 if ($this->N
>= strlen($this->data
)) {
811 return false; // end of input
815 } else { $yy_yymore_patterns = array(
816 1 => array(0, "^(\\|)|^(:)|^(\\.)|^(\\[)|^(\\])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(')|^(\")|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
817 2 => array(0, "^(:)|^(\\.)|^(\\[)|^(\\])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(')|^(\")|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
818 3 => array(0, "^(\\.)|^(\\[)|^(\\])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(')|^(\")|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
819 4 => array(0, "^(\\[)|^(\\])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(')|^(\")|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
820 5 => array(0, "^(\\])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(')|^(\")|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
821 6 => array(0, "^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(')|^(\")|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
822 7 => array(1, "^(([0-9])+\\.([0-9])+)|^(')|^(\")|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
823 9 => array(3, "^(')|^(\")|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
824 12 => array(3, "^(\")|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
825 13 => array(3, "^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
826 14 => array(4, "^([ \r\t\n]+)"),
832 if (!strlen($yy_yymore_patterns[$this->token
][1])) {
833 throw new Exception('cannot do yymore for the last token');
835 $yysubmatches = array();
836 if (preg_match('/' . $yy_yymore_patterns[$this->token
][1] . '/',
837 substr($this->data
, $this->N
), $yymatches)) {
838 $yysubmatches = $yymatches;
839 $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
840 next($yymatches); // skip global match
841 $this->token +
= key($yymatches) +
$yy_yymore_patterns[$this->token
][0]; // token number
842 $this->value
= current($yymatches); // token value
843 $this->line
= substr_count($this->value
, "\n");
844 if ($tokenMap[$this->token
]) {
845 // extract sub-patterns for passing to lex function
846 $yysubmatches = array_slice($yysubmatches, $this->token +
1,
847 $tokenMap[$this->token
]);
849 $yysubmatches = array();
852 $r = $this->{'yy_r3_' . $this->token
}($yysubmatches);
853 } while ($r !== null && !is_bool($r));
855 // we have changed state
856 // process this token in the new state
857 return $this->yylex();
858 } elseif ($r === false) {
859 $this->N +
= strlen($this->value
);
860 $this->line +
= substr_count($this->value
, "\n");
861 if ($this->N
>= strlen($this->data
)) {
862 return false; // end of input
868 $this->N +
= strlen($this->value
);
869 $this->line +
= substr_count($this->value
, "\n");
874 throw new Exception('Unexpected input at line' . $this->line
.
875 ': ' . $this->data
[$this->N
]);
884 function yy_r3_1($yy_subpatterns)
887 $this->token
= Parser
::T_PRINT_CLOSE
;
890 function yy_r3_2($yy_subpatterns)
893 $this->token
= Parser
::T_PIPE
;
895 function yy_r3_3($yy_subpatterns)
898 $this->token
= Parser
::T_COLON
;
900 function yy_r3_4($yy_subpatterns)
903 $this->token
= Parser
::T_DOT
;
905 function yy_r3_5($yy_subpatterns)
908 $this->token
= Parser
::T_BRACKETS_OPEN
;
910 function yy_r3_6($yy_subpatterns)
913 $this->token
= Parser
::T_BRACKETS_CLOSE
;
915 function yy_r3_7($yy_subpatterns)
918 $this->token
= Parser
::T_NUMERIC
;
920 function yy_r3_9($yy_subpatterns)
923 $this->token
= Parser
::T_NUMERIC
;
925 function yy_r3_12($yy_subpatterns)
928 $this->token
= Parser
::T_STRING_SINGLE_INIT
;
929 $this->yypushstate(self
::IN_STRING_SINGLE
);
931 function yy_r3_13($yy_subpatterns)
934 $this->token
= Parser
::T_STRING_DOUBLE_INIT
;
935 $this->yypushstate(self
::IN_STRING_DOUBLE
);
937 function yy_r3_14($yy_subpatterns)
940 $this->token
= Parser
::T_ALPHA
;
942 function yy_r3_16($yy_subpatterns)
958 if ($this->N
>= strlen($this->data
)) {
959 return false; // end of input
961 $yy_global_pattern = "/^(\\\\\")|^(\\\\')|^(\")|^([^\"\\\\]+)/";
964 if (preg_match($yy_global_pattern, substr($this->data
, $this->N
), $yymatches)) {
965 $yysubmatches = $yymatches;
966 $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
967 if (!count($yymatches)) {
968 throw new Exception('Error: lexing failed because a rule matched' .
969 'an empty string. Input "' . substr($this->data
,
970 $this->N
, 5) . '... state IN_STRING_DOUBLE');
972 next($yymatches); // skip global match
973 $this->token
= key($yymatches); // token number
974 if ($tokenMap[$this->token
]) {
975 // extract sub-patterns for passing to lex function
976 $yysubmatches = array_slice($yysubmatches, $this->token +
1,
977 $tokenMap[$this->token
]);
979 $yysubmatches = array();
981 $this->value
= current($yymatches); // token value
982 $r = $this->{'yy_r4_' . $this->token
}($yysubmatches);
984 $this->N +
= strlen($this->value
);
985 $this->line +
= substr_count($this->value
, "\n");
988 } elseif ($r === true) {
989 // we have changed state
990 // process this token in the new state
991 return $this->yylex();
992 } elseif ($r === false) {
993 $this->N +
= strlen($this->value
);
994 $this->line +
= substr_count($this->value
, "\n");
995 if ($this->N
>= strlen($this->data
)) {
996 return false; // end of input
1000 } else { $yy_yymore_patterns = array(
1001 1 => array(0, "^(\\\\')|^(\")|^([^\"\\\\]+)"),
1002 2 => array(0, "^(\")|^([^\"\\\\]+)"),
1003 3 => array(0, "^([^\"\\\\]+)"),
1009 if (!strlen($yy_yymore_patterns[$this->token
][1])) {
1010 throw new Exception('cannot do yymore for the last token');
1012 $yysubmatches = array();
1013 if (preg_match('/' . $yy_yymore_patterns[$this->token
][1] . '/',
1014 substr($this->data
, $this->N
), $yymatches)) {
1015 $yysubmatches = $yymatches;
1016 $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
1017 next($yymatches); // skip global match
1018 $this->token +
= key($yymatches) +
$yy_yymore_patterns[$this->token
][0]; // token number
1019 $this->value
= current($yymatches); // token value
1020 $this->line
= substr_count($this->value
, "\n");
1021 if ($tokenMap[$this->token
]) {
1022 // extract sub-patterns for passing to lex function
1023 $yysubmatches = array_slice($yysubmatches, $this->token +
1,
1024 $tokenMap[$this->token
]);
1026 $yysubmatches = array();
1029 $r = $this->{'yy_r4_' . $this->token
}($yysubmatches);
1030 } while ($r !== null && !is_bool($r));
1032 // we have changed state
1033 // process this token in the new state
1034 return $this->yylex();
1035 } elseif ($r === false) {
1036 $this->N +
= strlen($this->value
);
1037 $this->line +
= substr_count($this->value
, "\n");
1038 if ($this->N
>= strlen($this->data
)) {
1039 return false; // end of input
1045 $this->N +
= strlen($this->value
);
1046 $this->line +
= substr_count($this->value
, "\n");
1051 throw new Exception('Unexpected input at line' . $this->line
.
1052 ': ' . $this->data
[$this->N
]);
1060 const IN_STRING_DOUBLE
= 4;
1061 function yy_r4_1($yy_subpatterns)
1064 $this->token
= Parser
::T_STRING_CONTENT
;
1065 $this->value
= "\"";
1068 function yy_r4_2($yy_subpatterns)
1071 $this->token
= Parser
::T_STRING_CONTENT
;
1075 function yy_r4_3($yy_subpatterns)
1078 $this->token
= Parser
::T_STRING_DOUBLE_END
;
1079 $this->yypopstate();
1081 function yy_r4_4($yy_subpatterns)
1084 $this->token
= Parser
::T_STRING_CONTENT
;
1097 if ($this->N
>= strlen($this->data
)) {
1098 return false; // end of input
1100 $yy_global_pattern = "/^(\\\\')|^(\\\\\")|^(')|^([^'\\\\]+)/";
1103 if (preg_match($yy_global_pattern, substr($this->data
, $this->N
), $yymatches)) {
1104 $yysubmatches = $yymatches;
1105 $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
1106 if (!count($yymatches)) {
1107 throw new Exception('Error: lexing failed because a rule matched' .
1108 'an empty string. Input "' . substr($this->data
,
1109 $this->N
, 5) . '... state IN_STRING_SINGLE');
1111 next($yymatches); // skip global match
1112 $this->token
= key($yymatches); // token number
1113 if ($tokenMap[$this->token
]) {
1114 // extract sub-patterns for passing to lex function
1115 $yysubmatches = array_slice($yysubmatches, $this->token +
1,
1116 $tokenMap[$this->token
]);
1118 $yysubmatches = array();
1120 $this->value
= current($yymatches); // token value
1121 $r = $this->{'yy_r5_' . $this->token
}($yysubmatches);
1123 $this->N +
= strlen($this->value
);
1124 $this->line +
= substr_count($this->value
, "\n");
1125 // accept this token
1127 } elseif ($r === true) {
1128 // we have changed state
1129 // process this token in the new state
1130 return $this->yylex();
1131 } elseif ($r === false) {
1132 $this->N +
= strlen($this->value
);
1133 $this->line +
= substr_count($this->value
, "\n");
1134 if ($this->N
>= strlen($this->data
)) {
1135 return false; // end of input
1139 } else { $yy_yymore_patterns = array(
1140 1 => array(0, "^(\\\\\")|^(')|^([^'\\\\]+)"),
1141 2 => array(0, "^(')|^([^'\\\\]+)"),
1142 3 => array(0, "^([^'\\\\]+)"),
1148 if (!strlen($yy_yymore_patterns[$this->token
][1])) {
1149 throw new Exception('cannot do yymore for the last token');
1151 $yysubmatches = array();
1152 if (preg_match('/' . $yy_yymore_patterns[$this->token
][1] . '/',
1153 substr($this->data
, $this->N
), $yymatches)) {
1154 $yysubmatches = $yymatches;
1155 $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
1156 next($yymatches); // skip global match
1157 $this->token +
= key($yymatches) +
$yy_yymore_patterns[$this->token
][0]; // token number
1158 $this->value
= current($yymatches); // token value
1159 $this->line
= substr_count($this->value
, "\n");
1160 if ($tokenMap[$this->token
]) {
1161 // extract sub-patterns for passing to lex function
1162 $yysubmatches = array_slice($yysubmatches, $this->token +
1,
1163 $tokenMap[$this->token
]);
1165 $yysubmatches = array();
1168 $r = $this->{'yy_r5_' . $this->token
}($yysubmatches);
1169 } while ($r !== null && !is_bool($r));
1171 // we have changed state
1172 // process this token in the new state
1173 return $this->yylex();
1174 } elseif ($r === false) {
1175 $this->N +
= strlen($this->value
);
1176 $this->line +
= substr_count($this->value
, "\n");
1177 if ($this->N
>= strlen($this->data
)) {
1178 return false; // end of input
1184 $this->N +
= strlen($this->value
);
1185 $this->line +
= substr_count($this->value
, "\n");
1190 throw new Exception('Unexpected input at line' . $this->line
.
1191 ': ' . $this->data
[$this->N
]);
1199 const IN_STRING_SINGLE
= 5;
1200 function yy_r5_1($yy_subpatterns)
1203 $this->token
= Parser
::T_STRING_CONTENT
;
1207 function yy_r5_2($yy_subpatterns)
1210 $this->token
= Parser
::T_STRING_CONTENT
;
1211 $this->value
= "\"";
1214 function yy_r5_3($yy_subpatterns)
1217 $this->token
= Parser
::T_STRING_SINGLE_END
;
1218 $this->yypopstate();
1220 function yy_r5_4($yy_subpatterns)
1223 $this->token
= Parser
::T_STRING_CONTENT
;
1233 if ($this->N
>= strlen($this->data
)) {
1234 return false; // end of input
1236 $yy_global_pattern = "/^(([^#]+#\\})+)/";
1239 if (preg_match($yy_global_pattern, substr($this->data
, $this->N
), $yymatches)) {
1240 $yysubmatches = $yymatches;
1241 $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
1242 if (!count($yymatches)) {
1243 throw new Exception('Error: lexing failed because a rule matched' .
1244 'an empty string. Input "' . substr($this->data
,
1245 $this->N
, 5) . '... state IN_COMMENT');
1247 next($yymatches); // skip global match
1248 $this->token
= key($yymatches); // token number
1249 if ($tokenMap[$this->token
]) {
1250 // extract sub-patterns for passing to lex function
1251 $yysubmatches = array_slice($yysubmatches, $this->token +
1,
1252 $tokenMap[$this->token
]);
1254 $yysubmatches = array();
1256 $this->value
= current($yymatches); // token value
1257 $r = $this->{'yy_r6_' . $this->token
}($yysubmatches);
1259 $this->N +
= strlen($this->value
);
1260 $this->line +
= substr_count($this->value
, "\n");
1261 // accept this token
1263 } elseif ($r === true) {
1264 // we have changed state
1265 // process this token in the new state
1266 return $this->yylex();
1267 } elseif ($r === false) {
1268 $this->N +
= strlen($this->value
);
1269 $this->line +
= substr_count($this->value
, "\n");
1270 if ($this->N
>= strlen($this->data
)) {
1271 return false; // end of input
1275 } else { $yy_yymore_patterns = array(
1281 if (!strlen($yy_yymore_patterns[$this->token
][1])) {
1282 throw new Exception('cannot do yymore for the last token');
1284 $yysubmatches = array();
1285 if (preg_match('/' . $yy_yymore_patterns[$this->token
][1] . '/',
1286 substr($this->data
, $this->N
), $yymatches)) {
1287 $yysubmatches = $yymatches;
1288 $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
1289 next($yymatches); // skip global match
1290 $this->token +
= key($yymatches) +
$yy_yymore_patterns[$this->token
][0]; // token number
1291 $this->value
= current($yymatches); // token value
1292 $this->line
= substr_count($this->value
, "\n");
1293 if ($tokenMap[$this->token
]) {
1294 // extract sub-patterns for passing to lex function
1295 $yysubmatches = array_slice($yysubmatches, $this->token +
1,
1296 $tokenMap[$this->token
]);
1298 $yysubmatches = array();
1301 $r = $this->{'yy_r6_' . $this->token
}($yysubmatches);
1302 } while ($r !== null && !is_bool($r));
1304 // we have changed state
1305 // process this token in the new state
1306 return $this->yylex();
1307 } elseif ($r === false) {
1308 $this->N +
= strlen($this->value
);
1309 $this->line +
= substr_count($this->value
, "\n");
1310 if ($this->N
>= strlen($this->data
)) {
1311 return false; // end of input
1317 $this->N +
= strlen($this->value
);
1318 $this->line +
= substr_count($this->value
, "\n");
1323 throw new Exception('Unexpected input at line' . $this->line
.
1324 ': ' . $this->data
[$this->N
]);
1332 const IN_COMMENT
= 6;
1333 function yy_r6_1($yy_subpatterns)
1336 $this->token
= Parser
::T_COMMENT
;
1337 $this->yypopstate();