92 Commits
Author SHA1 Message Date
Will Estes ab49343b08 gettext: pulled latest translations; recompiled against current sources 2017-05-06 16:34:36 -04:00
Will Estes 0cfad78b32 version 2.6.4
* NEWS: Record release date.
2017-05-06 16:34:35 -04:00
Will Estes 31cdc1f095 note previous version 2017-05-06 16:34:35 -04:00
Will Estes 3d843a0f8d doc: update NEWS for upcoming release 2017-05-06 16:34:35 -04:00
viktor.shepel 7889866f58 doc: Correct typo in C code sample in manual 2017-05-06 10:56:29 -04:00
Explorer09 e5c7ad3aec scanner: Mention %# comments are removed when building skel.c 2017-05-06 10:51:48 -04:00
Demi Obenour a1634aa8d3 Honor user definitions of yy_* macros
The user may have defined the yy_* macros themselves.  In that case,
don't clobber them.
2017-05-03 16:16:37 -04:00
Demi Obenour d564d45477 Don't leak macro definitions into header files
This allowed unnamespaced definitions to leak into header files,
breaking client code.

Fixes #142
2017-05-03 16:16:37 -04:00
Demi Obenour ba530cd52f scanner: Check for 0 bracecount when EOL ends quoted literal.
This can happen in the case of // comments (which Flex doesn't handle
specially).
2017-05-03 16:13:39 -04:00
Demi Obenour b1c2957b3f scanner: when bracelevel is negative, treat as zero.
This really should never happen, but this at least fixes the
breakage on Verilator.
2017-05-03 16:13:02 -04:00
Jeff Smith 8b746fa025 test: enable more silent building of tests.
When running 'make V=0 check', some compile and link steps are made
less verbose and some are not.  This cleans up most steps that are
not.

These have no effect if V=0 is not specified.
2017-05-03 14:27:42 -04:00
Demi Obenour 2f21edac99 build: Delete comments from skeleton file.
Since the comments in flex.skl are, by hypothesis, not needed in
skel.c, we remove them. THis reduces the size of the resulting
executable somewhat.
2017-05-03 13:24:09 -04:00
Explorer09 2592576239 build: do not generate lib/Makefile.in.
Files in lib/ are picked up and built using makefile directives in
src/Makefile.am. Remove the need to generate lib/Makefile.in and the
stub lib/Makefile.am.
2017-05-03 13:14:16 -04:00
Will Estes 9131b8426a gettext: revert listing generated .c files 2017-05-02 20:39:15 -04:00
Jeff Smith 88b8e2a9d5 FLEX_EXIT() is the preferred way to exit flex 2017-05-02 15:31:05 -04:00
Explorer09 47d6a45345 Fix myesc() 'sptr' conditionals
* Don't call isascii() here. It's deprecated in POSIX and not needed
  for myesc's case.
* The check of the character class and range here should match what's
  defined as {ESCSEQ} in scan.l, so for [[:xdigit:]] we use isxdigit();
  for [0-7] we check '0' <= c <= '7' (not isdigit(c) because isdigit is
  locale-dependant in standard's sense)
* Add missing length limit for "\x<hex>" (<hex> is at most 2 digits)
2017-05-02 15:14:25 -04:00
Explorer09 d4ab90f185 Obsolete htoui() and otoui(); use strtoul().
No sense to keep these two function when libc's strtoul() can do the
same job, but better.
2017-05-02 15:14:25 -04:00
Todd C. Miller 09697fb269 scanner: update yy_buf_size after yyrealloc() 2017-05-02 15:08:10 -04:00
Simon Sobisch c2ceb3e129 build: use lowest versions for gettext, automake. 2017-05-02 14:56:59 -04:00
Simon Sobisch 5b30b23fe9 gettext: more recent makevars; new script to update po files.
Previously, "make dist" and similar commands would cause the po files
to be updated, which is incorrect. The more recent version now used
should not do this.

Replaced Rules-getpo by extra script to manually update and rebuild all po files.
2017-05-02 14:56:59 -04:00
Simon Sobisch 3211921c23 gettext: list generated files instead of flex, bison sources in POTFILES.in.
Listing the flex and bison sources -- as the gettext manual suggests
-- causes warnings. Listing the generated C files for the lexer and
parser removes the warnings. Since both files contain line directives,
any translator who needs to refer back to those files should be able
to find the context in which strings are needed.
2017-05-02 14:56:38 -04:00
Simon Sobisch 4efcf28ee6 build: only touch ChangeLog if it does not exist 2017-05-02 14:43:49 -04:00
Simon Sobisch 634ef8a945 build: list earliest useable versions for automake 2017-05-02 14:43:49 -04:00
Simon Sobisch 0a9687d138 build: check for how to call libtoolize.
Previously, we would call libtoolize and if that failed, we would call
glibtoolize since some platforms have the libtoolize program under
that name.

Instead, we check to see if the environment variable LIBTOOLIZE is set
and use that if so. Otherwise, we try to find a program "libtoolize"
on the path and failing that glibtoolize. We alert the user if no
suitable program can be found.
2017-05-02 14:43:49 -04:00
Alastair Hughes 89f10ee36f build: support cross compiling.
Check for cross compiling. If cross compiling, build stage1flex using a
custom link command.
We also override LDADD since that adds the replacement implementations
that are cross compiled, and instead always use the replacement library
implementations.

We don't use BUILD_OBJEXT and BUILD_EXEEXT since it seems that automake
does not support these.

Fixes #78.
2017-02-23 14:07:56 -05:00
Explorer09 d1b195b671 build: Include <strings.h>; add strcasecmp() check to configure.
strings.h (not string.h) is the standard-defined include header for
strcasecmp(). Include <strings.h> for portability (even though glibc
exposes strcasecmp() declaration also in <string.h> by default).
2017-02-17 16:56:21 -05:00
Explorer09 dbb4e94dc7 build: Let configure error if missing required functions, headers..
`configure` will now error if a required header or function is not
found on the system.

Also add comments on optional functions checks.

Add sys/stats.h and sys/wait.h to list of required headers in
configure.

This fixes issue #180.
2017-02-17 16:55:33 -05:00
Explorer09 c7a545ae09 scanner: compute powers of two faster.
Replace the naive "for" loop in determining power of two with a clever
bitwise solution. This code is around the Internet already and is in
Public Domain.
2017-02-16 13:26:21 -05:00
Explorer09 122e58965a test: skip pthread test when needed files missing.
"Unlisting" the pthread test when libpthread is not available is never
a good idea. Should let it compile into a stub program that returns
the "skip" status.

configure.ac and tests/Makefile.am are edited so that pthread test can
be built anyway, but only works (not as the stub) when both pthread.h
and libpthread are detected on the system.

Also fix a small typo in tests/pthread.l comments.
2017-02-16 09:33:35 -05:00
Will Estes 2e820b6015 build: mv scan.c when building dist.
Revert change to copy scan.c when building the distribution
archive. Move it instead. This satisfies automake's notions of what
should be clean and ensures that the distribution archive contains a
just-built copy of scan.c.

Fixes #186
2017-02-16 09:27:22 -05:00
Will Estes 44f10b366f build: don't assume distdir/scan.c is writeable 2017-02-06 12:04:03 -05:00
Explorer09 a7adbf20a9 build: Add dist-hook to force remake scan.c.
This will ensure the flex scanner included in release tarball being
generated by exactly the flex version to be released.

Here's one catch after this change: You may not run "make dist" or
"make distdir" if you configure the flex source to be cross-compiled.
2017-02-06 11:48:05 -05:00
Explorer09 dae5c22f87 build: respect '--localedir' from configure.
Makefile shouldn't overwrite the 'localedir' variable, because that's
what '--localedir' option in 'configure' is for.
2017-02-06 11:45:09 -05:00
Explorer09 dec3a380e5 build: Remove "-I$(top_srcdir)/intl" from CPPFLAGS.
Revert commit e02c3d27ee

("include the intl/ subdirectory when searching for include files")

Flex doesn't come with libintl source code, so inclusion of
$(top_srcdir)/intl subdirectory during compiling is unnecessary.

This flag seems to be left after "remove intl from dist"
(commit 8f45da06ad) without someone
cleaning this up.

Users who need to build with gettext functionality from libintl would
use the '--with-libintl-prefix' configure option.
2017-02-06 11:44:13 -05:00
Explorer09 e2d569053a scanner: fix regcomp's error reporting, double malloc.
Fix unneeded double malloc - let regerror(). Write its message after
our "regcomp for (regex) failed: " string.

Also, errbuf cannot be free()'d because of flexfatal containing a
longjmp.
2017-02-06 11:37:18 -05:00
Explorer09 3c0ccc4520 test: Skip bison tests if bison is not available 2017-01-25 10:33:06 -05:00
Explorer09 546851ba35 build: remove repeated bison detection from configure.
AC_PROG_YACC already detects the bison program. We can just use it,
and make notice if [ $YACC != 'bison -y' ]

Remove unused AC_SUBST([BISON], ...).

Add AM_CONDITIONAL([HAVE_BISON], ...) so that we can skip bison tests
in testsuite when bison is absent.

We don't make any attempt to detect other yacc implementations since
flex is developed with bison. While it would be possible, the need
isn't there right now. It would be possible to add a --with-parser
option that defaulted to bison if such a need cropped up.
2017-01-25 10:29:26 -05:00
Explorer09 a2fccbe579 build: fix Makefile parse.h dependency clauses.
The current clauses stating "main.c: parse.h" and "yylex.c: parse.h" do
not work as expected. Make did not try to build parse.h upon building
flex-main.o as it would think main.c exist already and ignore the
clause. Fix this by explicitly stating that the .o files depend on
parse.h instead.

This dependency bug only happens if user builds flex from a
checked-out repository.
2017-01-24 12:07:06 -05:00
Explorer09 e8cb34ed48 test: Remake *_scanner.c if *_scanner.h is missing.
If a ${foo}_scanner.c exists but the respective ${foo}_scanner.h is
missing, then 'make' can halt. Fix this by deleting the
${foo}_scanner.c file and then remake it. This rule is the same as the
automake-generated rule for .c files that require LEX or YACC (except
automake will use ylwrap).
2017-01-24 11:56:09 -05:00
Explorer09 afc687f586 test: remove BUILT_SOURCES; add missing dependencies.
Without BUILT_SOURCES in Makefile, no test sources in tests/ will be
built when using the default "make all" target. This is desireable for
people who are just building flex but who do not want to run, and
therefore, build any part of the test suite.

Also fix missing sources dependencies:

    bison_nr_scanner.$(OBJEXT): bison_nr_parser.h
    bison_yylloc_scanner.$(OBJEXT): bison_yylloc_parser.h
    bison_yylval_scanner.$(OBJEXT): bison_yylval_parser.h
2017-01-24 11:53:46 -05:00
Explorer09 9c54eb6e30 build: detect overflow for [re]allocate_array.
Use reallocarray() when we have it (i.e. in OpenBSD system). When we
don't, use equivalent overflow detection for our allocate_array and
reallocate_array functions.

Remove lib/reallocarray.c from our LIBOBJS as we no longer need it.

Provide a fallback SIZE_MAX macro definition in flexint.h (not
preprocessor friendly, but enough for our reallocate_array use case).
2017-01-24 07:36:50 -05:00
Will Estes 7e4d538724 doc: v2.6.4 2017-01-23 14:25:11 -05:00
Thomas Klausner 0a89eef5dc build: more BSD make and vpath build fixes.
BSD make doesn't like $< with more than one source
specified. Additionally, make sure to specify srcdir when referring to
source files since vpath builds depend on this.
2017-01-23 13:48:15 -05:00
Thomas Klausner b61b0fe906 build: Fix skel.c generation with BSD make 2017-01-23 13:45:34 -05:00
Christos Zoulas 078b46c69d Add more defines in the non-reentrant part.
Fix the reentrant part; don't "#define yyfoo yyfoo" because it breaks
code that does #ifndef yywrap ..
2017-01-23 13:39:49 -05:00
Christos Zoulas 726c8dab23 scanner: Add yyparse prototype 2017-01-23 13:38:58 -05:00
Thomas Klausner 6bf98d9aea scanner: move comment for consistency 2017-01-23 13:35:26 -05:00
Christos Zoulas 1a9468797d scanner: Use array instead of pointer 2017-01-23 13:32:40 -05:00
Christos Zoulas 43a5bebd7d scanner: manage path to m4 better.
Avoid alloca() for SSP; it is better anyway; since we don't need to
strdup the path.
2017-01-23 12:31:21 -05:00
Christos Zoulas fb175a49c3 scanner: Avoid creating unused label 2017-01-23 12:06:53 -05:00
Christos Zoulas f01ab4fe02 Cast argument to avoid arithmetic on void *. 2017-01-23 11:42:14 -05:00
Christos Zoulas 7ca76038df scanner: Use strncpy 2017-01-23 11:38:36 -05:00
Christos Zoulas f5d87f1a26 scanner: Use prefix when defining yywrap to avoid redefinition.
Fixes regression introduced in v2.6.3.
2017-01-23 11:35:19 -05:00
Christos Zoulas 6f47a5232c scanner: Include stdarg.h for va_list 2017-01-23 11:27:51 -05:00
Christos Zoulas d0d0573900 scanner: Rename warn to lwarn.
This avoids a naming conflict in NetBSD's  libc.
2017-01-23 11:01:54 -05:00
Explorer09 da071cfb7a test: document automake convention for skipped exit status. 2017-01-20 11:06:06 -05:00
Explorer09 dd7c6d4a0f test: let testwrapper scripts be run by ${SHELL}.
This allows user to use a different shell if /bin/sh has problems.
The use of $SHELL (variable) to run scripts is already an Automake
convention. All shell scripts in build-aux are run by $SHELL.
2017-01-17 21:10:42 -05:00
Explorer09 bcf7a07369 test: Remove test scripts bashisms.
They now all work under a POSIX compliant sh. Specifically, 'dash' can
now be used for running "make check" tests.

Note that none of these scripts has ever been using a pipe, so
`set -o pipefail` is unnecessary and removed.
2017-01-17 21:10:16 -05:00
Explorer09 8c8691c3fd test: exit on '-1' test non-zero status.
If a '-1' test program returns a non-zero status, don't go further and
compare it's (numeric) output values. This allows a '-1' test to
indicate a "skip" status or an otherwise error. (Currently no such '-1'
test would skip like this, though.)

Shell syntax note: `set -e` will not exit with the syntax like this
`test $(false) = $(false);`. The exit statuses of `false` in the
example will be ignored instead. But putting the output in a variable,
such as `VAR=$(false)`, DOES exit.
2017-01-17 21:08:42 -05:00
Explorer09 bb92951c02 build: Fix 'make indent' target
This 'make indent' target has not been working since the directories
reorganization in flex 2.6.0. Now make it work again.

Note that the current indent profile breaks many styles of existing
code. The indent target should not be used until the .indent.pro
options are reviewed for desireability.
2017-01-12 18:02:24 -05:00
Explorer09 8db5267af4 build: Simplify indent program detection 2017-01-12 18:01:57 -05:00
Tobias Klauser de0c5e91df filter: Don't emit #line if %option noline set
One place emitting a #line directive to the generated header was
missed in commit 647a92b9f4 when resolving #55. Fix it to respect
gen_line_dirs as well.
2017-01-12 17:44:00 -05:00
Will Estes 84a9a4b9fc translation: refresh po files from translation project 2017-01-12 13:22:02 -05:00
Harald van Dijk e666829949 c++: Fix yyrestart(NULL) SEGV.
Binding a reference to a dereferenced null pointer is invalid and
compilers optimise away the &file == 0 check. We need a real stream.

yyin is available already, and yyrestart(NULL) is only supported when
yyin will not be used, so there is no harm in just passing in that.
Since we now always have a valid stream, we can skip the null check
too.

Fixes #98.
2017-01-11 21:04:28 -05:00
luistung 7f263e3520 scanner: join symbol list.
Removed a newline that caused a problem building the scanner in some
circumstances. Specifically:

'bad character' error  when executing

/bin/sh ../build-aux/ylwrap scan.l lex.yy.c scan.c -- flex
2017-01-11 09:09:15 -05:00
Will Estes a58086a269 scanner: remove void cast before fprintf 2017-01-11 09:05:18 -05:00
Will Estes 581ef6d17f doc: update NEWS for 2.6.3 release 2016-12-30 12:48:24 -05:00
Explorer09 adddfba7ab build: New configure option '--disable-bootstrap'.
If configure is run with '--disable-bootstrap', then stage1flex won't
be built and stage1scan.c will be generated by sed'ing scan.c.

This option is intended to workaround bootstrap bugs rather than to
fix the bootstrapping issues which are proving subtler and harder to
fix than anyone would like.
2016-12-29 17:26:07 -05:00
Explorer09 6964073c59 build: "make clean" deletes stage1scan.c, stage1flex 2016-12-29 17:25:19 -05:00
Explorer09 935478c3fe build: allow building libfl even with --disable-libfl.
For various reasons, we may wish to build libfl explicitly even when
configure has been run with the --disable-libfl option. This is
possible, now, via 'make -C src libfl.la'.
2016-12-29 17:19:53 -05:00
Alexis La Goutte a33e6fd5b4 scanner: remove trailing whitespace in skeleton 2016-12-29 15:11:11 -05:00
Demi Obenour 8d4aa5ccaf scanner: Disallow, overquote '[' and ']' in prefix 2016-12-29 14:18:15 -05:00
Samuel Thibault 7975c43384 scanner: allocate correct buffer size for m4 path.
Flex did not check the length of the m4 path which could lead to a
buffer overflow in some cases. Additionally, not all platforms believe
in PATH_MAX, so stop relying on it.

Fixes #138
2016-12-29 08:47:10 -05:00
Will Estes 6bea32e937 doc: note no more libcompat in NEWS 2016-11-24 18:50:21 -05:00
Will Estes 223f297825 build: explain empty lib/Makefile.am 2016-11-24 18:50:21 -05:00
Explorer09 44fa758931 build: warn about cross compiling with *alloc 2016-11-24 18:48:28 -05:00
Explorer09 713f5a0cb4 build: Link $(LIBOBJS) from src/ dir, remove libcompat.la.
The libcompat.la library was small and less friendly to bootstrapping
and cross compilation. Now, we will simply link individual object
files as needed, which is simpler.
2016-11-24 18:45:07 -05:00
Explorer09 11c445cde9 build: Let stage1flex respect LFLAGS 2016-11-15 19:26:08 -05:00
Will Estes 99612781d9 doc: describe --disable-libfl in NEWS 2016-11-14 14:26:48 -05:00
Explorer09 5d71e9ffb9 build: Add --disable-libfl configure option.
Disabling libfl is useful when building flex for a cross-toolchain.

Fixes: GH-99
2016-11-14 14:23:27 -05:00
Demi Obenour 347652c32b fix backwards incompatible changes in 2.6.2.
This patch addscompatibility `#defines` for all macros affected by
`%prefix`.

Fixes #113.
2016-11-12 12:00:12 -05:00
Will Estes d374b87e68 git: ignore quote_in_comment artifacts 2016-11-08 12:53:21 -05:00
Demi Obenour c8ad3d682f Fixes a major bug in Flex's own lexing of literals.
My changes caused Flex to mishandle string and character literals in
line comments.  This commit fixes them.

Fixes #113.
2016-11-08 12:49:44 -05:00
Thomas Klausner 0af671a275 Fix unportable test(1) operator.
"==" is only supported by bash, "=" is the standard comparison
operator.
2016-11-06 22:32:43 +01:00
Demi Obenour 14846e5e1a Add more escaping tests 2016-11-02 13:22:02 -04:00
Demi Obenour e1038db19a Fix another escaping bug
in non-indented verbatim section 2 code.

I also did some reformatting.
2016-11-01 20:20:46 -04:00
Alastair Hughes 75f4305eed build: fix false negatives for help2man and texi2dvi
HELP2MAN and TEXI2DVI (or the corresponding ac_prog variables) will
never be zero length as they fall back to the missing script; check for
the fall back and warn on that instead of always warning.
2016-10-29 09:11:20 -04:00
Explorer09 c503eaf061 doc: Don't delete flex.1 during "make distclean".
flex.1 is pre-generated in release tarball. If we delete it, the next
"configure and make" on the source directory will then require help2man
unnecessarily.
2016-10-28 19:48:11 -04:00
Alastair Hughes 92311a56b3 Only regenerate the man page when required.
Make the flex binary an order-only prerequisite, and add back the
prerequisites from before 7cfb440. This prevents rebuilding the man page
whenever the flex binary is rebuilt, which causes problems if help2man
is not installed and will never work when cross compiling.

Fixes #108.
2016-10-27 17:55:46 -04:00
Will Estes 2bf2ad6d68 build: no longer build PIC version of libfl.
The PIC version of libfl was not being built correctly. From the lack
of bug reports around this problem, we conclude that the PIC version
of libfl is not used and so we drop it from the build build targets
for flex.
2016-10-26 14:09:36 -04:00
Explorer09 023cd4f754 doc: README.md formatting fixes
* Wrap everything in the raw document in 72 char per line limit.
* Proper casing for terms "Git" and "GitHub" (don't try to look lazy).
* Add unordered list marks when needed.
* Say `configure && make && make install` and quoted for fixed-width
  font.

Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
2016-10-25 10:20:35 -04:00
Will Estes 31cc18ebd0 build: version 2.6.3 begins 2016-10-25 09:53:50 -04:00
64 changed files with 6739 additions and 4869 deletions
+1
View File
@@ -0,0 +1 @@
2.6.3
+4 -3
View File
@@ -29,7 +29,6 @@
# to DEFS.
ACLOCAL_AMFLAGS = -I m4
indent = @INDENT@
dist_doc_DATA = \
AUTHORS \
@@ -43,7 +42,6 @@ EXTRA_DIST = \
autogen.sh
SUBDIRS = \
lib \
src \
doc \
examples \
@@ -58,8 +56,11 @@ ChangeLog: $(srcdir)/tools/git2cl
$(srcdir)/tools/git2cl > $@ \
; fi
indent:
cd src && $(MAKE) $(AM_MAKEFLAGS) indent
install-exec-hook:
cd $(DESTDIR)$(bindir) && \
$(LN_S) -f flex$(EXEEXT) flex++$(EXEEXT)
.PHONY: ChangeLog tags indent
.PHONY: ChangeLog indent
+102 -3
View File
@@ -1,7 +1,104 @@
This is the file NEWS for the flex package. It records user -visible
changes between releases of flex.
flex NEWS
See the file COPYING for copying conditions.
* Noteworthy changes in release 2.6.4 (2017-05-06) [stable]
** build
*** The indent target now knows about flex's new (as of 2.6.0)
layout. The indent rules it would apply are not correct and do
need to be fixed.
*** The files included in the flex distribution are now built by the
version of flex that is included in the distribution.
*** The configure script has a better idea of which headers are
required to build flex. It will also error when missing functions
are detected.
*** We have lowered the versions of automake and gettext that
configure.ac lists as required for building flex. In autogen.sh,
we now check for how to call libtoolize and use what we find in
the rest of the script.
*** Since files in lib/ are picked up as needed by src/, we no longer
generate a Makefile for that directory.
*** Flex can be cross compiled.
** documentation
*** Some typos were removed from the manual.
** scanner
*** Some minor performance enhancements.
*** We honor user defined yy_* macros again. We are also more careful
to not leak macro definitions into header files.
*** A number of portability fixes were introduced so building flex is
more reliable on more platforms. Additionally, outdated function
calls were removed.
*** When building the flex executable itself, %# comments from
flex.skl are removed when generating the C source code array. This
reduces the size of flex.
** test suite
*** All scripts in the test suite are now run by $(SHELL) and the
needed portability fixes have been included.
*** Test suite dependencies are handled much better. This only matters
if you are actively developing flex or its test suite.
*** Tests that depend on platform dependent features now properly skip
when those platforms are not present.
*** When running "make check", you can now pas V=0 to silence more of
the build. This is useful when you're less connncerned about the
details of building and linking the test programs themselves.
* Noteworthy changes in release 2.6.3 (2016-12-30) [stable]
** scanner
*** several bug fixes resolved problems introduced in recent flex
versions regarding processing of comments, literals and various
quoting scenarios.
*** If the path to m4 was sufficiently long, a buffer overflow could
occur. This has been resolved. The fix also removes dependence on
the constant PATH_MAX.
** build
*** A new configure option --disable-bootstrap changes the behavior of
the build system when building flex. The default
"--enable-bootstrap" behavior is to build flex, then to use that
flex to build flex again. With --disable-bootstrap, the scanner is
simply built by sedding the scanner source. This is friendlier to
cross compilation.
*** The compatibility functions in lib/ are no longer built as a
library. Instead, they are built as $(LIBOBJ) objects. This is
simpler and friendlier to cross compilation.
*** It is now possible to build flex without building the accompanying
libfl. This is friendlier to cross compilation. See the
--disable-libfl option to configure. Resolves #99.
*** the PIC version of libfl was not correctly built. It is no longer
included in the build/installation targets of flex since it was
unused.
*** the distributed man page is only rebuilt when the relevant source
files change or when the binary doesn't exist. In particular, this
is friendlier to cross compilation. Resolves #108
** test
*** the shell scripts in the test suite are more portable across different shell implementations.
* version 2.6.2 released 2016-10-24
@@ -641,6 +738,8 @@ But the inverse is still true
See the file ONEWS for changes in earlier releases.
See the file COPYING for copying conditions.
Local Variables:
mode: text
mode: outline-minor
+50 -41
View File
@@ -3,58 +3,61 @@ This is flex, the fast lexical analyzer generator.
flex is a tool for generating scanners: programs which recognize
lexical patterns in text.
The flex codebase is kept in [git on github.](https://github.com/westes/flex)
The flex codebase is kept in
[Git on GitHub.](https://github.com/westes/flex)
Use github's [issues](https://github.com/westes/flex/issues) and [pull request](https://github.com/westes/flex) features to file bugs and submit patches.
Use GitHub's [issues](https://github.com/westes/flex/issues) and
[pull request](https://github.com/westes/flex) features to file bugs
and submit patches.
There are several mailing lists available as well:
flex-announce@lists.sourceforge.net - where posts will be made
announcing new releases of flex.
flex-help@lists.sourceforge.net - where you can post questions about
using flex
flex-devel@lists.sourceforge.net - where you can discuss development of
flex itself
* flex-announce@lists.sourceforge.net - where posts will be made
announcing new releases of flex.
* flex-help@lists.sourceforge.net - where you can post questions about
using flex
* flex-devel@lists.sourceforge.net - where you can discuss development
of flex itself
Find information on subscribing to the mailing lists at:
http://sourceforge.net/mail/?group_id=97492
The flex distribution contains the following files which may be of interest:
The flex distribution contains the following files which may be of
interest:
README - This file.
NEWS - current version number and list of user-visible changes.
INSTALL - basic installation information.
ABOUT-NLS - description of internationalization support in flex.
COPYING - flex's copyright and license.
doc/ - user documentation.
examples/ - containing examples of some possible flex scanners and a
few other things. See the file examples/README for more details.
tests/ - regression tests. See TESTS/README for details.
po/ - internationalization support files.
* README - This file.
* NEWS - current version number and list of user-visible changes.
* INSTALL - basic installation information.
* ABOUT-NLS - description of internationalization support in flex.
* COPYING - flex's copyright and license.
* doc/ - user documentation.
* examples/ - containing examples of some possible flex scanners and a
few other things. See the file examples/README for more
details.
* tests/ - regression tests. See TESTS/README for details.
* po/ - internationalization support files.
You need the following tools to build flex from the maintainer's
repository:
compiler suite - flex is built with gcc
bash, or a good Bourne-style shell
m4 - m4 -p needs to work; GNU m4 and a few others are suitable
GNU bison; to generate parse.c from parse.y
autoconf; for handling the build system
automake; for Makefile generation
gettext; for i18n support
help2man; to generate the flex man page
tar, gzip, etc.; for packaging of the source distribution
GNU texinfo; to build and test the flex manual. Note that if you want
to build the dvi/ps/pdf versions of the documentation you will need
texi2dvi and related programs, along with a sufficiently powerful
implementation of \TeX to process them. See your operating system
documentation for how to achieve this. The printable versions of the
manual are not built unless specifically requested, but the targets
are included by automake.
GNU indent; for indenting the flex source the way we want it done
* compiler suite - flex is built with gcc
* bash, or a good Bourne-style shell
* m4 - m4 -p needs to work; GNU m4 and a few others are suitable
* GNU bison; to generate parse.c from parse.y
* autoconf; for handling the build system
* automake; for Makefile generation
* gettext; for i18n support
* help2man; to generate the flex man page
* tar, gzip, lzip, etc.; for packaging of the source distribution
* GNU texinfo; to build and test the flex manual. Note that if you want
to build the dvi/ps/pdf versions of the documentation you will need
texi2dvi and related programs, along with a sufficiently powerful
implementation of TeX to process them. See your operating system
documentation for how to achieve this. The printable versions of the
manual are not built unless specifically requested, but the targets
are included by automake.
* GNU indent; for indenting the flex source the way we want it done
In cases where the versions of the above tools matter, the file
configure.ac will specify the minimum required versions.
@@ -62,14 +65,20 @@ configure.ac will specify the minimum required versions.
Once you have all the necessary tools installed, life becomes
simple. To prepare the flex tree for building, run the script:
$ ./autogen.sh
```bash
./autogen.sh
```
in the top level of the flex source tree.
This script calls the various tools needed to get flex ready for the
GNU-style configure script to be able to work.
From this point on, building flex follows the usual configure, make,
make install routine.
From this point on, building flex follows the usual routine:
```bash
configure && make && make install
```
This file is part of flex.
+20 -2
View File
@@ -24,10 +24,28 @@
# If you see no configure script, then run ./autogen.sh to create it
# and procede with the "normal" build procedures.
# use LIBTOOLIZE, if set
LIBTOOLIZE_ORIG="$LIBTOOLIZE";
if test "x$LIBTOOLIZE" = "x"; then LIBTOOLIZE=libtoolize; fi
# test libtoolize
$LIBTOOLIZE --version 2>/dev/null
if test "$?" -ne 0; then
LIBTOOLIZE=glibtoolize
$LIBTOOLIZE --version 2>/dev/null
if test "$?" -ne 0; then
echo "error: libtoolize not working, re-run with LIBTOOLIZE=/path/to/libtoolize"
echo " LIBTOOLIZE is currently \"$LIBTOOLIZE_ORIG\""
exit 1
fi
fi
#if we pretend to have a ChangeLog, then automake is less
#worried. (Don't worry, we *do* have a ChangeLog, we just need the
#Makefile first.)
touch ChangeLog
libtoolize --install --force || glibtoolize --install --force
if ! test -f ChangeLog; then
touch ChangeLog
fi
"$LIBTOOLIZE" --install --force
autoreconf --install --force
+61 -37
View File
@@ -24,11 +24,11 @@
# autoconf requirements and initialization
AC_INIT([the fast lexical analyser generator],[2.6.2],[flex-help@lists.sourceforge.net],[flex])
AC_INIT([the fast lexical analyser generator],[2.6.4],[flex-help@lists.sourceforge.net],[flex])
AC_CONFIG_SRCDIR([src/scan.l])
AC_CONFIG_AUX_DIR([build-aux])
LT_INIT
AM_INIT_AUTOMAKE([-Wno-portability foreign check-news std-options dist-lzip parallel-tests 1.14.1])
AM_INIT_AUTOMAKE([1.11.3 -Wno-portability foreign check-news std-options dist-lzip parallel-tests subdir-objects])
AC_CONFIG_HEADER([src/config.h])
AC_CONFIG_LIBOBJ_DIR([lib])
AC_CONFIG_MACRO_DIR([m4])
@@ -38,10 +38,16 @@ AC_SUBST(SHARED_VERSION_INFO)
# checks for programs
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.19])
AM_GNU_GETTEXT_VERSION([0.18])
AC_PROG_YACC
AS_IF([test "$YACC" != 'bison -y'], [
YACC="\${top_srcdir}/build-aux/missing bison -y"
AC_MSG_NOTICE(no bison program found: only required for maintainers)
])
AM_CONDITIONAL([HAVE_BISON], [test "$YACC" = 'bison -y'])
AM_PROG_LEX
AC_PROG_CC
AX_PROG_CC_FOR_BUILD
AC_PROG_CXX
AM_PROG_CC_C_O
AC_PROG_LN_S
@@ -55,24 +61,35 @@ AC_PROG_INSTALL
AC_ARG_ENABLE([warnings],
[AS_HELP_STRING([--enable-warnings],
[enable a bunch of compiler warning flags (defaults to GCC warning flags).])],
[AS_IF([test "x$GCC" == xyes],
[AS_IF([test "x$GCC" = xyes],
[ : ${WARNINGFLAGS="-Wall -Wextra -Wmissing-prototypes -Wstrict-prototypes -Wnested-externs -Wold-style-definition -Wredundant-decls -Wconversion -Wno-unused-but-set-variable"} ])])
AC_SUBST([WARNINGFLAGS])
AC_PATH_PROG([BISON], bison, no)
AS_IF([test "$BISON" != no],[],
[ AC_SUBST([BISON], [\${top_srcdir}/build-aux/missing bison])
AC_MSG_NOTICE(no bison program found: only required for maintainers)
])
AC_ARG_ENABLE([libfl],
[AS_HELP_STRING([--disable-libfl],
[do not build -lfl runtime support library])],
[], [enable_libfl=yes])
AM_CONDITIONAL([ENABLE_LIBFL], [test "x$enable_libfl" = xyes])
# --disable-bootstrap is intended only to workaround problems with bootstrap
# (e.g. when cross-compiling flex or when bootstrapping has bugs).
# Ideally we should be able to bootstrap even when cross-compiling.
AC_ARG_ENABLE([bootstrap],
[AS_HELP_STRING([--disable-bootstrap],
[don't perform a bootstrap when building flex])],
[], [enable_bootstrap=yes])
AM_CONDITIONAL([ENABLE_BOOTSTRAP], [test "x$enable_bootstrap" = xyes])
AM_CONDITIONAL([CROSS], [test "x$cross_compiling" = xyes])
AC_PATH_PROG([HELP2MAN], help2man, [\${top_srcdir}/build-aux/missing help2man])
AS_IF([test -z "$ac_cv_path_HELP2MAN" ],[],
AC_MSG_WARN(program not found: help2man: building man page will not work)
AS_IF([test "$HELP2MAN" = "\${top_srcdir}/build-aux/missing help2man"],
AC_MSG_WARN(help2man: program not found: building man page will not work)
)
AC_PATH_PROGS([TEXI2DVI], [gtexi2dvi texi2dvi], [\${top_srcdir}/build-aux/missing texi2dvi])
AS_IF([test -z "$ac_cv_path_TEXI2DVI" ], [],
AS_IF([test "$TEXI2DVI" = "\${top_srcdir}/build-aux/missing texi2dvi"],
AC_MSG_WARN(texi2dvi: program not found: building pdf version of manual will not work)
)
@@ -87,23 +104,20 @@ AC_CACHE_CHECK([for m4 that supports -P], [ac_cv_path_M4],
AC_SUBST([M4], [$ac_cv_path_M4])
AC_DEFINE_UNQUOTED([M4], ["$M4"], [Define to the m4 executable name.])
AC_PATH_PROG(INDENT, indent, indent)
# if INDENT is set to 'indent' then we didn't find indent
if test "$INDENT" != indent ; then
AC_MSG_CHECKING(if $INDENT is GNU indent)
if $INDENT --version 2>/dev/null | head -n 1|grep "GNU indent" > /dev/null ; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
AC_MSG_WARN($INDENT does not appear to be GNU indent.)
fi
else
AC_MSG_WARN(no indent program found: make indent target will not function)
fi
AC_PATH_PROG([INDENT], indent, [\${top_srcdir}/build-aux/missing indent])
AC_MSG_CHECKING(if $INDENT is GNU indent)
AS_IF([$INDENT --version 2>/dev/null | head -n 1 | grep "GNU indent" >/dev/null],
[AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)
AC_MSG_WARN($INDENT does not appear to be GNU indent; 'make indent' may not function properly)
])
# checks for headers
AC_CHECK_HEADERS([inttypes.h libintl.h limits.h locale.h malloc.h netinet/in.h regex.h unistd.h])
AC_CHECK_HEADERS([regex.h strings.h sys/stat.h sys/wait.h unistd.h], [],
[AC_MSG_ERROR(required header not found on your system)])
AC_CHECK_HEADERS([inttypes.h libintl.h limits.h locale.h malloc.h netinet/in.h])
# checks for libraries
@@ -111,12 +125,12 @@ AC_CHECK_HEADERS([inttypes.h libintl.h limits.h locale.h malloc.h netinet/in.h r
# all we need is the preprocessor symbol defined since we don't need
# LIBS to include libpthread for building flex.
LIBPTHREAD=''
AC_CHECK_LIB(pthread, pthread_mutex_lock,
AC_DEFINE([HAVE_LIBPTHREAD], 1, [pthread library] ),
AC_DEFINE([HAVE_LIBPTHREAD], 0, [pthread library] )
)
AC_CHECK_HEADERS([pthread.h])
AM_CONDITIONAL([want_pthread], [test x$ac_cv_lib_pthread_pthread_mutex_lock = xyes])
[AC_CHECK_HEADERS([pthread.h], [LIBPTHREAD=-lpthread],
[AC_MSG_WARN([pthread tests will be skipped])])],
[AC_MSG_WARN([pthread tests will be skipped])])
AC_SUBST([LIBPTHREAD])
AC_CHECK_LIB(m, log10)
@@ -130,19 +144,30 @@ AC_TYPE_SIZE_T
AC_FUNC_ALLOCA
AC_FUNC_FORK
dnl Autoconf bug: AC_FUNC_MALLOC and AC_FUNC_REALLOC might not warn of cross
dnl compilation. Workaround this.
AC_FUNC_MALLOC
AS_IF([test "$cross_compiling" = yes],
AC_MSG_WARN([result $ac_cv_func_malloc_0_nonnull guessed because of cross compilation]))
AC_FUNC_REALLOC
AS_IF([test "$cross_compiling" = yes],
AC_MSG_WARN([result $ac_cv_func_realloc_0_nonnull guessed because of cross compilation]))
AC_CHECK_FUNCS(dup2 dnl
AC_CHECK_FUNCS([dup2 dnl
memset dnl
pow dnl
regcomp dnl
setlocale dnl
strcasecmp dnl
strchr dnl
strdup dnl
strtol)
strtol dnl
], [], [AC_MSG_ERROR(required library function not found on your system)])
AC_REPLACE_FUNCS(reallocarray)
# Optional library functions
AC_CHECK_FUNCS([dnl
pow dnl Used only by "examples/manual/expr"
setlocale dnl Needed only if NLS is enabled
reallocarray dnl OpenBSD function. We have replacement if not available.
])
AC_CONFIG_FILES(
Makefile
@@ -150,7 +175,6 @@ doc/Makefile
examples/Makefile
examples/fastwc/Makefile
examples/manual/Makefile
lib/Makefile
po/Makefile.in
src/Makefile
tools/Makefile
+7 -23
View File
@@ -1,30 +1,14 @@
help2man = @HELP2MAN@
FLEX = $(top_builddir)/src/flex$(EXEEXT)
info_TEXINFOS = flex.texi
dist_man_MANS = flex.1
DISTCLEANFILES = flex.1
MAINTAINERCLEANFILES = flex.1
CLEANFILES = \
flex.aux \
flex.cp \
flex.cps \
flex.fn \
flex.fns \
flex.hk \
flex.hks \
flex.ky \
flex.log \
flex.op \
flex.ops \
flex.pg \
flex.toc \
flex.tp \
flex.tps \
flex.vr \
flex.vrs
CLEANFILES = *.aux *.cp *.cps *.fn *.fns *.hk *.hks *.ky *.log \
*.op *.ops *.pg *.toc *.tp *.tps *.vr *.vrs
flex.1: ../src/flex$(EXEEXT)
$(help2man) --name='$(PACKAGE_NAME)' --section=1 \
flex.1: $(top_srcdir)/configure.ac $(top_srcdir)/src/flex.skl $(top_srcdir)/src/options.c $(top_srcdir)/src/options.h | $(FLEX)
$(HELP2MAN) --name='$(PACKAGE_NAME)' --section=1 \
--source='The Flex Project' --manual='Programming' \
--output=$@ $< \
--output=$@ $(FLEX) \
|| rm -f $@
+1 -1
View File
@@ -2182,7 +2182,7 @@ manages its own input buffer stack manually (instead of letting flex do it).
}
<<EOF>> {
if ( --include_stack_ptr 0 )
if ( --include_stack_ptr == 0 )
{
yyterminate();
}
-4
View File
@@ -1,4 +0,0 @@
noinst_LTLIBRARIES = libcompat.la
libcompat_la_SOURCES = lib.c
libcompat_la_LIBADD = $(LTLIBOBJS)
-9
View File
@@ -1,9 +0,0 @@
/* Since building an empty library could cause problems, we provide a
* function to go into the library. We could make this non-trivial by
* moving something that flex treats as a library function into this
* directory. */
extern void do_nothing(void);
void do_nothing(void){ return;}
-49
View File
@@ -1,49 +0,0 @@
/* $OpenBSD: reallocarray.c,v 1.2 2014/12/08 03:45:00 bcook Exp $ */
/*
* Copyright (c) 2008 Otto Moerbeek <otto@drijf.net>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* OPENBSD ORIGINAL: lib/libc/stdlib/reallocarray.c */
#include <config.h>
#ifndef HAVE_REALLOCARRAY
#undef reallocarray
#include <sys/types.h>
#include <errno.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include <stdlib.h>
void *reallocarray(void *, size_t, size_t);
/*
* This is sqrt(SIZE_MAX+1), as s1*s2 <= SIZE_MAX
* if both s1 < MUL_NO_OVERFLOW and s2 < MUL_NO_OVERFLOW
*/
#define MUL_NO_OVERFLOW ((size_t)1 << (sizeof(size_t) * 4))
void *
reallocarray(void *optr, size_t nmemb, size_t size)
{
if ((nmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) &&
nmemb > 0 && SIZE_MAX / nmemb < size) {
errno = ENOMEM;
return NULL;
}
return realloc(optr, size * nmemb);
}
#endif /* HAVE_REALLOCARRAY */
+125
View File
@@ -0,0 +1,125 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_prog_cc_for_build.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_PROG_CC_FOR_BUILD
#
# DESCRIPTION
#
# This macro searches for a C compiler that generates native executables,
# that is a C compiler that surely is not a cross-compiler. This can be
# useful if you have to generate source code at compile-time like for
# example GCC does.
#
# The macro sets the CC_FOR_BUILD and CPP_FOR_BUILD macros to anything
# needed to compile or link (CC_FOR_BUILD) and preprocess (CPP_FOR_BUILD).
# The value of these variables can be overridden by the user by specifying
# a compiler with an environment variable (like you do for standard CC).
#
# It also sets BUILD_EXEEXT and BUILD_OBJEXT to the executable and object
# file extensions for the build platform, and GCC_FOR_BUILD to `yes' if
# the compiler we found is GCC. All these variables but GCC_FOR_BUILD are
# substituted in the Makefile.
#
# LICENSE
#
# Copyright (c) 2008 Paolo Bonzini <bonzini@gnu.org>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 8
AU_ALIAS([AC_PROG_CC_FOR_BUILD], [AX_PROG_CC_FOR_BUILD])
AC_DEFUN([AX_PROG_CC_FOR_BUILD], [dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_CPP])dnl
AC_REQUIRE([AC_EXEEXT])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
dnl Use the standard macros, but make them use other variable names
dnl
pushdef([ac_cv_prog_CPP], ac_cv_build_prog_CPP)dnl
pushdef([ac_cv_prog_gcc], ac_cv_build_prog_gcc)dnl
pushdef([ac_cv_prog_cc_works], ac_cv_build_prog_cc_works)dnl
pushdef([ac_cv_prog_cc_cross], ac_cv_build_prog_cc_cross)dnl
pushdef([ac_cv_prog_cc_g], ac_cv_build_prog_cc_g)dnl
pushdef([ac_cv_exeext], ac_cv_build_exeext)dnl
pushdef([ac_cv_objext], ac_cv_build_objext)dnl
pushdef([ac_exeext], ac_build_exeext)dnl
pushdef([ac_objext], ac_build_objext)dnl
pushdef([CC], CC_FOR_BUILD)dnl
pushdef([CPP], CPP_FOR_BUILD)dnl
pushdef([CFLAGS], CFLAGS_FOR_BUILD)dnl
pushdef([CPPFLAGS], CPPFLAGS_FOR_BUILD)dnl
pushdef([LDFLAGS], LDFLAGS_FOR_BUILD)dnl
pushdef([host], build)dnl
pushdef([host_alias], build_alias)dnl
pushdef([host_cpu], build_cpu)dnl
pushdef([host_vendor], build_vendor)dnl
pushdef([host_os], build_os)dnl
pushdef([ac_cv_host], ac_cv_build)dnl
pushdef([ac_cv_host_alias], ac_cv_build_alias)dnl
pushdef([ac_cv_host_cpu], ac_cv_build_cpu)dnl
pushdef([ac_cv_host_vendor], ac_cv_build_vendor)dnl
pushdef([ac_cv_host_os], ac_cv_build_os)dnl
pushdef([ac_cpp], ac_build_cpp)dnl
pushdef([ac_compile], ac_build_compile)dnl
pushdef([ac_link], ac_build_link)dnl
save_cross_compiling=$cross_compiling
save_ac_tool_prefix=$ac_tool_prefix
cross_compiling=no
ac_tool_prefix=
AC_PROG_CC
AC_PROG_CPP
AC_EXEEXT
ac_tool_prefix=$save_ac_tool_prefix
cross_compiling=$save_cross_compiling
dnl Restore the old definitions
dnl
popdef([ac_link])dnl
popdef([ac_compile])dnl
popdef([ac_cpp])dnl
popdef([ac_cv_host_os])dnl
popdef([ac_cv_host_vendor])dnl
popdef([ac_cv_host_cpu])dnl
popdef([ac_cv_host_alias])dnl
popdef([ac_cv_host])dnl
popdef([host_os])dnl
popdef([host_vendor])dnl
popdef([host_cpu])dnl
popdef([host_alias])dnl
popdef([host])dnl
popdef([LDFLAGS])dnl
popdef([CPPFLAGS])dnl
popdef([CFLAGS])dnl
popdef([CPP])dnl
popdef([CC])dnl
popdef([ac_objext])dnl
popdef([ac_exeext])dnl
popdef([ac_cv_objext])dnl
popdef([ac_cv_exeext])dnl
popdef([ac_cv_prog_cc_g])dnl
popdef([ac_cv_prog_cc_cross])dnl
popdef([ac_cv_prog_cc_works])dnl
popdef([ac_cv_prog_gcc])dnl
popdef([ac_cv_prog_CPP])dnl
dnl Finally, set Makefile variables
dnl
BUILD_EXEEXT=$ac_build_exeext
BUILD_OBJEXT=$ac_build_objext
AC_SUBST(BUILD_EXEEXT)dnl
AC_SUBST(BUILD_OBJEXT)dnl
AC_SUBST([CFLAGS_FOR_BUILD])dnl
AC_SUBST([CPPFLAGS_FOR_BUILD])dnl
AC_SUBST([LDFLAGS_FOR_BUILD])dnl
])
+38 -1
View File
@@ -8,7 +8,7 @@ subdir = po
top_builddir = ..
# These options get passed to xgettext.
XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
XGETTEXT_OPTIONS = --language=C --keyword=_ --keyword=N_
# This is the copyright holder that gets inserted into the header of the
# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
@@ -20,6 +20,13 @@ XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
# their copyright.
COPYRIGHT_HOLDER =
# This tells whether or not to prepend "GNU " prefix to the package
# name that gets inserted into the header of the $(DOMAIN).pot file.
# Possible values are "yes", "no", or empty. If it is empty, try to
# detect it automatically by scanning the files in $(top_srcdir) for
# "GNU packagename" string.
PACKAGE_GNU = "no"
# This is the email address or URL to which the translators shall report
# bugs in the untranslated strings:
# - Strings which are not entire sentences, see the maintainer guidelines
@@ -39,3 +46,33 @@ MSGID_BUGS_ADDRESS = flex-devel@lists.sourceforge.net
# This is the list of locale categories, beyond LC_MESSAGES, for which the
# message catalogs shall be used. It is usually empty.
EXTRA_LOCALE_CATEGORIES =
# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt'
# context. Possible values are "yes" and "no". Set this to yes if the
# package uses functions taking also a message context, like pgettext(), or
# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument.
USE_MSGCTXT = no
# These options get passed to msgmerge.
# Useful options are in particular:
# --previous to keep previous msgids of translated messages,
# --quiet to reduce the verbosity.
MSGMERGE_OPTIONS =
# These options get passed to msginit.
# If you want to disable line wrapping when writing PO files, add
# --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and
# MSGINIT_OPTIONS.
MSGINIT_OPTIONS =
# This tells whether or not to regenerate a PO file when $(DOMAIN).pot
# has changed. Possible values are "yes" and "no". Set this to no if
# the POT file is checked in the repository and the version control
# program ignores timestamps.
PO_DEPENDS_ON_POT = yes
# This tells whether or not to forcibly update $(DOMAIN).pot and
# regenerate PO files on "make dist". Possible values are "yes" and
# "no". Set this to no if the POT file and PO files are maintained
# externally.
DIST_DEPENDS_ON_UPDATE_PO = no
-9
View File
@@ -1,9 +0,0 @@
# Rules to fetch the translation project's po files for a domain
# Just rsync the *.po files for a particular textual domain into the
# po/ subdirectory of the project's source tree
getpo:
rsync -Ltvz translationproject.org::tp/latest/flex/*.po $(top_srcdir)/po
.PHONY: getpo
+260 -202
View File
File diff suppressed because it is too large Load Diff
+208 -180
View File
File diff suppressed because it is too large Load Diff
+230 -189
View File
File diff suppressed because it is too large Load Diff
+212 -182
View File
File diff suppressed because it is too large Load Diff
+398 -191
View File
File diff suppressed because it is too large Load Diff
+238 -194
View File
File diff suppressed because it is too large Load Diff
+249 -199
View File
File diff suppressed because it is too large Load Diff
+284 -212
View File
File diff suppressed because it is too large Load Diff
+192 -174
View File
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: flex 2.5.37\n"
"Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n"
"POT-Creation-Date: 2012-07-22 20:48-0400\n"
"POT-Creation-Date: 2017-05-06 10:49-0400\n"
"PO-Revision-Date: 2012-10-05 16:48+0200\n"
"Last-Translator: Tomislav Krznar <tomislav.krznar@gmail.com>\n"
"Language-Team: Croatian <lokalizacija@linux.hr>\n"
@@ -15,56 +15,58 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Bugs: Report translation errors to the Language-Team address.\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: Lokalize 1.4\n"
#: buf.c:78
#: src/buf.c:79
msgid "Allocation of buffer to print string failed"
msgstr ""
#: buf.c:100
#: src/buf.c:107
msgid "Allocation of buffer for line directive failed"
msgstr ""
#: buf.c:177
#: src/buf.c:177
msgid "Allocation of buffer for m4 def failed"
msgstr ""
#: buf.c:197
#: src/buf.c:198
msgid "Allocation of buffer for m4 undef failed"
msgstr ""
#: dfa.c:61
#: src/dfa.c:59
#, c-format
msgid "State #%d is non-accepting -\n"
msgstr ""
#: dfa.c:124
#: src/dfa.c:119
msgid "dangerous trailing context"
msgstr ""
#: dfa.c:166
#: src/dfa.c:159
#, c-format
msgid " associated rule line numbers:"
msgstr ""
#: dfa.c:202
#: src/dfa.c:193
#, c-format
msgid " out-transitions: "
msgstr ""
#: dfa.c:210
#: src/dfa.c:201
#, c-format
msgid ""
"\n"
" jam-transitions: EOF "
msgstr ""
#: dfa.c:341
#: src/dfa.c:331
msgid "consistency check failed in epsclosure()"
msgstr ""
#: dfa.c:429
#: src/dfa.c:419
msgid ""
"\n"
"\n"
@@ -72,24 +74,24 @@ msgid ""
"\n"
msgstr ""
#: dfa.c:604
#: src/dfa.c:587
msgid "could not create unique end-of-buffer state"
msgstr ""
#: dfa.c:625
#: src/dfa.c:608
#, c-format
msgid "state # %d:\n"
msgstr ""
#: dfa.c:785
#: src/dfa.c:768
msgid "Could not write yynxt_tbl[][]"
msgstr ""
#: dfa.c:1049
#: src/dfa.c:1028
msgid "bad transition character detected in sympartition()"
msgstr ""
#: gen.c:478
#: src/gen.c:480
msgid ""
"\n"
"\n"
@@ -97,420 +99,426 @@ msgid ""
"\n"
msgstr ""
#: gen.c:662 gen.c:691 gen.c:1215
#: src/gen.c:669 src/gen.c:698 src/gen.c:1218
#, c-format
msgid "state # %d accepts: [%d]\n"
msgstr ""
#: gen.c:1110
#: src/gen.c:1115
#, c-format
msgid "state # %d accepts: "
msgstr ""
#: gen.c:1157
#: src/gen.c:1162
msgid "Could not write yyacclist_tbl"
msgstr ""
#: gen.c:1233
#: src/gen.c:1236
msgid "Could not write yyacc_tbl"
msgstr ""
#: gen.c:1248 gen.c:1633 gen.c:1656
#: src/gen.c:1251 src/gen.c:1623 src/gen.c:1646
msgid "Could not write ecstbl"
msgstr ""
#: gen.c:1271
#: src/gen.c:1271
msgid ""
"\n"
"\n"
"Meta-Equivalence Classes:\n"
msgstr ""
#: gen.c:1293
#: src/gen.c:1293
msgid "Could not write yymeta_tbl"
msgstr ""
#: gen.c:1354
#: src/gen.c:1352
msgid "Could not write yybase_tbl"
msgstr ""
#: gen.c:1388
#: src/gen.c:1384
msgid "Could not write yydef_tbl"
msgstr ""
#: gen.c:1428
#: src/gen.c:1422
msgid "Could not write yynxt_tbl"
msgstr ""
#: gen.c:1464
#: src/gen.c:1456
msgid "Could not write yychk_tbl"
msgstr ""
#: gen.c:1618 gen.c:1647
#: src/gen.c:1608 src/gen.c:1637
msgid "Could not write ftbl"
msgstr ""
#: gen.c:1624
#: src/gen.c:1614
msgid "Could not write ssltbl"
msgstr ""
#: gen.c:1675
#: src/gen.c:1665
msgid "Could not write eoltbl"
msgstr ""
#: gen.c:1735
#: src/gen.c:1722
msgid "Could not write yynultrans_tbl"
msgstr ""
#: main.c:189
#: src/main.c:178
msgid "rule cannot be matched"
msgstr ""
#: main.c:194
#: src/main.c:183
msgid "-s option given but default rule can be matched"
msgstr ""
#: main.c:234
#: src/main.c:221
msgid "Can't use -+ with -l option"
msgstr ""
#: main.c:237
#: src/main.c:224
msgid "Can't use -f or -F with -l option"
msgstr ""
#: main.c:241
#: src/main.c:228
msgid "Can't use --reentrant or --bison-bridge with -l option"
msgstr ""
#: main.c:278
#: src/main.c:260
msgid "-Cf/-CF and -Cm don't make sense together"
msgstr ""
#: main.c:281
#: src/main.c:263
msgid "-Cf/-CF and -I are incompatible"
msgstr ""
#: main.c:285
#: src/main.c:267
msgid "-Cf/-CF are incompatible with lex-compatibility mode"
msgstr ""
#: main.c:290
#: src/main.c:272
msgid "-Cf and -CF are mutually exclusive"
msgstr ""
#: main.c:294
#: src/main.c:276
msgid "Can't use -+ with -CF option"
msgstr ""
#: main.c:297
#: src/main.c:279
#, c-format
msgid "%array incompatible with -+ option"
msgstr ""
#: main.c:302
#: src/main.c:284
msgid "Options -+ and --reentrant are mutually exclusive."
msgstr ""
#: main.c:305
#: src/main.c:287
msgid "bison bridge not supported for the C++ scanner."
msgstr ""
#: main.c:360 main.c:406
#: src/main.c:336 src/main.c:419
#, c-format
msgid "could not create %s"
msgstr ""
#: main.c:419
#: src/main.c:431
msgid "could not write tables header"
msgstr ""
#: main.c:423
#: src/main.c:435
#, c-format
msgid "can't open skeleton file %s"
msgstr ""
#: main.c:459
#: src/main.c:450
msgid "Prefix cannot include '[' or ']'"
msgstr ""
#: src/main.c:474
msgid "allocation of macro definition failed"
msgstr ""
#: main.c:507
#: src/main.c:521
#, c-format
msgid "input error reading skeleton file %s"
msgstr ""
#: main.c:511
#: src/main.c:525
#, c-format
msgid "error closing skeleton file %s"
msgstr "greška pri zatvaranju datoteke predloška %s"
#: main.c:696
#: src/main.c:709
#, c-format
msgid "error creating header file %s"
msgstr "greška pri stvaranju datoteke zaglavlja %s"
#: main.c:704
#: src/main.c:717
#, c-format
msgid "error writing output file %s"
msgstr "greška pri pisanju izlazne datoteke %s"
#: main.c:708
#: src/main.c:721
#, c-format
msgid "error closing output file %s"
msgstr "greška pri zatvaranju izlazne datoteke %s"
#: main.c:712
#: src/main.c:725
#, c-format
msgid "error deleting output file %s"
msgstr "greška pri uklanjanju izlazne datoteke %s"
#: main.c:719
#: src/main.c:732
#, c-format
msgid "No backing up.\n"
msgstr ""
#: main.c:723
#: src/main.c:736
#, c-format
msgid "%d backing up (non-accepting) states.\n"
msgstr ""
#: main.c:727
#: src/main.c:740
#, c-format
msgid "Compressed tables always back up.\n"
msgstr ""
#: main.c:730
#: src/main.c:743
#, c-format
msgid "error writing backup file %s"
msgstr ""
#: main.c:734
#: src/main.c:747
#, c-format
msgid "error closing backup file %s"
msgstr ""
#: main.c:739
#: src/main.c:752
#, c-format
msgid "%s version %s usage statistics:\n"
msgstr ""
#: main.c:742
#: src/main.c:755
#, c-format
msgid " scanner options: -"
msgstr ""
#: main.c:821
#: src/main.c:834
#, c-format
msgid " %d/%d NFA states\n"
msgstr ""
#: main.c:823
#: src/main.c:836
#, c-format
msgid " %d/%d DFA states (%d words)\n"
msgstr ""
#: main.c:825
#: src/main.c:838
#, c-format
msgid " %d rules\n"
msgstr ""
#: main.c:830
#: src/main.c:843
#, c-format
msgid " No backing up\n"
msgstr ""
#: main.c:834
#: src/main.c:847
#, c-format
msgid " %d backing-up (non-accepting) states\n"
msgstr ""
#: main.c:839
#: src/main.c:852
#, c-format
msgid " Compressed tables always back-up\n"
msgstr ""
#: main.c:843
#: src/main.c:856
#, c-format
msgid " Beginning-of-line patterns used\n"
msgstr ""
#: main.c:845
#: src/main.c:858
#, c-format
msgid " %d/%d start conditions\n"
msgstr ""
#: main.c:849
#: src/main.c:862
#, c-format
msgid " %d epsilon states, %d double epsilon states\n"
msgstr ""
#: main.c:853
#: src/main.c:866
#, c-format
msgid " no character classes\n"
msgstr ""
#: main.c:857
#: src/main.c:870
#, c-format
msgid " %d/%d character classes needed %d/%d words of storage, %d reused\n"
msgstr ""
#: main.c:862
#: src/main.c:875
#, c-format
msgid " %d state/nextstate pairs created\n"
msgstr ""
#: main.c:865
#: src/main.c:878
#, c-format
msgid " %d/%d unique/duplicate transitions\n"
msgstr ""
#: main.c:870
#: src/main.c:883
#, c-format
msgid " %d table entries\n"
msgstr ""
#: main.c:878
#: src/main.c:891
#, c-format
msgid " %d/%d base-def entries created\n"
msgstr ""
#: main.c:882
#: src/main.c:895
#, c-format
msgid " %d/%d (peak %d) nxt-chk entries created\n"
msgstr ""
#: main.c:886
#: src/main.c:899
#, c-format
msgid " %d/%d (peak %d) template nxt-chk entries created\n"
msgstr ""
#: main.c:890
#: src/main.c:903
#, c-format
msgid " %d empty table entries\n"
msgstr ""
#: main.c:892
#: src/main.c:905
#, c-format
msgid " %d protos created\n"
msgstr ""
#: main.c:895
#: src/main.c:908
#, c-format
msgid " %d templates created, %d uses\n"
msgstr ""
#: main.c:903
#: src/main.c:916
#, c-format
msgid " %d/%d equivalence classes created\n"
msgstr ""
#: main.c:911
#: src/main.c:924
#, c-format
msgid " %d/%d meta-equivalence classes created\n"
msgstr ""
#: main.c:917
#: src/main.c:930
#, c-format
msgid " %d (%d saved) hash collisions, %d DFAs equal\n"
msgstr ""
#: main.c:919
#: src/main.c:932
#, c-format
msgid " %d sets of reallocations needed\n"
msgstr ""
#: main.c:921
#: src/main.c:934
#, c-format
msgid " %d total table entries needed\n"
msgstr ""
#: main.c:998
#: src/main.c:1008
#, c-format
msgid "Internal error. flexopts are malformed.\n"
msgstr ""
#: main.c:1008
#: src/main.c:1018
#, c-format
msgid "Try `%s --help' for more information.\n"
msgstr "Pokušajte „%s --help” za više informacija.\n"
#: main.c:1065
#: src/main.c:1075
#, c-format
msgid "unknown -C option '%c'"
msgstr "nepoznata -C opcija „%c”"
#: main.c:1194
#: src/main.c:1204
#, c-format
msgid "%s %s\n"
msgstr "%s %s\n"
#: main.c:1469
#: src/main.c:1476
msgid "fatal parse error"
msgstr "fatalna greška analize"
#: main.c:1501
#: src/main.c:1508
#, c-format
msgid "could not create backing-up info file %s"
msgstr ""
#: main.c:1522
#: src/main.c:1529
#, c-format
msgid "-l AT&T lex compatibility option entails a large performance penalty\n"
msgstr ""
#: main.c:1525
#: src/main.c:1532
#, c-format
msgid " and may be the actual source of other reported performance penalties\n"
msgstr ""
#: main.c:1531
#: src/main.c:1538
#, c-format
msgid "%%option yylineno entails a performance penalty ONLY on rules that can match newline characters\n"
msgid ""
"%%option yylineno entails a performance penalty ONLY on rules that can match "
"newline characters\n"
msgstr ""
#: main.c:1538
#: src/main.c:1545
#, c-format
msgid "-I (interactive) entails a minor performance penalty\n"
msgstr ""
#: main.c:1543
#: src/main.c:1550
#, c-format
msgid "yymore() entails a minor performance penalty\n"
msgstr ""
#: main.c:1549
#: src/main.c:1556
#, c-format
msgid "REJECT entails a large performance penalty\n"
msgstr ""
#: main.c:1554
#: src/main.c:1561
#, c-format
msgid "Variable trailing context rules entail a large performance penalty\n"
msgstr ""
#: main.c:1566
#: src/main.c:1573
msgid "REJECT cannot be used with -f or -F"
msgstr ""
#: main.c:1569
#: src/main.c:1576
#, c-format
msgid "%option yylineno cannot be used with REJECT"
msgstr ""
#: main.c:1572
#: src/main.c:1579
msgid "variable trailing context rules cannot be used with -f or -F"
msgstr ""
#: main.c:1695
#: src/main.c:1704
#, c-format
msgid "%option yyclass only meaningful for C++ scanners"
msgstr ""
#: main.c:1802
#: src/main.c:1791
#, c-format
msgid "Usage: %s [OPTIONS] [FILE]...\n"
msgstr "Uporaba: %s [OPCIJE] [DATOTEKA]...\n"
#: main.c:1805
#: src/main.c:1794
#, c-format
msgid ""
"Generates programs that perform pattern-matching on text.\n"
@@ -534,13 +542,16 @@ msgid ""
" -T, --trace %s should run in trace mode\n"
" -w, --nowarn do not generate warnings\n"
" -v, --verbose write summary of scanner statistics to stdout\n"
" --hex use hexadecimal numbers instead of octal in debug "
"outputs\n"
"\n"
"Files:\n"
" -o, --outfile=FILE specify output filename\n"
" -S, --skel=FILE specify skeleton file\n"
" -t, --stdout write scanner on stdout instead of %s\n"
" --yyclass=NAME name of C++ class\n"
" --header-file=FILE create a C header file in addition to the scanner\n"
" --header-file=FILE create a C header file in addition to the "
"scanner\n"
" --tables-file[=FILE] write tables to FILE\n"
"\n"
"Scanner behavior:\n"
@@ -562,8 +573,6 @@ msgid ""
" --bison-bridge scanner for bison pure parser.\n"
" --bison-locations include yylloc support.\n"
" --stdinit initialize yyin/yyout to stdin/stdout\n"
" --noansi-definitions old-style function definitions\n"
" --noansi-prototypes empty parameter list in prototypes\n"
" --nounistd do not include <unistd.h>\n"
" --noFUNCTION do not generate a particular FUNCTION\n"
"\n"
@@ -575,51 +584,52 @@ msgid ""
" -V, --version report %s version\n"
msgstr ""
#: misc.c:65
#: src/misc.c:64
msgid "allocation of sko_stack failed"
msgstr ""
#: misc.c:102 misc.c:128
#: src/misc.c:100
#, c-format
msgid "name \"%s\" ridiculously long"
msgstr ""
#: misc.c:177
#: src/misc.c:155
msgid "memory allocation failed in allocate_array()"
msgstr ""
#: misc.c:230
#: src/misc.c:205
#, c-format
msgid "bad character '%s' detected in check_char()"
msgstr ""
#: misc.c:235
#: src/misc.c:210
#, c-format
msgid "scanner requires -8 flag to use the character %s"
msgstr ""
#: misc.c:268
msgid "dynamic memory failure in copy_string()"
msgstr ""
#: src/misc.c:229
#, fuzzy
msgid "memory allocation failure in xstrdup()"
msgstr "alokacija memorije za tablicu simbola nije uspjela"
#: misc.c:367
#: src/misc.c:303
#, c-format
msgid "%s: fatal internal error, %s\n"
msgstr ""
#: misc.c:803
#: src/misc.c:671
msgid "attempt to increase array size failed"
msgstr ""
#: misc.c:930
#: src/misc.c:795
msgid "bad line in skeleton file"
msgstr "neispravan redak u datoteci predloška"
#: misc.c:979
#: src/misc.c:845
msgid "memory allocation failed in yy_flex_xmalloc()"
msgstr ""
#: nfa.c:104
#: src/nfa.c:100
#, c-format
msgid ""
"\n"
@@ -627,226 +637,234 @@ msgid ""
"********** beginning dump of nfa with start state %d\n"
msgstr ""
#: nfa.c:115
#: src/nfa.c:111
#, c-format
msgid "state # %4d\t"
msgstr ""
#: nfa.c:130
#: src/nfa.c:126
#, c-format
msgid "********** end of dump\n"
msgstr ""
#: nfa.c:174
#: src/nfa.c:169
msgid "empty machine in dupmachine()"
msgstr ""
#: nfa.c:240
#: src/nfa.c:234
#, c-format
msgid "Variable trailing context rule at line %d\n"
msgstr ""
#: nfa.c:353
#: src/nfa.c:357
msgid "bad state type in mark_beginning_as_normal()"
msgstr ""
#: nfa.c:598
#: src/nfa.c:595
#, c-format
msgid "input rules are too complicated (>= %d NFA states)"
msgstr ""
#: nfa.c:677
#: src/nfa.c:673
msgid "found too many transitions in mkxtion()"
msgstr ""
#: nfa.c:703
#: src/nfa.c:699
#, c-format
msgid "too many rules (> %d)!"
msgstr "previše pravila (> %d)!"
#: parse.y:159
#: src/parse.y:159
msgid "unknown error processing section 1"
msgstr ""
#: parse.y:184 parse.y:351
#: src/parse.y:184 src/parse.y:353
msgid "bad start condition list"
msgstr ""
#: parse.y:315
#: src/parse.y:204
msgid "Prefix must not contain [ or ]"
msgstr ""
#: src/parse.y:317
msgid "unrecognized rule"
msgstr "neprepoznato pravilo"
#: parse.y:434 parse.y:447 parse.y:516
#: src/parse.y:436 src/parse.y:449 src/parse.y:518
msgid "trailing context used twice"
msgstr ""
#: parse.y:552 parse.y:562 parse.y:635 parse.y:645
#: src/parse.y:554 src/parse.y:564 src/parse.y:637 src/parse.y:647
msgid "bad iteration values"
msgstr "neispravne vrijednosti iteracije"
#: parse.y:580 parse.y:598 parse.y:663 parse.y:681
#: src/parse.y:582 src/parse.y:600 src/parse.y:665 src/parse.y:683
msgid "iteration value must be positive"
msgstr "vrijednost iteracije mora biti pozitivna"
#: parse.y:804 parse.y:814
#: src/parse.y:806 src/parse.y:816
#, c-format
msgid "the character range [%c-%c] is ambiguous in a case-insensitive scanner"
msgstr ""
#: parse.y:819
#: src/parse.y:821
msgid "negative range in character class"
msgstr ""
#: parse.y:916
#: src/parse.y:918
msgid "[:^lower:] is ambiguous in case insensitive scanner"
msgstr ""
#: parse.y:922
#: src/parse.y:924
msgid "[:^upper:] ambiguous in case insensitive scanner"
msgstr ""
#: scan.l:75 scan.l:618 scan.l:676
#: src/scan.l:82 src/scan.l:644 src/scan.l:702
msgid "Input line too long\n"
msgstr "Ulazni redak je predugačak\n"
#: scan.l:161
#: src/scan.l:183
#, c-format
msgid "malformed '%top' directive"
msgstr ""
#: scan.l:183
#: src/scan.l:205
#, no-c-format
msgid "unrecognized '%' directive"
msgstr ""
#: scan.l:192
#: src/scan.l:214
msgid "Definition name too long\n"
msgstr "Ime definicije je predugačko\n"
#: scan.l:284
#: src/scan.l:309
msgid "Unmatched '{'"
msgstr "Neuparena „{”"
#: scan.l:300
#: src/scan.l:325
#, c-format
msgid "Definition value for {%s} too long\n"
msgstr ""
#: scan.l:317
#: src/scan.l:342
msgid "incomplete name definition"
msgstr "nepotpuna definicija imena"
#: scan.l:443
#: src/scan.l:467
msgid "Option line too long\n"
msgstr "Redak opcija je predugačak\n"
#: scan.l:451
#: src/scan.l:475
#, c-format
msgid "unrecognized %%option: %s"
msgstr ""
#: scan.l:633 scan.l:800
#: src/scan.l:659 src/scan.l:832
msgid "bad character class"
msgstr "neispravan razred znakova"
#: scan.l:683
#: src/scan.l:709
#, c-format
msgid "undefined definition {%s}"
msgstr "nedefinirana definicija {%s}"
#: scan.l:755
#: src/scan.l:772
msgid "unbalanced parenthesis"
msgstr ""
#: src/scan.l:787
#, c-format
msgid "bad <start condition>: %s"
msgstr ""
#: scan.l:768
#: src/scan.l:800
msgid "missing quote"
msgstr "nedostaje navodnik"
#: scan.l:834
#: src/scan.l:866
#, c-format
msgid "bad character class expression: %s"
msgstr ""
#: scan.l:856
#: src/scan.l:888
msgid "bad character inside {}'s"
msgstr "neispravan znak unutar {}"
#: scan.l:862
#: src/scan.l:894
msgid "missing }"
msgstr "nedostaje }"
#: scan.l:940
#: src/scan.l:972
msgid "EOF encountered inside an action"
msgstr ""
#: scan.l:945
#: src/scan.l:977
msgid "EOF encountered inside pattern"
msgstr ""
#: scan.l:967
#: src/scan.l:1010
#, c-format
msgid "bad character: %s"
msgstr "neispravan znak: %s"
#: scan.l:996
#: src/scan.l:1038
#, c-format
msgid "can't open %s"
msgstr "ne mogu otvoriti %s"
#: scanopt.c:291
#: src/scanopt.c:259
#, c-format
msgid "Usage: %s [OPTIONS]...\n"
msgstr "Uporaba: %s [OPCIJE]...\n"
#: scanopt.c:564
#: src/scanopt.c:524
#, c-format
msgid "option `%s' doesn't allow an argument\n"
msgstr "opcija „%s” ne dozvoljava argument\n"
#: scanopt.c:569
#: src/scanopt.c:529
#, c-format
msgid "option `%s' requires an argument\n"
msgstr "opcija „%s” zahtijeva argument\n"
#: scanopt.c:573
#: src/scanopt.c:533
#, c-format
msgid "option `%s' is ambiguous\n"
msgstr "opcija „%s” je višeznačna\n"
#: scanopt.c:577
#: src/scanopt.c:537
#, c-format
msgid "Unrecognized option `%s'\n"
msgstr "Neprepoznata opcija „%s”\n"
#: scanopt.c:581
#: src/scanopt.c:541
#, c-format
msgid "Unknown error=(%d)\n"
msgstr "Nepoznata greška=(%d)\n"
#: sym.c:100
#: src/sym.c:92
msgid "symbol table memory allocation failed"
msgstr "alokacija memorije za tablicu simbola nije uspjela"
#: sym.c:202
#: src/sym.c:183
msgid "name defined twice"
msgstr "ime je dvaput definirano"
#: sym.c:253
#: src/sym.c:231
#, c-format
msgid "start condition %s declared twice"
msgstr ""
#: yylex.c:56
#: src/yylex.c:57
msgid "premature EOF"
msgstr "preuranjen EOF"
#: yylex.c:198
#: src/yylex.c:200
#, c-format
msgid "End Marker\n"
msgstr "Oznaka kraja\n"
#: yylex.c:204
#: src/yylex.c:206
#, c-format
msgid "*Something Weird* - tok: %d val: %d\n"
msgstr "*Nešto je čudno* - simbol: %d vrijednost: %d\n"
+908 -524
View File
File diff suppressed because it is too large Load Diff
+228 -188
View File
File diff suppressed because it is too large Load Diff
+224 -187
View File
File diff suppressed because it is too large Load Diff
+222 -186
View File
File diff suppressed because it is too large Load Diff
+292 -178
View File
File diff suppressed because it is too large Load Diff
+222 -184
View File
File diff suppressed because it is too large Load Diff
+226 -189
View File
File diff suppressed because it is too large Load Diff
+206 -179
View File
File diff suppressed because it is too large Load Diff
+276 -172
View File
File diff suppressed because it is too large Load Diff
+26
View File
@@ -0,0 +1,26 @@
#!/bin/sh
# shell for updating the translations before a release
# Let this be executed in the po/ subdir.
cd "$(dirname "$0")" || exit
echo "Updating translations via TP"
rsync -Lrtvz translationproject.org::tp/latest/flex/ . # || exit
# Are there now PO files that are not in svn yet?
NEWSTUFF=$(git status --porcelain *.po | grep "^??")
if [ -n "${NEWSTUFF}" ]; then
echo "New languages found; updating LINGUAS"
echo "# List of available languages." >LINGUAS
echo $(printf '%s\n' *.po | LC_ALL=C sort | sed 's/\.po//g') >>LINGUAS
fi
echo "Regenerating POT file and remerging and recompiling PO files..."
make update-po
# Ensure that the PO files are newer than the POT.
touch *.po
# Compile PO files
make
+239 -194
View File
File diff suppressed because it is too large Load Diff
+194 -174
View File
File diff suppressed because it is too large Load Diff
+194 -174
View File
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: flex 2.5.37\n"
"Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n"
"POT-Creation-Date: 2012-07-22 20:48-0400\n"
"POT-Creation-Date: 2017-05-06 10:49-0400\n"
"PO-Revision-Date: 2013-02-12 23:23+0800\n"
"Last-Translator: Wei-Lun Chao <bluebat@member.fsf.org>\n"
"Language-Team: Chinese (traditional) <zh-l10n@linux.org.tw>\n"
@@ -16,44 +16,45 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Bugs: Report translation errors to the Language-Team address.\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#: buf.c:78
#: src/buf.c:79
msgid "Allocation of buffer to print string failed"
msgstr "給予緩衝區配額以列印字串時失敗"
#: buf.c:100
#: src/buf.c:107
msgid "Allocation of buffer for line directive failed"
msgstr "給予緩衝區配額用於列指令時失敗"
#: buf.c:177
#: src/buf.c:177
msgid "Allocation of buffer for m4 def failed"
msgstr "給予緩衝區配額用於 m4 def 時失敗"
#: buf.c:197
#: src/buf.c:198
msgid "Allocation of buffer for m4 undef failed"
msgstr "給予緩衝區配額用於 m4 undef 時失敗"
#: dfa.c:61
#: src/dfa.c:59
#, c-format
msgid "State #%d is non-accepting -\n"
msgstr "#%d 正處於非存取狀態 -\n"
#: dfa.c:124
#: src/dfa.c:119
msgid "dangerous trailing context"
msgstr "不安全的末端內文"
#: dfa.c:166
#: src/dfa.c:159
#, c-format
msgid " associated rule line numbers:"
msgstr " 關聯的規則列號:"
#: dfa.c:202
#: src/dfa.c:193
#, c-format
msgid " out-transitions: "
msgstr " 外轉換:"
#: dfa.c:210
#: src/dfa.c:201
#, c-format
msgid ""
"\n"
@@ -62,11 +63,11 @@ msgstr ""
"\n"
" 合併轉換:檔案結尾 "
#: dfa.c:341
#: src/dfa.c:331
msgid "consistency check failed in epsclosure()"
msgstr "epsclosure() 中的一致性檢查失敗"
#: dfa.c:429
#: src/dfa.c:419
msgid ""
"\n"
"\n"
@@ -78,24 +79,24 @@ msgstr ""
" DFA 傾印:\n"
"\n"
#: dfa.c:604
#: src/dfa.c:587
msgid "could not create unique end-of-buffer state"
msgstr "無法建立獨一的緩衝區結尾狀態"
#: dfa.c:625
#: src/dfa.c:608
#, c-format
msgid "state # %d:\n"
msgstr "狀態 # %d:\n"
#: dfa.c:785
#: src/dfa.c:768
msgid "Could not write yynxt_tbl[][]"
msgstr "無法寫入 yynxt_tbl[][]"
#: dfa.c:1049
#: src/dfa.c:1028
msgid "bad transition character detected in sympartition()"
msgstr "在 sympartition() 偵測到不當的轉換字元"
#: gen.c:478
#: src/gen.c:480
msgid ""
"\n"
"\n"
@@ -107,29 +108,29 @@ msgstr ""
"等價類別:\n"
"\n"
#: gen.c:662 gen.c:691 gen.c:1215
#: src/gen.c:669 src/gen.c:698 src/gen.c:1218
#, c-format
msgid "state # %d accepts: [%d]\n"
msgstr "狀態 # %d 接受:[%d]\n"
#: gen.c:1110
#: src/gen.c:1115
#, c-format
msgid "state # %d accepts: "
msgstr "狀態 # %d 接受:"
#: gen.c:1157
#: src/gen.c:1162
msgid "Could not write yyacclist_tbl"
msgstr "無法寫入 yyacclist_tbl"
#: gen.c:1233
#: src/gen.c:1236
msgid "Could not write yyacc_tbl"
msgstr "無法寫入 yyacc_tbl"
#: gen.c:1248 gen.c:1633 gen.c:1656
#: src/gen.c:1251 src/gen.c:1623 src/gen.c:1646
msgid "Could not write ecstbl"
msgstr "無法寫入 ecstbl"
#: gen.c:1271
#: src/gen.c:1271
msgid ""
"\n"
"\n"
@@ -139,392 +140,398 @@ msgstr ""
"\n"
" 後設等價類別:\n"
#: gen.c:1293
#: src/gen.c:1293
msgid "Could not write yymeta_tbl"
msgstr "無法寫入 yymeta_tbl"
#: gen.c:1354
#: src/gen.c:1352
msgid "Could not write yybase_tbl"
msgstr "無法寫入 yybase_tbl"
#: gen.c:1388
#: src/gen.c:1384
msgid "Could not write yydef_tbl"
msgstr "無法寫入 yydef_tbl"
#: gen.c:1428
#: src/gen.c:1422
msgid "Could not write yynxt_tbl"
msgstr "無法寫入 yynxt_tbl"
#: gen.c:1464
#: src/gen.c:1456
msgid "Could not write yychk_tbl"
msgstr "無法寫入 yychk_tbl"
#: gen.c:1618 gen.c:1647
#: src/gen.c:1608 src/gen.c:1637
msgid "Could not write ftbl"
msgstr "無法寫入 ftbl"
#: gen.c:1624
#: src/gen.c:1614
msgid "Could not write ssltbl"
msgstr "無法寫入 ssltbl"
#: gen.c:1675
#: src/gen.c:1665
msgid "Could not write eoltbl"
msgstr "無法寫入 eoltbl"
#: gen.c:1735
#: src/gen.c:1722
msgid "Could not write yynultrans_tbl"
msgstr "無法寫入 yynultrans_tbl"
#: main.c:189
#: src/main.c:178
msgid "rule cannot be matched"
msgstr "規則無法吻合"
#: main.c:194
#: src/main.c:183
msgid "-s option given but default rule can be matched"
msgstr "-s 選項已給定但是可以吻合預設規則"
#: main.c:234
#: src/main.c:221
msgid "Can't use -+ with -l option"
msgstr "無法將 -+ 與 -l 選項共同使用"
#: main.c:237
#: src/main.c:224
msgid "Can't use -f or -F with -l option"
msgstr "無法將 -f 或 -F 與 -l 選項共同使用"
#: main.c:241
#: src/main.c:228
msgid "Can't use --reentrant or --bison-bridge with -l option"
msgstr "無法將 --reentrant 或 --bison-bridge 與 -l 選項共同使用"
#: main.c:278
#: src/main.c:260
msgid "-Cf/-CF and -Cm don't make sense together"
msgstr "-Cf/-CF 和 -Cm 共用時不具任何意義"
#: main.c:281
#: src/main.c:263
msgid "-Cf/-CF and -I are incompatible"
msgstr "-Cf/-CF 和 -I 是不相容的"
#: main.c:285
#: src/main.c:267
msgid "-Cf/-CF are incompatible with lex-compatibility mode"
msgstr "-Cf/-CF 與 lex 相容模式是不相容的"
#: main.c:290
#: src/main.c:272
msgid "-Cf and -CF are mutually exclusive"
msgstr "-Cf 和 -CF 是互斥的"
#: main.c:294
#: src/main.c:276
msgid "Can't use -+ with -CF option"
msgstr "無法將 -+ 與 -CF 選項共同使用"
#: main.c:297
#: src/main.c:279
#, c-format
msgid "%array incompatible with -+ option"
msgstr "%array 與 -+ 選項不相容"
#: main.c:302
#: src/main.c:284
msgid "Options -+ and --reentrant are mutually exclusive."
msgstr "選項 -+ 和 --reentrant 是互斥的。"
#: main.c:305
#: src/main.c:287
msgid "bison bridge not supported for the C++ scanner."
msgstr "bison 橋接器不受 C++ 掃描程式支援。"
#: main.c:360 main.c:406
#: src/main.c:336 src/main.c:419
#, c-format
msgid "could not create %s"
msgstr "無法建立 %s"
#: main.c:419
#: src/main.c:431
msgid "could not write tables header"
msgstr "無法寫入表頭"
#: main.c:423
#: src/main.c:435
#, c-format
msgid "can't open skeleton file %s"
msgstr "無法開啟架構檔案 %s"
#: main.c:459
#: src/main.c:450
msgid "Prefix cannot include '[' or ']'"
msgstr ""
#: src/main.c:474
msgid "allocation of macro definition failed"
msgstr "給予巨集定義配額時失敗"
#: main.c:507
#: src/main.c:521
#, c-format
msgid "input error reading skeleton file %s"
msgstr "讀取架構檔案 %s 時輸入錯誤"
#: main.c:511
#: src/main.c:525
#, c-format
msgid "error closing skeleton file %s"
msgstr "關閉架構檔案 %s 時發生錯誤"
#: main.c:696
#: src/main.c:709
#, c-format
msgid "error creating header file %s"
msgstr "建立標頭檔案 %s 時發生錯誤"
#: main.c:704
#: src/main.c:717
#, c-format
msgid "error writing output file %s"
msgstr "寫入輸出檔案 %s 時發生錯誤"
#: main.c:708
#: src/main.c:721
#, c-format
msgid "error closing output file %s"
msgstr "關閉輸出檔案 %s 時發生錯誤"
#: main.c:712
#: src/main.c:725
#, c-format
msgid "error deleting output file %s"
msgstr "刪除輸出檔案 %s 時發生錯誤"
#: main.c:719
#: src/main.c:732
#, c-format
msgid "No backing up.\n"
msgstr "沒有備份。\n"
#: main.c:723
#: src/main.c:736
#, c-format
msgid "%d backing up (non-accepting) states.\n"
msgstr "%d 備份 (非接受) 狀態。\n"
#: main.c:727
#: src/main.c:740
#, c-format
msgid "Compressed tables always back up.\n"
msgstr "壓縮過的表格自動備份。\n"
#: main.c:730
#: src/main.c:743
#, c-format
msgid "error writing backup file %s"
msgstr "寫入備份檔案 %s 時發生錯誤"
#: main.c:734
#: src/main.c:747
#, c-format
msgid "error closing backup file %s"
msgstr "關閉備份檔案 %s 時發生錯誤"
#: main.c:739
#: src/main.c:752
#, c-format
msgid "%s version %s usage statistics:\n"
msgstr "%s 版本 %s 用法統計:\n"
#: main.c:742
#: src/main.c:755
#, c-format
msgid " scanner options: -"
msgstr " 掃描程式選項:-"
#: main.c:821
#: src/main.c:834
#, c-format
msgid " %d/%d NFA states\n"
msgstr " %d/%d NFA 狀態\n"
#: main.c:823
#: src/main.c:836
#, c-format
msgid " %d/%d DFA states (%d words)\n"
msgstr " %d/%d DFA 狀態 (%d 個字詞)\n"
#: main.c:825
#: src/main.c:838
#, c-format
msgid " %d rules\n"
msgstr " %d 條規則\n"
#: main.c:830
#: src/main.c:843
#, c-format
msgid " No backing up\n"
msgstr " 沒有備份\n"
#: main.c:834
#: src/main.c:847
#, c-format
msgid " %d backing-up (non-accepting) states\n"
msgstr " %d 備份 (非接受) 狀態\n"
#: main.c:839
#: src/main.c:852
#, c-format
msgid " Compressed tables always back-up\n"
msgstr " 壓縮過的表格自動備份\n"
#: main.c:843
#: src/main.c:856
#, c-format
msgid " Beginning-of-line patterns used\n"
msgstr " 列首式樣已使用\n"
#: main.c:845
#: src/main.c:858
#, c-format
msgid " %d/%d start conditions\n"
msgstr " %d/%d 起始條件\n"
#: main.c:849
#: src/main.c:862
#, c-format
msgid " %d epsilon states, %d double epsilon states\n"
msgstr " %d ε狀態,%d 雙倍ε狀態\n"
#: main.c:853
#: src/main.c:866
#, c-format
msgid " no character classes\n"
msgstr " 無字元類別\n"
#: main.c:857
#: src/main.c:870
#, c-format
msgid " %d/%d character classes needed %d/%d words of storage, %d reused\n"
msgstr " %d/%d 字元類別所需 %d/%d 字詞的儲存體,%d 重新使用\n"
#: main.c:862
#: src/main.c:875
#, c-format
msgid " %d state/nextstate pairs created\n"
msgstr " %d 狀態/下一狀態對已建立\n"
#: main.c:865
#: src/main.c:878
#, c-format
msgid " %d/%d unique/duplicate transitions\n"
msgstr " %d/%d 獨一/重複轉換\n"
#: main.c:870
#: src/main.c:883
#, c-format
msgid " %d table entries\n"
msgstr " %d 表格項目\n"
#: main.c:878
#: src/main.c:891
#, c-format
msgid " %d/%d base-def entries created\n"
msgstr " %d/%d base-def 項目已建立\n"
#: main.c:882
#: src/main.c:895
#, c-format
msgid " %d/%d (peak %d) nxt-chk entries created\n"
msgstr " %d/%d (尖峰 %d) nxt-chk 項目已建立\n"
#: main.c:886
#: src/main.c:899
#, c-format
msgid " %d/%d (peak %d) template nxt-chk entries created\n"
msgstr " %d/%d (尖峰 %d) 模板 nxt-chk 項目已建立\n"
#: main.c:890
#: src/main.c:903
#, c-format
msgid " %d empty table entries\n"
msgstr " %d 清空表格項目\n"
#: main.c:892
#: src/main.c:905
#, c-format
msgid " %d protos created\n"
msgstr " %d 原型已建立\n"
#: main.c:895
#: src/main.c:908
#, c-format
msgid " %d templates created, %d uses\n"
msgstr " %d 範本已建立,%d 使用\n"
#: main.c:903
#: src/main.c:916
#, c-format
msgid " %d/%d equivalence classes created\n"
msgstr " %d/%d 等價類別已建立\n"
#: main.c:911
#: src/main.c:924
#, c-format
msgid " %d/%d meta-equivalence classes created\n"
msgstr " %d/%d 後設等價類別已建立\n"
#: main.c:917
#: src/main.c:930
#, c-format
msgid " %d (%d saved) hash collisions, %d DFAs equal\n"
msgstr " %d (%d 已儲存) 雜湊碰撞,%d DFAs 相等\n"
#: main.c:919
#: src/main.c:932
#, c-format
msgid " %d sets of reallocations needed\n"
msgstr " 需要 %d 組重新配置\n"
#: main.c:921
#: src/main.c:934
#, c-format
msgid " %d total table entries needed\n"
msgstr " 總計需要 %d 表格項目\n"
#: main.c:998
#: src/main.c:1008
#, c-format
msgid "Internal error. flexopts are malformed.\n"
msgstr "內部錯誤。flexopts 功能異常。\n"
#: main.c:1008
#: src/main.c:1018
#, c-format
msgid "Try `%s --help' for more information.\n"
msgstr "嘗試「%s --help」以獲得更多資訊。\n"
#: main.c:1065
#: src/main.c:1075
#, c-format
msgid "unknown -C option '%c'"
msgstr "不明 -C 選項「%c」"
#: main.c:1194
#: src/main.c:1204
#, c-format
msgid "%s %s\n"
msgstr "%s %s\n"
#: main.c:1469
#: src/main.c:1476
msgid "fatal parse error"
msgstr "嚴重的解析錯誤"
#: main.c:1501
#: src/main.c:1508
#, c-format
msgid "could not create backing-up info file %s"
msgstr "無法建立備份資訊檔案 %s"
#: main.c:1522
#: src/main.c:1529
#, c-format
msgid "-l AT&T lex compatibility option entails a large performance penalty\n"
msgstr "-l AT&T lex 相容性選項會導致大幅效能減退\n"
#: main.c:1525
#: src/main.c:1532
#, c-format
msgid " and may be the actual source of other reported performance penalties\n"
msgstr " 同時也許是其他回報效能減退的實際來源\n"
#: main.c:1531
#: src/main.c:1538
#, c-format
msgid "%%option yylineno entails a performance penalty ONLY on rules that can match newline characters\n"
msgid ""
"%%option yylineno entails a performance penalty ONLY on rules that can match "
"newline characters\n"
msgstr "%%option yylineno 導致效能減退,只有當該規則該吻合新列字元時才會\n"
#: main.c:1538
#: src/main.c:1545
#, c-format
msgid "-I (interactive) entails a minor performance penalty\n"
msgstr "-I (互動式) 導致小幅效能減退\n"
#: main.c:1543
#: src/main.c:1550
#, c-format
msgid "yymore() entails a minor performance penalty\n"
msgstr "yymore() 導致小幅效能減退\n"
#: main.c:1549
#: src/main.c:1556
#, c-format
msgid "REJECT entails a large performance penalty\n"
msgstr "REJECT 導致大幅效能減退\n"
#: main.c:1554
#: src/main.c:1561
#, c-format
msgid "Variable trailing context rules entail a large performance penalty\n"
msgstr "變數末尾內文規則導致大幅效能減退\n"
#: main.c:1566
#: src/main.c:1573
msgid "REJECT cannot be used with -f or -F"
msgstr "REJECT 無法與 -f 或 -F 共同使用"
#: main.c:1569
#: src/main.c:1576
#, c-format
msgid "%option yylineno cannot be used with REJECT"
msgstr "%option yylineno 無法與 REJECT 共同使用"
#: main.c:1572
#: src/main.c:1579
msgid "variable trailing context rules cannot be used with -f or -F"
msgstr "變數末尾內文規則無法與 -f 或 -F 共同使用"
#: main.c:1695
#: src/main.c:1704
#, c-format
msgid "%option yyclass only meaningful for C++ scanners"
msgstr "%option yyclass 只對於 C++ 掃描程式有意義"
#: main.c:1802
#: src/main.c:1791
#, c-format
msgid "Usage: %s [OPTIONS] [FILE]...\n"
msgstr "用法:%s [選項] [檔案]…\n"
#: main.c:1805
#, c-format
#: src/main.c:1794
#, fuzzy, c-format
msgid ""
"Generates programs that perform pattern-matching on text.\n"
"\n"
@@ -547,13 +554,16 @@ msgid ""
" -T, --trace %s should run in trace mode\n"
" -w, --nowarn do not generate warnings\n"
" -v, --verbose write summary of scanner statistics to stdout\n"
" --hex use hexadecimal numbers instead of octal in debug "
"outputs\n"
"\n"
"Files:\n"
" -o, --outfile=FILE specify output filename\n"
" -S, --skel=FILE specify skeleton file\n"
" -t, --stdout write scanner on stdout instead of %s\n"
" --yyclass=NAME name of C++ class\n"
" --header-file=FILE create a C header file in addition to the scanner\n"
" --header-file=FILE create a C header file in addition to the "
"scanner\n"
" --tables-file[=FILE] write tables to FILE\n"
"\n"
"Scanner behavior:\n"
@@ -575,8 +585,6 @@ msgid ""
" --bison-bridge scanner for bison pure parser.\n"
" --bison-locations include yylloc support.\n"
" --stdinit initialize yyin/yyout to stdin/stdout\n"
" --noansi-definitions old-style function definitions\n"
" --noansi-prototypes empty parameter list in prototypes\n"
" --nounistd do not include <unistd.h>\n"
" --noFUNCTION do not generate a particular FUNCTION\n"
"\n"
@@ -648,51 +656,52 @@ msgstr ""
" -h, --help 產生這個說明訊息\n"
" -V, --version 報告 %s 版本\n"
#: misc.c:65
#: src/misc.c:64
msgid "allocation of sko_stack failed"
msgstr "給予 sko_stack 配額時失敗"
#: misc.c:102 misc.c:128
#: src/misc.c:100
#, c-format
msgid "name \"%s\" ridiculously long"
msgstr "名稱「%s」有荒謬的長度"
#: misc.c:177
#: src/misc.c:155
msgid "memory allocation failed in allocate_array()"
msgstr "在 allocatearray() 中記憶體配置失敗"
#: misc.c:230
#: src/misc.c:205
#, c-format
msgid "bad character '%s' detected in check_char()"
msgstr "在 checkchar() 中偵測到不當的字元「%s」"
#: misc.c:235
#: src/misc.c:210
#, c-format
msgid "scanner requires -8 flag to use the character %s"
msgstr "掃描程式需要 -8 旗標以使用字元 %s"
#: misc.c:268
msgid "dynamic memory failure in copy_string()"
msgstr "在 copystring() 中動態記憶體失敗"
#: src/misc.c:229
#, fuzzy
msgid "memory allocation failure in xstrdup()"
msgstr "在 allocatearray() 中記憶體配置失敗"
#: misc.c:367
#: src/misc.c:303
#, c-format
msgid "%s: fatal internal error, %s\n"
msgstr "%s:嚴重內部錯誤,%s\n"
#: misc.c:803
#: src/misc.c:671
msgid "attempt to increase array size failed"
msgstr "試圖增加陣列大小時失敗"
#: misc.c:930
#: src/misc.c:795
msgid "bad line in skeleton file"
msgstr "架構檔案中不當的列"
#: misc.c:979
#: src/misc.c:845
msgid "memory allocation failed in yy_flex_xmalloc()"
msgstr "在 yy_flex_xmalloc() 中的記憶體配置失敗"
#: nfa.c:104
#: src/nfa.c:100
#, c-format
msgid ""
"\n"
@@ -703,226 +712,237 @@ msgstr ""
"\n"
"********** 開始輸出起始狀態為 %d 的 NFA\n"
#: nfa.c:115
#: src/nfa.c:111
#, c-format
msgid "state # %4d\t"
msgstr "狀態 # %4d\t"
#: nfa.c:130
#: src/nfa.c:126
#, c-format
msgid "********** end of dump\n"
msgstr "********** 傾印結束\n"
#: nfa.c:174
#: src/nfa.c:169
msgid "empty machine in dupmachine()"
msgstr "在 dupmachine() 中清空機器"
#: nfa.c:240
#: src/nfa.c:234
#, c-format
msgid "Variable trailing context rule at line %d\n"
msgstr "變數末尾內文規則於列 %d\n"
#: nfa.c:353
#: src/nfa.c:357
msgid "bad state type in mark_beginning_as_normal()"
msgstr "在 mark_beginning_as_normal() 中有不當的狀態輸入"
#: nfa.c:598
#: src/nfa.c:595
#, c-format
msgid "input rules are too complicated (>= %d NFA states)"
msgstr "輸入規則太複雜 (>= %d NFA 狀態)"
#: nfa.c:677
#: src/nfa.c:673
msgid "found too many transitions in mkxtion()"
msgstr "在 mkxtion() 中找到太多轉換"
#: nfa.c:703
#: src/nfa.c:699
#, c-format
msgid "too many rules (> %d)!"
msgstr "太多規則 (> %d)!"
#: parse.y:159
#: src/parse.y:159
msgid "unknown error processing section 1"
msgstr "不明的錯誤處理區段 1"
#: parse.y:184 parse.y:351
#: src/parse.y:184 src/parse.y:353
msgid "bad start condition list"
msgstr "不當的起始條件清單"
#: parse.y:315
#: src/parse.y:204
msgid "Prefix must not contain [ or ]"
msgstr ""
#: src/parse.y:317
msgid "unrecognized rule"
msgstr "無法辨識的規則"
#: parse.y:434 parse.y:447 parse.y:516
#: src/parse.y:436 src/parse.y:449 src/parse.y:518
msgid "trailing context used twice"
msgstr "末尾內文已使用兩次"
#: parse.y:552 parse.y:562 parse.y:635 parse.y:645
#: src/parse.y:554 src/parse.y:564 src/parse.y:637 src/parse.y:647
msgid "bad iteration values"
msgstr "不當的迭代值"
#: parse.y:580 parse.y:598 parse.y:663 parse.y:681
#: src/parse.y:582 src/parse.y:600 src/parse.y:665 src/parse.y:683
msgid "iteration value must be positive"
msgstr "迭代值必須是正值"
#: parse.y:804 parse.y:814
#: src/parse.y:806 src/parse.y:816
#, c-format
msgid "the character range [%c-%c] is ambiguous in a case-insensitive scanner"
msgstr "在大小寫不須相符的掃描程式中,字元範圍 [%c-%c] 是模稜兩可的"
#: parse.y:819
#: src/parse.y:821
msgid "negative range in character class"
msgstr "在字元類別中有負值範圍"
#: parse.y:916
#: src/parse.y:918
msgid "[:^lower:] is ambiguous in case insensitive scanner"
msgstr "在大小寫不須相符的掃描程式中,[:^lower:] 是模稜兩可的"
#: parse.y:922
#: src/parse.y:924
msgid "[:^upper:] ambiguous in case insensitive scanner"
msgstr "在大小寫不須相符的掃描程式中,[:^upper:] 是模稜兩可的"
#: scan.l:75 scan.l:618 scan.l:676
#: src/scan.l:82 src/scan.l:644 src/scan.l:702
msgid "Input line too long\n"
msgstr "輸入列太長\n"
#: scan.l:161
#: src/scan.l:183
#, c-format
msgid "malformed '%top' directive"
msgstr "異常的「%top」指令"
#: scan.l:183
#: src/scan.l:205
#, no-c-format
msgid "unrecognized '%' directive"
msgstr "無法辨識的「%」指令"
#: scan.l:192
#: src/scan.l:214
msgid "Definition name too long\n"
msgstr "定義名稱太長\n"
#: scan.l:284
#: src/scan.l:309
msgid "Unmatched '{'"
msgstr "不成對的「{」"
#: scan.l:300
#: src/scan.l:325
#, c-format
msgid "Definition value for {%s} too long\n"
msgstr "{%s} 的定義值太長\n"
#: scan.l:317
#: src/scan.l:342
msgid "incomplete name definition"
msgstr "不完整的名稱定義"
#: scan.l:443
#: src/scan.l:467
msgid "Option line too long\n"
msgstr "選項列太長\n"
#: scan.l:451
#: src/scan.l:475
#, c-format
msgid "unrecognized %%option: %s"
msgstr "無法辨識的 %%option:%s"
#: scan.l:633 scan.l:800
#: src/scan.l:659 src/scan.l:832
msgid "bad character class"
msgstr "不當的字元類別"
#: scan.l:683
#: src/scan.l:709
#, c-format
msgid "undefined definition {%s}"
msgstr "未定義的定義 {%s}"
#: scan.l:755
#: src/scan.l:772
msgid "unbalanced parenthesis"
msgstr ""
#: src/scan.l:787
#, c-format
msgid "bad <start condition>: %s"
msgstr "不當的 <起始條件>:%s"
#: scan.l:768
#: src/scan.l:800
msgid "missing quote"
msgstr "缺少引號"
#: scan.l:834
#: src/scan.l:866
#, c-format
msgid "bad character class expression: %s"
msgstr "不當的字元類別運算式:%s"
#: scan.l:856
#: src/scan.l:888
msgid "bad character inside {}'s"
msgstr "不當字元於 {} 內部"
#: scan.l:862
#: src/scan.l:894
msgid "missing }"
msgstr "缺少 }"
#: scan.l:940
#: src/scan.l:972
msgid "EOF encountered inside an action"
msgstr "在動作之內遇到檔案結束"
#: scan.l:945
#: src/scan.l:977
msgid "EOF encountered inside pattern"
msgstr "在式樣之內遇到檔案結束"
#: scan.l:967
#: src/scan.l:1010
#, c-format
msgid "bad character: %s"
msgstr "不當的字元:%s"
#: scan.l:996
#: src/scan.l:1038
#, c-format
msgid "can't open %s"
msgstr "無法開啟 %s"
#: scanopt.c:291
#: src/scanopt.c:259
#, c-format
msgid "Usage: %s [OPTIONS]...\n"
msgstr "用法:%s [選項]…\n"
#: scanopt.c:564
#: src/scanopt.c:524
#, c-format
msgid "option `%s' doesn't allow an argument\n"
msgstr "選項「%s」不允許任何引數\n"
#: scanopt.c:569
#: src/scanopt.c:529
#, c-format
msgid "option `%s' requires an argument\n"
msgstr "選項「%s」需要一個引數\n"
#: scanopt.c:573
#: src/scanopt.c:533
#, c-format
msgid "option `%s' is ambiguous\n"
msgstr "選項「%s」是模稜兩可的\n"
#: scanopt.c:577
#: src/scanopt.c:537
#, c-format
msgid "Unrecognized option `%s'\n"
msgstr "無法辨識的選項 %s\n"
#: scanopt.c:581
#: src/scanopt.c:541
#, c-format
msgid "Unknown error=(%d)\n"
msgstr "不明錯誤=(%d)\n"
#: sym.c:100
#: src/sym.c:92
msgid "symbol table memory allocation failed"
msgstr "符號表記憶體配置失敗"
#: sym.c:202
#: src/sym.c:183
msgid "name defined twice"
msgstr "名稱定義了兩次"
#: sym.c:253
#: src/sym.c:231
#, c-format
msgid "start condition %s declared twice"
msgstr "起始條件 %s 宣告了兩次"
#: yylex.c:56
#: src/yylex.c:57
msgid "premature EOF"
msgstr "過早出現檔案結尾"
#: yylex.c:198
#: src/yylex.c:200
#, c-format
msgid "End Marker\n"
msgstr "結束標誌\n"
#: yylex.c:204
#: src/yylex.c:206
#, c-format
msgid "*Something Weird* - tok: %d val: %d\n"
msgstr "*情況很怪異* - tok:%d val:%d\n"
#~ msgid "dynamic memory failure in copy_string()"
#~ msgstr "在 copystring() 中動態記憶體失敗"
+61 -39
View File
@@ -1,21 +1,44 @@
AM_YFLAGS = -d
localedir = $(datadir)/locale
AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" -I$(top_srcdir)/intl
AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\"
LIBS = @LIBS@
m4 = @M4@
bin_PROGRAMS = flex
if ENABLE_BOOTSTRAP
noinst_PROGRAMS = stage1flex
lib_LTLIBRARIES = \
libfl.la \
libfl_pic.la
endif
if ENABLE_LIBFL
lib_LTLIBRARIES = libfl.la
endif
libfl_la_SOURCES = \
libmain.c \
libyywrap.c
libfl_la_LDFLAGS = -version-info @SHARED_VERSION_INFO@
stage1flex_SOURCES = \
scan.l \
$(COMMON_SOURCES)
if CROSS
stage1flex_LDADD =
stage1flex_SOURCES += \
../lib/malloc.c \
../lib/realloc.c
stage1flex_LINK = $(LIBTOOL) --tag=CC --mode=link $(CC_FOR_BUILD) \
$(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@
$(stage1flex_OBJECTS): CC=$(CC_FOR_BUILD)
$(stage1flex_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD)
$(stage1flex_OBJECTS): CPP=$(CPP_FOR_BUILD)
$(stage1flex_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD)
$(stage1flex_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD)
else
stage1flex_LDADD = $(LDADD)
stage1flex_LINK = $(LINK)
stage1flex_CFLAGS = $(AM_CFLAGS)
endif
flex_SOURCES = \
$(COMMON_SOURCES)
@@ -54,19 +77,7 @@ COMMON_SOURCES = \
version.h \
yylex.c
LDADD = ../lib/libcompat.la @LIBINTL@
libfl_la_SOURCES = \
libmain.c \
libyywrap.c
libfl_la_LDFLAGS = -version-info @SHARED_VERSION_INFO@
libfl_pic_la_SOURCES = \
libmain.c \
libyywrap.c
libfl_pic_la_LDFLAGS = -version-info @SHARED_VERSION_INFO@
LDADD = $(LIBOBJS) @LIBINTL@
include_HEADERS = \
FlexLexer.h
@@ -76,29 +87,38 @@ EXTRA_DIST = \
mkskel.sh \
gettext.h
DISTCLEANFILES = stage1scan.c
CLEANFILES = stage1scan.c stage1flex$(EXEEXT)
MAINTAINERCLEANFILES = skel.c
skel.c: flex.skl mkskel.sh flexint.h tables_shared.h tables_shared.c
sed 's/4_/a4_/g; s/m4preproc_/m4_/g' $< | \
$(m4) -P -I $(srcdir) \
-DFLEX_MAJOR_VERSION=` echo $(VERSION)|cut -f 1 -d .` \
-DFLEX_MINOR_VERSION=` echo $(VERSION)|cut -f 2 -d .` \
-DFLEX_SUBMINOR_VERSION=`echo $(VERSION)|cut -f 3 -d .` | \
$(SHELL) $(srcdir)/mkskel.sh > $@.tmp
$(SHELL) $(srcdir)/mkskel.sh $(srcdir) $(m4) $(VERSION) > $@.tmp
mv $@.tmp $@
if ENABLE_BOOTSTRAP
stage1scan.c: scan.l stage1flex$(EXEEXT)
./stage1flex$(EXEEXT) -o $@ $<
./stage1flex$(EXEEXT) $(AM_LFLAGS) $(LFLAGS) -o $@ $(srcdir)/scan.l
else
stage1scan.c: scan.c
sed 's|^\(#line .*\)"'`printf %s $< | sed 's|[][\\\\.*]|\\\\&|g'`'"|\1"$@"|g' $< > $@
endif
dist-hook: scan.l flex$(EXEEXT)
chmod u+w $(distdir)/scan.c && \
./flex$(EXEEXT) -o scan.c $< && \
mv scan.c $(distdir)
# make needs to be told to make parse.h so that parallelized runs will
# not fail.
main.c : parse.h
scan.c : parse.h
stage1scan.c : parse.h
yylex.c : parse.h
stage1flex-main.$(OBJEXT): parse.h
flex-main.$(OBJEXT): parse.h
stage1flex-yylex.$(OBJEXT): parse.h
flex-yylex.$(OBJEXT): parse.h
stage1flex-scan.$(OBJEXT): parse.h
flex-stage1scan.$(OBJEXT): parse.h
# Run GNU indent on sources. Don't run this unless all the sources compile cleanly.
#
@@ -135,12 +155,14 @@ indentfiles = \
tables_shared.h \
tblcmp.c
indent:
if [ -f .indent.pro ] ; then \
for f in $(indentfiles);\
do\
echo indenting $$f ;\
f='$(srcdir)'/$$f; \
$(indent) < $$f >/dev/null && indent $$f || echo $$f FAILED to indent ;\
done \
fi
indent: $(top_srcdir)/.indent.pro
cd $(top_srcdir) && \
for f in $(indentfiles); do \
f=src/$$f; \
echo indenting $$f; \
INDENT_PROFILE=.indent.pro $(INDENT) <$$f >/dev/null && \
INDENT_PROFILE=.indent.pro $(INDENT) $$f || \
echo $$f FAILED to indent; \
done;
.PHONY: indent
+2 -2
View File
@@ -166,7 +166,7 @@ struct Buf *buf_strdefine (struct Buf *buf, const char *str, const char *def)
*/
struct Buf *buf_m4_define (struct Buf *buf, const char* def, const char* val)
{
const char * fmt = "m4_define( [[%s]], [[%s]])m4_dnl\n";
const char * fmt = "m4_define( [[%s]], [[[[%s]]]])m4_dnl\n";
char * str;
size_t strsz;
@@ -259,7 +259,7 @@ struct Buf *buf_append (struct Buf *buf, const void *ptr, int n_elem)
buf->nmax = n_alloc;
}
memcpy (buf->elts + (size_t) buf->nelts * buf->elt_size, ptr,
memcpy ((char *) buf->elts + (size_t) buf->nelts * buf->elt_size, ptr,
(size_t) n_elem * buf->elt_size);
buf->nelts += n_elem;
+3 -8
View File
@@ -463,14 +463,9 @@ void ntod (void)
/* We still may want to use the table if numecs
* is a power of 2.
*/
int power_of_two;
for (power_of_two = 1; power_of_two <= csize;
power_of_two *= 2)
if (numecs == power_of_two) {
use_NUL_table = true;
break;
}
if (numecs <= csize && is_power_of_2(numecs)) {
use_NUL_table = true;
}
}
if (use_NUL_table)
+5 -4
View File
@@ -176,7 +176,7 @@ clearerr(stdin);
if ((r = chain->filter_func (chain)) == -1)
flexfatal (_("filter_func failed"));
exit (0);
FLEX_EXIT (0);
}
else {
execvp (chain->argv[0],
@@ -185,7 +185,7 @@ clearerr(stdin);
chain->argv[0]);
}
exit (1);
FLEX_EXIT (1);
}
/* Parent */
@@ -296,7 +296,8 @@ int filter_tee_header (struct filter *chain)
fprintf (to_h, "\n");
/* write a fake line number. It will get fixed by the linedir filter. */
fprintf (to_h, "#line 4000 \"M4_YY_OUTFILE_NAME\"\n");
if (gen_line_dirs)
fprintf (to_h, "#line 4000 \"M4_YY_OUTFILE_NAME\"\n");
fprintf (to_h, "#undef %sIN_HEADER\n", prefix);
fprintf (to_h, "#endif /* %sHEADER_H */\n", prefix);
@@ -323,7 +324,7 @@ int filter_tee_header (struct filter *chain)
while (wait (0) > 0) ;
exit (0);
FLEX_EXIT (0);
return 0;
}
+62 -35
View File
@@ -6,17 +6,18 @@
%# pre-compilation stage of flex. Only macros starting
%# with `m4preproc_' are processed, and quoting is normal.
%#
%# 2. The preprocessed skeleton is translated verbatim into a
%# C array, saved as "skel.c" and compiled into the flex binary.
%# 2. The preprocessed skeleton is translated into a C array, saved
%# as "skel.c" and compiled into the flex binary. The %# comment
%# lines are removed.
%#
%# 3. At runtime, the skeleton is generated and filtered (again)
%# through m4. Macros beginning with `m4_' will be processed.
%# The quoting is "[[" and "]]" so we don't interfere with
%# user code.
%#
%#
%# All generate macros for the m4 stage contain the text "m4" or "M4"
%# in them. This is to distinguish them from CPP macros.
%# The exception to this rule is YY_G, which is an m4 macro,
%# The exception to this rule is YY_G, which is an m4 macro,
%# but it needs to be remain short because it is used everywhere.
%#
/* A lexical scanner generated by flex */
@@ -29,7 +30,7 @@ m4_changecom
m4_changequote
m4_changequote([[, ]])
%#
%#
%# Lines in this skeleton starting with a "%" character are "control lines"
%# and affect the generation of the scanner. The possible control codes are
%# listed and processed in misc.c.
@@ -61,11 +62,17 @@ m4_changequote([[, ]])
m4_ifelse(M4_YY_PREFIX,yy,,
#define yy_create_buffer M4_YY_PREFIX[[_create_buffer]]
#define yy_delete_buffer M4_YY_PREFIX[[_delete_buffer]]
#define yy_flex_debug M4_YY_PREFIX[[_flex_debug]]
#define yy_scan_buffer M4_YY_PREFIX[[_scan_buffer]]
#define yy_scan_string M4_YY_PREFIX[[_scan_string]]
#define yy_scan_bytes M4_YY_PREFIX[[_scan_bytes]]
#define yy_init_buffer M4_YY_PREFIX[[_init_buffer]]
#define yy_flush_buffer M4_YY_PREFIX[[_flush_buffer]]
#define yy_load_buffer_state M4_YY_PREFIX[[_load_buffer_state]]
#define yy_switch_to_buffer M4_YY_PREFIX[[_switch_to_buffer]]
#define yypush_buffer_state M4_YY_PREFIX[[push_buffer_state]]
#define yypop_buffer_state M4_YY_PREFIX[[pop_buffer_state]]
#define yyensure_buffer_stack M4_YY_PREFIX[[ensure_buffer_stack]]
#define yy_flex_debug M4_YY_PREFIX[[_flex_debug]]
#define yyin M4_YY_PREFIX[[in]]
#define yyleng M4_YY_PREFIX[[leng]]
#define yylex M4_YY_PREFIX[[lex]]
@@ -105,8 +112,16 @@ m4_ifdef( [[M4_YY_REENTRANT]], [[m4_define([[M4_YY_HAS_START_STACK_VARS]])]])
m4_ifdef( [[M4_YY_PREFIX]],, [[m4_define([[M4_YY_PREFIX]], [[yy]])]])
m4preproc_define(`M4_GEN_PREFIX',
``m4_define(yy[[$1]], [[M4_YY_PREFIX[[$1]]m4_ifelse($'`#,0,,[[($'`@)]])]])'')
m4preproc_define(`M4_GEN_PREFIX',``
[[#ifdef yy$1
#define ]]M4_YY_PREFIX[[$1_ALREADY_DEFINED
#else
#define yy$1 ]]M4_YY_PREFIX[[$1
#endif]]
'm4preproc_divert(1)`
[[#ifndef ]]M4_YY_PREFIX[[$1_ALREADY_DEFINED
#undef yy$1
#endif]]'m4preproc_divert(0)')
%if-c++-only
/* The c++ scanner is a mess. The FlexLexer.h header file relies on the
@@ -119,6 +134,7 @@ m4preproc_define(`M4_GEN_PREFIX',
%endif
%if-c-only
m4_ifelse(M4_YY_PREFIX,yy,,
M4_GEN_PREFIX(`_create_buffer')
M4_GEN_PREFIX(`_delete_buffer')
M4_GEN_PREFIX(`_scan_buffer')
@@ -154,6 +170,7 @@ m4preproc_define(`M4_GEN_PREFIX',
M4_GEN_PREFIX(`set_column')
]])
M4_GEN_PREFIX(`wrap')
)
%endif
m4_ifdef( [[M4_YY_BISON_LVAL]],
@@ -169,11 +186,14 @@ m4_ifdef( [[<M4_YY_BISON_LLOC>]],
]])
m4_ifelse(M4_YY_PREFIX,yy,,
M4_GEN_PREFIX(`alloc')
M4_GEN_PREFIX(`realloc')
M4_GEN_PREFIX(`free')
)
%if-c-only
m4_ifelse(M4_YY_PREFIX,yy,,
m4_ifdef( [[M4_YY_NOT_REENTRANT]],
[[
M4_GEN_PREFIX(`text')
@@ -183,6 +203,7 @@ m4_ifdef( [[M4_YY_NOT_REENTRANT]],
M4_GEN_PREFIX(`_flex_debug')
M4_GEN_PREFIX(`lineno')
]])
)
%endif
@@ -213,9 +234,9 @@ m4_ifdef( [[M4_YY_TABLES_EXTERNAL]],
m4preproc_include(`flexint.h')
%endif
%if-c++-only
/* begin standard C++ headers. */
#include <iostream>
%if-c++-only
#include <iostream>
#include <errno.h>
#include <cstdlib>
#include <cstdio>
@@ -288,7 +309,7 @@ m4_define( [[M4_YY_DOC_PARAM]], [[@param yyscanner The scanner object.]])
#define yy_flex_debug YY_G(yy_flex_debug_r)
m4_define( [[M4_YY_INCR_LINENO]],
[[
[[
do{ yylineno++;
yycolumn=0;
}while(0)
@@ -301,7 +322,7 @@ m4_define( [[M4_YY_INCR_LINENO]],
%if-not-reentrant
m4_define( [[M4_YY_INCR_LINENO]],
[[
[[
yylineno++;
]])
@@ -397,7 +418,7 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
[[
/* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
* access to the local variable yy_act. Since yyless() is a macro, it would break
* existing scanners that call yyless() from OUTSIDE yylex.
* existing scanners that call yyless() from OUTSIDE yylex.
* One obvious solution it to make yy_act a global. I tried that, and saw
* a 5% performance hit in a non-yylineno scanner, because yy_act is
* normally declared as a register variable-- so it is not worth it.
@@ -446,7 +467,7 @@ struct yy_buffer_state
%endif
%if-c++-only
std::streambuf* yy_input_file;
std::streambuf* yy_input_file;
%endif
@@ -484,7 +505,7 @@ struct yy_buffer_state
int yy_bs_lineno; /**< The line count. */
int yy_bs_column; /**< The column count. */
/* Whether to try to fill the input buffer when we reach the
* end of it.
@@ -1054,7 +1075,7 @@ int yytables_destroy (M4_YY_PROTO_ONLY_ARG);
/** Describes a mapping from a serialized table id to its deserialized state in
* this scanner. This is the bridge between our "generic" deserialization code
* and the specifics of this scanner.
* and the specifics of this scanner.
*/
struct yytbl_dmap {
enum yytbl_id dm_id;/**< table identifier */
@@ -1663,6 +1684,8 @@ m4_ifdef( [[M4_YY_USES_REJECT]],
(void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size M4_YY_CALL_LAST_ARG );
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
/* "- 2" to take care of EOB's */
YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
}
YY_G(yy_n_chars) += number_to_move;
@@ -1895,6 +1918,9 @@ m4_ifdef( [[M4_YY_USE_LINENO]],
*/
void yyFlexLexer::yyrestart( std::istream* input_file )
{
if( ! input_file ) {
input_file = &yyin;
}
yyrestart( *input_file );
}
%endif
@@ -2056,7 +2082,7 @@ static void yy_load_buffer_state (M4_YY_DEF_ONLY_ARG)
b->yy_input_file = file;
%endif
%if-c++-only
b->yy_input_file = (&file == 0) ? NULL : file.rdbuf();
b->yy_input_file = file.rdbuf();
%endif
b->yy_fill_buffer = 1;
@@ -2219,10 +2245,10 @@ void yyFlexLexer::yyensure_buffer_stack(void)
M4_YY_CALL_LAST_ARG);
if ( ! YY_G(yy_buffer_stack) )
YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
memset(YY_G(yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
YY_G(yy_buffer_stack_max) = num_to_alloc;
YY_G(yy_buffer_stack_top) = 0;
return;
@@ -2258,7 +2284,7 @@ m4_ifdef( [[M4_YY_NO_SCAN_BUFFER]],,
* @param base the character buffer
* @param size the size in bytes of the character buffer
* M4_YY_DOC_PARAM
* @return the newly allocated buffer state object.
* @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE yy_scan_buffer YYFARGS2( char *,base, yy_size_t ,size)
{
@@ -2434,7 +2460,7 @@ static void yynoreturn yy_fatal_error YYFARGS1(const char*, msg)
{
M4_YY_DECL_GUTS_VAR();
M4_YY_NOOP_GUTS_VAR();
(void) fprintf( stderr, "%s\n", msg );
fprintf( stderr, "%s\n", msg );
exit( YY_EXIT_FAILURE );
}
%endif
@@ -2491,7 +2517,7 @@ m4_ifdef( [[M4_YY_NO_GET_LINENO]],,
int yyget_lineno (M4_YY_DEF_ONLY_ARG)
{
M4_YY_DECL_GUTS_VAR();
m4_ifdef( [[M4_YY_REENTRANT]],
[[
if (! YY_CURRENT_BUFFER)
@@ -2511,7 +2537,7 @@ m4_ifdef( [[M4_YY_NO_GET_COLUMN]],,
int yyget_column (M4_YY_DEF_ONLY_ARG)
{
M4_YY_DECL_GUTS_VAR();
m4_ifdef( [[M4_YY_REENTRANT]],
[[
if (! YY_CURRENT_BUFFER)
@@ -2763,20 +2789,20 @@ int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals )
errno = EINVAL;
return 1;
}
*ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
if (*ptr_yy_globals == NULL){
errno = ENOMEM;
return 1;
}
/* By setting to 0xAA, we expose bugs in
yy_init_globals. Leave at 0x00 for releases. */
memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
yyset_extra (yy_user_defined, *ptr_yy_globals);
return yy_init_globals ( *ptr_yy_globals );
}
@@ -3064,7 +3090,7 @@ static struct yytbl_dmap *yytbl_dmap_lookup YYFARGS2(struct yytbl_dmap *, dmap,
return NULL;
}
/** Read a table while mapping its contents to the local array.
/** Read a table while mapping its contents to the local array.
* @param dmap used to performing mapping
* @return 0 on success
*/
@@ -3109,7 +3135,7 @@ static int yytbl_data_load YYFARGS2(struct yytbl_dmap *, dmap, struct yytbl_read
if(M4_YY_TABLES_VERIFY)
/* We point to the array itself */
p = dmap->dm_arr;
p = dmap->dm_arr;
else
/* We point to the address of a pointer. */
*dmap->dm_arr = p = (void *) yyalloc (bytes M4_YY_CALL_LAST_ARG);
@@ -3156,7 +3182,7 @@ static int yytbl_data_load YYFARGS2(struct yytbl_dmap *, dmap, struct yytbl_read
rv = yytbl_read8 (&t8, rd);
t32 = t8;
break;
default:
default:
YY_FATAL_ERROR( "invalid td_flags" ); /* TODO: not fatal. */
return -1;
}
@@ -3213,7 +3239,7 @@ static int yytbl_data_load YYFARGS2(struct yytbl_dmap *, dmap, struct yytbl_read
YY_FATAL_ERROR( "transition table not found" ); /* TODO: not fatal. */
return -1;
}
if( M4_YY_TABLES_VERIFY)
v = &(((struct yy_trans_info *) (transdmap->dm_arr))[t32]);
else
@@ -3224,7 +3250,7 @@ static int yytbl_data_load YYFARGS2(struct yytbl_dmap *, dmap, struct yytbl_read
YY_FATAL_ERROR( "tables verification failed at YYTD_PTRANS" );
}else
((struct yy_trans_info **) p)[0] = v;
/* increment p */
p = (struct yy_trans_info **) p + 1;
}
@@ -3340,7 +3366,7 @@ int yytables_fload YYFARGS1(FILE *, fp)
/** Destroy the loaded tables, freeing memory, etc.. */
int yytables_destroy (M4_YY_DEF_ONLY_ARG)
{
{
struct yytbl_dmap *dmap=0;
if(!M4_YY_TABLES_VERIFY){
@@ -3397,4 +3423,5 @@ m4_ifdef( [[M4_YY_IN_HEADER]],
#undef YY_DECL_IS_OURS
#undef YY_DECL
#endif
m4preproc_undivert(1)
]])
+11 -13
View File
@@ -57,23 +57,24 @@
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
#ifdef HAVE_UNISTD_H
/* Required: dup() and dup2() in <unistd.h> */
#include <unistd.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_SYS_PARAMS_H
#include <sys/params.h>
#endif
#ifdef HAVE_SYS_STAT_H
/* Required: stat() in <sys/stat.h> */
#include <sys/stat.h>
#endif
/* Required: wait() in <sys/wait.h> */
#include <sys/wait.h>
#include <stdbool.h>
#ifdef HAVE_REGEX_H
#include <stdarg.h>
/* Required: regcomp(), regexec() and regerror() in <regex.h> */
#include <regex.h>
#endif
/* Required: strcasecmp() in <strings.h> */
#include <strings.h>
#include "flexint.h"
/* We use gettext. So, when we write strings which should be translated, we mark them with _() */
@@ -108,6 +109,8 @@
#define ABS(x) ((x) < 0 ? -(x) : (x))
#endif
/* Whether an integer is a power of two */
#define is_power_of_2(n) ((n) > 0 && ((n) & ((n) - 1)) == 0)
#define unspecified -1
@@ -842,9 +845,6 @@ extern void flexfatal(const char *);
}while(0)
#endif /* ! HAVE_DECL___func__ */
/* Convert a hexadecimal digit string to an integer value. */
extern unsigned int htoui(unsigned char[]);
/* Report an error message formatted */
extern void lerr(const char *, ...)
#if defined(__GNUC__) && __GNUC__ >= 3
@@ -881,9 +881,6 @@ extern int myctoi(const char *);
/* Return character corresponding to escape sequence. */
extern unsigned char myesc(unsigned char[]);
/* Convert an octal digit string to an integer value. */
extern unsigned int otoui(unsigned char[]);
/* Output a (possibly-formatted) string to the generated scanner. */
extern void out(const char *);
extern void out_dec(const char *, int);
@@ -974,8 +971,9 @@ extern void line_pinpoint(const char *, int);
extern void format_synerr(const char *, const char *);
extern void synerr(const char *); /* report a syntax error */
extern void format_warn(const char *, const char *);
extern void warn(const char *); /* report a warning */
extern void lwarn(const char *); /* report a warning */
extern void yyerror(const char *); /* report a parse error */
extern int yyparse(void); /* the YACC parser */
/* from file scan.l */
+4
View File
@@ -58,6 +58,10 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif
#ifndef SIZE_MAX
#define SIZE_MAX (~(size_t)0)
#endif
#endif /* ! C99 */
#endif /* ! FLEXINT_H */
+4
View File
@@ -509,8 +509,12 @@ void gen_find_action (void)
indent_puts ("yy_current_state = *--YY_G(yy_state_ptr);");
indent_puts ("YY_G(yy_lp) = yy_accept[yy_current_state];");
if (!variable_trailing_context_rules)
outn ("m4_ifdef( [[M4_YY_USES_REJECT]],\n[[");
if(reject_really_used)
outn ("find_rule: /* we branch to this label when backing up */");
if (!variable_trailing_context_rules)
outn ("]])\n");
indent_puts
("for ( ; ; ) /* until we find what rule we matched */");
+19 -18
View File
@@ -276,7 +276,7 @@ void check_options (void)
flexerror (_("Can't use -+ with -CF option"));
if (C_plus_plus && yytext_is_array) {
warn (_("%array incompatible with -+ option"));
lwarn (_("%array incompatible with -+ option"));
yytext_is_array = false;
}
@@ -310,8 +310,8 @@ void check_options (void)
}
}
if (extra_type)
buf_m4_define( &m4defs_buf, "M4_EXTRA_TYPE_DEFS", extra_type);
if (extra_type)
buf_m4_define( &m4defs_buf, "M4_EXTRA_TYPE_DEFS", extra_type);
if (!use_stdout) {
FILE *prev_stdout;
@@ -351,8 +351,8 @@ void check_options (void)
if (!path) {
m4 = M4;
} else {
int m4_length = strlen(m4);
do {
char m4_path[PATH_MAX];
size_t length = strlen(path);
struct stat sbuf;
@@ -360,19 +360,18 @@ void check_options (void)
if (!endOfDir)
endOfDir = path+length;
if (endOfDir + 2 >= path + sizeof(m4_path)) {
path = endOfDir+1;
continue;
}
{
char *m4_path = calloc(endOfDir-path + 1 + m4_length + 1, 1);
strncpy(m4_path, path, sizeof(m4_path));
m4_path[endOfDir-path] = '/';
m4_path[endOfDir-path+1] = '\0';
strncat(m4_path, m4, sizeof(m4_path) - strlen(m4_path) - 1);
if (stat(m4_path, &sbuf) == 0 &&
(S_ISREG(sbuf.st_mode)) && sbuf.st_mode & S_IXUSR) {
m4 = strdup(m4_path);
break;
memcpy(m4_path, path, endOfDir-path);
m4_path[endOfDir-path] = '/';
memcpy(m4_path + (endOfDir-path) + 1, m4, m4_length + 1);
if (stat(m4_path, &sbuf) == 0 &&
(S_ISREG(sbuf.st_mode)) && sbuf.st_mode & S_IXUSR) {
m4 = m4_path;
break;
}
free(m4_path);
}
path = endOfDir+1;
} while (path[0]);
@@ -447,6 +446,8 @@ void check_options (void)
if ( bison_bridge_lloc)
buf_m4_define (&m4defs_buf, "<M4_YY_BISON_LLOC>", NULL);
if (strchr(prefix, '[') || strchr(prefix, ']'))
flexerror(_("Prefix cannot include '[' or ']'"));
buf_m4_define(&m4defs_buf, "M4_YY_PREFIX", prefix);
if (did_outfilename)
@@ -1586,9 +1587,9 @@ void readin (void)
if (!do_yywrap) {
if (!C_plus_plus) {
if (reentrant)
outn ("\n#define yywrap(yyscanner) (/*CONSTCOND*/1)");
out_str ("\n#define %swrap(yyscanner) (/*CONSTCOND*/1)\n", prefix);
else
outn ("\n#define yywrap() (/*CONSTCOND*/1)");
out_str ("\n#define %swrap() (/*CONSTCOND*/1)\n", prefix);
}
outn ("#define YY_SKIP_YYWRAP");
}
+24 -45
View File
@@ -30,7 +30,6 @@
/* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED */
/* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */
/* PURPOSE. */
#include "flexdef.h"
#include "tables.h"
@@ -143,9 +142,14 @@ void add_action (const char *new_text)
void *allocate_array (int size, size_t element_size)
{
void *mem;
size_t num_bytes = element_size * (size_t) size;
mem = malloc(num_bytes);
#if HAVE_REALLOCARRAY
/* reallocarray has built-in overflow detection */
mem = reallocarray(NULL, (size_t) size, element_size);
#else
size_t num_bytes = (size_t) size * element_size;
mem = (size && SIZE_MAX / (size_t) size < element_size) ? NULL :
malloc(num_bytes);
#endif
if (!mem)
flexfatal (_
("memory allocation failed in allocate_array()"));
@@ -302,18 +306,6 @@ void flexfatal (const char *msg)
}
/* htoui - convert a hexadecimal digit string to an unsigned integer value */
unsigned int htoui (unsigned char str[])
{
unsigned int result;
(void) sscanf ((char *) str, "%x", &result);
return result;
}
/* lerr - report an error message */
void lerr (const char *msg, ...)
@@ -348,7 +340,7 @@ void line_directive_out (FILE *output_file, int do_infile)
{
char directive[MAXLINE], filename[MAXLINE];
char *s1, *s2, *s3;
static const char *line_fmt = "#line %d \"%s\"\n";
static const char line_fmt[] = "#line %d \"%s\"\n";
if (!gen_line_dirs)
return;
@@ -513,18 +505,14 @@ unsigned char myesc (unsigned char array[])
int sptr = 1;
while (sptr <= 3 &&
isascii (array[sptr]) &&
isdigit (array[sptr]))
/* Don't increment inside loop control
* because if isdigit() is a macro it might
* expand into multiple increments ...
*/
array[sptr] >= '0' && array[sptr] <= '7') {
++sptr;
}
c = array[sptr];
array[sptr] = '\0';
esc_char = (unsigned char) otoui (array + 1);
esc_char = (unsigned char) strtoul (array + 1, NULL, 8);
array[sptr] = c;
@@ -535,18 +523,18 @@ unsigned char myesc (unsigned char array[])
{ /* \x<hex> */
int sptr = 2;
while (isascii (array[sptr]) &&
isxdigit (array[sptr]))
while (sptr <= 3 && isxdigit (array[sptr])) {
/* Don't increment inside loop control
* because if isdigit() is a macro it might
* because if isxdigit() is a macro it might
* expand into multiple increments ...
*/
++sptr;
}
c = array[sptr];
array[sptr] = '\0';
esc_char = (unsigned char) htoui (array + 2);
esc_char = (unsigned char) strtoul (array + 2, NULL, 16);
array[sptr] = c;
@@ -559,17 +547,6 @@ unsigned char myesc (unsigned char array[])
}
/* otoui - convert an octal digit string to an unsigned integer value */
unsigned int otoui (unsigned char str[])
{
unsigned int result;
(void) sscanf ((char *) str, "%o", &result);
return result;
}
/* out - various flavors of outputing a (possibly formatted) string for the
* generated scanner, keeping track of the line count.
*/
@@ -682,9 +659,14 @@ char *readable_form (int c)
void *reallocate_array (void *array, int size, size_t element_size)
{
void *new_array;
size_t num_bytes = element_size * (size_t) size;
new_array = realloc(array, num_bytes);
#if HAVE_REALLOCARRAY
/* reallocarray has built-in overflow detection */
new_array = reallocarray(array, (size_t) size, element_size);
#else
size_t num_bytes = (size_t) size * element_size;
new_array = (size && SIZE_MAX / (size_t) size < element_size) ? NULL :
realloc(array, num_bytes);
#endif
if (!new_array)
flexfatal (_("attempt to increase array size failed"));
@@ -809,9 +791,6 @@ void skelout (void)
/* %e end linkage-only code. */
OUT_END_CODE ();
}
else if (buf[1] == '#') {
/* %# a comment in the skel. ignore. */
}
else {
flexfatal (_("bad line in skeleton file"));
}
+20 -2
View File
@@ -21,13 +21,31 @@
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE.
if test ! $# = 3; then
echo 'Usage: mkskel.sh srcdir m4 version' >&2
exit 1
fi
echo '/* File created from flex.skl via mkskel.sh */
#include "flexdef.h"
const char *skel[] = {'
sed 's/m4_/m4preproc_/g
srcdir=$1
m4=$2
VERSION=$3
case $VERSION in
*[!0-9.]*) echo 'Invalid version number' >&2; exit 1;;
esac
IFS=.
set $VERSION
sed 's/4_/a4_/g
s/m4preproc_/m4_/g
' "$srcdir/flex.skl" |
"$m4" -P -I "$srcdir" "-DFLEX_MAJOR_VERSION=$1" \
"-DFLEX_MINOR_VERSION=$2" \
"-DFLEX_SUBMINOR_VERSION=$3" |
sed '/^%#/d
s/m4_/m4preproc_/g
s/a4_/4_/g
s/[\\"]/\\&/g
s/.*/ "&",/'
+12 -10
View File
@@ -80,7 +80,7 @@ int previous_continued_action; /* whether the previous rule's action was '|' */
do{ \
char fw3_msg[MAXLINE];\
snprintf( fw3_msg, MAXLINE,(fmt), (a1), (a2) );\
warn( fw3_msg );\
lwarn( fw3_msg );\
}while(0)
/* Expand a POSIX character class expression. */
@@ -199,7 +199,9 @@ option : TOK_OUTFILE '=' NAME
| TOK_EXTRA_TYPE '=' NAME
{ extra_type = xstrdup(nmstr); }
| TOK_PREFIX '=' NAME
{ prefix = xstrdup(nmstr); }
{ prefix = xstrdup(nmstr);
if (strchr(prefix, '[') || strchr(prefix, ']'))
flexerror(_("Prefix must not contain [ or ]")); }
| TOK_YYCLASS '=' NAME
{ yyclass = xstrdup(nmstr); }
| TOK_HEADER_FILE '=' NAME
@@ -303,7 +305,7 @@ flexrule : '^' rule
scon_stk[++scon_stk_ptr] = i;
if ( scon_stk_ptr == 0 )
warn(
lwarn(
"all start conditions already have <<EOF>> rules" );
else
@@ -398,7 +400,7 @@ rule : re2 re
* erroneously.
*/
if ( ! varlength || headcnt != 0 )
warn(
lwarn(
"trailing context made variable due to preceding '|' action" );
/* Mark as variable. */
@@ -453,7 +455,7 @@ rule : re2 re
/* See the comment in the rule for "re2 re"
* above.
*/
warn(
lwarn(
"trailing context made variable due to preceding '|' action" );
varlength = true;
@@ -913,13 +915,13 @@ ccl_expr:
| CCE_NEG_XDIGIT { CCL_NEG_EXPR(isxdigit); }
| CCE_NEG_LOWER {
if ( sf_case_ins() )
warn(_("[:^lower:] is ambiguous in case insensitive scanner"));
lwarn(_("[:^lower:] is ambiguous in case insensitive scanner"));
else
CCL_NEG_EXPR(islower);
}
| CCE_NEG_UPPER {
if ( sf_case_ins() )
warn(_("[:^upper:] ambiguous in case insensitive scanner"));
lwarn(_("[:^upper:] ambiguous in case insensitive scanner"));
else
CCL_NEG_EXPR(isupper);
}
@@ -1016,13 +1018,13 @@ void format_warn( const char *msg, const char arg[] )
char warn_msg[MAXLINE];
snprintf( warn_msg, sizeof(warn_msg), msg, arg );
warn( warn_msg );
lwarn( warn_msg );
}
/* warn - report a warning, unless -w was given */
/* lwarn - report a warning, unless -w was given */
void warn( const char *str )
void lwarn( const char *str )
{
line_warning( str, linenum );
}
+6 -10
View File
@@ -54,21 +54,17 @@ void flex_regcomp(regex_t *preg, const char *regex, int cflags)
memset (preg, 0, sizeof (regex_t));
if ((err = regcomp (preg, regex, cflags)) != 0) {
const size_t errbuf_sz = 200;
char *errbuf, *rxerr;
const size_t errbuf_sz = 200;
char *errbuf;
int n;
errbuf = malloc(errbuf_sz * sizeof(char));
if (!errbuf)
flexfatal(_("Unable to allocate buffer to report regcomp"));
rxerr = malloc(errbuf_sz * sizeof(char));
if (!rxerr)
flexfatal(_("Unable to allocate buffer for regerror"));
regerror (err, preg, rxerr, errbuf_sz);
snprintf (errbuf, errbuf_sz, "regcomp for \"%s\" failed: %s", regex, rxerr);
n = snprintf(errbuf, errbuf_sz, "regcomp for \"%s\" failed: ", regex);
regerror(err, preg, errbuf+n, errbuf_sz-(size_t)n);
flexfatal (errbuf);
free(errbuf);
free(rxerr);
flexfatal (errbuf); /* never returns - no need to free(errbuf) */
}
}
+76 -77
View File
@@ -74,7 +74,7 @@ extern const char *escaped_qstart, *escaped_qend;
#define RETURNNAME \
if(yyleng < MAXLINE) \
{ \
strcpy( nmstr, yytext ); \
strncpy( nmstr, yytext, sizeof(nmstr) ); \
return NAME; \
} \
else \
@@ -102,20 +102,22 @@ extern const char *escaped_qstart, *escaped_qend;
posix_compat = true;
#define START_CODEBLOCK(x) do { \
/* Emit the needed line directive... */\
if (indented_code == false) { \
linenum++; \
line_directive_out(NULL, 1); \
} \
add_action(M4QSTART); \
yy_push_state(CODEBLOCK); \
if ((indented_code = x)) ACTION_ECHO; \
} while(0)
/* Emit the needed line directive... */\
if (indented_code == false) { \
linenum++; \
line_directive_out(NULL, 1); \
} \
add_action(M4QSTART); \
yy_push_state(CODEBLOCK); \
if ((indented_code = x)) ACTION_ECHO; \
} while(0)
#define END_CODEBLOCK do { \
yy_pop_state();\
yy_pop_state();\
add_action(M4QEND); \
if (!indented_code) line_directive_out(NULL, 0);\
} while (0)
if (!indented_code) line_directive_out(NULL, 0);\
} while (0)
%}
%option caseless nodefault noreject stack noyy_top_state
@@ -205,7 +207,7 @@ M4QEND "]""]"
^{NAME} {
if(yyleng < MAXLINE)
{
strcpy( nmstr, yytext );
strncpy( nmstr, yytext, sizeof(nmstr) );
}
else
{
@@ -261,8 +263,7 @@ M4QEND "]""]"
}
. /* ignore spurious characters */
}
<ACTION,CODEBLOCK,ACTION_STRING,PERCENT_BRACE_ACTION,CHARACTER_CONSTANT,
COMMENT,CODE_COMMENT>{
<ACTION,CODEBLOCK,ACTION_STRING,PERCENT_BRACE_ACTION,CHARACTER_CONSTANT,COMMENT,CODE_COMMENT>{
{M4QSTART} ACTION_ECHO_QSTART;
{M4QEND} ACTION_ECHO_QEND;
}
@@ -317,7 +318,7 @@ COMMENT,CODE_COMMENT>{
{NOT_WS}[^\r\n]* {
if(yyleng < MAXLINE)
{
strcpy( nmdef, yytext );
strncpy( nmdef, yytext, sizeof(nmdef) );
}
else
{
@@ -459,7 +460,7 @@ COMMENT,CODE_COMMENT>{
\"[^"\n]*\" {
if(yyleng-1 < MAXLINE)
{
strcpy( nmstr, yytext + 1 );
strncpy( nmstr, yytext + 1, sizeof(nmstr) );
}
else
{
@@ -486,17 +487,18 @@ COMMENT,CODE_COMMENT>{
^{WS} START_CODEBLOCK(true); /* indented code in prolog */
^{NOT_WS}.* { /* non-indented code */
if ( bracelevel <= 0 )
{ /* not in %{ ... %} */
yyless( 0 ); /* put it all back */
yy_set_bol( 1 );
mark_prolog();
BEGIN(SECT2);
}
else
ACTION_ECHO;
}
^{NOT_WS}.* {
/* non-indented code */
if ( bracelevel <= 0 ) {
/* not in %{ ... %} */
yyless( 0 ); /* put it all back */
yy_set_bol( 1 );
mark_prolog();
BEGIN(SECT2);
} else {
START_CODEBLOCK(true);
}
}
. ACTION_ECHO;
{NL} ++linenum; ACTION_ECHO;
@@ -635,7 +637,7 @@ COMMENT,CODE_COMMENT>{
if(yyleng < MAXLINE)
{
strcpy( nmstr, yytext );
strncpy( nmstr, yytext, sizeof(nmstr) );
}
else
{
@@ -693,7 +695,7 @@ COMMENT,CODE_COMMENT>{
if(yyleng-1 < MAXLINE)
{
strcpy( nmstr, yytext + 1 );
strncpy( nmstr, yytext + 1, sizeof(nmstr) );
}
else
{
@@ -903,30 +905,28 @@ nmstr[yyleng - 2 - end_is_ws] = '\0'; /* chop trailing brace */
<ACTION>"/*" ACTION_ECHO; yy_push_state( CODE_COMMENT );
<CODEBLOCK,ACTION>{
"reject" {
ACTION_ECHO;
CHECK_REJECT(yytext);
}
"yymore" {
ACTION_ECHO;
CHECK_YYMORE(yytext);
}
"reject" {
ACTION_ECHO;
CHECK_REJECT(yytext);
}
"yymore" {
ACTION_ECHO;
CHECK_YYMORE(yytext);
}
}
. ACTION_ECHO;
{NL} {
++linenum;
ACTION_ECHO;
if ( bracelevel == 0 ||
(doing_codeblock && indented_code) )
{
if ( doing_rule_action )
add_action( "\tYY_BREAK]""]\n" );
. ACTION_ECHO;
{NL} {
++linenum;
ACTION_ECHO;
if (bracelevel <= 0 || (doing_codeblock && indented_code)) {
if ( doing_rule_action )
add_action( "\tYY_BREAK]""]\n" );
doing_rule_action = doing_codeblock = false;
BEGIN(SECT2);
}
}
doing_rule_action = doing_codeblock = false;
BEGIN(SECT2);
}
}
}
@@ -935,38 +935,37 @@ nmstr[yyleng - 2 - end_is_ws] = '\0'; /* chop trailing brace */
"{" ACTION_ECHO; ++bracelevel;
"}" ACTION_ECHO; --bracelevel;
[^[:alpha:]_{}\"'/\n\[\]]+ ACTION_ECHO;
[\[\]] ACTION_ECHO;
{NAME} ACTION_ECHO;
{NAME} ACTION_ECHO;
"'"([^\'\\\n]|\\.)"'" ACTION_ECHO; /* character constant */
"'" ACTION_ECHO; yy_push_state(CHARACTER_CONSTANT);
"'" ACTION_ECHO; BEGIN(CHARACTER_CONSTANT);
\" ACTION_ECHO; BEGIN(ACTION_STRING);
{NL} {
++linenum;
ACTION_ECHO;
if ( bracelevel == 0 )
{
if ( doing_rule_action )
add_action( "\tYY_BREAK]""]\n" );
{NL} {
++linenum;
ACTION_ECHO;
if (bracelevel <= 0) {
if ( doing_rule_action )
add_action( "\tYY_BREAK]""]\n" );
doing_rule_action = false;
BEGIN(SECT2);
}
}
. ACTION_ECHO;
doing_rule_action = false;
BEGIN(SECT2);
}
}
. ACTION_ECHO;
}
<ACTION_STRING>{
[^\]\"\\\n\[MmY]+ ACTION_ECHO;
[^\[\]\"\\\n]+ ACTION_ECHO;
\" ACTION_ECHO; BEGIN(ACTION);
}
<CHARACTER_CONSTANT>{
[^\[\]\'\\\nMmY]+ ACTION_ECHO;
\' ACTION_ECHO; yy_pop_state();
[^\[\]\'\\\n]+ ACTION_ECHO;
\' ACTION_ECHO; BEGIN(ACTION);
}
<ACTION_STRING,CHARACTER_CONSTANT>{
\\. ACTION_ECHO;
{NL} ++linenum; ACTION_ECHO;
. ACTION_ECHO;
(\\\n)* ACTION_ECHO;
\\(\\\n)*. ACTION_ECHO;
{NL} ++linenum; ACTION_ECHO; if (bracelevel <= 0) { BEGIN(SECT2); } else { BEGIN(ACTION); }
. ACTION_ECHO;
}
<COMMENT,CODE_COMMENT,COMMENT_DISCARD,ACTION,ACTION_STRING,CHARACTER_CONSTANT><<EOF>> {
@@ -991,8 +990,8 @@ nmstr[yyleng - 2 - end_is_ws] = '\0'; /* chop trailing brace */
<SECT3>{
{M4QSTART} fputs(escaped_qstart, yyout);
{M4QEND} fputs(escaped_qend, yyout);
[^\[\]\n]*(\n?) ECHO;
.|\n ECHO;
[^\[\]]* ECHO;
[][] ECHO;
<<EOF>> {
sectnum = 0;
yyterminate();
@@ -1001,8 +1000,8 @@ nmstr[yyleng - 2 - end_is_ws] = '\0'; /* chop trailing brace */
<SECT3_NOESCAPE>{
{M4QSTART} fprintf(yyout, "[""[%s]""]", escaped_qstart);
{M4QEND} fprintf(yyout, "[""[%s]""]", escaped_qend);
[^\[\]\n]*(\n?) ECHO;
(.|\n) ECHO;
[^][]* ECHO;
[][] ECHO;
<<EOF>> {
sectnum = 0;
yyterminate();
+2
View File
@@ -87,6 +87,8 @@ rescan_nr.direct
rescan_nr.direct.c
rescan_r.direct
rescan_r.direct.c
quote_in_comment
quote_in_comment.c
quotes
quotes.c
string_nr
+94 -63
View File
@@ -31,28 +31,28 @@ TESTS = $(check_PROGRAMS) options.cn
TEST_EXTENSIONS = .reject .table .direct .cn .i3 .pthread .one .opt .ser .ver
LOG_COMPILER = $(srcdir)/testwrapper.sh
LOG_COMPILER = $(SHELL) $(srcdir)/testwrapper.sh
AM_LOG_FLAGS = -d $(srcdir) -r
REJECT_LOG_COMPILER = $(srcdir)/testwrapper.sh
REJECT_LOG_COMPILER = $(SHELL) $(srcdir)/testwrapper.sh
AM_REJECT_LOG_FLAGS = -d $(srcdir) -i $(srcdir)/reject.txt -r
TABLE_LOG_COMPILER = $(srcdir)/testwrapper.sh
TABLE_LOG_COMPILER = $(SHELL) $(srcdir)/testwrapper.sh
AM_TABLE_LOG_FLAGS = -d $(builddir) -i $(srcdir)/reject.txt -t
DIRECT_LOG_COMPILER=$(srcdir)/testwrapper-direct.sh
DIRECT_LOG_COMPILER = $(SHELL) $(srcdir)/testwrapper-direct.sh
AM_DIRECT_LOG_FLAGS = -b $(abs_builddir) -s $(srcdir)
CN_LOG_COMPILER=$(srcdir)/options.cn
AM_CN_LOG_FLAGS=$(FLEX)
CN_LOG_COMPILER = $(SHELL) $(srcdir)/options.cn
AM_CN_LOG_FLAGS = $(FLEX)
I3_LOG_COMPILER=$(srcdir)/testwrapper.sh
AM_I3_LOG_FLAGS=-i $(srcdir)/cxx_yywrap.txt -i $(srcdir)/cxx_yywrap.txt -i $(srcdir)/cxx_yywrap.txt
I3_LOG_COMPILER = $(SHELL) $(srcdir)/testwrapper.sh
AM_I3_LOG_FLAGS = -i $(srcdir)/cxx_yywrap.txt -i $(srcdir)/cxx_yywrap.txt -i $(srcdir)/cxx_yywrap.txt
PTHREAD_LOG_COMPILER=$(srcdir)/testwrapper.sh
AM_PTHREAD_LOG_FLAGS=-i $(srcdir)/pthread_1.txt -i $(srcdir)/pthread_2.txt -i $(srcdir)/pthread_3.txt -i $(srcdir)/pthread_4.txt -i $(srcdir)/pthread_5.txt
PTHREAD_LOG_COMPILER = $(SHELL) $(srcdir)/testwrapper.sh
AM_PTHREAD_LOG_FLAGS = -i $(srcdir)/pthread_1.txt -i $(srcdir)/pthread_2.txt -i $(srcdir)/pthread_3.txt -i $(srcdir)/pthread_4.txt -i $(srcdir)/pthread_5.txt
ONE_LOG_COMPILER = $(srcdir)/testwrapper.sh
ONE_LOG_COMPILER = $(SHELL) $(srcdir)/testwrapper.sh
AM_ONE_LOG_FLAGS = -1 -d $(srcdir)
AM_YFLAGS = -d -p test
@@ -88,6 +88,7 @@ simple_tests = \
posixly_correct \
prefix_nr \
prefix_r \
quote_in_comment \
quotes \
string_nr \
string_r \
@@ -112,24 +113,32 @@ DIRECT_TESTS = \
I3_TESTS = \
cxx_yywrap.i3
if want_pthread
PTHREAD_TESTS = \
pthread.pthread
endif
ONE_TESTS = \
lineno_nr.one \
lineno_r.one \
lineno_trailing.one
quote_in_comment_SOURCES = quote_in_comment.l
alloc_extra_SOURCES = alloc_extra.l
array_nr_SOURCES = array_nr.l
array_r_SOURCES = array_r.l
basic_nr_SOURCES = basic_nr.l
basic_r_SOURCES = basic_r.l
if HAVE_BISON
bison_nr_SOURCES = bison_nr_scanner.l bison_nr_parser.y bison_nr_main.c
nodist_bison_nr_SOURCES = bison_nr_parser.h bison_nr_scanner.h
bison_yylloc_SOURCES = bison_yylloc_scanner.l bison_yylloc_parser.y bison_yylloc_main.c
nodist_bison_yylloc_SOURCES = bison_yylloc_parser.h bison_yylloc_scanner.h
bison_yylval_SOURCES = bison_yylval_scanner.l bison_yylval_parser.y bison_yylval_main.c
nodist_bison_yylval_SOURCES = bison_yylval_parser.h bison_yylval_scanner.h
else
bison_nr_SOURCES = no_bison_stub.c
bison_yylloc_SOURCES = no_bison_stub.c
bison_yylval_SOURCES = no_bison_stub.c
endif
c_cxx_nr_SOURCES = c_cxx_nr.lll
c_cxx_r_SOURCES = c_cxx_r.lll
ccl_SOURCES = ccl.l
@@ -141,7 +150,9 @@ debug_nr_SOURCES = debug_nr.l
debug_r_SOURCES = debug_r.l
extended_SOURCES = extended.l
header_nr_SOURCES = header_nr_scanner.l header_nr_main.c
nodist_header_nr_SOURCES = header_nr_scanner.h
header_r_SOURCES = header_r_scanner.l header_r_main.c
nodist_header_r_SOURCES = header_r_scanner.h
include_by_buffer_direct_SOURCES = include_by_buffer.direct.l
include_by_push_direct_SOURCES = include_by_push.direct.l
include_by_reentrant_direct_SOURCES = include_by_reentrant.direct.l
@@ -151,7 +162,9 @@ lineno_trailing_one_SOURCES = lineno_trailing.l
mem_nr_SOURCES = mem_nr.l
mem_r_SOURCES = mem_r.l
multiple_scanners_nr_SOURCES = multiple_scanners_nr_main.c multiple_scanners_nr_1.l multiple_scanners_nr_2.l
nodist_multiple_scanners_nr_SOURCES = multiple_scanners_nr_1.h multiple_scanners_nr_2.h
multiple_scanners_r_SOURCES = multiple_scanners_r_main.c multiple_scanners_r_1.l multiple_scanners_r_2.l
nodist_multiple_scanners_r_SOURCES = multiple_scanners_nr_1.h multiple_scanners_nr_2.h
posix_SOURCES = posix.l
posixly_correct_SOURCES = posixly_correct.l
prefix_nr_SOURCES = prefix_nr.l
@@ -167,23 +180,9 @@ rescan_r_direct_SOURCES = rescan_r.direct.l
string_nr_SOURCES = string_nr.l
string_r_SOURCES = string_r.l
top_SOURCES = top.l top_main.c
nodist_top_SOURCES = top.h
yyextra_SOURCES = yyextra.l
BUILT_SOURCES = \
bison_nr_parser.h \
bison_nr_scanner.h \
bison_yylloc_parser.h \
bison_yylloc_scanner.h \
bison_yylval_parser.h \
bison_yylval_scanner.h \
header_nr_scanner.h \
header_r_scanner.h \
multiple_scanners_nr_1.h \
multiple_scanners_nr_2.h \
multiple_scanners_r_1.h \
multiple_scanners_r_2.h \
top.h
# Normally, automake would distribute files built by flex. Since the
# point of the test suite is to test the files that flex builds, and
# since anyone who has the flex distribution can build a flex binary
@@ -194,6 +193,7 @@ BUILT_SOURCES = \
# it.
CLEANFILES = \
alloc_extra.c \
array_nr.c \
array_r.c \
basic_nr.c \
@@ -246,6 +246,7 @@ CLEANFILES = \
prefix_nr.c \
prefix_r.c \
pthread.c \
quote_in_comment.c \
quotes.c \
reject_nr.reject.c \
reject_r.reject.c \
@@ -260,7 +261,6 @@ CLEANFILES = \
top.c \
top.h \
yyextra.c \
alloc_extra.c \
$(tableopts_c) \
$(tableopts_tables)
@@ -315,6 +315,7 @@ EXTRA_DIST = \
reject.txt \
rescan_nr.direct.txt \
rescan_r.direct.txt \
quote_in_comment.txt \
quotes.txt \
top.txt \
yyextra.txt \
@@ -328,82 +329,112 @@ dist_check_SCRIPTS = \
testwrapper-direct.sh \
testwrapper.sh
pthread_pthread_LDADD = -lpthread
pthread_pthread_LDADD = @LIBPTHREAD@
# specify how to process .l files in order to test the flex built by make all
FLEX = $(top_builddir)/src/flex
.l.c: $(FLEX)
$(FLEX) -o $@ $<
$(AM_V_LEX)$(FLEX) -o $@ $<
.ll.cc: $(FLEX)
$(FLEX) -+ -o $@ $<
$(AM_V_LEX)$(FLEX) -+ -o $@ $<
bison_nr_main.$(OBJEXT): bison_nr_parser.h bison_nr_scanner.h
bison_nr_scanner.$(OBJEXT): bison_nr_parser.h
bison_nr_main.($OBJEXT): bison_nr_parser.h bison_nr_scanner.h
bison_nr_scanner.h: bison_nr_scanner.c
@if test ! -f $@; then rm -f $<; else :; fi
@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) $<; else :; fi
bison_yylloc_main.$(OBJEXT): bison_yylloc_parser.h bison_yylloc_scanner.h
bison_yylloc_scanner.$(OBJEXT): bison_yylloc_parser.h
bison_yylloc_scanner.h: bison_yylloc_scanner.c
@if test ! -f $@; then rm -f $<; else :; fi
@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) $<; else :; fi
bison_yylval_main.$(OBJEXT): bison_yylval_parser.h bison_yylval_scanner.h
bison_yylval_scanner.$(OBJEXT): bison_yylval_parser.h
bison_yylval_scanner.h: bison_yylval_scanner.c
@if test ! -f $@; then rm -f $<; else :; fi
@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) $<; else :; fi
# automake does not support compiling flex scanners output in C as C++
# so we explicitly sayhow, using the .lll suffix for the lex input file
.lll.cc: $(FLEX)
$(FLEX) -o $@ $<
$(AM_V_LEX)$(FLEX) -o $@ $<
header_nr_main.$(OBJEXT): header_nr_scanner.h
header_nr_scanner.h: header_nr_scanner.c
@if test ! -f $@; then rm -f $<; else :; fi
@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) $<; else :; fi
header_r_main.$(OBJEXT): header_r_scanner.h
header_r_scanner.h: header_r_scanner.c
@if test ! -f $@; then rm -f $<; else :; fi
@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) $<; else :; fi
multiple_scanners_nr_main.$(OBJEXT): multiple_scanners_nr_1.h multiple_scanners_nr_2.h
multiple_scanners_nr_1.h: multiple_scanners_nr_1.c
@if test ! -f $@; then rm -f $<; else :; fi
@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) $<; else :; fi
multiple_scanners_nr_2.h: multiple_scanners_nr_2.c
@if test ! -f $@; then rm -f $<; else :; fi
@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) $<; else :; fi
multiple_scanners_r_main.$(OBJEXT): multiple_scanners_r_1.h multiple_scanners_r_2.h
multiple_scanners_r_1.h: multiple_scanners_r_1.c
@if test ! -f $@; then rm -f $<; else :; fi
@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) $<; else :; fi
multiple_scanners_r_2.h: multiple_scanners_r_2.c
@if test ! -f $@; then rm -f $<; else :; fi
@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) $<; else :; fi
posixly_correct.c: posixly_correct.l $(FLEX)
POSIXLY_CORRECT=1 $(FLEX) -o $@ $<
$(AM_V_LEX)POSIXLY_CORRECT=1 $(FLEX) -o $@ $<
reject_nr.reject.c: reject.l4 $(FLEX)
$(FLEX) --unsafe-no-m4-sect3-escape -o $@ $<
$(AM_V_LEX)$(FLEX) --unsafe-no-m4-sect3-escape -o $@ $<
reject_nr.reject$(EXEEXT): reject_nr.reject.$(OBJEXT)
$(LINK) $^
$(AM_V_CCLD)$(LINK) $^
reject_r.reject.c: reject.l4 $(FLEX)
$(FLEX) --unsafe-no-m4-sect3-escape --reentrant -o $@ $<
$(AM_V_LEX)$(FLEX) --unsafe-no-m4-sect3-escape --reentrant -o $@ $<
reject_r.reject.$(OBJEXT): reject_r.reject.c
$(COMPILE) -DTEST_IS_REENTRANT -c -o $@ $<
$(AM_V_CC)$(COMPILE) -DTEST_IS_REENTRANT -c -o $@ $<
reject_r.reject$(EXEEXT): reject_r.reject.$(OBJEXT)
$(LINK) $^
$(AM_V_CCLD)$(LINK) $^
reject_ver.table.c: reject.l4 $(FLEX)
$(FLEX) --unsafe-no-m4-sect3-escape -o $@ --tables-verify --tables-file=$(basename $@).tables $<
$(AM_V_LEX)$(FLEX) --unsafe-no-m4-sect3-escape -o $@ --tables-verify --tables-file=$(basename $@).tables $<
reject_ver.table.$(OBJEXT): reject_ver.table.c
$(COMPILE) -DTEST_HAS_TABLES_EXTERNAL -c -o $@ $<
$(AM_V_CC)$(COMPILE) -DTEST_HAS_TABLES_EXTERNAL -c -o $@ $<
reject_ver.table$(EXEEXT): reject_ver.table.$(OBJEXT)
$(LINK) $^
$(AM_V_CCLD)$(LINK) $^
reject_ser.table.c: reject.l4 $(FLEX)
$(FLEX) -o $@ --unsafe-no-m4-sect3-escape --tables-file=$(basename $@).tables $<
$(AM_V_LEX)$(FLEX) -o $@ --unsafe-no-m4-sect3-escape --tables-file=$(basename $@).tables $<
reject_ser.table.$(OBJEXT): reject_ser.table.c
$(COMPILE) -DTEST_HAS_TABLES_EXTERNAL -c -o $@ $<
$(AM_V_CC)$(COMPILE) -DTEST_HAS_TABLES_EXTERNAL -c -o $@ $<
reject_ser.table$(EXEEXT): reject_ser.table.$(OBJEXT)
$(LINK) $^
$(AM_V_CCLD)$(LINK) $^
top_main.$(OBJEXT): top.h
top.h: top.c
@@ -415,7 +446,7 @@ top.h: top.c
# it can be / is generated by a shell script, tableopts.sh.
tableopts.am: tableopts.sh
$(srcdir)/tableopts.sh > $(srcdir)/tableopts.am
$(SHELL) $(srcdir)/tableopts.sh > $(srcdir)/tableopts.am
include $(srcdir)/tableopts.am
@@ -427,50 +458,50 @@ tableopts_tests := $(tableopts_opttests) $(tableopts_vertests) $(tableopts_sert
tableopts_c := $(addsuffix .c,$(tableopts_tests))
OPT_LOG_COMPILER = $(srcdir)/testwrapper.sh
OPT_LOG_COMPILER = $(SHELL) $(srcdir)/testwrapper.sh
AM_OPT_LOG_FLAGS = -d $(srcdir) -i $(srcdir)/tableopts.txt -r
tableopts_opt_nr%.c: tableopts.l4 $(FLEX)
$(FLEX) --unsafe-no-m4-sect3-escape -P $(subst -,_,$(basename $(*F))) $* -o $@ $<
$(AM_V_LEX)$(FLEX) --unsafe-no-m4-sect3-escape -P $(subst -,_,$(basename $(*F))) $* -o $@ $<
tableopts_opt_nr%.$(OBJEXT): tableopts_opt_nr%.c
$(COMPILE) -c -o $@ $<
$(AM_V_CC)$(COMPILE) -c -o $@ $<
tableopts_opt_r%.c: tableopts.l4 $(FLEX)
$(FLEX) --unsafe-no-m4-sect3-escape -P $(subst -,_,$(basename $(*F))) --reentrant $* -o $@ $<
$(AM_V_LEX)$(FLEX) --unsafe-no-m4-sect3-escape -P $(subst -,_,$(basename $(*F))) --reentrant $* -o $@ $<
tableopts_opt_r%.$(OBJEXT): tableopts_opt_r%.c
$(COMPILE) -DTEST_IS_REENTRANT -c -o $@ $<
$(AM_V_CC)$(COMPILE) -DTEST_IS_REENTRANT -c -o $@ $<
SER_LOG_COMPILER = $(srcdir)/testwrapper.sh
SER_LOG_COMPILER = $(SHELL) $(srcdir)/testwrapper.sh
AM_SER_LOG_FLAGS = -d $(builddir) -i $(srcdir)/tableopts.txt -r -t
tableopts_ser_nr%.c: tableopts.l4 $(FLEX)
$(FLEX) --unsafe-no-m4-sect3-escape -P $(subst -,_,$(basename $(*F))) --tables-file="tableopts_ser_nr$*.ser.tables" $* -o $@ $<
$(AM_V_LEX)$(FLEX) --unsafe-no-m4-sect3-escape -P $(subst -,_,$(basename $(*F))) --tables-file="tableopts_ser_nr$*.ser.tables" $* -o $@ $<
tableopts_ser_nr%.$(OBJEXT): tableopts_ser_nr%.c
$(COMPILE) -DTEST_HAS_TABLES_EXTERNAL -c -o $@ $<
$(AM_V_CC)$(COMPILE) -DTEST_HAS_TABLES_EXTERNAL -c -o $@ $<
tableopts_ser_r%.c: tableopts.l4 $(FLEX)
$(FLEX) --unsafe-no-m4-sect3-escape -P $(subst -,_,$(basename $(*F))) -R --tables-file="tableopts_ser_r$*.ser.tables" $* -o $@ $<
$(AM_V_LEX)$(FLEX) --unsafe-no-m4-sect3-escape -P $(subst -,_,$(basename $(*F))) -R --tables-file="tableopts_ser_r$*.ser.tables" $* -o $@ $<
tableopts_ser_r%.$(OBJEXT): tableopts_ser_r%.c
$(COMPILE) -DTEST_HAS_TABLES_EXTERNAL -DTEST_IS_REENTRANT -c -o $@ $<
$(AM_V_CC)$(COMPILE) -DTEST_HAS_TABLES_EXTERNAL -DTEST_IS_REENTRANT -c -o $@ $<
VER_LOG_COMPILER = $(srcdir)/testwrapper.sh
VER_LOG_COMPILER = $(SHELL) $(srcdir)/testwrapper.sh
AM_VER_LOG_FLAGS = -d $(builddir) -i $(srcdir)/tableopts.txt -r -t
tableopts_ver_nr%.c: tableopts.l4 $(FLEX)
$(FLEX) --unsafe-no-m4-sect3-escape -P $(subst -,_,$(basename $(*F))) --tables-file="tableopts_ver_nr$*.ver.tables" --tables-verify $* -o $@ $<
$(AM_V_LEX)$(FLEX) --unsafe-no-m4-sect3-escape -P $(subst -,_,$(basename $(*F))) --tables-file="tableopts_ver_nr$*.ver.tables" --tables-verify $* -o $@ $<
tableopts_ver_nr%.$(OBJEXT): tableopts_ver_nr%.c
$(COMPILE) -DTEST_HAS_TABLES_EXTERNAL -c -o $@ $<
$(AM_V_CC)$(COMPILE) -DTEST_HAS_TABLES_EXTERNAL -c -o $@ $<
tableopts_ver_nr%.ver$(EXEEXT): tableopts_ver_nr%.$(OBJEXT)
$(LINK) -o $@ $^
$(AM_V_CCLD)$(LINK) -o $@ $^
tableopts_ver_r%.c: tableopts.l4 $(FLEX)
$(FLEX) --unsafe-no-m4-sect3-escape -P $(subst -,_,$(basename $(*F))) -R --tables-file="tableopts_ver_r$*.ver.tables" --tables-verify $* -o $@ $<
$(AM_V_LEX)$(FLEX) --unsafe-no-m4-sect3-escape -P $(subst -,_,$(basename $(*F))) -R --tables-file="tableopts_ver_r$*.ver.tables" --tables-verify $* -o $@ $<
tableopts_ver_r%.$(OBJEXT): tableopts_ver_r%.c
$(COMPILE) -DTEST_HAS_TABLES_EXTERNAL -DTEST_IS_REENTRANT -c -o $@ $<
$(AM_V_CC)$(COMPILE) -DTEST_HAS_TABLES_EXTERNAL -DTEST_IS_REENTRANT -c -o $@ $<
+2 -1
View File
@@ -50,7 +50,8 @@ stderr, which will have been redirected to the log file created by the
automake test suite harness.
** If your test is skipped (e.g., because bison was not found), then
the test should return 2 (two).
the test should return 77 (seventy-seven). This is the exit status that
would be recognized by automake's "test-driver" as _skipped_.
** Once your work is done, submit a patch via the flex development
mailing list, the github pull request mechanism or some other
+5 -5
View File
@@ -49,13 +49,13 @@ main (void)
{
yyscan_t lexer;
testlex_init(&lexer);
testset_in(stdin, lexer);
testset_out(stdout, lexer);
yylex_init(&lexer);
yyset_in(stdin, lexer);
yyset_out(stdout, lexer);
testlex( lexer );
yylex( lexer );
testlex_destroy( lexer);
yylex_destroy( lexer);
printf("TEST RETURNING OK.\n");
return 0;
+39
View File
@@ -0,0 +1,39 @@
/* This stub will be used when Bison is not available on the user's host. */
/* 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.
*/
#include <stdio.h>
int main (int argc, char *argv[])
{
(void)argc;
(void)argv;
puts(
"This test requires Bison. Install Bison and re-run \"configure && make check\"\n"
"to perform this test. (This file is stub code.)"
);
/* Exit status for a skipped test */
return 77;
}
/* vim:set tabstop=8 softtabstop=4 shiftwidth=4: */
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
# Test that flex handles the grouped noop options -c and -n properly.
+9 -9
View File
@@ -27,7 +27,7 @@
We create N_THREADS number of threads. Each thread has it's own scanner.
Each thread selects one of the files specified in ARGV, scans it, then
closes it. This is repeated N_SCANS numebr of times for each thread.
closes it. This is repeated N_SCANS number of times for each thread.
The idea is to press the scanner to break under threads.
If we see "Scanner Jammed", then we know
@@ -90,18 +90,18 @@ static int process_text(char* s, yyscan_t scanner)
int main(int ARGC, char *ARGV[]);
#ifndef HAVE_LIBPTHREAD
int main (int ARGC, char *ARGV[]) {
printf(
#ifndef HAVE_PTHREAD_H
int main (int ARGC, char *ARGV[]) {
puts(
"TEST ABORTED because pthread library not available \n"
"-- This is expected on some systems. It is not a flex error.\n" );
return 0;
}
"-- This is expected on some systems. It is not a flex error.");
/* Exit status for a skipped test */
return 77;
}
#else
#define N_THREADS 4
#define N_SCANS 20
#define INPUT_FILE "test.input"
/* Each thread selects the next file to scan in round-robin fashion.
If there are less files than threads, some threads may block. */
@@ -204,5 +204,5 @@ int main (int ARGC, char *ARGV[])
return 0;
}
#endif /* HAVE_LIBPTHREAD */
#endif /* HAVE_PTHREAD_H */
+16
View File
@@ -0,0 +1,16 @@
%option 8bit noyywrap
%%
.|\n { ECHO;
//' "
}
%%
int
main (void)
{
yyin = stdin;
yyout = stdout;
while (yylex())
;
printf("TEST RETURNING OK.\n");
return 0;
}
+1
View File
@@ -0,0 +1 @@
test
+22 -2
View File
@@ -67,19 +67,39 @@ static int foo (int i){
/* indented code [[[ 3 ]]] */
/* indented code [[[[ 4 ]]]] */
/* indented code ]] unmatched [[ */
%{
// non-indented code [ 1 ]
// non-indented code [[ 2 ]]
// non-indented code [[[ 3 ]]]
// non-indented code [[[[ 4 ]]]]
%}
a /* action comment [ 1 ] */ ;
b /* action comment [[ 2 ]] */ ;
c /* action comment [[[ 3 ]]] */ ;
d /* action comment [[[[ 4 ]]]] */ ;
e /* action comment ]] unmatched [[ */ ;
f return 1+foo(a[b[c[0]]]);
.|\n {
.|\n {
#if 0
action code [ 1 ] TEST_XXX
action code [[ 2 ]] TEST_XXX
action code [[[ 3 ]]] TEST_XXX
action code [[[[ 4 ]]]] TEST_XXX
action code ]] unmatched [[ TEST_XXX
#endif
/* action block [ 1 ] TEST_XXX */
/* action block [[ 2 ]] TEST_XXX */
/* action block [[[ 3 ]]] TEST_XXX */
/* action block [[[[ 4 ]]]] TEST_XXX */
/* action block ]] unmatched [[ TEST_XXX */
assert(!strcmp("m4_define(alpha, beta)", "m4_""define(alpha, beta)"));
assert(!strcmp("[[ 2 ]]", "[""[ 2 ]""]"));
assert(!strcmp("[[[ 3 ]]]", "[""[""[ 3 ]""]""]"));
assert(!strcmp("[[[[ 4 ]]]]", "[""[""[""[ 4 ]""]""]""]"));
assert(!strcmp("]] unmatched [[", "]""] unmatched [""["));
assert(!strcmp("]]m4_define(alpha, beta)[[",
"]""]m4_""define(alpha, beta)[""["));
return 1+foo(a[b[c[0]]]); /* TEST_XXX */
}
%%
+66 -66
View File
@@ -1,332 +1,332 @@
tableopts_opt_nr_Ca_opt_SOURCES = tableopts.l4
tableopts_opt_nr-Ca.opt$(EXEEXT): tableopts_opt_nr-Ca.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_opt_nr_Ce_opt_SOURCES = tableopts.l4
tableopts_opt_nr-Ce.opt$(EXEEXT): tableopts_opt_nr-Ce.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_opt_nr_Cf_opt_SOURCES = tableopts.l4
tableopts_opt_nr-Cf.opt$(EXEEXT): tableopts_opt_nr-Cf.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_opt_nr_CF_opt_SOURCES = tableopts.l4
tableopts_opt_nr-CF.opt$(EXEEXT): tableopts_opt_nr-CF.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_opt_nr_Cm_opt_SOURCES = tableopts.l4
tableopts_opt_nr-Cm.opt$(EXEEXT): tableopts_opt_nr-Cm.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_opt_nr_Cem_opt_SOURCES = tableopts.l4
tableopts_opt_nr-Cem.opt$(EXEEXT): tableopts_opt_nr-Cem.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_opt_nr_Cae_opt_SOURCES = tableopts.l4
tableopts_opt_nr-Cae.opt$(EXEEXT): tableopts_opt_nr-Cae.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_opt_nr_Caef_opt_SOURCES = tableopts.l4
tableopts_opt_nr-Caef.opt$(EXEEXT): tableopts_opt_nr-Caef.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_opt_nr_CaeF_opt_SOURCES = tableopts.l4
tableopts_opt_nr-CaeF.opt$(EXEEXT): tableopts_opt_nr-CaeF.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_opt_nr_Cam_opt_SOURCES = tableopts.l4
tableopts_opt_nr-Cam.opt$(EXEEXT): tableopts_opt_nr-Cam.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_opt_nr_Caem_opt_SOURCES = tableopts.l4
tableopts_opt_nr-Caem.opt$(EXEEXT): tableopts_opt_nr-Caem.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_opt_r_Ca_opt_SOURCES = tableopts.l4
tableopts_opt_r-Ca.opt$(EXEEXT): tableopts_opt_r-Ca.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_opt_r_Ce_opt_SOURCES = tableopts.l4
tableopts_opt_r-Ce.opt$(EXEEXT): tableopts_opt_r-Ce.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_opt_r_Cf_opt_SOURCES = tableopts.l4
tableopts_opt_r-Cf.opt$(EXEEXT): tableopts_opt_r-Cf.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_opt_r_CF_opt_SOURCES = tableopts.l4
tableopts_opt_r-CF.opt$(EXEEXT): tableopts_opt_r-CF.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_opt_r_Cm_opt_SOURCES = tableopts.l4
tableopts_opt_r-Cm.opt$(EXEEXT): tableopts_opt_r-Cm.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_opt_r_Cem_opt_SOURCES = tableopts.l4
tableopts_opt_r-Cem.opt$(EXEEXT): tableopts_opt_r-Cem.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_opt_r_Cae_opt_SOURCES = tableopts.l4
tableopts_opt_r-Cae.opt$(EXEEXT): tableopts_opt_r-Cae.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_opt_r_Caef_opt_SOURCES = tableopts.l4
tableopts_opt_r-Caef.opt$(EXEEXT): tableopts_opt_r-Caef.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_opt_r_CaeF_opt_SOURCES = tableopts.l4
tableopts_opt_r-CaeF.opt$(EXEEXT): tableopts_opt_r-CaeF.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_opt_r_Cam_opt_SOURCES = tableopts.l4
tableopts_opt_r-Cam.opt$(EXEEXT): tableopts_opt_r-Cam.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_opt_r_Caem_opt_SOURCES = tableopts.l4
tableopts_opt_r-Caem.opt$(EXEEXT): tableopts_opt_r-Caem.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ser_nr_Ca_ser_SOURCES = tableopts.l4
tableopts_ser_nr-Ca.ser$(EXEEXT): tableopts_ser_nr-Ca.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ser_nr_Ce_ser_SOURCES = tableopts.l4
tableopts_ser_nr-Ce.ser$(EXEEXT): tableopts_ser_nr-Ce.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ser_nr_Cf_ser_SOURCES = tableopts.l4
tableopts_ser_nr-Cf.ser$(EXEEXT): tableopts_ser_nr-Cf.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ser_nr_CF_ser_SOURCES = tableopts.l4
tableopts_ser_nr-CF.ser$(EXEEXT): tableopts_ser_nr-CF.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ser_nr_Cm_ser_SOURCES = tableopts.l4
tableopts_ser_nr-Cm.ser$(EXEEXT): tableopts_ser_nr-Cm.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ser_nr_Cem_ser_SOURCES = tableopts.l4
tableopts_ser_nr-Cem.ser$(EXEEXT): tableopts_ser_nr-Cem.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ser_nr_Cae_ser_SOURCES = tableopts.l4
tableopts_ser_nr-Cae.ser$(EXEEXT): tableopts_ser_nr-Cae.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ser_nr_Caef_ser_SOURCES = tableopts.l4
tableopts_ser_nr-Caef.ser$(EXEEXT): tableopts_ser_nr-Caef.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ser_nr_CaeF_ser_SOURCES = tableopts.l4
tableopts_ser_nr-CaeF.ser$(EXEEXT): tableopts_ser_nr-CaeF.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ser_nr_Cam_ser_SOURCES = tableopts.l4
tableopts_ser_nr-Cam.ser$(EXEEXT): tableopts_ser_nr-Cam.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ser_nr_Caem_ser_SOURCES = tableopts.l4
tableopts_ser_nr-Caem.ser$(EXEEXT): tableopts_ser_nr-Caem.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ser_r_Ca_ser_SOURCES = tableopts.l4
tableopts_ser_r-Ca.ser$(EXEEXT): tableopts_ser_r-Ca.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ser_r_Ce_ser_SOURCES = tableopts.l4
tableopts_ser_r-Ce.ser$(EXEEXT): tableopts_ser_r-Ce.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ser_r_Cf_ser_SOURCES = tableopts.l4
tableopts_ser_r-Cf.ser$(EXEEXT): tableopts_ser_r-Cf.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ser_r_CF_ser_SOURCES = tableopts.l4
tableopts_ser_r-CF.ser$(EXEEXT): tableopts_ser_r-CF.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ser_r_Cm_ser_SOURCES = tableopts.l4
tableopts_ser_r-Cm.ser$(EXEEXT): tableopts_ser_r-Cm.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ser_r_Cem_ser_SOURCES = tableopts.l4
tableopts_ser_r-Cem.ser$(EXEEXT): tableopts_ser_r-Cem.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ser_r_Cae_ser_SOURCES = tableopts.l4
tableopts_ser_r-Cae.ser$(EXEEXT): tableopts_ser_r-Cae.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ser_r_Caef_ser_SOURCES = tableopts.l4
tableopts_ser_r-Caef.ser$(EXEEXT): tableopts_ser_r-Caef.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ser_r_CaeF_ser_SOURCES = tableopts.l4
tableopts_ser_r-CaeF.ser$(EXEEXT): tableopts_ser_r-CaeF.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ser_r_Cam_ser_SOURCES = tableopts.l4
tableopts_ser_r-Cam.ser$(EXEEXT): tableopts_ser_r-Cam.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ser_r_Caem_ser_SOURCES = tableopts.l4
tableopts_ser_r-Caem.ser$(EXEEXT): tableopts_ser_r-Caem.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ver_nr_Ca_ver_SOURCES = tableopts.l4
tableopts_ver_nr-Ca.ver$(EXEEXT): tableopts_ver_nr-Ca.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ver_nr_Ce_ver_SOURCES = tableopts.l4
tableopts_ver_nr-Ce.ver$(EXEEXT): tableopts_ver_nr-Ce.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ver_nr_Cf_ver_SOURCES = tableopts.l4
tableopts_ver_nr-Cf.ver$(EXEEXT): tableopts_ver_nr-Cf.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ver_nr_CF_ver_SOURCES = tableopts.l4
tableopts_ver_nr-CF.ver$(EXEEXT): tableopts_ver_nr-CF.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ver_nr_Cm_ver_SOURCES = tableopts.l4
tableopts_ver_nr-Cm.ver$(EXEEXT): tableopts_ver_nr-Cm.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ver_nr_Cem_ver_SOURCES = tableopts.l4
tableopts_ver_nr-Cem.ver$(EXEEXT): tableopts_ver_nr-Cem.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ver_nr_Cae_ver_SOURCES = tableopts.l4
tableopts_ver_nr-Cae.ver$(EXEEXT): tableopts_ver_nr-Cae.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ver_nr_Caef_ver_SOURCES = tableopts.l4
tableopts_ver_nr-Caef.ver$(EXEEXT): tableopts_ver_nr-Caef.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ver_nr_CaeF_ver_SOURCES = tableopts.l4
tableopts_ver_nr-CaeF.ver$(EXEEXT): tableopts_ver_nr-CaeF.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ver_nr_Cam_ver_SOURCES = tableopts.l4
tableopts_ver_nr-Cam.ver$(EXEEXT): tableopts_ver_nr-Cam.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ver_nr_Caem_ver_SOURCES = tableopts.l4
tableopts_ver_nr-Caem.ver$(EXEEXT): tableopts_ver_nr-Caem.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ver_r_Ca_ver_SOURCES = tableopts.l4
tableopts_ver_r-Ca.ver$(EXEEXT): tableopts_ver_r-Ca.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ver_r_Ce_ver_SOURCES = tableopts.l4
tableopts_ver_r-Ce.ver$(EXEEXT): tableopts_ver_r-Ce.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ver_r_Cf_ver_SOURCES = tableopts.l4
tableopts_ver_r-Cf.ver$(EXEEXT): tableopts_ver_r-Cf.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ver_r_CF_ver_SOURCES = tableopts.l4
tableopts_ver_r-CF.ver$(EXEEXT): tableopts_ver_r-CF.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ver_r_Cm_ver_SOURCES = tableopts.l4
tableopts_ver_r-Cm.ver$(EXEEXT): tableopts_ver_r-Cm.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ver_r_Cem_ver_SOURCES = tableopts.l4
tableopts_ver_r-Cem.ver$(EXEEXT): tableopts_ver_r-Cem.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ver_r_Cae_ver_SOURCES = tableopts.l4
tableopts_ver_r-Cae.ver$(EXEEXT): tableopts_ver_r-Cae.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ver_r_Caef_ver_SOURCES = tableopts.l4
tableopts_ver_r-Caef.ver$(EXEEXT): tableopts_ver_r-Caef.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ver_r_CaeF_ver_SOURCES = tableopts.l4
tableopts_ver_r-CaeF.ver$(EXEEXT): tableopts_ver_r-CaeF.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ver_r_Cam_ver_SOURCES = tableopts.l4
tableopts_ver_r-Cam.ver$(EXEEXT): tableopts_ver_r-Cam.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
tableopts_ver_r_Caem_ver_SOURCES = tableopts.l4
tableopts_ver_r-Caem.ver$(EXEEXT): tableopts_ver_r-Caem.$(OBJEXT)
$(LINK) -o $@ $<
$(AM_V_CCLD)$(LINK) -o $@ $<
TABLEOPTS_TESTS = tableopts_opt_nr-Ca.opt tableopts_opt_nr-Ce.opt tableopts_opt_nr-Cf.opt tableopts_opt_nr-CF.opt tableopts_opt_nr-Cm.opt tableopts_opt_nr-Cem.opt tableopts_opt_nr-Cae.opt tableopts_opt_nr-Caef.opt tableopts_opt_nr-CaeF.opt tableopts_opt_nr-Cam.opt tableopts_opt_nr-Caem.opt tableopts_opt_r-Ca.opt tableopts_opt_r-Ce.opt tableopts_opt_r-Cf.opt tableopts_opt_r-CF.opt tableopts_opt_r-Cm.opt tableopts_opt_r-Cem.opt tableopts_opt_r-Cae.opt tableopts_opt_r-Caef.opt tableopts_opt_r-CaeF.opt tableopts_opt_r-Cam.opt tableopts_opt_r-Caem.opt tableopts_ser_nr-Ca.ser tableopts_ser_nr-Ce.ser tableopts_ser_nr-Cf.ser tableopts_ser_nr-CF.ser tableopts_ser_nr-Cm.ser tableopts_ser_nr-Cem.ser tableopts_ser_nr-Cae.ser tableopts_ser_nr-Caef.ser tableopts_ser_nr-CaeF.ser tableopts_ser_nr-Cam.ser tableopts_ser_nr-Caem.ser tableopts_ser_r-Ca.ser tableopts_ser_r-Ce.ser tableopts_ser_r-Cf.ser tableopts_ser_r-CF.ser tableopts_ser_r-Cm.ser tableopts_ser_r-Cem.ser tableopts_ser_r-Cae.ser tableopts_ser_r-Caef.ser tableopts_ser_r-CaeF.ser tableopts_ser_r-Cam.ser tableopts_ser_r-Caem.ser tableopts_ver_nr-Ca.ver tableopts_ver_nr-Ce.ver tableopts_ver_nr-Cf.ver tableopts_ver_nr-CF.ver tableopts_ver_nr-Cm.ver tableopts_ver_nr-Cem.ver tableopts_ver_nr-Cae.ver tableopts_ver_nr-Caef.ver tableopts_ver_nr-CaeF.ver tableopts_ver_nr-Cam.ver tableopts_ver_nr-Caem.ver tableopts_ver_r-Ca.ver tableopts_ver_r-Ce.ver tableopts_ver_r-Cf.ver tableopts_ver_r-CF.ver tableopts_ver_r-Cm.ver tableopts_ver_r-Cem.ver tableopts_ver_r-Cae.ver tableopts_ver_r-Caef.ver tableopts_ver_r-CaeF.ver tableopts_ver_r-Cam.ver tableopts_ver_r-Caem.ver
+10 -7
View File
@@ -1,12 +1,15 @@
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
#!/bin/sh
set -eu
# IFS=$'\n\t'
IFS='
'' '
# This script is present to generate the automake _SOURCES variables
# for the tableopts_* tests. It also generates the linking rules for
# each test since automake isn't able to handle the pattern rules that
# would be natural to use. Output is written to standard output for
# inclusion in a Makefile.am, typically by redirecting the output and then an automake include directive.
# inclusion in a Makefile.am, typically by redirecting the output and
# then an automake include directive.
TABLEOPTS_TESTS=""
tableopts_tables=""
@@ -17,12 +20,12 @@ for kind in opt ser ver ; do
testname=tableopts_${kind}_${threading}${opt}.${kind}
if [ "${TABLEOPTS_TESTS}" = "" ] ;then
TABLEOPTS_TESTS=${testname}
if [ "$kind" = "ser" -o "$kind" = "ver" ] ; then
if [ "$kind" = "ser" ] || [ "$kind" = "ver" ] ; then
tableopts_tables=${testname}.tables
fi
else
TABLEOPTS_TESTS="${TABLEOPTS_TESTS} ${testname}"
if [ "$kind" = "ser" -o "$kind" = "ver" ] ; then
if [ "$kind" = "ser" ] || [ "$kind" = "ver" ] ; then
tableopts_tables="${tableopts_tables} ${testname}.tables"
fi
fi
@@ -32,7 +35,7 @@ for kind in opt ser ver ; do
tableopts_${kind}_${threading}_${bare_opt}_${kind}_SOURCES = tableopts.l4
${testname}\$(EXEEXT): tableopts_${kind}_${threading}${opt}.\$(OBJEXT)
\$(LINK) -o \$@ \$<
\$(AM_V_CCLD)\$(LINK) -o \$@ \$<
EOF
done
+9 -6
View File
@@ -1,17 +1,20 @@
#!/bin/bash -vx
set -euo pipefail
#!/bin/sh
set -vx
set -euvx
# testwrapper-direct.sh: run some specialized flex tests that care where they're run from.
# testwrapper-direct.sh: run some specialized flex tests that care where
# they're run from.
while getopts :b:s: OPTION ; do
case $OPTION in
b) BINARY_DIR=$OPTARG ;;
b) BINARY_DIR=$OPTARG ;;
s) SOURCE_DIR=$OPTARG ;;
esac
done
TESTNAME="${!OPTIND}"
shift $(($OPTIND-1))
TESTNAME=$1
INPUT_NAME=`basename ${TESTNAME%.exe}`.txt
INPUT_NAME=`basename "${TESTNAME%.exe}"`.txt
cd ${SOURCE_DIR} && ${BINARY_DIR}/${TESTNAME} ${INPUT_NAME}
+17 -12
View File
@@ -1,9 +1,11 @@
#!/bin/bash -vx
set -euo pipefail
#!/bin/sh
set -vx
set -euvx
# testwrapper.sh: run a flex test, typically called by a Makefile
# Each test will exercise some feature or aspect of flex. Run the test with any input it may need.
# Each test will exercise some feature or aspect of flex. Run the test with any
# input it may need.
INPUT_DIRECTORY=""
INPUT_NAME=""
@@ -15,7 +17,7 @@ while getopts :d:i:rt1 OPTION ; do
case $OPTION in
d) INPUT_DIRECTORY=$OPTARG ;;
i)
if [ "$INPUT_NAME" == "" ] ; then
if [ "$INPUT_NAME" = "" ] ; then
INPUT_NAME="$OPTARG"
else
INPUT_NAME="$INPUT_NAME $OPTARG"
@@ -26,24 +28,27 @@ while getopts :d:i:rt1 OPTION ; do
t) USE_TABLES=1 ;;
1) DO_COMPARISON=1 ;;
esac
done
done
TESTNAME="${!OPTIND}"
shift $(($OPTIND-1))
TESTNAME=$1
INPUT_NAME=${INPUT_NAME:-$INPUT_DIRECTORY/`basename ${TESTNAME%.exe}`.txt}
INPUT_NAME=${INPUT_NAME:-$INPUT_DIRECTORY/`basename "${TESTNAME%.exe}"`.txt}
if [ "$DO_COMPARISON" -eq "1" ] ; then
test `$TESTNAME 1 < $INPUT_NAME` -eq `$TESTNAME < $INPUT_NAME`
if [ $DO_COMPARISON = 1 ] ; then
TEST_OUTPUT=`$TESTNAME < $INPUT_NAME`
REF_OUTPUT=`$TESTNAME 1 < $INPUT_NAME`
test "$TEST_OUTPUT" -eq "$REF_OUTPUT"
exit $?
fi
fi
if [ $INPUT_COUNT -gt 1 ] ; then
$TESTNAME ${USE_TABLES:+${INPUT_DIRECTORY}/${TESTNAME%.exe}.tables} ${INPUT_NAME}
exit $?
fi
fi
if [ -f ${INPUT_NAME} ] ; then
if [ $USE_REDIRECT == 1 ] ; then
if [ $USE_REDIRECT = 1 ] ; then
$TESTNAME ${USE_TABLES:+${INPUT_DIRECTORY}/${TESTNAME%.exe}.tables} < $INPUT_NAME
else
$TESTNAME ${USE_TABLES:+${INPUT_DIRECTORY}/${TESTNAME%.exe}.tables} $INPUT_NAME