11/* Generated by re2c 1.1.1 */
22#line 1 "parser/scanner.re"
3-
4- /*
5- * This file is part of the Zephir Parser.
3+ /* This file is part of the Zephir Parser.
64 *
75 * (c) Zephir Team <team@zephir-lang.com>
86 *
9- * For the full copyright and license information, please view the LICENSE
10- * file that was distributed with this source code.
7+ * For the full copyright and license information, please view
8+ * the LICENSE file that was distributed with this source code.
119 */
1210
1311#ifdef HAVE_CONFIG_H
1412# include "config.h"
1513#endif
1614
1715#include <php.h>
16+
1817#include "xx.h"
1918#include "scanner.h"
2019
21- #define YYCTYPE unsigned char
22- #define YYCURSOR (s->start)
23- #define YYLIMIT (s->end)
24- #define YYMARKER qm
20+ // for re2c...
21+ #define YYCTYPE char
22+ #define YYCURSOR (s->cursor)
23+ #define YYLIMIT (s->limit)
24+ #define YYMARKER (s->marker)
2525
2626int xx_get_token (xx_scanner_state * s , xx_scanner_token * token ) {
2727
28- char * start = YYCURSOR , * qm ;
28+ char * cursor = YYCURSOR ;
2929 int status = XX_SCANNER_RETCODE_IMPOSSIBLE ;
3030 int is_constant = 0 , j ;
3131
@@ -173,7 +173,7 @@ int xx_get_token(xx_scanner_state *s, xx_scanner_token *token) {
173173 YYDEBUG (8 , * YYCURSOR );
174174#line 985 "parser/scanner.re"
175175 {
176- s -> active_char += (YYCURSOR - start );
176+ s -> active_char += (YYCURSOR - cursor );
177177 token -> opcode = XX_T_IGNORE ;
178178 return 0 ;
179179 }
@@ -455,9 +455,9 @@ int xx_get_token(xx_scanner_state *s, xx_scanner_token *token) {
455455#line 37 "parser/scanner.re"
456456 {
457457 token -> opcode = XX_T_INTEGER ;
458- token -> value = estrndup (start , YYCURSOR - start );
459- token -> len = YYCURSOR - start ;
460- s -> active_char += (YYCURSOR - start );
458+ token -> value = estrndup (cursor , YYCURSOR - cursor );
459+ token -> len = YYCURSOR - cursor ;
460+ s -> active_char += (YYCURSOR - cursor );
461461 return 0 ;
462462 }
463463#line 464 "parser/scanner.c"
@@ -598,14 +598,14 @@ int xx_get_token(xx_scanner_state *s, xx_scanner_token *token) {
598598#line 586 "parser/scanner.re"
599599 {
600600
601- if (start [0 ] == '$' ) {
602- token -> value = estrndup (start + 1 , YYCURSOR - start - 1 );
603- token -> len = YYCURSOR - start - 1 ;
604- s -> active_char += (YYCURSOR - start - 1 );
601+ if (cursor [0 ] == '$' ) {
602+ token -> value = estrndup (cursor + 1 , YYCURSOR - cursor - 1 );
603+ token -> len = YYCURSOR - cursor - 1 ;
604+ s -> active_char += (YYCURSOR - cursor - 1 );
605605 } else {
606- token -> value = estrndup (start , YYCURSOR - start );
607- token -> len = YYCURSOR - start ;
608- s -> active_char += (YYCURSOR - start );
606+ token -> value = estrndup (cursor , YYCURSOR - cursor );
607+ token -> len = YYCURSOR - cursor ;
608+ s -> active_char += (YYCURSOR - cursor );
609609 }
610610
611611 if (token -> len > 3 && token -> value [0 ] == '_' ) {
@@ -1074,11 +1074,11 @@ int xx_get_token(xx_scanner_state *s, xx_scanner_token *token) {
10741074 YYDEBUG (94 , * YYCURSOR );
10751075#line 503 "parser/scanner.re"
10761076 {
1077- start ++ ;
1077+ cursor ++ ;
10781078 token -> opcode = XX_T_STRING ;
1079- token -> value = estrndup (start , YYCURSOR - start - 1 );
1080- token -> len = YYCURSOR - start - 1 ;
1081- s -> active_char += (YYCURSOR - start - 1 );
1079+ token -> value = estrndup (cursor , YYCURSOR - cursor - 1 );
1080+ token -> len = YYCURSOR - cursor - 1 ;
1081+ s -> active_char += (YYCURSOR - cursor - 1 );
10821082 return 0 ;
10831083 }
10841084#line 1085 "parser/scanner.c"
@@ -1147,11 +1147,11 @@ int xx_get_token(xx_scanner_state *s, xx_scanner_token *token) {
11471147 YYDEBUG (107 , * YYCURSOR );
11481148#line 481 "parser/scanner.re"
11491149 {
1150- start ++ ;
1150+ cursor ++ ;
11511151 token -> opcode = XX_T_CHAR ;
1152- token -> value = estrndup (start , YYCURSOR - start - 1 );
1153- token -> len = YYCURSOR - start - 1 ;
1154- s -> active_char += (YYCURSOR - start );
1152+ token -> value = estrndup (cursor , YYCURSOR - cursor - 1 );
1153+ token -> len = YYCURSOR - cursor - 1 ;
1154+ s -> active_char += (YYCURSOR - cursor );
11551155 return 0 ;
11561156 }
11571157#line 1158 "parser/scanner.c"
@@ -1275,7 +1275,7 @@ int xx_get_token(xx_scanner_state *s, xx_scanner_token *token) {
12751275 YYDEBUG (128 , * YYCURSOR );
12761276#line 556 "parser/scanner.re"
12771277 {
1278- s -> active_char += (YYCURSOR - start );
1278+ s -> active_char += (YYCURSOR - cursor );
12791279 token -> opcode = XX_T_IGNORE ;
12801280 return 0 ;
12811281 }
@@ -2312,9 +2312,9 @@ int xx_get_token(xx_scanner_state *s, xx_scanner_token *token) {
23122312#line 46 "parser/scanner.re"
23132313 {
23142314 token -> opcode = XX_T_DOUBLE ;
2315- token -> value = estrndup (start , YYCURSOR - start );
2316- token -> len = YYCURSOR - start ;
2317- s -> active_char += (YYCURSOR - start );
2315+ token -> value = estrndup (cursor , YYCURSOR - cursor );
2316+ token -> len = YYCURSOR - cursor ;
2317+ s -> active_char += (YYCURSOR - cursor );
23182318 return 0 ;
23192319 }
23202320#line 2321 "parser/scanner.c"
@@ -3365,12 +3365,12 @@ int xx_get_token(xx_scanner_state *s, xx_scanner_token *token) {
33653365 YYDEBUG (297 , * YYCURSOR );
33663366#line 492 "parser/scanner.re"
33673367 {
3368- start ++ ; /* ~ */
3369- start ++ ; /* " */
3368+ cursor ++ ; /* ~ */
3369+ cursor ++ ; /* " */
33703370 token -> opcode = XX_T_ISTRING ;
3371- token -> value = estrndup (start , YYCURSOR - start - 1 );
3372- token -> len = YYCURSOR - start - 1 ;
3373- s -> active_char += (YYCURSOR - start );
3371+ token -> value = estrndup (cursor , YYCURSOR - cursor - 1 );
3372+ token -> len = YYCURSOR - cursor - 1 ;
3373+ s -> active_char += (YYCURSOR - cursor );
33743374 return 0 ;
33753375 }
33763376#line 3377 "parser/scanner.c"
@@ -3388,11 +3388,11 @@ int xx_get_token(xx_scanner_state *s, xx_scanner_token *token) {
33883388 YYDEBUG (300 , * YYCURSOR );
33893389#line 563 "parser/scanner.re"
33903390 {
3391- start ++ ;
3392- start ++ ;
3391+ cursor ++ ;
3392+ cursor ++ ;
33933393 token -> opcode = XX_T_CBLOCK ;
3394- token -> value = estrndup (start , YYCURSOR - start - 2 );
3395- token -> len = YYCURSOR - start - 2 ;
3394+ token -> value = estrndup (cursor , YYCURSOR - cursor - 2 );
3395+ token -> len = YYCURSOR - cursor - 2 ;
33963396 {
33973397 int k , ch = s -> active_char ;
33983398 for (k = 0 ; k < (token -> len - 1 ); k ++ ) {
@@ -4670,8 +4670,8 @@ int xx_get_token(xx_scanner_state *s, xx_scanner_token *token) {
46704670#line 534 "parser/scanner.re"
46714671 {
46724672 token -> opcode = XX_T_IGNORE ;
4673- token -> value = estrndup (start , YYCURSOR - start - 1 );
4674- token -> len = YYCURSOR - start - 1 ;
4673+ token -> value = estrndup (cursor , YYCURSOR - cursor - 1 );
4674+ token -> len = YYCURSOR - cursor - 1 ;
46754675 {
46764676 int k , ch = s -> active_char ;
46774677 for (k = 0 ; k < (token -> len - 1 ); k ++ ) {
@@ -4695,10 +4695,10 @@ int xx_get_token(xx_scanner_state *s, xx_scanner_token *token) {
46954695 YYDEBUG (377 , * YYCURSOR );
46964696#line 513 "parser/scanner.re"
46974697 {
4698- start ++ ;
4698+ cursor ++ ;
46994699 token -> opcode = XX_T_COMMENT ;
4700- token -> value = estrndup (start , YYCURSOR - start - 1 );
4701- token -> len = YYCURSOR - start - 1 ;
4700+ token -> value = estrndup (cursor , YYCURSOR - cursor - 1 );
4701+ token -> len = YYCURSOR - cursor - 1 ;
47024702 {
47034703 int k , ch = s -> active_char ;
47044704 for (k = 0 ; k < (token -> len - 1 ); k ++ ) {
0 commit comments