From 0eb2c3dc52fd9fde9413a544c3ea7ebfe1ec0e89 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Tue, 21 Feb 2017 15:26:02 +0100 Subject: [PATCH] parser: regenerate with file header --- src/parser.c | 447 ++++++++++++++++++++++++++------------------------ src/parser.re | 25 +++ 2 files changed, 261 insertions(+), 211 deletions(-) diff --git a/src/parser.c b/src/parser.c index 97ef23f..9cafa4e 100644 --- a/src/parser.c +++ b/src/parser.c @@ -1,5 +1,30 @@ -/* Generated by re2c 0.16 on Mon Feb 20 20:39:25 2017 */ +/* Generated by re2c 0.16 on Tue Feb 21 15:25:35 2017 */ #line 1 "src/parser.re" +/******************************************************************************* + Copyright (c) 2016, Michael Wallner . + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*******************************************************************************/ + #include "php_psi_stdinc.h" #include #include @@ -230,7 +255,7 @@ token_t psi_parser_scan(struct psi_parser *P) nextline: P->tok = P->cur; -#line 234 "src/parser.c" +#line 259 "src/parser.c" { unsigned char yych; unsigned int yyaccept = 0; @@ -336,9 +361,9 @@ token_t psi_parser_scan(struct psi_parser *P) yy2: ++P->cur; yy3: -#line 346 "src/parser.re" +#line 371 "src/parser.re" {break;} -#line 342 "src/parser.c" +#line 367 "src/parser.c" yy4: ++P->cur; if (P->lim <= P->cur) { if (!psi_parser_fill(P,1)) RETURN(PSI_T_EOF); }; @@ -349,14 +374,14 @@ yy4: default: goto yy6; } yy6: -#line 281 "src/parser.re" +#line 306 "src/parser.re" { continue; } -#line 355 "src/parser.c" +#line 380 "src/parser.c" yy7: ++P->cur; -#line 280 "src/parser.re" +#line 305 "src/parser.re" { NEWLINE(nextline); } -#line 360 "src/parser.c" +#line 385 "src/parser.c" yy9: ++P->cur; switch ((yych = *P->cur)) { @@ -364,9 +389,9 @@ yy9: default: goto yy10; } yy10: -#line 265 "src/parser.re" +#line 290 "src/parser.re" {RETURN(PSI_T_NOT);} -#line 370 "src/parser.c" +#line 395 "src/parser.c" yy11: yyaccept = 0; yych = *(P->mrk = ++P->cur); @@ -448,9 +473,9 @@ yy13: } yy14: ++P->cur; -#line 266 "src/parser.re" +#line 291 "src/parser.re" {RETURN(PSI_T_MODULO);} -#line 454 "src/parser.c" +#line 479 "src/parser.c" yy16: ++P->cur; switch ((yych = *P->cur)) { @@ -458,24 +483,24 @@ yy16: default: goto yy17; } yy17: -#line 267 "src/parser.re" +#line 292 "src/parser.re" {RETURN(PSI_T_AMPERSAND);} -#line 464 "src/parser.c" +#line 489 "src/parser.c" yy18: ++P->cur; -#line 249 "src/parser.re" +#line 274 "src/parser.re" {RETURN(PSI_T_LPAREN);} -#line 469 "src/parser.c" +#line 494 "src/parser.c" yy20: ++P->cur; -#line 250 "src/parser.re" +#line 275 "src/parser.re" {RETURN(PSI_T_RPAREN);} -#line 474 "src/parser.c" +#line 499 "src/parser.c" yy22: ++P->cur; -#line 263 "src/parser.re" +#line 288 "src/parser.re" {RETURN(PSI_T_ASTERISK);} -#line 479 "src/parser.c" +#line 504 "src/parser.c" yy24: yyaccept = 1; yych = *(P->mrk = ++P->cur); @@ -494,14 +519,14 @@ yy24: default: goto yy25; } yy25: -#line 268 "src/parser.re" +#line 293 "src/parser.re" {RETURN(PSI_T_PLUS);} -#line 500 "src/parser.c" +#line 525 "src/parser.c" yy26: ++P->cur; -#line 252 "src/parser.re" +#line 277 "src/parser.re" {RETURN(PSI_T_COMMA);} -#line 505 "src/parser.c" +#line 530 "src/parser.c" yy28: yyaccept = 2; yych = *(P->mrk = ++P->cur); @@ -520,9 +545,9 @@ yy28: default: goto yy29; } yy29: -#line 269 "src/parser.re" +#line 294 "src/parser.re" {RETURN(PSI_T_MINUS);} -#line 526 "src/parser.c" +#line 551 "src/parser.c" yy30: yyaccept = 0; yych = *(P->mrk = ++P->cur); @@ -549,9 +574,9 @@ yy31: default: goto yy32; } yy32: -#line 270 "src/parser.re" +#line 295 "src/parser.re" {RETURN(PSI_T_SLASH);} -#line 555 "src/parser.c" +#line 580 "src/parser.c" yy33: yyaccept = 4; P->mrk = ++P->cur; @@ -574,19 +599,19 @@ yy33: default: goto yy35; } yy35: -#line 341 "src/parser.re" +#line 366 "src/parser.re" {RETURN(PSI_T_NUMBER);} -#line 580 "src/parser.c" +#line 605 "src/parser.c" yy36: ++P->cur; -#line 253 "src/parser.re" +#line 278 "src/parser.re" {RETURN(PSI_T_COLON);} -#line 585 "src/parser.c" +#line 610 "src/parser.c" yy38: ++P->cur; -#line 251 "src/parser.re" +#line 276 "src/parser.re" {RETURN(PSI_T_EOS);} -#line 590 "src/parser.c" +#line 615 "src/parser.c" yy40: ++P->cur; switch ((yych = *P->cur)) { @@ -595,9 +620,9 @@ yy40: default: goto yy41; } yy41: -#line 277 "src/parser.re" +#line 302 "src/parser.re" {RETURN(PSI_T_LCHEVR);} -#line 601 "src/parser.c" +#line 626 "src/parser.c" yy42: ++P->cur; switch ((yych = *P->cur)) { @@ -605,9 +630,9 @@ yy42: default: goto yy43; } yy43: -#line 262 "src/parser.re" +#line 287 "src/parser.re" {RETURN(PSI_T_EQUALS);} -#line 611 "src/parser.c" +#line 636 "src/parser.c" yy44: ++P->cur; switch ((yych = *P->cur)) { @@ -616,9 +641,9 @@ yy44: default: goto yy45; } yy45: -#line 278 "src/parser.re" +#line 303 "src/parser.re" {RETURN(PSI_T_RCHEVR);} -#line 622 "src/parser.c" +#line 647 "src/parser.c" yy46: yyaccept = 5; yych = *(P->mrk = ++P->cur); @@ -628,9 +653,9 @@ yy46: default: goto yy54; } yy47: -#line 342 "src/parser.re" +#line 367 "src/parser.re" {RETURN(PSI_T_NAME);} -#line 634 "src/parser.c" +#line 659 "src/parser.c" yy48: yyaccept = 5; yych = *(P->mrk = ++P->cur); @@ -874,9 +899,9 @@ yy66: } yy67: ++P->cur; -#line 256 "src/parser.re" +#line 281 "src/parser.re" {RETURN(PSI_T_LBRACKET);} -#line 880 "src/parser.c" +#line 905 "src/parser.c" yy69: yych = *++P->cur; switch (yych) { @@ -937,19 +962,19 @@ yy69: } yy70: ++P->cur; -#line 257 "src/parser.re" +#line 282 "src/parser.re" {RETURN(PSI_T_RBRACKET);} -#line 943 "src/parser.c" +#line 968 "src/parser.c" yy72: ++P->cur; -#line 272 "src/parser.re" +#line 297 "src/parser.re" {RETURN(PSI_T_CARET);} -#line 948 "src/parser.c" +#line 973 "src/parser.c" yy74: ++P->cur; -#line 254 "src/parser.re" +#line 279 "src/parser.re" {RETURN(PSI_T_LBRACE);} -#line 953 "src/parser.c" +#line 978 "src/parser.c" yy76: ++P->cur; switch ((yych = *P->cur)) { @@ -957,24 +982,24 @@ yy76: default: goto yy77; } yy77: -#line 271 "src/parser.re" +#line 296 "src/parser.re" {RETURN(PSI_T_PIPE);} -#line 963 "src/parser.c" +#line 988 "src/parser.c" yy78: ++P->cur; -#line 255 "src/parser.re" +#line 280 "src/parser.re" {RETURN(PSI_T_RBRACE);} -#line 968 "src/parser.c" +#line 993 "src/parser.c" yy80: ++P->cur; -#line 264 "src/parser.re" +#line 289 "src/parser.re" {RETURN(PSI_T_TILDE);} -#line 973 "src/parser.c" +#line 998 "src/parser.c" yy82: ++P->cur; -#line 258 "src/parser.re" +#line 283 "src/parser.re" {RETURN(PSI_T_CMP_NE);} -#line 978 "src/parser.c" +#line 1003 "src/parser.c" yy84: ++P->cur; if (P->lim <= P->cur) { if (!psi_parser_fill(P,1)) RETURN(PSI_T_EOF); }; @@ -994,9 +1019,9 @@ yy87: } yy88: ++P->cur; -#line 248 "src/parser.re" +#line 273 "src/parser.re" { NEWLINE(nextline); } -#line 1000 "src/parser.c" +#line 1025 "src/parser.c" yy90: ++P->cur; if (P->lim <= P->cur) { if (!psi_parser_fill(P,1)) RETURN(PSI_T_EOF); }; @@ -1068,14 +1093,14 @@ yy90: default: goto yy92; } yy92: -#line 344 "src/parser.re" +#line 369 "src/parser.re" {RETURN(PSI_T_DOLLAR_NAME);} -#line 1074 "src/parser.c" +#line 1099 "src/parser.c" yy93: ++P->cur; -#line 260 "src/parser.re" +#line 285 "src/parser.re" {RETURN(PSI_T_AND);} -#line 1079 "src/parser.c" +#line 1104 "src/parser.c" yy95: yych = *++P->cur; switch (yych) { @@ -1189,9 +1214,9 @@ yy98: } yy100: ++P->cur; -#line 247 "src/parser.re" +#line 272 "src/parser.re" { goto comment; } -#line 1195 "src/parser.c" +#line 1220 "src/parser.c" yy102: yych = *++P->cur; switch (yych) { @@ -1211,29 +1236,29 @@ yy102: } yy103: ++P->cur; -#line 273 "src/parser.re" +#line 298 "src/parser.re" {RETURN(PSI_T_LSHIFT);} -#line 1217 "src/parser.c" +#line 1242 "src/parser.c" yy105: ++P->cur; -#line 275 "src/parser.re" +#line 300 "src/parser.re" {RETURN(PSI_T_CMP_LE);} -#line 1222 "src/parser.c" +#line 1247 "src/parser.c" yy107: ++P->cur; -#line 259 "src/parser.re" +#line 284 "src/parser.re" {RETURN(PSI_T_CMP_EQ);} -#line 1227 "src/parser.c" +#line 1252 "src/parser.c" yy109: ++P->cur; -#line 276 "src/parser.re" +#line 301 "src/parser.re" {RETURN(PSI_T_CMP_GE);} -#line 1232 "src/parser.c" +#line 1257 "src/parser.c" yy111: ++P->cur; -#line 274 "src/parser.re" +#line 299 "src/parser.re" {RETURN(PSI_T_RSHIFT);} -#line 1237 "src/parser.c" +#line 1262 "src/parser.c" yy113: yyaccept = 5; yych = *(P->mrk = ++P->cur); @@ -1644,24 +1669,24 @@ yy148: default: goto yy150; } yy150: -#line 343 "src/parser.re" +#line 368 "src/parser.re" {RETURN(PSI_T_NSNAME);} -#line 1650 "src/parser.c" +#line 1675 "src/parser.c" yy151: ++P->cur; -#line 261 "src/parser.re" +#line 286 "src/parser.re" {RETURN(PSI_T_OR);} -#line 1655 "src/parser.c" +#line 1680 "src/parser.c" yy153: ++P->cur; -#line 345 "src/parser.re" +#line 370 "src/parser.re" {RETURN(PSI_T_QUOTED_STRING);} -#line 1660 "src/parser.c" +#line 1685 "src/parser.c" yy155: ++P->cur; -#line 279 "src/parser.re" +#line 304 "src/parser.re" {RETURN(PSI_T_ELLIPSIS);} -#line 1665 "src/parser.c" +#line 1690 "src/parser.c" yy157: yych = *++P->cur; switch (yych) { @@ -1863,9 +1888,9 @@ yy172: default: goto yy173; } yy173: -#line 291 "src/parser.re" +#line 316 "src/parser.re" {RETURN(PSI_T_INT);} -#line 1869 "src/parser.c" +#line 1894 "src/parser.c" yy174: yyaccept = 8; yych = *(P->mrk = ++P->cur); @@ -1937,9 +1962,9 @@ yy174: default: goto yy175; } yy175: -#line 317 "src/parser.re" +#line 342 "src/parser.re" {RETURN(PSI_T_LET);} -#line 1943 "src/parser.c" +#line 1968 "src/parser.c" yy176: yyaccept = 9; yych = *(P->mrk = ++P->cur); @@ -2011,9 +2036,9 @@ yy176: default: goto yy177; } yy177: -#line 316 "src/parser.re" +#line 341 "src/parser.re" {RETURN(PSI_T_LIB);} -#line 2017 "src/parser.c" +#line 2042 "src/parser.c" yy178: yyaccept = 5; yych = *(P->mrk = ++P->cur); @@ -2150,9 +2175,9 @@ yy186: default: goto yy187; } yy187: -#line 318 "src/parser.re" +#line 343 "src/parser.re" {RETURN(PSI_T_SET);} -#line 2156 "src/parser.c" +#line 2181 "src/parser.c" yy188: yyaccept = 5; yych = *(P->mrk = ++P->cur); @@ -2360,9 +2385,9 @@ yy203: default: goto yy204; } yy204: -#line 288 "src/parser.re" +#line 313 "src/parser.re" {RETURN(PSI_T_BOOL);} -#line 2366 "src/parser.c" +#line 2391 "src/parser.c" yy205: yyaccept = 5; yych = *(P->mrk = ++P->cur); @@ -2446,9 +2471,9 @@ yy206: default: goto yy207; } yy207: -#line 289 "src/parser.re" +#line 314 "src/parser.re" {RETURN(PSI_T_CHAR);} -#line 2452 "src/parser.c" +#line 2477 "src/parser.c" yy208: yyaccept = 5; yych = *(P->mrk = ++P->cur); @@ -2544,9 +2569,9 @@ yy211: default: goto yy212; } yy212: -#line 314 "src/parser.re" +#line 339 "src/parser.re" {RETURN(PSI_T_ENUM);} -#line 2550 "src/parser.c" +#line 2575 "src/parser.c" yy213: yyaccept = 5; yych = *(P->mrk = ++P->cur); @@ -2634,9 +2659,9 @@ yy215: default: goto yy216; } yy216: -#line 322 "src/parser.re" +#line 347 "src/parser.re" {RETURN(PSI_T_FREE);} -#line 2640 "src/parser.c" +#line 2665 "src/parser.c" yy217: yyaccept = 5; yych = *(P->mrk = ++P->cur); @@ -2752,9 +2777,9 @@ yy223: default: goto yy224; } yy224: -#line 292 "src/parser.re" +#line 317 "src/parser.re" {RETURN(PSI_T_LONG);} -#line 2758 "src/parser.c" +#line 2783 "src/parser.c" yy225: yyaccept = 5; yych = *(P->mrk = ++P->cur); @@ -2834,9 +2859,9 @@ yy226: default: goto yy227; } yy227: -#line 284 "src/parser.re" +#line 309 "src/parser.re" {RETURN(PSI_T_NULL);} -#line 2840 "src/parser.c" +#line 2865 "src/parser.c" yy228: yyaccept = 5; yych = *(P->mrk = ++P->cur); @@ -3011,9 +3036,9 @@ yy241: default: goto yy242; } yy242: -#line 323 "src/parser.re" +#line 348 "src/parser.re" {RETURN(PSI_T_TEMP);} -#line 3017 "src/parser.c" +#line 3042 "src/parser.c" yy243: yyaccept = 5; yych = *(P->mrk = ++P->cur); @@ -3133,9 +3158,9 @@ yy249: default: goto yy250; } yy250: -#line 282 "src/parser.re" +#line 307 "src/parser.re" {RETURN(PSI_T_TRUE);} -#line 3139 "src/parser.c" +#line 3164 "src/parser.c" yy251: yyaccept = 5; yych = *(P->mrk = ++P->cur); @@ -3241,9 +3266,9 @@ yy255: default: goto yy256; } yy256: -#line 287 "src/parser.re" +#line 312 "src/parser.re" {RETURN(PSI_T_VOID);} -#line 3247 "src/parser.c" +#line 3272 "src/parser.c" yy257: yyaccept = 20; yych = *(P->mrk = ++P->cur); @@ -3315,9 +3340,9 @@ yy257: default: goto yy258; } yy258: -#line 332 "src/parser.re" +#line 357 "src/parser.re" {RETURN(PSI_T_ZVAL);} -#line 3321 "src/parser.c" +#line 3346 "src/parser.c" yy259: yyaccept = 21; yych = *(P->mrk = ++P->cur); @@ -3389,9 +3414,9 @@ yy259: default: goto yy260; } yy260: -#line 306 "src/parser.re" +#line 331 "src/parser.re" {RETURN(PSI_T_ARRAY);} -#line 3395 "src/parser.c" +#line 3420 "src/parser.c" yy261: yyaccept = 5; yych = *(P->mrk = ++P->cur); @@ -3503,9 +3528,9 @@ yy266: default: goto yy267; } yy267: -#line 315 "src/parser.re" +#line 340 "src/parser.re" {RETURN(PSI_T_CONST);} -#line 3509 "src/parser.c" +#line 3534 "src/parser.c" yy268: yyaccept = 23; yych = *(P->mrk = ++P->cur); @@ -3577,9 +3602,9 @@ yy268: default: goto yy269; } yy269: -#line 333 "src/parser.re" +#line 358 "src/parser.re" {RETURN(PSI_T_COUNT);} -#line 3583 "src/parser.c" +#line 3608 "src/parser.c" yy270: yyaccept = 5; yych = *(P->mrk = ++P->cur); @@ -3659,9 +3684,9 @@ yy271: default: goto yy272; } yy272: -#line 283 "src/parser.re" +#line 308 "src/parser.re" {RETURN(PSI_T_FALSE);} -#line 3665 "src/parser.c" +#line 3690 "src/parser.c" yy273: yyaccept = 25; yych = *(P->mrk = ++P->cur); @@ -3733,9 +3758,9 @@ yy273: default: goto yy274; } yy274: -#line 293 "src/parser.re" +#line 318 "src/parser.re" {RETURN(PSI_T_FLOAT);} -#line 3739 "src/parser.c" +#line 3764 "src/parser.c" yy275: yyaccept = 5; yych = *(P->mrk = ++P->cur); @@ -3852,9 +3877,9 @@ yy281: default: goto yy282; } yy282: -#line 285 "src/parser.re" +#line 310 "src/parser.re" {RETURN(PSI_T_MIXED);} -#line 3858 "src/parser.c" +#line 3883 "src/parser.c" yy283: yyaccept = 5; yych = *(P->mrk = ++P->cur); @@ -3974,9 +3999,9 @@ yy289: default: goto yy290; } yy290: -#line 290 "src/parser.re" +#line 315 "src/parser.re" {RETURN(PSI_T_SHORT);} -#line 3980 "src/parser.c" +#line 4005 "src/parser.c" yy291: yyaccept = 5; yych = *(P->mrk = ++P->cur); @@ -4180,9 +4205,9 @@ yy308: default: goto yy309; } yy309: -#line 313 "src/parser.re" +#line 338 "src/parser.re" {RETURN(PSI_T_UNION);} -#line 4186 "src/parser.c" +#line 4211 "src/parser.c" yy310: yyaccept = 5; yych = *(P->mrk = ++P->cur); @@ -4262,9 +4287,9 @@ yy311: default: goto yy312; } yy312: -#line 330 "src/parser.re" +#line 355 "src/parser.re" {RETURN(PSI_T_ARRVAL);} -#line 4268 "src/parser.c" +#line 4293 "src/parser.c" yy313: yyaccept = 5; yych = *(P->mrk = ++P->cur); @@ -4360,9 +4385,9 @@ yy316: default: goto yy317; } yy317: -#line 334 "src/parser.re" +#line 359 "src/parser.re" {RETURN(PSI_T_CALLOC);} -#line 4366 "src/parser.c" +#line 4391 "src/parser.c" yy318: yyaccept = 31; yych = *(P->mrk = ++P->cur); @@ -4434,9 +4459,9 @@ yy318: default: goto yy319; } yy319: -#line 294 "src/parser.re" +#line 319 "src/parser.re" {RETURN(PSI_T_DOUBLE);} -#line 4440 "src/parser.c" +#line 4465 "src/parser.c" yy320: yyaccept = 5; yych = *(P->mrk = ++P->cur); @@ -4548,9 +4573,9 @@ yy325: default: goto yy326; } yy326: -#line 295 "src/parser.re" +#line 320 "src/parser.re" {RETURN(PSI_T_INT8);} -#line 4554 "src/parser.c" +#line 4579 "src/parser.c" yy327: yyaccept = 33; yych = *(P->mrk = ++P->cur); @@ -4622,9 +4647,9 @@ yy327: default: goto yy328; } yy328: -#line 327 "src/parser.re" +#line 352 "src/parser.re" {RETURN(PSI_T_INTVAL);} -#line 4628 "src/parser.c" +#line 4653 "src/parser.c" yy329: yyaccept = 34; yych = *(P->mrk = ++P->cur); @@ -4696,9 +4721,9 @@ yy329: default: goto yy330; } yy330: -#line 307 "src/parser.re" +#line 332 "src/parser.re" {RETURN(PSI_T_OBJECT);} -#line 4702 "src/parser.c" +#line 4727 "src/parser.c" yy331: yyaccept = 35; yych = *(P->mrk = ++P->cur); @@ -4770,9 +4795,9 @@ yy331: default: goto yy332; } yy332: -#line 331 "src/parser.re" +#line 356 "src/parser.re" {RETURN(PSI_T_OBJVAL);} -#line 4776 "src/parser.c" +#line 4801 "src/parser.c" yy333: yyaccept = 5; yych = *(P->mrk = ++P->cur); @@ -4868,9 +4893,9 @@ yy336: default: goto yy337; } yy337: -#line 321 "src/parser.re" +#line 346 "src/parser.re" {RETURN(PSI_T_RETURN);} -#line 4874 "src/parser.c" +#line 4899 "src/parser.c" yy338: yyaccept = 37; yych = *(P->mrk = ++P->cur); @@ -4942,9 +4967,9 @@ yy338: default: goto yy339; } yy339: -#line 304 "src/parser.re" +#line 329 "src/parser.re" {RETURN(PSI_T_SIGNED);} -#line 4948 "src/parser.c" +#line 4973 "src/parser.c" yy340: yyaccept = 38; yych = *(P->mrk = ++P->cur); @@ -5016,9 +5041,9 @@ yy340: default: goto yy341; } yy341: -#line 309 "src/parser.re" +#line 334 "src/parser.re" {RETURN(PSI_T_STATIC);} -#line 5022 "src/parser.c" +#line 5047 "src/parser.c" yy342: yyaccept = 39; yych = *(P->mrk = ++P->cur); @@ -5090,9 +5115,9 @@ yy342: default: goto yy343; } yy343: -#line 305 "src/parser.re" +#line 330 "src/parser.re" {RETURN(PSI_T_STRING);} -#line 5096 "src/parser.c" +#line 5121 "src/parser.c" yy344: yyaccept = 40; yych = *(P->mrk = ++P->cur); @@ -5164,9 +5189,9 @@ yy344: default: goto yy345; } yy345: -#line 324 "src/parser.re" +#line 349 "src/parser.re" {RETURN(PSI_T_STRLEN);} -#line 5170 "src/parser.c" +#line 5195 "src/parser.c" yy346: yyaccept = 41; yych = *(P->mrk = ++P->cur); @@ -5238,9 +5263,9 @@ yy346: default: goto yy347; } yy347: -#line 312 "src/parser.re" +#line 337 "src/parser.re" {RETURN(PSI_T_STRUCT);} -#line 5244 "src/parser.c" +#line 5269 "src/parser.c" yy348: yyaccept = 42; yych = *(P->mrk = ++P->cur); @@ -5312,9 +5337,9 @@ yy348: default: goto yy349; } yy349: -#line 325 "src/parser.re" +#line 350 "src/parser.re" {RETURN(PSI_T_STRVAL);} -#line 5318 "src/parser.c" +#line 5343 "src/parser.c" yy350: yyaccept = 5; yych = *(P->mrk = ++P->cur); @@ -5410,9 +5435,9 @@ yy353: default: goto yy354; } yy354: -#line 338 "src/parser.re" +#line 363 "src/parser.re" {RETURN(PSI_T_TO_INT);} -#line 5416 "src/parser.c" +#line 5441 "src/parser.c" yy355: yyaccept = 5; yych = *(P->mrk = ++P->cur); @@ -5545,9 +5570,9 @@ yy363: default: goto yy364; } yy364: -#line 329 "src/parser.re" +#line 354 "src/parser.re" {RETURN(PSI_T_BOOLVAL);} -#line 5551 "src/parser.c" +#line 5576 "src/parser.c" yy365: yyaccept = 5; yych = *(P->mrk = ++P->cur); @@ -5651,9 +5676,9 @@ yy369: default: goto yy370; } yy370: -#line 297 "src/parser.re" +#line 322 "src/parser.re" {RETURN(PSI_T_INT16);} -#line 5657 "src/parser.c" +#line 5682 "src/parser.c" yy371: yyaccept = 46; yych = *(P->mrk = ++P->cur); @@ -5725,9 +5750,9 @@ yy371: default: goto yy372; } yy372: -#line 299 "src/parser.re" +#line 324 "src/parser.re" {RETURN(PSI_T_INT32);} -#line 5731 "src/parser.c" +#line 5756 "src/parser.c" yy373: yyaccept = 47; yych = *(P->mrk = ++P->cur); @@ -5799,9 +5824,9 @@ yy373: default: goto yy374; } yy374: -#line 301 "src/parser.re" +#line 326 "src/parser.re" {RETURN(PSI_T_INT64);} -#line 5805 "src/parser.c" +#line 5830 "src/parser.c" yy375: yyaccept = 48; yych = *(P->mrk = ++P->cur); @@ -5873,9 +5898,9 @@ yy375: default: goto yy376; } yy376: -#line 326 "src/parser.re" +#line 351 "src/parser.re" {RETURN(PSI_T_PATHVAL);} -#line 5879 "src/parser.c" +#line 5904 "src/parser.c" yy377: yyaccept = 5; yych = *(P->mrk = ++P->cur); @@ -5971,9 +5996,9 @@ yy380: default: goto yy381; } yy381: -#line 340 "src/parser.re" +#line 365 "src/parser.re" {RETURN(PSI_T_TO_BOOL);} -#line 5977 "src/parser.c" +#line 6002 "src/parser.c" yy382: yyaccept = 5; yych = *(P->mrk = ++P->cur); @@ -6069,9 +6094,9 @@ yy385: default: goto yy386; } yy386: -#line 311 "src/parser.re" +#line 336 "src/parser.re" {RETURN(PSI_T_TYPEDEF);} -#line 6075 "src/parser.c" +#line 6100 "src/parser.c" yy387: yyaccept = 5; yych = *(P->mrk = ++P->cur); @@ -6167,9 +6192,9 @@ yy390: default: goto yy391; } yy391: -#line 296 "src/parser.re" +#line 321 "src/parser.re" {RETURN(PSI_T_UINT8);} -#line 6173 "src/parser.c" +#line 6198 "src/parser.c" yy392: yyaccept = 5; yych = *(P->mrk = ++P->cur); @@ -6249,9 +6274,9 @@ yy393: default: goto yy394; } yy394: -#line 286 "src/parser.re" +#line 311 "src/parser.re" {RETURN(PSI_T_CALLABLE);} -#line 6255 "src/parser.c" +#line 6280 "src/parser.c" yy395: yyaccept = 53; yych = *(P->mrk = ++P->cur); @@ -6323,9 +6348,9 @@ yy395: default: goto yy396; } yy396: -#line 308 "src/parser.re" +#line 333 "src/parser.re" {RETURN(PSI_T_CALLBACK);} -#line 6329 "src/parser.c" +#line 6354 "src/parser.c" yy397: yyaccept = 54; yych = *(P->mrk = ++P->cur); @@ -6397,9 +6422,9 @@ yy397: default: goto yy398; } yy398: -#line 328 "src/parser.re" +#line 353 "src/parser.re" {RETURN(PSI_T_FLOATVAL);} -#line 6403 "src/parser.c" +#line 6428 "src/parser.c" yy399: yyaccept = 55; yych = *(P->mrk = ++P->cur); @@ -6471,9 +6496,9 @@ yy399: default: goto yy400; } yy400: -#line 310 "src/parser.re" +#line 335 "src/parser.re" {RETURN(PSI_T_FUNCTION);} -#line 6477 "src/parser.c" +#line 6502 "src/parser.c" yy401: yyaccept = 5; yych = *(P->mrk = ++P->cur); @@ -6561,9 +6586,9 @@ yy403: default: goto yy404; } yy404: -#line 336 "src/parser.re" +#line 361 "src/parser.re" {RETURN(PSI_T_TO_ARRAY);} -#line 6567 "src/parser.c" +#line 6592 "src/parser.c" yy405: yyaccept = 57; yych = *(P->mrk = ++P->cur); @@ -6635,9 +6660,9 @@ yy405: default: goto yy406; } yy406: -#line 339 "src/parser.re" +#line 364 "src/parser.re" {RETURN(PSI_T_TO_FLOAT);} -#line 6641 "src/parser.c" +#line 6666 "src/parser.c" yy407: yyaccept = 5; yych = *(P->mrk = ++P->cur); @@ -6725,9 +6750,9 @@ yy409: default: goto yy410; } yy410: -#line 298 "src/parser.re" +#line 323 "src/parser.re" {RETURN(PSI_T_UINT16);} -#line 6731 "src/parser.c" +#line 6756 "src/parser.c" yy411: yyaccept = 59; yych = *(P->mrk = ++P->cur); @@ -6799,9 +6824,9 @@ yy411: default: goto yy412; } yy412: -#line 300 "src/parser.re" +#line 325 "src/parser.re" {RETURN(PSI_T_UINT32);} -#line 6805 "src/parser.c" +#line 6830 "src/parser.c" yy413: yyaccept = 60; yych = *(P->mrk = ++P->cur); @@ -6873,9 +6898,9 @@ yy413: default: goto yy414; } yy414: -#line 302 "src/parser.re" +#line 327 "src/parser.re" {RETURN(PSI_T_UINT64);} -#line 6879 "src/parser.c" +#line 6904 "src/parser.c" yy415: yyaccept = 61; yych = *(P->mrk = ++P->cur); @@ -6947,9 +6972,9 @@ yy415: default: goto yy416; } yy416: -#line 303 "src/parser.re" +#line 328 "src/parser.re" {RETURN(PSI_T_UNSIGNED);} -#line 6953 "src/parser.c" +#line 6978 "src/parser.c" yy417: yyaccept = 5; yych = *(P->mrk = ++P->cur); @@ -7037,9 +7062,9 @@ yy419: default: goto yy420; } yy420: -#line 335 "src/parser.re" +#line 360 "src/parser.re" {RETURN(PSI_T_TO_OBJECT);} -#line 7043 "src/parser.c" +#line 7068 "src/parser.c" yy421: yyaccept = 63; yych = *(P->mrk = ++P->cur); @@ -7111,9 +7136,9 @@ yy421: default: goto yy422; } yy422: -#line 337 "src/parser.re" +#line 362 "src/parser.re" {RETURN(PSI_T_TO_STRING);} -#line 7117 "src/parser.c" +#line 7142 "src/parser.c" yy423: yyaccept = 5; yych = *(P->mrk = ++P->cur); @@ -7193,9 +7218,9 @@ yy424: default: goto yy425; } yy425: -#line 319 "src/parser.re" +#line 344 "src/parser.re" {RETURN(PSI_T_PRE_ASSERT);} -#line 7199 "src/parser.c" +#line 7224 "src/parser.c" yy426: yyaccept = 65; yych = *(P->mrk = ++P->cur); @@ -7267,17 +7292,17 @@ yy426: default: goto yy427; } yy427: -#line 320 "src/parser.re" +#line 345 "src/parser.re" {RETURN(PSI_T_POST_ASSERT);} -#line 7273 "src/parser.c" +#line 7298 "src/parser.c" } -#line 347 "src/parser.re" +#line 372 "src/parser.re" comment: P->tok = P->cur; -#line 7281 "src/parser.c" +#line 7306 "src/parser.c" { unsigned char yych; if ((P->lim - P->cur) < 2) { if (!psi_parser_fill(P,2)) RETURN(PSI_T_EOF); }; @@ -7290,14 +7315,14 @@ yy427: yy430: ++P->cur; yy431: -#line 354 "src/parser.re" +#line 379 "src/parser.re" { goto comment; } -#line 7296 "src/parser.c" +#line 7321 "src/parser.c" yy432: ++P->cur; -#line 352 "src/parser.re" +#line 377 "src/parser.re" { NEWLINE(comment); } -#line 7301 "src/parser.c" +#line 7326 "src/parser.c" yy434: yych = *++P->cur; switch (yych) { @@ -7306,11 +7331,11 @@ yy434: } yy435: ++P->cur; -#line 353 "src/parser.re" +#line 378 "src/parser.re" { continue; } -#line 7312 "src/parser.c" +#line 7337 "src/parser.c" } -#line 355 "src/parser.re" +#line 380 "src/parser.re" } return -1; diff --git a/src/parser.re b/src/parser.re index df2d102..fb46080 100644 --- a/src/parser.re +++ b/src/parser.re @@ -1,3 +1,28 @@ +/******************************************************************************* + Copyright (c) 2016, Michael Wallner . + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*******************************************************************************/ + #include "php_psi_stdinc.h" #include #include -- 2.30.2