summaryrefslogtreecommitdiff
path: root/tests/test-table-opts/scanner.l
diff options
context:
space:
mode:
authorWill Estes <westes575@gmail.com>2012-08-07 12:18:08 -0400
committerWill Estes <westes575@gmail.com>2012-08-07 15:56:44 -0400
commitec676fce008138b222d072de28fb05e1dfd945fb (patch)
tree1d45f3a3df39df4647ec4487f426f8f6b564373a /tests/test-table-opts/scanner.l
parentc1a633de7c2ee2fb450b24ec46e9c4390f3c69ea (diff)
downloadflex-git-ec676fce008138b222d072de28fb05e1dfd945fb.tar.gz
reorganize flex skeleton and m4 processingbug-2172046
Diffstat (limited to 'tests/test-table-opts/scanner.l')
-rw-r--r--tests/test-table-opts/scanner.l28
1 files changed, 15 insertions, 13 deletions
diff --git a/tests/test-table-opts/scanner.l b/tests/test-table-opts/scanner.l
index 3ad6199..b7f5b76 100644
--- a/tests/test-table-opts/scanner.l
+++ b/tests/test-table-opts/scanner.l
@@ -45,38 +45,40 @@ foo|bar ;
int main ( int argc, char** argv )
{
FILE* fp = NULL;
- void *yyscanner=0;
- M4_YY_DECL_GUTS_VAR();
#ifdef TEST_IS_REENTRANT
+ void *yyscanner=NULL;
yylex_init(&yyscanner);
+#define YY_CALL_LAST_ARG , yyscanner
+#define YY_CALL_ONLY_ARG yyscanner
+#else
+#define YY_CALL_LAST_ARG
+#define YY_CALL_ONLY_ARG
#endif
#ifdef TEST_HAS_TABLES_EXTERNAL
if((fp = fopen(argv[1],"r"))== NULL)
- YY_FATAL_ERROR("could not open tables file for reading");
+ yy_fatal_error("could not open tables file for reading" YY_CALL_LAST_ARG);
- if(yytables_fload(fp M4_YY_CALL_LAST_ARG) < 0)
- YY_FATAL_ERROR("yytables_fload returned < 0");
- if(M4_YY_TABLES_VERIFY)
+ if(yytables_fload(fp YY_CALL_LAST_ARG) < 0)
+ yy_fatal_error("yytables_fload returned < 0" YY_CALL_LAST_ARG);
+#ifdef TEST_HAS_TABLES_VERIFY
exit(0);
#endif
+#endif
if(argc > 2){
if((fp = fopen(argv[2],"r"))== NULL)
- YY_FATAL_ERROR("could not open input file for reading");
+ yy_fatal_error("could not open input file for reading" YY_CALL_LAST_ARG);
yyin = fp;
}
- while(yylex(M4_YY_CALL_ONLY_ARG) != 0)
+ while(yylex(YY_CALL_ONLY_ARG) != 0)
;
#ifdef TEST_HAS_TABLES_EXTERNAL
- yytables_destroy(M4_YY_CALL_ONLY_ARG);
+ yytables_destroy(YY_CALL_ONLY_ARG);
#endif
- yylex_destroy(M4_YY_CALL_ONLY_ARG);
-
- if(argc < 0) /* silence the compiler */
- yyscanner = (void*)fp;
+ yylex_destroy(YY_CALL_ONLY_ARG);
return 0;
}