Author: petdance
Date: Fri Feb 22 20:23:21 2008
New Revision: 26001
Modified:
trunk/compilers/imcc/imcc.l
trunk/compilers/imcc/imclexer.c
Log:
use PARROT_INTERP macro
Modified: trunk/compilers/imcc/imcc.l
==============================================================================
--- trunk/compilers/imcc/imcc.l (original)
+++ trunk/compilers/imcc/imcc.l Fri Feb 22 20:23:21 2008
@@ -75,34 +75,31 @@
} macro_frame_t;
/* static function declariations */
-static void pop_parser_state(Interp* interp, void *yyscanner);
+static void pop_parser_state(PARROT_INTERP, void *yyscanner);
-static struct macro_frame_t *new_frame(Interp*);
+static struct macro_frame_t *new_frame(PARROT_INTERP);
-static void define_macro(Interp *interp, ARGIN(const char *name), ARGIN(const
params_t *params),
+static void define_macro(PARROT_INTERP, ARGIN(const char *name), ARGIN(const
params_t *params),
ARGIN(const char *expansion), int start_line);
-static macro_t *find_macro(Interp *interp, ARGIN(const char *name));
+static macro_t *find_macro(PARROT_INTERP, ARGIN(const char *name));
-static void scan_string(macro_frame_t *frame, const char *expansion,
- void *yyscanner);
+static void scan_string(macro_frame_t *frame, ARGIN(const char *expansion),
void *yyscanner);
-static void scan_file(Interp* interp, struct macro_frame_t *frame, FILE *,
+static void scan_file(PARROT_INTERP, struct macro_frame_t *frame, ARGMOD(FILE
*file),
void *yyscanner);
static int destroy_frame(macro_frame_t *frame, void *yyscanner);
-static int yylex_skip(YYSTYPE *valp, Interp *interp, const char *skip,
- void *yyscanner);
+static int yylex_skip(YYSTYPE *valp, PARROT_INTERP, ARGIN(const char *skip),
void *yyscanner);
-static int read_macro(YYSTYPE *valp, Interp *interp, void *yyscanner);
+static int read_macro(YYSTYPE *valp, PARROT_INTERP, void *yyscanner);
-static int expand_macro(YYSTYPE *valp, Interp *interp, const char *name,
- void *yyscanner);
+static int expand_macro(YYSTYPE *valp, PARROT_INTERP, ARGIN(const char *name),
void *yyscanner);
-static void include_file(Interp *interp, char *file_name, void *yyscanner);
+static void include_file(PARROT_INTERP, char *file_name, void *yyscanner);
-#define YY_DECL int yylex(YYSTYPE *valp, yyscan_t yyscanner, Interp *interp)
+#define YY_DECL int yylex(YYSTYPE *valp, yyscan_t yyscanner, PARROT_INTERP)
#define YYCHOP() (yytext[--yyleng] = '\0')
@@ -756,7 +753,7 @@
}
static macro_frame_t *
-new_frame(Interp *interp) {
+new_frame(PARROT_INTERP) {
static int label = 0;
macro_frame_t * const tmp = mem_allocate_zeroed_typed(macro_frame_t);
@@ -817,7 +814,7 @@
}
static int
-yylex_skip(YYSTYPE *valp, Interp *interp, const char *skip, void *yyscanner)
+yylex_skip(YYSTYPE *valp, PARROT_INTERP, const char *skip, void *yyscanner)
{
int c;
const char *p;
@@ -839,7 +836,7 @@
}
static char*
-read_braced(YYSTYPE *valp, Interp *interp, const char *macro_name,
+read_braced(YYSTYPE *valp, PARROT_INTERP, const char *macro_name,
char *current, void *yyscanner)
{
YYSTYPE val;
@@ -877,7 +874,7 @@
}
static int
-read_params(YYSTYPE *valp, Interp *interp, params_t *params,
+read_params(YYSTYPE *valp, PARROT_INTERP, params_t *params,
const char *macro_name, int need_id, void *yyscanner)
{
YYSTYPE val;
@@ -942,7 +939,7 @@
}
static int
-read_macro(YYSTYPE *valp, Interp *interp, void *yyscanner)
+read_macro(YYSTYPE *valp, PARROT_INTERP, void *yyscanner)
{
int c, start_line;
params_t params;
@@ -1026,7 +1023,7 @@
}
static char *
-find_macro_param(Interp *interp, const char *name)
+find_macro_param(PARROT_INTERP, const char *name)
{
macro_frame_t *f;
@@ -1044,7 +1041,7 @@
}
static void
-define_macro(Interp *interp, ARGIN(const char *name), ARGIN(const params_t
*params),
+define_macro(PARROT_INTERP, ARGIN(const char *name), ARGIN(const params_t
*params),
ARGIN(const char *expansion), int start_line)
{
macro_t *m = find_macro(interp, name);
@@ -1071,7 +1068,7 @@
}
static macro_t *
-find_macro(Interp *interp, const char *name)
+find_macro(PARROT_INTERP, const char *name)
{
if (!IMCC_INFO(interp)->macros)
return NULL;
@@ -1080,7 +1077,7 @@
}
static int
-expand_macro(YYSTYPE *valp, Interp *interp, const char *name, void *yyscanner)
+expand_macro(YYSTYPE *valp, PARROT_INTERP, const char *name, void *yyscanner)
{
yyguts_t *yyg = (yyguts_t *)yyscanner;
const char *expansion = find_macro_param(interp, name);
@@ -1185,7 +1182,7 @@
}
static void
-include_file(Interp* interp, char *file_name, void *yyscanner)
+include_file(PARROT_INTERP, char *file_name, void *yyscanner)
{
char *ext;
FILE *file = 0;
@@ -1222,7 +1219,7 @@
}
static void
-scan_file(Interp *interp, macro_frame_t *frame, FILE *file, void *yyscanner)
+scan_file(PARROT_INTERP, macro_frame_t *frame, FILE *file, void *yyscanner)
{
yyguts_t * const yyg = (yyguts_t *)yyscanner;
frame->buffer = YY_CURRENT_BUFFER;
@@ -1237,7 +1234,7 @@
}
void
-IMCC_push_parser_state(Interp *interp)
+IMCC_push_parser_state(PARROT_INTERP)
{
macro_frame_t * const frame = new_frame(interp);
frame->s.next = (parser_state_t *)IMCC_INFO(interp)->frames;
@@ -1248,7 +1245,7 @@
}
static void
-pop_parser_state(Interp *interp, void *yyscanner)
+pop_parser_state(PARROT_INTERP, void *yyscanner)
{
macro_frame_t * const tmp = IMCC_INFO(interp)->frames;
if (tmp) {
@@ -1269,13 +1266,13 @@
}
void
-IMCC_pop_parser_state(Interp *interp, void *yyscanner)
+IMCC_pop_parser_state(PARROT_INTERP, void *yyscanner)
{
pop_parser_state(interp, yyscanner);
}
void
-compile_file(Interp *interp, FILE *file, void *yyscanner)
+compile_file(PARROT_INTERP, FILE *file, void *yyscanner)
{
yyguts_t * const yyg = (yyguts_t *)yyscanner;
YY_BUFFER_STATE buffer;
@@ -1308,7 +1305,7 @@
}
void
-compile_string(Interp *interp, char *s, void *yyscanner)
+compile_string(PARROT_INTERP, char *s, void *yyscanner)
{
yyguts_t * const yyg = (yyguts_t *)yyscanner;
YY_BUFFER_STATE buffer;
@@ -1339,7 +1336,7 @@
}
void
-IMCC_print_inc(Interp *interp)
+IMCC_print_inc(PARROT_INTERP)
{
macro_frame_t *f;
const char *old = IMCC_INFO(interp)->frames->s.file;
Modified: trunk/compilers/imcc/imclexer.c
==============================================================================
--- trunk/compilers/imcc/imclexer.c (original)
+++ trunk/compilers/imcc/imclexer.c Fri Feb 22 20:23:21 2008
@@ -2716,34 +2716,31 @@
} macro_frame_t;
/* static function declariations */
-static void pop_parser_state(Interp* interp, void *yyscanner);
+static void pop_parser_state(PARROT_INTERP, void *yyscanner);
-static struct macro_frame_t *new_frame(Interp*);
+static struct macro_frame_t *new_frame(PARROT_INTERP);
-static void define_macro(Interp *interp, ARGIN(const char *name), ARGIN(const
params_t *params),
+static void define_macro(PARROT_INTERP, ARGIN(const char *name), ARGIN(const
params_t *params),
ARGIN(const char *expansion), int start_line);
-static macro_t *find_macro(Interp *interp, ARGIN(const char *name));
+static macro_t *find_macro(PARROT_INTERP, ARGIN(const char *name));
-static void scan_string(macro_frame_t *frame, const char *expansion,
- void *yyscanner);
+static void scan_string(macro_frame_t *frame, ARGIN(const char *expansion),
void *yyscanner);
-static void scan_file(Interp* interp, struct macro_frame_t *frame, FILE *,
+static void scan_file(PARROT_INTERP, struct macro_frame_t *frame, ARGMOD(FILE
*file),
void *yyscanner);
static int destroy_frame(macro_frame_t *frame, void *yyscanner);
-static int yylex_skip(YYSTYPE *valp, Interp *interp, const char *skip,
- void *yyscanner);
+static int yylex_skip(YYSTYPE *valp, PARROT_INTERP, ARGIN(const char *skip),
void *yyscanner);
-static int read_macro(YYSTYPE *valp, Interp *interp, void *yyscanner);
+static int read_macro(YYSTYPE *valp, PARROT_INTERP, void *yyscanner);
-static int expand_macro(YYSTYPE *valp, Interp *interp, const char *name,
- void *yyscanner);
+static int expand_macro(YYSTYPE *valp, PARROT_INTERP, ARGIN(const char *name),
void *yyscanner);
-static void include_file(Interp *interp, char *file_name, void *yyscanner);
+static void include_file(PARROT_INTERP, char *file_name, void *yyscanner);
-#define YY_DECL int yylex(YYSTYPE *valp,yyscan_t yyscanner,Interp *interp)
+#define YY_DECL int yylex(YYSTYPE *valp,yyscan_t yyscanner,PARROT_INTERP)
#define YYCHOP() (yytext[--yyleng] = '\0')
@@ -2772,7 +2769,7 @@
-#line 2776 "compilers/imcc/imclexer.c"
+#line 2773 "compilers/imcc/imclexer.c"
#define INITIAL 0
#define emit 1
@@ -3012,7 +3009,7 @@
register int yy_act;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-#line 167 "compilers/imcc/imcc.l"
+#line 164 "compilers/imcc/imcc.l"
/* for emacs "*/
if (IMCC_INFO(interp)->expect_pasm == 1 && !IMCC_INFO(interp)->in_pod)
{
@@ -3031,7 +3028,7 @@
return 0;
}
-#line 3035 "compilers/imcc/imclexer.c"
+#line 3032 "compilers/imcc/imclexer.c"
if ( !yyg->yy_init )
{
@@ -3114,7 +3111,7 @@
case 1:
/* rule 1 can match eol */
YY_RULE_SETUP
-#line 185 "compilers/imcc/imcc.l"
+#line 182 "compilers/imcc/imcc.l"
{
IMCC_INFO(interp)->frames->heredoc_rest = str_dup(yytext);
BEGIN(heredoc2);
@@ -3123,7 +3120,7 @@
case 2:
/* rule 2 can match eol */
YY_RULE_SETUP
-#line 190 "compilers/imcc/imcc.l"
+#line 187 "compilers/imcc/imcc.l"
{
/* heredocs have highest priority
* arrange them befor all wildcard state matches
@@ -3141,7 +3138,7 @@
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 205 "compilers/imcc/imcc.l"
+#line 202 "compilers/imcc/imcc.l"
{
/* Are we at the end of the heredoc? */
if (STREQ(IMCC_INFO(interp)->heredoc_end, yytext)) {
@@ -3181,7 +3178,7 @@
YY_BREAK
case 4:
YY_RULE_SETUP
-#line 243 "compilers/imcc/imcc.l"
+#line 240 "compilers/imcc/imcc.l"
{
yy_push_state(cmt2, yyscanner);
IMCC_INFO(interp)->line = atoi(yytext+6);
@@ -3191,7 +3188,7 @@
case 5:
/* rule 5 can match eol */
YY_RULE_SETUP
-#line 249 "compilers/imcc/imcc.l"
+#line 246 "compilers/imcc/imcc.l"
{
yy_pop_state(yyscanner);
yy_push_state(cmt3, yyscanner);
@@ -3204,7 +3201,7 @@
YY_BREAK
case 6:
YY_RULE_SETUP
-#line 259 "compilers/imcc/imcc.l"
+#line 256 "compilers/imcc/imcc.l"
{
yy_pop_state(yyscanner);
yy_push_state(cmt4, yyscanner);
@@ -3212,17 +3209,17 @@
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 264 "compilers/imcc/imcc.l"
+#line 261 "compilers/imcc/imcc.l"
{ yy_push_state(cmt2, yyscanner); }
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 266 "compilers/imcc/imcc.l"
+#line 263 "compilers/imcc/imcc.l"
{ yy_push_state(cmt1, yyscanner); }
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 268 "compilers/imcc/imcc.l"
+#line 265 "compilers/imcc/imcc.l"
{
IMCC_INFO(interp)->line = atoi(yytext);
yy_pop_state(yyscanner);
@@ -3233,7 +3230,7 @@
case 10:
/* rule 10 can match eol */
YY_RULE_SETUP
-#line 275 "compilers/imcc/imcc.l"
+#line 272 "compilers/imcc/imcc.l"
{
yy_pop_state(yyscanner);
IMCC_INFO(interp)->line++;
@@ -3242,7 +3239,7 @@
case 11:
/* rule 11 can match eol */
YY_RULE_SETUP
-#line 280 "compilers/imcc/imcc.l"
+#line 277 "compilers/imcc/imcc.l"
{
if (IMCC_INFO(interp)->expect_pasm == 2)
BEGIN(INITIAL);
@@ -3255,7 +3252,7 @@
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 290 "compilers/imcc/imcc.l"
+#line 287 "compilers/imcc/imcc.l"
{
yy_push_state(cmt5, yyscanner);
}
@@ -3263,7 +3260,7 @@
case 13:
/* rule 13 can match eol */
YY_RULE_SETUP
-#line 294 "compilers/imcc/imcc.l"
+#line 291 "compilers/imcc/imcc.l"
{
if (IMCC_INFO(interp)->expect_pasm == 2)
BEGIN(INITIAL);
@@ -3278,7 +3275,7 @@
YY_BREAK
case 14:
YY_RULE_SETUP
-#line 307 "compilers/imcc/imcc.l"
+#line 304 "compilers/imcc/imcc.l"
{
valp->s = str_dup(yytext);
return REG;
@@ -3286,7 +3283,7 @@
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 312 "compilers/imcc/imcc.l"
+#line 309 "compilers/imcc/imcc.l"
{
IMCC_INFO(interp)->in_pod = 1;
yy_push_state(pod, yyscanner);
@@ -3295,7 +3292,7 @@
case 16:
/* rule 16 can match eol */
YY_RULE_SETUP
-#line 317 "compilers/imcc/imcc.l"
+#line 314 "compilers/imcc/imcc.l"
{
IMCC_INFO(interp)->in_pod = 0;
yy_pop_state(yyscanner);
@@ -3304,480 +3301,480 @@
YY_BREAK
case 17:
YY_RULE_SETUP
-#line 323 "compilers/imcc/imcc.l"
+#line 320 "compilers/imcc/imcc.l"
{ /*ignore*/ }
YY_BREAK
case 18:
/* rule 18 can match eol */
YY_RULE_SETUP
-#line 325 "compilers/imcc/imcc.l"
+#line 322 "compilers/imcc/imcc.l"
{ IMCC_INFO(interp)->line++; }
YY_BREAK
case 19:
YY_RULE_SETUP
-#line 327 "compilers/imcc/imcc.l"
+#line 324 "compilers/imcc/imcc.l"
return LEXICAL;
YY_BREAK
case 20:
YY_RULE_SETUP
-#line 328 "compilers/imcc/imcc.l"
+#line 325 "compilers/imcc/imcc.l"
return ARG;
YY_BREAK
case 21:
YY_RULE_SETUP
-#line 329 "compilers/imcc/imcc.l"
+#line 326 "compilers/imcc/imcc.l"
return SUB;
YY_BREAK
case 22:
YY_RULE_SETUP
-#line 330 "compilers/imcc/imcc.l"
+#line 327 "compilers/imcc/imcc.l"
return ESUB;
YY_BREAK
case 23:
YY_RULE_SETUP
-#line 331 "compilers/imcc/imcc.l"
+#line 328 "compilers/imcc/imcc.l"
return PCC_BEGIN;
YY_BREAK
case 24:
YY_RULE_SETUP
-#line 332 "compilers/imcc/imcc.l"
+#line 329 "compilers/imcc/imcc.l"
return PCC_END;
YY_BREAK
case 25:
YY_RULE_SETUP
-#line 333 "compilers/imcc/imcc.l"
+#line 330 "compilers/imcc/imcc.l"
return PCC_CALL;
YY_BREAK
case 26:
YY_RULE_SETUP
-#line 334 "compilers/imcc/imcc.l"
+#line 331 "compilers/imcc/imcc.l"
return NCI_CALL;
YY_BREAK
case 27:
YY_RULE_SETUP
-#line 335 "compilers/imcc/imcc.l"
+#line 332 "compilers/imcc/imcc.l"
return METH_CALL;
YY_BREAK
case 28:
YY_RULE_SETUP
-#line 336 "compilers/imcc/imcc.l"
+#line 333 "compilers/imcc/imcc.l"
return INVOCANT;
YY_BREAK
case 29:
YY_RULE_SETUP
-#line 337 "compilers/imcc/imcc.l"
+#line 334 "compilers/imcc/imcc.l"
return PCC_SUB;
YY_BREAK
case 30:
YY_RULE_SETUP
-#line 338 "compilers/imcc/imcc.l"
+#line 335 "compilers/imcc/imcc.l"
return PCC_BEGIN_RETURN;
YY_BREAK
case 31:
YY_RULE_SETUP
-#line 339 "compilers/imcc/imcc.l"
+#line 336 "compilers/imcc/imcc.l"
return PCC_END_RETURN;
YY_BREAK
case 32:
YY_RULE_SETUP
-#line 340 "compilers/imcc/imcc.l"
+#line 337 "compilers/imcc/imcc.l"
return PCC_BEGIN_YIELD;
YY_BREAK
case 33:
YY_RULE_SETUP
-#line 341 "compilers/imcc/imcc.l"
+#line 338 "compilers/imcc/imcc.l"
return PCC_END_YIELD;
YY_BREAK
case 34:
YY_RULE_SETUP
-#line 343 "compilers/imcc/imcc.l"
+#line 340 "compilers/imcc/imcc.l"
return METHOD;
YY_BREAK
case 35:
YY_RULE_SETUP
-#line 344 "compilers/imcc/imcc.l"
+#line 341 "compilers/imcc/imcc.l"
return MULTI;
YY_BREAK
case 36:
YY_RULE_SETUP
-#line 345 "compilers/imcc/imcc.l"
+#line 342 "compilers/imcc/imcc.l"
return MAIN;
YY_BREAK
case 37:
YY_RULE_SETUP
-#line 346 "compilers/imcc/imcc.l"
+#line 343 "compilers/imcc/imcc.l"
return LOAD;
YY_BREAK
case 38:
YY_RULE_SETUP
-#line 347 "compilers/imcc/imcc.l"
+#line 344 "compilers/imcc/imcc.l"
return INIT;
YY_BREAK
case 39:
YY_RULE_SETUP
-#line 348 "compilers/imcc/imcc.l"
+#line 345 "compilers/imcc/imcc.l"
return IMMEDIATE;
YY_BREAK
case 40:
YY_RULE_SETUP
-#line 349 "compilers/imcc/imcc.l"
+#line 346 "compilers/imcc/imcc.l"
return POSTCOMP;
YY_BREAK
case 41:
YY_RULE_SETUP
-#line 350 "compilers/imcc/imcc.l"
+#line 347 "compilers/imcc/imcc.l"
return ANON;
YY_BREAK
case 42:
YY_RULE_SETUP
-#line 351 "compilers/imcc/imcc.l"
+#line 348 "compilers/imcc/imcc.l"
return OUTER;
YY_BREAK
case 43:
YY_RULE_SETUP
-#line 352 "compilers/imcc/imcc.l"
+#line 349 "compilers/imcc/imcc.l"
return NEED_LEX;
YY_BREAK
case 44:
YY_RULE_SETUP
-#line 353 "compilers/imcc/imcc.l"
+#line 350 "compilers/imcc/imcc.l"
return VTABLE_METHOD;
YY_BREAK
case 45:
YY_RULE_SETUP
-#line 354 "compilers/imcc/imcc.l"
+#line 351 "compilers/imcc/imcc.l"
return UNIQUE_REG;
YY_BREAK
case 46:
YY_RULE_SETUP
-#line 356 "compilers/imcc/imcc.l"
+#line 353 "compilers/imcc/imcc.l"
return RESULT;
YY_BREAK
case 47:
YY_RULE_SETUP
-#line 357 "compilers/imcc/imcc.l"
+#line 354 "compilers/imcc/imcc.l"
return GET_RESULTS;
YY_BREAK
case 48:
YY_RULE_SETUP
-#line 358 "compilers/imcc/imcc.l"
+#line 355 "compilers/imcc/imcc.l"
return YIELDT;
YY_BREAK
case 49:
YY_RULE_SETUP
-#line 359 "compilers/imcc/imcc.l"
+#line 356 "compilers/imcc/imcc.l"
return RETURN;
YY_BREAK
case 50:
YY_RULE_SETUP
-#line 360 "compilers/imcc/imcc.l"
+#line 357 "compilers/imcc/imcc.l"
return LOADLIB;
YY_BREAK
case 51:
YY_RULE_SETUP
-#line 362 "compilers/imcc/imcc.l"
+#line 359 "compilers/imcc/imcc.l"
return ADV_FLAT;
YY_BREAK
case 52:
YY_RULE_SETUP
-#line 363 "compilers/imcc/imcc.l"
+#line 360 "compilers/imcc/imcc.l"
return ADV_SLURPY;
YY_BREAK
case 53:
YY_RULE_SETUP
-#line 364 "compilers/imcc/imcc.l"
+#line 361 "compilers/imcc/imcc.l"
return ADV_OPTIONAL;
YY_BREAK
case 54:
YY_RULE_SETUP
-#line 365 "compilers/imcc/imcc.l"
+#line 362 "compilers/imcc/imcc.l"
return ADV_OPT_FLAG;
YY_BREAK
case 55:
YY_RULE_SETUP
-#line 366 "compilers/imcc/imcc.l"
+#line 363 "compilers/imcc/imcc.l"
return ADV_NAMED;
YY_BREAK
case 56:
YY_RULE_SETUP
-#line 367 "compilers/imcc/imcc.l"
+#line 364 "compilers/imcc/imcc.l"
return ADV_ARROW;
YY_BREAK
case 57:
YY_RULE_SETUP
-#line 368 "compilers/imcc/imcc.l"
+#line 365 "compilers/imcc/imcc.l"
return ADV_INVOCANT;
YY_BREAK
case 58:
YY_RULE_SETUP
-#line 370 "compilers/imcc/imcc.l"
+#line 367 "compilers/imcc/imcc.l"
return NAMESPACE;
YY_BREAK
case 59:
YY_RULE_SETUP
-#line 371 "compilers/imcc/imcc.l"
+#line 368 "compilers/imcc/imcc.l"
return HLL;
YY_BREAK
case 60:
YY_RULE_SETUP
-#line 372 "compilers/imcc/imcc.l"
+#line 369 "compilers/imcc/imcc.l"
return HLL_MAP;
YY_BREAK
case 61:
YY_RULE_SETUP
-#line 373 "compilers/imcc/imcc.l"
+#line 370 "compilers/imcc/imcc.l"
return ENDNAMESPACE;
YY_BREAK
case 62:
YY_RULE_SETUP
-#line 374 "compilers/imcc/imcc.l"
+#line 371 "compilers/imcc/imcc.l"
return LOCAL;
YY_BREAK
case 63:
YY_RULE_SETUP
-#line 375 "compilers/imcc/imcc.l"
+#line 372 "compilers/imcc/imcc.l"
return GLOBAL;
YY_BREAK
case 64:
YY_RULE_SETUP
-#line 376 "compilers/imcc/imcc.l"
+#line 373 "compilers/imcc/imcc.l"
return CONST;
YY_BREAK
case 65:
YY_RULE_SETUP
-#line 377 "compilers/imcc/imcc.l"
+#line 374 "compilers/imcc/imcc.l"
return GLOBAL_CONST;
YY_BREAK
case 66:
YY_RULE_SETUP
-#line 378 "compilers/imcc/imcc.l"
+#line 375 "compilers/imcc/imcc.l"
return PARAM;
YY_BREAK
case 67:
YY_RULE_SETUP
-#line 379 "compilers/imcc/imcc.l"
+#line 376 "compilers/imcc/imcc.l"
return PRAGMA;
YY_BREAK
case 68:
YY_RULE_SETUP
-#line 380 "compilers/imcc/imcc.l"
+#line 377 "compilers/imcc/imcc.l"
return N_OPERATORS;
YY_BREAK
case 69:
YY_RULE_SETUP
-#line 381 "compilers/imcc/imcc.l"
+#line 378 "compilers/imcc/imcc.l"
return GOTO;
YY_BREAK
case 70:
YY_RULE_SETUP
-#line 382 "compilers/imcc/imcc.l"
+#line 379 "compilers/imcc/imcc.l"
return IF;
YY_BREAK
case 71:
YY_RULE_SETUP
-#line 383 "compilers/imcc/imcc.l"
+#line 380 "compilers/imcc/imcc.l"
return UNLESS;
YY_BREAK
case 72:
YY_RULE_SETUP
-#line 384 "compilers/imcc/imcc.l"
+#line 381 "compilers/imcc/imcc.l"
return PNULL;
YY_BREAK
case 73:
YY_RULE_SETUP
-#line 385 "compilers/imcc/imcc.l"
+#line 382 "compilers/imcc/imcc.l"
return INTV;
YY_BREAK
case 74:
YY_RULE_SETUP
-#line 386 "compilers/imcc/imcc.l"
+#line 383 "compilers/imcc/imcc.l"
return FLOATV;
YY_BREAK
case 75:
YY_RULE_SETUP
-#line 387 "compilers/imcc/imcc.l"
+#line 384 "compilers/imcc/imcc.l"
return NEW;
YY_BREAK
case 76:
YY_RULE_SETUP
-#line 388 "compilers/imcc/imcc.l"
+#line 385 "compilers/imcc/imcc.l"
return ADDR;
YY_BREAK
case 77:
YY_RULE_SETUP
-#line 389 "compilers/imcc/imcc.l"
+#line 386 "compilers/imcc/imcc.l"
return GLOBALOP;
YY_BREAK
case 78:
YY_RULE_SETUP
-#line 390 "compilers/imcc/imcc.l"
+#line 387 "compilers/imcc/imcc.l"
return PMCV;
YY_BREAK
case 79:
YY_RULE_SETUP
-#line 391 "compilers/imcc/imcc.l"
+#line 388 "compilers/imcc/imcc.l"
return STRINGV;
YY_BREAK
case 80:
YY_RULE_SETUP
-#line 392 "compilers/imcc/imcc.l"
+#line 389 "compilers/imcc/imcc.l"
return SHIFT_LEFT;
YY_BREAK
case 81:
YY_RULE_SETUP
-#line 393 "compilers/imcc/imcc.l"
+#line 390 "compilers/imcc/imcc.l"
return SHIFT_RIGHT;
YY_BREAK
case 82:
YY_RULE_SETUP
-#line 394 "compilers/imcc/imcc.l"
+#line 391 "compilers/imcc/imcc.l"
return SHIFT_RIGHT_U;
YY_BREAK
case 83:
YY_RULE_SETUP
-#line 395 "compilers/imcc/imcc.l"
+#line 392 "compilers/imcc/imcc.l"
return LOG_AND;
YY_BREAK
case 84:
YY_RULE_SETUP
-#line 396 "compilers/imcc/imcc.l"
+#line 393 "compilers/imcc/imcc.l"
return LOG_OR;
YY_BREAK
case 85:
YY_RULE_SETUP
-#line 397 "compilers/imcc/imcc.l"
+#line 394 "compilers/imcc/imcc.l"
return LOG_XOR;
YY_BREAK
case 86:
YY_RULE_SETUP
-#line 398 "compilers/imcc/imcc.l"
+#line 395 "compilers/imcc/imcc.l"
return RELOP_LT;
YY_BREAK
case 87:
YY_RULE_SETUP
-#line 399 "compilers/imcc/imcc.l"
+#line 396 "compilers/imcc/imcc.l"
return RELOP_LTE;
YY_BREAK
case 88:
YY_RULE_SETUP
-#line 400 "compilers/imcc/imcc.l"
+#line 397 "compilers/imcc/imcc.l"
return RELOP_GT;
YY_BREAK
case 89:
YY_RULE_SETUP
-#line 401 "compilers/imcc/imcc.l"
+#line 398 "compilers/imcc/imcc.l"
return RELOP_GTE;
YY_BREAK
case 90:
YY_RULE_SETUP
-#line 402 "compilers/imcc/imcc.l"
+#line 399 "compilers/imcc/imcc.l"
return RELOP_EQ;
YY_BREAK
case 91:
YY_RULE_SETUP
-#line 403 "compilers/imcc/imcc.l"
+#line 400 "compilers/imcc/imcc.l"
return RELOP_NE;
YY_BREAK
case 92:
YY_RULE_SETUP
-#line 404 "compilers/imcc/imcc.l"
+#line 401 "compilers/imcc/imcc.l"
return POW;
YY_BREAK
case 93:
YY_RULE_SETUP
-#line 406 "compilers/imcc/imcc.l"
+#line 403 "compilers/imcc/imcc.l"
return CONCAT;
YY_BREAK
case 94:
YY_RULE_SETUP
-#line 407 "compilers/imcc/imcc.l"
+#line 404 "compilers/imcc/imcc.l"
return DOT;
YY_BREAK
case 95:
YY_RULE_SETUP
-#line 408 "compilers/imcc/imcc.l"
+#line 405 "compilers/imcc/imcc.l"
return DOTDOT;
YY_BREAK
case 96:
YY_RULE_SETUP
-#line 409 "compilers/imcc/imcc.l"
+#line 406 "compilers/imcc/imcc.l"
return PLUS_ASSIGN;
YY_BREAK
case 97:
YY_RULE_SETUP
-#line 410 "compilers/imcc/imcc.l"
+#line 407 "compilers/imcc/imcc.l"
return MINUS_ASSIGN;
YY_BREAK
case 98:
YY_RULE_SETUP
-#line 411 "compilers/imcc/imcc.l"
+#line 408 "compilers/imcc/imcc.l"
return MUL_ASSIGN;
YY_BREAK
case 99:
YY_RULE_SETUP
-#line 412 "compilers/imcc/imcc.l"
+#line 409 "compilers/imcc/imcc.l"
return DIV_ASSIGN;
YY_BREAK
case 100:
YY_RULE_SETUP
-#line 413 "compilers/imcc/imcc.l"
+#line 410 "compilers/imcc/imcc.l"
return MOD_ASSIGN;
YY_BREAK
case 101:
YY_RULE_SETUP
-#line 414 "compilers/imcc/imcc.l"
+#line 411 "compilers/imcc/imcc.l"
return FDIV;
YY_BREAK
case 102:
YY_RULE_SETUP
-#line 415 "compilers/imcc/imcc.l"
+#line 412 "compilers/imcc/imcc.l"
return FDIV_ASSIGN;
YY_BREAK
case 103:
YY_RULE_SETUP
-#line 416 "compilers/imcc/imcc.l"
+#line 413 "compilers/imcc/imcc.l"
return BAND_ASSIGN;
YY_BREAK
case 104:
YY_RULE_SETUP
-#line 417 "compilers/imcc/imcc.l"
+#line 414 "compilers/imcc/imcc.l"
return BOR_ASSIGN;
YY_BREAK
case 105:
YY_RULE_SETUP
-#line 418 "compilers/imcc/imcc.l"
+#line 415 "compilers/imcc/imcc.l"
return BXOR_ASSIGN;
YY_BREAK
case 106:
YY_RULE_SETUP
-#line 419 "compilers/imcc/imcc.l"
+#line 416 "compilers/imcc/imcc.l"
return SHR_ASSIGN;
YY_BREAK
case 107:
YY_RULE_SETUP
-#line 420 "compilers/imcc/imcc.l"
+#line 417 "compilers/imcc/imcc.l"
return SHL_ASSIGN;
YY_BREAK
case 108:
YY_RULE_SETUP
-#line 421 "compilers/imcc/imcc.l"
+#line 418 "compilers/imcc/imcc.l"
return SHR_U_ASSIGN;
YY_BREAK
case 109:
YY_RULE_SETUP
-#line 422 "compilers/imcc/imcc.l"
+#line 419 "compilers/imcc/imcc.l"
return CONCAT_ASSIGN;
YY_BREAK
case 110:
YY_RULE_SETUP
-#line 424 "compilers/imcc/imcc.l"
+#line 421 "compilers/imcc/imcc.l"
{
return read_macro(valp, interp, yyscanner);
}
YY_BREAK
case 111:
YY_RULE_SETUP
-#line 428 "compilers/imcc/imcc.l"
+#line 425 "compilers/imcc/imcc.l"
{
int c;
int start_line;
@@ -3809,7 +3806,7 @@
YY_BREAK
case 112:
YY_RULE_SETUP
-#line 457 "compilers/imcc/imcc.l"
+#line 454 "compilers/imcc/imcc.l"
{
const int c = yylex(valp,yyscanner,interp);
if (c != STRINGC)
@@ -3821,7 +3818,7 @@
YY_BREAK
case 113:
YY_RULE_SETUP
-#line 466 "compilers/imcc/imcc.l"
+#line 463 "compilers/imcc/imcc.l"
{
if (valp) {
char *label;
@@ -3846,7 +3843,7 @@
YY_BREAK
case 114:
YY_RULE_SETUP
-#line 488 "compilers/imcc/imcc.l"
+#line 485 "compilers/imcc/imcc.l"
{
if (valp) {
@@ -3871,12 +3868,12 @@
YY_BREAK
case 115:
YY_RULE_SETUP
-#line 510 "compilers/imcc/imcc.l"
+#line 507 "compilers/imcc/imcc.l"
return COMMA;
YY_BREAK
case 116:
YY_RULE_SETUP
-#line 512 "compilers/imcc/imcc.l"
+#line 509 "compilers/imcc/imcc.l"
{
/* trim last ':' */
YYCHOP();
@@ -3889,7 +3886,7 @@
YY_BREAK
case 117:
YY_RULE_SETUP
-#line 522 "compilers/imcc/imcc.l"
+#line 519 "compilers/imcc/imcc.l"
{
const char * const macro_name = yytext + 1;
const int type = pmc_type(interp,
string_from_cstring(interp, macro_name, 0));
@@ -3912,7 +3909,7 @@
YY_BREAK
case 118:
YY_RULE_SETUP
-#line 542 "compilers/imcc/imcc.l"
+#line 539 "compilers/imcc/imcc.l"
{
if (!is_def) {
SymReg *r = find_sym(interp, yytext);
@@ -3942,32 +3939,32 @@
YY_BREAK
case 119:
YY_RULE_SETUP
-#line 569 "compilers/imcc/imcc.l"
+#line 566 "compilers/imcc/imcc.l"
DUP_AND_RET(valp, FLOATC);
YY_BREAK
case 120:
YY_RULE_SETUP
-#line 570 "compilers/imcc/imcc.l"
+#line 567 "compilers/imcc/imcc.l"
DUP_AND_RET(valp, INTC);
YY_BREAK
case 121:
YY_RULE_SETUP
-#line 571 "compilers/imcc/imcc.l"
+#line 568 "compilers/imcc/imcc.l"
DUP_AND_RET(valp, INTC);
YY_BREAK
case 122:
YY_RULE_SETUP
-#line 572 "compilers/imcc/imcc.l"
+#line 569 "compilers/imcc/imcc.l"
DUP_AND_RET(valp, INTC);
YY_BREAK
case 123:
YY_RULE_SETUP
-#line 573 "compilers/imcc/imcc.l"
+#line 570 "compilers/imcc/imcc.l"
DUP_AND_RET(valp, INTC);
YY_BREAK
case 124:
YY_RULE_SETUP
-#line 575 "compilers/imcc/imcc.l"
+#line 572 "compilers/imcc/imcc.l"
{
valp->s = str_dup(yytext);
@@ -3980,7 +3977,7 @@
YY_BREAK
case 125:
YY_RULE_SETUP
-#line 585 "compilers/imcc/imcc.l"
+#line 582 "compilers/imcc/imcc.l"
{
valp->s = str_dup(yytext);
@@ -3990,7 +3987,7 @@
YY_BREAK
case 126:
YY_RULE_SETUP
-#line 592 "compilers/imcc/imcc.l"
+#line 589 "compilers/imcc/imcc.l"
{
macro_frame_t *frame;
@@ -4022,7 +4019,7 @@
YY_BREAK
case 127:
YY_RULE_SETUP
-#line 621 "compilers/imcc/imcc.l"
+#line 618 "compilers/imcc/imcc.l"
{
/* charset:"..." */
valp->s = str_dup(yytext);
@@ -4033,7 +4030,7 @@
YY_BREAK
case 128:
YY_RULE_SETUP
-#line 629 "compilers/imcc/imcc.l"
+#line 626 "compilers/imcc/imcc.l"
{
if (valp) (valp)->s = yytext;
return IREG;
@@ -4041,7 +4038,7 @@
YY_BREAK
case 129:
YY_RULE_SETUP
-#line 634 "compilers/imcc/imcc.l"
+#line 631 "compilers/imcc/imcc.l"
{
if (valp) (valp)->s = yytext;
return NREG;
@@ -4049,7 +4046,7 @@
YY_BREAK
case 130:
YY_RULE_SETUP
-#line 639 "compilers/imcc/imcc.l"
+#line 636 "compilers/imcc/imcc.l"
{
if (valp) (valp)->s = yytext;
return SREG;
@@ -4057,7 +4054,7 @@
YY_BREAK
case 131:
YY_RULE_SETUP
-#line 644 "compilers/imcc/imcc.l"
+#line 641 "compilers/imcc/imcc.l"
{
if (valp) (valp)->s = yytext;
return PREG;
@@ -4065,7 +4062,7 @@
YY_BREAK
case 132:
YY_RULE_SETUP
-#line 649 "compilers/imcc/imcc.l"
+#line 646 "compilers/imcc/imcc.l"
{
IMCC_fataly(interp, E_SyntaxError,
"'%s' is not a valid register name", yytext);
@@ -4073,19 +4070,19 @@
YY_BREAK
case 133:
YY_RULE_SETUP
-#line 655 "compilers/imcc/imcc.l"
+#line 652 "compilers/imcc/imcc.l"
/* skip */;
YY_BREAK
case 134:
YY_RULE_SETUP
-#line 657 "compilers/imcc/imcc.l"
+#line 654 "compilers/imcc/imcc.l"
{
/* catch all except for state macro */
return yytext[0];
}
YY_BREAK
case YY_STATE_EOF(emit):
-#line 662 "compilers/imcc/imcc.l"
+#line 659 "compilers/imcc/imcc.l"
{
BEGIN(INITIAL);
@@ -4098,18 +4095,18 @@
}
YY_BREAK
case YY_STATE_EOF(INITIAL):
-#line 673 "compilers/imcc/imcc.l"
+#line 670 "compilers/imcc/imcc.l"
yyterminate();
YY_BREAK
case 135:
YY_RULE_SETUP
-#line 675 "compilers/imcc/imcc.l"
+#line 672 "compilers/imcc/imcc.l"
DUP_AND_RET(valp, ENDM);
YY_BREAK
case 136:
/* rule 136 can match eol */
YY_RULE_SETUP
-#line 677 "compilers/imcc/imcc.l"
+#line 674 "compilers/imcc/imcc.l"
{
IMCC_INFO(interp)->line++;
DUP_AND_RET(valp, '\n');
@@ -4117,12 +4114,12 @@
YY_BREAK
case 137:
YY_RULE_SETUP
-#line 682 "compilers/imcc/imcc.l"
+#line 679 "compilers/imcc/imcc.l"
return LABEL;
YY_BREAK
case 138:
YY_RULE_SETUP
-#line 684 "compilers/imcc/imcc.l"
+#line 681 "compilers/imcc/imcc.l"
{
if (yylex(valp,yyscanner,interp) != LABEL)
@@ -4148,7 +4145,7 @@
YY_BREAK
case 139:
YY_RULE_SETUP
-#line 707 "compilers/imcc/imcc.l"
+#line 704 "compilers/imcc/imcc.l"
{
if (valp) {
const size_t len = strlen(IMCC_INFO(interp)->cur_macro_name) +
yyleng + 12;
@@ -4165,39 +4162,39 @@
YY_BREAK
case 140:
YY_RULE_SETUP
-#line 721 "compilers/imcc/imcc.l"
+#line 718 "compilers/imcc/imcc.l"
/* skip leading ws */;
YY_BREAK
case 141:
YY_RULE_SETUP
-#line 722 "compilers/imcc/imcc.l"
+#line 719 "compilers/imcc/imcc.l"
DUP_AND_RET(valp, ' ');
YY_BREAK
case 142:
YY_RULE_SETUP
-#line 723 "compilers/imcc/imcc.l"
+#line 720 "compilers/imcc/imcc.l"
DUP_AND_RET(valp, IDENTIFIER);
YY_BREAK
case 143:
YY_RULE_SETUP
-#line 724 "compilers/imcc/imcc.l"
+#line 721 "compilers/imcc/imcc.l"
DUP_AND_RET(valp, MACRO);
YY_BREAK
case 144:
YY_RULE_SETUP
-#line 725 "compilers/imcc/imcc.l"
+#line 722 "compilers/imcc/imcc.l"
DUP_AND_RET(valp, yytext[0]);
YY_BREAK
case YY_STATE_EOF(macro):
-#line 726 "compilers/imcc/imcc.l"
+#line 723 "compilers/imcc/imcc.l"
yyterminate();
YY_BREAK
case 145:
YY_RULE_SETUP
-#line 728 "compilers/imcc/imcc.l"
+#line 725 "compilers/imcc/imcc.l"
ECHO;
YY_BREAK
-#line 4201 "compilers/imcc/imclexer.c"
+#line 4198 "compilers/imcc/imclexer.c"
case YY_STATE_EOF(pod):
case YY_STATE_EOF(cmt1):
case YY_STATE_EOF(cmt2):
@@ -5399,7 +5396,7 @@
#define YYTABLES_NAME "yytables"
-#line 728 "compilers/imcc/imcc.l"
+#line 725 "compilers/imcc/imcc.l"
@@ -5432,7 +5429,7 @@
}
static macro_frame_t *
-new_frame(Interp *interp) {
+new_frame(PARROT_INTERP) {
static int label = 0;
macro_frame_t * const tmp = mem_allocate_zeroed_typed(macro_frame_t);
@@ -5493,7 +5490,7 @@
}
static int
-yylex_skip(YYSTYPE *valp, Interp *interp, const char *skip, void *yyscanner)
+yylex_skip(YYSTYPE *valp, PARROT_INTERP, const char *skip, void *yyscanner)
{
int c;
const char *p;
@@ -5515,7 +5512,7 @@
}
static char*
-read_braced(YYSTYPE *valp, Interp *interp, const char *macro_name,
+read_braced(YYSTYPE *valp, PARROT_INTERP, const char *macro_name,
char *current, void *yyscanner)
{
YYSTYPE val;
@@ -5553,7 +5550,7 @@
}
static int
-read_params(YYSTYPE *valp, Interp *interp, params_t *params,
+read_params(YYSTYPE *valp, PARROT_INTERP, params_t *params,
const char *macro_name, int need_id, void *yyscanner)
{
YYSTYPE val;
@@ -5618,7 +5615,7 @@
}
static int
-read_macro(YYSTYPE *valp, Interp *interp, void *yyscanner)
+read_macro(YYSTYPE *valp, PARROT_INTERP, void *yyscanner)
{
int c, start_line;
params_t params;
@@ -5702,7 +5699,7 @@
}
static char *
-find_macro_param(Interp *interp, const char *name)
+find_macro_param(PARROT_INTERP, const char *name)
{
macro_frame_t *f;
@@ -5720,7 +5717,7 @@
}
static void
-define_macro(Interp *interp, ARGIN(const char *name), ARGIN(const params_t
*params),
+define_macro(PARROT_INTERP, ARGIN(const char *name), ARGIN(const params_t
*params),
ARGIN(const char *expansion), int start_line)
{
macro_t *m = find_macro(interp, name);
@@ -5747,7 +5744,7 @@
}
static macro_t *
-find_macro(Interp *interp, const char *name)
+find_macro(PARROT_INTERP, const char *name)
{
if (!IMCC_INFO(interp)->macros)
return NULL;
@@ -5756,7 +5753,7 @@
}
static int
-expand_macro(YYSTYPE *valp, Interp *interp, const char *name, void *yyscanner)
+expand_macro(YYSTYPE *valp, PARROT_INTERP, const char *name, void *yyscanner)
{
yyguts_t *yyg = (yyguts_t *)yyscanner;
const char *expansion = find_macro_param(interp, name);
@@ -5861,7 +5858,7 @@
}
static void
-include_file(Interp* interp, char *file_name, void *yyscanner)
+include_file(PARROT_INTERP, char *file_name, void *yyscanner)
{
char *ext;
FILE *file = 0;
@@ -5898,7 +5895,7 @@
}
static void
-scan_file(Interp *interp, macro_frame_t *frame, FILE *file, void *yyscanner)
+scan_file(PARROT_INTERP, macro_frame_t *frame, FILE *file, void *yyscanner)
{
yyguts_t * const yyg = (yyguts_t *)yyscanner;
frame->buffer = YY_CURRENT_BUFFER;
@@ -5912,7 +5909,7 @@
}
void
-IMCC_push_parser_state(Interp *interp)
+IMCC_push_parser_state(PARROT_INTERP)
{
macro_frame_t * const frame = new_frame(interp);
frame->s.next = (parser_state_t *)IMCC_INFO(interp)->frames;
@@ -5923,7 +5920,7 @@
}
static void
-pop_parser_state(Interp *interp, void *yyscanner)
+pop_parser_state(PARROT_INTERP, void *yyscanner)
{
macro_frame_t * const tmp = IMCC_INFO(interp)->frames;
if (tmp) {
@@ -5944,13 +5941,13 @@
}
void
-IMCC_pop_parser_state(Interp *interp, void *yyscanner)
+IMCC_pop_parser_state(PARROT_INTERP, void *yyscanner)
{
pop_parser_state(interp, yyscanner);
}
void
-compile_file(Interp *interp, FILE *file, void *yyscanner)
+compile_file(PARROT_INTERP, FILE *file, void *yyscanner)
{
yyguts_t * const yyg = (yyguts_t *)yyscanner;
YY_BUFFER_STATE buffer;
@@ -5982,7 +5979,7 @@
}
void
-compile_string(Interp *interp, char *s, void *yyscanner)
+compile_string(PARROT_INTERP, char *s, void *yyscanner)
{
yyguts_t * const yyg = (yyguts_t *)yyscanner;
YY_BUFFER_STATE buffer;
@@ -6013,7 +6010,7 @@
}
void
-IMCC_print_inc(Interp *interp)
+IMCC_print_inc(PARROT_INTERP)
{
macro_frame_t *f;
const char *old = IMCC_INFO(interp)->frames->s.file;