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 Exception($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
;
318 if ($this->N
>= strlen($this->data
)) {
319 return false; // end of input
321 $yy_global_pattern = "/^(%\\})|^(\\.)|^(for[^a-zA-Z0-9])|^(empty[^a-zA-Z0-9])|^(cycle[^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]+)/";
324 if (preg_match($yy_global_pattern, substr($this->data
, $this->N
), $yymatches)) {
325 $yysubmatches = $yymatches;
326 $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
327 if (!count($yymatches)) {
328 throw new Exception('Error: lexing failed because a rule matched' .
329 'an empty string. Input "' . substr($this->data
,
330 $this->N
, 5) . '... state IN_CODE');
332 next($yymatches); // skip global match
333 $this->token
= key($yymatches); // token number
334 if ($tokenMap[$this->token
]) {
335 // extract sub-patterns for passing to lex function
336 $yysubmatches = array_slice($yysubmatches, $this->token +
1,
337 $tokenMap[$this->token
]);
339 $yysubmatches = array();
341 $this->value
= current($yymatches); // token value
342 $r = $this->{'yy_r2_' . $this->token
}($yysubmatches);
344 $this->N +
= strlen($this->value
);
345 $this->line +
= substr_count($this->value
, "\n");
348 } elseif ($r === true) {
349 // we have changed state
350 // process this token in the new state
351 return $this->yylex();
352 } elseif ($r === false) {
353 $this->N +
= strlen($this->value
);
354 $this->line +
= substr_count($this->value
, "\n");
355 if ($this->N
>= strlen($this->data
)) {
356 return false; // end of input
360 } else { $yy_yymore_patterns = array(
361 1 => array(0, "^(\\.)|^(for[^a-zA-Z0-9])|^(empty[^a-zA-Z0-9])|^(cycle[^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 2 => array(0, "^(for[^a-zA-Z0-9])|^(empty[^a-zA-Z0-9])|^(cycle[^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 3 => array(0, "^(empty[^a-zA-Z0-9])|^(cycle[^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]+)"),
364 4 => array(0, "^(cycle[^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]+)"),
365 5 => 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]+)"),
366 6 => 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]+)"),
367 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]+)"),
368 8 => 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]+)"),
369 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]+)"),
370 10 => 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]+)"),
371 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]+)"),
372 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]+)"),
373 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]+)"),
374 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]+)"),
375 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]+)"),
376 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]+)"),
377 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]+)"),
378 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]+)"),
379 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]+)"),
380 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]+)"),
381 21 => 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]+)"),
382 22 => 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]+)"),
383 23 => 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]+)"),
384 24 => 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]+)"),
385 25 => 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]+)"),
386 26 => 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]+)"),
387 27 => 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]+)"),
388 28 => 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]+)"),
389 29 => 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]+)"),
390 30 => 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]+)"),
391 31 => 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]+)"),
392 32 => 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]+)"),
393 33 => 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]+)"),
394 34 => 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]+)"),
395 35 => 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]+)"),
396 36 => 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]+)"),
397 37 => 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]+)"),
398 38 => 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]+)"),
399 39 => 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]+)"),
400 40 => 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]+)"),
401 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]+)"),
402 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]+)"),
403 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]+)"),
404 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]+)"),
405 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]+)"),
406 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]+)"),
407 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]+)"),
408 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]+)"),
409 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]+)"),
410 50 => 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]+)"),
411 51 => 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]+)"),
412 53 => array(1, "^(include[^a-zA-Z0-9])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
413 54 => array(1, "^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
414 55 => array(2, "^(([0-9])+\\.([0-9])+)|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
415 57 => array(4, "^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
416 60 => array(5, "^([ \r\t\n]+)"),
422 if (!strlen($yy_yymore_patterns[$this->token
][1])) {
423 throw new Exception('cannot do yymore for the last token');
425 $yysubmatches = array();
426 if (preg_match('/' . $yy_yymore_patterns[$this->token
][1] . '/',
427 substr($this->data
, $this->N
), $yymatches)) {
428 $yysubmatches = $yymatches;
429 $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
430 next($yymatches); // skip global match
431 $this->token +
= key($yymatches) +
$yy_yymore_patterns[$this->token
][0]; // token number
432 $this->value
= current($yymatches); // token value
433 $this->line
= substr_count($this->value
, "\n");
434 if ($tokenMap[$this->token
]) {
435 // extract sub-patterns for passing to lex function
436 $yysubmatches = array_slice($yysubmatches, $this->token +
1,
437 $tokenMap[$this->token
]);
439 $yysubmatches = array();
442 $r = $this->{'yy_r2_' . $this->token
}($yysubmatches);
443 } while ($r !== null && !is_bool($r));
445 // we have changed state
446 // process this token in the new state
447 return $this->yylex();
448 } elseif ($r === false) {
449 $this->N +
= strlen($this->value
);
450 $this->line +
= substr_count($this->value
, "\n");
451 if ($this->N
>= strlen($this->data
)) {
452 return false; // end of input
458 $this->N +
= strlen($this->value
);
459 $this->line +
= substr_count($this->value
, "\n");
464 throw new Exception('Unexpected input at line' . $this->line
.
465 ': ' . $this->data
[$this->N
]);
474 function yy_r2_1($yy_subpatterns)
477 $this->token
= Parser
::T_CLOSE_TAG
;
480 function yy_r2_2($yy_subpatterns)
483 $this->token
= Parser
::T_DOT
;
485 function yy_r2_3($yy_subpatterns)
488 $this->token
= Parser
::T_FOR
;
490 function yy_r2_4($yy_subpatterns)
493 $this->token
= Parser
::T_EMPTY
;
495 function yy_r2_5($yy_subpatterns)
498 $this->token
= Parser
::T_CYCLE
;
500 function yy_r2_6($yy_subpatterns)
503 $this->token
= Parser
::T_FIRST_OF
;
505 function yy_r2_7($yy_subpatterns)
508 $this->token
= Parser
::T_BLOCK
;
510 function yy_r2_8($yy_subpatterns)
513 $this->token
= Parser
::T_AND
;
515 function yy_r2_9($yy_subpatterns)
518 $this->token
= Parser
::T_AND
;
520 function yy_r2_10($yy_subpatterns)
523 $this->token
= Parser
::T_OR
;
525 function yy_r2_11($yy_subpatterns)
528 $this->token
= Parser
::T_OR
;
530 function yy_r2_12($yy_subpatterns)
533 $this->token
= Parser
::T_EQ
;
535 function yy_r2_13($yy_subpatterns)
538 $this->token
= Parser
::T_NE
;
540 function yy_r2_14($yy_subpatterns)
543 $this->token
= Parser
::T_GE
;
545 function yy_r2_15($yy_subpatterns)
548 $this->token
= Parser
::T_BRACKETS_OPEN
;
550 function yy_r2_16($yy_subpatterns)
553 $this->token
= Parser
::T_BRACKETS_CLOSE
;
555 function yy_r2_17($yy_subpatterns)
558 $this->token
= Parser
::T_GT
;
560 function yy_r2_18($yy_subpatterns)
563 $this->token
= Parser
::T_LT
;
565 function yy_r2_19($yy_subpatterns)
568 $this->token
= Parser
::T_LE
;
570 function yy_r2_20($yy_subpatterns)
573 $this->token
= Parser
::T_PIPE
;
575 function yy_r2_21($yy_subpatterns)
578 $this->token
= Parser
::T_COLON
;
580 function yy_r2_22($yy_subpatterns)
583 $this->token
= Parser
::T_FILTER
;
585 function yy_r2_23($yy_subpatterns)
588 $this->token
= Parser
::T_REGROUP
;
590 function yy_r2_24($yy_subpatterns)
593 $this->token
= Parser
::T_END_FILTER
;
595 function yy_r2_25($yy_subpatterns)
598 $this->token
= Parser
::T_AUTOESCAPE
;
600 function yy_r2_26($yy_subpatterns)
603 $this->token
= Parser
::T_END_AUTOESCAPE
;
605 function yy_r2_27($yy_subpatterns)
608 $this->token
= Parser
::T_END_BLOCK
;
610 function yy_r2_28($yy_subpatterns)
613 $this->token
= Parser
::T_IFCHANGED
;
615 function yy_r2_29($yy_subpatterns)
618 $this->token
= Parser
::T_ELSE
;
620 function yy_r2_30($yy_subpatterns)
623 $this->token
= Parser
::T_ENDIFCHANGED
;
625 function yy_r2_31($yy_subpatterns)
628 $this->token
= Parser
::T_IN
;
630 function yy_r2_32($yy_subpatterns)
633 $this->token
= Parser
::T_CLOSEFOR
;
635 function yy_r2_33($yy_subpatterns)
638 $this->token
= Parser
::T_WITH
;
640 function yy_r2_34($yy_subpatterns)
643 $this->token
= Parser
::T_ENDWITH
;
645 function yy_r2_35($yy_subpatterns)
648 $this->token
= Parser
::T_AS
;
650 function yy_r2_36($yy_subpatterns)
653 $this->token
= Parser
::T_ON
;
655 function yy_r2_37($yy_subpatterns)
658 $this->token
= Parser
::T_OFF
;
660 function yy_r2_38($yy_subpatterns)
663 $this->token
= Parser
::T_BY
;
665 function yy_r2_39($yy_subpatterns)
668 $this->token
= Parser
::T_IF
;
670 function yy_r2_40($yy_subpatterns)
673 $this->token
= Parser
::T_ELSE
;
675 function yy_r2_41($yy_subpatterns)
678 $this->token
= Parser
::T_ENDIF
;
680 function yy_r2_42($yy_subpatterns)
683 $this->token
= Parser
::T_LPARENT
;
685 function yy_r2_43($yy_subpatterns)
688 $this->token
= Parser
::T_RPARENT
;
690 function yy_r2_44($yy_subpatterns)
693 $this->token
= Parser
::T_MOD
;
695 function yy_r2_45($yy_subpatterns)
698 $this->token
= Parser
::T_COMMA
;
700 function yy_r2_46($yy_subpatterns)
703 $this->token
= Parser
::T_PLUS
;
705 function yy_r2_47($yy_subpatterns)
708 $this->token
= Parser
::T_TIMES
;
710 function yy_r2_48($yy_subpatterns)
713 $this->token
= Parser
::T_DIV
;
715 function yy_r2_49($yy_subpatterns)
718 $this->token
= Parser
::T_STRING_SINGLE_INIT
;
719 $this->yypushstate(self
::IN_STRING_SINGLE
);
721 function yy_r2_50($yy_subpatterns)
724 $this->token
= Parser
::T_STRING_DOUBLE_INIT
;
725 $this->yypushstate(self
::IN_STRING_DOUBLE
);
727 function yy_r2_51($yy_subpatterns)
730 $this->token
= Parser
::T_CUSTOM_END
;
732 function yy_r2_53($yy_subpatterns)
735 $this->token
= Parser
::T_EXTENDS
;
737 function yy_r2_54($yy_subpatterns)
740 $this->token
= Parser
::T_INCLUDE
;
742 function yy_r2_55($yy_subpatterns)
745 $this->token
= Parser
::T_NUMERIC
;
747 function yy_r2_57($yy_subpatterns)
750 $this->token
= Parser
::T_NUMERIC
;
752 function yy_r2_60($yy_subpatterns)
755 $this->is_custom_tag();
757 function yy_r2_62($yy_subpatterns)
780 if ($this->N
>= strlen($this->data
)) {
781 return false; // end of input
783 $yy_global_pattern = "/^(\\}\\})|^(\\|)|^(:)|^(\\.)|^(\\[)|^(\\])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(')|^(\")|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)/";
786 if (preg_match($yy_global_pattern, substr($this->data
, $this->N
), $yymatches)) {
787 $yysubmatches = $yymatches;
788 $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
789 if (!count($yymatches)) {
790 throw new Exception('Error: lexing failed because a rule matched' .
791 'an empty string. Input "' . substr($this->data
,
792 $this->N
, 5) . '... state IN_PRINT');
794 next($yymatches); // skip global match
795 $this->token
= key($yymatches); // token number
796 if ($tokenMap[$this->token
]) {
797 // extract sub-patterns for passing to lex function
798 $yysubmatches = array_slice($yysubmatches, $this->token +
1,
799 $tokenMap[$this->token
]);
801 $yysubmatches = array();
803 $this->value
= current($yymatches); // token value
804 $r = $this->{'yy_r3_' . $this->token
}($yysubmatches);
806 $this->N +
= strlen($this->value
);
807 $this->line +
= substr_count($this->value
, "\n");
810 } elseif ($r === true) {
811 // we have changed state
812 // process this token in the new state
813 return $this->yylex();
814 } elseif ($r === false) {
815 $this->N +
= strlen($this->value
);
816 $this->line +
= substr_count($this->value
, "\n");
817 if ($this->N
>= strlen($this->data
)) {
818 return false; // end of input
822 } else { $yy_yymore_patterns = array(
823 1 => array(0, "^(\\|)|^(:)|^(\\.)|^(\\[)|^(\\])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(')|^(\")|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
824 2 => array(0, "^(:)|^(\\.)|^(\\[)|^(\\])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(')|^(\")|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
825 3 => array(0, "^(\\.)|^(\\[)|^(\\])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(')|^(\")|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
826 4 => array(0, "^(\\[)|^(\\])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(')|^(\")|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
827 5 => array(0, "^(\\])|^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(')|^(\")|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
828 6 => array(0, "^(([0-9])+)|^(([0-9])+\\.([0-9])+)|^(')|^(\")|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
829 7 => array(1, "^(([0-9])+\\.([0-9])+)|^(')|^(\")|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
830 9 => array(3, "^(')|^(\")|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
831 12 => array(3, "^(\")|^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
832 13 => array(3, "^(([a-zA-Z_][a-zA-Z_0-9]*))|^([ \r\t\n]+)"),
833 14 => array(4, "^([ \r\t\n]+)"),
839 if (!strlen($yy_yymore_patterns[$this->token
][1])) {
840 throw new Exception('cannot do yymore for the last token');
842 $yysubmatches = array();
843 if (preg_match('/' . $yy_yymore_patterns[$this->token
][1] . '/',
844 substr($this->data
, $this->N
), $yymatches)) {
845 $yysubmatches = $yymatches;
846 $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
847 next($yymatches); // skip global match
848 $this->token +
= key($yymatches) +
$yy_yymore_patterns[$this->token
][0]; // token number
849 $this->value
= current($yymatches); // token value
850 $this->line
= substr_count($this->value
, "\n");
851 if ($tokenMap[$this->token
]) {
852 // extract sub-patterns for passing to lex function
853 $yysubmatches = array_slice($yysubmatches, $this->token +
1,
854 $tokenMap[$this->token
]);
856 $yysubmatches = array();
859 $r = $this->{'yy_r3_' . $this->token
}($yysubmatches);
860 } while ($r !== null && !is_bool($r));
862 // we have changed state
863 // process this token in the new state
864 return $this->yylex();
865 } elseif ($r === false) {
866 $this->N +
= strlen($this->value
);
867 $this->line +
= substr_count($this->value
, "\n");
868 if ($this->N
>= strlen($this->data
)) {
869 return false; // end of input
875 $this->N +
= strlen($this->value
);
876 $this->line +
= substr_count($this->value
, "\n");
881 throw new Exception('Unexpected input at line' . $this->line
.
882 ': ' . $this->data
[$this->N
]);
891 function yy_r3_1($yy_subpatterns)
894 $this->token
= Parser
::T_PRINT_CLOSE
;
897 function yy_r3_2($yy_subpatterns)
900 $this->token
= Parser
::T_PIPE
;
902 function yy_r3_3($yy_subpatterns)
905 $this->token
= Parser
::T_COLON
;
907 function yy_r3_4($yy_subpatterns)
910 $this->token
= Parser
::T_DOT
;
912 function yy_r3_5($yy_subpatterns)
915 $this->token
= Parser
::T_BRACKETS_OPEN
;
917 function yy_r3_6($yy_subpatterns)
920 $this->token
= Parser
::T_BRACKETS_CLOSE
;
922 function yy_r3_7($yy_subpatterns)
925 $this->token
= Parser
::T_NUMERIC
;
927 function yy_r3_9($yy_subpatterns)
930 $this->token
= Parser
::T_NUMERIC
;
932 function yy_r3_12($yy_subpatterns)
935 $this->token
= Parser
::T_STRING_SINGLE_INIT
;
936 $this->yypushstate(self
::IN_STRING_SINGLE
);
938 function yy_r3_13($yy_subpatterns)
941 $this->token
= Parser
::T_STRING_DOUBLE_INIT
;
942 $this->yypushstate(self
::IN_STRING_DOUBLE
);
944 function yy_r3_14($yy_subpatterns)
947 $this->token
= Parser
::T_ALPHA
;
949 function yy_r3_16($yy_subpatterns)
965 if ($this->N
>= strlen($this->data
)) {
966 return false; // end of input
968 $yy_global_pattern = "/^(\\\\\")|^(\\\\')|^(\")|^([^\"\\\\]+)/";
971 if (preg_match($yy_global_pattern, substr($this->data
, $this->N
), $yymatches)) {
972 $yysubmatches = $yymatches;
973 $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
974 if (!count($yymatches)) {
975 throw new Exception('Error: lexing failed because a rule matched' .
976 'an empty string. Input "' . substr($this->data
,
977 $this->N
, 5) . '... state IN_STRING_DOUBLE');
979 next($yymatches); // skip global match
980 $this->token
= key($yymatches); // token number
981 if ($tokenMap[$this->token
]) {
982 // extract sub-patterns for passing to lex function
983 $yysubmatches = array_slice($yysubmatches, $this->token +
1,
984 $tokenMap[$this->token
]);
986 $yysubmatches = array();
988 $this->value
= current($yymatches); // token value
989 $r = $this->{'yy_r4_' . $this->token
}($yysubmatches);
991 $this->N +
= strlen($this->value
);
992 $this->line +
= substr_count($this->value
, "\n");
995 } elseif ($r === true) {
996 // we have changed state
997 // process this token in the new state
998 return $this->yylex();
999 } elseif ($r === false) {
1000 $this->N +
= strlen($this->value
);
1001 $this->line +
= substr_count($this->value
, "\n");
1002 if ($this->N
>= strlen($this->data
)) {
1003 return false; // end of input
1007 } else { $yy_yymore_patterns = array(
1008 1 => array(0, "^(\\\\')|^(\")|^([^\"\\\\]+)"),
1009 2 => array(0, "^(\")|^([^\"\\\\]+)"),
1010 3 => array(0, "^([^\"\\\\]+)"),
1016 if (!strlen($yy_yymore_patterns[$this->token
][1])) {
1017 throw new Exception('cannot do yymore for the last token');
1019 $yysubmatches = array();
1020 if (preg_match('/' . $yy_yymore_patterns[$this->token
][1] . '/',
1021 substr($this->data
, $this->N
), $yymatches)) {
1022 $yysubmatches = $yymatches;
1023 $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
1024 next($yymatches); // skip global match
1025 $this->token +
= key($yymatches) +
$yy_yymore_patterns[$this->token
][0]; // token number
1026 $this->value
= current($yymatches); // token value
1027 $this->line
= substr_count($this->value
, "\n");
1028 if ($tokenMap[$this->token
]) {
1029 // extract sub-patterns for passing to lex function
1030 $yysubmatches = array_slice($yysubmatches, $this->token +
1,
1031 $tokenMap[$this->token
]);
1033 $yysubmatches = array();
1036 $r = $this->{'yy_r4_' . $this->token
}($yysubmatches);
1037 } while ($r !== null && !is_bool($r));
1039 // we have changed state
1040 // process this token in the new state
1041 return $this->yylex();
1042 } elseif ($r === false) {
1043 $this->N +
= strlen($this->value
);
1044 $this->line +
= substr_count($this->value
, "\n");
1045 if ($this->N
>= strlen($this->data
)) {
1046 return false; // end of input
1052 $this->N +
= strlen($this->value
);
1053 $this->line +
= substr_count($this->value
, "\n");
1058 throw new Exception('Unexpected input at line' . $this->line
.
1059 ': ' . $this->data
[$this->N
]);
1067 const IN_STRING_DOUBLE
= 4;
1068 function yy_r4_1($yy_subpatterns)
1071 $this->token
= Parser
::T_STRING_CONTENT
;
1072 $this->value
= "\"";
1075 function yy_r4_2($yy_subpatterns)
1078 $this->token
= Parser
::T_STRING_CONTENT
;
1082 function yy_r4_3($yy_subpatterns)
1085 $this->token
= Parser
::T_STRING_DOUBLE_END
;
1086 $this->yypopstate();
1088 function yy_r4_4($yy_subpatterns)
1091 $this->token
= Parser
::T_STRING_CONTENT
;
1104 if ($this->N
>= strlen($this->data
)) {
1105 return false; // end of input
1107 $yy_global_pattern = "/^(\\\\')|^(\\\\\")|^(')|^([^'\\\\]+)/";
1110 if (preg_match($yy_global_pattern, substr($this->data
, $this->N
), $yymatches)) {
1111 $yysubmatches = $yymatches;
1112 $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
1113 if (!count($yymatches)) {
1114 throw new Exception('Error: lexing failed because a rule matched' .
1115 'an empty string. Input "' . substr($this->data
,
1116 $this->N
, 5) . '... state IN_STRING_SINGLE');
1118 next($yymatches); // skip global match
1119 $this->token
= key($yymatches); // token number
1120 if ($tokenMap[$this->token
]) {
1121 // extract sub-patterns for passing to lex function
1122 $yysubmatches = array_slice($yysubmatches, $this->token +
1,
1123 $tokenMap[$this->token
]);
1125 $yysubmatches = array();
1127 $this->value
= current($yymatches); // token value
1128 $r = $this->{'yy_r5_' . $this->token
}($yysubmatches);
1130 $this->N +
= strlen($this->value
);
1131 $this->line +
= substr_count($this->value
, "\n");
1132 // accept this token
1134 } elseif ($r === true) {
1135 // we have changed state
1136 // process this token in the new state
1137 return $this->yylex();
1138 } elseif ($r === false) {
1139 $this->N +
= strlen($this->value
);
1140 $this->line +
= substr_count($this->value
, "\n");
1141 if ($this->N
>= strlen($this->data
)) {
1142 return false; // end of input
1146 } else { $yy_yymore_patterns = array(
1147 1 => array(0, "^(\\\\\")|^(')|^([^'\\\\]+)"),
1148 2 => array(0, "^(')|^([^'\\\\]+)"),
1149 3 => array(0, "^([^'\\\\]+)"),
1155 if (!strlen($yy_yymore_patterns[$this->token
][1])) {
1156 throw new Exception('cannot do yymore for the last token');
1158 $yysubmatches = array();
1159 if (preg_match('/' . $yy_yymore_patterns[$this->token
][1] . '/',
1160 substr($this->data
, $this->N
), $yymatches)) {
1161 $yysubmatches = $yymatches;
1162 $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
1163 next($yymatches); // skip global match
1164 $this->token +
= key($yymatches) +
$yy_yymore_patterns[$this->token
][0]; // token number
1165 $this->value
= current($yymatches); // token value
1166 $this->line
= substr_count($this->value
, "\n");
1167 if ($tokenMap[$this->token
]) {
1168 // extract sub-patterns for passing to lex function
1169 $yysubmatches = array_slice($yysubmatches, $this->token +
1,
1170 $tokenMap[$this->token
]);
1172 $yysubmatches = array();
1175 $r = $this->{'yy_r5_' . $this->token
}($yysubmatches);
1176 } while ($r !== null && !is_bool($r));
1178 // we have changed state
1179 // process this token in the new state
1180 return $this->yylex();
1181 } elseif ($r === false) {
1182 $this->N +
= strlen($this->value
);
1183 $this->line +
= substr_count($this->value
, "\n");
1184 if ($this->N
>= strlen($this->data
)) {
1185 return false; // end of input
1191 $this->N +
= strlen($this->value
);
1192 $this->line +
= substr_count($this->value
, "\n");
1197 throw new Exception('Unexpected input at line' . $this->line
.
1198 ': ' . $this->data
[$this->N
]);
1206 const IN_STRING_SINGLE
= 5;
1207 function yy_r5_1($yy_subpatterns)
1210 $this->token
= Parser
::T_STRING_CONTENT
;
1214 function yy_r5_2($yy_subpatterns)
1217 $this->token
= Parser
::T_STRING_CONTENT
;
1218 $this->value
= "\"";
1221 function yy_r5_3($yy_subpatterns)
1224 $this->token
= Parser
::T_STRING_SINGLE_END
;
1225 $this->yypopstate();
1227 function yy_r5_4($yy_subpatterns)
1230 $this->token
= Parser
::T_STRING_CONTENT
;
1240 if ($this->N
>= strlen($this->data
)) {
1241 return false; // end of input
1243 $yy_global_pattern = "/^(([^#]+#\\})+)/";
1246 if (preg_match($yy_global_pattern, substr($this->data
, $this->N
), $yymatches)) {
1247 $yysubmatches = $yymatches;
1248 $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
1249 if (!count($yymatches)) {
1250 throw new Exception('Error: lexing failed because a rule matched' .
1251 'an empty string. Input "' . substr($this->data
,
1252 $this->N
, 5) . '... state IN_COMMENT');
1254 next($yymatches); // skip global match
1255 $this->token
= key($yymatches); // token number
1256 if ($tokenMap[$this->token
]) {
1257 // extract sub-patterns for passing to lex function
1258 $yysubmatches = array_slice($yysubmatches, $this->token +
1,
1259 $tokenMap[$this->token
]);
1261 $yysubmatches = array();
1263 $this->value
= current($yymatches); // token value
1264 $r = $this->{'yy_r6_' . $this->token
}($yysubmatches);
1266 $this->N +
= strlen($this->value
);
1267 $this->line +
= substr_count($this->value
, "\n");
1268 // accept this token
1270 } elseif ($r === true) {
1271 // we have changed state
1272 // process this token in the new state
1273 return $this->yylex();
1274 } elseif ($r === false) {
1275 $this->N +
= strlen($this->value
);
1276 $this->line +
= substr_count($this->value
, "\n");
1277 if ($this->N
>= strlen($this->data
)) {
1278 return false; // end of input
1282 } else { $yy_yymore_patterns = array(
1288 if (!strlen($yy_yymore_patterns[$this->token
][1])) {
1289 throw new Exception('cannot do yymore for the last token');
1291 $yysubmatches = array();
1292 if (preg_match('/' . $yy_yymore_patterns[$this->token
][1] . '/',
1293 substr($this->data
, $this->N
), $yymatches)) {
1294 $yysubmatches = $yymatches;
1295 $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
1296 next($yymatches); // skip global match
1297 $this->token +
= key($yymatches) +
$yy_yymore_patterns[$this->token
][0]; // token number
1298 $this->value
= current($yymatches); // token value
1299 $this->line
= substr_count($this->value
, "\n");
1300 if ($tokenMap[$this->token
]) {
1301 // extract sub-patterns for passing to lex function
1302 $yysubmatches = array_slice($yysubmatches, $this->token +
1,
1303 $tokenMap[$this->token
]);
1305 $yysubmatches = array();
1308 $r = $this->{'yy_r6_' . $this->token
}($yysubmatches);
1309 } while ($r !== null && !is_bool($r));
1311 // we have changed state
1312 // process this token in the new state
1313 return $this->yylex();
1314 } elseif ($r === false) {
1315 $this->N +
= strlen($this->value
);
1316 $this->line +
= substr_count($this->value
, "\n");
1317 if ($this->N
>= strlen($this->data
)) {
1318 return false; // end of input
1324 $this->N +
= strlen($this->value
);
1325 $this->line +
= substr_count($this->value
, "\n");
1330 throw new Exception('Unexpected input at line' . $this->line
.
1331 ': ' . $this->data
[$this->N
]);
1339 const IN_COMMENT
= 6;
1340 function yy_r6_1($yy_subpatterns)
1343 $this->token
= Parser
::T_COMMENT
;
1344 $this->yypopstate();