summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJohn Millaway <john43@users.sourceforge.net>2002-09-13 01:17:22 +0000
committerJohn Millaway <john43@users.sourceforge.net>2002-09-13 01:17:22 +0000
commit815fd665d8c46fc9f106fe65643c12614ffc9747 (patch)
treeb1135a92b387ceb3d8629464bc0b57261d51343d /tests
parentf6904782ed84d7a946ecca17c1b1269eee0978c0 (diff)
Bison bridge code now works for all C scanners and pure/non-pure bison parsers.
Added %option bison-bridge (--bison-bridge). Removed %option reentrant-bison/--reentrant-bison/-Rb. Scanner knows the name of its tables. Tables serialization is OK on EOF. yylineno is present in all scanners. Modified nasty performance penalty warning w/ yylineno. test-table-opts is now run last because it's so fat. Updated manual.
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am5
-rw-r--r--tests/descriptions1
-rw-r--r--tests/test-bison-yylloc/scanner.l2
-rw-r--r--tests/test-bison-yylval/scanner.l2
-rw-r--r--tests/test-table-opts/scanner.l4
5 files changed, 10 insertions, 4 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 75232ef..19a168a 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -26,8 +26,8 @@ noinst_SCRIPTS = \
create-test
SUBDIRS = \
+ test-bison-nr \
test-c++-basic \
- test-table-opts \
test-posixly-correct \
test-posix \
test-mem-r \
@@ -56,7 +56,8 @@ SUBDIRS = \
test-pthread \
test-string-nr \
test-string-r \
- test-yyextra
+ test-yyextra \
+ test-table-opts
# clean up before running the test suite so we dont test old builds of test code
diff --git a/tests/descriptions b/tests/descriptions
index 0066025..90e8420 100644
--- a/tests/descriptions
+++ b/tests/descriptions
@@ -5,6 +5,7 @@ array-nr - Use %option array, non-reentrant.
array-r - Use %option array, reentrant.
basic-nr - Simple scanner, non-reentrant.
basic-r - Simple scanner, reentrant.
+bison-nr - Ordinary bison-bridge.
bison-yylloc - Reentrant scanner + pure parser. Requires bison.
bison-yylval - Reentrant scanner + pure parser. Requires bison.
c-cpp-nr - Compile a C scanner with C++ compiler, nonreentrant.
diff --git a/tests/test-bison-yylloc/scanner.l b/tests/test-bison-yylloc/scanner.l
index ed22fe8..0ae65ed 100644
--- a/tests/test-bison-yylloc/scanner.l
+++ b/tests/test-bison-yylloc/scanner.l
@@ -32,7 +32,7 @@ static char* STRDUP(char* s1);
%}
%option 8bit outfile="scanner.c" prefix="test"
-%option reentrant-bison yylineno
+%option reentrant bison-bridge yylineno
%option nomain nounput noyy_top_state noyywrap nodefault warn
%option prefix="test" header="scanner.h"
diff --git a/tests/test-bison-yylval/scanner.l b/tests/test-bison-yylval/scanner.l
index 1af8db3..7e902f7 100644
--- a/tests/test-bison-yylval/scanner.l
+++ b/tests/test-bison-yylval/scanner.l
@@ -34,7 +34,7 @@ enum yesno_t { no=0, yes=1 };
%}
%option 8bit outfile="scanner.c" prefix="test"
-%option reentrant-bison
+%option reentrant bison-bridge
%option noyywrap nomain nounput noyy_top_state noyywrap nodefault warn
%option prefix="test" header="scanner.h"
%option stack
diff --git a/tests/test-table-opts/scanner.l b/tests/test-table-opts/scanner.l
index 9efd49f..4a3bf95 100644
--- a/tests/test-table-opts/scanner.l
+++ b/tests/test-table-opts/scanner.l
@@ -66,6 +66,10 @@ int main ( int argc, char** argv )
}
while(yylex(YY_CALL_ONLY_ARG) != 0)
;
+
+#ifdef YY_TABLES_EXTERNAL
+ yytables_destroy(YY_CALL_ONLY_ARG);
+#endif
yylex_destroy(YY_CALL_ONLY_ARG);
if(argc < 0) /* silence the compiler */