diff options
author | Manoj Srivastava <srivasta@debian.org> | 2016-01-22 13:51:30 -0800 |
---|---|---|
committer | Manoj Srivastava <srivasta@debian.org> | 2016-01-22 13:51:30 -0800 |
commit | f753f2b7b6d97014110dbe418861353a2f3f445d (patch) | |
tree | 7f248ce2f59fbb79cab24b4727955e37e9a5ab81 /tests/test-ccl | |
parent | 306163051847aaaabe7ae0f4cfc7d23f15923f3a (diff) | |
parent | a646b6cd438dc4bd957c6c6afd89b5e8e59468fe (diff) |
Merge branch 'upstream'
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
# Conflicts:
# INSTALL
# Makefile.in
# aclocal.m4
# build-aux/compile
# build-aux/config.guess
# build-aux/config.sub
# build-aux/depcomp
# build-aux/install-sh
# build-aux/mdate-sh
# build-aux/texinfo.tex
# configure
# doc/Makefile.in
# doc/flex.1
# doc/flex.info
# doc/flex.info-1
# doc/flex.info-2
# doc/flex.pdf
# doc/stamp-vti
# doc/version.texi
# examples/Makefile.in
# examples/fastwc/Makefile.in
# examples/manual/Makefile.in
# src/config.h.in
# tests/Makefile.in
# tests/test-bison-nr/Makefile.am
# tests/test-bison-yylloc/Makefile.am
# tests/test-bison-yylval/Makefile.am
# tools/Makefile.in
Diffstat (limited to 'tests/test-ccl')
-rw-r--r-- | tests/test-ccl/Makefile.am | 44 | ||||
-rw-r--r-- | tests/test-ccl/scanner.l | 95 | ||||
-rw-r--r-- | tests/test-ccl/test.input | 27 |
3 files changed, 0 insertions, 166 deletions
diff --git a/tests/test-ccl/Makefile.am b/tests/test-ccl/Makefile.am deleted file mode 100644 index 0a92bb2..0000000 --- a/tests/test-ccl/Makefile.am +++ /dev/null @@ -1,44 +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 - -builddir = @builddir@ - -EXTRA_DIST = scanner.l test.input -CLEANFILES = scanner.c scanner.h $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o - -AM_CPPFLAGS = -I$(srcdir) -I$(builddir) -I$(top_srcdir) -I$(top_builddir) - -testname = test-ccl - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $(LFLAGS) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname)$(EXEEXT) < $(srcdir)/test.input - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< diff --git a/tests/test-ccl/scanner.l b/tests/test-ccl/scanner.l deleted file mode 100644 index 330278a..0000000 --- a/tests/test-ccl/scanner.l +++ /dev/null @@ -1,95 +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 template scanner file to build "scanner.c". */ -#include <stdio.h> -#include <stdlib.h> -#include "config.h" -/*#include "parser.h" */ - -#define err_abort() do{printf("ERROR: flex line %d. input line %d.\n", __LINE__, yylineno); abort();} while(0) -#define a_ok() do{printf("OK: flex line %d. input line %d.\n", __LINE__, yylineno); return 1;}while(0) -%} - -%option 8bit outfile="scanner.c" prefix="test" -%option nounput nomain noyywrap -%option warn - - -%% - -^"^alpha:"[[:^alpha:]]+@alpha@\n printf("OK: %s", yytext); ++yylineno; return 1; -^"^digit:"[[:^digit:]]+@digit@\n printf("OK: %s", yytext); ++yylineno; return 1; -^"^alnum:"[[:^alnum:]]+@alnum@\n printf("OK: %s", yytext); ++yylineno; return 1; -^"^upper:"[[:^upper:]]+@upper@\n printf("OK: %s", yytext); ++yylineno; return 1; -^"^lower:"[[:^lower:]]+@lower@\n printf("OK: %s", yytext); ++yylineno; return 1; -^"^space:"[[:^space:]]+@space@\n printf("OK: %s", yytext); ++yylineno; return 1; -^"^blank:"[[:^blank:]]+@blank@\n printf("OK: %s", yytext); ++yylineno; return 1; -^"^punct:"[[:^punct:]]+@punct@\n printf("OK: %s", yytext); ++yylineno; return 1; -^"^cntrl:"[[:^cntrl:]]+@cntrl@\n printf("OK: %s", yytext); ++yylineno; return 1; -^"^xdigit:"[[:^xdigit:]]+@xdigit@\n printf("OK: %s", yytext); ++yylineno; return 1; - -^"a-d:"[[:alpha:]]{-}[[:digit:]]+@a-d@\n printf("OK: %s", yytext); ++yylineno; return 1; -^"l-xyz:"([[:lower:]]{-}[xyz])+@l-xyz@\n printf("OK: %s", yytext); ++yylineno; return 1; -^"abcd-bc:"([abcd]{-}[bc])+@abcd-bc@\n printf("OK: %s", yytext); ++yylineno; return 1; -^"abcde-b-c:"([abcde]{-}[b]{-}[c])+@abcde-b-c@\n printf("OK: %s", yytext); ++yylineno; return 1; -^"^XY-^XYZ:"([^XY]{-}[^XYZ])+@^XY-^XYZ@\n printf("OK: %s", yytext); ++yylineno; return 1; - -^"a+d:"([[:alpha:]]{+}[[:digit:]])+"@a+d@"\n a_ok(); -^"a-u+Q:"([[:alpha:]]{-}[[:upper:]]{+}[Q])+"@a-u+Q@"\n a_ok(); - -^"ia:"(?i:a)+@ia@\n printf("OK: %s", yytext); ++yylineno; return 1; -^"iabc:"(?i:abc)+@iabc@\n printf("OK: %s", yytext); ++yylineno; return 1; -^"ia-c:"(?i:[a-c]+)@ia-c@\n printf("OK: %s", yytext); ++yylineno; return 1; - - /* We don't want this one to match. */ -^"check-a:"(?i:(?-i:A))@\n err_abort(); -^"check-a:"(?i:(?-i:(?i:A)))@\n printf("OK: %s", yytext); ++yylineno; return 1; - - /* We don't want this one to match. */ -^"dot-all-1:"(?-s:XXX.*)@dot-all-1@\n err_abort(); -^"dot-all-1:"(?s:XXX.*)@dot-all-1@\n a_ok(); - -^"x1:"(?x: a | b )+@x1@\n a_ok(); -^"x2:"(?x: a | - (?# Comment ) - b - )+@x2@\n a_ok(); - - -.|\n { err_abort(); } -%% - -int main(void); - -int -main () -{ - yyin = stdin; - yyout = stdout; - while (yylex()) - ; - printf("TEST RETURNING OK.\n"); - return 0; -} diff --git a/tests/test-ccl/test.input b/tests/test-ccl/test.input deleted file mode 100644 index b318fe6..0000000 --- a/tests/test-ccl/test.input +++ /dev/null @@ -1,27 +0,0 @@ -^alpha:0123456789 ~!@#$%^&*(){}[]':;"<>,./?\+=_-`@alpha@ -^digit:abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ~!@#$%^&*(){}[]':;"<>,./?\+=_-`@digit@ -^alnum:~!@#$%^&*(){}[]':;"<>,./?\+=_-`@alnum@ -^upper:abcdefghijklmnopqrstuvwxyz0123456789 ~!@#$%^&*(){}[]':;"<>,./?\+=_-`@upper@ -^lower:ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEF ~!@#$%^&*(){}[]':;"<>,./?\+=_-`@lower@ -^space:abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEF~!@#$%^&*(){}[]':;"<>,./?\+=_-`@space@ -^blank:abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEF~!@#$%^&*(){}[]':;"<>,./?\+=_-`@blank@ -^punct:abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEF Z@punct@ -^cntrl:abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEF~!@#$%^&*(){}[]':;"<>,./?\+=_-`@cntrl@ -^xdigit:ghijklmnopqrstuvwxyzGHIJKLMNOPQRSTUVWXYZ ~!@#$%^&*(){}[]':;"<>,./?\+=_-`@xdigit@ -a-d:abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@a-d@ -l-xyz:abcdefghijklmnopqrstuvw@l-xyz@ -abcd-bc:aaaaddddaaaa@abcd-bc@ -abcde-b-c:aaaaddddeeee@abcde-b-c@ -^XY-^XYZ:ZZZZZZZZZZZ@^XY-^XYZ@ -a+d:abc0123xyz789@a+d@ -a-u+Q:abcQQQQxyz@a-u+Q@ -ia:AaAa@ia@ -iabc:ABCabcAbCaBc@iabc@ -ia-c:ABCabcAbCaBc@ia-c@ -check-a:a@ -dot-all-1:XXX junk - junk - junk - @dot-all-1@ -x1:abaabb@x1@ -x2:abaabb@x2@ |