-/* Generated by re2c 0.5 on Wed Sep 20 10:36:10 2000 */
+/* Generated by re2c 0.5 on Wed Sep 20 10:58:28 2000 */
#line 1 "/home/sas/src/php4/ext/standard/url_scanner_ex.re"
/*
+----------------------------------------------------------------------+
tag_arg(ctx PLS_CC); \
}
+#ifdef SCANNER_DEBUG
+#define scdebug(x) printf x
+#else
+#define scdebug(x)
+#endif
+
static inline void mainloop(url_adapt_state_ex_t *ctx, const char *newdata, size_t newlen)
{
char *end, *q;
YYCURSOR = ctx->buf.c;
YYLIMIT = ctx->buf.c + ctx->buf.len;
-#line 263
+#line 269
while(1) {
start = YYCURSOR;
-#ifdef SCANNER_DEBUG
- printf("state %d at %s\n", STATE, YYCURSOR);
-#endif
+ scdebug(("state %d at %s\n", STATE, YYCURSOR));
switch(STATE) {
case STATE_PLAIN:
if(yych != '<') goto yy4;
yy2: yych = *++YYCURSOR;
yy3:
-#line 274
+#line 278
{ PASSTHRU(); STATE = STATE_TAG; continue; }
yy4: yych = *++YYCURSOR;
yy5:
-#line 275
+#line 279
{ PASSTHRU(); continue; }
}
-#line 276
+#line 280
break;
yy8: yych = *++YYCURSOR;
goto yy13;
yy9:
-#line 281
+#line 285
{ HANDLE_TAG() /* Sets STATE */; PASSTHRU(); continue; }
yy10: yych = *++YYCURSOR;
yy11:
-#line 282
+#line 286
{ PASSTHRU(); continue; }
yy12: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yy13: if(yybm[0+yych] & 128) goto yy12;
goto yy9;
}
-#line 283
+#line 287
break;
}
yy16: yych = *++YYCURSOR;
yy17:
-#line 288
+#line 292
{ PASSTHRU(); HANDLE_FORM(); STATE = STATE_PLAIN; continue; }
yy18: yych = *++YYCURSOR;
yy19:
-#line 289
+#line 293
{ PASSTHRU(); continue; }
yy20: yych = *++YYCURSOR;
yy21:
-#line 290
+#line 294
{ YYCURSOR--; STATE = STATE_ARG; continue; }
yy22: yych = *++YYCURSOR;
yy23:
-#line 291
+#line 295
{ PASSTHRU(); continue; }
}
-#line 292
+#line 296
break;
yy26: yych = *++YYCURSOR;
goto yy31;
yy27:
-#line 297
+#line 301
{ PASSTHRU(); HANDLE_ARG(); STATE = STATE_BEFORE_VAL; continue; }
yy28: yych = *++YYCURSOR;
yy29:
-#line 298
+#line 302
{ PASSTHRU(); STATE = STATE_NEXT_ARG; continue; }
yy30: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yy31: if(yybm[0+yych] & 128) goto yy30;
goto yy27;
}
-#line 299
+#line 303
case STATE_BEFORE_VAL:
if(yych == ' ') goto yy41;
if(yych == '=') goto yy39;
yy35:
-#line 304
+#line 308
{ YYCURSOR--; STATE = STATE_NEXT_ARG; continue; }
yy36: yych = *++YYCURSOR;
goto yy40;
yy37:
-#line 303
+#line 307
{ PASSTHRU(); STATE = STATE_VAL; continue; }
yy38: yych = *++YYCURSOR;
goto yy35;
case 0: goto yy35;
}
}
-#line 305
+#line 309
break;
yych = *(YYMARKER = ++YYCURSOR);
if(yych != '>') goto yy54;
yy47:
-#line 312
+#line 316
{ PASSTHRU(); STATE = STATE_NEXT_ARG; continue; }
yy48: yych = *++YYCURSOR;
goto yy52;
yy49:
-#line 311
+#line 315
{ HANDLE_VAL(0); STATE = STATE_NEXT_ARG; continue; }
yy50: yych = *++YYCURSOR;
goto yy47;
}
yy56: yych = *++YYCURSOR;
yy57:
-#line 310
+#line 314
{ HANDLE_VAL(1); STATE = STATE_NEXT_ARG; continue; }
}
-#line 313
+#line 317
break;
}
}
stop:
-#ifdef SCANNER_DEBUG
- printf("stopped in state %d at pos %d (%d:%c)\n", STATE, YYCURSOR - ctx->buf.c, *YYCURSOR, *YYCURSOR);
-#endif
+ scdebug(("stopped in state %d at pos %d (%d:%c)\n", STATE, YYCURSOR - ctx->buf.c, *YYCURSOR, *YYCURSOR));
rest = YYLIMIT - start;
- memmove(ctx->buf.c, start, rest);
- ctx->buf.c[rest] = '\0';
+ if (rest) memmove(ctx->buf.c, start, rest);
ctx->buf.len = rest;
}
tag_arg(ctx PLS_CC); \
}
+#ifdef SCANNER_DEBUG
+#define scdebug(x) printf x
+#else
+#define scdebug(x)
+#endif
+
static inline void mainloop(url_adapt_state_ex_t *ctx, const char *newdata, size_t newlen)
{
char *end, *q;
while(1) {
start = YYCURSOR;
-#ifdef SCANNER_DEBUG
- printf("state %d at %s\n", STATE, YYCURSOR);
-#endif
+ scdebug(("state %d at %s\n", STATE, YYCURSOR));
switch(STATE) {
case STATE_PLAIN:
}
stop:
-#ifdef SCANNER_DEBUG
- printf("stopped in state %d at pos %d (%d:%c)\n", STATE, YYCURSOR - ctx->buf.c, *YYCURSOR, *YYCURSOR);
-#endif
+ scdebug(("stopped in state %d at pos %d (%d:%c)\n", STATE, YYCURSOR - ctx->buf.c, *YYCURSOR, *YYCURSOR));
rest = YYLIMIT - start;
- memmove(ctx->buf.c, start, rest);
- ctx->buf.c[rest] = '\0';
+ if (rest) memmove(ctx->buf.c, start, rest);
ctx->buf.len = rest;
}