diff options
Diffstat (limited to 'tests/test-include-by-reentrant')
-rw-r--r-- | tests/test-include-by-reentrant/.gitignore | 7 | ||||
-rw-r--r-- | tests/test-include-by-reentrant/Makefile.am | 49 | ||||
-rw-r--r-- | tests/test-include-by-reentrant/scanner.l | 101 | ||||
-rw-r--r-- | tests/test-include-by-reentrant/test-1.input | 3 | ||||
-rw-r--r-- | tests/test-include-by-reentrant/test-2.input | 3 | ||||
-rw-r--r-- | tests/test-include-by-reentrant/test-3.input | 2 |
6 files changed, 0 insertions, 165 deletions
diff --git a/tests/test-include-by-reentrant/.gitignore b/tests/test-include-by-reentrant/.gitignore deleted file mode 100644 index a824aa3..0000000 --- a/tests/test-include-by-reentrant/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -Makefile -Makefile.in -parser.c -parser.h -scanner.c -test-include-by-reentrant -OUTPUT diff --git a/tests/test-include-by-reentrant/Makefile.am b/tests/test-include-by-reentrant/Makefile.am deleted file mode 100644 index 3f4d1d5..0000000 --- a/tests/test-include-by-reentrant/Makefile.am +++ /dev/null @@ -1,49 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. 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. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -EXTRA_DIST = scanner.l test-1.input test-2.input test-3.input -CLEANFILES = scanner.c scanner.h parser.c parser.h $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o # parser.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -#LDFLAGS = $(top_srcdir)/libfl.a -#LFLAGS = --header="scanner.h" -#YFLAGS = --defines --output=parser.c - -testname = test-include-by-reentrant - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $(LFLAGS) $< - -parser.c: $(srcdir)/parser.y - $(BISON) $(YFLAGS) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname) $(srcdir)/test-1.input - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< diff --git a/tests/test-include-by-reentrant/scanner.l b/tests/test-include-by-reentrant/scanner.l deleted file mode 100644 index 8d23681..0000000 --- a/tests/test-include-by-reentrant/scanner.l +++ /dev/null @@ -1,101 +0,0 @@ -/* - * This file is part of flex. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE. - */ - -%{ -/* A scanner file to build "scanner.c". - Input language is any text. - "#include <filename>" causes a new scanner to be created. - */ -#include <stdio.h> -#include <stdlib.h> -#include "config.h" -%} - -%option 8bit outfile="scanner.c" prefix="test" -%option nounput nomain noyywrap -%option reentrant -%option warn - -%x GET_FILENAME - -%% - -<INITIAL>{ -^"#include"[[:blank:]]+"<" { BEGIN(GET_FILENAME); } -.|\n { ECHO; } -} - -<GET_FILENAME>{ -[[:alnum:]_.-]+> { - /* recurse */ - yyscan_t scanner; - FILE * fp; - yytext[yyleng-1]='\0'; - if((fp=fopen(yytext,"r"))==NULL) { - fprintf(stderr,"*** Error: Could not open include file \"%s\".\n", - yytext); - yyterminate(); - } - yylex_init(&scanner); - yyset_in( fp, scanner); - yyset_out( stdout, scanner); - yylex(scanner); - yylex_destroy(scanner); - - BEGIN(0); - } -.|\n { - fprintf(stderr,"Invalid input \"%s\".\n", yytext); - yyterminate(); - } -} - -<<EOF>> { fclose(yyin); yyterminate();} - -%% - -int main (int argc, char** argv); - -int -main ( argc, argv ) - int argc; - char ** argv; -{ - FILE * fp; - yyscan_t scanner; - if( argc != 2 ) { - fprintf(stderr,"*** Error: Must specifiy one filename.\n"); - exit(-1); - } - if((fp=fopen(argv[1],"r"))==NULL) { - fprintf(stderr,"*** Error: fopen(%s) failed.\n",argv[1]); - exit(-1); - } - yylex_init(&scanner); - yyset_in( fp, scanner); - yyset_out( stdout, scanner); - yylex(scanner); - yylex_destroy(scanner); - printf("TEST RETURNING OK.\n"); - return 0; -} diff --git a/tests/test-include-by-reentrant/test-1.input b/tests/test-include-by-reentrant/test-1.input deleted file mode 100644 index 355beaa..0000000 --- a/tests/test-include-by-reentrant/test-1.input +++ /dev/null @@ -1,3 +0,0 @@ -Beginning of "test-1.input". -#include <test-2.input> -End of "test-1.input". diff --git a/tests/test-include-by-reentrant/test-2.input b/tests/test-include-by-reentrant/test-2.input deleted file mode 100644 index 45f11f9..0000000 --- a/tests/test-include-by-reentrant/test-2.input +++ /dev/null @@ -1,3 +0,0 @@ -Beginning of "test-2.input". -#include <test-3.input> -End of "test-2.input". diff --git a/tests/test-include-by-reentrant/test-3.input b/tests/test-include-by-reentrant/test-3.input deleted file mode 100644 index 6a2d055..0000000 --- a/tests/test-include-by-reentrant/test-3.input +++ /dev/null @@ -1,2 +0,0 @@ -Beginning of "test-3.input". -End of "test-3.input". |