PEEL Shopping
Open source ecommerce : PEEL Shopping
smarty_internal_templatelexer.php
Go to the documentation of this file.
1 <?php
14 {
15  public $data;
16  public $counter;
17  public $token;
18  public $value;
19  public $node;
20  public $line;
21  public $taglineno;
22  public $state = 1;
23  private $heredoc_id_stack = Array();
24  public $smarty_token_names = array ( // Text for parser error messages
25  'IDENTITY' => '===',
26  'NONEIDENTITY' => '!==',
27  'EQUALS' => '==',
28  'NOTEQUALS' => '!=',
29  'GREATEREQUAL' => '(>=,ge)',
30  'LESSEQUAL' => '(<=,le)',
31  'GREATERTHAN' => '(>,gt)',
32  'LESSTHAN' => '(<,lt)',
33  'MOD' => '(%,mod)',
34  'NOT' => '(!,not)',
35  'LAND' => '(&&,and)',
36  'LOR' => '(||,or)',
37  'LXOR' => 'xor',
38  'OPENP' => '(',
39  'CLOSEP' => ')',
40  'OPENB' => '[',
41  'CLOSEB' => ']',
42  'PTR' => '->',
43  'APTR' => '=>',
44  'EQUAL' => '=',
45  'NUMBER' => 'number',
46  'UNIMATH' => '+" , "-',
47  'MATH' => '*" , "/" , "%',
48  'INCDEC' => '++" , "--',
49  'SPACE' => ' ',
50  'DOLLAR' => '$',
51  'SEMICOLON' => ';',
52  'COLON' => ':',
53  'DOUBLECOLON' => '::',
54  'AT' => '@',
55  'HATCH' => '#',
56  'QUOTE' => '"',
57  'BACKTICK' => '`',
58  'VERT' => '|',
59  'DOT' => '.',
60  'COMMA' => '","',
61  'ANDSYM' => '"&"',
62  'QMARK' => '"?"',
63  'ID' => 'identifier',
64  'TEXT' => 'text',
65  'FAKEPHPSTARTTAG' => 'Fake PHP start tag',
66  'PHPSTARTTAG' => 'PHP start tag',
67  'PHPENDTAG' => 'PHP end tag',
68  'LITERALSTART' => 'Literal start',
69  'LITERALEND' => 'Literal end',
70  'LDELSLASH' => 'closing tag',
71  'COMMENT' => 'comment',
72  'AS' => 'as',
73  'TO' => 'to',
74  );
75 
76 
77  function __construct($data,$compiler)
78  {
79 // $this->data = preg_replace("/(\r\n|\r|\n)/", "\n", $data);
80  $this->data = $data;
81  $this->counter = 0;
82  $this->line = 1;
83  $this->smarty = $compiler->smarty;
84  $this->compiler = $compiler;
85  $this->ldel = preg_quote($this->smarty->left_delimiter,'/');
86  $this->ldel_length = strlen($this->smarty->left_delimiter);
87  $this->rdel = preg_quote($this->smarty->right_delimiter,'/');
88  $this->rdel_length = strlen($this->smarty->right_delimiter);
89  $this->smarty_token_names['LDEL'] = $this->smarty->left_delimiter;
90  $this->smarty_token_names['RDEL'] = $this->smarty->right_delimiter;
91  $this->mbstring_overload = ini_get('mbstring.func_overload') & 2;
92  }
93 
94 
95  private $_yy_state = 1;
96  private $_yy_stack = array();
97 
98  function yylex()
99  {
100  return $this->{'yylex' . $this->_yy_state}();
101  }
102 
103  function yypushstate($state)
104  {
105  array_push($this->_yy_stack, $this->_yy_state);
106  $this->_yy_state = $state;
107  }
108 
109  function yypopstate()
110  {
111  $this->_yy_state = array_pop($this->_yy_stack);
112  }
113 
114  function yybegin($state)
115  {
116  $this->_yy_state = $state;
117  }
118 
119 
120 
121  function yylex1()
122  {
123  $tokenMap = array (
124  1 => 0,
125  2 => 0,
126  3 => 1,
127  5 => 0,
128  6 => 0,
129  7 => 0,
130  8 => 0,
131  9 => 0,
132  10 => 0,
133  11 => 1,
134  13 => 0,
135  14 => 0,
136  15 => 0,
137  16 => 0,
138  17 => 0,
139  18 => 0,
140  19 => 0,
141  20 => 0,
142  21 => 0,
143  22 => 0,
144  23 => 0,
145  24 => 0,
146  );
147  if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) {
148  return false; // end of input
149  }
150  $yy_global_pattern = "/\G(".$this->ldel."[$]smarty\\.block\\.child".$this->rdel.")|\G(\\{\\})|\G(".$this->ldel."\\*([\S\s]*?)\\*".$this->rdel.")|\G(".$this->ldel."strip".$this->rdel.")|\G(".$this->ldel."\\s{1,}strip\\s{1,}".$this->rdel.")|\G(".$this->ldel."\/strip".$this->rdel.")|\G(".$this->ldel."\\s{1,}\/strip\\s{1,}".$this->rdel.")|\G(".$this->ldel."\\s*literal\\s*".$this->rdel.")|\G(".$this->ldel."\\s{1,}\/)|\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{1,})|\G(".$this->ldel."\/)|\G(".$this->ldel.")|\G(<\\?(?:php\\w+|=|[a-zA-Z]+)?)|\G(\\?>)|\G(".$this->rdel.")|\G(<%)|\G(%>)|\G([\S\s])/iS";
151 
152  do {
153  if ($this->mbstring_overload ? preg_match($yy_global_pattern, mb_substr($this->data, $this->counter,2000000000,'latin1'), $yymatches) : preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) {
154  $yysubmatches = $yymatches;
155  $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
156  if (!count($yymatches)) {
157  throw new Exception('Error: lexing failed because a rule matched' .
158  ' an empty string. Input "' . substr($this->data,
159  $this->counter, 5) . '... state TEXT');
160  }
161  next($yymatches); // skip global match
162  $this->token = key($yymatches); // token number
163  if ($tokenMap[$this->token]) {
164  // extract sub-patterns for passing to lex function
165  $yysubmatches = array_slice($yysubmatches, $this->token + 1,
166  $tokenMap[$this->token]);
167  } else {
168  $yysubmatches = array();
169  }
170  $this->value = current($yymatches); // token value
171  $r = $this->{'yy_r1_' . $this->token}($yysubmatches);
172  if ($r === null) {
173  $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value));
174  $this->line += substr_count($this->value, "\n");
175  // accept this token
176  return true;
177  } elseif ($r === true) {
178  // we have changed state
179  // process this token in the new state
180  return $this->yylex();
181  } elseif ($r === false) {
182  $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value));
183  $this->line += substr_count($this->value, "\n");
184  if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) {
185  return false; // end of input
186  }
187  // skip this token
188  continue;
189  } } else {
190  throw new Exception('Unexpected input at line' . $this->line .
191  ': ' . $this->data[$this->counter]);
192  }
193  break;
194  } while (true);
195 
196  } // end function
197 
198 
199  const TEXT = 1;
200  function yy_r1_1($yy_subpatterns)
201  {
202 
204  }
205  function yy_r1_2($yy_subpatterns)
206  {
207 
209  }
210  function yy_r1_3($yy_subpatterns)
211  {
212 
214  }
215  function yy_r1_5($yy_subpatterns)
216  {
217 
219  }
220  function yy_r1_6($yy_subpatterns)
221  {
222 
223  if ($this->smarty->auto_literal) {
225  } else {
227  }
228  }
229  function yy_r1_7($yy_subpatterns)
230  {
231 
233  }
234  function yy_r1_8($yy_subpatterns)
235  {
236 
237  if ($this->smarty->auto_literal) {
239  } else {
241  }
242  }
243  function yy_r1_9($yy_subpatterns)
244  {
245 
247  $this->yypushstate(self::LITERAL);
248  }
249  function yy_r1_10($yy_subpatterns)
250  {
251 
252  if ($this->smarty->auto_literal) {
254  } else {
256  $this->yypushstate(self::SMARTY);
257  $this->taglineno = $this->line;
258  }
259  }
260  function yy_r1_11($yy_subpatterns)
261  {
262 
263  if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
265  } else {
267  $this->yypushstate(self::SMARTY);
268  $this->taglineno = $this->line;
269  }
270  }
271  function yy_r1_13($yy_subpatterns)
272  {
273 
274  if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
276  } else {
278  $this->yypushstate(self::SMARTY);
279  $this->taglineno = $this->line;
280  }
281  }
282  function yy_r1_14($yy_subpatterns)
283  {
284 
285  if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
287  } else {
289  $this->yypushstate(self::SMARTY);
290  $this->taglineno = $this->line;
291  }
292  }
293  function yy_r1_15($yy_subpatterns)
294  {
295 
296  if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
298  } else {
300  $this->yypushstate(self::SMARTY);
301  $this->taglineno = $this->line;
302  }
303  }
304  function yy_r1_16($yy_subpatterns)
305  {
306 
307  if ($this->smarty->auto_literal) {
309  } else {
311  $this->yypushstate(self::SMARTY);
312  $this->taglineno = $this->line;
313  }
314  }
315  function yy_r1_17($yy_subpatterns)
316  {
317 
319  $this->yypushstate(self::SMARTY);
320  $this->taglineno = $this->line;
321  }
322  function yy_r1_18($yy_subpatterns)
323  {
324 
326  $this->yypushstate(self::SMARTY);
327  $this->taglineno = $this->line;
328  }
329  function yy_r1_19($yy_subpatterns)
330  {
331 
332  if (in_array($this->value, Array('<?', '<?=', '<?php'))) {
334  } elseif ($this->value == '<?xml') {
336  } else {
338  $this->value = substr($this->value, 0, 2);
339  }
340  }
341  function yy_r1_20($yy_subpatterns)
342  {
343 
345  }
346  function yy_r1_21($yy_subpatterns)
347  {
348 
350  }
351  function yy_r1_22($yy_subpatterns)
352  {
353 
355  }
356  function yy_r1_23($yy_subpatterns)
357  {
358 
360  }
361  function yy_r1_24($yy_subpatterns)
362  {
363 
364  if ($this->mbstring_overload) {
365  $to = mb_strlen($this->data,'latin1');
366  } else {
367  $to = strlen($this->data);
368  }
369  preg_match("/{$this->ldel}|<\?|\?>|<%|%>/",$this->data,$match,PREG_OFFSET_CAPTURE,$this->counter);
370  if (isset($match[0][1])) {
371  $to = $match[0][1];
372  }
373  if ($this->mbstring_overload) {
374  $this->value = mb_substr($this->data,$this->counter,$to-$this->counter,'latin1');
375  } else {
376  $this->value = substr($this->data,$this->counter,$to-$this->counter);
377  }
379  }
380 
381 
382  function yylex2()
383  {
384  $tokenMap = array (
385  1 => 0,
386  2 => 0,
387  3 => 1,
388  5 => 0,
389  6 => 0,
390  7 => 0,
391  8 => 0,
392  9 => 0,
393  10 => 0,
394  11 => 0,
395  12 => 0,
396  13 => 0,
397  14 => 0,
398  15 => 0,
399  16 => 0,
400  17 => 0,
401  18 => 0,
402  19 => 0,
403  20 => 1,
404  22 => 1,
405  24 => 1,
406  26 => 0,
407  27 => 0,
408  28 => 0,
409  29 => 0,
410  30 => 0,
411  31 => 0,
412  32 => 0,
413  33 => 0,
414  34 => 0,
415  35 => 0,
416  36 => 0,
417  37 => 0,
418  38 => 0,
419  39 => 0,
420  40 => 0,
421  41 => 0,
422  42 => 0,
423  43 => 3,
424  47 => 0,
425  48 => 0,
426  49 => 0,
427  50 => 0,
428  51 => 0,
429  52 => 0,
430  53 => 0,
431  54 => 0,
432  55 => 1,
433  57 => 1,
434  59 => 0,
435  60 => 0,
436  61 => 0,
437  62 => 0,
438  63 => 0,
439  64 => 0,
440  65 => 0,
441  66 => 0,
442  67 => 0,
443  68 => 0,
444  69 => 0,
445  70 => 0,
446  71 => 0,
447  72 => 0,
448  73 => 0,
449  74 => 0,
450  75 => 0,
451  76 => 0,
452  77 => 0,
453  );
454  if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) {
455  return false; // end of input
456  }
457  $yy_global_pattern = "/\G('[^'\\\\]*(?:\\\\.[^'\\\\]*)*')|\G(".$this->ldel."\\s{1,}\/)|\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{1,})|\G(\\s{1,}".$this->rdel.")|\G(".$this->ldel."\/)|\G(".$this->ldel.")|\G(".$this->rdel.")|\G(\\s+is\\s+in\\s+)|\G(\\s+as\\s+)|\G(\\s+to\\s+)|\G(\\s+step\\s+)|\G(\\s+instanceof\\s+)|\G(\\s*===\\s*)|\G(\\s*!==\\s*)|\G(\\s*==\\s*|\\s+eq\\s+)|\G(\\s*!=\\s*|\\s*<>\\s*|\\s+(ne|neq)\\s+)|\G(\\s*>=\\s*|\\s+(ge|gte)\\s+)|\G(\\s*<=\\s*|\\s+(le|lte)\\s+)|\G(\\s*>\\s*|\\s+gt\\s+)|\G(\\s*<\\s*|\\s+lt\\s+)|\G(\\s+mod\\s+)|\G(!\\s*|not\\s+)|\G(\\s*&&\\s*|\\s*and\\s+)|\G(\\s*\\|\\|\\s*|\\s*or\\s+)|\G(\\s*xor\\s+)|\G(\\s+is\\s+odd\\s+by\\s+)|\G(\\s+is\\s+not\\s+odd\\s+by\\s+)|\G(\\s+is\\s+odd)|\G(\\s+is\\s+not\\s+odd)|\G(\\s+is\\s+even\\s+by\\s+)|\G(\\s+is\\s+not\\s+even\\s+by\\s+)|\G(\\s+is\\s+even)|\G(\\s+is\\s+not\\s+even)|\G(\\s+is\\s+div\\s+by\\s+)|\G(\\s+is\\s+not\\s+div\\s+by\\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(\\+\\+|--)|\G(\\s*(\\+|-)\\s*)|\G(\\s*(\\*|\/|%)\\s*)|\G(\\$)|\G(\\s*;)|\G(::)|\G(\\s*:\\s*)|\G(@)|\G(#)|\G(\")|\G(`)|\G(\\|)|\G(\\.)|\G(\\s*,\\s*)|\G(\\s*&\\s*)|\G(\\s*\\?\\s*)|\G(0[xX][0-9a-fA-F]+)|\G(\\s+[0-9]*[a-zA-Z_][a-zA-Z0-9_\-:]*\\s*=\\s*)|\G([0-9]*[a-zA-Z_]\\w*)|\G(\\d+)|\G(\\s+)|\G([\S\s])/iS";
458 
459  do {
460  if ($this->mbstring_overload ? preg_match($yy_global_pattern, mb_substr($this->data, $this->counter,2000000000,'latin1'), $yymatches) : preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) {
461  $yysubmatches = $yymatches;
462  $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
463  if (!count($yymatches)) {
464  throw new Exception('Error: lexing failed because a rule matched' .
465  ' an empty string. Input "' . substr($this->data,
466  $this->counter, 5) . '... state SMARTY');
467  }
468  next($yymatches); // skip global match
469  $this->token = key($yymatches); // token number
470  if ($tokenMap[$this->token]) {
471  // extract sub-patterns for passing to lex function
472  $yysubmatches = array_slice($yysubmatches, $this->token + 1,
473  $tokenMap[$this->token]);
474  } else {
475  $yysubmatches = array();
476  }
477  $this->value = current($yymatches); // token value
478  $r = $this->{'yy_r2_' . $this->token}($yysubmatches);
479  if ($r === null) {
480  $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value));
481  $this->line += substr_count($this->value, "\n");
482  // accept this token
483  return true;
484  } elseif ($r === true) {
485  // we have changed state
486  // process this token in the new state
487  return $this->yylex();
488  } elseif ($r === false) {
489  $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value));
490  $this->line += substr_count($this->value, "\n");
491  if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) {
492  return false; // end of input
493  }
494  // skip this token
495  continue;
496  } } else {
497  throw new Exception('Unexpected input at line' . $this->line .
498  ': ' . $this->data[$this->counter]);
499  }
500  break;
501  } while (true);
502 
503  } // end function
504 
505 
506  const SMARTY = 2;
507  function yy_r2_1($yy_subpatterns)
508  {
509 
511  }
512  function yy_r2_2($yy_subpatterns)
513  {
514 
515  if ($this->smarty->auto_literal) {
517  } else {
519  $this->yypushstate(self::SMARTY);
520  $this->taglineno = $this->line;
521  }
522  }
523  function yy_r2_3($yy_subpatterns)
524  {
525 
526  if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
528  } else {
530  $this->yypushstate(self::SMARTY);
531  $this->taglineno = $this->line;
532  }
533  }
534  function yy_r2_5($yy_subpatterns)
535  {
536 
537  if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
539  } else {
541  $this->yypushstate(self::SMARTY);
542  $this->taglineno = $this->line;
543  }
544  }
545  function yy_r2_6($yy_subpatterns)
546  {
547 
548  if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
550  } else {
552  $this->yypushstate(self::SMARTY);
553  $this->taglineno = $this->line;
554  }
555  }
556  function yy_r2_7($yy_subpatterns)
557  {
558 
559  if ($this->smarty->auto_literal) {
561  } else {
563  $this->yypushstate(self::SMARTY);
564  $this->taglineno = $this->line;
565  }
566  }
567  function yy_r2_8($yy_subpatterns)
568  {
569 
571  $this->yypopstate();
572  }
573  function yy_r2_9($yy_subpatterns)
574  {
575 
577  $this->yypushstate(self::SMARTY);
578  $this->taglineno = $this->line;
579  }
580  function yy_r2_10($yy_subpatterns)
581  {
582 
584  $this->yypushstate(self::SMARTY);
585  $this->taglineno = $this->line;
586  }
587  function yy_r2_11($yy_subpatterns)
588  {
589 
591  $this->yypopstate();
592  }
593  function yy_r2_12($yy_subpatterns)
594  {
595 
597  }
598  function yy_r2_13($yy_subpatterns)
599  {
600 
602  }
603  function yy_r2_14($yy_subpatterns)
604  {
605 
607  }
608  function yy_r2_15($yy_subpatterns)
609  {
610 
612  }
613  function yy_r2_16($yy_subpatterns)
614  {
615 
617  }
618  function yy_r2_17($yy_subpatterns)
619  {
620 
622  }
623  function yy_r2_18($yy_subpatterns)
624  {
625 
627  }
628  function yy_r2_19($yy_subpatterns)
629  {
630 
632  }
633  function yy_r2_20($yy_subpatterns)
634  {
635 
637  }
638  function yy_r2_22($yy_subpatterns)
639  {
640 
642  }
643  function yy_r2_24($yy_subpatterns)
644  {
645 
647  }
648  function yy_r2_26($yy_subpatterns)
649  {
650 
652  }
653  function yy_r2_27($yy_subpatterns)
654  {
655 
657  }
658  function yy_r2_28($yy_subpatterns)
659  {
660 
662  }
663  function yy_r2_29($yy_subpatterns)
664  {
665 
667  }
668  function yy_r2_30($yy_subpatterns)
669  {
670 
672  }
673  function yy_r2_31($yy_subpatterns)
674  {
675 
677  }
678  function yy_r2_32($yy_subpatterns)
679  {
680 
682  }
683  function yy_r2_33($yy_subpatterns)
684  {
685 
687  }
688  function yy_r2_34($yy_subpatterns)
689  {
690 
692  }
693  function yy_r2_35($yy_subpatterns)
694  {
695 
697  }
698  function yy_r2_36($yy_subpatterns)
699  {
700 
702  }
703  function yy_r2_37($yy_subpatterns)
704  {
705 
707  }
708  function yy_r2_38($yy_subpatterns)
709  {
710 
712  }
713  function yy_r2_39($yy_subpatterns)
714  {
715 
717  }
718  function yy_r2_40($yy_subpatterns)
719  {
720 
722  }
723  function yy_r2_41($yy_subpatterns)
724  {
725 
727  }
728  function yy_r2_42($yy_subpatterns)
729  {
730 
732  }
733  function yy_r2_43($yy_subpatterns)
734  {
735 
737  }
738  function yy_r2_47($yy_subpatterns)
739  {
740 
742  }
743  function yy_r2_48($yy_subpatterns)
744  {
745 
747  }
748  function yy_r2_49($yy_subpatterns)
749  {
750 
752  }
753  function yy_r2_50($yy_subpatterns)
754  {
755 
757  }
758  function yy_r2_51($yy_subpatterns)
759  {
760 
762  }
763  function yy_r2_52($yy_subpatterns)
764  {
765 
767  }
768  function yy_r2_53($yy_subpatterns)
769  {
770 
772  }
773  function yy_r2_54($yy_subpatterns)
774  {
775 
777  }
778  function yy_r2_55($yy_subpatterns)
779  {
780 
782  }
783  function yy_r2_57($yy_subpatterns)
784  {
785 
787  }
788  function yy_r2_59($yy_subpatterns)
789  {
790 
792  }
793  function yy_r2_60($yy_subpatterns)
794  {
795 
797  }
798  function yy_r2_61($yy_subpatterns)
799  {
800 
802  }
803  function yy_r2_62($yy_subpatterns)
804  {
805 
807  }
808  function yy_r2_63($yy_subpatterns)
809  {
810 
812  }
813  function yy_r2_64($yy_subpatterns)
814  {
815 
817  }
818  function yy_r2_65($yy_subpatterns)
819  {
820 
822  $this->yypushstate(self::DOUBLEQUOTEDSTRING);
823  }
824  function yy_r2_66($yy_subpatterns)
825  {
826 
828  $this->yypopstate();
829  }
830  function yy_r2_67($yy_subpatterns)
831  {
832 
834  }
835  function yy_r2_68($yy_subpatterns)
836  {
837 
839  }
840  function yy_r2_69($yy_subpatterns)
841  {
842 
844  }
845  function yy_r2_70($yy_subpatterns)
846  {
847 
849  }
850  function yy_r2_71($yy_subpatterns)
851  {
852 
854  }
855  function yy_r2_72($yy_subpatterns)
856  {
857 
859  }
860  function yy_r2_73($yy_subpatterns)
861  {
862 
863  // resolve conflicts with shorttag and right_delimiter starting with '='
864  if (substr($this->data, $this->counter + strlen($this->value) - 1, $this->rdel_length) == $this->smarty->right_delimiter) {
865  preg_match("/\s+/",$this->value,$match);
866  $this->value = $match[0];
868  } else {
870  }
871  }
872  function yy_r2_74($yy_subpatterns)
873  {
874 
876  }
877  function yy_r2_75($yy_subpatterns)
878  {
879 
881  }
882  function yy_r2_76($yy_subpatterns)
883  {
884 
886  }
887  function yy_r2_77($yy_subpatterns)
888  {
889 
891  }
892 
893 
894 
895  function yylex3()
896  {
897  $tokenMap = array (
898  1 => 0,
899  2 => 0,
900  3 => 0,
901  4 => 0,
902  5 => 0,
903  6 => 0,
904  7 => 0,
905  );
906  if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) {
907  return false; // end of input
908  }
909  $yy_global_pattern = "/\G(".$this->ldel."\\s*literal\\s*".$this->rdel.")|\G(".$this->ldel."\\s*\/literal\\s*".$this->rdel.")|\G(<\\?(?:php\\w+|=|[a-zA-Z]+)?)|\G(\\?>)|\G(<%)|\G(%>)|\G([\S\s])/iS";
910 
911  do {
912  if ($this->mbstring_overload ? preg_match($yy_global_pattern, mb_substr($this->data, $this->counter,2000000000,'latin1'), $yymatches) : preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) {
913  $yysubmatches = $yymatches;
914  $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
915  if (!count($yymatches)) {
916  throw new Exception('Error: lexing failed because a rule matched' .
917  ' an empty string. Input "' . substr($this->data,
918  $this->counter, 5) . '... state LITERAL');
919  }
920  next($yymatches); // skip global match
921  $this->token = key($yymatches); // token number
922  if ($tokenMap[$this->token]) {
923  // extract sub-patterns for passing to lex function
924  $yysubmatches = array_slice($yysubmatches, $this->token + 1,
925  $tokenMap[$this->token]);
926  } else {
927  $yysubmatches = array();
928  }
929  $this->value = current($yymatches); // token value
930  $r = $this->{'yy_r3_' . $this->token}($yysubmatches);
931  if ($r === null) {
932  $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value));
933  $this->line += substr_count($this->value, "\n");
934  // accept this token
935  return true;
936  } elseif ($r === true) {
937  // we have changed state
938  // process this token in the new state
939  return $this->yylex();
940  } elseif ($r === false) {
941  $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value));
942  $this->line += substr_count($this->value, "\n");
943  if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) {
944  return false; // end of input
945  }
946  // skip this token
947  continue;
948  } } else {
949  throw new Exception('Unexpected input at line' . $this->line .
950  ': ' . $this->data[$this->counter]);
951  }
952  break;
953  } while (true);
954 
955  } // end function
956 
957 
958  const LITERAL = 3;
959  function yy_r3_1($yy_subpatterns)
960  {
961 
963  $this->yypushstate(self::LITERAL);
964  }
965  function yy_r3_2($yy_subpatterns)
966  {
967 
969  $this->yypopstate();
970  }
971  function yy_r3_3($yy_subpatterns)
972  {
973 
974  if (in_array($this->value, Array('<?', '<?=', '<?php'))) {
976  } else {
978  $this->value = substr($this->value, 0, 2);
979  }
980  }
981  function yy_r3_4($yy_subpatterns)
982  {
983 
985  }
986  function yy_r3_5($yy_subpatterns)
987  {
988 
990  }
991  function yy_r3_6($yy_subpatterns)
992  {
993 
995  }
996  function yy_r3_7($yy_subpatterns)
997  {
998 
999  if ($this->mbstring_overload) {
1000  $to = mb_strlen($this->data,'latin1');
1001  } else {
1002  $to = strlen($this->data);
1003  }
1004  preg_match("/{$this->ldel}\/?literal{$this->rdel}|<\?|<%|\?>|%>/",$this->data,$match,PREG_OFFSET_CAPTURE,$this->counter);
1005  if (isset($match[0][1])) {
1006  $to = $match[0][1];
1007  } else {
1008  $this->compiler->trigger_template_error ("missing or misspelled literal closing tag");
1009  }
1010  if ($this->mbstring_overload) {
1011  $this->value = mb_substr($this->data,$this->counter,$to-$this->counter,'latin1');
1012  } else {
1013  $this->value = substr($this->data,$this->counter,$to-$this->counter);
1014  }
1016  }
1017 
1018 
1019  function yylex4()
1020  {
1021  $tokenMap = array (
1022  1 => 0,
1023  2 => 1,
1024  4 => 0,
1025  5 => 0,
1026  6 => 0,
1027  7 => 0,
1028  8 => 0,
1029  9 => 0,
1030  10 => 0,
1031  11 => 0,
1032  12 => 0,
1033  13 => 3,
1034  17 => 0,
1035  );
1036  if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) {
1037  return false; // end of input
1038  }
1039  $yy_global_pattern = "/\G(".$this->ldel."\\s{1,}\/)|\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{1,})|\G(".$this->ldel."\/)|\G(".$this->ldel.")|\G(\")|\G(`\\$)|\G(\\$[0-9]*[a-zA-Z_]\\w*)|\G(\\$)|\G(([^\"\\\\]*?)((?:\\\\.[^\"\\\\]*?)*?)(?=(".$this->ldel."|\\$|`\\$|\")))|\G([\S\s])/iS";
1040 
1041  do {
1042  if ($this->mbstring_overload ? preg_match($yy_global_pattern, mb_substr($this->data, $this->counter,2000000000,'latin1'), $yymatches) : preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) {
1043  $yysubmatches = $yymatches;
1044  $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
1045  if (!count($yymatches)) {
1046  throw new Exception('Error: lexing failed because a rule matched' .
1047  ' an empty string. Input "' . substr($this->data,
1048  $this->counter, 5) . '... state DOUBLEQUOTEDSTRING');
1049  }
1050  next($yymatches); // skip global match
1051  $this->token = key($yymatches); // token number
1052  if ($tokenMap[$this->token]) {
1053  // extract sub-patterns for passing to lex function
1054  $yysubmatches = array_slice($yysubmatches, $this->token + 1,
1055  $tokenMap[$this->token]);
1056  } else {
1057  $yysubmatches = array();
1058  }
1059  $this->value = current($yymatches); // token value
1060  $r = $this->{'yy_r4_' . $this->token}($yysubmatches);
1061  if ($r === null) {
1062  $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value));
1063  $this->line += substr_count($this->value, "\n");
1064  // accept this token
1065  return true;
1066  } elseif ($r === true) {
1067  // we have changed state
1068  // process this token in the new state
1069  return $this->yylex();
1070  } elseif ($r === false) {
1071  $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value));
1072  $this->line += substr_count($this->value, "\n");
1073  if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) {
1074  return false; // end of input
1075  }
1076  // skip this token
1077  continue;
1078  } } else {
1079  throw new Exception('Unexpected input at line' . $this->line .
1080  ': ' . $this->data[$this->counter]);
1081  }
1082  break;
1083  } while (true);
1084 
1085  } // end function
1086 
1087 
1089  function yy_r4_1($yy_subpatterns)
1090  {
1091 
1092  if ($this->smarty->auto_literal) {
1094  } else {
1096  $this->yypushstate(self::SMARTY);
1097  $this->taglineno = $this->line;
1098  }
1099  }
1100  function yy_r4_2($yy_subpatterns)
1101  {
1102 
1103  if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
1105  } else {
1107  $this->yypushstate(self::SMARTY);
1108  $this->taglineno = $this->line;
1109  }
1110  }
1111  function yy_r4_4($yy_subpatterns)
1112  {
1113 
1114  if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
1116  } else {
1118  $this->yypushstate(self::SMARTY);
1119  $this->taglineno = $this->line;
1120  }
1121  }
1122  function yy_r4_5($yy_subpatterns)
1123  {
1124 
1125  if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
1127  } else {
1129  $this->yypushstate(self::SMARTY);
1130  $this->taglineno = $this->line;
1131  }
1132  }
1133  function yy_r4_6($yy_subpatterns)
1134  {
1135 
1136  if ($this->smarty->auto_literal) {
1138  } else {
1140  $this->yypushstate(self::SMARTY);
1141  $this->taglineno = $this->line;
1142  }
1143  }
1144  function yy_r4_7($yy_subpatterns)
1145  {
1146 
1148  $this->yypushstate(self::SMARTY);
1149  $this->taglineno = $this->line;
1150  }
1151  function yy_r4_8($yy_subpatterns)
1152  {
1153 
1155  $this->yypushstate(self::SMARTY);
1156  $this->taglineno = $this->line;
1157  }
1158  function yy_r4_9($yy_subpatterns)
1159  {
1160 
1162  $this->yypopstate();
1163  }
1164  function yy_r4_10($yy_subpatterns)
1165  {
1166 
1168  $this->value = substr($this->value,0,-1);
1169  $this->yypushstate(self::SMARTY);
1170  $this->taglineno = $this->line;
1171  }
1172  function yy_r4_11($yy_subpatterns)
1173  {
1174 
1176  }
1177  function yy_r4_12($yy_subpatterns)
1178  {
1179 
1181  }
1182  function yy_r4_13($yy_subpatterns)
1183  {
1184 
1186  }
1187  function yy_r4_17($yy_subpatterns)
1188  {
1189 
1190  if ($this->mbstring_overload) {
1191  $to = mb_strlen($this->data,'latin1');
1192  } else {
1193  $to = strlen($this->data);
1194  }
1195  if ($this->mbstring_overload) {
1196  $this->value = mb_substr($this->data,$this->counter,$to-$this->counter,'latin1');
1197  } else {
1198  $this->value = substr($this->data,$this->counter,$to-$this->counter);
1199  }
1201  }
1202 
1203 }
Smarty Internal Plugin Templatelexer.
if(strlen($date2)== '10') if($type== 'users-by-age'&&a_priv('admin_users', true)) elseif($type== 'forums-count'&&a_priv('admin_content', true)) elseif($type== 'forums-categories'&&a_priv('admin_content', true)) elseif($type== 'users-count'&&a_priv('admin_users', true)) elseif($type== 'product-categories'&&a_priv('admin_products', true)) elseif($type== 'users-by-sex'&&a_priv('admin_users', true)) elseif($type== 'users-by-country'&&a_priv('admin_users', true)) elseif($type== 'sales'&&a_priv('admin_sales', true))
Definition: chart-data.php:160
$match
Definition: search.php:86

This documentation for Open ecommerce PEEL Shopping and PEEL.fr has been generated by Doxygen on Thu Oct 15 2015 14:41:17 - Peel ecommerce is a product of Agence web Advisto SAS. All rights reserved.