libs/sysplugins/smarty_internal_templatelexer.php Quellcode

smarty_internal_templatelexer.php
gehe zur Dokumentation dieser Datei
1 <?php
21 {
27  public $data;
28 
34  public $counter;
35 
41  public $token;
42 
48  public $value;
49 
55  public $line;
56 
62  public $taglineno;
63 
69  public $phpType = '';
70 
76  public $ldel = '';
77 
83  public $ldel_length = 0;
84 
90  public $rdel = '';
91 
97  public $rdel_length = 0;
98 
104  public $state = 1;
105 
111  public $smarty = null;
112 
118  public $compiler = null;
119 
125  private $literal_cnt = 0;
126 
138  public $yyTraceFILE;
139 
146 
152  public $is_xml = false;
153 
159  public $state_name = array(1 => 'TEXT', 2 => 'TAG', 3 => 'TAGBODY', 4 => 'LITERAL', 5 => 'DOUBLEQUOTEDSTRING',
160  6 => 'CHILDBODY', 7 => 'CHILDBLOCK', 8 => 'CHILDLITERAL');
161 
167  private $yy_global_pattern1 = null;
168 
169  private $yy_global_pattern2 = null;
170 
171  private $yy_global_pattern3 = null;
172 
173  private $yy_global_pattern4 = null;
174 
175  private $yy_global_pattern5 = null;
176 
177  private $yy_global_pattern6 = null;
178 
179  private $yy_global_pattern7 = null;
180 
181  private $yy_global_pattern8 = null;
182 
188  public $smarty_token_names = array( // Text for parser error messages
189  'NOT' => '(!,not)', 'OPENP' => '(', 'CLOSEP' => ')', 'OPENB' => '[', 'CLOSEB' => ']', 'PTR' => '->',
190  'APTR' => '=>', 'EQUAL' => '=', 'NUMBER' => 'number', 'UNIMATH' => '+" , "-', 'MATH' => '*" , "/" , "%',
191  'INCDEC' => '++" , "--', 'SPACE' => ' ', 'DOLLAR' => '$', 'SEMICOLON' => ';', 'COLON' => ':',
192  'DOUBLECOLON' => '::', 'AT' => '@', 'HATCH' => '#', 'QUOTE' => '"', 'BACKTICK' => '`', 'VERT' => '"|" modifier',
193  'DOT' => '.', 'COMMA' => '","', 'QMARK' => '"?"', 'ID' => 'id, name', 'TEXT' => 'text',
194  'LDELSLASH' => '{/..} closing tag', 'LDEL' => '{...} Smarty tag', 'COMMENT' => 'comment', 'AS' => 'as',
195  'TO' => 'to', 'PHP' => '"<?php", "<%", "{php}" tag', 'LOGOP' => '"<", "==" ... logical operator',
196  'TLOGOP' => '"lt", "eq" ... logical operator; "is div by" ... if condition',
197  'SCOND' => '"is even" ... if condition',);
198 
206  {
207  $this->data = $data;
208  $this->counter = 0;
209  if (preg_match('~^\xEF\xBB\xBF~i', $this->data, $match)) {
210  $this->counter += strlen($match[0]);
211  }
212  $this->line = 1;
213  $this->smarty = $compiler->smarty;
214  $this->compiler = $compiler;
215  $this->ldel = preg_quote($this->smarty->left_delimiter, '~');
216  $this->ldel_length = strlen($this->smarty->left_delimiter);
217  $this->rdel = preg_quote($this->smarty->right_delimiter, '~');
218  $this->rdel_length = strlen($this->smarty->right_delimiter);
219  $this->smarty_token_names['LDEL'] = $this->smarty->left_delimiter;
220  $this->smarty_token_names['RDEL'] = $this->smarty->right_delimiter;
221  }
222 
223  public function PrintTrace()
224  {
225  $this->yyTraceFILE = fopen('php://output', 'w');
226  $this->yyTracePrompt = '<br>';
227  }
228 
229  /*
230  * Check if this tag is autoliteral
231  */
232  public function isAutoLiteral()
233  {
234  return $this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false;
235  }
236 
237  private $_yy_state = 1;
238 
239  private $_yy_stack = array();
240 
241  public function yylex()
242  {
243  return $this->{'yylex' . $this->_yy_state}();
244  }
245 
246  public function yypushstate($state)
247  {
248  if ($this->yyTraceFILE) {
249  fprintf($this->yyTraceFILE, "%sState push %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state);
250  }
251  array_push($this->_yy_stack, $this->_yy_state);
252  $this->_yy_state = $state;
253  if ($this->yyTraceFILE) {
254  fprintf($this->yyTraceFILE, "%snew State %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state);
255  }
256  }
257 
258  public function yypopstate()
259  {
260  if ($this->yyTraceFILE) {
261  fprintf($this->yyTraceFILE, "%sState pop %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state);
262  }
263  $this->_yy_state = array_pop($this->_yy_stack);
264  if ($this->yyTraceFILE) {
265  fprintf($this->yyTraceFILE, "%snew State %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state);
266  }
267  }
268 
269  public function yybegin($state)
270  {
271  $this->_yy_state = $state;
272  if ($this->yyTraceFILE) {
273  fprintf($this->yyTraceFILE, "%sState set %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state);
274  }
275  }
276 
277  public function yylex1()
278  {
279  if (!isset($this->yy_global_pattern1)) {
280  $this->yy_global_pattern1 = "/\G([{][}])|\G(" . $this->ldel . "[*])|\G((<[?]((php\\s+|=)|\\s+))|(<[%])|(<[?]xml\\s+)|(<script\\s+language\\s*=\\s*[\"']?\\s*php\\s*[\"']?\\s*>)|([?][>])|([%][>])|(" . $this->ldel . "\\s*php(.*?)" . $this->rdel . ")|(" . $this->ldel . "\\s*[\/]php" . $this->rdel . "))|\G(" . $this->ldel . "\\s*literal\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*)|\G(\\s*" . $this->rdel . ")|\G([\S\s])/isS";
281  }
282  if ($this->counter >= strlen($this->data)) {
283  return false; // end of input
284  }
285 
286  do {
287  if (preg_match($this->yy_global_pattern1, $this->data, $yymatches, null, $this->counter)) {
288  $yysubmatches = $yymatches;
289  if (strlen($yysubmatches[0]) < 200) {
290  $yymatches = preg_grep("/(.|\s)+/", $yysubmatches);
291  } else {
292  $yymatches = array_filter($yymatches, 'strlen');
293  }
294  if (empty($yymatches)) {
295  throw new Exception('Error: lexing failed because a rule matched' . ' an empty string. Input "' . substr($this->data, $this->counter, 5) . '... state TEXT');
296  }
297  next($yymatches); // skip global match
298  $this->token = key($yymatches); // token number
299  $this->value = current($yymatches); // token value
300  $r = $this->{'yy_r1_' . $this->token}();
301  if ($r === null) {
302  $this->counter += strlen($this->value);
303  $this->line += substr_count($this->value, "\n");
304  // accept this token
305  return true;
306  } elseif ($r === true) {
307  // we have changed state
308  // process this token in the new state
309  return $this->yylex();
310  } elseif ($r === false) {
311  $this->counter += strlen($this->value);
312  $this->line += substr_count($this->value, "\n");
313  if ($this->counter >= strlen($this->data)) {
314  return false; // end of input
315  }
316  // skip this token
317  continue;
318  }
319  } else {
320  throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[$this->counter]);
321  }
322  break;
323  } while (true);
324  } // end function
325 
326  const TEXT = 1;
327 
328  function yy_r1_1()
329  {
330 
332  }
333 
334  function yy_r1_2()
335  {
336 
337  preg_match("~[*]{$this->rdel}~", $this->data, $match, PREG_OFFSET_CAPTURE, $this->counter);
338  if (isset($match[0][1])) {
339  $to = $match[0][1] + strlen($match[0][0]);
340  } else {
341  $this->compiler->trigger_template_error("missing or misspelled comment closing tag '*{$this->smarty->right_delimiter}'");
342  }
343  $this->value = substr($this->data, $this->counter, $to - $this->counter);
344  return false;
345  }
346 
347  function yy_r1_3()
348  {
349 
351  $obj->parsePhp($this);
352  }
353 
354  function yy_r1_15()
355  {
356 
357  if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
359  } else {
361  $this->yypushstate(self::LITERAL);
362  }
363  }
364 
365  function yy_r1_16()
366  {
367 
368  if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
370  } else {
371  $this->yypushstate(self::TAG);
372  return true;
373  }
374  }
375 
376  function yy_r1_17()
377  {
378 
380  }
381 
382  function yy_r1_18()
383  {
384 
385  $to = strlen($this->data);
386  preg_match("~($this->ldel)|([<]script\s+language\s*=\s*[\"\']?\s*php\s*[\"\']?\s*[>])|([<][?])|([<][%])|([?][>])|([%][>])~i", $this->data, $match, PREG_OFFSET_CAPTURE, $this->counter);
387  if (isset($match[0][1])) {
388  $to = $match[0][1];
389  }
390  $this->value = substr($this->data, $this->counter, $to - $this->counter);
392  }
393 
394  public function yylex2()
395  {
396  if (!isset($this->yy_global_pattern2)) {
397  $this->yy_global_pattern2 = "/\G(" . $this->ldel . "\\s*(if|elseif|else if|while)\\s+)|\G(" . $this->ldel . "\\s*for\\s+)|\G(" . $this->ldel . "\\s*foreach(?![^\s]))|\G(" . $this->ldel . "\\s*setfilter\\s+)|\G(" . $this->ldel . "\\s*[0-9]*[a-zA-Z_]\\w*(\\s+nocache)?\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*[\/](?:(?!block)[0-9]*[a-zA-Z_]\\w*)\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*[$][0-9]*[a-zA-Z_]\\w*(\\s+nocache)?\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*[\/])|\G(" . $this->ldel . "\\s*)/isS";
398  }
399  if ($this->counter >= strlen($this->data)) {
400  return false; // end of input
401  }
402 
403  do {
404  if (preg_match($this->yy_global_pattern2, $this->data, $yymatches, null, $this->counter)) {
405  $yysubmatches = $yymatches;
406  if (strlen($yysubmatches[0]) < 200) {
407  $yymatches = preg_grep("/(.|\s)+/", $yysubmatches);
408  } else {
409  $yymatches = array_filter($yymatches, 'strlen');
410  }
411  if (empty($yymatches)) {
412  throw new Exception('Error: lexing failed because a rule matched' . ' an empty string. Input "' . substr($this->data, $this->counter, 5) . '... state TAG');
413  }
414  next($yymatches); // skip global match
415  $this->token = key($yymatches); // token number
416  $this->value = current($yymatches); // token value
417  $r = $this->{'yy_r2_' . $this->token}();
418  if ($r === null) {
419  $this->counter += strlen($this->value);
420  $this->line += substr_count($this->value, "\n");
421  // accept this token
422  return true;
423  } elseif ($r === true) {
424  // we have changed state
425  // process this token in the new state
426  return $this->yylex();
427  } elseif ($r === false) {
428  $this->counter += strlen($this->value);
429  $this->line += substr_count($this->value, "\n");
430  if ($this->counter >= strlen($this->data)) {
431  return false; // end of input
432  }
433  // skip this token
434  continue;
435  }
436  } else {
437  throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[$this->counter]);
438  }
439  break;
440  } while (true);
441  } // end function
442 
443  const TAG = 2;
444 
445  function yy_r2_1()
446  {
447 
449  $this->yybegin(self::TAGBODY);
450  $this->taglineno = $this->line;
451  }
452 
453  function yy_r2_3()
454  {
455 
457  $this->yybegin(self::TAGBODY);
458  $this->taglineno = $this->line;
459  }
460 
461  function yy_r2_4()
462  {
463 
465  $this->yybegin(self::TAGBODY);
466  $this->taglineno = $this->line;
467  }
468 
469  function yy_r2_5()
470  {
471 
473  $this->yybegin(self::TAGBODY);
474  $this->taglineno = $this->line;
475  }
476 
477  function yy_r2_6()
478  {
479 
480  $this->yypopstate();
482  $this->taglineno = $this->line;
483  }
484 
485  function yy_r2_8()
486  {
487 
488  $this->yypopstate();
490  $this->taglineno = $this->line;
491  }
492 
493  function yy_r2_9()
494  {
495 
496  if ($this->_yy_stack[count($this->_yy_stack) - 1] == self::TEXT) {
497  $this->yypopstate();
499  $this->taglineno = $this->line;
500  } else {
501  $this->value = $this->smarty->left_delimiter;
503  $this->yybegin(self::TAGBODY);
504  $this->taglineno = $this->line;
505  }
506  }
507 
508  function yy_r2_11()
509  {
510 
512  $this->yybegin(self::TAGBODY);
513  $this->taglineno = $this->line;
514  }
515 
516  function yy_r2_12()
517  {
518 
520  $this->yybegin(self::TAGBODY);
521  $this->taglineno = $this->line;
522  }
523 
524  public function yylex3()
525  {
526  if (!isset($this->yy_global_pattern3)) {
527  $this->yy_global_pattern3 = "/\G(\\s*" . $this->rdel . ")|\G([\"])|\G('[^'\\\\]*(?:\\\\.[^'\\\\]*)*')|\G([$]smarty\\.block\\.(child|parent))|\G([$][0-9]*[a-zA-Z_]\\w*)|\G([$])|\G(\\s+is\\s+in\\s+)|\G(\\s+as\\s+)|\G(\\s+to\\s+)|\G(\\s+step\\s+)|\G(\\s+instanceof\\s+)|\G(\\s*(([!=][=]{1,2})|([<][=>]?)|([>][=]?)|[&|]{2})\\s*)|\G(\\s+(eq|ne|neq|gt|ge|gte|lt|le|lte|mod|and|or|xor|(is\\s+(not\\s+)?(odd|even|div)\\s+by))\\s+)|\G(\\s+is\\s+(not\\s+)?(odd|even))|\G(([!]\\s*)|(not\\s+))|\G([(](int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)[)]\\s*)|\G(\\s*[(]\\s*)|\G(\\s*[)])|\G(\\[\\s*)|\G(\\s*\\])|\G(\\s*[-][>]\\s*)|\G(\\s*[=][>]\\s*)|\G(\\s*[=]\\s*)|\G(([+]|[-]){2})|\G(\\s*([+]|[-])\\s*)|\G(\\s*([*]{1,2}|[%\/^&]|[<>]{2})\\s*)|\G([@])|\G([#])|\G(\\s+[0-9]*[a-zA-Z_][a-zA-Z0-9_\-:]*\\s*[=]\\s*)|\G(([0-9]*[a-zA-Z_]\\w*)?(\\\\[0-9]*[a-zA-Z_]\\w*)+)|\G([0-9]*[a-zA-Z_]\\w*)|\G(\\d+)|\G([`])|\G([|])|\G([.])|\G(\\s*[,]\\s*)|\G(\\s*[;]\\s*)|\G([:]{2})|\G(\\s*[:]\\s*)|\G(\\s*[?]\\s*)|\G(0[xX][0-9a-fA-F]+)|\G(\\s+)|\G(" . $this->ldel . "\\s*)|\G([\S\s])/isS";
528  }
529  if ($this->counter >= strlen($this->data)) {
530  return false; // end of input
531  }
532 
533  do {
534  if (preg_match($this->yy_global_pattern3, $this->data, $yymatches, null, $this->counter)) {
535  $yysubmatches = $yymatches;
536  if (strlen($yysubmatches[0]) < 200) {
537  $yymatches = preg_grep("/(.|\s)+/", $yysubmatches);
538  } else {
539  $yymatches = array_filter($yymatches, 'strlen');
540  }
541  if (empty($yymatches)) {
542  throw new Exception('Error: lexing failed because a rule matched' . ' an empty string. Input "' . substr($this->data, $this->counter, 5) . '... state TAGBODY ');
543  }
544  next($yymatches); // skip global match
545  $this->token = key($yymatches); // token number
546  $this->value = current($yymatches); // token value
547  $r = $this->{'yy_r3_' . $this->token}();
548  if ($r === null) {
549  $this->counter += strlen($this->value);
550  $this->line += substr_count($this->value, "\n");
551  // accept this token
552  return true;
553  } elseif ($r === true) {
554  // we have changed state
555  // process this token in the new state
556  return $this->yylex();
557  } elseif ($r === false) {
558  $this->counter += strlen($this->value);
559  $this->line += substr_count($this->value, "\n");
560  if ($this->counter >= strlen($this->data)) {
561  return false; // end of input
562  }
563  // skip this token
564  continue;
565  }
566  } else {
567  throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[$this->counter]);
568  }
569  break;
570  } while (true);
571  } // end function
572 
573  const TAGBODY = 3;
574 
575  function yy_r3_1()
576  {
577 
579  $this->yypopstate();
580  }
581 
582  function yy_r3_2()
583  {
584 
586  $this->yypushstate(self::DOUBLEQUOTEDSTRING);
587  }
588 
589  function yy_r3_3()
590  {
591 
593  }
594 
595  function yy_r3_4()
596  {
597 
599  $this->taglineno = $this->line;
600  }
601 
602  function yy_r3_6()
603  {
604 
606  }
607 
608  function yy_r3_7()
609  {
610 
612  }
613 
614  function yy_r3_8()
615  {
616 
618  }
619 
620  function yy_r3_9()
621  {
622 
624  }
625 
626  function yy_r3_10()
627  {
628 
630  }
631 
632  function yy_r3_11()
633  {
634 
636  }
637 
638  function yy_r3_12()
639  {
640 
642  }
643 
644  function yy_r3_13()
645  {
646 
648  }
649 
650  function yy_r3_18()
651  {
652 
654  }
655 
656  function yy_r3_23()
657  {
658 
660  }
661 
662  function yy_r3_26()
663  {
664 
666  }
667 
668  function yy_r3_29()
669  {
670 
672  }
673 
674  function yy_r3_33()
675  {
676 
678  }
679 
680  function yy_r3_34()
681  {
682 
684  }
685 
686  function yy_r3_35()
687  {
688 
690  }
691 
692  function yy_r3_36()
693  {
694 
696  }
697 
698  function yy_r3_37()
699  {
700 
702  }
703 
704  function yy_r3_38()
705  {
706 
708  }
709 
710  function yy_r3_39()
711  {
712 
714  }
715 
716  function yy_r3_40()
717  {
718 
720  }
721 
722  function yy_r3_42()
723  {
724 
726  }
727 
728  function yy_r3_44()
729  {
730 
732  }
733 
734  function yy_r3_46()
735  {
736 
738  }
739 
740  function yy_r3_47()
741  {
742 
744  }
745 
746  function yy_r3_48()
747  {
748 
749  // resolve conflicts with shorttag and right_delimiter starting with '='
750  if (substr($this->data, $this->counter + strlen($this->value) - 1, $this->rdel_length) == $this->smarty->right_delimiter) {
751  preg_match("~\s+~", $this->value, $match);
752  $this->value = $match[0];
754  } else {
756  }
757  }
758 
759  function yy_r3_49()
760  {
761 
763  }
764 
765  function yy_r3_52()
766  {
767 
769  }
770 
771  function yy_r3_53()
772  {
773 
775  }
776 
777  function yy_r3_54()
778  {
779 
781  $this->yypopstate();
782  }
783 
784  function yy_r3_55()
785  {
786 
788  }
789 
790  function yy_r3_56()
791  {
792 
794  }
795 
796  function yy_r3_57()
797  {
798 
800  }
801 
802  function yy_r3_58()
803  {
804 
806  }
807 
808  function yy_r3_59()
809  {
810 
812  }
813 
814  function yy_r3_60()
815  {
816 
818  }
819 
820  function yy_r3_61()
821  {
822 
824  }
825 
826  function yy_r3_62()
827  {
828 
830  }
831 
832  function yy_r3_63()
833  {
834 
836  }
837 
838  function yy_r3_64()
839  {
840 
841  if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
843  } else {
844  $this->yypushstate(self::TAG);
845  return true;
846  }
847  }
848 
849  function yy_r3_65()
850  {
851 
853  }
854 
855  public function yylex4()
856  {
857  if (!isset($this->yy_global_pattern4)) {
858  $this->yy_global_pattern4 = "/\G(" . $this->ldel . "\\s*literal\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*[\/]literal\\s*" . $this->rdel . ")|\G([\S\s])/isS";
859  }
860  if ($this->counter >= strlen($this->data)) {
861  return false; // end of input
862  }
863 
864  do {
865  if (preg_match($this->yy_global_pattern4, $this->data, $yymatches, null, $this->counter)) {
866  $yysubmatches = $yymatches;
867  if (strlen($yysubmatches[0]) < 200) {
868  $yymatches = preg_grep("/(.|\s)+/", $yysubmatches);
869  } else {
870  $yymatches = array_filter($yymatches, 'strlen');
871  }
872  if (empty($yymatches)) {
873  throw new Exception('Error: lexing failed because a rule matched' . ' an empty string. Input "' . substr($this->data, $this->counter, 5) . '... state LITERAL');
874  }
875  next($yymatches); // skip global match
876  $this->token = key($yymatches); // token number
877  $this->value = current($yymatches); // token value
878  $r = $this->{'yy_r4_' . $this->token}();
879  if ($r === null) {
880  $this->counter += strlen($this->value);
881  $this->line += substr_count($this->value, "\n");
882  // accept this token
883  return true;
884  } elseif ($r === true) {
885  // we have changed state
886  // process this token in the new state
887  return $this->yylex();
888  } elseif ($r === false) {
889  $this->counter += strlen($this->value);
890  $this->line += substr_count($this->value, "\n");
891  if ($this->counter >= strlen($this->data)) {
892  return false; // end of input
893  }
894  // skip this token
895  continue;
896  }
897  } else {
898  throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[$this->counter]);
899  }
900  break;
901  } while (true);
902  } // end function
903 
904  const LITERAL = 4;
905 
906  function yy_r4_1()
907  {
908 
909  $this->literal_cnt ++;
911  }
912 
913  function yy_r4_2()
914  {
915 
916  if ($this->literal_cnt) {
917  $this->literal_cnt --;
919  } else {
921  $this->yypopstate();
922  }
923  }
924 
925  function yy_r4_3()
926  {
927 
928  $to = strlen($this->data);
929  preg_match("~{$this->ldel}[/]?literal{$this->rdel}~i", $this->data, $match, PREG_OFFSET_CAPTURE, $this->counter);
930  if (isset($match[0][1])) {
931  $to = $match[0][1];
932  } else {
933  $this->compiler->trigger_template_error("missing or misspelled literal closing tag");
934  }
935  $this->value = substr($this->data, $this->counter, $to - $this->counter);
937  }
938 
939  public function yylex5()
940  {
941  if (!isset($this->yy_global_pattern5)) {
942  $this->yy_global_pattern5 = "/\G(" . $this->ldel . "\\s*literal\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*[\/]literal\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*[\/])|\G(" . $this->ldel . "\\s*[0-9]*[a-zA-Z_]\\w*)|\G(" . $this->ldel . "\\s*)|\G([\"])|\G([`][$])|\G([$][0-9]*[a-zA-Z_]\\w*)|\G([$])|\G(([^\"\\\\]*?)((?:\\\\.[^\"\\\\]*?)*?)(?=(" . $this->ldel . "|\\$|`\\$|\")))|\G([\S\s])/isS";
943  }
944  if ($this->counter >= strlen($this->data)) {
945  return false; // end of input
946  }
947 
948  do {
949  if (preg_match($this->yy_global_pattern5, $this->data, $yymatches, null, $this->counter)) {
950  $yysubmatches = $yymatches;
951  if (strlen($yysubmatches[0]) < 200) {
952  $yymatches = preg_grep("/(.|\s)+/", $yysubmatches);
953  } else {
954  $yymatches = array_filter($yymatches, 'strlen');
955  }
956  if (empty($yymatches)) {
957  throw new Exception('Error: lexing failed because a rule matched' . ' an empty string. Input "' . substr($this->data, $this->counter, 5) . '... state DOUBLEQUOTEDSTRING');
958  }
959  next($yymatches); // skip global match
960  $this->token = key($yymatches); // token number
961  $this->value = current($yymatches); // token value
962  $r = $this->{'yy_r5_' . $this->token}();
963  if ($r === null) {
964  $this->counter += strlen($this->value);
965  $this->line += substr_count($this->value, "\n");
966  // accept this token
967  return true;
968  } elseif ($r === true) {
969  // we have changed state
970  // process this token in the new state
971  return $this->yylex();
972  } elseif ($r === false) {
973  $this->counter += strlen($this->value);
974  $this->line += substr_count($this->value, "\n");
975  if ($this->counter >= strlen($this->data)) {
976  return false; // end of input
977  }
978  // skip this token
979  continue;
980  }
981  } else {
982  throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[$this->counter]);
983  }
984  break;
985  } while (true);
986  } // end function
987 
989 
990  function yy_r5_1()
991  {
992 
994  }
995 
996  function yy_r5_2()
997  {
998 
1000  }
1001 
1002  function yy_r5_3()
1003  {
1004 
1005  if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
1007  } else {
1008  $this->yypushstate(self::TAG);
1009  return true;
1010  }
1011  }
1012 
1013  function yy_r5_4()
1014  {
1015 
1016  if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
1018  } else {
1019  $this->yypushstate(self::TAG);
1020  return true;
1021  }
1022  }
1023 
1024  function yy_r5_5()
1025  {
1026 
1027  if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
1029  } else {
1031  $this->taglineno = $this->line;
1032  $this->yypushstate(self::TAGBODY);
1033  }
1034  }
1035 
1036  function yy_r5_6()
1037  {
1038 
1040  $this->yypopstate();
1041  }
1042 
1043  function yy_r5_7()
1044  {
1045 
1047  $this->value = substr($this->value, 0, - 1);
1048  $this->yypushstate(self::TAGBODY);
1049  $this->taglineno = $this->line;
1050  }
1051 
1052  function yy_r5_8()
1053  {
1054 
1056  }
1057 
1058  function yy_r5_9()
1059  {
1060 
1062  }
1063 
1064  function yy_r5_10()
1065  {
1066 
1068  }
1069 
1070  function yy_r5_14()
1071  {
1072 
1073  $to = strlen($this->data);
1074  $this->value = substr($this->data, $this->counter, $to - $this->counter);
1076  }
1077 
1078  public function yylex6()
1079  {
1080  if (!isset($this->yy_global_pattern6)) {
1081  $this->yy_global_pattern6 = "/\G(" . $this->ldel . "\\s*strip\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*[\/]strip\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*block)|\G([\S\s])/isS";
1082  }
1083  if ($this->counter >= strlen($this->data)) {
1084  return false; // end of input
1085  }
1086 
1087  do {
1088  if (preg_match($this->yy_global_pattern6, $this->data, $yymatches, null, $this->counter)) {
1089  $yysubmatches = $yymatches;
1090  if (strlen($yysubmatches[0]) < 200) {
1091  $yymatches = preg_grep("/(.|\s)+/", $yysubmatches);
1092  } else {
1093  $yymatches = array_filter($yymatches, 'strlen');
1094  }
1095  if (empty($yymatches)) {
1096  throw new Exception('Error: lexing failed because a rule matched' . ' an empty string. Input "' . substr($this->data, $this->counter, 5) . '... state CHILDBODY');
1097  }
1098  next($yymatches); // skip global match
1099  $this->token = key($yymatches); // token number
1100  $this->value = current($yymatches); // token value
1101  $r = $this->{'yy_r6_' . $this->token}();
1102  if ($r === null) {
1103  $this->counter += strlen($this->value);
1104  $this->line += substr_count($this->value, "\n");
1105  // accept this token
1106  return true;
1107  } elseif ($r === true) {
1108  // we have changed state
1109  // process this token in the new state
1110  return $this->yylex();
1111  } elseif ($r === false) {
1112  $this->counter += strlen($this->value);
1113  $this->line += substr_count($this->value, "\n");
1114  if ($this->counter >= strlen($this->data)) {
1115  return false; // end of input
1116  }
1117  // skip this token
1118  continue;
1119  }
1120  } else {
1121  throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[$this->counter]);
1122  }
1123  break;
1124  } while (true);
1125  } // end function
1126 
1127  const CHILDBODY = 6;
1128 
1129  function yy_r6_1()
1130  {
1131 
1132  if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
1133  return false;
1134  } else {
1136  }
1137  }
1138 
1139  function yy_r6_2()
1140  {
1141 
1142  if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
1143  return false;
1144  } else {
1146  }
1147  }
1148 
1149  function yy_r6_3()
1150  {
1151 
1152  if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
1153  return false;
1154  } else {
1155  $this->yypopstate();
1156  return true;
1157  }
1158  }
1159 
1160  function yy_r6_4()
1161  {
1162 
1163  $to = strlen($this->data);
1164  preg_match("~" . $this->ldel . "\s*(([/])?strip\s*" . $this->rdel . "|block\s+)~i", $this->data, $match, PREG_OFFSET_CAPTURE, $this->counter);
1165  if (isset($match[0][1])) {
1166  $to = $match[0][1];
1167  }
1168  $this->value = substr($this->data, $this->counter, $to - $this->counter);
1169  return false;
1170  }
1171 
1172  public function yylex7()
1173  {
1174  if (!isset($this->yy_global_pattern7)) {
1175  $this->yy_global_pattern7 = "/\G(" . $this->ldel . "\\s*literal\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*block)|\G(" . $this->ldel . "\\s*[\/]block)|\G(" . $this->ldel . "\\s*[$]smarty\\.block\\.(child|parent))|\G([\S\s])/isS";
1176  }
1177  if ($this->counter >= strlen($this->data)) {
1178  return false; // end of input
1179  }
1180 
1181  do {
1182  if (preg_match($this->yy_global_pattern7, $this->data, $yymatches, null, $this->counter)) {
1183  $yysubmatches = $yymatches;
1184  if (strlen($yysubmatches[0]) < 200) {
1185  $yymatches = preg_grep("/(.|\s)+/", $yysubmatches);
1186  } else {
1187  $yymatches = array_filter($yymatches, 'strlen');
1188  }
1189  if (empty($yymatches)) {
1190  throw new Exception('Error: lexing failed because a rule matched' . ' an empty string. Input "' . substr($this->data, $this->counter, 5) . '... state CHILDBLOCK');
1191  }
1192  next($yymatches); // skip global match
1193  $this->token = key($yymatches); // token number
1194  $this->value = current($yymatches); // token value
1195  $r = $this->{'yy_r7_' . $this->token}();
1196  if ($r === null) {
1197  $this->counter += strlen($this->value);
1198  $this->line += substr_count($this->value, "\n");
1199  // accept this token
1200  return true;
1201  } elseif ($r === true) {
1202  // we have changed state
1203  // process this token in the new state
1204  return $this->yylex();
1205  } elseif ($r === false) {
1206  $this->counter += strlen($this->value);
1207  $this->line += substr_count($this->value, "\n");
1208  if ($this->counter >= strlen($this->data)) {
1209  return false; // end of input
1210  }
1211  // skip this token
1212  continue;
1213  }
1214  } else {
1215  throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[$this->counter]);
1216  }
1217  break;
1218  } while (true);
1219  } // end function
1220 
1221  const CHILDBLOCK = 7;
1222 
1223  function yy_r7_1()
1224  {
1225 
1226  if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
1228  } else {
1230  $this->yypushstate(self::CHILDLITERAL);
1231  }
1232  }
1233 
1234  function yy_r7_2()
1235  {
1236 
1237  if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
1239  } else {
1240  $this->yypopstate();
1241  return true;
1242  }
1243  }
1244 
1245  function yy_r7_3()
1246  {
1247 
1248  if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
1250  } else {
1251  $this->yypopstate();
1252  return true;
1253  }
1254  }
1255 
1256  function yy_r7_4()
1257  {
1258 
1259  if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
1261  } else {
1262  $this->yypopstate();
1263  return true;
1264  }
1265  }
1266 
1267  function yy_r7_6()
1268  {
1269 
1270  $to = strlen($this->data);
1271  preg_match("~" . $this->ldel . "\s*(literal\s*" . $this->rdel . "|([/])?block(\s|" . $this->rdel . ")|[\$]smarty\.block\.(child|parent))~i", $this->data, $match, PREG_OFFSET_CAPTURE, $this->counter);
1272  if (isset($match[0][1])) {
1273  $to = $match[0][1];
1274  }
1275  $this->value = substr($this->data, $this->counter, $to - $this->counter);
1277  }
1278 
1279  public function yylex8()
1280  {
1281  if (!isset($this->yy_global_pattern8)) {
1282  $this->yy_global_pattern8 = "/\G(" . $this->ldel . "\\s*literal\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*[\/]literal\\s*" . $this->rdel . ")|\G([\S\s])/isS";
1283  }
1284  if ($this->counter >= strlen($this->data)) {
1285  return false; // end of input
1286  }
1287 
1288  do {
1289  if (preg_match($this->yy_global_pattern8, $this->data, $yymatches, null, $this->counter)) {
1290  $yysubmatches = $yymatches;
1291  if (strlen($yysubmatches[0]) < 200) {
1292  $yymatches = preg_grep("/(.|\s)+/", $yysubmatches);
1293  } else {
1294  $yymatches = array_filter($yymatches, 'strlen');
1295  }
1296  if (empty($yymatches)) {
1297  throw new Exception('Error: lexing failed because a rule matched' . ' an empty string. Input "' . substr($this->data, $this->counter, 5) . '... state CHILDLITERAL');
1298  }
1299  next($yymatches); // skip global match
1300  $this->token = key($yymatches); // token number
1301  $this->value = current($yymatches); // token value
1302  $r = $this->{'yy_r8_' . $this->token}();
1303  if ($r === null) {
1304  $this->counter += strlen($this->value);
1305  $this->line += substr_count($this->value, "\n");
1306  // accept this token
1307  return true;
1308  } elseif ($r === true) {
1309  // we have changed state
1310  // process this token in the new state
1311  return $this->yylex();
1312  } elseif ($r === false) {
1313  $this->counter += strlen($this->value);
1314  $this->line += substr_count($this->value, "\n");
1315  if ($this->counter >= strlen($this->data)) {
1316  return false; // end of input
1317  }
1318  // skip this token
1319  continue;
1320  }
1321  } else {
1322  throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[$this->counter]);
1323  }
1324  break;
1325  } while (true);
1326  } // end function
1327 
1328  const CHILDLITERAL = 8;
1329 
1330  function yy_r8_1()
1331  {
1332 
1333  if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
1335  } else {
1337  $this->yypushstate(self::CHILDLITERAL);
1338  }
1339  }
1340 
1341  function yy_r8_2()
1342  {
1343 
1344  if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
1346  } else {
1348  $this->yypopstate();
1349  }
1350  }
1351 
1352  function yy_r8_3()
1353  {
1354 
1355  $to = strlen($this->data);
1356  preg_match("~{$this->ldel}[/]?literal\s*{$this->rdel}~i", $this->data, $match, PREG_OFFSET_CAPTURE, $this->counter);
1357  if (isset($match[0][1])) {
1358  $to = $match[0][1];
1359  } else {
1360  $this->compiler->trigger_template_error("missing or misspelled literal closing tag");
1361  }
1362  $this->value = substr($this->data, $this->counter, $to - $this->counter);
1364  }
1365 
1366 }
1367 
1368 




Korrekturen, Hinweise und Ergänzungen

Bitte scheuen Sie sich nicht und melden Sie, was auf dieser Seite sachlich falsch oder irreführend ist, was ergänzt werden sollte, was fehlt usw. Dazu bitte oben aus dem Menü Seite den Eintrag Support Forum wählen. Es ist eine kostenlose Anmeldung erforderlich, um Anmerkungen zu posten. Unpassende Postings, Spam usw. werden kommentarlos entfernt.