Alien-flex
view release on metacpan or search on metacpan
patch/flex-2.6.4.diff view on Meta::CPAN
+ $(MAKE) $(AM_MAKEFLAGS) lib_LTLIBRARIES=libfl.la clean-libLTLIBRARIES \
+ clean-libtool
+
# Create the ChangeLog, but only if we're inside a git working directory
ChangeLog: $(srcdir)/tools/git2cl
@@ -968,7 +991,8 @@ install-exec-hook:
cd $(DESTDIR)$(bindir) && \
$(LN_S) -f flex$(EXEEXT) flex++$(EXEEXT)
-.PHONY: ChangeLog indent
+.PHONY: libfl install-libfl uninstall-libfl clean-libfl \
+ ChangeLog indent
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/NEWS b/NEWS
index 85d900b..2a8c897 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,59 @@
flex NEWS
+* Noteworthy changes in release ?.? (????-??-??) [?]
+
+** build
+
+*** Flex now includes its own <config.h> header before including
+ system headers so that any system specific features detected by
+ configure are taken into account during compilation of flex
+ itself.
+
+*** The flex build system now includes Makefile targets at the top
+ level to allow just building and installing libfl.
+
+*** The flex distribution now includes a file, src/libfl.pc, to allow
+ using pkgconfig to find out what flags to use when building
+ against libfl from flex.
+
+*** Various edge cases, mostly involving out-of-tree builds have been
+ accounted for in the autotools build system.
+
+*** A crash during building on NetBSD has been fixed.
+
+*** Flex is now automatically built by travis-ci. That should increase
+ the visibility of bugs and help prevent regressions.
+
+** documentation
+
+*** a new Ukrainian translation has been submitted from the Translation Project.
+
+** scanner
+
+*** Some memory leaks have been fixed.
+
+*** A long standing bug that effected expressions of the form c{i,j}
+ where 'c' is a character and {i,j} describes the number of times
+ to match against 'c' when case sensitivity was turned on has been
+ fixed.
+
+*** New option: --backup-file allows setting the name of the file
+ written containing backing up information. Useful if you need
+ backing up information from multiple scanners in the same
+ directory.
+
+*** flex emits correct line number directives when line numbers refer
+ to the file containing the line number directives.
+
+*** The options {no,}yy{get,set}_column are now supported.
+
+** test
+
+*** Generating the various tableoptions make rules is now more portable.
+
+*** Tests of the options -C*f and -C*F will now run correctly on
+ filesystems that are not case sensitive.
+
* Noteworthy changes in release 2.6.4 (2017-05-06) [stable]
** build
diff --git a/README.md b/README.md
index b979b01..b388c07 100644
--- a/README.md
+++ b/README.md
@@ -33,7 +33,7 @@ interest:
* 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
+ few other things. See the file examples/README for more
details.
* tests/ - regression tests. See TESTS/README for details.
* po/ - internationalization support files.
@@ -43,7 +43,7 @@ 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
+* 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
@@ -74,12 +74,14 @@ 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 routine:
+From this point on, building flex follows the usual routine:
```bash
configure && make && make install
```
+---
+
This file is part of flex.
This code is derived from software contributed to Berkeley by
diff --git a/aclocal.m4 b/aclocal.m4
index 1b6f735..17e4943 100644
--- a/aclocal.m4
patch/flex-2.6.4.diff view on Meta::CPAN
+#: src/main.c:435
+#, c-format
+msgid "can't open skeleton file %s"
+msgstr "Ðеможливо вÑдкÑиÑи Ñайл-каÑÐºÐ°Ñ %s"
+
+#: src/main.c:450
+msgid "Prefix cannot include '[' or ']'"
+msgstr "ÐÑеÑÑÐºÑ Ð½Ðµ може мÑÑÑиÑи «[» або «]»"
+
+#: src/main.c:474
+msgid "allocation of macro definition failed"
+msgstr "Ðе вдалоÑÑ ÑозмÑÑÑиÑи визнаÑÐµÐ½Ð½Ñ Ð¼Ð°ÐºÑоÑÑ"
+
+#: src/main.c:521
+#, c-format
+msgid "input error reading skeleton file %s"
+msgstr "помилка ÑиÑÐ°Ð½Ð½Ñ Ñайла-каÑкаÑа %s"
+
+#: src/main.c:525
+#, c-format
+msgid "error closing skeleton file %s"
+msgstr "помилка пÑи закÑиÑÑÑ Ñайла-каÑкаÑа %s"
+
+#: src/main.c:711
+#, c-format
+msgid "error creating header file %s"
+msgstr "помилка ÑÑвоÑÐµÐ½Ð½Ñ Ñайла-Ð·Ð°Ð³Ð¾Ð»Ð¾Ð²ÐºÑ %s"
+
+#: src/main.c:719
+#, c-format
+msgid "error writing output file %s"
+msgstr "помилка запиÑÑ Ñ Ð²Ð¸Ñ
Ñдний Ñайл %s"
+
+#: src/main.c:723
+#, c-format
+msgid "error closing output file %s"
+msgstr "помилка закÑиÑÑÑ Ð²Ð¸Ñ
Ñдного Ñайла %s"
+
+#: src/main.c:727
+#, c-format
+msgid "error deleting output file %s"
+msgstr "помилка Ð²Ð¸Ð´Ð°Ð»ÐµÐ½Ð½Ñ Ð²Ð¸Ñ
Ñдного Ñайла %s"
+
+#: src/main.c:734
+#, c-format
+msgid "No backing up.\n"
+msgstr "РезеÑвне копÑÑÐ²Ð°Ð½Ð½Ñ Ð²Ð¸Ð¼ÐºÐ½ÐµÐ½Ð¾.\n"
+
+#: src/main.c:738
+#, c-format
+msgid "%d backing up (non-accepting) states.\n"
+msgstr "ÑезеÑвне копÑÑÐ²Ð°Ð½Ð½Ñ %d (недопÑÑÑимиÑ
) ÑÑанÑв.\n"
+
+#: src/main.c:742
+#, c-format
+msgid "Compressed tables always back up.\n"
+msgstr "СÑвоÑÐµÐ½Ð½Ñ ÑезеÑвниÑ
копÑй ÑÑиÑлиÑ
ÑаблиÑÑ Ð²Ð¸ÐºÐ¾Ð½ÑÑÑÑÑÑ Ð·Ð°Ð²Ð¶Ð´Ð¸.\n"
+
+#: src/main.c:745
+#, c-format
+msgid "error writing backup file %s"
+msgstr "помилка запиÑÑ ÑезеÑÐ²Ð½Ð¾Ñ ÐºÐ¾Ð¿ÑÑ Ñайла %s"
+
+#: src/main.c:749
+#, c-format
+msgid "error closing backup file %s"
+msgstr "помилка закÑиÑÑÑ ÑезеÑÐ²Ð½Ð¾Ñ ÐºÐ¾Ð¿ÑÑ Ñайла %s"
+
+#: src/main.c:754
+#, c-format
+msgid "%s version %s usage statistics:\n"
+msgstr "ÑÑаÑиÑÑика викоÑиÑÑÐ°Ð½Ð½Ñ %s веÑÑÑÑ %s:\n"
+
+#: src/main.c:757
+#, c-format
+msgid " scanner options: -"
+msgstr " паÑамеÑÑи ÑканеÑа: -"
+
+#: src/main.c:836
+#, c-format
+msgid " %d/%d NFA states\n"
+msgstr " %d/%d ÑÑанÑв ÐСÐ\n"
+
+#: src/main.c:838
+#, c-format
+msgid " %d/%d DFA states (%d words)\n"
+msgstr " %d/%d ÑÑанÑв ÐСР(%d ÑлÑв)\n"
+
+#: src/main.c:840
+#, c-format
+msgid " %d rules\n"
+msgstr " %d пÑавил\n"
+
+#: src/main.c:845
+#, c-format
+msgid " No backing up\n"
+msgstr " РезеÑвне копÑÑÐ²Ð°Ð½Ð½Ñ Ð²Ð¸Ð¼ÐºÐ½ÐµÐ½Ð¾\n"
+
+#: src/main.c:849
+#, c-format
+msgid " %d backing-up (non-accepting) states\n"
+msgstr " ÑезеÑвне копÑÑÐ²Ð°Ð½Ð½Ñ %d (недопÑÑÑимиÑ
) ÑÑанÑв\n"
+
+#: src/main.c:854
+#, c-format
+msgid " Compressed tables always back-up\n"
+msgstr " СÑвоÑÐµÐ½Ð½Ñ ÑезеÑвниÑ
копÑй ÑÑиÑлиÑ
ÑаблиÑÑ Ð²Ð¸ÐºÐ¾Ð½ÑÑÑÑÑÑ Ð·Ð°Ð²Ð¶Ð´Ð¸\n"
+
+#: src/main.c:858
+#, c-format
+msgid " Beginning-of-line patterns used\n"
+msgstr " ÐикоÑиÑÑовÑÑÑÑÑÑ Ñаблони поÑаÑÐºÑ ÑÑдка\n"
+
+#: src/main.c:860
+#, c-format
+msgid " %d/%d start conditions\n"
+msgstr " %d/%d поÑаÑковиÑ
Ñмов\n"
+
+#: src/main.c:864
+#, c-format
+msgid " %d epsilon states, %d double epsilon states\n"
+msgstr " %d епÑилон-ÑÑанÑв, %d подвÑйниÑ
епÑилон-ÑÑанÑв\n"
+
+#: src/main.c:868
+#, c-format
+msgid " no character classes\n"
patch/flex-2.6.4.diff view on Meta::CPAN
+#: src/main.c:1560
+#, c-format
+msgid "yymore() entails a minor performance penalty\n"
+msgstr "yymore() ÑпÑиÑинÑе незнаÑне Ð·Ð½Ð¸Ð¶ÐµÐ½Ð½Ñ Ð¿ÑодÑкÑивноÑÑÑ\n"
+
+#: src/main.c:1566
+#, c-format
+msgid "REJECT entails a large performance penalty\n"
+msgstr "REJECT ÑпÑиÑинÑе знаÑне Ð·Ð½Ð¸Ð¶ÐµÐ½Ð½Ñ Ð¿ÑодÑкÑивноÑÑÑ\n"
+
+#: src/main.c:1571
+#, c-format
+msgid "Variable trailing context rules entail a large performance penalty\n"
+msgstr ""
+"ÐÑавила коÑÑÑ Ð¼Ð°ÑÑÑ Ð·Ð°Ð¼Ð¸ÐºÐ°ÑÑий конÑекÑÑ Ð·Ð¼ÑÐ½Ð½Ð¾Ñ Ð´Ð¾Ð²Ð¶Ð¸Ð½Ð¸ знаÑно знижÑÑÑÑ "
+"пÑодÑкÑивнÑÑÑÑ\n"
+
+#: src/main.c:1583
+msgid "REJECT cannot be used with -f or -F"
+msgstr "REJECT не може бÑÑи викоÑиÑÑано Ñазом з -f або -F"
+
+#: src/main.c:1586
+#, c-format
+msgid "%option yylineno cannot be used with REJECT"
+msgstr "%option yylineno не може бÑÑи викоÑиÑÑано з REJECT"
+
+#: src/main.c:1589
+msgid "variable trailing context rules cannot be used with -f or -F"
+msgstr ""
+"ÐÑавила коÑÑÑ Ð¼Ð°ÑÑÑ Ð·Ð°Ð¼Ð¸ÐºÐ°ÑÑий конÑекÑÑ Ð·Ð¼ÑÐ½Ð½Ð¾Ñ Ð´Ð¾Ð²Ð¶Ð¸Ð½Ð¸ не можÑÑÑ Ð±ÑÑи "
+"викоÑиÑÑÐ°Ð½Ñ Ð· -f or -F"
+
+#: src/main.c:1714
+#, c-format
+msgid "%option yyclass only meaningful for C++ scanners"
+msgstr "%option yyclass Ð¼Ð°Ñ ÑÐµÐ½Ñ ÑÑлÑки Ð´Ð»Ñ ÑканеÑÑв C++"
+
+#: src/main.c:1801
+#, c-format
+msgid "Usage: %s [OPTIONS] [FILE]...\n"
+msgstr "ÐикоÑиÑÑаннÑ: %s [ÐÐÐ ÐÐÐТРÐ] [ФÐÐÐ]â¦\n"
+
+#: src/main.c:1804
+#, fuzzy, c-format
+msgid ""
+"Generates programs that perform pattern-matching on text.\n"
+"\n"
+"Table Compression:\n"
+" -Ca, --align trade off larger tables for better memory alignment\n"
+" -Ce, --ecs construct equivalence classes\n"
+" -Cf do not compress tables; use -f representation\n"
+" -CF do not compress tables; use -F representation\n"
+" -Cm, --meta-ecs construct meta-equivalence classes\n"
+" -Cr, --read use read() instead of stdio for scanner input\n"
+" -f, --full generate fast, large scanner. Same as -Cfr\n"
+" -F, --fast use alternate table representation. Same as -CFr\n"
+" -Cem default compression (same as --ecs --meta-ecs)\n"
+"\n"
+"Debugging:\n"
+" -d, --debug enable debug mode in scanner\n"
+" -b, --backup write backing-up information to %s\n"
+" -p, --perf-report write performance report to stderr\n"
+" -s, --nodefault suppress default rule to ECHO unmatched text\n"
+" -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"
+" --tables-file[=FILE] write tables to FILE\n"
+"\n"
+"Scanner behavior:\n"
+" -7, --7bit generate 7-bit scanner\n"
+" -8, --8bit generate 8-bit scanner\n"
+" -B, --batch generate batch scanner (opposite of -I)\n"
+" -i, --case-insensitive ignore case in patterns\n"
+" -l, --lex-compat maximal compatibility with original lex\n"
+" -X, --posix-compat maximal compatibility with POSIX lex\n"
+" -I, --interactive generate interactive scanner (opposite of -B)\n"
+" --yylineno track line count in yylineno\n"
+"\n"
+"Generated code:\n"
+" -+, --c++ generate C++ scanner class\n"
+" -Dmacro[=defn] #define macro defn (default defn is '1')\n"
+" -L, --noline suppress #line directives in scanner\n"
+" -P, --prefix=STRING use STRING as prefix instead of \"yy\"\n"
+" -R, --reentrant generate a reentrant C scanner\n"
+" --bison-bridge scanner for bison pure parser.\n"
+" --bison-locations include yylloc support.\n"
+" --stdinit initialize yyin/yyout to stdin/stdout\n"
+" --nounistd do not include <unistd.h>\n"
+" --noFUNCTION do not generate a particular FUNCTION\n"
+"\n"
+"Miscellaneous:\n"
+" -c do-nothing POSIX option\n"
+" -n do-nothing POSIX option\n"
+" -?\n"
+" -h, --help produce this help message\n"
+" -V, --version report %s version\n"
+msgstr ""
+"ÐенеÑÑÑ Ð¿ÑогÑами, Ñо знаÑ
одÑÑÑ Ñаблони Ñ ÑекÑÑÑ.\n"
+"\n"
+"СÑиÑÐ½ÐµÐ½Ð½Ñ ÑаблиÑÑ:\n"
+" -Ca, --align виÑÑвнÑÑи ÑаблиÑÑ Ñ Ð¿Ð°Ð¼'ÑÑÑ Ð·Ð±ÑлÑÑивÑи ÑозмÑÑ\n"
+" ÑÑ
елеменÑÑв\n"
+" -Ce, --ecs ÑÑвоÑÑваÑи клаÑи еквÑваленÑноÑÑÑ\n"
+" -Cf не ÑÑиÑкаÑи ÑаблиÑÑ; викоÑиÑÑовÑваÑи -f пÑедÑÑавленнÑ\n"
+" -CF не ÑÑиÑкаÑи ÑаблиÑÑ; викоÑиÑÑовÑваÑи -F пÑедÑÑавленнÑ\n"
+" -Cm, --meta-ecs ÑÑвоÑÑваÑи клаÑи меÑа-еквÑваленÑноÑÑÑ\n"
+" -Cr, --read викоÑиÑÑаÑи read() замÑÑÑÑ stdio Ñк\n"
+" вÑ
ÑÐ´Ð½Ñ Ð´Ð°Ð½Ñ ÑканеÑа\n"
+" -f, --full ÑÑвоÑиÑи Ñвидкий, великий ÑканеÑ. Теж Ñаме, Ñо -Cfr\n"
+" -F, --fast заÑÑоÑÑваÑи алÑÑеÑнаÑивний Ð¾Ð¿Ð¸Ñ ÑаблиÑÑ.\n"
+" Теж Ñаме, Ñо -CFr\n"
+" -Cem ÑÑепÑÐ½Ñ ÑÑиÑÐ½ÐµÐ½Ð½Ñ Ð·Ð° замовÑÑваннÑм\n"
+" (Ñеж Ñаме, Ñо --ecs --meta-ecs)\n"
+"\n"
+"ÐалагодженнÑ:\n"
+" -d, --debug ÑвÑмкнÑÑи Ñежим Ð½Ð°Ð»Ð°Ð³Ð¾Ð´Ð¶ÐµÐ½Ð½Ñ ÑканеÑа\n"
+" -b, --backup запиÑаÑи ÑезеÑÐ²Ð½Ñ ÐºÐ¾Ð¿ÑÑ Ð´Ð¾ %s\n"
+" -p, --perf-report запиÑаÑи звÑÑ Ð¿Ñо пÑодÑкÑивнÑÑÑÑ Ð´Ð¾ stderr\n"
+" -s, --nodefault пÑипиниÑи вивÑд ÑекÑÑÑ (ECHO до stdout)\n"
+" Ñо не збÑгаÑÑÑÑÑ Ð· жодним пÑавилом\n"
+" -T, --trace %s повинен запÑÑкаÑиÑÑ Ñ ÑÐµÐ¶Ð¸Ð¼Ñ ÑÑаÑÑваннÑ\n"
+" -w, --nowarn не видаваÑи попеÑедженÑ\n"
+" -v, --verbose запиÑаÑи пÑдÑÑÐ¼ÐºÐ¾Ð²Ñ ÑÑаÑиÑÑÐ¸ÐºÑ ÑканеÑа до stdout\n"
+"\n"
+"Файли:\n"
+" -o, --outfile=ФÐÐРвказаÑи Ñм'Ñ Ð²Ð¸Ñ
Ñдного Ñайла\n"
+" -S, --skel=ФÐÐРвказаÑи Ñайл каÑкаÑÑ\n"
+" -t, --stdout запиÑаÑи ÑÐºÐ°Ð½ÐµÑ Ð´Ð¾ stdout замÑÑÑÑ %s\n"
+" --yyclass=ÐÐ'Я Ñм'Ñ ÐºÐ»Ð°ÑÑ C++\n"
+" --header-file=ФÐÐÐ ÑÑвоÑиÑи C Ñайл заголовок ÑканеÑа\n"
+" --tables-file[=ФÐÐÐ] запиÑаÑи ÑаблиÑÑ Ñ Ð¤ÐÐÐ\n"
+"\n"
+"ÐоведÑнка ÑканеÑа:\n"
+" -7, --7bit ÑÑвоÑиÑи 7-бÑÑний ÑканеÑ\n"
+" -8, --8bit ÑÑвоÑиÑи 8-бÑÑний ÑканеÑ\n"
+" -B, --batch ÑÑвоÑиÑи пакеÑний ÑканеÑ\n"
+" (пÑоÑилежна за влаÑÑивоÑÑÑми до опÑÑÑ -I)\n"
+" -i, --case-insensitive ÑгноÑÑваÑи ÑегÑÑÑÑ ÑимволÑв Ñ ÑаблонаÑ
\n"
+" -l, --lex-compat макÑималÑна ÑÑмÑÑнÑÑÑÑ Ð· оÑигÑналÑним lex\n"
+" -X, --posix-compat макÑималÑна ÑÑмÑÑнÑÑÑÑ Ð· POSIX lex\n"
+" -I, --interactive ÑÑвоÑиÑи ÑнÑеÑакÑивний ÑканеÑ\n"
+" (пÑоÑилежна за влаÑÑивоÑÑÑми до опÑÑÑ -B)\n"
+" --yylineno вÑдÑлÑдковÑваÑи ÑиÑло ÑÑдкÑв Ñ yylineno\n"
+"\n"
+"ÐенеÑаÑÑÑ ÐºÐ¾Ð´Ñ:\n"
+" -+, --c++ ÑÑвоÑиÑи C++ ÐºÐ»Ð°Ñ ÑканеÑа\n"
+" -Dmacro[=defn] #define macro defn (за замовÑÑваннÑм defn='1')\n"
+" -L, --noline не ÑÑвоÑÑваÑи #line диÑекÑиви Ð´Ð»Ñ ÑканеÑа\n"
+" -P, --prefix=РЯÐÐРвикоÑиÑÑаÑи РЯÐÐÐ Ñк пÑеÑÑÐºÑ Ð·Ð°Ð¼ÑÑÑÑ Â«yy»\n"
+" -R, --reentrant генеÑÑваÑи ÑеенÑеÑабелÑний C-ÑканеÑ\n"
+" --bison-bridge ÑÐºÐ°Ð½ÐµÑ ÑÑлÑки Ð´Ð»Ñ bison аналÑзаÑоÑÑ\n"
+" --bison-locations додаÑи пÑдÑÑÐ¸Ð¼ÐºÑ yylloc\n"
+" --stdinit ÑнÑÑÑалÑзÑваÑи yyin/yyout до stdin/stdout\n"
+" --noansi-definitions визнаÑÐµÐ½Ð½Ñ ÑÑнкÑÑй Ñ Ð·Ð°ÑÑаÑÑÐ»Ð¾Ð¼Ñ ÑÑилÑ\n"
+" --noansi-prototypes поÑожнÑй ÑпиÑок паÑамеÑÑÑв Ñ Ð¿ÑоÑоÑипаÑ
\n"
+" --nounistd не додаваÑи <unistd.h>\n"
+" --noФУÐÐЦÐЯ не генеÑÑваÑи Ð·Ð°Ð´Ð°Ð½Ñ ÑÑнкÑÑÑ Ð¤Ð£ÐÐЦÐЯ\n"
+"\n"
+"ÐнÑе:\n"
+" -Ñ Ð½ÐµÐ´ÑÑÑий POSIX паÑамеÑÑ\n"
+" -n недÑÑÑий POSIX паÑамеÑÑ\n"
+" -?\n"
+" -h, --help показаÑи ÑÑ Ð´Ð¾Ð²ÑдкÑ\n"
+" -V, --version показаÑи веÑÑÑÑ %s\n"
+
+#: src/misc.c:64
+msgid "allocation of sko_stack failed"
+msgstr "не вдалоÑÑ Ð¾ÑÑимаÑи памâÑÑÑ Ð¿Ñд sko_stack"
+
+#: src/misc.c:100
+#, c-format
+msgid "name \"%s\" ridiculously long"
+msgstr "Ñм'Ñ Â«%s» занадÑо довге"
+
+#: src/misc.c:149 src/misc.c:162
+msgid "memory allocation failed in allocate_array()"
+msgstr "помилка видÑÐ»ÐµÐ½Ð½Ñ Ð¿Ð°Ð¼'ÑÑÑ Ñ allocate_array()"
patch/flex-2.6.4.diff view on Meta::CPAN
@@ -1420,9 +1420,9 @@ void gentabs (void)
yytbl_data_compress (yynxt_tbl);
if (yytbl_data_fwrite (&tableswr, yynxt_tbl) < 0)
flexerror (_("Could not write yynxt_tbl"));
- yytbl_data_destroy (yynxt_tbl);
- yynxt_tbl = NULL;
}
+ yytbl_data_destroy (yynxt_tbl);
+ yynxt_tbl = NULL;
/* End generating yy_nxt */
/* Begin generating yy_chk */
@@ -1454,9 +1454,9 @@ void gentabs (void)
yytbl_data_compress (yychk_tbl);
if (yytbl_data_fwrite (&tableswr, yychk_tbl) < 0)
flexerror (_("Could not write yychk_tbl"));
- yytbl_data_destroy (yychk_tbl);
- yychk_tbl = NULL;
}
+ yytbl_data_destroy (yychk_tbl);
+ yychk_tbl = NULL;
/* End generating yy_chk */
free(acc_array);
diff --git a/src/gettext.h b/src/gettext.h
index ea67f30..3f62961 100644
--- a/src/gettext.h
+++ b/src/gettext.h
@@ -20,7 +20,7 @@
#define _LIBGETTEXT_H 1
/* NLS can be disabled through the configure --disable-nls option. */
-#if ENABLE_NLS
+#ifdef ENABLE_NLS
/* Get declarations of GNU message catalog functions. */
# include <libintl.h>
diff --git a/src/libfl.pc.in b/src/libfl.pc.in
new file mode 100644
index 0000000..8d4240c
--- /dev/null
+++ b/src/libfl.pc.in
@@ -0,0 +1,8 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+
+Name: libfl
+Description: Flex (the fast lexical analyzer) support library
+Version: @PACKAGE_VERSION@
+Libs: -L${libdir} -lfl
diff --git a/src/main.c b/src/main.c
index e5eac44..a4047d7 100644
--- a/src/main.c
+++ b/src/main.c
@@ -117,7 +117,7 @@ struct yytbl_writer tableswr;
char *program_name = "flex";
static const char outfile_template[] = "lex.%s.%s";
-static const char backing_name[] = "lex.backup";
+static const char *backing_name = "lex.backup";
static const char tablesfile_template[] = "lex.%s.tables";
/* From scan.l */
@@ -197,7 +197,7 @@ int flex_main (int argc, char *argv[])
/* Wrapper around flex_main, so flex_main can be built as a library. */
int main (int argc, char *argv[])
{
-#if ENABLE_NLS
+#if defined(ENABLE_NLS) && ENABLE_NLS
#if HAVE_LOCALE_H
setlocale (LC_MESSAGES, "");
setlocale (LC_CTYPE, "");
@@ -648,6 +648,7 @@ void flexend (int exit_status)
"yyget_extra",
"yyget_in",
"yyget_leng",
+ "yyget_column",
"yyget_lineno",
"yyget_lloc",
"yyget_lval",
@@ -670,6 +671,7 @@ void flexend (int exit_status)
"yyset_debug",
"yyset_extra",
"yyset_in",
+ "yyset_column",
"yyset_lineno",
"yyset_lloc",
"yyset_lval",
@@ -994,7 +996,7 @@ void flexinit (int argc, char **argv)
flex_init_regex();
/* Enable C++ if program name ends with '+'. */
- program_name = basename (argv[0]);
+ program_name = argv[0];
if (program_name != NULL &&
program_name[strlen (program_name) - 1] == '+')
@@ -1033,6 +1035,11 @@ void flexinit (int argc, char **argv)
backing_up_report = true;
break;
+ case OPT_BACKUP_FILE:
+ backing_up_report = true;
+ backing_name = arg;
+ break;
+
case OPT_DONOTHING:
break;
@@ -1201,7 +1208,7 @@ void flexinit (int argc, char **argv)
break;
case OPT_VERSION:
- printf (_("%s %s\n"), program_name, flex_version);
+ printf ("%s %s\n", (C_plus_plus ? "flex++" : "flex"), flex_version);
FLEX_EXIT (0);
case OPT_WARN:
@@ -1394,6 +1401,14 @@ void flexinit (int argc, char **argv)
//buf_strdefine (&userdef_buf, "YY_NO_SET_LINENO", "1");
buf_m4_define( &m4defs_buf, "M4_YY_NO_SET_LINENO",0);
break;
+ case OPT_NO_YYGET_COLUMN:
+ //buf_strdefine (&userdef_buf, "YY_NO_GET_COLUMN", "1");
+ buf_m4_define( &m4defs_buf, "M4_YY_NO_GET_COLUMN",0);
+ break;
+ case OPT_NO_YYSET_COLUMN:
+ //buf_strdefine (&userdef_buf, "YY_NO_SET_COLUMN", "1");
+ buf_m4_define( &m4defs_buf, "M4_YY_NO_SET_COLUMN",0);
+ break;
case OPT_NO_YYGET_IN:
//buf_strdefine (&userdef_buf, "YY_NO_GET_IN", "1");
buf_m4_define( &m4defs_buf, "M4_YY_NO_GET_IN",0);
@@ -1817,7 +1832,8 @@ void usage (void)
" -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"
- " --tables-file[=FILE] write tables to FILE\n" "\n"
+ " --tables-file[=FILE] write tables to FILE\n"
+ " --backup-file=FILE write backing-up information to FILE\n" "\n"
"Scanner behavior:\n"
" -7, --7bit generate 7-bit scanner\n"
" -8, --8bit generate 8-bit scanner\n"
@@ -1844,6 +1860,6 @@ void usage (void)
" -?\n"
" -h, --help produce this help message\n"
" -V, --version report %s version\n"),
- backing_name, program_name, outfile_path, program_name);
+ backing_name, "flex", outfile_path, "flex");
}
diff --git a/src/misc.c b/src/misc.c
index ef27833..745e6a8 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -116,15 +116,14 @@ void add_action (const char *new_text)
int len = (int) strlen (new_text);
while (len + action_index >= action_size - 10 /* slop */ ) {
- int new_size = action_size * 2;
- if (new_size <= 0)
+ if (action_size > INT_MAX / 2)
/* Increase just a little, to try to avoid overflow
* on 16-bit machines.
*/
action_size += action_size / 8;
else
- action_size = new_size;
+ action_size = action_size * 2;
action_array =
reallocate_character_array (action_array,
@@ -141,20 +140,24 @@ void add_action (const char *new_text)
void *allocate_array (int size, size_t element_size)
{
- void *mem;
-#if HAVE_REALLOCARRAY
- /* reallocarray has built-in overflow detection */
- mem = reallocarray(NULL, (size_t) size, element_size);
+ void *new_array;
+#if HAVE_REALLOCARR
+ new_array = NULL;
+ if (reallocarr(&new_array, (size_t) size, element_size))
+ flexfatal (_("memory allocation failed in allocate_array()"));
#else
+# if HAVE_REALLOCARRAY
+ new_array = reallocarray(NULL, (size_t) size, element_size);
+# else
+ /* Do manual overflow detection */
size_t num_bytes = (size_t) size * element_size;
- mem = (size && SIZE_MAX / (size_t) size < element_size) ? NULL :
+ new_array = (size && SIZE_MAX / (size_t) size < element_size) ? NULL :
malloc(num_bytes);
+# endif
+ if (!new_array)
+ flexfatal (_("memory allocation failed in allocate_array()"));
#endif
- if (!mem)
patch/flex-2.6.4.diff view on Meta::CPAN
+# if HAVE_REALLOCARRAY
+ new_array = reallocarray(array, (size_t) size, element_size);
+# else
+ /* Do manual overflow detection */
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
+# endif
if (!new_array)
flexfatal (_("attempt to increase array size failed"));
-
+#endif
return new_array;
}
@@ -720,7 +728,10 @@ void skelout (void)
*/
#define cmd_match(s) (strncmp(buf,(s),strlen(s))==0)
- if (buf[1] == '%') {
+ if (buf[1] == '#') {
+ /* %# indicates comment line to be ignored */
+ }
+ else if (buf[1] == '%') {
/* %% is a break point for skelout() */
return;
}
diff --git a/src/mkskel.sh b/src/mkskel.sh
index 1aa59e1..2d6ae9f 100755
--- a/src/mkskel.sh
+++ b/src/mkskel.sh
@@ -48,7 +48,7 @@ sed '/^%#/d
s/m4_/m4preproc_/g
s/a4_/4_/g
s/[\\"]/\\&/g
-s/.*/ "&",/'
+s/[^\r]*/ "&",/'
echo ' 0
};'
diff --git a/src/nfa.c b/src/nfa.c
index 9143cf6..3d9bf24 100644
--- a/src/nfa.c
+++ b/src/nfa.c
@@ -499,6 +499,8 @@ int mkor (int first, int second)
}
}
+ firstst[first] = MIN(firstst[first], firstst[second]);
+
finalst[first] = orend;
return first;
}
diff --git a/src/options.c b/src/options.c
index 366bc2e..e98159c 100644
--- a/src/options.c
+++ b/src/options.c
@@ -62,6 +62,8 @@ optspec_t flexopts[] = {
,
{"--backup", OPT_BACKUP, 0}
, /* Generate backing-up information to lex.backup. */
+ {"--backup-file=FILE", OPT_BACKUP_FILE, 0}
+ , /* Generate backing-up information to FILE. */
{"-B", OPT_BATCH, 0}
,
{"--batch", OPT_BATCH, 0}
@@ -255,6 +257,10 @@ optspec_t flexopts[] = {
,
{"--noyyset_lineno", OPT_NO_YYSET_LINENO, 0}
,
+ {"--noyyget_column", OPT_NO_YYGET_COLUMN, 0}
+ ,
+ {"--noyyset_column", OPT_NO_YYSET_COLUMN, 0}
+ ,
{"--noyyget_in", OPT_NO_YYGET_IN, 0}
,
{"--noyyset_in", OPT_NO_YYSET_IN, 0}
diff --git a/src/options.h b/src/options.h
index 5b51c23..acee275 100644
--- a/src/options.h
+++ b/src/options.h
@@ -46,6 +46,7 @@ enum flexopt_flag_t {
OPT_ALWAYS_INTERACTIVE,
OPT_ARRAY,
OPT_BACKUP,
+ OPT_BACKUP_FILE,
OPT_BATCH,
OPT_BISON_BRIDGE,
OPT_BISON_BRIDGE_LOCATIONS,
@@ -83,6 +84,7 @@ enum flexopt_flag_t {
OPT_NO_YYGET_IN,
OPT_NO_YYGET_LENG,
OPT_NO_YYGET_LINENO,
+ OPT_NO_YYGET_COLUMN,
OPT_NO_YYGET_LLOC,
OPT_NO_YYGET_LVAL,
OPT_NO_YYGET_OUT,
@@ -92,6 +94,7 @@ enum flexopt_flag_t {
OPT_NO_YYSET_EXTRA,
OPT_NO_YYSET_IN,
OPT_NO_YYSET_LINENO,
+ OPT_NO_YYSET_COLUMN,
OPT_NO_YYSET_LLOC,
OPT_NO_YYSET_LVAL,
OPT_NO_YYSET_OUT,
diff --git a/src/regex.c b/src/regex.c
index 38e658b..f4c4163 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -25,10 +25,8 @@
static const char* REGEXP_LINEDIR = "^#line ([[:digit:]]+) \"(.*)\"";
-static const char* REGEXP_BLANK_LINE = "^[[:space:]]*$";
regex_t regex_linedir; /**< matches line directives */
-regex_t regex_blank_line; /**< matches blank lines */
/** Initialize the regular expressions.
@@ -37,8 +35,6 @@ regex_t regex_blank_line; /**< matches blank lines */
bool flex_init_regex(void)
( run in 1.313 second using v1.01-cache-2.11-cpan-119454b85a5 )