diff options
author | Steven Moreland <smoreland@google.com> | 2018-05-29 14:18:06 -0700 |
---|---|---|
committer | Steven Moreland <smoreland@google.com> | 2018-05-30 16:31:02 +0000 |
commit | 94457957c9e112dc635612b6e4fc2a64222fa995 (patch) | |
tree | 7b39141a4e35ace9d02ccb2f6c6b1e801d455e0a | |
parent | f7ef90467cb960cee378cce41238418809c86329 (diff) | |
parent | ab49343b08c933e32de8de78132649f9560a3727 (diff) | |
download | flex-94457957c9e112dc635612b6e4fc2a64222fa995.tar.gz |
Merge commit 'ab49343b08c933e32de8de78132649f9560a3727' into 20180529135747
Flex 2.6.4
Bug: 31194194
Test: hidl_error_test hidl_export_test hidl_hash_test hidl_impl_test
w/ symlink to flex in build-tools from our master branch
Test: $ flex -V
2.6.4
Change-Id: I2c7c13159538150d48c2d8bab66d3b15335c3995
-rw-r--r-- | .gitignore | 41 | ||||
-rw-r--r-- | .prev-version | 1 | ||||
-rw-r--r-- | BUGS | 107 | ||||
-rw-r--r-- | CODE_OF_CONDUCT.md | 5 | ||||
-rw-r--r-- | FlexLexer.h | 206 | ||||
-rw-r--r-- | Makefile.am | 162 | ||||
-rw-r--r-- | NEWS | 226 | ||||
-rw-r--r-- | README | 113 | ||||
-rw-r--r-- | README.md | 109 | ||||
-rw-r--r-- | TODO | 66 | ||||
-rwxr-xr-x | autogen.sh | 23 | ||||
-rw-r--r-- | configure.ac | 175 | ||||
-rw-r--r-- | control.ac | 1 | ||||
-rw-r--r-- | devel/00EXTRACT-ALL-SYMS.sh | 57 | ||||
-rw-r--r-- | devel/README | 2 | ||||
-rw-r--r-- | devel/dump-tables.pl | 22 | ||||
-rw-r--r-- | devel/tables.pl | 165 | ||||
-rw-r--r-- | doc/.gitignore | 42 | ||||
-rw-r--r-- | doc/Makefile.am | 35 | ||||
-rw-r--r-- | doc/flex.texi | 62 | ||||
-rw-r--r-- | examples/fastwc/mywc.c | 2 | ||||
-rw-r--r-- | examples/testxxLexer.l | 6 | ||||
-rw-r--r-- | lib/.gitignore | 3 | ||||
-rw-r--r-- | lib/Makefile.am | 4 | ||||
-rw-r--r-- | lib/lib.c | 7 | ||||
-rwxr-xr-x | lib/malloc.c | 34 | ||||
-rw-r--r-- | lib/realloc.c | 2 | ||||
-rw-r--r-- | m4/.gitignore | 3 | ||||
-rw-r--r-- | m4/Makefile.am | 1 | ||||
-rw-r--r-- | m4/ax_prog_cc_for_build.m4 | 125 | ||||
-rw-r--r-- | po/Makevars | 39 | ||||
-rw-r--r-- | po/POTFILES.in | 35 | ||||
-rw-r--r-- | po/ca.po | 462 | ||||
-rw-r--r-- | po/da.po | 414 | ||||
-rw-r--r-- | po/de.po | 419 | ||||
-rw-r--r-- | po/eo.po | 394 | ||||
-rw-r--r-- | po/es.po | 587 | ||||
-rw-r--r-- | po/fi.po | 432 | ||||
-rw-r--r-- | po/fr.po | 448 | ||||
-rw-r--r-- | po/ga.po | 494 | ||||
-rw-r--r-- | po/hr.po | 366 | ||||
-rw-r--r-- | po/ko.po | 1266 | ||||
-rw-r--r-- | po/nl.po | 416 | ||||
-rw-r--r-- | po/pl.po | 411 | ||||
-rw-r--r-- | po/pt_BR.po | 408 | ||||
-rw-r--r-- | po/ro.po | 470 | ||||
-rw-r--r-- | po/ru.po | 406 | ||||
-rw-r--r-- | po/sr.po | 415 | ||||
-rw-r--r-- | po/sv.po | 862 | ||||
-rw-r--r-- | po/tr.po | 444 | ||||
-rwxr-xr-x | po/update_linguas.sh | 26 | ||||
-rw-r--r-- | po/vi.po | 433 | ||||
-rw-r--r-- | po/zh_CN.po | 825 | ||||
-rw-r--r-- | po/zh_TW.po | 368 | ||||
-rw-r--r-- | src/.gitignore | 12 | ||||
-rw-r--r-- | src/Android.bp (renamed from Android.bp) | 7 | ||||
-rw-r--r-- | src/FlexLexer.h | 220 | ||||
-rw-r--r-- | src/Makefile.am | 168 | ||||
-rw-r--r-- | src/buf.c (renamed from buf.c) | 92 | ||||
-rw-r--r-- | src/ccl.c (renamed from ccl.c) | 23 | ||||
-rw-r--r-- | src/dfa.c (renamed from dfa.c) | 115 | ||||
-rw-r--r-- | src/ecs.c (renamed from ecs.c) | 23 | ||||
-rw-r--r-- | src/filter.c (renamed from filter.c) | 65 | ||||
-rw-r--r-- | src/flex.skl (renamed from flex.skl) | 760 | ||||
-rw-r--r-- | src/flexdef.h (renamed from flexdef.h) | 428 | ||||
-rw-r--r-- | src/flexint.h (renamed from flexint.h) | 4 | ||||
-rw-r--r-- | src/gen.c (renamed from gen.c) | 403 | ||||
-rw-r--r-- | src/gettext.h (renamed from gettext.h) | 0 | ||||
-rw-r--r-- | src/libmain.c (renamed from libmain.c) | 13 | ||||
-rw-r--r-- | src/libyywrap.c (renamed from libyywrap.c) | 2 | ||||
-rw-r--r-- | src/main.c (renamed from main.c) | 231 | ||||
-rw-r--r-- | src/misc.c (renamed from misc.c) | 359 | ||||
-rwxr-xr-x | src/mkskel.sh (renamed from mkskel.sh) | 39 | ||||
-rw-r--r-- | src/nfa.c (renamed from nfa.c) | 61 | ||||
-rw-r--r-- | src/options.c (renamed from options.c) | 9 | ||||
-rw-r--r-- | src/options.h (renamed from options.h) | 6 | ||||
-rw-r--r-- | src/parse.y (renamed from parse.y) | 89 | ||||
-rw-r--r-- | src/regex.c (renamed from regex.c) | 33 | ||||
-rw-r--r-- | src/scan.l (renamed from scan.l) | 369 | ||||
-rw-r--r-- | src/scanflags.c (renamed from scanflags.c) | 12 | ||||
-rw-r--r-- | src/scanopt.c (renamed from scanopt.c) | 165 | ||||
-rw-r--r-- | src/scanopt.h (renamed from scanopt.h) | 19 | ||||
-rw-r--r-- | src/sym.c (renamed from sym.c) | 83 | ||||
-rw-r--r-- | src/tables.c (renamed from tables.c) | 74 | ||||
-rw-r--r-- | src/tables.h (renamed from tables.h) | 2 | ||||
-rw-r--r-- | src/tables_shared.c (renamed from tables_shared.c) | 6 | ||||
-rw-r--r-- | src/tables_shared.h (renamed from tables_shared.h) | 0 | ||||
-rw-r--r-- | src/tblcmp.c (renamed from tblcmp.c) | 92 | ||||
-rw-r--r-- | src/version.h (renamed from version.h) | 0 | ||||
-rw-r--r-- | src/yylex.c (renamed from yylex.c) | 30 | ||||
-rw-r--r-- | tests/.gitignore | 116 | ||||
-rw-r--r-- | tests/Makefile.am | 606 | ||||
-rw-r--r-- | tests/README | 75 | ||||
-rw-r--r-- | tests/TEMPLATE/.gitignore | 8 | ||||
-rw-r--r-- | tests/TEMPLATE/Makefile.am | 50 | ||||
-rw-r--r-- | tests/TEMPLATE/cvsignore | 4 | ||||
-rw-r--r-- | tests/TEMPLATE/parser.y | 61 | ||||
-rw-r--r-- | tests/alloc_extra.l (renamed from tests/test-alloc-extra/scanner.l) | 15 | ||||
-rw-r--r-- | tests/alloc_extra.txt (renamed from tests/test-alloc-extra/test.input) | 0 | ||||
-rw-r--r-- | tests/array_nr.l (renamed from tests/test-array-nr/scanner.l) | 6 | ||||
-rw-r--r-- | tests/array_nr.txt (renamed from tests/TEMPLATE/test.input) | 0 | ||||
-rw-r--r-- | tests/array_r.l (renamed from tests/test-array-r/scanner.l) | 6 | ||||
-rw-r--r-- | tests/array_r.txt (renamed from tests/test-array-nr/test.input) | 0 | ||||
-rw-r--r-- | tests/basic_nr.l (renamed from tests/test-basic-nr/scanner.l) | 8 | ||||
-rw-r--r-- | tests/basic_nr.txt (renamed from tests/test-basic-nr/test.input) | 0 | ||||
-rw-r--r-- | tests/basic_r.l (renamed from tests/test-basic-r/scanner.l) | 16 | ||||
-rw-r--r-- | tests/basic_r.txt (renamed from tests/test-basic-r/test.input) | 0 | ||||
-rw-r--r-- | tests/bison_nr.txt (renamed from tests/test-bison-nr/test.input) | 0 | ||||
-rw-r--r-- | tests/bison_nr_main.c (renamed from tests/test-bison-nr/main.c) | 8 | ||||
-rw-r--r-- | tests/bison_nr_parser.y (renamed from tests/test-bison-nr/parser.y) | 11 | ||||
-rw-r--r-- | tests/bison_nr_scanner.l (renamed from tests/test-bison-nr/scanner.l) | 10 | ||||
-rw-r--r-- | tests/bison_yylloc.txt (renamed from tests/test-bison-yylloc/test.input) | 0 | ||||
-rw-r--r-- | tests/bison_yylloc_main.c (renamed from tests/test-bison-yylval/main.c) | 9 | ||||
-rw-r--r-- | tests/bison_yylloc_parser.y (renamed from tests/test-bison-yylloc/parser.y) | 20 | ||||
-rw-r--r-- | tests/bison_yylloc_scanner.l (renamed from tests/test-bison-yylloc/scanner.l) | 10 | ||||
-rw-r--r-- | tests/bison_yylval.txt (renamed from tests/test-bison-yylval/test.input) | 0 | ||||
-rw-r--r-- | tests/bison_yylval_main.c (renamed from tests/test-bison-yylloc/main.c) | 9 | ||||
-rw-r--r-- | tests/bison_yylval_parser.y (renamed from tests/test-bison-yylval/parser.y) | 12 | ||||
-rw-r--r-- | tests/bison_yylval_scanner.l (renamed from tests/test-bison-yylval/scanner.l) | 12 | ||||
-rw-r--r-- | tests/c_cxx_nr.lll (renamed from tests/test-c-cpp-nr/scanner.l) | 10 | ||||
-rw-r--r-- | tests/c_cxx_nr.txt (renamed from tests/test-array-r/test.input) | 0 | ||||
-rw-r--r-- | tests/c_cxx_r.lll (renamed from tests/test-c-cpp-r/scanner.l) | 12 | ||||
-rw-r--r-- | tests/c_cxx_r.txt (renamed from tests/test-c++-basic/test.input) | 0 | ||||
-rw-r--r-- | tests/ccl.l (renamed from tests/test-ccl/scanner.l) | 6 | ||||
-rw-r--r-- | tests/ccl.txt (renamed from tests/test-ccl/test.input) | 0 | ||||
-rwxr-xr-x | tests/create-test | 33 | ||||
-rw-r--r-- | tests/cxx_basic.ll (renamed from tests/test-c++-basic/scanner.l) | 5 | ||||
-rw-r--r-- | tests/cxx_basic.txt (renamed from tests/test-c++-yywrap/test.input) | 0 | ||||
-rw-r--r-- | tests/cxx_multiple_scanners.txt (renamed from tests/test-c++-multiple-scanners/test.input) | 0 | ||||
-rw-r--r-- | tests/cxx_multiple_scanners_1.ll (renamed from tests/test-c++-multiple-scanners/scanner-1.l) | 2 | ||||
-rw-r--r-- | tests/cxx_multiple_scanners_2.ll (renamed from tests/test-c++-multiple-scanners/scanner-2.l) | 2 | ||||
-rw-r--r-- | tests/cxx_multiple_scanners_main.cc (renamed from tests/test-c++-multiple-scanners/main.cpp) | 0 | ||||
-rw-r--r-- | tests/cxx_restart.ll (renamed from tests/TEMPLATE/scanner.l) | 23 | ||||
-rw-r--r-- | tests/cxx_restart.txt (renamed from tests/test-c-cpp-nr/test.input) | 0 | ||||
-rw-r--r-- | tests/cxx_yywrap.ll (renamed from tests/test-c++-yywrap/scanner.l) | 2 | ||||
-rw-r--r-- | tests/cxx_yywrap.txt (renamed from tests/test-c-cpp-r/test.input) | 0 | ||||
-rw-r--r-- | tests/debug_nr.l (renamed from tests/test-debug-nr/scanner.l) | 6 | ||||
-rw-r--r-- | tests/debug_nr.txt (renamed from tests/test-debug-nr/test.input) | 0 | ||||
-rw-r--r-- | tests/debug_r.l (renamed from tests/test-debug-r/scanner.l) | 16 | ||||
-rw-r--r-- | tests/debug_r.txt (renamed from tests/test-debug-r/test.input) | 0 | ||||
-rw-r--r-- | tests/descriptions | 49 | ||||
-rw-r--r-- | tests/extended.l (renamed from tests/test-extended/scanner.l) | 6 | ||||
-rw-r--r-- | tests/extended.txt (renamed from tests/test-extended/test.input) | 0 | ||||
-rw-r--r-- | tests/header_nr.txt (renamed from tests/test-header-nr/test.input) | 0 | ||||
-rw-r--r-- | tests/header_nr_main.c (renamed from tests/test-header-nr/main.c) | 5 | ||||
-rw-r--r-- | tests/header_nr_scanner.l (renamed from tests/test-header-nr/scanner.l) | 4 | ||||
-rw-r--r-- | tests/header_r.txt (renamed from tests/test-header-r/test.input) | 0 | ||||
-rw-r--r-- | tests/header_r_main.c (renamed from tests/test-top/main.c) | 12 | ||||
-rw-r--r-- | tests/header_r_scanner.l (renamed from tests/test-header-r/scanner.l) | 4 | ||||
-rw-r--r-- | tests/include_by_buffer.direct.l (renamed from tests/test-include-by-buffer/scanner.l) | 17 | ||||
-rw-r--r-- | tests/include_by_buffer.direct.txt | 3 | ||||
-rw-r--r-- | tests/include_by_buffer.direct_2.txt | 3 | ||||
-rw-r--r-- | tests/include_by_buffer.direct_3.txt | 2 | ||||
-rw-r--r-- | tests/include_by_push.direct.l (renamed from tests/test-include-by-push/scanner.l) | 19 | ||||
-rw-r--r-- | tests/include_by_push.direct.txt | 3 | ||||
-rw-r--r-- | tests/include_by_push.direct_2.txt | 3 | ||||
-rw-r--r-- | tests/include_by_push.direct_3.txt | 2 | ||||
-rw-r--r-- | tests/include_by_reentrant.direct.l (renamed from tests/test-include-by-reentrant/scanner.l) | 39 | ||||
-rw-r--r-- | tests/include_by_reentrant.direct.txt | 3 | ||||
-rw-r--r-- | tests/include_by_reentrant.direct_2.txt | 3 | ||||
-rw-r--r-- | tests/include_by_reentrant.direct_3.txt | 2 | ||||
-rw-r--r-- | tests/lineno_nr.l (renamed from tests/test-lineno-nr/scanner.l) | 10 | ||||
-rw-r--r-- | tests/lineno_nr.one.txt (renamed from tests/test-lineno-nr/test.input) | 0 | ||||
-rw-r--r-- | tests/lineno_r.l (renamed from tests/test-lineno-r/scanner.l) | 20 | ||||
-rw-r--r-- | tests/lineno_r.one.txt (renamed from tests/test-lineno-r/test.input) | 0 | ||||
-rw-r--r-- | tests/lineno_trailing.l (renamed from tests/test-lineno-trailing/scanner.l) | 10 | ||||
-rw-r--r-- | tests/lineno_trailing.one.txt (renamed from tests/test-lineno-trailing/test.input) | 0 | ||||
-rw-r--r-- | tests/mem_nr.l (renamed from tests/test-mem-nr/scanner.l) | 18 | ||||
-rw-r--r-- | tests/mem_nr.txt (renamed from tests/test-mem-nr/test.input) | 0 | ||||
-rw-r--r-- | tests/mem_r.l (renamed from tests/test-mem-r/scanner.l) | 36 | ||||
-rw-r--r-- | tests/mem_r.txt (renamed from tests/test-mem-r/test.input) | 0 | ||||
-rw-r--r-- | tests/multiple_scanners_nr_1.l (renamed from tests/test-multiple-scanners-nr/scanner-1.l) | 6 | ||||
-rw-r--r-- | tests/multiple_scanners_nr_2.l (renamed from tests/test-multiple-scanners-nr/scanner-2.l) | 6 | ||||
-rw-r--r-- | tests/multiple_scanners_nr_main.c (renamed from tests/test-multiple-scanners-nr/main.c) | 10 | ||||
-rw-r--r-- | tests/multiple_scanners_r_1.l (renamed from tests/test-multiple-scanners-r/scanner-1.l) | 7 | ||||
-rw-r--r-- | tests/multiple_scanners_r_2.l (renamed from tests/test-multiple-scanners-r/scanner-2.l) | 7 | ||||
-rw-r--r-- | tests/multiple_scanners_r_main.c (renamed from tests/test-multiple-scanners-r/main.c) | 31 | ||||
-rw-r--r-- | tests/no_bison_stub.c | 39 | ||||
-rwxr-xr-x | tests/options.cn | 5 | ||||
-rw-r--r-- | tests/posix.l (renamed from tests/test-posix/scanner.l) | 12 | ||||
-rw-r--r-- | tests/posixly_correct.l (renamed from tests/test-posixly-correct/scanner.l) | 12 | ||||
-rw-r--r-- | tests/prefix_nr.l (renamed from tests/test-prefix-nr/scanner.l) | 6 | ||||
-rw-r--r-- | tests/prefix_nr.txt (renamed from tests/test-prefix-nr/test.input) | 0 | ||||
-rw-r--r-- | tests/prefix_r.l (renamed from tests/test-prefix-r/scanner.l) | 6 | ||||
-rw-r--r-- | tests/prefix_r.txt (renamed from tests/test-prefix-r/test.input) | 0 | ||||
-rw-r--r-- | tests/pthread.l (renamed from tests/test-pthread/scanner.l) | 46 | ||||
-rw-r--r-- | tests/pthread_1.txt (renamed from tests/test-pthread/test-1.input) | 0 | ||||
-rw-r--r-- | tests/pthread_2.txt (renamed from tests/test-pthread/test-2.input) | 0 | ||||
-rw-r--r-- | tests/pthread_3.txt (renamed from tests/test-pthread/test-3.input) | 0 | ||||
-rw-r--r-- | tests/pthread_4.txt (renamed from tests/test-pthread/test-4.input) | 0 | ||||
-rw-r--r-- | tests/pthread_5.txt (renamed from tests/test-pthread/test-5.input) | 0 | ||||
-rw-r--r-- | tests/quote_in_comment.l | 16 | ||||
-rw-r--r-- | tests/quote_in_comment.txt | 1 | ||||
-rw-r--r-- | tests/quotes.l (renamed from tests/test-quotes/scanner.l) | 42 | ||||
-rw-r--r-- | tests/quotes.txt (renamed from tests/test-quotes/test.input) | 0 | ||||
-rw-r--r-- | tests/reject.l4 (renamed from tests/test-reject/scanner.l) | 14 | ||||
-rw-r--r-- | tests/reject.txt (renamed from tests/test-reject/test.input) | 0 | ||||
-rw-r--r-- | tests/rescan_nr.direct.l (renamed from tests/test-rescan-nr/scanner.l) | 14 | ||||
-rw-r--r-- | tests/rescan_nr.direct.txt (renamed from tests/test-rescan-nr/test.input) | 0 | ||||
-rw-r--r-- | tests/rescan_r.direct.l (renamed from tests/test-rescan-r/scanner.l) | 26 | ||||
-rw-r--r-- | tests/rescan_r.direct.txt (renamed from tests/test-rescan-r/test.input) | 0 | ||||
-rw-r--r-- | tests/string_nr.l (renamed from tests/test-string-nr/scanner.l) | 32 | ||||
-rw-r--r-- | tests/string_r.l (renamed from tests/test-string-r/scanner.l) | 46 | ||||
-rw-r--r-- | tests/tableopts.am | 333 | ||||
-rw-r--r-- | tests/tableopts.l4 (renamed from tests/test-table-opts/scanner.l) | 6 | ||||
-rwxr-xr-x | tests/tableopts.sh | 47 | ||||
-rw-r--r-- | tests/tableopts.txt (renamed from tests/test-table-opts/test.input) | 0 | ||||
-rw-r--r-- | tests/test-alloc-extra/.gitignore | 6 | ||||
-rw-r--r-- | tests/test-alloc-extra/Makefile.am | 49 | ||||
-rw-r--r-- | tests/test-array-nr/.gitignore | 7 | ||||
-rw-r--r-- | tests/test-array-nr/Makefile.am | 48 | ||||
-rw-r--r-- | tests/test-array-r/.gitignore | 7 | ||||
-rw-r--r-- | tests/test-array-r/Makefile.am | 45 | ||||
-rw-r--r-- | tests/test-basic-nr/.gitignore | 7 | ||||
-rw-r--r-- | tests/test-basic-nr/Makefile.am | 48 | ||||
-rw-r--r-- | tests/test-basic-r/.gitignore | 7 | ||||
-rw-r--r-- | tests/test-basic-r/Makefile.am | 48 | ||||
-rw-r--r-- | tests/test-bison-nr/.gitignore | 10 | ||||
-rw-r--r-- | tests/test-bison-nr/Makefile.am | 55 | ||||
-rw-r--r-- | tests/test-bison-yylloc/.gitignore | 10 | ||||
-rw-r--r-- | tests/test-bison-yylloc/Makefile.am | 55 | ||||
-rw-r--r-- | tests/test-bison-yylval/.gitignore | 10 | ||||
-rw-r--r-- | tests/test-bison-yylval/Makefile.am | 55 | ||||
-rw-r--r-- | tests/test-c++-basic/.gitignore | 6 | ||||
-rw-r--r-- | tests/test-c++-basic/Makefile.am | 45 | ||||
-rw-r--r-- | tests/test-c++-multiple-scanners/.gitignore | 7 | ||||
-rw-r--r-- | tests/test-c++-multiple-scanners/Makefile.am | 53 | ||||
-rw-r--r-- | tests/test-c++-yywrap/.gitignore | 6 | ||||
-rw-r--r-- | tests/test-c++-yywrap/Makefile.am | 45 | ||||
-rw-r--r-- | tests/test-c-cpp-nr/.gitignore | 5 | ||||
-rw-r--r-- | tests/test-c-cpp-nr/Makefile.am | 45 | ||||
-rw-r--r-- | tests/test-c-cpp-r/.gitignore | 5 | ||||
-rw-r--r-- | tests/test-c-cpp-r/Makefile.am | 45 | ||||
-rw-r--r-- | tests/test-ccl/.gitignore | 9 | ||||
-rw-r--r-- | tests/test-ccl/Makefile.am | 44 | ||||
-rw-r--r-- | tests/test-concatenated-options/.gitignore | 3 | ||||
-rw-r--r-- | tests/test-concatenated-options/Makefile.am | 33 | ||||
-rw-r--r-- | tests/test-debug-nr/.gitignore | 9 | ||||
-rw-r--r-- | tests/test-debug-nr/Makefile.am | 44 | ||||
-rw-r--r-- | tests/test-debug-r/.gitignore | 9 | ||||
-rw-r--r-- | tests/test-debug-r/Makefile.am | 44 | ||||
-rw-r--r-- | tests/test-extended/.gitignore | 9 | ||||
-rw-r--r-- | tests/test-extended/Makefile.am | 44 | ||||
-rw-r--r-- | tests/test-header-nr/.gitignore | 7 | ||||
-rw-r--r-- | tests/test-header-nr/Makefile.am | 53 | ||||
-rw-r--r-- | tests/test-header-r/.gitignore | 6 | ||||
-rw-r--r-- | tests/test-header-r/Makefile.am | 54 | ||||
-rw-r--r-- | tests/test-include-by-buffer/.gitignore | 7 | ||||
-rw-r--r-- | tests/test-include-by-buffer/Makefile.am | 49 | ||||
-rw-r--r-- | tests/test-include-by-buffer/test-1.input | 3 | ||||
-rw-r--r-- | tests/test-include-by-buffer/test-2.input | 3 | ||||
-rw-r--r-- | tests/test-include-by-buffer/test-3.input | 2 | ||||
-rw-r--r-- | tests/test-include-by-push/.gitignore | 7 | ||||
-rw-r--r-- | tests/test-include-by-push/Makefile.am | 49 | ||||
-rw-r--r-- | tests/test-include-by-push/test-1.input | 3 | ||||
-rw-r--r-- | tests/test-include-by-push/test-2.input | 3 | ||||
-rw-r--r-- | tests/test-include-by-push/test-3.input | 2 | ||||
-rw-r--r-- | tests/test-include-by-reentrant/.gitignore | 7 | ||||
-rw-r--r-- | tests/test-include-by-reentrant/Makefile.am | 49 | ||||
-rw-r--r-- | tests/test-include-by-reentrant/test-1.input | 3 | ||||
-rw-r--r-- | tests/test-include-by-reentrant/test-2.input | 3 | ||||
-rw-r--r-- | tests/test-include-by-reentrant/test-3.input | 2 | ||||
-rw-r--r-- | tests/test-linedir-r/.gitignore | 6 | ||||
-rw-r--r-- | tests/test-linedir-r/Makefile.am | 56 | ||||
-rw-r--r-- | tests/test-linedir-r/check-lines.awk | 7 | ||||
-rw-r--r-- | tests/test-linedir-r/main.c | 58 | ||||
-rw-r--r-- | tests/test-linedir-r/scanner.l | 45 | ||||
-rw-r--r-- | tests/test-lineno-nr/.gitignore | 8 | ||||
-rw-r--r-- | tests/test-lineno-nr/Makefile.am | 45 | ||||
-rw-r--r-- | tests/test-lineno-r/.gitignore | 8 | ||||
-rw-r--r-- | tests/test-lineno-r/Makefile.am | 45 | ||||
-rw-r--r-- | tests/test-lineno-trailing/.gitignore | 8 | ||||
-rw-r--r-- | tests/test-lineno-trailing/Makefile.am | 45 | ||||
-rw-r--r-- | tests/test-mem-nr/.gitignore | 9 | ||||
-rw-r--r-- | tests/test-mem-nr/Makefile.am | 44 | ||||
-rw-r--r-- | tests/test-mem-r/.gitignore | 9 | ||||
-rw-r--r-- | tests/test-mem-r/Makefile.am | 44 | ||||
-rw-r--r-- | tests/test-multiple-scanners-nr/.gitignore | 8 | ||||
-rw-r--r-- | tests/test-multiple-scanners-nr/Makefile.am | 54 | ||||
-rw-r--r-- | tests/test-multiple-scanners-r/.gitignore | 10 | ||||
-rw-r--r-- | tests/test-multiple-scanners-r/Makefile.am | 56 | ||||
-rw-r--r-- | tests/test-noansi-nr/.gitignore | 7 | ||||
-rw-r--r-- | tests/test-noansi-nr/Makefile.am | 48 | ||||
-rw-r--r-- | tests/test-noansi-nr/scanner.l | 67 | ||||
-rw-r--r-- | tests/test-noansi-nr/test.input | 5 | ||||
-rw-r--r-- | tests/test-noansi-r/.gitignore | 7 | ||||
-rw-r--r-- | tests/test-noansi-r/Makefile.am | 48 | ||||
-rw-r--r-- | tests/test-noansi-r/scanner.l | 69 | ||||
-rw-r--r-- | tests/test-noansi-r/test.input | 4 | ||||
-rw-r--r-- | tests/test-posix/.gitignore | 9 | ||||
-rw-r--r-- | tests/test-posix/Makefile.am | 45 | ||||
-rw-r--r-- | tests/test-posixly-correct/.gitignore | 9 | ||||
-rw-r--r-- | tests/test-posixly-correct/Makefile.am | 45 | ||||
-rw-r--r-- | tests/test-prefix-nr/.gitignore | 7 | ||||
-rw-r--r-- | tests/test-prefix-nr/Makefile.am | 49 | ||||
-rw-r--r-- | tests/test-prefix-nr/README | 2 | ||||
-rw-r--r-- | tests/test-prefix-r/.gitignore | 7 | ||||
-rw-r--r-- | tests/test-prefix-r/Makefile.am | 49 | ||||
-rw-r--r-- | tests/test-prefix-r/README | 2 | ||||
-rw-r--r-- | tests/test-pthread/.gitignore | 7 | ||||
-rw-r--r-- | tests/test-pthread/Makefile.am | 46 | ||||
-rw-r--r-- | tests/test-quotes/.gitignore | 11 | ||||
-rw-r--r-- | tests/test-quotes/Makefile.am | 47 | ||||
-rw-r--r-- | tests/test-reject/.gitignore | 9 | ||||
-rw-r--r-- | tests/test-reject/Makefile.am | 80 | ||||
-rw-r--r-- | tests/test-rescan-nr/.gitignore | 9 | ||||
-rw-r--r-- | tests/test-rescan-nr/Makefile.am | 47 | ||||
-rw-r--r-- | tests/test-rescan-r/.gitignore | 9 | ||||
-rw-r--r-- | tests/test-rescan-r/Makefile.am | 47 | ||||
-rw-r--r-- | tests/test-string-nr/.gitignore | 7 | ||||
-rw-r--r-- | tests/test-string-nr/Makefile.am | 46 | ||||
-rw-r--r-- | tests/test-string-r/.gitignore | 7 | ||||
-rw-r--r-- | tests/test-string-r/Makefile.am | 46 | ||||
-rw-r--r-- | tests/test-table-opts/.gitignore | 11 | ||||
-rw-r--r-- | tests/test-table-opts/Makefile.am | 132 | ||||
-rw-r--r-- | tests/test-top/.gitignore | 6 | ||||
-rw-r--r-- | tests/test-top/Makefile.am | 54 | ||||
-rw-r--r-- | tests/test-top/test.input | 3 | ||||
-rw-r--r-- | tests/test-yyextra/.gitignore | 7 | ||||
-rw-r--r-- | tests/test-yyextra/Makefile.am | 49 | ||||
-rwxr-xr-x | tests/testwrapper-direct.sh | 20 | ||||
-rwxr-xr-x | tests/testwrapper.sh | 58 | ||||
-rw-r--r-- | tests/top.l (renamed from tests/test-top/scanner.l) | 4 | ||||
-rw-r--r-- | tests/top.txt (renamed from tests/test-linedir-r/test.input) | 0 | ||||
-rw-r--r-- | tests/top_main.c (renamed from tests/test-header-r/main.c) | 12 | ||||
-rw-r--r-- | tests/yyextra.l (renamed from tests/test-yyextra/scanner.l) | 14 | ||||
-rw-r--r-- | tests/yyextra.txt (renamed from tests/test-yyextra/test.input) | 0 | ||||
-rw-r--r-- | to.do/README | 46 | ||||
-rw-r--r-- | to.do/Wilhelms.todo | 711 | ||||
-rw-r--r-- | to.do/Wish-List | 277 | ||||
-rw-r--r-- | to.do/flex.rmail | 4520 | ||||
-rw-r--r-- | to.do/streams.mail | 194 | ||||
-rw-r--r-- | to.do/unicode/FlexLexer.h | 195 | ||||
-rw-r--r-- | to.do/unicode/ccl.c | 149 | ||||
-rw-r--r-- | to.do/unicode/changes.txt | 102 | ||||
-rw-r--r-- | to.do/unicode/ecs.c | 225 | ||||
-rw-r--r-- | to.do/unicode/flex.1 | 4099 | ||||
-rw-r--r-- | to.do/unicode/flex.skl | 1542 | ||||
-rw-r--r-- | to.do/unicode/flexdef.h | 1062 | ||||
-rw-r--r-- | to.do/unicode/gen.c | 1650 | ||||
-rw-r--r-- | to.do/unicode/main.c | 1228 | ||||
-rw-r--r-- | to.do/unicode/misc.c | 894 | ||||
-rw-r--r-- | to.do/unicode/scan.l | 710 | ||||
-rw-r--r-- | to.do/unicode/tblcmp.c | 887 | ||||
-rw-r--r-- | tools/Makefile.am | 2 |
345 files changed, 10557 insertions, 29950 deletions
@@ -1,7 +1,11 @@ +*.orig +*.rej *.tar.bz2 *.tar.gz -.bootstrap +*.tar.lz +*~ .deps +.libs ABOUT-NLS ChangeLog INSTALL @@ -9,34 +13,13 @@ Makefile Makefile.in aclocal.m4 autom4te.cache -compile -conf.in -config.cache -config.guess -config.h +autoscan.log config.log -config.status* -config.sub +config.status configure -depcomp -flex -flex-* -install-sh -missing -mkinstalldirs -parse.c -parse.h -scan.c -skel.c -stamp-* -config.rpath -ylwrap -*.o -.libs -*.lo -*.la +configure.scan +flex-*/ libtool -ltmain.sh -*~ -*.orig -*.rej +stamp-* +m4/ +build-aux/ diff --git a/.prev-version b/.prev-version new file mode 100644 index 0000000..ec1cf33 --- /dev/null +++ b/.prev-version @@ -0,0 +1 @@ +2.6.3 @@ -1,107 +0,0 @@ -This is a list of bugs still in the queue at lex.sf.net at the time we closed -out the project and moved it to flex.sf.net. - -------------------------------------------------------------- - -Some strict compilers warn about a few internal flex variables signedness. They -are bogus warnings and can be ignored, but people send in reports nonethless. - -------------------------------------------------------------- - -The initializer of the yy_transition array in the -generated scanner -contains fewer entries than the declared size of the array. - -Examples include yy_transition[6504] with 6250 entries, -yy_transition[13215] with 12961 entries. This looks -like it -is always 254 fewer entries than the declared size. - -This bug is present in flex 2.5.4a as well. It appears to be harmless. - -------------------------------------------------------------- -The examples in the chapter "Generating C++ Scanners" -contain suspicious code. Attached is a patch that -corrects this, and after these -modifications this example compiles and works. - -------------------------------------------------------------- - -C++ scanners derived from the yyFlexLexer base class -will not compile with flex-2.5.31 because the -<FlexLexer.h> automatically gets included into the -scanner twice. Because yyFlexLexer is now defined by -default even if no prefix is specified, including -FlexLexer.h twice causes the class yyFlexLexer to be -declared twice. In flex-2.5.4 because yyFlexLexer was -not defined by flex in the scanner code, including -FlexLexer.h more than once only declared yyFlexLexer -once. I appreciate that this is because of the M4 -additions to flex, but I can not find a way to stop -flex defining yyFlexLexer if it is not needed. - -Here is an example of a class that will not compile: - -derived_lexer.h: - -#ifndef __derived_lexer__ -#define __derived_lexer__ - -#include <FlexLexer.h> - -class derived_lexer : public yyFlexLexer -{ -public: -derived_lexer(std::istream* arg_yyin = 0) : -yyFlexLexer(arg_yyin){} -int yylex(); -int x; -}; -#endif - -derived_lexer.l: - -%{ -#include "derived_lexer.h" -%} - -%option yyclass="derived_lexer" - -%% -[0-9]+ { -x = atoi(yytext); -} -%% - -main.cpp: - -#include "derived_lexer.h" -#include <fstream> - -int main() -{ -std::ifstream input; -input.open("input"); -derived_lexer lexer(&input); -lexer.yylex(); -} - -------------------------------------------------------------- - -Hi, the anomally is that if I generate a c++ parser it will not make -yy_scan_buffer and friends. -this is happenning on flex version 2.5.4. -Is this the intent, if so how do I make a c++ parser read from my buffer? - -P.S. in c++ it will only generate: -#ifndef YY_NO_SCAN_BUFFER -#endif - - -#ifndef YY_NO_SCAN_STRING -#endif - - -#ifndef YY_NO_SCAN_BYTES -#endif -------------------------------------------------------------- diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..a734e49 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,5 @@ +# Contributor Code of Conduct + +This project adheres to No Code of Conduct. We are all adults. We accept anyone's contributions. Nothing else matters. + +For more information please visit the [No Code of Conduct](https://github.com/domgetter/NCoC) homepage. diff --git a/FlexLexer.h b/FlexLexer.h deleted file mode 100644 index bad4ce0..0000000 --- a/FlexLexer.h +++ /dev/null @@ -1,206 +0,0 @@ -// -*-C++-*- -// FlexLexer.h -- define interfaces for lexical analyzer classes generated -// by flex - -// Copyright (c) 1993 The Regents of the University of California. -// All rights reserved. -// -// This code is derived from software contributed to Berkeley by -// Kent Williams and Tom Epperly. -// -// 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. - -// This file defines FlexLexer, an abstract class which specifies the -// external interface provided to flex C++ lexer objects, and yyFlexLexer, -// which defines a particular lexer class. -// -// If you want to create multiple lexer classes, you use the -P flag -// to rename each yyFlexLexer to some other xxFlexLexer. You then -// include <FlexLexer.h> in your other sources once per lexer class: -// -// #undef yyFlexLexer -// #define yyFlexLexer xxFlexLexer -// #include <FlexLexer.h> -// -// #undef yyFlexLexer -// #define yyFlexLexer zzFlexLexer -// #include <FlexLexer.h> -// ... - -#ifndef __FLEX_LEXER_H -// Never included before - need to define base class. -#define __FLEX_LEXER_H - -#include <iostream> -# ifndef FLEX_STD -# define FLEX_STD std:: -# endif - -extern "C++" { - -struct yy_buffer_state; -typedef int yy_state_type; - -class FlexLexer { -public: - virtual ~FlexLexer() { } - - const char* YYText() const { return yytext; } - int YYLeng() const { return yyleng; } - - virtual void - yy_switch_to_buffer( struct yy_buffer_state* new_buffer ) = 0; - virtual struct yy_buffer_state* - yy_create_buffer( FLEX_STD istream* s, int size ) = 0; - virtual void yy_delete_buffer( struct yy_buffer_state* b ) = 0; - virtual void yyrestart( FLEX_STD istream* s ) = 0; - - virtual int yylex() = 0; - - // Call yylex with new input/output sources. - int yylex( FLEX_STD istream* new_in, FLEX_STD ostream* new_out = 0 ) - { - switch_streams( new_in, new_out ); - return yylex(); - } - - // Switch to new input/output streams. A nil stream pointer - // indicates "keep the current one". - virtual void switch_streams( FLEX_STD istream* new_in = 0, - FLEX_STD ostream* new_out = 0 ) = 0; - - int lineno() const { return yylineno; } - - int debug() const { return yy_flex_debug; } - void set_debug( int flag ) { yy_flex_debug = flag; } - -protected: - char* yytext; - int yyleng; - int yylineno; // only maintained if you use %option yylineno - int yy_flex_debug; // only has effect with -d or "%option debug" -}; - -} -#endif // FLEXLEXER_H - -#if defined(yyFlexLexer) || ! defined(yyFlexLexerOnce) -// Either this is the first time through (yyFlexLexerOnce not defined), -// or this is a repeated include to define a different flavor of -// yyFlexLexer, as discussed in the flex manual. -#define yyFlexLexerOnce - -extern "C++" { - -class yyFlexLexer : public FlexLexer { -public: - // arg_yyin and arg_yyout default to the cin and cout, but we - // only make that assignment when initializing in yylex(). - yyFlexLexer( FLEX_STD istream* arg_yyin = 0, FLEX_STD ostream* arg_yyout = 0 ); - - virtual ~yyFlexLexer(); - - void yy_switch_to_buffer( struct yy_buffer_state* new_buffer ); - struct yy_buffer_state* yy_create_buffer( FLEX_STD istream* s, int size ); - void yy_delete_buffer( struct yy_buffer_state* b ); - void yyrestart( FLEX_STD istream* s ); - - void yypush_buffer_state( struct yy_buffer_state* new_buffer ); - void yypop_buffer_state(); - - virtual int yylex(); - virtual void switch_streams( FLEX_STD istream* new_in, FLEX_STD ostream* new_out = 0 ); - virtual int yywrap(); - -protected: - virtual int LexerInput( char* buf, int max_size ); - virtual void LexerOutput( const char* buf, int size ); - virtual void LexerError( const char* msg ); - - void yyunput( int c, char* buf_ptr ); - int yyinput(); - - void yy_load_buffer_state(); - void yy_init_buffer( struct yy_buffer_state* b, FLEX_STD istream* s ); - void yy_flush_buffer( struct yy_buffer_state* b ); - - int yy_start_stack_ptr; - int yy_start_stack_depth; - int* yy_start_stack; - - void yy_push_state( int new_state ); - void yy_pop_state(); - int yy_top_state(); - - yy_state_type yy_get_previous_state(); - yy_state_type yy_try_NUL_trans( yy_state_type current_state ); - int yy_get_next_buffer(); - - FLEX_STD istream* yyin; // input source for default LexerInput - FLEX_STD ostream* yyout; // output sink for default LexerOutput - - // yy_hold_char holds the character lost when yytext is formed. - char yy_hold_char; - - // Number of characters read into yy_ch_buf. - int yy_n_chars; - - // Points to current character in buffer. - char* yy_c_buf_p; - - int yy_init; // whether we need to initialize - int yy_start; // start state number - - // Flag which is used to allow yywrap()'s to do buffer switches - // instead of setting up a fresh yyin. A bit of a hack ... - int yy_did_buffer_switch_on_eof; - - - size_t yy_buffer_stack_top; /**< index of top of stack. */ - size_t yy_buffer_stack_max; /**< capacity of stack. */ - struct yy_buffer_state ** yy_buffer_stack; /**< Stack as an array. */ - void yyensure_buffer_stack(void); - - // The following are not always needed, but may be depending - // on use of certain flex features (like REJECT or yymore()). - - yy_state_type yy_last_accepting_state; - char* yy_last_accepting_cpos; - - yy_state_type* yy_state_buf; - yy_state_type* yy_state_ptr; - - char* yy_full_match; - int* yy_full_state; - int yy_full_lp; - - int yy_lp; - int yy_looking_for_trail_begin; - - int yy_more_flag; - int yy_more_len; - int yy_more_offset; - int yy_prev_more_offset; -}; - -} - -#endif // yyFlexLexer || ! yyFlexLexerOnce - diff --git a/Makefile.am b/Makefile.am index fc51921..638c549 100644 --- a/Makefile.am +++ b/Makefile.am @@ -27,134 +27,27 @@ # and 7-bit scanners when using uncompressed tables (-f or -F options). # For flex to always generate 8-bit scanners, add "-DDEFAULT_CSIZE=256" # to DEFS. -# -# For Vax/VMS, add "-DVMS" to DEFS. -# -# For MS-DOS, add "-DMS_DOS" to DEFS. See the directory MISC/MSDOS for -# additional info. -AM_YFLAGS = -d ACLOCAL_AMFLAGS = -I m4 -m4 = @M4@ -indent = @INDENT@ - -bin_PROGRAMS = flex -lib_LTLIBRARIES = \ - libfl.la \ - libfl_pic.la - -flex_SOURCES = \ - ccl.c \ - dfa.c \ - ecs.c \ - scanflags.c \ - gen.c \ - main.c \ - misc.c \ - nfa.c \ - parse.y \ - scan.l \ - skel.c \ - sym.c \ - tblcmp.c \ - yylex.c \ - options.c \ - scanopt.c \ - buf.c \ - tables.c \ - tables_shared.c \ - filter.c \ - regex.c - - -LDADD = lib/libcompat.la - -libfl_la_SOURCES = \ - libmain.c \ - libyywrap.c - -libfl_la_LDFLAGS = -no-undefined -version-info @SHARED_VERSION_INFO@ - -libfl_pic_la_SOURCES = \ - libmain.c \ - libyywrap.c - -libfl_pic_la_LDFLAGS = -no-undefined -version-info @SHARED_VERSION_INFO@ - -noinst_HEADERS = \ - flexdef.h \ - flexint.h \ - version.h \ - options.h \ - scanopt.h \ - tables.h \ - tables_shared.h - -include_HEADERS = \ - FlexLexer.h dist_doc_DATA = \ AUTHORS \ COPYING \ NEWS \ ONEWS \ - README \ - TODO + README.md EXTRA_DIST = \ .indent.pro \ - ABOUT-NLS \ - INSTALL \ - autogen.sh \ - flex.skl \ - mkskel.sh \ - config.rpath \ - gettext.h - -BUILT_SOURCES = \ - skel.c + autogen.sh SUBDIRS = \ - lib \ - . \ + src \ doc \ examples \ po \ - tests - -localedir = $(datadir)/locale -AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" -I$(top_srcdir)/intl -LIBS = @LIBINTL@ @LIBS@ - -skel.c: flex.skl mkskel.sh flexint.h tables_shared.h - sed 's/m4_/m4postproc_/g; s/m4preproc_/m4_/g' $(srcdir)/flex.skl | $(m4) -P -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 .` | sed 's/m4postproc_/m4_/g' | $(SHELL) $(srcdir)/mkskel.sh >skel.c - -# Explicitly describe dependencies. -# You can recreate this with `gcc -I. -MM *.c' -buf.o: buf.c flexdef.h flexint.h -ccl.o: ccl.c flexdef.h flexint.h -dfa.o: dfa.c flexdef.h flexint.h tables.h tables_shared.h -ecs.o: ecs.c flexdef.h flexint.h -scanflags.o: scanflags.c flexdef.h flexint.h -gen.o: gen.c flexdef.h flexint.h tables.h tables_shared.h -libmain.o: libmain.c -libyywrap.o: libyywrap.c -main.o: main.c flexdef.h flexint.h version.h options.h scanopt.h \ - tables.h tables_shared.h -misc.o: misc.c flexdef.h flexint.h tables.h tables_shared.h -nfa.o: nfa.c flexdef.h flexint.h -options.o: options.c options.h scanopt.h flexdef.h flexint.h -parse.o: parse.c flexdef.h flexint.h tables.h tables_shared.h -scan.o: scan.c flexdef.h flexint.h parse.h -scanopt.o: scanopt.c flexdef.h flexint.h scanopt.h -skel.o: skel.c flexdef.h flexint.h -sym.o: sym.c flexdef.h flexint.h -tables.o: tables.c flexdef.h flexint.h tables.h tables_shared.h -tables_shared.o: tables_shared.c flexdef.h flexint.h tables.h \ - tables_shared.h -tblcmp.o: tblcmp.c flexdef.h flexint.h -yylex.o: yylex.c flexdef.h flexint.h parse.h -filter.o: filter.c flexdef.h flexint.h + tests \ + tools # Create the ChangeLog, but only if we're inside a git working directory @@ -163,52 +56,11 @@ ChangeLog: $(srcdir)/tools/git2cl $(srcdir)/tools/git2cl > $@ \ ; fi -# Run GNU indent on sources. Don't run this unless all the sources compile cleanly. -# -# Whole idea: -# 1. Check for .indent.pro, otherwise indent will use unknown -# settings, or worse, the GNU defaults.) -# 2. Check that this is GNU indent. -# 3. Make sure to process only the NON-generated .c and .h files. -# 4. Run indent twice per file. The first time is a test. -# Otherwise, indent overwrites your file even if it fails! -indentfiles = \ - buf.c \ - ccl.c \ - dfa.c \ - ecs.c \ - scanflags.c \ - filter.c \ - flexdef.h \ - gen.c \ - libmain.c \ - libyywrap.c \ - main.c \ - misc.c \ - nfa.c \ - options.c \ - options.h \ - regex.c \ - scanopt.c \ - scanopt.h \ - sym.c \ - tables.c \ - tables.h \ - tables_shared.c \ - tables_shared.h \ - tblcmp.c - indent: - if [ -f .indent.pro ] ; then \ - for f in $(indentfiles);\ - do\ - echo indenting $$f ;\ - $(indent) < $$f >/dev/null && indent $$f || echo $$f FAILED to indent ;\ - done \ - fi + 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 @@ -1,9 +1,225 @@ -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 + +** flex internals + +*** a segfalt involving yyrestart(NULL) has been fixed + +*** flex should now handle quoting when mixed with m4 processing correctly + +*** flex handles `[[' and `]]' correctly + +*** flex no longer generates non-ANSI code + +*** more compilation warnings were squashed in generated scanners + +*** prevented a buffer overflow that could occur when input buffers were the exact wrong size + +** test suite + +*** input filenames on MSWindows are now calculated correctly + +*** general code cleanups in a number of tests now make the test suite compile much more cleanly + +** build system + +*** the xz archive has been replaced with an lzip archive + +*** a new option to configure --enable-warnings to encapsulate passing + of warning-related flags which is useful in testing flex + +*** make indent now works for out of source builds -* version 2.5.38 +*** Portability warnings when generating Makefile.in files are now suppressed; they were just noise and the use of GNU extensions in Makefile.{am,in,} was intentional and well known. + +** bugs + +*** resolved gh#67 + +** new sv translation from the translation project + +* version 2.6.1 released 2016-03-01 + +** flex resources + +*** The flex project is now hosted at github. Consider this a "period of transition". In particular, you should start at https://github.com/westes/flex for the flex codebase, issue tracking and pull requests. + +*** New releases of flex are to be found at https://github.com/westes/flex/releases. + +** flex internals + +*** Flex now uses more modern and more standard names for variable types. There's more work to be done on that front yet, though. + +*** A number of compiler warnings have been remedied. + +*** Line directives should now work as expected and be absent when that is expected. + +** test suite + +*** When running the test suite, c++ files are compiled with the c++ header inside the flex distribution, rather than relying on the build system's flex header , which might not be installed yet or which might be out of date with respect to what flex tests expect. + +*** Some portability fixes in the test suite such as opening files for reading in binary mode + +** Building flex + +*** The file src/scan.c asdistributed with flex source is now built with the current version of flex. Occasionally this had to be done manually to pick up new flex features. It's now just a part of flex's build system. + +*** The pdf version of the manual is no longer distributed with flex, although if you have the texinfo package installed, you can still build it. + +*** lots of general build system cleanup + +*** the build system tries a bit harder to find libtoolize and texi2dvi. + +*** When help2man and texi2dvi are missing, the error messages are now much more helpful. + +** bug fixes + +*** resolved github issues #53, #54, #55, #61. + +*** Resolved sf bugs #128, #129, #155, #160, #184, #187, #195. + +* version 2.6.0 released 2015-11-17 + +** User Visible Changes + +*** C++ scanners now use references instead of pointers. See the manual for details. + +*** A number of compiler warnings were addressed, so flex generated scanners should be quieter under compiler warning scenarios. + +*** Allow error reporting routines to accept varying number of arguments + +*** Removed deprecated 'register' storage class specifier + +*** Changeed output formats from octal to hexadecimal + +*** check limits before using array index cclp; resolves sf-166 + +*** Suppress clang warning about empty @param paragraph; resolves sf#158 + +*** Fixed malloc/realloc replacement, resolves sf bug#151. + +*** Adjusted buffer sizes on ia64. + +*** various documentation and code clean up fixes: resolves sf bugs #167, #168, among other patches. + +** Flex Internals + +*** flex is now organized into subdirectories. This keeps the tree neater at the top level and puts like things near each other and unlike things away from each other. + +*** The test suite has been reorganized and is now run with the parallel test suite harness from automake. + +*** Cleaned up the automake parts of the build system to better reflect what automake does on its own. Also added a call to libtoolize in autogen.sh because autoreconf gets confused without a prior run of libtoolize. + +*** po/Makefile now includes a rule to fetch the latest translations from the translation project. "make -f po/Makefile getpo" from the top level of the flex tree will fetch the files. + +*** New da translation from the translation project + +* flex version 2.5.39 released 2014-03-26 + +** no user visible changes in this release + +* version 2.5.38 released 2014-02-14 ** internationalization @@ -522,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 @@ -1,113 +0,0 @@ -This is flex, the fast lexical analyzer generator. - -flex is a tool for generating scanners: programs which recognize -lexical patterns in text. - -More information about flex as well as the latest official release of -flex can be found at: - -http://flex.sourceforge.net/ - -Bug reports should be submitted using the SourceForge Bug Tracker for -flex at: - -http://sourceforge.net/tracker/?group_id=97492&atid=618177 - -The flex codebase is kept in git at: - -https://github.com/westes/flex - -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 - -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: - -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. - -TODO - outstanding bug reports, desired features, etc. - -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 2.69; for handling the build system -automake 1.12.2; for Makefile generation -gettext 0.18; fori18n support -help2man 1.36; to generate the flex man page -tar, gzip, etc.; for packaging of the source distribution -GNU texinfo 498; to build and test the flex manual -GNU indent 2.8; for indenting the flex source the way we want it done - -Once you have all the necessary tools installed, life becomes -simple. To prepare the flex tree for building, run the script: - -$ ./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. - -This file is part of flex. - -This code is derived from software contributed to Berkeley by -Vern Paxson. - -The United States Government has rights in this work pursuant -to contract no. DE-AC03-76SF00098 between the United States -Department of Energy and the University of California. - -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. - - diff --git a/README.md b/README.md new file mode 100644 index 0000000..b979b01 --- /dev/null +++ b/README.md @@ -0,0 +1,109 @@ +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) + +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 + +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: + +* 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, 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. + +Once you have all the necessary tools installed, life becomes +simple. To prepare the flex tree for building, run the script: + +```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 routine: + +```bash +configure && make && make install +``` + +This file is part of flex. + +This code is derived from software contributed to Berkeley by +Vern Paxson. + +The United States Government has rights in this work pursuant +to contract no. DE-AC03-76SF00098 between the United States +Department of Energy and the University of California. + +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. @@ -1,66 +0,0 @@ -* the manual: - -** do an end-to-end proofread of the manual (this is under way, but is - going slowly) - -** pretty up the dvi output; overflows, etc. - -** faq - -*** clean up the faqs section. The information is good; the texinfo - could use some touching up. - -*** index the faq entries - -*** mention that it's possible to use a variable to scan matching - brackets, nested comments etc. - -*** include something about lexing/parsing fortran - -** create a section on flex design, features, etc. - -* getext - -** make sure all flex modules use gettext translation facilities - -*subdirectories - -** in examples/manual, integrate the Makefile.examples into the - Makefile.am - -* test suite - -** integrate the test suite into automake's framework (note that the - test suite can be run from the top level directory with "make - check". Still, we want to get it completely under automake's control.) - -** make test suite more complete - -* generic coding - -** move as much skeleton code as possible out of gen.c and into - flex.skl - -** figure out whether we want to add the capability to have - auto-generated backout rules - -** token-type and token buffer support - -** check if we still need to #undef macros at the end of a header - -** merge yylineno into support for location tracking - -** bug where yylineno is not decremented on REJECT - -** bug where yylineno is counted in trailing context - -* C++ - -** have a separate skeleton for c++ - -** revisit the C++ API. We get requests to make it more complete. - -Local Variables: -Mode: text -mode: outline-minor -End: @@ -24,9 +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 -autoreconf --install --verbose --force +if ! test -f ChangeLog; then + touch ChangeLog +fi +"$LIBTOOLIZE" --install --force +autoreconf --install --force diff --git a/configure.ac b/configure.ac index 2ef26a5..55e774b 100644 --- a/configure.ac +++ b/configure.ac @@ -24,32 +24,74 @@ # autoconf requirements and initialization -AC_INIT([the fast lexical analyser generator], [2.5.38], -[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([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]) SHARED_VERSION_INFO="2:0:0" AC_SUBST(SHARED_VERSION_INFO) -AC_CONFIG_SRCDIR([scan.l]) -AM_INIT_AUTOMAKE([gnu check-news std-options dist-bzip2 dist-xz 1.10]) -AC_CONFIG_HEADER([config.h:conf.in]) -AC_CONFIG_LIBOBJ_DIR([lib]) - # checks for programs AM_GNU_GETTEXT([external]) -AM_GNU_GETTEXT_VERSION([0.18.1]) +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 -LT_INIT AC_PROG_AWK AC_PROG_INSTALL -AC_PATH_PROG(BISON, bison,bison) -AC_PATH_PROG(HELP2MAN, help2man, help2man) +# allow passing a variable `WARNINGFLAGS', +# either when invoking `configure', or when invoking `make' +# default to something useful if GCC was detected + +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], + [ : ${WARNINGFLAGS="-Wall -Wextra -Wmissing-prototypes -Wstrict-prototypes -Wnested-externs -Wold-style-definition -Wredundant-decls -Wconversion -Wno-unused-but-set-variable"} ])]) + +AC_SUBST([WARNINGFLAGS]) + +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 "$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 "$TEXI2DVI" = "\${top_srcdir}/build-aux/missing texi2dvi"], + AC_MSG_WARN(texi2dvi: program not found: building pdf version of manual will not work) + ) # Check for a m4 that supports -P @@ -62,25 +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_HEADER_STDC -AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS([inttypes.h libintl.h limits.h locale.h malloc.h netinet/in.h regex.h stddef.h stdlib.h string.h strings.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 @@ -88,11 +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]) + [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) @@ -106,9 +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 -AC_CHECK_FUNCS([dup2 isascii memset pow regcomp setlocale strchr strtol]) +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 +memset dnl +regcomp dnl +strcasecmp dnl +strchr dnl +strdup dnl +strtol dnl +], [], [AC_MSG_ERROR(required library function not found on your system)]) + +# 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 @@ -116,58 +175,10 @@ doc/Makefile examples/Makefile examples/fastwc/Makefile examples/manual/Makefile -lib/Makefile po/Makefile.in +src/Makefile +tools/Makefile tests/Makefile -tests/TEMPLATE/Makefile -tests/test-array-nr/Makefile -tests/test-array-r/Makefile -tests/test-basic-nr/Makefile -tests/test-basic-r/Makefile -tests/test-bison-yylloc/Makefile -tests/test-bison-yylval/Makefile -tests/test-c-cpp-nr/Makefile -tests/test-c-cpp-r/Makefile -tests/test-header-nr/Makefile -tests/test-header-r/Makefile -tests/test-include-by-buffer/Makefile -tests/test-include-by-push/Makefile -tests/test-include-by-reentrant/Makefile -tests/test-multiple-scanners-nr/Makefile -tests/test-multiple-scanners-r/Makefile -tests/test-noansi-nr/Makefile -tests/test-noansi-r/Makefile -tests/test-prefix-nr/Makefile -tests/test-prefix-r/Makefile -tests/test-pthread/Makefile -tests/test-string-nr/Makefile -tests/test-string-r/Makefile -tests/test-yyextra/Makefile -tests/test-alloc-extra/Makefile -tests/test-lineno-nr/Makefile -tests/test-lineno-trailing/Makefile -tests/test-lineno-r/Makefile -tests/test-linedir-r/Makefile -tests/test-debug-r/Makefile -tests/test-debug-nr/Makefile -tests/test-mem-nr/Makefile -tests/test-mem-r/Makefile -tests/test-posix/Makefile -tests/test-posixly-correct/Makefile -tests/test-table-opts/Makefile -tests/test-c++-basic/Makefile -tests/test-bison-nr/Makefile -tests/test-reject/Makefile -tests/test-c++-multiple-scanners/Makefile -tests/test-top/Makefile -tests/test-rescan-nr/Makefile -tests/test-rescan-r/Makefile -tests/test-quotes/Makefile -tests/test-ccl/Makefile -tests/test-extended/Makefile -tests/test-c++-yywrap/Makefile -tests/test-concatenated-options/Makefile -dnl --new-test-here-- This line is processed by tests/create-test. ) AC_OUTPUT diff --git a/control.ac b/control.ac new file mode 100644 index 0000000..30596cf --- /dev/null +++ b/control.ac @@ -0,0 +1 @@ +XBS-Destinations: sourceforge diff --git a/devel/00EXTRACT-ALL-SYMS.sh b/devel/00EXTRACT-ALL-SYMS.sh deleted file mode 100644 index 0f7d4ae..0000000 --- a/devel/00EXTRACT-ALL-SYMS.sh +++ /dev/null @@ -1,57 +0,0 @@ -# extract all table types from various scanners. We try to get the ones -# that are declared outside '{'. -# hopefully we'll hit them all. -OUTFILE=/tmp/EXTRACT-FLEX-SYMS.$$ -echo > $OUTFILE - -for s in \ - yy_trans_info \ - yy_NUL_trans \ - yy_accept \ - yy_base \ - yy_chk \ - yy_def \ - yy_ec \ - yy_meta \ - yy_nxt \ - yy_rule_can_match_eol \ - yy_rule_linenum \ - yy_start_state_list \ - yy_state_type \ - yy_transition -do - perl -ne \ - ' - BEGIN{ - $s = qq('$s'); - } - s/\b(short|long)\s+int\b/$1/; - s/\b(static|(yy)?const)\b\s+//g; - next unless m/((?:struct\s*)?\w+)\W+$s\s*((?:\[\s*\d*\s*\])+)\s*=/; - $type=$1; - $arr = $2; - $arr =~ s/\d+//g; - $a{$s}->{$type . $arr}= $_; - - END{ - for(sort keys %a){ - print values %{$a{$_}} - } - } - ' \ - tests/test-*/*.c >> $OUTFILE -done - -grep -E 'typedef.*yy_state_type' tests/test-*/*.c | - gawk -F ':' '{print $2}' | - sort | - uniq >> $OUTFILE - -pcregrep '(\w+)[\s*]*yy_(verify|nxt)\s*;' tests/test-*/*.c | - perl -pe 's/^.*?\.c?[\-\:]//;' | - sort | - uniq >> $OUTFILE - -cat $OUTFILE -rm -f $OUTFILE - diff --git a/devel/README b/devel/README deleted file mode 100644 index 01bca86..0000000 --- a/devel/README +++ /dev/null @@ -1,2 +0,0 @@ -This directory contains flex developer junk. -It should not be considered part of the official distribution. diff --git a/devel/dump-tables.pl b/devel/dump-tables.pl deleted file mode 100644 index 1515e18..0000000 --- a/devel/dump-tables.pl +++ /dev/null @@ -1,22 +0,0 @@ -#! /usr/bin/perl -w -# vim:set ft=perl ai si et ts=4 sts=4 sw=4 tw=0: -# USAGE: dump-tables.pl FILE [max-data] -use strict; - -my $dir = $0; -$dir =~ s:/[^/]+$::; -push @INC, $dir; -require "tables.pl"; - -@ARGV == 1 || @ARGV == 2 || die "\nUSAGE: dump-tables.pl FILE [max-data]\n"; -open FD, $ARGV[0] or die "$ARGV[0]: $!"; - -dump_hdr(read_hdr()); -while(!eof FD){ - dump_table(read_table(),$ARGV[1]); -} -close FD; - -1 -__END__ - diff --git a/devel/tables.pl b/devel/tables.pl deleted file mode 100644 index 6e7d507..0000000 --- a/devel/tables.pl +++ /dev/null @@ -1,165 +0,0 @@ -#! /usr/bin/perl -w -# vim:set ft=perl ai si et ts=4 sts=4 sw=4 tw=0: -# THIS FILE IS A LIBRARY, AND MEANT TO BE 'required' BY OTHER SCRIPTS -use strict; -use Class::Struct yytbl_hdr => [ - th_magic => '$', th_magic_offset => '$', - th_hsize => '$', th_hsize_offset => '$', - th_ssize => '$', th_ssize_offset => '$', - th_flags => '$', th_flags_offset => '$', - th_version => '$', th_version_offset => '$', - th_name => '$', th_name_offset => '$' - ]; -use Class::Struct yytbl_data => [ - td_id => '$', td_id_offset => '$', - td_flags => '$', td_flags_offset => '$', - td_hilen => '$', td_hilen_offset => '$', - td_lolen => '$', td_lolen_offset => '$', - td_data => '@', td_data_offset => '$' - ]; - -sub read_hdr { - my $th = new yytbl_hdr; - $th->th_magic_offset(tell FD); - $th->th_magic(read32()); - $th->th_hsize_offset(tell FD); - $th->th_hsize(read32()); - $th->th_ssize_offset(tell FD); - my @a = unpack 'Nna*',readn($th->th_hsize - 8); - $th->th_ssize($a[0]); - $th->th_flags_offset($th->th_ssize_offset + 4); - $th->th_flags($a[1]); - $th->th_version_offset($th->th_flags_offset + 2); - $th->th_version($a[2]); - $th->th_name((split /\0/, $th->th_version)[1]); - $th->th_version((split /\0/, $th->th_version)[0]); - $th->th_name_offset($th->th_version_offset + length($th->th_version) + 1); - - return $th; -} -sub dump_hdr { - my $th = shift; - printf "%04X th_magic: %08X\n",$th->th_magic_offset, $th->th_magic; - printf "%04X th_hsize: \%d\n",$th->th_hsize_offset, $th->th_hsize; - printf "%04X th_ssize: \%d\n",$th->th_ssize_offset, $th->th_ssize; - printf "%04X th_flags: \%d\n",$th->th_flags_offset, $th->th_flags; - printf "%04X th_version: \%s\n",$th->th_version_offset, $th->th_version; - printf "%04X th_name: \%s\n",$th->th_name_offset, $th->th_name; -} - - -sub readn { my $s; read FD, $s, shift; return $s } -sub read32 { my $n; read FD, $n, 4; return unpack 'i', pack 'i', unpack 'N',$n } -sub read16 { my $n; read FD, $n, 2; return unpack 's', pack 's', unpack 'n',$n } -sub read8 { my $n; read FD, $n, 1; return unpack 'c',$n } -sub readstruct { - my $td=shift; - my $r = $::TFLAGS{$td->td_flags & 0x07}->[1]; - return ($r->(), $r->()); -} -sub getreader { - my $td = shift; - return \&readstruct if ($td->td_flags & 0x10); - return $::TFLAGS{$td->td_flags & 0x07}->[1]; -} - -sub read_table { - my $td = new yytbl_data; - printf "HERE: %04X\n", tell FD; - $td->td_id_offset(tell FD); - $td->td_id(read16()); - $td->td_flags_offset(tell FD); - $td->td_flags(read16()); - $td->td_hilen_offset(tell FD); - $td->td_hilen(read32()); - $td->td_lolen_offset(tell FD); - $td->td_lolen(read32()); - $td->td_data_offset(tell FD); - - my $read = getreader($td); - - my $tot = $td->td_lolen * ($td->td_hilen?$td->td_hilen:1); - $tot *=2 if $::TID{$td->td_id}eq 'YYTH_ID_TRANSITION'; - - for(1..$tot){ - my @v = $read->($td); - push @{$td->td_data}, @v; - } - my $pad = pad64(tell FD); - while($pad-- > 0){ read8() } - return $td; -} - -sub dump_table { - my $td = shift; - my $max = shift; - defined($max) or $max = 2**15; - printf "%04X td_id: \%d (\%s)\n", $td->td_id_offset, $td->td_id, $::TID{$td->td_id}; - printf "%04X td_flags: \%0x (\%s)\n",$td->td_flags_offset, $td->td_flags, "@{[TFLAGS($td->td_flags)]}"; - printf "%04X td_hilen: \%d\n", $td->td_hilen_offset, $td->td_hilen; - printf "%04X td_lolen: \%d\n", $td->td_lolen_offset, $td->td_lolen; - - printf "%04X td_data: ", $td->td_data_offset; - foreach( @{$td->td_data} ){ - last if $max-- == 0; - print "$_, "; - } - print "\n"; - return $td; -} - - -sub TFLAGS { - my @s; - my $f = shift; - foreach(keys %::TFLAGS){ - if ($f & $_){ - push @s, $::TFLAGS{$_}->[0] - } - } - return join '|', @s; -} - -sub pad64{ return ((8-((shift)%8))%8) } - -BEGIN { - %::TID = ( - 0x01 => 'YYTD_ID_ACCEPT' , - 0x02 => 'YYTD_ID_BASE' , - 0x03 => 'YYTD_ID_CHK' , - 0x04 => 'YYTD_ID_DEF' , - 0x05 => 'YYTD_ID_EC' , - 0x06 => 'YYTD_ID_META' , - 0x07 => 'YYTD_ID_NUL_TRANS' , - 0x08 => 'YYTD_ID_NXT' , - 0x09 => 'YYTD_ID_RULE_CAN_MATCH_EOL' , - 0x0A => 'YYTD_ID_START_STATE_LIST' , - 0x0B => 'YYTD_ID_TRANSITION', - 0x0C => 'YYTD_ID_ACCLIST'); - - %::TFLAGS = ( - 0x01 => ['YYTD_DATA8',\&read8] , - 0x02 => ['YYTD_DATA16',\&read16] , - 0x04 => ['YYTD_DATA32',\&read32] , - 0x08 => ['YYTD_PTRANS',undef], - 0x10 => ['YYTD_STRUCT',\&readstruct]); -} - -# CODE TO EXTRACT TABLES FROM GENERATED C CODE -sub extract_from_code { - my $nms = qr/yy_(?:accept|base|chk| - def|ec|meta|NUL_trans| - nxt|rule_can_match_eol| - start_state_list|transition)/x; - - while(<FD>){ - next unless m/static\s+yyconst\s+.+yy_($nms)(\[\])?\[(\d+)\]\s*=/; - my $n = $1; - my $dim = defined($2)?2:1; - # TODO - } -} - -1 -__END__ - diff --git a/doc/.gitignore b/doc/.gitignore index c74bc7b..83b0108 100644 --- a/doc/.gitignore +++ b/doc/.gitignore @@ -1,29 +1,27 @@ -*.aux -*.cp -*.cps -*.dvi -*.fn -*.fns -*.hk -*.hks -*.info* -*.ky -*.log -*.op -*.ops -*.pg -*.toc -*.tp -*.tps -*.vr -*.vrs +flex.aux +flex.cp +flex.cps +flex.dvi +flex.fn +flex.fns +flex.hk +flex.hks +flex.info* +flex.ky +flex.log +flex.op +flex.ops +flex.pg +flex.toc +flex.tp +flex.tps +flex.vr +flex.vrs Makefile Makefile.in flex.1 flex.pdf flex.ps -mdate-sh -stamp-* version.texi flex.html -texinfo.tex +flex.t2p diff --git a/doc/Makefile.am b/doc/Makefile.am index 0e23dca..523aa97 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,31 +1,14 @@ -help2man = @HELP2MAN@ +FLEX = $(top_builddir)/src/flex$(EXEEXT) info_TEXINFOS = flex.texi dist_man_MANS = flex.1 -dist_doc_DATA= flex.pdf +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 -$(dist_man_MANS): $(top_srcdir)/main.c - for i in $(dist_man_MANS) ; do \ - $(help2man) --name='$(PACKAGE_NAME)' \ - --section=`echo $$i | sed -e 's/.*\.\([^.]*\)$$/\1/'` \ - ../flex$(EXEEXT) > $$i || rm -f $$i ; \ - done +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=$@ $(FLEX) \ + || rm -f $@ diff --git a/doc/flex.texi b/doc/flex.texi index 07ce3ac..bccab1e 100644 --- a/doc/flex.texi +++ b/doc/flex.texi @@ -296,8 +296,7 @@ Indices @cindex reporting bugs If you find a bug in @code{flex}, please report it using -the SourceForge Bug Tracking facilities which can be found on -@url{http://sourceforge.net/projects/flex,flex's SourceForge Page}. +GitHub's issue tracking facility at @url{https://github.com/westes/flex/issues/} @node Introduction, Simple Examples, Reporting Bugs, Top @chapter Introduction @@ -409,7 +408,7 @@ A somewhat more complicated example: "+"|"-"|"*"|"/" printf( "An operator: %s\n", yytext ); - "{"[\^{}}\n]*"}" /* eat up one-line comments */ + "{"[^{}\n]*"}" /* eat up one-line comments */ [ \t\n]+ /* eat up whitespace */ @@ -895,7 +894,7 @@ And to match a sequence of zero or more repetitions of @samp{foo} and @cindex character classes in patterns In addition to characters and ranges of characters, character classes can also contain @dfn{character class expressions}. These are -expressions enclosed inside @samp{[}: and @samp{:]} delimiters (which +expressions enclosed inside @samp{[:} and @samp{:]} delimiters (which themselves must appear between the @samp{[} and @samp{]} of the character class. Other elements may occur inside the character class, too). The valid expressions are: @@ -1404,7 +1403,7 @@ example, the following is one way to eat up C comments: @verbatim %% "/*" { - register int c; + int c; for ( ; ; ) { @@ -1492,15 +1491,14 @@ the scanning routine using a K&R-style/non-prototyped function declaration, you must terminate the definition with a semi-colon (;). @code{flex} generates @samp{C99} function definitions by -default. However flex does have the ability to generate obsolete, er, -@samp{traditional}, function definitions. This is to support +default. Flex used to have the ability to generate obsolete, er, +@samp{traditional}, function definitions. This was to support bootstrapping gcc on old systems. Unfortunately, traditional definitions prevent us from using any standard data types smaller than -int (such as short, char, or bool) as function arguments. For this -reason, future versions of @code{flex} may generate standard C99 code -only, leaving K&R-style functions to the historians. Currently, if you -do @strong{not} want @samp{C99} definitions, then you must use -@code{%option noansi-definitions}. +int (such as short, char, or bool) as function arguments. Furthermore, +traditional definitions support added extra complexity in the skeleton file. +For this reason, current versions of @code{flex} generate standard C99 code +only, leaving K&R-style functions to the historians. @cindex stdin, default for yyin @cindex yyin @@ -1601,7 +1599,6 @@ Any rule whose pattern is prefixed with @samp{<sc>} will only be active when the scanner is in the @dfn{start condition} named @code{sc}. For example, -@c proofread edit stopped here @example @verbatim <STRING>[^"]* { /* eat up the string body ... */ @@ -1934,9 +1931,9 @@ condition @dfn{scope}. A start condition scope is begun with: @end verbatim @end example -where @code{SCs} is a list of one or more start conditions. Inside the +where @code{<SCs>} is a list of one or more start conditions. Inside the start condition scope, every rule automatically has the prefix -@code{SCs>} applied to it, until a @samp{@}} which matches the initial +@code{<SCs>} applied to it, until a @samp{@}} which matches the initial @samp{@{}. So, for example, @cindex extended scope of start conditions @@ -2185,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(); } @@ -2862,19 +2859,13 @@ calls @code{yylex()} again). @opindex ---option-ansi-definitions @opindex ansi-definitions @item --ansi-definitions, @code{%option ansi-definitions} -instruct flex to generate ANSI C99 definitions for functions. -This option is enabled by default. -If @code{%option noansi-definitions} is specified, then the obsolete style -is generated. +Deprecated, ignored @anchor{option-ansi-prototypes} @opindex ---option-ansi-prototypes @opindex ansi-prototypes @item --ansi-prototypes, @code{%option ansi-prototypes} -instructs flex to generate ANSI C99 prototypes for functions. -This option is enabled by default. -If @code{noansi-prototypes} is specified, then -prototypes will have empty parameter lists. +Deprecated, ignored @anchor{option-bison-bridge} @opindex ---bison-bridge @@ -3765,8 +3756,7 @@ defaults to generating the scanner to the file @file{lex.yy.cc} instead of @file{lex.yy.c}. The generated scanner includes the header file @file{FlexLexer.h}, which defines the interface to two C++ classes. -The first class, -@code{FlexLexer}, +The first class in @file{FlexLexer.h}, @code{FlexLexer}, provides an abstract base class defining the general scanner class interface. It provides the following member functions: @@ -3800,10 +3790,10 @@ returns the current setting of the debugging flag. Also provided are member functions equivalent to @code{yy_switch_to_buffer()}, @code{yy_create_buffer()} (though the -first argument is an @code{istream*} object pointer and not a +first argument is an @code{istream&} object reference and not a @code{FILE*)}, @code{yy_flush_buffer()}, @code{yy_delete_buffer()}, and -@code{yyrestart()} (again, the first argument is a @code{istream*} -object pointer). +@code{yyrestart()} (again, the first argument is a @code{istream&} +object reference). @tindex yyFlexLexer (C++ only) @tindex FlexLexer (C++ only) @@ -3814,9 +3804,12 @@ additional member functions: @table @code @findex yyFlexLexer constructor (C++ only) @item yyFlexLexer( istream* arg_yyin = 0, ostream* arg_yyout = 0 ) +@item yyFlexLexer( istream& arg_yyin, ostream& arg_yyout ) constructs a @code{yyFlexLexer} object using the given streams for input and output. If not specified, the streams default to @code{cin} and -@code{cout}, respectively. +@code{cout}, respectively. @code{yyFlexLexer} does not take ownership of +its stream arguments. It's up to the user to ensure the streams pointed +to remain alive at least as long as the @code{yyFlexLexer} instance. @findex yylex (C++ version) @item virtual int yylex() @@ -3833,11 +3826,13 @@ instead of @code{yyFlexLexer}. In this case, rather than generating @findex switch_streams (C++ only) @item virtual void switch_streams(istream* new_in = 0, ostream* new_out = 0) +@item virtual void switch_streams(istream& new_in, ostream& new_out) reassigns @code{yyin} to @code{new_in} (if non-null) and @code{yyout} to @code{new_out} (if non-null), deleting the previous input buffer if @code{yyin} is reassigned. @item int yylex( istream* new_in, ostream* new_out = 0 ) +@item int yylex( istream& new_in, ostream& new_out ) first switches the input streams via @code{switch_streams( new_in, new_out )} and then returns the value of @code{yylex()}. @end table @@ -3894,7 +3889,7 @@ Here is an example of a simple C++ scanner: int mylineno = 0; %} - %option noyywrap + %option noyywrap c++ string \"[^\n"]+\" @@ -3939,6 +3934,9 @@ Here is an example of a simple C++ scanner: %% + // This include is required if main() is an another source file. + //#include <FlexLexer.h> + int main( int /* argc */, char** /* argv */ ) { FlexLexer* lexer = new yyFlexLexer; @@ -4911,8 +4909,10 @@ custom allocator through @code{yyextra}. %option reentrant /* Initialize the allocator. */ +%{ #define YY_EXTRA_TYPE struct allocator* #define YY_USER_INIT yyextra = allocator_create(); +%} %% .|\n ; diff --git a/examples/fastwc/mywc.c b/examples/fastwc/mywc.c index 92e5a36..b07d5f0 100644 --- a/examples/fastwc/mywc.c +++ b/examples/fastwc/mywc.c @@ -5,7 +5,7 @@ main() { - register int c, cc = 0, wc = 0, lc = 0; + int c, cc = 0, wc = 0, lc = 0; FILE *f = stdin; while ((c = getc(f)) != EOF) { diff --git a/examples/testxxLexer.l b/examples/testxxLexer.l index e2aed33..a3c4735 100644 --- a/examples/testxxLexer.l +++ b/examples/testxxLexer.l @@ -39,13 +39,13 @@ number {num1}|{num2} } } -{number} FLEX_STD cout << "number " << YYText() << '\n'; +{number} std::cout << "number " << YYText() << '\n'; \n mylineno++; -{name} FLEX_STD cout << "name " << YYText() << '\n'; +{name} std::cout << "name " << YYText() << '\n'; -{string} FLEX_STD cout << "string " << YYText() << '\n'; +{string} std::cout << "string " << YYText() << '\n'; %% diff --git a/lib/.gitignore b/lib/.gitignore new file mode 100644 index 0000000..9e23bdd --- /dev/null +++ b/lib/.gitignore @@ -0,0 +1,3 @@ +*.la +*.lo +*.o diff --git a/lib/Makefile.am b/lib/Makefile.am deleted file mode 100644 index 391465f..0000000 --- a/lib/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -noinst_LTLIBRARIES = libcompat.la -libcompat_la_SOURCES = lib.c -libcompat_la_LIBADD = $(LIBOBJS) - diff --git a/lib/lib.c b/lib/lib.c deleted file mode 100644 index a8ff70f..0000000 --- a/lib/lib.c +++ /dev/null @@ -1,7 +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. */ - -void do_nothing(){ return;} - diff --git a/lib/malloc.c b/lib/malloc.c index d4c605f..75e8ef9 100755 --- a/lib/malloc.c +++ b/lib/malloc.c @@ -1,17 +1,17 @@ - #include <config.h>
- #undef malloc
-
- #include <sys/types.h>
-
- void *malloc ();
-
- /* Allocate an N-byte block of memory from the heap.
- If N is zero, allocate a 1-byte block. */
-
- void *
- rpl_malloc (size_t n)
- {
- if (n == 0)
- n = 1;
- return malloc (n);
- }
+ #include <config.h> + #undef malloc + + #include <sys/types.h> + + void *malloc (); + + /* Allocate an N-byte block of memory from the heap. + If N is zero, allocate a 1-byte block. */ + + void * + rpl_malloc (size_t n) + { + if (n == 0) + n = 1; + return malloc (n); + } diff --git a/lib/realloc.c b/lib/realloc.c index d7bb629..79bfd28 100644 --- a/lib/realloc.c +++ b/lib/realloc.c @@ -1,4 +1,6 @@ #include <config.h> +#undef realloc +#undef malloc #include <stdlib.h> diff --git a/m4/.gitignore b/m4/.gitignore deleted file mode 100644 index 0063d7a..0000000 --- a/m4/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -*.m4 -Makefile -Makefile.in diff --git a/m4/Makefile.am b/m4/Makefile.am deleted file mode 100644 index 109e92d..0000000 --- a/m4/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -EXTRA_DIST = codeset.m4 gettext.m4 glibc21.m4 iconv.m4 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4 lcmessage.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 progtest.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4 nls.m4 po.m4 diff --git a/m4/ax_prog_cc_for_build.m4 b/m4/ax_prog_cc_for_build.m4 new file mode 100644 index 0000000..77fd346 --- /dev/null +++ b/m4/ax_prog_cc_for_build.m4 @@ -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 +]) diff --git a/po/Makevars b/po/Makevars index 2ac7ee8..cff165f 100644 --- a/po/Makevars +++ b/po/Makevars @@ -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 diff --git a/po/POTFILES.in b/po/POTFILES.in index 4b03de7..62a928e 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1,18 +1,17 @@ -buf.c -ccl.c -dfa.c -ecs.c -gen.c -libmain.c -libyywrap.c -main.c -misc.c -nfa.c -options.c -parse.y -scan.l -scanopt.c -skel.c -sym.c -tblcmp.c -yylex.c +src/buf.c +src/ccl.c +src/dfa.c +src/ecs.c +src/gen.c +src/libmain.c +src/libyywrap.c +src/main.c +src/misc.c +src/nfa.c +src/options.c +src/parse.y +src/scan.l +src/scanopt.c +src/sym.c +src/tblcmp.c +src/yylex.c @@ -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-12-04 17:36+0100\n" "Last-Translator: Jordi Mallach <jordi@sindominio.net>\n" "Language-Team: Catalan <ca@dodds.net>\n" @@ -15,43 +15,44 @@ 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" -#: buf.c:78 +#: src/buf.c:79 msgid "Allocation of buffer to print string failed" msgstr "Ha fallat l'assignació d'un búfer per imprimir la cadena" -#: buf.c:100 +#: src/buf.c:107 msgid "Allocation of buffer for line directive failed" msgstr "Ha fallat l'assignació d'un buffer per a la directiva de lÃnia" -#: buf.c:177 +#: src/buf.c:177 msgid "Allocation of buffer for m4 def failed" msgstr "Ha fallat l'assignació d'un búfer per la definició m4" -#: buf.c:197 +#: src/buf.c:198 msgid "Allocation of buffer for m4 undef failed" msgstr "Ha fallat l'assignació d'un búfer per la indefinició m4" -#: dfa.c:61 +#: src/dfa.c:59 #, c-format msgid "State #%d is non-accepting -\n" msgstr "L'estat #%d és no-acceptar -\n" -#: dfa.c:124 +#: src/dfa.c:119 msgid "dangerous trailing context" msgstr "Context posterior perillós" -#: dfa.c:166 +#: src/dfa.c:159 #, c-format msgid " associated rule line numbers:" msgstr " números de lÃnia associats a la regla:" -#: dfa.c:202 +#: src/dfa.c:193 #, c-format msgid " out-transitions: " msgstr " fi de transicions: " -#: dfa.c:210 +#: src/dfa.c:201 #, c-format msgid "" "\n" @@ -60,11 +61,11 @@ msgstr "" "\n" " transicions de bloqueig: EOF " -#: dfa.c:341 +#: src/dfa.c:331 msgid "consistency check failed in epsclosure()" msgstr "la comprovació de consistència ha fallat en epsclosure()" -#: dfa.c:429 +#: src/dfa.c:419 msgid "" "\n" "\n" @@ -76,24 +77,24 @@ msgstr "" "Bolcat AFD:\n" "\n" -#: dfa.c:604 +#: src/dfa.c:587 msgid "could not create unique end-of-buffer state" msgstr "no s'ha pogut crear un estat únic de final-de-búfer" -#: dfa.c:625 +#: src/dfa.c:608 #, c-format msgid "state # %d:\n" msgstr "estat # %d:\n" -#: dfa.c:785 +#: src/dfa.c:768 msgid "Could not write yynxt_tbl[][]" msgstr "No s'ha pogut escriure yynxt_tbl[][]" -#: dfa.c:1049 +#: src/dfa.c:1028 msgid "bad transition character detected in sympartition()" msgstr "carà cter de transició incorrecte detectat en sympartition()" -#: gen.c:478 +#: src/gen.c:480 msgid "" "\n" "\n" @@ -105,29 +106,29 @@ msgstr "" "Classes d'equivalència:\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 "l'estat # %d accepta: [%d]\n" -#: gen.c:1110 +#: src/gen.c:1115 #, c-format msgid "state # %d accepts: " msgstr "l'estat # %d accepta: " -#: gen.c:1157 +#: src/gen.c:1162 msgid "Could not write yyacclist_tbl" msgstr "No s'ha pogut escriure yyacclist_tbl" -#: gen.c:1233 +#: src/gen.c:1236 msgid "Could not write yyacc_tbl" msgstr "No s'ha pogut escriure 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 "No s'ha pogut escriure ecstbl" -#: gen.c:1271 +#: src/gen.c:1271 msgid "" "\n" "\n" @@ -137,287 +138,293 @@ msgstr "" "\n" "Classes de metaequivalència:\n" -#: gen.c:1293 +#: src/gen.c:1293 msgid "Could not write yymeta_tbl" msgstr "No s'ha pogut escriure yymeta_tbl" -#: gen.c:1354 +#: src/gen.c:1352 msgid "Could not write yybase_tbl" msgstr "No s'ha pogut escriure yybase_tbl" -#: gen.c:1388 +#: src/gen.c:1384 msgid "Could not write yydef_tbl" msgstr "No s'ha pogut escriure yydef_tbl" -#: gen.c:1428 +#: src/gen.c:1422 msgid "Could not write yynxt_tbl" msgstr "No s'ha pogut escriure yynxt_tbl" -#: gen.c:1464 +#: src/gen.c:1456 msgid "Could not write yychk_tbl" msgstr "No s'ha pogut escriure yychk_tbl" -#: gen.c:1618 gen.c:1647 +#: src/gen.c:1608 src/gen.c:1637 msgid "Could not write ftbl" msgstr "No s'ha pogut escriure ftbl" -#: gen.c:1624 +#: src/gen.c:1614 msgid "Could not write ssltbl" msgstr "No s'ha pogut escriure ssltbl" -#: gen.c:1675 +#: src/gen.c:1665 msgid "Could not write eoltbl" msgstr "No s'ha pogut escriure eoltbl" -#: gen.c:1735 +#: src/gen.c:1722 msgid "Could not write yynultrans_tbl" msgstr "No s'ha pogut escriure yynultrans_tbl" -#: main.c:189 +#: src/main.c:178 msgid "rule cannot be matched" msgstr "no es pot satisfer la regla" -#: main.c:194 +#: src/main.c:183 msgid "-s option given but default rule can be matched" msgstr "S'ha especificat l'opció -s però es pot aplicar la regla per defecte" -#: main.c:234 +#: src/main.c:221 msgid "Can't use -+ with -l option" msgstr "No es pot fer servir -+ amb l'opció -l" -#: main.c:237 +#: src/main.c:224 msgid "Can't use -f or -F with -l option" msgstr "No es pot fer servir -f o -F amb l'opció -l" -#: main.c:241 +#: src/main.c:228 msgid "Can't use --reentrant or --bison-bridge with -l option" msgstr "No es pot fer servir --reentrant o --bison-bridge amb l'opció -l" -#: main.c:278 +#: src/main.c:260 msgid "-Cf/-CF and -Cm don't make sense together" msgstr "-Cf/-CF i -Cm no tenen sentit juntes" -#: main.c:281 +#: src/main.c:263 msgid "-Cf/-CF and -I are incompatible" msgstr "-Cf/-CF i -I són incompatibles" -#: main.c:285 +#: src/main.c:267 msgid "-Cf/-CF are incompatible with lex-compatibility mode" msgstr "-Cf/-CF són incompatibles amb el mode de compatibilitat amb lex" -#: main.c:290 +#: src/main.c:272 msgid "-Cf and -CF are mutually exclusive" msgstr "-Cf i -CF són mútuament excloents" -#: main.c:294 +#: src/main.c:276 msgid "Can't use -+ with -CF option" msgstr "No es pot fer servir -+ amb l'opció -CF" -#: main.c:297 +#: src/main.c:279 #, c-format msgid "%array incompatible with -+ option" msgstr "%array és incompatible amb l'opció -+" -#: main.c:302 +#: src/main.c:284 msgid "Options -+ and --reentrant are mutually exclusive." msgstr "Les opcions -+ i --reentrant són mútuament excloents" -#: main.c:305 +#: src/main.c:287 msgid "bison bridge not supported for the C++ scanner." msgstr "No es suporta «bison bridge» per a l'analitzador de C++" -#: main.c:360 main.c:406 +#: src/main.c:336 src/main.c:419 #, c-format msgid "could not create %s" msgstr "no s'ha pogut crear %s" -#: main.c:419 +#: src/main.c:431 msgid "could not write tables header" msgstr "no s'ha pogut crear la capçalera de les taules" -#: main.c:423 +#: src/main.c:435 #, c-format msgid "can't open skeleton file %s" msgstr "No es pot obrir el fitxer d'esquema %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 "Ha fallat l'assignació de la definició de la macro" -#: main.c:507 +#: src/main.c:521 #, c-format msgid "input error reading skeleton file %s" msgstr "error d'entrada al llegir el fitxer d'esquema %s" -#: main.c:511 +#: src/main.c:525 #, c-format msgid "error closing skeleton file %s" msgstr "s'ha produït un error en tancar el fitxer d'esquema %s" -#: main.c:696 +#: src/main.c:709 #, c-format msgid "error creating header file %s" msgstr "s'ha produït un error en crear el fitxer de capçalera %s" -#: main.c:704 +#: src/main.c:717 #, c-format msgid "error writing output file %s" msgstr "s'ha produït un error en escriure el fitxer d'eixida %s" -#: main.c:708 +#: src/main.c:721 #, c-format msgid "error closing output file %s" msgstr "s'ha produït un error en tancar el fitxer d'eixida %s" -#: main.c:712 +#: src/main.c:725 #, c-format msgid "error deleting output file %s" msgstr "s'ha produït un error en suprimir el fitxer d'eixida %s" -#: main.c:719 +#: src/main.c:732 #, c-format msgid "No backing up.\n" msgstr "No hi ha retrocés.\n" -#: main.c:723 +#: src/main.c:736 #, c-format msgid "%d backing up (non-accepting) states.\n" msgstr "%d estats de retrocés (no-acceptació).\n" -#: main.c:727 +#: src/main.c:740 #, c-format msgid "Compressed tables always back up.\n" msgstr "Les taules comprimides sempre impliquen un retard.\n" -#: main.c:730 +#: src/main.c:743 #, c-format msgid "error writing backup file %s" msgstr "s'ha produït un error en escriure el fitxer de còpia de seguretat %s" -#: main.c:734 +#: src/main.c:747 #, c-format msgid "error closing backup file %s" msgstr "s'ha produït un error en tancar el fitxer de còpia de seguretat %s" -#: main.c:739 +#: src/main.c:752 #, c-format msgid "%s version %s usage statistics:\n" msgstr "estadÃstiques d'ús de %s versió %s:\n" -#: main.c:742 +#: src/main.c:755 #, c-format msgid " scanner options: -" msgstr " opcions de l'analitzador: -" # NFA == Autómata finit no-determinista. jm -#: main.c:821 +#: src/main.c:834 #, c-format msgid " %d/%d NFA states\n" msgstr " %d/%d estats AFN\n" # DFA == Autómata finit deterministic. jm -#: main.c:823 +#: src/main.c:836 #, c-format msgid " %d/%d DFA states (%d words)\n" msgstr " %d/%d estats AFD (%d paraules)\n" -#: main.c:825 +#: src/main.c:838 #, c-format msgid " %d rules\n" msgstr " %d regles\n" -#: main.c:830 +#: src/main.c:843 #, c-format msgid " No backing up\n" msgstr " Sense retrocés\n" -#: main.c:834 +#: src/main.c:847 #, c-format msgid " %d backing-up (non-accepting) states\n" msgstr " %d estats de retrocés (no-acceptació)\n" # Es refereix a còpia de seguretat, o retrocés? jm -#: main.c:839 +#: src/main.c:852 #, c-format msgid " Compressed tables always back-up\n" msgstr " Sempre es realitza còpia de seguretat de les taules comprimides\n" -#: main.c:843 +#: src/main.c:856 #, c-format msgid " Beginning-of-line patterns used\n" msgstr " Utilitzats patrons de principi-de-lÃnia\n" -#: main.c:845 +#: src/main.c:858 #, c-format msgid " %d/%d start conditions\n" msgstr " %d/%d condicions d'activació\n" -#: main.c:849 +#: src/main.c:862 #, c-format msgid " %d epsilon states, %d double epsilon states\n" msgstr " %d estats èpsilon, %d estats doble èpsilon\n" -#: main.c:853 +#: src/main.c:866 #, c-format msgid " no character classes\n" msgstr " sense classes de carà cter\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 " les classes de carà cters %d/%d necessitaren %d/%d paraules de magatzement, %d reutilitzades\n" +msgstr "" +" les classes de carà cters %d/%d necessitaren %d/%d paraules de magatzement, " +"%d reutilitzades\n" -#: main.c:862 +#: src/main.c:875 #, c-format msgid " %d state/nextstate pairs created\n" msgstr " %d parells estat/estat-següent creats\n" -#: main.c:865 +#: src/main.c:878 #, c-format msgid " %d/%d unique/duplicate transitions\n" msgstr " %d/%d transicions úniques/duplicades\n" -#: main.c:870 +#: src/main.c:883 #, c-format msgid " %d table entries\n" msgstr " %d entrades de la taula\n" -#: main.c:878 +#: src/main.c:891 #, c-format msgid " %d/%d base-def entries created\n" msgstr " %d/%d entrades base-def creades\n" -#: main.c:882 +#: src/main.c:895 #, c-format msgid " %d/%d (peak %d) nxt-chk entries created\n" msgstr " %d/%d (pic %d) entrades nxt-chk creades\n" -#: main.c:886 +#: src/main.c:899 #, c-format msgid " %d/%d (peak %d) template nxt-chk entries created\n" msgstr " %d/%d (pic %d) entrades de plantilla nxt-chk creades\n" -#: main.c:890 +#: src/main.c:903 #, c-format msgid " %d empty table entries\n" msgstr " %d entrades de la tabla buides\n" -#: main.c:892 +#: src/main.c:905 #, c-format msgid " %d protos created\n" msgstr " %d prototips creats\n" -#: main.c:895 +#: src/main.c:908 #, c-format msgid " %d templates created, %d uses\n" msgstr " %d plantilles creades, %d usos\n" -#: main.c:903 +#: src/main.c:916 #, c-format msgid " %d/%d equivalence classes created\n" msgstr " %d/%d classes d'equivalència creades\n" -#: main.c:911 +#: src/main.c:924 #, c-format msgid " %d/%d meta-equivalence classes created\n" msgstr " %d/%d classes de meta-equivalència creades\n" @@ -426,105 +433,115 @@ msgstr " %d/%d classes de meta-equivalència creades\n" # segons un company de treballa que estudia a la UOC, allà # les "hashtables" s'anomenen "taules de DISPERSIÓ". En aquest context # no sé que dir-te. ear -#: main.c:917 +#: src/main.c:930 #, c-format msgid " %d (%d saved) hash collisions, %d DFAs equal\n" msgstr " %d (%d desades) col·lisions d'ubicació («hash»), %d AFD iguals\n" -#: main.c:919 +#: src/main.c:932 #, c-format msgid " %d sets of reallocations needed\n" msgstr " es necessiten %d conjunts de relocalització\n" -#: main.c:921 +#: src/main.c:934 #, c-format msgid " %d total table entries needed\n" msgstr " es necessiten %d entrades totals de la taula\n" -#: main.c:998 +#: src/main.c:1008 #, c-format msgid "Internal error. flexopts are malformed.\n" msgstr "Error intern. Els flexopts estan malformats.\n" -#: main.c:1008 +#: src/main.c:1018 #, c-format msgid "Try `%s --help' for more information.\n" msgstr "Proveu «%s --help» per a obtindre més informació.\n" -#: main.c:1065 +#: src/main.c:1075 #, c-format msgid "unknown -C option '%c'" msgstr "opció de -C desconeguda «%c»" -#: main.c:1194 +#: src/main.c:1204 #, c-format msgid "%s %s\n" msgstr "%s %s\n" # Hmm. No se si açò està be. jm -#: main.c:1469 +#: src/main.c:1476 msgid "fatal parse error" msgstr "s'ha produït un error fatal d'anà lisi sintà ctic" -#: main.c:1501 +#: src/main.c:1508 #, c-format msgid "could not create backing-up info file %s" msgstr "no s'ha pogut crear un fitxer d'informació del retrocés %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 l'opció de compatibilitat amb AT&T lex implica una penalització del rendiment molt gran\n" +msgstr "" +"-l l'opció de compatibilitat amb AT&T lex implica una penalització del " +"rendiment molt gran\n" -#: main.c:1525 +#: src/main.c:1532 #, c-format msgid " and may be the actual source of other reported performance penalties\n" -msgstr " i pot ser l'origen real d'altres penalitzacions del rendiment notificades\n" +msgstr "" +" i pot ser l'origen real d'altres penalitzacions del rendiment notificades\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" -msgstr "l'%%opció yylineno implica una penalització del rendiment NOMÉS en regles que poden fer coincidir carà cters de nova lÃnia\n" +msgid "" +"%%option yylineno entails a performance penalty ONLY on rules that can match " +"newline characters\n" +msgstr "" +"l'%%opció yylineno implica una penalització del rendiment NOMÉS en regles " +"que poden fer coincidir carà cters de nova lÃnia\n" -#: main.c:1538 +#: src/main.c:1545 #, c-format msgid "-I (interactive) entails a minor performance penalty\n" msgstr "-I (interactiu) implica una xicoteta penalització del rendiment\n" -#: main.c:1543 +#: src/main.c:1550 #, c-format msgid "yymore() entails a minor performance penalty\n" msgstr "yymore() implica una xicoteta penalització del rendiment\n" -#: main.c:1549 +#: src/main.c:1556 #, c-format msgid "REJECT entails a large performance penalty\n" msgstr "REJECT implica una penalització del rendiment molt gran\n" -#: main.c:1554 +#: src/main.c:1561 #, c-format msgid "Variable trailing context rules entail a large performance penalty\n" -msgstr "Les regles de context posterior variable implica una penalització del rendiment molt gran\n" +msgstr "" +"Les regles de context posterior variable implica una penalització del " +"rendiment molt gran\n" -#: main.c:1566 +#: src/main.c:1573 msgid "REJECT cannot be used with -f or -F" msgstr "REJECT no es pot fer servir amb -f o -F" -#: main.c:1569 +#: src/main.c:1576 #, c-format msgid "%option yylineno cannot be used with REJECT" msgstr "l'%opció yylineno no es pot fer servir amb REJECT" -#: main.c:1572 +#: src/main.c:1579 msgid "variable trailing context rules cannot be used with -f or -F" -msgstr "Les regles de context posterior variable no es poden utilitzar amb -f o -F" +msgstr "" +"Les regles de context posterior variable no es poden utilitzar amb -f o -F" -#: main.c:1695 +#: src/main.c:1704 #, c-format msgid "%option yyclass only meaningful for C++ scanners" msgstr "l'%opció yyclass només té sentit per a analitzadors de C++" -#: main.c:1802 +#: src/main.c:1791 #, c-format msgid "Usage: %s [OPTIONS] [FILE]...\n" msgstr "Forma d'ús: %s [OPCIONS] [FITXER]...\n" @@ -533,8 +550,8 @@ msgstr "Forma d'ús: %s [OPCIONS] [FITXER]...\n" # molt això de text emparellat. # Encara que coincident tampoc no m'acaba de convéncer. ear # I que faig amb "reentrant" i "parser"? jm -#: main.c:1805 -#, c-format +#: src/main.c:1794 +#, fuzzy, c-format msgid "" "Generates programs that perform pattern-matching on text.\n" "\n" @@ -557,13 +574,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" @@ -585,8 +605,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" @@ -600,41 +618,52 @@ msgstr "" "Genera programes que realitzen emparellaments de patrons en text.\n" "\n" "Compressió de taules:\n" -" -Ca, --align renuncia a taules més grans a canvi de una millor alineació\n" +" -Ca, --align renuncia a taules més grans a canvi de una millor " +"alineació\n" " -Ce, --ecs construeix classes d'equivalència\n" -" -Cf no comprimeixes les taules; utilitza la representació -f\n" -" -CF no comprimeixes les taules; utilitza la representació -F\n" +" -Cf no comprimeixes les taules; utilitza la representació -" +"f\n" +" -CF no comprimeixes les taules; utilitza la representació -" +"F\n" " -Cm, --meta-ecs construeix classes de metaequivalència\n" -" -Cr, --read utilitza read() en lloc de stdio com a entrada de l'analitzador\n" +" -Cr, --read utilitza read() en lloc de stdio com a entrada de " +"l'analitzador\n" " -f, --full genera un analitzador rà pid i gran. El mateix que -Cfr\n" -" -F, --fast usa una representació alternativa de taules. El mateix que -CFr\n" +" -F, --fast usa una representació alternativa de taules. El mateix " +"que -CFr\n" " -Cem compressió per defecte (el mateix que --ecs --meta-ecs)\n" "\n" "Depuració:\n" " -d, --debug activa el mode de depuració en l'analitzador\n" " -b, --backup escriu l'informació dels retrocessos en %s\n" " -p, --perf-report escriu l'informe de rendiment en stderr\n" -" -s, --nodefault suprimeix la regla per defecte de visualitzar (ECHO) el text no emparellat\n" +" -s, --nodefault suprimeix la regla per defecte de visualitzar " +"(ECHO) el text no emparellat\n" " -T, --trace %s hauria d'executar-se en mode traça\n" " -w, --nowarn no generes avisos\n" -" -v, --verbose escriu un resum de les estadÃstiques de l'analitzador en stdout\n" +" -v, --verbose escriu un resum de les estadÃstiques de " +"l'analitzador en stdout\n" "\n" "Fitxers:\n" " -o, --outfile=FITXER especifica el fitxer d'eixida\n" " -S, --skel=FITXER especifica el fitxer d'esquema\n" " -t, --stdout escriu l'analitzador en stdout en lloc de %s\n" " --yyclass=NOM nom de la classe C++\n" -" --header-file=FITXER crea un fitxer de capçaleres de C a més de l'analitzador\n" +" --header-file=FITXER crea un fitxer de capçaleres de C a més de " +"l'analitzador\n" " --tables-file=[FITXER] escriu les taules en FITXER\n" "\n" "Comportament de l'analitzador:\n" " -7, --7bit genera un analitzador de 7 bits\n" " -8, --8bit genera un analitzador de 8 bits\n" -" -B, --batch genera un analitzador no interactiu (el contrari a -I)\n" -" -i, --case-insensitive Ignora les diferències de majúscules i minúscules en els patrons\n" +" -B, --batch genera un analitzador no interactiu (el contrari a " +"-I)\n" +" -i, --case-insensitive Ignora les diferències de majúscules i minúscules " +"en els patrons\n" " -l, --lex-compat compatibilitat mà xima amb el lex original\n" " -X, --posix-compat compatibilitat mà xima amb el lex POSIX\n" -" -I, --interactive genera un analitzador interactiu (el contrari a -B)\n" +" -I, --interactive genera un analitzador interactiu (el contrari a -" +"B)\n" " --yylineno traça el compte de lÃnies en yylineno\n" "\n" "Codi generat:\n" @@ -658,51 +687,52 @@ msgstr "" " -h, --help mostra aquest missatge d'ajuda\n" " -V, --version informa de la versió de %s\n" -#: misc.c:65 +#: src/misc.c:64 msgid "allocation of sko_stack failed" msgstr "Ha fallat l'assignació de «sko_stack»" -#: misc.c:102 misc.c:128 +#: src/misc.c:100 #, c-format msgid "name \"%s\" ridiculously long" msgstr "el nom «%s» és ridÃculament llarg" -#: misc.c:177 +#: src/misc.c:155 msgid "memory allocation failed in allocate_array()" msgstr "ha fallat l'assignació de memòria en allocate_array()" -#: misc.c:230 +#: src/misc.c:205 #, c-format msgid "bad character '%s' detected in check_char()" msgstr "carà cter incorrecte «%s» detectat en check_char()" -#: misc.c:235 +#: src/misc.c:210 #, c-format msgid "scanner requires -8 flag to use the character %s" msgstr "l'analitzador requereix l'opció -8 per a fer servir el carà cter %s" -#: misc.c:268 -msgid "dynamic memory failure in copy_string()" -msgstr "errada de la memòria dinà mica en copy_string()" +#: src/misc.c:229 +#, fuzzy +msgid "memory allocation failure in xstrdup()" +msgstr "ha fallat l'assignació de memòria en allocate_array()" -#: misc.c:367 +#: src/misc.c:303 #, c-format msgid "%s: fatal internal error, %s\n" msgstr "%s: error intern fatal, %s\n" -#: misc.c:803 +#: src/misc.c:671 msgid "attempt to increase array size failed" msgstr "ha fallat l'intent d'augmentar la mida de la matriu" -#: misc.c:930 +#: src/misc.c:795 msgid "bad line in skeleton file" msgstr "lÃnia incorrecta en el fitxer d'esquema" -#: misc.c:979 +#: src/misc.c:845 msgid "memory allocation failed in yy_flex_xmalloc()" msgstr "ha fallat l'assignació de memòria en yy_flex_xmalloc()" -#: nfa.c:104 +#: src/nfa.c:100 #, c-format msgid "" "\n" @@ -713,230 +743,247 @@ msgstr "" "\n" "********** s'està començant el bolcat de l'afn amb l'estat inicial %d\n" -#: nfa.c:115 +#: src/nfa.c:111 #, c-format msgid "state # %4d\t" msgstr "estat # %4d\t" -#: nfa.c:130 +#: src/nfa.c:126 #, c-format msgid "********** end of dump\n" msgstr "********** final del bolcat\n" -#: nfa.c:174 +#: src/nfa.c:169 msgid "empty machine in dupmachine()" msgstr "mà quina buida en dupmachine()" -#: nfa.c:240 +#: src/nfa.c:234 #, c-format msgid "Variable trailing context rule at line %d\n" msgstr "Regla de context posterior variable en la lÃnia %d\n" -#: nfa.c:353 +#: src/nfa.c:357 msgid "bad state type in mark_beginning_as_normal()" msgstr "tipus d'estat incorrecte en mark_beginning_as_normal()" -#: nfa.c:598 +#: src/nfa.c:595 #, c-format msgid "input rules are too complicated (>= %d NFA states)" msgstr "les regles d'entrada són massa complicades (>= %d estats AFN)" -#: nfa.c:677 +#: src/nfa.c:673 msgid "found too many transitions in mkxtion()" msgstr "s'han trobat massa transicions en mkxtion()" -#: nfa.c:703 +#: src/nfa.c:699 #, c-format msgid "too many rules (> %d)!" msgstr "massa regles (> %d)!" -#: parse.y:159 +#: src/parse.y:159 msgid "unknown error processing section 1" msgstr "s'ha produït un error desconegut en processar la secció 1" -#: parse.y:184 parse.y:351 +#: src/parse.y:184 src/parse.y:353 msgid "bad start condition list" msgstr "condició de començament incorrecta" -#: parse.y:315 +#: src/parse.y:204 +msgid "Prefix must not contain [ or ]" +msgstr "" + +#: src/parse.y:317 msgid "unrecognized rule" msgstr "regla no reconeguda" -#: 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 "s'ha utilitzat el context posterior dos vegades" -#: 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 "valors d'iteració incorrectes" -#: 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 "el valor d'iteració ha de ser positiu" -#: 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 "el rang de carà cters [%c-%c] és ambigu en un analitzador insensible a les majúscules i minúscules" +msgstr "" +"el rang de carà cters [%c-%c] és ambigu en un analitzador insensible a les " +"majúscules i minúscules" -#: parse.y:819 +#: src/parse.y:821 msgid "negative range in character class" msgstr "rang negatiu en classe de carà cter" -#: parse.y:916 +#: src/parse.y:918 msgid "[:^lower:] is ambiguous in case insensitive scanner" -msgstr "[:^lower:] és ambigu en un analitzador insensible a les majúscules i minúscules" +msgstr "" +"[:^lower:] és ambigu en un analitzador insensible a les majúscules i " +"minúscules" -#: parse.y:922 +#: src/parse.y:924 msgid "[:^upper:] ambiguous in case insensitive scanner" -msgstr "[:^upper:] és ambigu en un analitzador insensible a les majúscules i minúscules" +msgstr "" +"[:^upper:] és ambigu en un analitzador insensible a les majúscules i " +"minúscules" -#: 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 "La lÃnia d'entrada és massa llarga\n" -#: scan.l:161 +#: src/scan.l:183 #, c-format msgid "malformed '%top' directive" msgstr "directiva «%top» malformada" -#: scan.l:183 +#: src/scan.l:205 #, no-c-format msgid "unrecognized '%' directive" msgstr "directiva «%» no reconeguda" -#: scan.l:192 +#: src/scan.l:214 msgid "Definition name too long\n" msgstr "El nom de la definició és massa llarg\n" -#: scan.l:284 +#: src/scan.l:309 msgid "Unmatched '{'" msgstr "«|» no emparellat" -#: scan.l:300 +#: src/scan.l:325 #, c-format msgid "Definition value for {%s} too long\n" msgstr "El valor de la definició de {%s} és massa llarg\n" -#: scan.l:317 +#: src/scan.l:342 msgid "incomplete name definition" msgstr "definició del nom incompleta" -#: scan.l:443 +#: src/scan.l:467 msgid "Option line too long\n" msgstr "La lÃnia d'opcions és massa llarga\n" -#: scan.l:451 +#: src/scan.l:475 #, c-format msgid "unrecognized %%option: %s" msgstr "%%opció no reconeguda: %s" -#: scan.l:633 scan.l:800 +#: src/scan.l:659 src/scan.l:832 msgid "bad character class" msgstr "classe de carà cter incorrecta" -#: scan.l:683 +#: src/scan.l:709 #, c-format msgid "undefined definition {%s}" msgstr "definició no definida {%s}" -#: scan.l:755 +#: src/scan.l:772 +msgid "unbalanced parenthesis" +msgstr "" + +#: src/scan.l:787 #, c-format msgid "bad <start condition>: %s" msgstr "<condició d'activació> incorrecta: %s" -#: scan.l:768 +#: src/scan.l:800 msgid "missing quote" msgstr "manca una cometa" -#: scan.l:834 +#: src/scan.l:866 #, c-format msgid "bad character class expression: %s" msgstr "expressió de la classe de carà cters incorrecta: %s" -#: scan.l:856 +#: src/scan.l:888 msgid "bad character inside {}'s" msgstr "carà cter incorrecte dins de {}" -#: scan.l:862 +#: src/scan.l:894 msgid "missing }" msgstr "manca una }" -#: scan.l:940 +#: src/scan.l:972 msgid "EOF encountered inside an action" msgstr "s'ha trobat un EOF dins d'una acció" -#: scan.l:945 +#: src/scan.l:977 msgid "EOF encountered inside pattern" msgstr "s'ha trobat un EOF dins d'un patró" -#: scan.l:967 +#: src/scan.l:1010 #, c-format msgid "bad character: %s" msgstr "carà cter incorrecte: %s" -#: scan.l:996 +#: src/scan.l:1038 #, c-format msgid "can't open %s" msgstr "no es pot obrir %s" -#: scanopt.c:291 +#: src/scanopt.c:259 #, c-format msgid "Usage: %s [OPTIONS]...\n" msgstr "Forma d'ús: %s [OPCIONS]...\n" -#: scanopt.c:564 +#: src/scanopt.c:524 #, c-format msgid "option `%s' doesn't allow an argument\n" msgstr "l'opció «%s» no accepta arguments\n" -#: scanopt.c:569 +#: src/scanopt.c:529 #, c-format msgid "option `%s' requires an argument\n" msgstr "l'opció «%s» requereix un argument\n" -#: scanopt.c:573 +#: src/scanopt.c:533 #, c-format msgid "option `%s' is ambiguous\n" msgstr "l'opció «%s» és ambÃgua\n" -#: scanopt.c:577 +#: src/scanopt.c:537 #, c-format msgid "Unrecognized option `%s'\n" msgstr "Opció no reconeguda «%s»\n" -#: scanopt.c:581 +#: src/scanopt.c:541 #, c-format msgid "Unknown error=(%d)\n" msgstr "Error desconegut=(%d)\n" -#: sym.c:100 +#: src/sym.c:92 msgid "symbol table memory allocation failed" msgstr "ha fallat l'assignació de memòria per a la taula de sÃmbols" -#: sym.c:202 +#: src/sym.c:183 msgid "name defined twice" msgstr "el nom ha sigut definit dos vegades" -#: sym.c:253 +#: src/sym.c:231 #, c-format msgid "start condition %s declared twice" msgstr "la condició d'activació %s ha sigut declarada dos vegades" -#: yylex.c:56 +#: src/yylex.c:57 msgid "premature EOF" msgstr "EOF prematur" -#: yylex.c:198 +#: src/yylex.c:200 #, c-format msgid "End Marker\n" msgstr "Marcador de fi\n" -#: yylex.c:204 +#: src/yylex.c:206 #, c-format msgid "*Something Weird* - tok: %d val: %d\n" msgstr "*Quelcom estrany* - terminal: %d val: %d\n" +#~ msgid "dynamic memory failure in copy_string()" +#~ msgstr "errada de la memòria dinà mica en copy_string()" + #~ msgid "consistency check failed in symfollowset" #~ msgstr "Ha fallat la prova de consistència en symfollowset" @@ -968,8 +1015,10 @@ msgstr "*Quelcom estrany* - terminal: %d val: %d\n" #~ msgid "-C flag must be given separately" #~ msgstr "l'opció -C s'ha de donar per separat" -#~ msgid "%s [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -ooutput -Pprefix -Sskeleton]\n" -#~ msgstr "%s [--bcdfhilnpstvwBFILTV78+? -C[aefFmr] -oeixida -Pprefix -Sesquema]\n" +#~ msgid "" +#~ "%s [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -ooutput -Pprefix -Sskeleton]\n" +#~ msgstr "" +#~ "%s [--bcdfhilnpstvwBFILTV78+? -C[aefFmr] -oeixida -Pprefix -Sesquema]\n" #~ msgid "\t[--help --version] [file ...]\n" #~ msgstr "\t[--help --version] [fitxer ...]\n" @@ -1005,10 +1054,13 @@ msgstr "*Quelcom estrany* - terminal: %d val: %d\n" # molt això de text emparellat. # Encara que coincident tampoc no m'acaba de convéncer. ear #~ msgid "\t-s suppress default rule to ECHO unmatched text\n" -#~ msgstr "\t-s suprimeix la regla per defecte de visualitzar (ECHO) el text no emparellat\n" +#~ msgstr "" +#~ "\t-s suprimeix la regla per defecte de visualitzar (ECHO) el text no " +#~ "emparellat\n" #~ msgid "\t-t write generated scanner on stdout instead of %s\n" -#~ msgstr "\t-t escriu l'analitzador generat en l'eixida està ndard en lloc de %s\n" +#~ msgstr "" +#~ "\t-t escriu l'analitzador generat en l'eixida està ndard en lloc de %s\n" #~ msgid "\t-v write summary of scanner statistics to f\n" #~ msgstr "\t-v escriu un resum de les estadÃstiques en f\n" @@ -1047,7 +1099,8 @@ msgstr "*Quelcom estrany* - terminal: %d val: %d\n" #~ msgstr "\t-? produeix aquest missatge d'ajuda\n" #~ msgid "\t-C specify degree of table compression (default is -Cem):\n" -#~ msgstr "\t-C especifica el grau de compressió de la taula (per defecte -Cem):\n" +#~ msgstr "" +#~ "\t-C especifica el grau de compressió de la taula (per defecte -Cem):\n" #~ msgid "\t\t-Ca trade off larger tables for better memory alignment\n" #~ msgstr "" @@ -1058,16 +1111,21 @@ msgstr "*Quelcom estrany* - terminal: %d val: %d\n" #~ msgstr "\t\t-Ce construeix classes d'equivalència\n" #~ msgid "\t\t-Cf do not compress scanner tables; use -f representation\n" -#~ msgstr "\t\t-Cf no comprimeix les taules de l'analitzador; utilitza la representació -f\n" +#~ msgstr "" +#~ "\t\t-Cf no comprimeix les taules de l'analitzador; utilitza la " +#~ "representació -f\n" #~ msgid "\t\t-CF do not compress scanner tables; use -F representation\n" -#~ msgstr "\t\t-CF no comprimeix les taules de l'analitzador; utilitza la representació -F\n" +#~ msgstr "" +#~ "\t\t-CF no comprimeix les taules de l'analitzador; utilitza la " +#~ "representació -F\n" #~ msgid "\t\t-Cm construct meta-equivalence classes\n" #~ msgstr "\t\t-Cm construeix classes de metaequivalència\n" #~ msgid "\t\t-Cr use read() instead of stdio for scanner input\n" -#~ msgstr "\t\t-Cr utilitza read() en lloc de stdio com a entrada de l'analitzador\n" +#~ msgstr "" +#~ "\t\t-Cr utilitza read() en lloc de stdio com a entrada de l'analitzador\n" #~ msgid "\t-o specify output filename\n" #~ msgstr "\t-o especifica el fitxer d'eixida\n" @@ -2,40 +2,58 @@ # Copyright (C) 2007 The Flex Project (msgids) # This file is distributed under the same license as the flex package. # Johan Linde <jl@theophys.kth.se>, 1996. -# Keld Simonsen <keld@keldix.com>, 2000-2011. +# Keld Simonsen <keld@keldix.com>, 2000-2011, 2015. # msgid "" msgstr "" -"Project-Id-Version: flex-2.5.35\n" +"Project-Id-Version: flex-2.5.38\n" "Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2008-02-26 16:34-0500\n" -"PO-Revision-Date: 2011-01-11 09:12+0100\n" +"POT-Creation-Date: 2017-05-06 10:49-0400\n" +"PO-Revision-Date: 2015-04-26 09:12+0200\n" "Last-Translator: Keld Simonsen <keld@keldix.com>\n" "Language-Team: Danish <dansk@dansk-gruppen.dk>\n" +"Language: da\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Transfer-Encoding: 8-bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" -#: dfa.c:61 +#: src/buf.c:79 +msgid "Allocation of buffer to print string failed" +msgstr "Tildeling af buffer til udskrivningsstreng mislykkedes" + +#: src/buf.c:107 +msgid "Allocation of buffer for line directive failed" +msgstr "Tildeling af buffer til linjedirektiv mislykkedes" + +#: src/buf.c:177 +msgid "Allocation of buffer for m4 def failed" +msgstr "Tildeling af buffer til m4 def mislykkedes" + +#: src/buf.c:198 +msgid "Allocation of buffer for m4 undef failed" +msgstr "Tildeling af buffer til m4 undef mislykkedes" + +#: src/dfa.c:59 #, c-format msgid "State #%d is non-accepting -\n" msgstr "Tilstand %d er ikke-accepterende -\n" -#: dfa.c:124 +#: src/dfa.c:119 msgid "dangerous trailing context" msgstr "farlig efterfølgende kontekst" -#: dfa.c:166 +#: src/dfa.c:159 #, c-format msgid " associated rule line numbers:" msgstr " linjenummer for associeret regel:" -#: dfa.c:202 +#: src/dfa.c:193 #, c-format msgid " out-transitions: " msgstr " ud-overgange: " -#: dfa.c:210 +#: src/dfa.c:201 #, c-format msgid "" "\n" @@ -44,11 +62,11 @@ msgstr "" "\n" " stopovergange: filslut " -#: dfa.c:341 +#: src/dfa.c:331 msgid "consistency check failed in epsclosure()" msgstr "konsistenskontrollen mislykkedes i epsclosure()" -#: dfa.c:429 +#: src/dfa.c:419 msgid "" "\n" "\n" @@ -60,26 +78,26 @@ msgstr "" "DFA-udskrift:\n" "\n" -#: dfa.c:604 +#: src/dfa.c:587 msgid "could not create unique end-of-buffer state" msgstr "kunne ikke oprette en unik buffersluttilstand" -#: dfa.c:625 +#: src/dfa.c:608 #, c-format msgid "state # %d:\n" msgstr "tilstand %d:\n" # Dette er ju helt sjukt. Har buggrapporteret dette at det bør # erstatas med %s -#: dfa.c:785 +#: src/dfa.c:768 msgid "Could not write yynxt_tbl[][]" msgstr "Kunne ikke skrive yynxt_tbl[][]" -#: dfa.c:1052 +#: src/dfa.c:1028 msgid "bad transition character detected in sympartition()" msgstr "forkert overgangstegn fundet i sympartition()" -#: gen.c:478 +#: src/gen.c:480 msgid "" "\n" "\n" @@ -91,29 +109,29 @@ msgstr "" "Ækvivalensklasser:\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 "tilstand %d accepterer: [%d]\n" -#: gen.c:1110 +#: src/gen.c:1115 #, c-format msgid "state # %d accepts: " msgstr "tilstand %d accepterer: " -#: gen.c:1157 +#: src/gen.c:1162 msgid "Could not write yyacclist_tbl" msgstr "Kunne ikke skrive yyacclist_tbl" -#: gen.c:1233 +#: src/gen.c:1236 msgid "Could not write yyacc_tbl" msgstr "Kunne ikke skrive 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 "Kunne ikke skrive esctbl" -#: gen.c:1271 +#: src/gen.c:1271 msgid "" "\n" "\n" @@ -123,390 +141,405 @@ msgstr "" "\n" "Meta-ækvivalensklasser:\n" -#: gen.c:1293 +#: src/gen.c:1293 msgid "Could not write yymeta_tbl" msgstr "Kunne ikke skrive yymeta_tbl" -#: gen.c:1354 +#: src/gen.c:1352 msgid "Could not write yybase_tbl" msgstr "kunne ikke oprette yybase_tbl" -#: gen.c:1388 +#: src/gen.c:1384 msgid "Could not write yydef_tbl" msgstr "Kunne ikke oprette yydef_tbl" -#: gen.c:1428 +#: src/gen.c:1422 msgid "Could not write yynxt_tbl" msgstr "Kunne ikke skrive yynxt_tbl" -#: gen.c:1464 +#: src/gen.c:1456 msgid "Could not write yychk_tbl" msgstr "Kunne ikke skrive yychk_tbl" -#: gen.c:1618 gen.c:1647 +#: src/gen.c:1608 src/gen.c:1637 msgid "Could not write ftbl" msgstr "Kunne ikke skrive ftbl" -#: gen.c:1624 +#: src/gen.c:1614 msgid "Could not write ssltbl" msgstr "Kunne ikke skrive ssltbl" -#: gen.c:1675 +#: src/gen.c:1665 msgid "Could not write eoltbl" msgstr "Kunne ikke skrive eoltbl" -#: gen.c:1735 +#: src/gen.c:1722 msgid "Could not write yynultrans_tbl" msgstr "Kunne ikke skrive yynultrans_tbl" -#: main.c:189 +#: src/main.c:178 msgid "rule cannot be matched" msgstr "reglen kan ikke matches" -#: main.c:194 +#: src/main.c:183 msgid "-s option given but default rule can be matched" msgstr "flaget -s angivet, men standardreglen kan følges" -#: main.c:234 +#: src/main.c:221 msgid "Can't use -+ with -l option" msgstr "-+ kan ikke bruges sammen med flaget -l" -#: main.c:237 +#: src/main.c:224 msgid "Can't use -f or -F with -l option" msgstr "-f eller -F kan ikke bruges sammen med -l" -#: main.c:241 +#: src/main.c:228 msgid "Can't use --reentrant or --bison-bridge with -l option" msgstr "Kan ikke bruge --reentrant eller --bison-bridge sammen med flaget -l" -#: main.c:278 +#: src/main.c:260 msgid "-Cf/-CF and -Cm don't make sense together" msgstr "-Cf/-CF og -Cm kan ikke bruges sammen" -#: main.c:281 +#: src/main.c:263 msgid "-Cf/-CF and -I are incompatible" msgstr "-Cf/-CF og -I kan ikke bruges sammen" -#: main.c:285 +#: src/main.c:267 msgid "-Cf/-CF are incompatible with lex-compatibility mode" msgstr "-Cf/-CF kan ikke bruges i lex-kompatibilitetstilstand" -#: main.c:290 +#: src/main.c:272 msgid "-Cf and -CF are mutually exclusive" msgstr "-Cf og -CF er gensidigt udelukkende" -#: main.c:294 +#: src/main.c:276 msgid "Can't use -+ with -CF option" msgstr "-+ kan ikke bruges sammen med flaget -CF" -#: main.c:297 +#: src/main.c:279 #, c-format msgid "%array incompatible with -+ option" msgstr "-+ kan ikke bruges sammen med %array" -#: main.c:302 +#: src/main.c:284 msgid "Options -+ and --reentrant are mutually exclusive." msgstr "Flagene -+ og --reentrant er gensidigt udelukkende." -#: main.c:305 +#: src/main.c:287 msgid "bison bridge not supported for the C++ scanner." msgstr "bisonbro understøttes ikke for C++-skanneren." -#: main.c:360 main.c:406 +#: src/main.c:336 src/main.c:419 #, c-format msgid "could not create %s" msgstr "kunne ikke oprette %s" -#: main.c:419 +#: src/main.c:431 msgid "could not write tables header" msgstr "kunne ikke skrive tabellhoved" -#: main.c:423 +#: src/main.c:435 #, c-format msgid "can't open skeleton file %s" msgstr "kan ikke åbne skabelonfilen %s" -#: main.c:505 +#: src/main.c:450 +msgid "Prefix cannot include '[' or ']'" +msgstr "" + +#: src/main.c:474 +msgid "allocation of macro definition failed" +msgstr "tildeling af makro-definition mislykkedes" + +#: src/main.c:521 #, c-format msgid "input error reading skeleton file %s" msgstr "fejl ved læsning af skabelonsfilen %s" -#: main.c:509 +#: src/main.c:525 #, c-format msgid "error closing skeleton file %s" msgstr "fejl ved lukning af skabelonfilen %s" -#: main.c:694 +#: src/main.c:709 #, c-format msgid "error creating header file %s" msgstr "fejl ved oprettelsen af headerfilen %s" -#: main.c:702 +#: src/main.c:717 #, c-format msgid "error writing output file %s" msgstr "fejl ved skrivning af udfilen %s" -#: main.c:706 +#: src/main.c:721 #, c-format msgid "error closing output file %s" msgstr "fejl ved lukning af udfilen %s" -#: main.c:710 +#: src/main.c:725 #, c-format msgid "error deleting output file %s" msgstr "fejl ved sletning af udfilen %s" -#: main.c:717 +#: src/main.c:732 #, c-format msgid "No backing up.\n" msgstr "Ingen sikkerhedskopiering.\n" -#: main.c:721 +#: src/main.c:736 #, c-format msgid "%d backing up (non-accepting) states.\n" msgstr "%d sikkerhedskopierer (ikke-accepterende) tilstande.\n" -#: main.c:725 +#: src/main.c:740 #, c-format msgid "Compressed tables always back up.\n" msgstr "Komprimerete tabeller backer alltid tillbaka.\n" -#: main.c:728 +#: src/main.c:743 #, c-format msgid "error writing backup file %s" msgstr "fejl ved skrivning af sikkerhedskopifilen %s" -#: main.c:732 +#: src/main.c:747 #, c-format msgid "error closing backup file %s" msgstr "fejl ved lukning af sikerhedskopifilen %s" -#: main.c:737 +#: src/main.c:752 #, c-format msgid "%s version %s usage statistics:\n" msgstr "Statistik over brugaf %s version %s:\n" -#: main.c:740 +#: src/main.c:755 #, c-format msgid " scanner options: -" msgstr " fortolkningsflag: -" -#: main.c:819 +#: src/main.c:834 #, c-format msgid " %d/%d NFA states\n" msgstr " %d/%d NFA-tilstand\n" -#: main.c:821 +#: src/main.c:836 #, c-format msgid " %d/%d DFA states (%d words)\n" msgstr " %d/%d DFA-tilstand (%d ord)\n" -#: main.c:823 +#: src/main.c:838 #, c-format msgid " %d rules\n" msgstr " %d regler\n" -#: main.c:828 +#: src/main.c:843 #, c-format msgid " No backing up\n" msgstr " Ingen sikkerhedskopiering\n" -#: main.c:832 +#: src/main.c:847 #, c-format msgid " %d backing-up (non-accepting) states\n" msgstr " %d sikkerhedskopierer (ikke-accepterende) tilstande.\n" -#: main.c:837 +#: src/main.c:852 #, c-format msgid " Compressed tables always back-up\n" msgstr " Komprimerede tabeller bakker altid tilbake\n" -#: main.c:841 +#: src/main.c:856 #, c-format msgid " Beginning-of-line patterns used\n" msgstr " Begyndelse-af-linje-mønster brugt\n" -#: main.c:843 +#: src/main.c:858 #, c-format msgid " %d/%d start conditions\n" msgstr " %d/%d startbetingelse\n" -#: main.c:847 +#: src/main.c:862 #, c-format msgid " %d epsilon states, %d double epsilon states\n" msgstr " %d epsilontilstande, %d dobbelte epsilontilstande\n" -#: main.c:851 +#: src/main.c:866 #, c-format msgid " no character classes\n" msgstr " ingen tegnklasser\n" -#: main.c:855 +#: src/main.c:870 #, c-format msgid " %d/%d character classes needed %d/%d words of storage, %d reused\n" msgstr " %d/%d tegnklasser behøvede %d/%d ord for gemning, %d genbrugte\n" -#: main.c:860 +#: src/main.c:875 #, c-format msgid " %d state/nextstate pairs created\n" msgstr " %d par med tilstand/næste-tilstand oprettede\n" -#: main.c:863 +#: src/main.c:878 #, c-format msgid " %d/%d unique/duplicate transitions\n" msgstr " %d/%d unikke/duplikerede overgange\n" -#: main.c:868 +#: src/main.c:883 #, c-format msgid " %d table entries\n" msgstr " %d tabelposter\n" -#: main.c:876 +#: src/main.c:891 #, c-format msgid " %d/%d base-def entries created\n" msgstr " %d/%d base/standard-poster oprettede\n" -#: main.c:880 +#: src/main.c:895 #, c-format msgid " %d/%d (peak %d) nxt-chk entries created\n" msgstr " %d/%d (max %d) næste/test-poster oprettede\n" -#: main.c:884 +#: src/main.c:899 #, c-format msgid " %d/%d (peak %d) template nxt-chk entries created\n" msgstr " %d/%d (max %d) skablon-næste/test-poster oprettede\n" -#: main.c:888 +#: src/main.c:903 #, c-format msgid " %d empty table entries\n" msgstr " %d tomme tabelposter\n" -#: main.c:890 +#: src/main.c:905 #, c-format msgid " %d protos created\n" msgstr " %d prototyper oprettede\n" -#: main.c:893 +#: src/main.c:908 #, c-format msgid " %d templates created, %d uses\n" msgstr " %d skabloner oprettede, %d formål\n" -#: main.c:901 +#: src/main.c:916 #, c-format msgid " %d/%d equivalence classes created\n" msgstr " %d/%d ækvivalensklasser oprettet\n" -#: main.c:909 +#: src/main.c:924 #, c-format msgid " %d/%d meta-equivalence classes created\n" msgstr " %d/%d meta-ækvivalensklasser oprettede\n" -#: main.c:915 +#: src/main.c:930 #, c-format msgid " %d (%d saved) hash collisions, %d DFAs equal\n" msgstr " %d (%d gemte) hash-kollisioner, %d DFA'er er ens\n" -#: main.c:917 +#: src/main.c:932 #, c-format msgid " %d sets of reallocations needed\n" msgstr " %d opsætninger med omallokeringer krævedes\n" -#: main.c:919 +#: src/main.c:934 #, c-format msgid " %d total table entries needed\n" msgstr " %d totale tabelposter kræves\n" -#: main.c:996 +#: src/main.c:1008 #, c-format msgid "Internal error. flexopts are malformed.\n" msgstr "Intern fejl. flexopts er fejlbehæftede.\n" -#: main.c:1006 +#: src/main.c:1018 #, c-format msgid "Try `%s --help' for more information.\n" msgstr "Prøv '%s --help' for mere information.\n" -#: main.c:1063 +#: src/main.c:1075 #, c-format msgid "unknown -C option '%c'" msgstr "ukendt flag til -C '%c'" -#: main.c:1192 +#: src/main.c:1204 #, c-format msgid "%s %s\n" msgstr "%s %s\n" -#: main.c:1467 +#: src/main.c:1476 msgid "fatal parse error" msgstr "uoprettelig fejl ved analysen" -#: main.c:1499 +#: src/main.c:1508 #, c-format msgid "could not create backing-up info file %s" msgstr "kunne ikke oprette sikkerhedskopi af info-fil %s" -#: main.c:1520 +#: src/main.c:1529 #, c-format msgid "-l AT&T lex compatibility option entails a large performance penalty\n" -msgstr "flaget -l for opførsel som AT&T's lex medfører et væsentligt præstationstab\n" +msgstr "" +"flaget -l for opførsel som AT&T's lex medfører et væsentligt præstationstab\n" -#: main.c:1523 +#: src/main.c:1532 #, c-format msgid " and may be the actual source of other reported performance penalties\n" msgstr " og kan være den egentlige årsag til andre rapporter om dette\n" -#: main.c:1529 +#: src/main.c:1538 #, c-format -msgid "%%option yylineno entails a performance penalty ONLY on rules that can match newline characters\n" -msgstr "%%option yylineno medfører et præstationstab KUN på regler der kan matche nylinje-tegn\n" +msgid "" +"%%option yylineno entails a performance penalty ONLY on rules that can match " +"newline characters\n" +msgstr "" +"%%option yylineno medfører et præstationstab KUN på regler der kan matche " +"nylinje-tegn\n" -#: main.c:1536 +#: src/main.c:1545 #, c-format msgid "-I (interactive) entails a minor performance penalty\n" msgstr "-I (interaktiv) medfører et mindre præstationstab\n" -#: main.c:1541 +#: src/main.c:1550 #, c-format msgid "yymore() entails a minor performance penalty\n" msgstr "yymore() medfører et mindre præstationstab\n" -#: main.c:1547 +#: src/main.c:1556 #, c-format msgid "REJECT entails a large performance penalty\n" msgstr "REJECT medfører et væsentligt præstationstab\n" -#: main.c:1552 +#: src/main.c:1561 #, c-format msgid "Variable trailing context rules entail a large performance penalty\n" -msgstr "Regler for variabel efterfølgende kontekst medfører et væsentlig præstationstab\n" +msgstr "" +"Regler for variabel efterfølgende kontekst medfører et væsentlig " +"præstationstab\n" -#: main.c:1564 +#: src/main.c:1573 msgid "REJECT cannot be used with -f or -F" msgstr "REJECT kan ikke bruges sammen med -f eller -F" -#: main.c:1567 +#: src/main.c:1576 #, c-format msgid "%option yylineno cannot be used with REJECT" msgstr "%option yylineno kan ikke bruges sammen med REJECT" -#: main.c:1570 +#: src/main.c:1579 msgid "variable trailing context rules cannot be used with -f or -F" msgstr "" "regler for variabel efterfølgende kontekst kan ikke bruges\n" "sammen med -f eller -F" -#: main.c:1691 +#: src/main.c:1704 #, c-format msgid "%option yyclass only meaningful for C++ scanners" msgstr "%option yyclass er kun meningsfyldt for C++-fortolkere" -#: main.c:1798 +#: src/main.c:1791 #, c-format msgid "Usage: %s [OPTIONS] [FILE]...\n" msgstr "Brug: %s [FLAG] [FIL]...\n" -#: main.c:1801 -#, c-format +#: src/main.c:1794 +#, fuzzy, c-format msgid "" "Generates programs that perform pattern-matching on text.\n" "\n" @@ -529,13 +562,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" @@ -557,8 +593,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" @@ -572,7 +606,8 @@ msgstr "" "Genererer programmer som udfører mønstergenkendelse på tekst.\n" "\n" "Tabel-kompression: (normalt -Cem)\n" -" -Ca, --align brug bedre hukommelses-tilpasning i stedet for mindre tabeller\n" +" -Ca, --align brug bedre hukommelses-tilpasning i stedet for mindre " +"tabeller\n" " -Ce, --ecs konstruér ækvivalensklasser\n" " -Cf komprimér ikke tabeller; brug -f repræsentation\n" " -CF komprimér ikke tabeller; brug -F repræsentation\n" @@ -586,7 +621,8 @@ msgstr "" " -d, --debug aktivér fejlsøgnings-tilstand i skanneren\n" " -b, --backup skriv sikkerhedskopi-information til %s\n" " -p, --perf-report skriv ydelses-rapport på stdfejl\n" -" -s, --nodefault undertryk normal regel om at udskrive tekst der ikke passede\n" +" -s, --nodefault undertryk normal regel om at udskrive tekst der " +"ikke passede\n" " -T, --trace %s bør køre i sporings-tilstand\n" " -w, --nowarn generér ikke advarsler\n" " -v, --verbose skriv sammendrag af skanner-statistik til stdud\n" @@ -603,7 +639,8 @@ msgstr "" " -7, --7bit generér 7-bit-skanner\n" " -8, --8bit generér 8-bit-skanner\n" " -B, --batch generér batch-skanner (modsat -I)\n" -" -i, --case-insensitive ignorér forskel på små og store bogstaver i mønstre\n" +" -i, --case-insensitive ignorér forskel på små og store bogstaver i " +"mønstre\n" " -l, --lex-compat maksimal kompatibilitet med oprindelig lex\n" " -X, --posix-compat maksimal kompatibilitet med POSIX lex\n" " -I, --interactive generér interaktiv skanner (modsat -B)\n" @@ -630,47 +667,52 @@ msgstr "" " -h, --help udskriv denne hjælpebesked\n" " -V, --version udskriv %s version\n" -#: misc.c:100 misc.c:126 +#: src/misc.c:64 +msgid "allocation of sko_stack failed" +msgstr "tildeling af sko_stack mislykkedes" + +#: src/misc.c:100 #, c-format msgid "name \"%s\" ridiculously long" msgstr "navnet '%s' er latterligt langt" -#: misc.c:175 +#: src/misc.c:155 msgid "memory allocation failed in allocate_array()" msgstr "hukommelsestildelingen mislykkedes i allocate_array()" -#: misc.c:250 +#: src/misc.c:205 #, c-format msgid "bad character '%s' detected in check_char()" msgstr "forkert tegn '%s' fundet i check_char()" -#: misc.c:255 +#: src/misc.c:210 #, c-format msgid "scanner requires -8 flag to use the character %s" msgstr "skanneren kræver flaget -8 for at kunne bruge tegnet %s" -#: misc.c:288 -msgid "dynamic memory failure in copy_string()" -msgstr "dynamisk hukommelsesfejl i copy_string()" +#: src/misc.c:229 +#, fuzzy +msgid "memory allocation failure in xstrdup()" +msgstr "hukommelsestildelingen mislykkedes i allocate_array()" -#: misc.c:422 +#: src/misc.c:303 #, c-format msgid "%s: fatal internal error, %s\n" msgstr "%s: uoprettelig intern fejl, %s\n" -#: misc.c:875 +#: src/misc.c:671 msgid "attempt to increase array size failed" msgstr "forsøg på at øge arraystørrelse mislykkedes" -#: misc.c:1002 +#: src/misc.c:795 msgid "bad line in skeleton file" msgstr "forkert linje i skeletfilen" -#: misc.c:1051 +#: src/misc.c:845 msgid "memory allocation failed in yy_flex_xmalloc()" msgstr "hukommelsestildelingen mislykkedes i yy_flex_xmalloc()" -#: nfa.c:104 +#: src/nfa.c:100 #, c-format msgid "" "\n" @@ -681,213 +723,237 @@ msgstr "" "\n" "********** begynder udskrift af nfa med starttilstand %d\n" -#: nfa.c:115 +#: src/nfa.c:111 #, c-format msgid "state # %4d\t" msgstr "tilstand %4d\t" -#: nfa.c:130 +#: src/nfa.c:126 #, c-format msgid "********** end of dump\n" msgstr "********** slut på udskrift\n" -#: nfa.c:174 +#: src/nfa.c:169 msgid "empty machine in dupmachine()" msgstr "tom maskine i dupmachine()" -#: nfa.c:240 +#: src/nfa.c:234 #, c-format msgid "Variable trailing context rule at line %d\n" msgstr "Regel for variabel efterfølgende kontekst på linje %d\n" -#: nfa.c:353 +#: src/nfa.c:357 msgid "bad state type in mark_beginning_as_normal()" msgstr "forkert tilstandstype i mark_beginning_as_normal()" -#: nfa.c:598 +#: src/nfa.c:595 #, c-format msgid "input rules are too complicated (>= %d NFA states)" msgstr "inddatareglerne er for komplicerede (>= %d NFA-tilstand)" -#: nfa.c:677 +#: src/nfa.c:673 msgid "found too many transitions in mkxtion()" msgstr "fandt for mange overgange i mkxtion()" -#: nfa.c:703 +#: src/nfa.c:699 #, c-format msgid "too many rules (> %d)!" msgstr "for mange regler (> %d)!" -#: parse.y:159 +#: src/parse.y:159 msgid "unknown error processing section 1" msgstr "ukendt fejl ved tolkning af sektion 1" -#: parse.y:184 parse.y:351 +#: src/parse.y:184 src/parse.y:353 msgid "bad start condition list" msgstr "forkert liste af startbetingelser" -#: parse.y:315 +#: src/parse.y:204 +msgid "Prefix must not contain [ or ]" +msgstr "" + +#: src/parse.y:317 msgid "unrecognized rule" msgstr "ukendt regel" -#: 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 "efterfølgende kontekst brugt to gange" -#: 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 "fejlagtige iterationsværdier" -#: 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 "iterationsværdi skal være positiv" -#: parse.y:806 parse.y:816 +#: src/parse.y:806 src/parse.y:816 #, c-format msgid "the character range [%c-%c] is ambiguous in a case-insensitive scanner" msgstr "tegnintervallet [%c-%c] er flertydigt i en versalufølsom skanner" -#: parse.y:821 +#: src/parse.y:821 msgid "negative range in character class" msgstr "negativt interval i tegnklasse" -#: parse.y:918 +#: src/parse.y:918 msgid "[:^lower:] is ambiguous in case insensitive scanner" msgstr "[:^lower:] er flertydigt i en versalufølsom skanner" -#: parse.y:924 +#: src/parse.y:924 msgid "[:^upper:] ambiguous in case insensitive scanner" msgstr "[:^upper:] er flertydigt i en versalufølsom skanner" -#: scan.l:75 scan.l:192 scan.l:300 scan.l:443 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 "For lang inddatalinje\n" -#: scan.l:161 +#: src/scan.l:183 #, c-format msgid "malformed '%top' directive" msgstr "fejlagtigt '%top'-direktiv" -#: scan.l:183 +#: src/scan.l:205 #, no-c-format msgid "unrecognized '%' directive" msgstr "ukendt '%'-direktiv" -#: scan.l:284 +#: src/scan.l:214 +msgid "Definition name too long\n" +msgstr "For langt definitionsnavn\n" + +#: src/scan.l:309 msgid "Unmatched '{'" msgstr "Ensomt '{'" -#: scan.l:317 +#: src/scan.l:325 +#, c-format +msgid "Definition value for {%s} too long\n" +msgstr "Definitionsværdi for (%s) for langt\n" + +#: src/scan.l:342 msgid "incomplete name definition" msgstr "ufuldstændig navnedefinition" -#: scan.l:451 +#: src/scan.l:467 +msgid "Option line too long\n" +msgstr "For lang valgmulighedslinje\n" + +#: src/scan.l:475 #, c-format msgid "unrecognized %%option: %s" msgstr "ukendt %%option: %s" -#: scan.l:633 scan.l:800 +#: src/scan.l:659 src/scan.l:832 msgid "bad character class" msgstr "forkert tegnklasse" -#: scan.l:683 +#: src/scan.l:709 #, c-format msgid "undefined definition {%s}" msgstr "udefinieret definition {%s}" -#: scan.l:755 +#: src/scan.l:772 +msgid "unbalanced parenthesis" +msgstr "" + +#: src/scan.l:787 #, c-format msgid "bad <start condition>: %s" msgstr "forkert <startbetingelse>: %s" -#: scan.l:768 +#: src/scan.l:800 msgid "missing quote" msgstr "citationstegn savnes" -#: scan.l:834 +#: src/scan.l:866 #, c-format msgid "bad character class expression: %s" msgstr "forkert udtryk for tegnklasse: %s" -#: scan.l:856 +#: src/scan.l:888 msgid "bad character inside {}'s" msgstr "forkert tegn imellem {}" -#: scan.l:862 +#: src/scan.l:894 msgid "missing }" msgstr "} savnes" -#: scan.l:940 +#: src/scan.l:972 msgid "EOF encountered inside an action" msgstr "filslutning mødt inden i en handling" -#: scan.l:945 +#: src/scan.l:977 msgid "EOF encountered inside pattern" msgstr "filslutning mødt inden i et mønster" -#: scan.l:967 +#: src/scan.l:1010 #, c-format msgid "bad character: %s" msgstr "forkert tegn: %s" -#: scan.l:996 +#: src/scan.l:1038 #, c-format msgid "can't open %s" msgstr "kan ikke åbne %s" -#: scanopt.c:291 +#: src/scanopt.c:259 #, c-format msgid "Usage: %s [OPTIONS]...\n" msgstr "Brug: %s [FLAG]...\n" -#: scanopt.c:565 +#: src/scanopt.c:524 #, c-format msgid "option `%s' doesn't allow an argument\n" msgstr "flaget '%s' tager ikke noget argument\n" -#: scanopt.c:570 +#: src/scanopt.c:529 #, c-format msgid "option `%s' requires an argument\n" msgstr "flaget '%s' kræver et argument\n" -#: scanopt.c:574 +#: src/scanopt.c:533 #, c-format msgid "option `%s' is ambiguous\n" msgstr "flaget '%s' er flertydig\n" -#: scanopt.c:578 +#: src/scanopt.c:537 #, c-format msgid "Unrecognized option `%s'\n" msgstr "Ukendt flag: '%s'\n" -#: scanopt.c:582 +#: src/scanopt.c:541 #, c-format msgid "Unknown error=(%d)\n" msgstr "Ukendt fejl=(%d)\n" -#: sym.c:100 +#: src/sym.c:92 msgid "symbol table memory allocation failed" msgstr "hukommelsestildeling for symboltabel mislykkedes" -#: sym.c:202 +#: src/sym.c:183 msgid "name defined twice" msgstr "navnet defineret to gange" -#: sym.c:253 +#: src/sym.c:231 #, c-format msgid "start condition %s declared twice" msgstr "startbetingelse %s deklareret to gange" -#: yylex.c:56 +#: src/yylex.c:57 msgid "premature EOF" msgstr "for tidlig filslut" -#: yylex.c:198 +#: src/yylex.c:200 #, c-format msgid "End Marker\n" msgstr "Slutmarkering\n" -#: yylex.c:204 +#: src/yylex.c:206 #, c-format msgid "*Something Weird* - tok: %d val: %d\n" msgstr "*Noget mærkeligt* - tegn: %d værdi: %d\n" + +#~ msgid "dynamic memory failure in copy_string()" +#~ msgstr "dynamisk hukommelsesfejl i copy_string()" @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: flex 2.5.36\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-08-03 13:42+0200\n" "Last-Translator: Michael Piefel <piefel@informatik.hu-berlin.de>\n" "Language-Team: German <translation-team-de@lists.sourceforge.net>\n" @@ -15,43 +15,44 @@ 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" -#: buf.c:78 +#: src/buf.c:79 msgid "Allocation of buffer to print string failed" msgstr "Anlegen des Puffers zur Ausgabe der Zeichenkette fehlgeschlagen" -#: buf.c:100 +#: src/buf.c:107 msgid "Allocation of buffer for line directive failed" msgstr "Anlegen des Puffers für Zeilen-Direktive fehlgeschlagen" -#: buf.c:177 +#: src/buf.c:177 msgid "Allocation of buffer for m4 def failed" msgstr "Anlegen des Puffers für m4 def fehlgeschlagen" -#: buf.c:197 +#: src/buf.c:198 msgid "Allocation of buffer for m4 undef failed" msgstr "Anlegen des Puffers für m4 undef fehlgeschlagen" -#: dfa.c:61 +#: src/dfa.c:59 #, c-format msgid "State #%d is non-accepting -\n" msgstr "Zustand #%d ist nicht-akzeptierend –\n" -#: dfa.c:124 +#: src/dfa.c:119 msgid "dangerous trailing context" msgstr "gefährlicher folgender Kontext" -#: dfa.c:166 +#: src/dfa.c:159 #, c-format msgid " associated rule line numbers:" msgstr " verbundene Regelzeilennummern" -#: dfa.c:202 +#: src/dfa.c:193 #, c-format msgid " out-transitions: " msgstr " Aus-Ãœbergänge: " -#: dfa.c:210 +#: src/dfa.c:201 #, c-format msgid "" "\n" @@ -60,11 +61,11 @@ msgstr "" "\n" " Hemm-Ãœbergänge: EOF " -#: dfa.c:341 +#: src/dfa.c:331 msgid "consistency check failed in epsclosure()" msgstr "Konsistenzprüfung fehlgeschlagen in epsclosure()" -#: dfa.c:429 +#: src/dfa.c:419 msgid "" "\n" "\n" @@ -76,24 +77,24 @@ msgstr "" "DFA-Ausgabe:\n" "\n" -#: dfa.c:604 +#: src/dfa.c:587 msgid "could not create unique end-of-buffer state" msgstr "konnte keinen einzigartigen Ende-des-Puffers-Zustand erzeugen" -#: dfa.c:625 +#: src/dfa.c:608 #, c-format msgid "state # %d:\n" msgstr "Zustand # %d:\n" -#: dfa.c:785 +#: src/dfa.c:768 msgid "Could not write yynxt_tbl[][]" msgstr "Konnte yynxt_tbl[][] nicht schreiben" -#: dfa.c:1049 +#: src/dfa.c:1028 msgid "bad transition character detected in sympartition()" msgstr "ungültiges Ãœbergangszeichen in sympartition() entdeckt" -#: gen.c:478 +#: src/gen.c:480 msgid "" "\n" "\n" @@ -105,29 +106,29 @@ msgstr "" "Äquivalenz-Klassen:\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 "Zustand # %d akzeptiert: [%d]\n" -#: gen.c:1110 +#: src/gen.c:1115 #, c-format msgid "state # %d accepts: " msgstr "Zustand # %d akzeptiert: " -#: gen.c:1157 +#: src/gen.c:1162 msgid "Could not write yyacclist_tbl" msgstr "Konnte yyacclist_tbl nicht schreiben" -#: gen.c:1233 +#: src/gen.c:1236 msgid "Could not write yyacc_tbl" msgstr "Konnte yyacc_tbl nicht schreiben" -#: 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 "Konnte ecstbl nicht schreiben" -#: gen.c:1271 +#: src/gen.c:1271 msgid "" "\n" "\n" @@ -137,392 +138,408 @@ msgstr "" "\n" "Meta-Äquivalenz-Klassen:\n" -#: gen.c:1293 +#: src/gen.c:1293 msgid "Could not write yymeta_tbl" msgstr "Konnte yymeta_tbl nicht schreiben" -#: gen.c:1354 +#: src/gen.c:1352 msgid "Could not write yybase_tbl" msgstr "Konnte yybase_tbl nicht schreiben" -#: gen.c:1388 +#: src/gen.c:1384 msgid "Could not write yydef_tbl" msgstr "Konnte yydef_tbl nicht schreiben" -#: gen.c:1428 +#: src/gen.c:1422 msgid "Could not write yynxt_tbl" msgstr "Konnte yynxt_tbl nicht schreiben" -#: gen.c:1464 +#: src/gen.c:1456 msgid "Could not write yychk_tbl" msgstr "Konnte yychk_tbl nicht schreiben" -#: gen.c:1618 gen.c:1647 +#: src/gen.c:1608 src/gen.c:1637 msgid "Could not write ftbl" msgstr "Konnte ftbl nicht schreiben" -#: gen.c:1624 +#: src/gen.c:1614 msgid "Could not write ssltbl" msgstr "Konnte ssltbl nicht schreiben" -#: gen.c:1675 +#: src/gen.c:1665 msgid "Could not write eoltbl" msgstr "Konnte eoltbl nicht schreiben" -#: gen.c:1735 +#: src/gen.c:1722 msgid "Could not write yynultrans_tbl" msgstr "Konnte yynultrans_tbl nicht schreiben" -#: main.c:189 +#: src/main.c:178 msgid "rule cannot be matched" msgstr "Regel kann nicht passen" -#: main.c:194 +#: src/main.c:183 msgid "-s option given but default rule can be matched" msgstr "„-s“-Option gegeben, aber Vorgabe-Regel kann nicht passen" -#: main.c:234 +#: src/main.c:221 msgid "Can't use -+ with -l option" msgstr "Kann nicht „-+“ zusammen mit „-l“-Option verwenden" -#: main.c:237 +#: src/main.c:224 msgid "Can't use -f or -F with -l option" msgstr "Kann nicht „-f“ oder „-F“ zusammen mit „-l“-Option verwenden" -#: main.c:241 +#: src/main.c:228 msgid "Can't use --reentrant or --bison-bridge with -l option" -msgstr "Kann nicht „--reentrant“ oder „--bison-bridge“ mit „-l“-Option verwenden" +msgstr "" +"Kann nicht „--reentrant“ oder „--bison-bridge“ mit „-l“-Option verwenden" -#: main.c:278 +#: src/main.c:260 msgid "-Cf/-CF and -Cm don't make sense together" msgstr "„-Cf“/„-CF“ und „-Cm“ sind zusammen nicht sinnvoll" -#: main.c:281 +#: src/main.c:263 msgid "-Cf/-CF and -I are incompatible" msgstr "„-Cf“/„-CF“ und „-I“ sind inkompatibel" -#: main.c:285 +#: src/main.c:267 msgid "-Cf/-CF are incompatible with lex-compatibility mode" msgstr "„-Cf“/„-CF“ sind inkompatibel mit lex-Kompatibilitätsmodus" -#: main.c:290 +#: src/main.c:272 msgid "-Cf and -CF are mutually exclusive" msgstr "„-Cf“ und „-CF“ schließen sich gegenseitig aus" -#: main.c:294 +#: src/main.c:276 msgid "Can't use -+ with -CF option" msgstr "Kann nicht „-+“ zusammen mit „-CF“-Option verwenden" -#: main.c:297 +#: src/main.c:279 #, c-format msgid "%array incompatible with -+ option" msgstr "„%array“ inkompatibel mit „-+“-Option" -#: main.c:302 +#: src/main.c:284 msgid "Options -+ and --reentrant are mutually exclusive." msgstr "Optionen „-+“ und „--reentrant“ schließen sich gegenseitig aus." -#: main.c:305 +#: src/main.c:287 msgid "bison bridge not supported for the C++ scanner." msgstr "Brücke zu Bison für den C++-Scanner nicht unterstützt." -#: main.c:360 main.c:406 +#: src/main.c:336 src/main.c:419 #, c-format msgid "could not create %s" msgstr "konnte %s nicht erzeugen" -#: main.c:419 +#: src/main.c:431 msgid "could not write tables header" msgstr "konnte Tabellenköpfe nicht schreiben" -#: main.c:423 +#: src/main.c:435 #, c-format msgid "can't open skeleton file %s" msgstr "kann Skelett-Datei %s nicht öffnen" -#: main.c:459 +#: src/main.c:450 +msgid "Prefix cannot include '[' or ']'" +msgstr "" + +#: src/main.c:474 msgid "allocation of macro definition failed" msgstr "Anlegen der Makrodefinition fehlgeschlagen" -#: main.c:507 +#: src/main.c:521 #, c-format msgid "input error reading skeleton file %s" msgstr "Eingabefehler beim Lesen der Skelett-Datei %s" -#: main.c:511 +#: src/main.c:525 #, c-format msgid "error closing skeleton file %s" msgstr "Fehler beim Schließen der Skelett-Datei %s" -#: main.c:696 +#: src/main.c:709 #, c-format msgid "error creating header file %s" msgstr "Fehler beim Erstellen der Header-Datei %s" -#: main.c:704 +#: src/main.c:717 #, c-format msgid "error writing output file %s" msgstr "Fehler beim Schreiben der Ausgabe-Datei %s" -#: main.c:708 +#: src/main.c:721 #, c-format msgid "error closing output file %s" msgstr "Fehler beim Schließen der Ausgabe-Datei %s" -#: main.c:712 +#: src/main.c:725 #, c-format msgid "error deleting output file %s" msgstr "Fehler beim Löschen der Ausgabe-Datei %s" -#: main.c:719 +#: src/main.c:732 #, c-format msgid "No backing up.\n" msgstr "Kein Backing-up.\n" -#: main.c:723 +#: src/main.c:736 #, c-format msgid "%d backing up (non-accepting) states.\n" msgstr "%d Zustände mit Backing-up (nicht akzeptierend).\n" -#: main.c:727 +#: src/main.c:740 #, c-format msgid "Compressed tables always back up.\n" msgstr "Komprimierte Tabellen benutzen immer Backing-up.\n" -#: main.c:730 +#: src/main.c:743 #, c-format msgid "error writing backup file %s" msgstr "Fehler beim Schreiben der Backup-Datei %s" -#: main.c:734 +#: src/main.c:747 #, c-format msgid "error closing backup file %s" msgstr "Fehler beim Schließen der Backup-Datei %s" -#: main.c:739 +#: src/main.c:752 #, c-format msgid "%s version %s usage statistics:\n" msgstr "%s Version %s Benutzungsstatistiken:\n" -#: main.c:742 +#: src/main.c:755 #, c-format msgid " scanner options: -" msgstr " Scanner-Optionen: -" -#: main.c:821 +#: src/main.c:834 #, c-format msgid " %d/%d NFA states\n" msgstr " %d/%d NFA-Zustände\n" -#: main.c:823 +#: src/main.c:836 #, c-format msgid " %d/%d DFA states (%d words)\n" msgstr " %d/%d DFA-Zustände (%d Wörter)\n" -#: main.c:825 +#: src/main.c:838 #, c-format msgid " %d rules\n" msgstr " %d Regeln\n" -#: main.c:830 +#: src/main.c:843 #, c-format msgid " No backing up\n" msgstr " Kein Backing-up.\n" -#: main.c:834 +#: src/main.c:847 #, c-format msgid " %d backing-up (non-accepting) states\n" msgstr " %d Zustände mit Backing-up (nicht akzeptierend).\n" -#: main.c:839 +#: src/main.c:852 #, c-format msgid " Compressed tables always back-up\n" msgstr " Komprimierte Tabellen benutzen immer Backing-up.\n" -#: main.c:843 +#: src/main.c:856 #, c-format msgid " Beginning-of-line patterns used\n" msgstr " Zeilenanfang-Muster benutzt\n" -#: main.c:845 +#: src/main.c:858 #, c-format msgid " %d/%d start conditions\n" msgstr " %d/%d Startbedingungen\n" -#: main.c:849 +#: src/main.c:862 #, c-format msgid " %d epsilon states, %d double epsilon states\n" msgstr " %d Epsilon-Zustände, %d Doppel-Epsilon-Zustände\n" -#: main.c:853 +#: src/main.c:866 #, c-format msgid " no character classes\n" msgstr " keine Zeichenklassen\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 Zeichenklassen brauchten %d/%d Speicherwörter, %d wiederbenutzt\n" +msgstr "" +" %d/%d Zeichenklassen brauchten %d/%d Speicherwörter, %d wiederbenutzt\n" -#: main.c:862 +#: src/main.c:875 #, c-format msgid " %d state/nextstate pairs created\n" msgstr " %d Zustand/Nächster-Zustand-Paare erzeugt\n" -#: main.c:865 +#: src/main.c:878 #, c-format msgid " %d/%d unique/duplicate transitions\n" msgstr " %d/%d einzigartige/doppelte Ãœbergänge\n" -#: main.c:870 +#: src/main.c:883 #, c-format msgid " %d table entries\n" msgstr " %d Tabelleneinträge\n" -#: main.c:878 +#: src/main.c:891 #, c-format msgid " %d/%d base-def entries created\n" msgstr " %d/%d Einträge „base-def“ erzeugt\n" -#: main.c:882 +#: src/main.c:895 #, c-format msgid " %d/%d (peak %d) nxt-chk entries created\n" msgstr " %d/%d (max. %d) Einträge „nxt-chk“ erzeugt\n" -#: main.c:886 +#: src/main.c:899 #, c-format msgid " %d/%d (peak %d) template nxt-chk entries created\n" msgstr " %d/%d (max. %d) Einträge „template nxt-chk“ erzeugt\n" -#: main.c:890 +#: src/main.c:903 #, c-format msgid " %d empty table entries\n" msgstr " %d leere Tabelleneinträge\n" -#: main.c:892 +#: src/main.c:905 #, c-format msgid " %d protos created\n" msgstr " %d Protos erzeugt\n" -#: main.c:895 +#: src/main.c:908 #, c-format msgid " %d templates created, %d uses\n" msgstr " %d Schablonen erzeugt, %d Benutzungen\n" -#: main.c:903 +#: src/main.c:916 #, c-format msgid " %d/%d equivalence classes created\n" msgstr " %d/%d Äquivalenz-Klassen erzeugt\n" -#: main.c:911 +#: src/main.c:924 #, c-format msgid " %d/%d meta-equivalence classes created\n" msgstr " %d/%d Meta-Äquivalenz-Klassen erzeugt\n" -#: main.c:917 +#: src/main.c:930 #, c-format msgid " %d (%d saved) hash collisions, %d DFAs equal\n" msgstr " %d (%d gespeichert) Hash-Kollisionen, %d DFAs gleich\n" -#: main.c:919 +#: src/main.c:932 #, c-format msgid " %d sets of reallocations needed\n" msgstr " %d Sätze von Neuallozierungen benötigt\n" -#: main.c:921 +#: src/main.c:934 #, c-format msgid " %d total table entries needed\n" msgstr " %d Tabelleneinträge insgesamt benötigt\n" -#: main.c:998 +#: src/main.c:1008 #, c-format msgid "Internal error. flexopts are malformed.\n" msgstr "Interner Fehler. flexopts sind missgestaltet.\n" -#: main.c:1008 +#: src/main.c:1018 #, c-format msgid "Try `%s --help' for more information.\n" msgstr "Versuchen Sie es mit „%s --help“ für mehr Informationen.\n" -#: main.c:1065 +#: src/main.c:1075 #, c-format msgid "unknown -C option '%c'" msgstr "unbekannte „-C“-Option „%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 "fataler Parse-Fehler" -#: main.c:1501 +#: src/main.c:1508 #, c-format msgid "could not create backing-up info file %s" msgstr "konnte Datei %s mit Informationen zum Backing-up nicht erzeugen" -#: 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-Kompatibilitätsmodus führt zu großen Geschwindigkeitseinbußen\n" +msgstr "" +"-l AT&T-lex-Kompatibilitätsmodus führt zu großen Geschwindigkeitseinbußen\n" -#: main.c:1525 +#: src/main.c:1532 #, c-format msgid " and may be the actual source of other reported performance penalties\n" -msgstr " und ist möglicherweise die wirkliche Quelle anderer gemeldeter Einbußen\n" +msgstr "" +" und ist möglicherweise die wirkliche Quelle anderer gemeldeter Einbußen\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" -msgstr "%%option yylineno führt zu Geschwindigkeitseinbußen NUR für Regeln, die auf einen Zeilenvorschub passen können\n" +msgid "" +"%%option yylineno entails a performance penalty ONLY on rules that can match " +"newline characters\n" +msgstr "" +"%%option yylineno führt zu Geschwindigkeitseinbußen NUR für Regeln, die auf " +"einen Zeilenvorschub passen können\n" -#: main.c:1538 +#: src/main.c:1545 #, c-format msgid "-I (interactive) entails a minor performance penalty\n" msgstr "-I (interaktiv) führt zu kleineren Geschwindigkeitseinbußen\n" -#: main.c:1543 +#: src/main.c:1550 #, c-format msgid "yymore() entails a minor performance penalty\n" msgstr "yymore() führt zu kleineren Geschwindigkeitseinbußen\n" -#: main.c:1549 +#: src/main.c:1556 #, c-format msgid "REJECT entails a large performance penalty\n" msgstr "REJECT führt zu großen Geschwindigkeitseinbußen\n" -#: main.c:1554 +#: src/main.c:1561 #, c-format msgid "Variable trailing context rules entail a large performance penalty\n" -msgstr "Regeln mit variablem folgenden Kontext führen zu großen Geschwindigkeitseinbußen\n" +msgstr "" +"Regeln mit variablem folgenden Kontext führen zu großen " +"Geschwindigkeitseinbußen\n" -#: main.c:1566 +#: src/main.c:1573 msgid "REJECT cannot be used with -f or -F" msgstr "REJECT kann nicht mit „-f“ oder „-F“ zusammen verwendet werden" -#: main.c:1569 +#: src/main.c:1576 #, c-format msgid "%option yylineno cannot be used with REJECT" msgstr "%option yylineno kann nicht mit REJECT zusammen verwendet werden" -#: main.c:1572 +#: src/main.c:1579 msgid "variable trailing context rules cannot be used with -f or -F" -msgstr "Regeln mit variablem folgenden Kontext können nicht mit „-f“ oder „-F“ verwendet werden" +msgstr "" +"Regeln mit variablem folgenden Kontext können nicht mit „-f“ oder „-F“ " +"verwendet werden" -#: main.c:1695 +#: src/main.c:1704 #, c-format msgid "%option yyclass only meaningful for C++ scanners" msgstr "%option yyclass ist nur bei C++-Scannern sinnvoll" -#: main.c:1802 +#: src/main.c:1791 #, c-format msgid "Usage: %s [OPTIONS] [FILE]...\n" msgstr "Aufruf: %s [OPTIONEN...] [DATEI...]\n" -#: main.c:1805 -#, c-format +#: src/main.c:1794 +#, fuzzy, c-format msgid "" "Generates programs that perform pattern-matching on text.\n" "\n" @@ -545,13 +562,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" @@ -573,8 +593,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" @@ -588,31 +606,36 @@ msgstr "" "Generiert Programme, die Mustererkennung in Texten durchführen.\n" "\n" "Tabellen-Komprimierung:\n" -" -Ca, --align erzeuge größere Tabellen, aber bessere Speicherausrichtung\n" +" -Ca, --align erzeuge größere Tabellen, aber bessere " +"Speicherausrichtung\n" " -Ce, --ecs konstruiere Äquivalenz-Klassen\n" " -Cf komprimiere Tabellen nicht; benutze „-f“-Repräsentation\n" " -CF komprimiere Tabellen nicht; benutze „-F“-Repräsentation\n" " -Cm, --meta-ecs konstruiere Meta-Äquivalenz-Klassen\n" " -Cr, --read benutze read() anstelle von stdio für Scannereingabe\n" " -f, --full generiere schnellen, großen Scanner. Genau wie -Cfr\n" -" -F, --fast benutze alternative Tabellenrepräsentation. Genau wie -CFr\n" +" -F, --fast benutze alternative Tabellenrepräsentation. Genau wie -" +"CFr\n" " -Cem Voreinstellung (genau wie --ecs --meta-ecs)\n" "\n" "Fehlersuche:\n" " -d, --debug Fehlersuch-(Debug-)Modus im Scanner aktivieren\n" " -b, --backup schreibe Backing-up-Information in %s\n" " -p, --perf-report schreibe Performanzbericht auf stderr\n" -" -s, --nodefault unterdücke Standardregel ECHO für nicht passenden Text\n" +" -s, --nodefault unterdücke Standardregel ECHO für nicht passenden " +"Text\n" " -T, --trace %s sollte im Trace-Modus laufen\n" " -w, --nowarn generiere keine Warnungen\n" -" -v, --verbose schreibe Zusammenfassung der Scannerstatistiken auf stdout\n" +" -v, --verbose schreibe Zusammenfassung der Scannerstatistiken " +"auf stdout\n" "\n" "Dateien:\n" " -o, --outfile=DATEI Ausgabe-Dateiname\n" " -S, --skel=DATEI Skelettdatei\n" " -t, --stdout gib Scanner auf stdout anstelle von %s aus\n" " --yyclass=NAME Name der C++-Klasse\n" -" --header-file=DATEI erstelle eine C-Headerdatei zusätzlich zum Scanner\n" +" --header-file=DATEI erstelle eine C-Headerdatei zusätzlich zum " +"Scanner\n" " --tables-file[=DATEI] schreibe Tabellen in DATEI\n" "\n" "Scannerverhalten:\n" @@ -647,51 +670,52 @@ msgstr "" " -h, --help produziere diese Hilfenachricht\n" " -V, --version melde %s-Version\n" -#: misc.c:65 +#: src/misc.c:64 msgid "allocation of sko_stack failed" msgstr "Anlegen des sko_stack fehlgeschlagen" -#: misc.c:102 misc.c:128 +#: src/misc.c:100 #, c-format msgid "name \"%s\" ridiculously long" msgstr "name „%s“ ist lächerlich lang" -#: misc.c:177 +#: src/misc.c:155 msgid "memory allocation failed in allocate_array()" msgstr "Speicheranforderung in allocate_array() fehlgeschlagen" -#: misc.c:230 +#: src/misc.c:205 #, c-format msgid "bad character '%s' detected in check_char()" msgstr "ungültiges Zeichen „%s“ in check_char() entdeckt" -#: misc.c:235 +#: src/misc.c:210 #, c-format msgid "scanner requires -8 flag to use the character %s" msgstr "Scanner erfordert Option „-8“, um das Zeichen %s benutzen zu können" -#: misc.c:268 -msgid "dynamic memory failure in copy_string()" -msgstr "Fehler beim dynamischen Speicher in copy_string()" +#: src/misc.c:229 +#, fuzzy +msgid "memory allocation failure in xstrdup()" +msgstr "Speicheranforderung in allocate_array() fehlgeschlagen" -#: misc.c:367 +#: src/misc.c:303 #, c-format msgid "%s: fatal internal error, %s\n" msgstr "%s: fataler interner Fehler, %s\n" -#: misc.c:803 +#: src/misc.c:671 msgid "attempt to increase array size failed" msgstr "Versuch, die Feldgröße zu erhöhen, fehlgeschlagen" -#: misc.c:930 +#: src/misc.c:795 msgid "bad line in skeleton file" msgstr "ungültige Zeile in Skelettdatei" -#: misc.c:979 +#: src/misc.c:845 msgid "memory allocation failed in yy_flex_xmalloc()" msgstr "Speicheranforderung in yy_flex_xmalloc() fehlgeschlagen" -#: nfa.c:104 +#: src/nfa.c:100 #, c-format msgid "" "\n" @@ -702,230 +726,247 @@ msgstr "" "\n" "********** beginne Ausgabe von NFA mit Startzustand %d\n" -#: nfa.c:115 +#: src/nfa.c:111 #, c-format msgid "state # %4d\t" msgstr "Zustand # %4d\t" -#: nfa.c:130 +#: src/nfa.c:126 #, c-format msgid "********** end of dump\n" msgstr "********** end der Ausgabe\n" -#: nfa.c:174 +#: src/nfa.c:169 msgid "empty machine in dupmachine()" msgstr "leere Maschine in dupmachine()" -#: nfa.c:240 +#: src/nfa.c:234 #, c-format msgid "Variable trailing context rule at line %d\n" msgstr "Regel mit veränderlichem folgenden Kontext in Zeile %d\n" -#: nfa.c:353 +#: src/nfa.c:357 msgid "bad state type in mark_beginning_as_normal()" msgstr "ungültiger Zustandstyp in mark_beginning_as_normal()" -#: nfa.c:598 +#: src/nfa.c:595 #, c-format msgid "input rules are too complicated (>= %d NFA states)" msgstr "Eingaberegeln sind zu kompliziert (>= %d NFA-Zustände)" -#: nfa.c:677 +#: src/nfa.c:673 msgid "found too many transitions in mkxtion()" msgstr "zu viele Ãœbergänge in mkxtion() gefunden" -#: nfa.c:703 +#: src/nfa.c:699 #, c-format msgid "too many rules (> %d)!" msgstr "zu viele Regeln (> %d)!" -#: parse.y:159 +#: src/parse.y:159 msgid "unknown error processing section 1" msgstr "unbekannter Fehler beim Bearbeiten von Abschnitt 1" -#: parse.y:184 parse.y:351 +#: src/parse.y:184 src/parse.y:353 msgid "bad start condition list" msgstr "ungültige Startbedingungs-Liste" -#: parse.y:315 +#: src/parse.y:204 +msgid "Prefix must not contain [ or ]" +msgstr "" + +#: src/parse.y:317 msgid "unrecognized rule" msgstr "nicht erkannte Regel" -#: 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 "folgender Kontext doppelt verwendet" -#: 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 "ungültige Iterationswerte" -#: 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 "Iterationswerte müssen positiv sein" -#: 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 "der Zeichenbereich [%c-%c] ist in Scannern ohne Beachtung von Groß-/Kleinschreibung mehrdeutig" +msgstr "" +"der Zeichenbereich [%c-%c] ist in Scannern ohne Beachtung von Groß-/" +"Kleinschreibung mehrdeutig" -#: parse.y:819 +#: src/parse.y:821 msgid "negative range in character class" msgstr "negativer Bereich in Zeichenklasse" -#: parse.y:916 +#: src/parse.y:918 msgid "[:^lower:] is ambiguous in case insensitive scanner" -msgstr "[:^lower:] ist in Scannern ohne Beachtung von Groß-/Kleinschreibung mehrdeutig" +msgstr "" +"[:^lower:] ist in Scannern ohne Beachtung von Groß-/Kleinschreibung " +"mehrdeutig" -#: parse.y:922 +#: src/parse.y:924 msgid "[:^upper:] ambiguous in case insensitive scanner" -msgstr "[:^upper:] ist in Scannern ohne Beachtung von Groß-/Kleinschreibung mehrdeutig" +msgstr "" +"[:^upper:] ist in Scannern ohne Beachtung von Groß-/Kleinschreibung " +"mehrdeutig" -#: 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 "Eingabezeile zu lang\n" -#: scan.l:161 +#: src/scan.l:183 #, c-format msgid "malformed '%top' directive" msgstr "falsch geformte „%top“-Direktive" -#: scan.l:183 +#: src/scan.l:205 #, no-c-format msgid "unrecognized '%' directive" msgstr "nicht erkannte „%“-Direktive" -#: scan.l:192 +#: src/scan.l:214 msgid "Definition name too long\n" msgstr "Definitionsname zu lang\n" -#: scan.l:284 +#: src/scan.l:309 msgid "Unmatched '{'" msgstr "Unbalancierte „{“" -#: scan.l:300 +#: src/scan.l:325 #, c-format msgid "Definition value for {%s} too long\n" msgstr "Definitionswert für {%s} ist zu lang\n" -#: scan.l:317 +#: src/scan.l:342 msgid "incomplete name definition" msgstr "unvollständige Namensdefinition" -#: scan.l:443 +#: src/scan.l:467 msgid "Option line too long\n" msgstr "Optionszeile zu lang\n" -#: scan.l:451 +#: src/scan.l:475 #, c-format msgid "unrecognized %%option: %s" msgstr "nicht erkannte %%option: %s" -#: scan.l:633 scan.l:800 +#: src/scan.l:659 src/scan.l:832 msgid "bad character class" msgstr "ungültige Zeichenklasse" -#: scan.l:683 +#: src/scan.l:709 #, c-format msgid "undefined definition {%s}" msgstr "undefinierte Definitione {%s}" -#: scan.l:755 +#: src/scan.l:772 +msgid "unbalanced parenthesis" +msgstr "" + +#: src/scan.l:787 #, c-format msgid "bad <start condition>: %s" msgstr "ungültige <Startbedingung>: %s" -#: scan.l:768 +#: src/scan.l:800 msgid "missing quote" msgstr "fehlendes Anführungszeichen" -#: scan.l:834 +#: src/scan.l:866 #, c-format msgid "bad character class expression: %s" msgstr "ungültiger Zeichenklassenausdruck: %s" -#: scan.l:856 +#: src/scan.l:888 msgid "bad character inside {}'s" msgstr "ungültiges Zeichen innerhalb von {}" -#: scan.l:862 +#: src/scan.l:894 msgid "missing }" msgstr "fehlende }" -#: scan.l:940 +#: src/scan.l:972 msgid "EOF encountered inside an action" msgstr "EOF innerhalb einer Aktion angetroffen" -#: scan.l:945 +#: src/scan.l:977 msgid "EOF encountered inside pattern" msgstr "EOF innerhalb eines Musters angetroffen" -#: scan.l:967 +#: src/scan.l:1010 #, c-format msgid "bad character: %s" msgstr "ungültiges Zeichen: %s" -#: scan.l:996 +#: src/scan.l:1038 #, c-format msgid "can't open %s" msgstr "kann %s nicht öffnen" -#: scanopt.c:291 +#: src/scanopt.c:259 #, c-format msgid "Usage: %s [OPTIONS]...\n" msgstr "Aufruf: %s [OPTIONEN...]\n" -#: scanopt.c:564 +#: src/scanopt.c:524 #, c-format msgid "option `%s' doesn't allow an argument\n" msgstr "Option „%s“ erlaubt kein Argument\n" -#: scanopt.c:569 +#: src/scanopt.c:529 #, c-format msgid "option `%s' requires an argument\n" msgstr "Option „%s“ verlangt ein Argument\n" -#: scanopt.c:573 +#: src/scanopt.c:533 #, c-format msgid "option `%s' is ambiguous\n" msgstr "Option „%s“ ist mehrdeutig\n" -#: scanopt.c:577 +#: src/scanopt.c:537 #, c-format msgid "Unrecognized option `%s'\n" msgstr "nicht erkannte Option „%s“\n" -#: scanopt.c:581 +#: src/scanopt.c:541 #, c-format msgid "Unknown error=(%d)\n" msgstr "Unbekannter Fehler=(%d)\n" -#: sym.c:100 +#: src/sym.c:92 msgid "symbol table memory allocation failed" msgstr "Speicheranforderung für Symboltabelle fehlgeschlagen" -#: sym.c:202 +#: src/sym.c:183 msgid "name defined twice" msgstr "Name zweimal definiert" -#: sym.c:253 +#: src/sym.c:231 #, c-format msgid "start condition %s declared twice" msgstr "Startbedingung %s zweimal definiert" -#: yylex.c:56 +#: src/yylex.c:57 msgid "premature EOF" msgstr "vorzeitiges EOF" -#: yylex.c:198 +#: src/yylex.c:200 #, c-format msgid "End Marker\n" msgstr "Endemarkierung\n" -#: yylex.c:204 +#: src/yylex.c:206 #, c-format msgid "*Something Weird* - tok: %d val: %d\n" msgstr "*Etwas Seltsames* - tok: %d val: %d\n" +#~ msgid "dynamic memory failure in copy_string()" +#~ msgstr "Fehler beim dynamischen Speicher in copy_string()" + #~ msgid "consistency check failed in symfollowset" #~ msgstr "Konstistenzüberprüfung in symfollowset fehlgeschlagen" @@ -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-09-08 07:15-0300\n" "Last-Translator: Felipe Castro <fefcas@gmail.com>\n" "Language-Team: Esperanto <translation-team-eo@lists.sourceforge.net>\n" @@ -15,43 +15,44 @@ 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" -#: buf.c:78 +#: src/buf.c:79 msgid "Allocation of buffer to print string failed" msgstr "Rezervo de bufro por printi ĉenon fiaskis" -#: buf.c:100 +#: src/buf.c:107 msgid "Allocation of buffer for line directive failed" msgstr "Rezervo de bufro por linia instrukcio fiaskis" -#: buf.c:177 +#: src/buf.c:177 msgid "Allocation of buffer for m4 def failed" msgstr "Rezervo de bufro por 'm4 def' fiaskis" -#: buf.c:197 +#: src/buf.c:198 msgid "Allocation of buffer for m4 undef failed" msgstr "Rezervo de bufro por 'm4 undef' fiaskis" -#: dfa.c:61 +#: src/dfa.c:59 #, c-format msgid "State #%d is non-accepting -\n" msgstr "Stato #%d estas ne-akceptanta -\n" -#: dfa.c:124 +#: src/dfa.c:119 msgid "dangerous trailing context" msgstr "danÄera vosta kunteksto" -#: dfa.c:166 +#: src/dfa.c:159 #, c-format msgid " associated rule line numbers:" msgstr " lini-numeroj de asociita regulo:" -#: dfa.c:202 +#: src/dfa.c:193 #, c-format msgid " out-transitions: " msgstr " for-transigoj: " -#: dfa.c:210 +#: src/dfa.c:201 #, c-format msgid "" "\n" @@ -60,11 +61,11 @@ msgstr "" "\n" " ĵam-transigoj: EOF " -#: dfa.c:341 +#: src/dfa.c:331 msgid "consistency check failed in epsclosure()" msgstr "kontrolo pri kohereco fiaskis ĉe epsclosure()" -#: dfa.c:429 +#: src/dfa.c:419 msgid "" "\n" "\n" @@ -76,24 +77,24 @@ msgstr "" "Nekropsio DFA:\n" "\n" -#: dfa.c:604 +#: src/dfa.c:587 msgid "could not create unique end-of-buffer state" msgstr "ne eblis krei unikan staton de bufro-fino" -#: dfa.c:625 +#: src/dfa.c:608 #, c-format msgid "state # %d:\n" msgstr "stato * %d:\n" -#: dfa.c:785 +#: src/dfa.c:768 msgid "Could not write yynxt_tbl[][]" msgstr "Ne eblis skribi yynxt_tbl[][]" -#: dfa.c:1049 +#: src/dfa.c:1028 msgid "bad transition character detected in sympartition()" msgstr "malÄusta transiga signo estis detektata en sympartition()" -#: gen.c:478 +#: src/gen.c:480 msgid "" "\n" "\n" @@ -105,29 +106,29 @@ msgstr "" "Ekvivalentecaj Klasoj:\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 "stato # %d akceptas: [%d]\n" -#: gen.c:1110 +#: src/gen.c:1115 #, c-format msgid "state # %d accepts: " msgstr "stato # %d akceptas: " -#: gen.c:1157 +#: src/gen.c:1162 msgid "Could not write yyacclist_tbl" msgstr "Ne eblis skribi yyacclist_tbl" -#: gen.c:1233 +#: src/gen.c:1236 msgid "Could not write yyacc_tbl" msgstr "Ne eblis skribi 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 "Ne eblis skribi ecstbl" -#: gen.c:1271 +#: src/gen.c:1271 msgid "" "\n" "\n" @@ -137,392 +138,404 @@ msgstr "" "\n" "Meta-Ekvivalentecaj Klasoj:\n" -#: gen.c:1293 +#: src/gen.c:1293 msgid "Could not write yymeta_tbl" msgstr "Ne eblis skribi yymeta_tbl" -#: gen.c:1354 +#: src/gen.c:1352 msgid "Could not write yybase_tbl" msgstr "Ne eblis skribi yybase_tbl" -#: gen.c:1388 +#: src/gen.c:1384 msgid "Could not write yydef_tbl" msgstr "Ne eblis skribi yydef_tbl" -#: gen.c:1428 +#: src/gen.c:1422 msgid "Could not write yynxt_tbl" msgstr "Ne eblis skribi yynxt_tbl" -#: gen.c:1464 +#: src/gen.c:1456 msgid "Could not write yychk_tbl" msgstr "Ne eblis skribi yychk_tbl" -#: gen.c:1618 gen.c:1647 +#: src/gen.c:1608 src/gen.c:1637 msgid "Could not write ftbl" msgstr "Ne eblis skribi ftbl" -#: gen.c:1624 +#: src/gen.c:1614 msgid "Could not write ssltbl" msgstr "Ne eblis skribi ssltbl" -#: gen.c:1675 +#: src/gen.c:1665 msgid "Could not write eoltbl" msgstr "Ne eblis skribi eoltbl" -#: gen.c:1735 +#: src/gen.c:1722 msgid "Could not write yynultrans_tbl" msgstr "Ne eblis skribi yynultrans_tbl" -#: main.c:189 +#: src/main.c:178 msgid "rule cannot be matched" msgstr "regulo ne povas esti korespondata" -#: main.c:194 +#: src/main.c:183 msgid "-s option given but default rule can be matched" -msgstr "la modifilo -s estis indikata sed la apriora regulo povas esti korespondata" +msgstr "" +"la modifilo -s estis indikata sed la apriora regulo povas esti korespondata" -#: main.c:234 +#: src/main.c:221 msgid "Can't use -+ with -l option" msgstr "Ne eblas uzi -+ kun la modifilo -l" -#: main.c:237 +#: src/main.c:224 msgid "Can't use -f or -F with -l option" msgstr "Ne eblas uzi -f aÅ -F kun la modifilo -l" -#: main.c:241 +#: src/main.c:228 msgid "Can't use --reentrant or --bison-bridge with -l option" msgstr "Ne eblas uzi --reentrant aÅ --bison-bridge kun la modifilo -l" -#: main.c:278 +#: src/main.c:260 msgid "-Cf/-CF and -Cm don't make sense together" msgstr "Sensencas -Cf/-CF kaj -Cm kune" -#: main.c:281 +#: src/main.c:263 msgid "-Cf/-CF and -I are incompatible" msgstr "-Cf/-CF kaj -I malakordas" -#: main.c:285 +#: src/main.c:267 msgid "-Cf/-CF are incompatible with lex-compatibility mode" msgstr "-Cf/-CF malakordas kun lex-akorda reÄimo" -#: main.c:290 +#: src/main.c:272 msgid "-Cf and -CF are mutually exclusive" msgstr "-Cf kaj -CF estas reciproke ekskluzivaj" -#: main.c:294 +#: src/main.c:276 msgid "Can't use -+ with -CF option" msgstr "Ne eblas uzi -+ kun la modifilo -CF" -#: main.c:297 +#: src/main.c:279 #, c-format msgid "%array incompatible with -+ option" msgstr "%array malakordas kun modifilo -+" -#: main.c:302 +#: src/main.c:284 msgid "Options -+ and --reentrant are mutually exclusive." msgstr "Modifiloj -+ kaj --reentrant estas reciproke ekskluzivaj." -#: main.c:305 +#: src/main.c:287 msgid "bison bridge not supported for the C++ scanner." msgstr "bison-ponto ne estas subtenata por la skanilo C++." -#: main.c:360 main.c:406 +#: src/main.c:336 src/main.c:419 #, c-format msgid "could not create %s" msgstr "ne eblis krei %s" -#: main.c:419 +#: src/main.c:431 msgid "could not write tables header" msgstr "ne eblis skribi tabel-kapojn" -#: main.c:423 +#: src/main.c:435 #, c-format msgid "can't open skeleton file %s" msgstr "ne eblas malfermi la skeletan dosieron %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 "rezervo de makroa difino fiaskis" -#: main.c:507 +#: src/main.c:521 #, c-format msgid "input error reading skeleton file %s" msgstr "eniga eraro dum lego de la skeleta dosiero %s" -#: main.c:511 +#: src/main.c:525 #, c-format msgid "error closing skeleton file %s" msgstr "eraro dum fermo de la skeleta dosiero %s" -#: main.c:696 +#: src/main.c:709 #, c-format msgid "error creating header file %s" msgstr "eraro dum kreo de la kap-dosiero %s" -#: main.c:704 +#: src/main.c:717 #, c-format msgid "error writing output file %s" msgstr "eraro dum skribo de la eliga dosiero %s" -#: main.c:708 +#: src/main.c:721 #, c-format msgid "error closing output file %s" msgstr "eraro dum fermo de la eliga dosiero %s" -#: main.c:712 +#: src/main.c:725 #, c-format msgid "error deleting output file %s" msgstr "eraro dum forigo de eliga dosiero %s" -#: main.c:719 +#: src/main.c:732 #, c-format msgid "No backing up.\n" msgstr "Sen savkopiado.\n" -#: main.c:723 +#: src/main.c:736 #, c-format msgid "%d backing up (non-accepting) states.\n" msgstr "%d savkopiadas (ne-akceptantajn) statojn.\n" -#: main.c:727 +#: src/main.c:740 #, c-format msgid "Compressed tables always back up.\n" msgstr "Densigitaj tabeloj ĉiam estas savkopiataj.\n" -#: main.c:730 +#: src/main.c:743 #, c-format msgid "error writing backup file %s" msgstr "eraro dum skribo de la savkopia dosiero %s" -#: main.c:734 +#: src/main.c:747 #, c-format msgid "error closing backup file %s" msgstr "eraro dum fermo de la savkopia dosiero %s" -#: main.c:739 +#: src/main.c:752 #, c-format msgid "%s version %s usage statistics:\n" msgstr "%s versio %s statistikoj pri usado:\n" -#: main.c:742 +#: src/main.c:755 #, c-format msgid " scanner options: -" msgstr " skanilaj modifiloj: -" -#: main.c:821 +#: src/main.c:834 #, c-format msgid " %d/%d NFA states\n" msgstr " %d/%d statoj NFA\n" -#: main.c:823 +#: src/main.c:836 #, c-format msgid " %d/%d DFA states (%d words)\n" msgstr " %d/%d statoj DFA (%d vortoj)\n" -#: main.c:825 +#: src/main.c:838 #, c-format msgid " %d rules\n" msgstr " %d reguloj\n" -#: main.c:830 +#: src/main.c:843 #, c-format msgid " No backing up\n" msgstr " Sen savkopiado\n" -#: main.c:834 +#: src/main.c:847 #, c-format msgid " %d backing-up (non-accepting) states\n" msgstr " %d savkopianta (ne-akceptantajn) statojn\n" -#: main.c:839 +#: src/main.c:852 #, c-format msgid " Compressed tables always back-up\n" msgstr " Densigitaj tabeloj ĉiam savkopiite\n" -#: main.c:843 +#: src/main.c:856 #, c-format msgid " Beginning-of-line patterns used\n" msgstr " modeloj komenco-de-linio estas uzataj\n" -#: main.c:845 +#: src/main.c:858 #, c-format msgid " %d/%d start conditions\n" msgstr " %d/%d komencaj kondiĉoj\n" -#: main.c:849 +#: src/main.c:862 #, c-format msgid " %d epsilon states, %d double epsilon states\n" msgstr " %d epsilonaj statoj, %d duoblaj epsilonaj statoj\n" -#: main.c:853 +#: src/main.c:866 #, c-format msgid " no character classes\n" msgstr " neniu signo-klaso\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 signo-klasoj bezonis %d/%d vortojn da memoro, %d reuzitaj\n" -#: main.c:862 +#: src/main.c:875 #, c-format msgid " %d state/nextstate pairs created\n" msgstr " %d stato/sekvstato-paroj estis kreataj\n" -#: main.c:865 +#: src/main.c:878 #, c-format msgid " %d/%d unique/duplicate transitions\n" msgstr " %d/%d unikaj/duobligitaj transigoj\n" -#: main.c:870 +#: src/main.c:883 #, c-format msgid " %d table entries\n" msgstr " %d tabel-enigoj\n" -#: main.c:878 +#: src/main.c:891 #, c-format msgid " %d/%d base-def entries created\n" msgstr " %d/%d bazo-def enigoj estis kreataj\n" -#: main.c:882 +#: src/main.c:895 #, c-format msgid " %d/%d (peak %d) nxt-chk entries created\n" msgstr " %d/%d (pinto %d) enigoj nxt-chk estis kreataj\n" -#: main.c:886 +#: src/main.c:899 #, c-format msgid " %d/%d (peak %d) template nxt-chk entries created\n" msgstr " %d/%d (pinto %d) Åablonaj enigoj nxt-chk estis kreataj\n" -#: main.c:890 +#: src/main.c:903 #, c-format msgid " %d empty table entries\n" msgstr " %d malplenaj tabel-enigoj\n" -#: main.c:892 +#: src/main.c:905 #, c-format msgid " %d protos created\n" msgstr " %d protoj estis kreataj\n" -#: main.c:895 +#: src/main.c:908 #, c-format msgid " %d templates created, %d uses\n" msgstr " %d Åablonoj estis kreataj, %d uzoj\n" -#: main.c:903 +#: src/main.c:916 #, c-format msgid " %d/%d equivalence classes created\n" msgstr " %d/%d ekvivalento-klasoj estis kreataj\n" -#: main.c:911 +#: src/main.c:924 #, c-format msgid " %d/%d meta-equivalence classes created\n" msgstr " %d/%d metaekvivalento-klasoj estis kreataj\n" -#: main.c:917 +#: src/main.c:930 #, c-format msgid " %d (%d saved) hash collisions, %d DFAs equal\n" msgstr " %d (%d konservitaj) haketaj kolizioj, %d DFA egalaj\n" -#: main.c:919 +#: src/main.c:932 #, c-format msgid " %d sets of reallocations needed\n" msgstr " %d aroj de relokigoj estas bezonataj\n" -#: main.c:921 +#: src/main.c:934 #, c-format msgid " %d total table entries needed\n" msgstr " entute %d tabel-enigoj estas bezonataj\n" -#: main.c:998 +#: src/main.c:1008 #, c-format msgid "Internal error. flexopts are malformed.\n" msgstr "Interna eraro. 'flexopt' estas misformitaj.\n" -#: main.c:1008 +#: src/main.c:1018 #, c-format msgid "Try `%s --help' for more information.\n" msgstr "Provu '%s --help' por pli da informo.\n" -#: main.c:1065 +#: src/main.c:1075 #, c-format msgid "unknown -C option '%c'" msgstr "nekonata modifilo -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 "neriparebla analiz-eraro" -#: main.c:1501 +#: src/main.c:1508 #, c-format msgid "could not create backing-up info file %s" msgstr "ne eblis krei savkopiad-informan dosieron %s" -#: main.c:1522 +#: src/main.c:1529 #, c-format msgid "-l AT&T lex compatibility option entails a large performance penalty\n" -msgstr "La modifilo -l AT&T de akordigo al lex alportas grandan malaltigon de rendimento\n" +msgstr "" +"La modifilo -l AT&T de akordigo al lex alportas grandan malaltigon de " +"rendimento\n" -#: main.c:1525 +#: src/main.c:1532 #, c-format msgid " and may be the actual source of other reported performance penalties\n" -msgstr " kaj povas esti la vera fonto de aliaj raportitaj malaltigoj de rendimento\n" +msgstr "" +" kaj povas esti la vera fonto de aliaj raportitaj malaltigoj de rendimento\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" -msgstr "%%option yylineno alportas malaltigon de rendimento NUR kun reguloj kiuj povas akordiÄi kun novliniaj signoj\n" +msgid "" +"%%option yylineno entails a performance penalty ONLY on rules that can match " +"newline characters\n" +msgstr "" +"%%option yylineno alportas malaltigon de rendimento NUR kun reguloj kiuj " +"povas akordiÄi kun novliniaj signoj\n" -#: main.c:1538 +#: src/main.c:1545 #, c-format msgid "-I (interactive) entails a minor performance penalty\n" msgstr "-I (interage) alportas etan malaltigon de rendimento\n" -#: main.c:1543 +#: src/main.c:1550 #, c-format msgid "yymore() entails a minor performance penalty\n" msgstr "yymore() alportas etan malaltigon de rendimento\n" -#: main.c:1549 +#: src/main.c:1556 #, c-format msgid "REJECT entails a large performance penalty\n" msgstr "REJECT alportas grandan malaltigon de rendimento\n" -#: main.c:1554 +#: src/main.c:1561 #, c-format msgid "Variable trailing context rules entail a large performance penalty\n" msgstr "Variabla vosta kunteksto alportas grandan malaltigon de rendimento\n" -#: main.c:1566 +#: src/main.c:1573 msgid "REJECT cannot be used with -f or -F" msgstr "REJECT ne povas esti uzata kun -f aÅ F" -#: main.c:1569 +#: src/main.c:1576 #, c-format msgid "%option yylineno cannot be used with REJECT" msgstr "%option yylineno ne povas esti uzata kun REJECT" -#: main.c:1572 +#: src/main.c:1579 msgid "variable trailing context rules cannot be used with -f or -F" msgstr "variablaj vostaj kuntekstaj reguloj ne povas esti uzataj kun -f aÅ F" -#: main.c:1695 +#: src/main.c:1704 #, c-format msgid "%option yyclass only meaningful for C++ scanners" msgstr "%option yyclass nur koheras por skaniloj C++" -#: main.c:1802 +#: src/main.c:1791 #, c-format msgid "Usage: %s [OPTIONS] [FILE]...\n" msgstr "Uzado: %s [MODIFILOJ] [DOSIERO]...\n" -#: main.c:1805 -#, c-format +#: src/main.c:1794 +#, fuzzy, c-format msgid "" "Generates programs that perform pattern-matching on text.\n" "\n" @@ -545,13 +558,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" @@ -573,8 +589,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" @@ -588,7 +602,8 @@ msgstr "" "Generas programojn kiuj prilaboras modelo-kongruon en tekstoj.\n" "\n" "Tabela Densigo:\n" -" -Ca, --align prilaboras pli grandajn tabelojn por pli bone organizi memoron\n" +" -Ca, --align prilaboras pli grandajn tabelojn por pli bone organizi " +"memoron\n" " -Ce, --ecs konstrui ekvivalento-klasojn\n" " -Cf ne densigi tabelojn; uzi reprezenton -f\n" " -CF ne densigi tabelojn; uzi reprezenton -F\n" @@ -602,10 +617,12 @@ msgstr "" " -d, --debug ebligi rafinigan reÄimon en la skanilo\n" " -b, --backup skribi savkopian informon al %s\n" " -p, --perf-report skribi raporton pri rendimento al 'stderr'\n" -" -s, --nodefault demeti aprioran regulon por EĤIGI nekongruan tekston\n" +" -s, --nodefault demeti aprioran regulon por EĤIGI nekongruan " +"tekston\n" " -T, --trace %s devos funkcii sub spura reÄimo\n" " -w, --nowarn ne generi avertojn\n" -" -v, --verbose skribi resumon de la skanilaj statistikoj al 'stdout'\n" +" -v, --verbose skribi resumon de la skanilaj statistikoj al " +"'stdout'\n" "\n" "Dosieroj:\n" " -o, --outfile=DOSIERO indiki eligan dosiernomon\n" @@ -627,7 +644,8 @@ msgstr "" "\n" "Generata kodumaĵo:\n" " -+, --c++ generi klason de skanilo C++\n" -" -Dmacro[=defn] uzi #define por makroo defn (apriora defn estas '1')\n" +" -Dmacro[=defn] uzi #define por makroo defn (apriora defn estas " +"'1')\n" " -L, --noline demeti instrukciojn #line en la skanilo\n" " -P, --prefix=ĈENO uzi ĈENOn kiel prefikson anstataÅ \"yy\"\n" " -R, --reentrant generi reenigan skanilon C\n" @@ -646,51 +664,52 @@ msgstr "" " -h, --help produkti tiun ĉi help-mesaÄon\n" " -V, --version raporti la version de %s\n" -#: misc.c:65 +#: src/misc.c:64 msgid "allocation of sko_stack failed" msgstr "rezervo de sko_stack fiaskis" -#: misc.c:102 misc.c:128 +#: src/misc.c:100 #, c-format msgid "name \"%s\" ridiculously long" msgstr "la nomo \"%s\" estas ridinde longa" -#: misc.c:177 +#: src/misc.c:155 msgid "memory allocation failed in allocate_array()" msgstr "rezervo de memoro fiaskis en allocate_array()" -#: misc.c:230 +#: src/misc.c:205 #, c-format msgid "bad character '%s' detected in check_char()" msgstr "malÄusta signo '%s' estis detektata en check_char()" -#: misc.c:235 +#: src/misc.c:210 #, c-format msgid "scanner requires -8 flag to use the character %s" msgstr "la skanilo postulas la flagon -8 por uzi la signon %s" -#: misc.c:268 -msgid "dynamic memory failure in copy_string()" -msgstr "fiasko de dinamika memoro en copy_string()" +#: src/misc.c:229 +#, fuzzy +msgid "memory allocation failure in xstrdup()" +msgstr "rezervo de memoro fiaskis en allocate_array()" -#: misc.c:367 +#: src/misc.c:303 #, c-format msgid "%s: fatal internal error, %s\n" msgstr "%s: neriparebla interna eraro, %s\n" -#: misc.c:803 +#: src/misc.c:671 msgid "attempt to increase array size failed" msgstr "provo pliigi grandon de tabelo fiaskis" -#: misc.c:930 +#: src/misc.c:795 msgid "bad line in skeleton file" msgstr "malÄusta linio en skeleta dosiero" -#: misc.c:979 +#: src/misc.c:845 msgid "memory allocation failed in yy_flex_xmalloc()" msgstr "rezervo de memoro fiaskis en yy_flex_xmalloc()" -#: nfa.c:104 +#: src/nfa.c:100 #, c-format msgid "" "\n" @@ -701,226 +720,237 @@ msgstr "" "\n" "********** komenco de Åuto de nfa kun ekstato %d\n" -#: nfa.c:115 +#: src/nfa.c:111 #, c-format msgid "state # %4d\t" msgstr "stato # %4d\t" -#: nfa.c:130 +#: src/nfa.c:126 #, c-format msgid "********** end of dump\n" msgstr "********** fino de Åuto\n" -#: nfa.c:174 +#: src/nfa.c:169 msgid "empty machine in dupmachine()" msgstr "malplena maÅino en dupmachine()" -#: nfa.c:240 +#: src/nfa.c:234 #, c-format msgid "Variable trailing context rule at line %d\n" msgstr "Variabla vosta kunteksta regulo ĉe linio %d\n" -#: nfa.c:353 +#: src/nfa.c:357 msgid "bad state type in mark_beginning_as_normal()" msgstr "malÄusta stat-tipo en mark_beginning_as_normal()" -#: nfa.c:598 +#: src/nfa.c:595 #, c-format msgid "input rules are too complicated (>= %d NFA states)" msgstr "enigaj reguloj estas tro komplikaj (>= %d statoj NFA)" -#: nfa.c:677 +#: src/nfa.c:673 msgid "found too many transitions in mkxtion()" msgstr "tro multe da transigoj estis trovataj en mkxtion()" -#: nfa.c:703 +#: src/nfa.c:699 #, c-format msgid "too many rules (> %d)!" msgstr "tro multe da reguoloj (> %d)!" -#: parse.y:159 +#: src/parse.y:159 msgid "unknown error processing section 1" msgstr "Nekonata erar-proceza sekcio 1" -#: parse.y:184 parse.y:351 +#: src/parse.y:184 src/parse.y:353 msgid "bad start condition list" msgstr "malÄusta komenc-kondiĉa listo" -#: parse.y:315 +#: src/parse.y:204 +msgid "Prefix must not contain [ or ]" +msgstr "" + +#: src/parse.y:317 msgid "unrecognized rule" msgstr "nerekonata regulo" -#: 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 "vosta kunteksto estis uzata duoble" -#: 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 "malÄustaj iteraciaj valoroj" -#: 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 "iteracia valoro devas esti pozitiva" -#: 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 "la signara intervalo [%c-%c] estas dusenca en sen-uskleca skanilo" -#: parse.y:819 +#: src/parse.y:821 msgid "negative range in character class" msgstr "negativa intervalo en signo-klaso" -#: parse.y:916 +#: src/parse.y:918 msgid "[:^lower:] is ambiguous in case insensitive scanner" msgstr "[:^lower:] estas dusenca en sen-uskleca skanilo" -#: parse.y:922 +#: src/parse.y:924 msgid "[:^upper:] ambiguous in case insensitive scanner" msgstr "[:^upper:] estas dusenca en sen-uskleca skanilo" -#: 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 "Eniga linio tro longas\n" -#: scan.l:161 +#: src/scan.l:183 #, c-format msgid "malformed '%top' directive" msgstr "misformita instrukcio '%top'" -#: scan.l:183 +#: src/scan.l:205 #, no-c-format msgid "unrecognized '%' directive" msgstr "nerekonita instrukcio '%'" -#: scan.l:192 +#: src/scan.l:214 msgid "Definition name too long\n" msgstr "Nom-difino tro longas\n" -#: scan.l:284 +#: src/scan.l:309 msgid "Unmatched '{'" msgstr "Senpara '{'" -#: scan.l:300 +#: src/scan.l:325 #, c-format msgid "Definition value for {%s} too long\n" msgstr "Valor-difino por {%s} tro longas\n" -#: scan.l:317 +#: src/scan.l:342 msgid "incomplete name definition" msgstr "nekompleta nom-difino" -#: scan.l:443 +#: src/scan.l:467 msgid "Option line too long\n" msgstr "Linio de modifiloj tro longas\n" -#: scan.l:451 +#: src/scan.l:475 #, c-format msgid "unrecognized %%option: %s" msgstr "nerekonita %%modifilo: %s" -#: scan.l:633 scan.l:800 +#: src/scan.l:659 src/scan.l:832 msgid "bad character class" msgstr "malÄusta signo-klaso" -#: scan.l:683 +#: src/scan.l:709 #, c-format msgid "undefined definition {%s}" msgstr "nedifinita difino {%s}" -#: scan.l:755 +#: src/scan.l:772 +msgid "unbalanced parenthesis" +msgstr "" + +#: src/scan.l:787 #, c-format msgid "bad <start condition>: %s" msgstr "malÄusta <komenca kondiĉo>: %s" -#: scan.l:768 +#: src/scan.l:800 msgid "missing quote" msgstr "mankas citilo" -#: scan.l:834 +#: src/scan.l:866 #, c-format msgid "bad character class expression: %s" msgstr "malÄusta signo-klasa esprimo: %s" -#: scan.l:856 +#: src/scan.l:888 msgid "bad character inside {}'s" msgstr "malÄusta signo interne de {}" -#: scan.l:862 +#: src/scan.l:894 msgid "missing }" msgstr "mankas }" -#: scan.l:940 +#: src/scan.l:972 msgid "EOF encountered inside an action" msgstr "EOF estis trovata interne de ago" -#: scan.l:945 +#: src/scan.l:977 msgid "EOF encountered inside pattern" msgstr "EOF estis trovata interne de modelo" -#: scan.l:967 +#: src/scan.l:1010 #, c-format msgid "bad character: %s" msgstr "malÄusta signo: %s" -#: scan.l:996 +#: src/scan.l:1038 #, c-format msgid "can't open %s" msgstr "ne eblas malfermi %s" -#: scanopt.c:291 +#: src/scanopt.c:259 #, c-format msgid "Usage: %s [OPTIONS]...\n" msgstr "Uzado: %s [MODIFILOJ]...\n" -#: scanopt.c:564 +#: src/scanopt.c:524 #, c-format msgid "option `%s' doesn't allow an argument\n" msgstr "la modifilo '%s' ne permesas argumenton\n" -#: scanopt.c:569 +#: src/scanopt.c:529 #, c-format msgid "option `%s' requires an argument\n" msgstr "la modifilo '%s' postulas argumenton\n" -#: scanopt.c:573 +#: src/scanopt.c:533 #, c-format msgid "option `%s' is ambiguous\n" msgstr "la modifilo '%s' estas dusenca\n" -#: scanopt.c:577 +#: src/scanopt.c:537 #, c-format msgid "Unrecognized option `%s'\n" msgstr "Nerekonita modifilo '%s'\n" -#: scanopt.c:581 +#: src/scanopt.c:541 #, c-format msgid "Unknown error=(%d)\n" msgstr "Nekonata eraro=(%d)\n" -#: sym.c:100 +#: src/sym.c:92 msgid "symbol table memory allocation failed" msgstr "rezervo de simbol-tabela memoro fiaskis" -#: sym.c:202 +#: src/sym.c:183 msgid "name defined twice" msgstr "nomo estis difinata duoble" -#: sym.c:253 +#: src/sym.c:231 #, c-format msgid "start condition %s declared twice" msgstr "la komenca kondiĉo %s estis deklarata duoble" -#: yylex.c:56 +#: src/yylex.c:57 msgid "premature EOF" msgstr "tro frua EOF" -#: yylex.c:198 +#: src/yylex.c:200 #, c-format msgid "End Marker\n" msgstr "Fino-markilo\n" -#: yylex.c:204 +#: src/yylex.c:206 #, c-format msgid "*Something Weird* - tok: %d val: %d\n" msgstr "*Io Stranga* - ero: %d val: %d\n" + +#~ msgid "dynamic memory failure in copy_string()" +#~ msgstr "fiasko de dinamika memoro en copy_string()" @@ -6,33 +6,55 @@ msgid "" msgstr "" "Project-Id-Version: GNU flex 2.5.8\n" -"POT-Creation-Date: 2002-06-19 09:43-0400\n" +"Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n" +"POT-Creation-Date: 2017-05-06 10:49-0400\n" "PO-Revision-Date: 2003-01-02 12:06+0100\n" "Last-Translator: Nicolás García-Pedrajas <ngarcia-pedrajas@acm.org>\n" "Language-Team: Spanish <es@li.org>\n" +"Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Transfer-Encoding: 8-bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: src/buf.c:79 +msgid "Allocation of buffer to print string failed" +msgstr "" + +#: src/buf.c:107 +msgid "Allocation of buffer for line directive failed" +msgstr "" + +#: src/buf.c:177 +msgid "Allocation of buffer for m4 def failed" +msgstr "" + +#: src/buf.c:198 +msgid "Allocation of buffer for m4 undef failed" +msgstr "" # El estado (?) sv -#: dfa.c:64 +#: src/dfa.c:59 #, c-format msgid "State #%d is non-accepting -\n" msgstr "El estado #%d es no-aceptar -\n" -#: dfa.c:131 +#: src/dfa.c:119 msgid "dangerous trailing context" msgstr "contexto posterior peligroso" -#: dfa.c:174 +#: src/dfa.c:159 +#, c-format msgid " associated rule line numbers:" msgstr " números de línea asociados a la regla:" -#: dfa.c:212 +#: src/dfa.c:193 +#, c-format msgid " out-transitions: " msgstr " fin de transiciones: " -#: dfa.c:220 +#: src/dfa.c:201 +#, c-format msgid "" "\n" " jam-transitions: EOF " @@ -51,13 +73,13 @@ msgstr "" # pues el verbo es testar, ¿cómo te suena? ng+ # # Sugiero usar prueba o comprobación. sv -#: dfa.c:357 +#: src/dfa.c:331 msgid "consistency check failed in epsclosure()" msgstr "el teste de consistencia falló en `epsclosure()'" # ¿Qué tal volcado? em # ok, a mí tampoco me gustaba descarga ng -#: dfa.c:443 +#: src/dfa.c:419 msgid "" "\n" "\n" @@ -69,27 +91,24 @@ msgstr "" "Volcado AFD:\n" "\n" -#: dfa.c:589 +#: src/dfa.c:587 msgid "could not create unique end-of-buffer state" msgstr "no se pudo crear un estado único de final-de-buffer" -#: dfa.c:610 +#: src/dfa.c:608 #, c-format msgid "state # %d:\n" msgstr "estado # %d:\n" -# Te he corregido un error de tecleo, y puesto entre comillas -# la llamada a la función em -# ok, lo de las comillas no lo sabía ng -#: dfa.c:994 -msgid "consistency check failed in symfollowset" -msgstr "falló el test de consistencia en `symfollowset'" +#: src/dfa.c:768 +msgid "Could not write yynxt_tbl[][]" +msgstr "" -#: dfa.c:1047 +#: src/dfa.c:1028 msgid "bad transition character detected in sympartition()" msgstr "carácter de transición erróneo detectado en sympartition()" -#: gen.c:251 +#: src/gen.c:480 msgid "" "\n" "\n" @@ -101,19 +120,32 @@ msgstr "" "Clases de equivalencia:\n" "\n" -#: gen.c:429 gen.c:913 +#: src/gen.c:669 src/gen.c:698 src/gen.c:1218 #, c-format msgid "state # %d accepts: [%d]\n" msgstr "el estado # %d acepta: [%d]\n" -#: gen.c:834 +#: src/gen.c:1115 #, c-format msgid "state # %d accepts: " msgstr "el estado # %d acepta: " +#: src/gen.c:1162 +msgid "Could not write yyacclist_tbl" +msgstr "" + +#: src/gen.c:1236 +msgid "Could not write yyacc_tbl" +msgstr "" + +#: src/gen.c:1251 src/gen.c:1623 src/gen.c:1646 +#, fuzzy +msgid "Could not write ecstbl" +msgstr "no se pudo crear %s" + # ¿No sería mejor "MetaEquivalencia" o "Meta-Equivalencia"? sv # yo prefiero como está, es el mismo caso de metafísica ng+ -#: gen.c:936 +#: src/gen.c:1271 msgid "" "\n" "\n" @@ -123,6 +155,46 @@ msgstr "" "\n" "Clases de metaequivalencia:\n" +#: src/gen.c:1293 +msgid "Could not write yymeta_tbl" +msgstr "" + +#: src/gen.c:1352 +#, fuzzy +msgid "Could not write yybase_tbl" +msgstr "no se pudo crear %s" + +#: src/gen.c:1384 +msgid "Could not write yydef_tbl" +msgstr "" + +#: src/gen.c:1422 +msgid "Could not write yynxt_tbl" +msgstr "" + +#: src/gen.c:1456 +msgid "Could not write yychk_tbl" +msgstr "" + +#: src/gen.c:1608 src/gen.c:1637 +#, fuzzy +msgid "Could not write ftbl" +msgstr "no se pudo crear %s" + +#: src/gen.c:1614 +#, fuzzy +msgid "Could not write ssltbl" +msgstr "no se pudo crear %s" + +#: src/gen.c:1665 +#, fuzzy +msgid "Could not write eoltbl" +msgstr "no se pudo crear %s" + +#: src/gen.c:1722 +msgid "Could not write yynultrans_tbl" +msgstr "" + # ¿coincidencia?, es la traducción habitual em # La traducción de match no me gusta pero no encuentro otra # Sugerencia: satisface, encaja, es aplicable. sv @@ -130,35 +202,33 @@ msgstr "" # abierta con una cerrada, por ejemplo, pero no cuando se trata de ver # si una regla "matches" o no "matches". # creo que aplicar no qeuda mal ng+ -#: main.c:163 +#: src/main.c:178 msgid "rule cannot be matched" msgstr "la regla no se puede aplicar" # ## re-redacto el mensaje. sv -#: main.c:168 +#: src/main.c:183 msgid "-s option given but default rule can be matched" -msgstr "se ha especificado la opción -s pero se puede aplicar la regla por defecto" +msgstr "" +"se ha especificado la opción -s pero se puede aplicar la regla por defecto" -#: main.c:203 +#: src/main.c:221 msgid "Can't use -+ with -l option" msgstr "No se puede usar -+ con la opción -l" -#: main.c:206 +#: src/main.c:224 msgid "Can't use -f or -F with -l option" msgstr "No se pueden usar las opciones -f o -F con la opción -l" -#: main.c:209 -msgid "Can't use -R or -Rb with -l option" +#: src/main.c:228 +#, fuzzy +msgid "Can't use --reentrant or --bison-bridge with -l option" msgstr "No se pueden usar las opciones -R o -Rb con la opción -l" -#: main.c:223 -msgid "Can't specify header option if writing to stdout." -msgstr "No se puede especificar una opción de cabecera si se escribe en stdout" - # ¿juntos o juntas? # Creo que está bien así em # ok ng -#: main.c:249 +#: src/main.c:260 msgid "-Cf/-CF and -Cm don't make sense together" msgstr "-Cf/-CF y -Cm no tienen sentido juntos" @@ -167,50 +237,63 @@ msgstr "-Cf/-CF y -Cm no tienen sentido juntos" # entonces lo dejo ng # Yo creo que en este caso no hace falta porque se leería así: # "menos ce efe o menos ce efe mayúscula y menos I son incompatibles". sv -#: main.c:252 +#: src/main.c:263 msgid "-Cf/-CF and -I are incompatible" msgstr "-Cf/-CF e -I son incompatibles" -#: main.c:256 +#: src/main.c:267 msgid "-Cf/-CF are incompatible with lex-compatibility mode" msgstr "-Cf/-CF son incompatibles con el modo de compatibilidad con lex" -#: main.c:260 -#, c-format -msgid "-Cf/-CF and %option yylineno are incompatible" -msgstr "-Cf/-CF y la %opción yylineno son incompatibles" - -#: main.c:263 +#: src/main.c:272 msgid "-Cf and -CF are mutually exclusive" msgstr "-Cf y -CF son mutuamente excluyentes" -#: main.c:267 +#: src/main.c:276 msgid "Can't use -+ with -CF option" msgstr "No se puede usar -+ con la opción -CF" -#: main.c:271 +#: src/main.c:279 #, c-format msgid "%array incompatible with -+ option" msgstr "%array incompatible con la opción -+" -#: main.c:276 -msgid "Options -+ and -R are mutually exclusive." +#: src/main.c:284 +#, fuzzy +msgid "Options -+ and --reentrant are mutually exclusive." msgstr "-+ y -R son mutuamente excluyentes" -#: main.c:328 main.c:524 +#: src/main.c:287 +msgid "bison bridge not supported for the C++ scanner." +msgstr "" + +#: src/main.c:336 src/main.c:419 #, c-format msgid "could not create %s" msgstr "no se pudo crear %s" +#: src/main.c:431 +#, fuzzy +msgid "could not write tables header" +msgstr "no se pudo crear %s" + # Lo mismo con skeleton, máscara o modelo em # lo mismo de antes ng # Lo mismo que antes :) em # idem ng+ -#: main.c:334 +#: src/main.c:435 #, c-format msgid "can't open skeleton file %s" msgstr "no se puede abrir el archivo de esquema %s" +#: src/main.c:450 +msgid "Prefix cannot include '[' or ']'" +msgstr "" + +#: src/main.c:474 +msgid "allocation of macro definition failed" +msgstr "" + # Skeleton se puede traducir por máscara, o por modelo em # Sí, lo estuve considerando. Pero el eskeleton file es un fichero que # le indica a flex la forma como tratar el fichero de entrada, y por eso me @@ -227,45 +310,46 @@ msgstr "no se puede abrir el archivo de esquema %s" # que decida una tercera persona # # ## Cambio "leyendo" por "al leer", como en otras traducciones. sv -#: main.c:492 +#: src/main.c:521 #, c-format msgid "input error reading skeleton file %s" msgstr "error de entrada al leer el archivo de esquema %s" # Otra vez :) em -#: main.c:496 +#: src/main.c:525 #, c-format msgid "error closing skeleton file %s" msgstr "error al cerrar el archivo de esquema %s" # Lo mismo, archivo de seguridad? em -#: main.c:690 +#: src/main.c:709 #, c-format msgid "error creating header file %s" msgstr "error al crear el archivo de cabecera %s" -#: main.c:698 +#: src/main.c:717 #, c-format msgid "error writing output file %s" msgstr "error al escribir el archivo de salida %s" -#: main.c:702 +#: src/main.c:721 #, c-format msgid "error closing output file %s" msgstr "error al cerrar el archivo de salida %s" -#: main.c:706 +#: src/main.c:725 #, c-format msgid "error deleting output file %s" msgstr "error al borrar el archivo de salida %s" # Copia de seguridad? em # Sugerencia: No hay retroceso. sv -#: main.c:714 +#: src/main.c:732 +#, c-format msgid "No backing up.\n" msgstr "Sin retroceso.\n" -#: main.c:717 +#: src/main.c:736 #, c-format msgid "%d backing up (non-accepting) states.\n" msgstr "%d estados de retroceso (no-aceptación).\n" @@ -275,12 +359,13 @@ msgstr "%d estados de retroceso (no-aceptación).\n" # "Compressed tables are always back up" # (supuesto que back es irregular y su pasado/participio es back y no backed, # que ahora mismo no me acuerdo). sv -#: main.c:721 +#: src/main.c:740 +#, c-format msgid "Compressed tables always back up.\n" msgstr "Las tablas comprimidas siempre implican un retraso.\n" # Lo mismo, archivo de seguridad? em -#: main.c:724 +#: src/main.c:743 #, c-format msgid "error writing backup file %s" msgstr "error al escribir el archivo de seguridad %s" @@ -288,45 +373,47 @@ msgstr "error al escribir el archivo de seguridad %s" # En todas las traducciones que ha aparecido # he sugerido el uso de copia de seguridad em # ok ng -#: main.c:728 +#: src/main.c:747 #, c-format msgid "error closing backup file %s" msgstr "error al cerrar el archivo de copia de seguridad %s" -#: main.c:734 +#: src/main.c:752 #, c-format msgid "%s version %s usage statistics:\n" msgstr "%s versión %s estadísticas de uso:\n" -#: main.c:737 +#: src/main.c:755 +#, c-format msgid " scanner options: -" msgstr " opciones del analizador: -" # NFA significa non-deterministic finite automata, así que lo he traducido # por AFN -#: main.c:817 +#: src/main.c:834 #, c-format msgid " %d/%d NFA states\n" msgstr " %d/%d estados AFN\n" # DFA significa deterministic finite autómata, lo he traducido por AFD -#: main.c:819 +#: src/main.c:836 #, c-format msgid " %d/%d DFA states (%d words)\n" msgstr " %d/%d estados AFD {%d palabras}\n" -#: main.c:821 +#: src/main.c:838 #, c-format msgid " %d rules\n" msgstr " %d reglas\n" # Otra vez ;) em # modificado como en la anterior ng -#: main.c:825 +#: src/main.c:843 +#, c-format msgid " No backing up\n" msgstr " Sin retroceso\n" -#: main.c:828 +#: src/main.c:847 #, c-format msgid " %d backing-up (non-accepting) states\n" msgstr " %d estados de retroceso (no-aceptación)\n" @@ -334,16 +421,18 @@ msgstr " %d estados de retroceso (no-aceptación)\n" # FIXME. # Informar al autor de que esta frase es casi idéntica a una anterior, para # que sólo haya que traducirla una vez. sv -#: main.c:832 +#: src/main.c:852 +#, c-format msgid " Compressed tables always back-up\n" msgstr " Siempre se realiza copia de seguridad de las tablas comprimidas\n" # Lo mismo "se han usado patrones de comienzo de línea". sv -#: main.c:836 +#: src/main.c:856 +#, c-format msgid " Beginning-of-line patterns used\n" msgstr " Usados patrones de comienzo-de-línea\n" -#: main.c:838 +#: src/main.c:858 #, c-format msgid " %d/%d start conditions\n" msgstr " %d/%d condiciones de activación\n" @@ -356,16 +445,17 @@ msgstr " %d/%d condiciones de activación\n" # lo de doble épsilon no lo he oído nunca. Creo que hay que dejar el término # técnico. ng # Tu mandas, no tengo nada que decir a eso em -#: main.c:841 +#: src/main.c:862 #, c-format msgid " %d epsilon states, %d double epsilon states\n" msgstr " %d estados épsilon, %d estados doble épsilon\n" -#: main.c:845 +#: src/main.c:866 +#, c-format msgid " no character classes\n" msgstr " sin clases de caracteres\n" -#: main.c:848 +#: src/main.c:870 #, c-format msgid " %d/%d character classes needed %d/%d words of storage, %d reused\n" msgstr "" @@ -376,13 +466,13 @@ msgstr "" # ¿Qué tal " se han creado %d pares estado/estado-siguiente"? # Bueno, mejor no lo hagas hasta que no se sepa cómo queda al lado # de las otras. sv -#: main.c:853 +#: src/main.c:875 #, c-format msgid " %d state/nextstate pairs created\n" msgstr " %d pares estado/estado-siguiente creados\n" # ## Añado sendas eses, ya que son transiciones. sv -#: main.c:855 +#: src/main.c:878 #, c-format msgid " %d/%d unique/duplicate transitions\n" msgstr " %d/%d transiciones únicas/duplicadas\n" @@ -391,50 +481,50 @@ msgstr " %d/%d transiciones únicas/duplicadas\n" # sí, mejor ng # ¿Que había antes? (¿entradas a la tabla?) # (entradas *de* la tabla me suena mejor) sv. -#: main.c:861 +#: src/main.c:883 #, c-format msgid " %d table entries\n" msgstr " %d entradas en la tabla\n" # ## pongo `comillas' en el base-def. sv -#: main.c:869 +#: src/main.c:891 #, c-format msgid " %d/%d base-def entries created\n" msgstr " %d/%d entradas `base-def' creadas\n" -#: main.c:872 +#: src/main.c:895 #, c-format msgid " %d/%d (peak %d) nxt-chk entries created\n" msgstr " %d/%d (pico %d) entradas nxt-chk creadas\n" -#: main.c:875 +#: src/main.c:899 #, c-format msgid " %d/%d (peak %d) template nxt-chk entries created\n" msgstr " %d/%d (pico %d) entradas de plantilla nxt-chk creadas\n" # ¿entradas a la tabla o entradas de la tabla? sv -#: main.c:879 +#: src/main.c:903 #, c-format msgid " %d empty table entries\n" msgstr " %d entradas en la tabla vacías\n" -#: main.c:881 +#: src/main.c:905 #, c-format msgid " %d protos created\n" msgstr " %d prototipos creados\n" -#: main.c:884 +#: src/main.c:908 #, c-format msgid " %d templates created, %d uses\n" msgstr " %d plantillas creadas, %d usos\n" -#: main.c:892 +#: src/main.c:916 #, c-format msgid " %d/%d equivalence classes created\n" msgstr " %d/%d clases de equivalencia creadas\n" # "se han creado..." sv -#: main.c:900 +#: src/main.c:924 #, c-format msgid " %d/%d meta-equivalence classes created\n" msgstr " %d/%d clases de metaequivalencia creadas\n" @@ -452,43 +542,40 @@ msgstr " %d/%d clases de metaequivalencia creadas\n" # un lugar que se puede determinar mediante una transformación directa de su # clave, por eso si hay dos claves iguales hay una colisión, porque dos # registros van al mismo sitio ng+ -#: main.c:905 +#: src/main.c:930 #, c-format msgid " %d (%d saved) hash collisions, %d DFAs equal\n" -msgstr " %d (%d almacenadas) colisiones de localización ('hash'), %d AFDs iguales\n" +msgstr "" +" %d (%d almacenadas) colisiones de localización ('hash'), %d AFDs iguales\n" -#: main.c:907 +#: src/main.c:932 #, c-format msgid " %d sets of reallocations needed\n" msgstr " se necesitan %d conjuntos de relocalización\n" # Lo mismo que en otro sitio: ¿table entries son entradas a la tabla o # de la tabla? sv -#: main.c:909 +#: src/main.c:934 #, c-format msgid " %d total table entries needed\n" msgstr " se necesitan %d entradas totales en la tabla\n" -#: main.c:966 +#: src/main.c:1008 +#, c-format msgid "Internal error. flexopts are malformed.\n" msgstr "Error interno. flexopts mal formadas.\n" -#: main.c:974 +#: src/main.c:1018 #, c-format msgid "Try `%s --help' for more information.\n" msgstr "Pruebe `%s --help' para más información.\n" -#: main.c:1033 +#: src/main.c:1075 #, c-format msgid "unknown -C option '%c'" msgstr "opción -C desconocida '%c'" -#: main.c:1116 -#, c-format -msgid "unknown -R option '%c'" -msgstr "opción -R desconocida '%c'" - -#: main.c:1153 +#: src/main.c:1204 #, c-format msgid "%s %s\n" msgstr "%s %s\n" @@ -505,7 +592,7 @@ msgstr "%s %s\n" # Sugerencia: error fatal. sv # con comillas es un término medio. Lo de error grave fue una sugerencia # de Enrique, y croe que queda mejor. ng+ -#: main.c:1395 +#: src/main.c:1476 msgid "fatal parse error" msgstr "error muy grave en el analizador sintáctico" @@ -528,71 +615,83 @@ msgstr "error muy grave en el analizador sintáctico" # ## # ## Eso no es válido ( solución, usa emacs po-mode :) ) em # ## ok, ya estoy instalando linux otra vez ng+ -#: main.c:1407 +#: src/main.c:1508 #, c-format msgid "could not create backing-up info file %s" msgstr "" "no se pudo crear el archivo de información de las reglas\n" "que producen un retroceso del analizador %s" -#: main.c:1429 +#: src/main.c:1529 +#, c-format msgid "-l AT&T lex compatibility option entails a large performance penalty\n" msgstr "" "-l la opción de compatibilidad con AT&T lex implica una penalización del\n" "rendimiento muy alta\n" -#: main.c:1431 +#: src/main.c:1532 +#, c-format msgid " and may be the actual source of other reported performance penalties\n" -msgstr " y puede ser el origen real de otras penalizaciones del rendimiento notificadas\n" +msgstr "" +" y puede ser el origen real de otras penalizaciones del rendimiento " +"notificadas\n" -#: main.c:1437 -#, c-format -msgid "%%option yylineno entails a large performance penalty\n" -msgstr "la %%opción yylineno implica una penalización del rendimiento muy alta\n" +#: src/main.c:1538 +#, fuzzy, c-format +msgid "" +"%%option yylineno entails a performance penalty ONLY on rules that can match " +"newline characters\n" +msgstr "" +"la %%opción yylineno implica una penalización del rendimiento muy alta\n" -#: main.c:1444 +#: src/main.c:1545 +#, c-format msgid "-I (interactive) entails a minor performance penalty\n" msgstr "-I (interactivo) implica una pequeña penalización del rendimiento\n" -#: main.c:1448 +#: src/main.c:1550 +#, c-format msgid "yymore() entails a minor performance penalty\n" msgstr "yymore() implica un pequeña penalización del rendimiento\n" -#: main.c:1453 +#: src/main.c:1556 +#, c-format msgid "REJECT entails a large performance penalty\n" msgstr "REJECT implica una penalización del rendimiento muy alta\n" -#: main.c:1457 +#: src/main.c:1561 +#, c-format msgid "Variable trailing context rules entail a large performance penalty\n" msgstr "" "La existencia de reglas de contexto posterior variable implica una\n" "penalización del rendimiento muy alta\n" -#: main.c:1470 +#: src/main.c:1573 msgid "REJECT cannot be used with -f or -F" msgstr "REJECT no se puede usar con -f o -F" -#: main.c:1473 -#, c-format -msgid "%option yylineno cannot be used with -f or -F" +#: src/main.c:1576 +#, fuzzy, c-format +msgid "%option yylineno cannot be used with REJECT" msgstr "la %opción yylineno no se puede usar con -f o -F" -#: main.c:1476 +#: src/main.c:1579 msgid "variable trailing context rules cannot be used with -f or -F" -msgstr "las reglas de contexto posterior variable no se pueden usar con -f o -F" +msgstr "" +"las reglas de contexto posterior variable no se pueden usar con -f o -F" -#: main.c:1607 +#: src/main.c:1704 #, c-format msgid "%option yyclass only meaningful for C++ scanners" msgstr "la %option yyclass sólo tiene sentido para los analizadores en C++" -#: main.c:1711 +#: src/main.c:1791 #, c-format msgid "Usage: %s [OPTIONS] [FILE]...\n" msgstr "Uso: %s [OPCIONES] [FICHERO]...\n" -#: main.c:1714 -#, c-format +#: src/main.c:1794 +#, fuzzy, c-format msgid "" "Generates programs that perform pattern-matching on text.\n" "\n" @@ -615,13 +714,17 @@ 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 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" " -7, --7bit generate 7-bit scanner\n" @@ -639,7 +742,8 @@ msgid "" " -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" -" -Rb, --reentrant-bison reentrant scanner for bison pure parser.\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" @@ -654,31 +758,37 @@ msgstr "" "Genera programas que realizan emparejado de patrones en texto.\n" "\n" "Compresión de tablas: (por defecto es -Cem)\n" -" -Ca, --align Renuncia a tablas grandes para mejorar la alineación en memoria\n" +" -Ca, --align Renuncia a tablas grandes para mejorar la alineación en " +"memoria\n" " -Ce, --ecs construye clases de equivalencia\n" " -Cf no comprime las tablas; utiliza la representación -f\n" " -CF no comprime las tablas; utiliza la representación -F\n" " -Cm, --meta-ecs construye clases de metaequivalencia\n" -" -Cr, --read utiliza read() en lugar de stdio para la entrada del analizador\n" +" -Cr, --read utiliza read() en lugar de stdio para la entrada del " +"analizador\n" " -f, --full genera una analizar rápido y grande. Igual que -Cfr\n" -" -F, --fast usa la representación de tablas alternativa. Igual que -CFr\n" +" -F, --fast usa la representación de tablas alternativa. Igual que -" +"CFr\n" " -Cem compresión por defecto (igual que --ecs --meta-ecs)\n" "\n" "Depurado:\n" " -d, --debug habilita el modo de depuración en el analizador\n" " -b, --backup escribe información de seguridad en %s\n" " -p, --perf-report escribe un informe de rendimiento en stderr\n" -" -s, --nodefault suprime la regla por defecto consistente en un ECHO de cualquier carácter sin emparejar\n" +" -s, --nodefault suprime la regla por defecto consistente en un " +"ECHO de cualquier carácter sin emparejar\n" " -T, --trace %s debería ejecutarse en modo traza\n" " -w, --nowarn no genera avisos\n" -" -v, --verbose escribe un resumen de estadísticas del analizador en stdout\n" +" -v, --verbose escribe un resumen de estadísticas del analizador " +"en stdout\n" "\n" "Ficheros:\n" " -o, --outfile=FILE especifica el nombre del fichero de salida\n" " -S, --skel=FILE especifica el fichero de esquema\n" " -t, --stdout escribe el analizador en stdout en lugar de en %s\n" " --yyclass=NAME nombre de la clase de C++\n" -" --header=FILE crea un fichero de cabecera de C además del analizador\n" +" --header=FILE crea un fichero de cabecera de C además del " +"analizador\n" "\n" "Comportamiento del analizador:\n" " -7, --7bit genera un analizador de 7 bits\n" @@ -687,7 +797,8 @@ msgstr "" " -i, --case-insensitive ignora mayúsculas y minúsculas en los patrones\n" " -l, --lex-compat compatibilidad máxima con lex\n" " -I, --interactive genera un analizador interactivo (opuesto a -B)\n" -" --yylineno mantiene información del conteo de líneas en yylineno\n" +" --yylineno mantiene información del conteo de líneas en " +"yylineno\n" "\n" "Código generado:\n" " -+, --c++ genera una clase C++ con el analizador\n" @@ -695,7 +806,8 @@ msgstr "" " -L, --noline suprime las directivas #line en el analizador\n" " -P, --prefix=STRING usa STRING como prefijo en lugar de \"yy\"\n" " -R, --reentrant generate un analizador C reentrante\n" -" -Rb, --reentrant-bison analizador reentrante para un analizador léxico bison puro.\n" +" -Rb, --reentrant-bison analizador reentrante para un analizador léxico " +"bison puro.\n" " --stdinit inicializa yyin/yyout a stdin/stdout\n" " --noFUNCTION no genera la función FUNCTION\n" "\n" @@ -706,7 +818,11 @@ msgstr "" " -h, --help produce este mensaje de ayuda\n" " -V, --version informa de la versión %s\n" -#: misc.c:47 +#: src/misc.c:64 +msgid "allocation of sko_stack failed" +msgstr "" + +#: src/misc.c:100 #, c-format msgid "name \"%s\" ridiculously long" msgstr "nombre \"%s\" ridículamente grande" @@ -716,45 +832,51 @@ msgstr "nombre \"%s\" ridículamente grande" # Sí, pero creo que sólo por mí. Normalmente esos mensajes # los dá la biblioteca C antes em # ok ng+ -#: misc.c:101 +#: src/misc.c:155 msgid "memory allocation failed in allocate_array()" msgstr "falló la asignación de memoria en `allocate_array()'" -#: misc.c:179 +#: src/misc.c:205 #, c-format msgid "bad character '%s' detected in check_char()" msgstr "carácter incorrecto '%s' detectado en `check_char()'" # he añadido el `poder' em # ok ng -#: misc.c:184 +#: src/misc.c:210 #, c-format msgid "scanner requires -8 flag to use the character %s" msgstr "el analizador requiere la opción -8 para poder usar el carácter %s" -#: misc.c:217 -msgid "dynamic memory failure in copy_string()" -msgstr "fallo de la memoria dinámica en copy_string()" +# Asignación de memoria em +# ¿está unificado? ng +# Sí, pero creo que sólo por mí. Normalmente esos mensajes +# los dá la biblioteca C antes em +# ok ng+ +#: src/misc.c:229 +#, fuzzy +msgid "memory allocation failure in xstrdup()" +msgstr "falló la asignación de memoria en `allocate_array()'" # Sugerencia: error fatal. sv -#: misc.c:349 +#: src/misc.c:303 #, c-format msgid "%s: fatal internal error, %s\n" msgstr "%s: error interno muy grave, %s\n" -#: misc.c:775 +#: src/misc.c:671 msgid "attempt to increase array size failed" msgstr "falló el intento de aumentar el tamaño de la matriz" -#: misc.c:847 +#: src/misc.c:795 msgid "bad line in skeleton file" msgstr "línea incorrecta en el archivo de esquema" -#: misc.c:892 +#: src/misc.c:845 msgid "memory allocation failed in yy_flex_xmalloc()" msgstr "la reserva de memoria falló en yy_flex_xmalloc()" -#: nfa.c:103 +#: src/nfa.c:100 #, c-format msgid "" "\n" @@ -765,103 +887,155 @@ msgstr "" "\n" "********** comenzando la descarga del AFN con el estado inicial %d\n" -#: nfa.c:115 +#: src/nfa.c:111 #, c-format msgid "state # %4d\t" msgstr "estado # %4d\t" # Sugerencia: volcado. sv # ok ng+ -#: nfa.c:130 +#: src/nfa.c:126 +#, c-format msgid "********** end of dump\n" msgstr "********** fin de volcado\n" -#: nfa.c:176 +#: src/nfa.c:169 msgid "empty machine in dupmachine()" msgstr "máquina vacía en `dupmachine()'" -#: nfa.c:228 +#: src/nfa.c:234 #, c-format msgid "Variable trailing context rule at line %d\n" msgstr "Regla de contexto posterior variable en la línea %d\n" -#: nfa.c:350 +#: src/nfa.c:357 msgid "bad state type in mark_beginning_as_normal()" msgstr "tipo de estado incorrecto en mark_beginning_as_normal()" -#: nfa.c:603 +#: src/nfa.c:595 #, c-format msgid "input rules are too complicated (>= %d NFA states)" msgstr "las reglas de entrada son demasiado complicadas (>= %d estados AFN)" # Sugerencia: se han encontrado... sv -#: nfa.c:682 +#: src/nfa.c:673 msgid "found too many transitions in mkxtion()" msgstr "encontradas demasiadas transiciones en mkxtion()" -#: nfa.c:708 +#: src/nfa.c:699 #, c-format msgid "too many rules (> %d)!" msgstr "demasiadas reglas (> %d)!" -#: parse.y:174 +#: src/parse.y:159 msgid "unknown error processing section 1" msgstr "error desconocido en el proceso de la sección 1" -#: parse.y:199 parse.y:362 +#: src/parse.y:184 src/parse.y:353 msgid "bad start condition list" msgstr "lista de condiciones de activación incorrecta" -#: parse.y:326 +#: src/parse.y:204 +msgid "Prefix must not contain [ or ]" +msgstr "" + +#: src/parse.y:317 msgid "unrecognized rule" msgstr "regla no reconocida" -#: parse.y:444 parse.y:457 parse.y:526 +#: src/parse.y:436 src/parse.y:449 src/parse.y:518 msgid "trailing context used twice" msgstr "contexto posterior usado dos veces" -#: parse.y:562 parse.y:572 parse.y:645 parse.y:655 +#: src/parse.y:554 src/parse.y:564 src/parse.y:637 src/parse.y:647 msgid "bad iteration values" msgstr "valores incorrectos para iteración" -#: parse.y:590 parse.y:608 parse.y:673 parse.y:691 +#: src/parse.y:582 src/parse.y:600 src/parse.y:665 src/parse.y:683 msgid "iteration value must be positive" msgstr "los valores para iteración deben ser positivos" -#: parse.y:785 +#: src/parse.y:806 src/parse.y:816 +#, c-format +msgid "the character range [%c-%c] is ambiguous in a case-insensitive scanner" +msgstr "" + +#: src/parse.y:821 msgid "negative range in character class" msgstr "rango negativo en clase caracteres" -#: scan.l:140 +#: src/parse.y:918 +#, fuzzy +msgid "[:^lower:] is ambiguous in case insensitive scanner" +msgstr "" +"\t-i genera un analizador que no distingue entre mayúsculas y minúsculas\n" + +#: src/parse.y:924 +#, fuzzy +msgid "[:^upper:] ambiguous in case insensitive scanner" +msgstr "" +"\t-i genera un analizador que no distingue entre mayúsculas y minúsculas\n" + +#: src/scan.l:82 src/scan.l:644 src/scan.l:702 +msgid "Input line too long\n" +msgstr "" + +#: src/scan.l:183 +#, fuzzy, c-format +msgid "malformed '%top' directive" +msgstr "directiva '%' no reconocida" + +#: src/scan.l:205 #, no-c-format msgid "unrecognized '%' directive" msgstr "directiva '%' no reconocida" -#: scan.l:207 +#: src/scan.l:214 +msgid "Definition name too long\n" +msgstr "" + +#: src/scan.l:309 +msgid "Unmatched '{'" +msgstr "" + +#: src/scan.l:325 +#, c-format +msgid "Definition value for {%s} too long\n" +msgstr "" + +#: src/scan.l:342 msgid "incomplete name definition" msgstr "definición de nombre incompleta" -#: scan.l:316 +#: src/scan.l:467 +msgid "Option line too long\n" +msgstr "" + +#: src/scan.l:475 #, c-format msgid "unrecognized %%option: %s" msgstr "%%opción no reconocida: %s" -#: scan.l:449 scan.l:549 +#: src/scan.l:659 src/scan.l:832 msgid "bad character class" msgstr "clase de caracteres incorrecta" -#: scan.l:481 +#: src/scan.l:709 #, c-format msgid "undefined definition {%s}" msgstr "definición no definida {%s}" -#: scan.l:517 +#: src/scan.l:772 +msgid "unbalanced parenthesis" +msgstr "" + +#: src/scan.l:787 #, c-format msgid "bad <start condition>: %s" msgstr "<condición de activación> incorrecta: %s" # Sugerencia: falta una comilla. sv -#: scan.l:530 +#: src/scan.l:800 msgid "missing quote" msgstr "falta comilla" @@ -869,97 +1043,122 @@ msgstr "falta comilla" # incorrecta la expresión ... em # ok, de traducir al final ocurre que acabas hablando al revés, # como en inglés ng -#: scan.l:570 +#: src/scan.l:866 #, c-format msgid "bad character class expression: %s" msgstr "expresión de la clase de caracteres incorrecta: %s" -#: scan.l:592 +#: src/scan.l:888 msgid "bad character inside {}'s" msgstr "carácter incorrecto dentro de {}'s" # Sugerencia: "falta una }". sv -#: scan.l:598 +#: src/scan.l:894 msgid "missing }" msgstr "falta }" -#: scan.l:671 +#: src/scan.l:972 msgid "EOF encountered inside an action" msgstr "Fin de archivo (EOF) encontrado dentro de una acción" -#: scan.l:691 +#: src/scan.l:977 +#, fuzzy +msgid "EOF encountered inside pattern" +msgstr "Fin de archivo (EOF) encontrado dentro de una acción" + +#: src/scan.l:1010 #, c-format msgid "bad character: %s" msgstr "carácter incorrecto: %s" -#: scan.l:720 +#: src/scan.l:1038 #, c-format msgid "can't open %s" msgstr "no se puede abrir %s" -#: scanopt.c:267 +#: src/scanopt.c:259 #, c-format msgid "Usage: %s [OPTIONS]...\n" msgstr "Uso: %s [OPCIONES]...\n" -#: scanopt.c:516 +#: src/scanopt.c:524 #, c-format msgid "option `%s' doesn't allow an argument\n" msgstr "la opción `%s' no permite un argumento\n" -#: scanopt.c:519 +#: src/scanopt.c:529 #, c-format msgid "option `%s' requires an argument\n" msgstr "la opción `%s' requiere un argumento\n" -#: scanopt.c:522 +#: src/scanopt.c:533 #, c-format msgid "option `%s' is ambiguous\n" msgstr "la opción `%s' es ambigua\n" -#: scanopt.c:525 +#: src/scanopt.c:537 #, c-format msgid "Unrecognized option `%s'\n" msgstr "Opción no reconocida `%s'\n" -#: scanopt.c:528 +#: src/scanopt.c:541 #, c-format msgid "Unknown error=(%d)\n" msgstr "Error desconocido=(%d)\n" # Asignación de memoria em -#: sym.c:100 +#: src/sym.c:92 msgid "symbol table memory allocation failed" msgstr "falló la reserva de memoria para la tabla de símbolos" # hay que procurar evitar esto, siempre nos suena mejor # el nombre ha sido definido dos veces, ¿qué te parece? em # mucho mejor, ya lo había pensado, pero no sabía cual era el estilo usual. ng -#: sym.c:210 +#: src/sym.c:183 msgid "name defined twice" msgstr "el nombre ha sido definido dos veces" # Aquí lo mismo 'la condición ... ha sido ..." em -#: sym.c:265 +#: src/sym.c:231 #, c-format msgid "start condition %s declared twice" msgstr "la condición de activación %s ha sido declarada dos veces" -#: yylex.c:58 +#: src/yylex.c:57 msgid "premature EOF" msgstr "fin de archivo (EOF) prematuro" -#: yylex.c:207 +#: src/yylex.c:200 +#, c-format msgid "End Marker\n" msgstr "Marcador de fin\n" # sobre lo de tok, me parece que es abreviatura de token. ng # en bison he traducido token por terminal, creo que es bueno unificar. ng -#: yylex.c:212 +#: src/yylex.c:206 #, c-format msgid "*Something Weird* - tok: %d val: %d\n" msgstr "*Algo extraño* - terminal: %d val: %d\n" +# Te he corregido un error de tecleo, y puesto entre comillas +# la llamada a la función em +# ok, lo de las comillas no lo sabía ng +#~ msgid "consistency check failed in symfollowset" +#~ msgstr "falló el test de consistencia en `symfollowset'" + +#~ msgid "Can't specify header option if writing to stdout." +#~ msgstr "" +#~ "No se puede especificar una opción de cabecera si se escribe en stdout" + +#~ msgid "-Cf/-CF and %option yylineno are incompatible" +#~ msgstr "-Cf/-CF y la %opción yylineno son incompatibles" + +#~ msgid "unknown -R option '%c'" +#~ msgstr "opción -R desconocida '%c'" + +#~ msgid "dynamic memory failure in copy_string()" +#~ msgstr "fallo de la memoria dinámica en copy_string()" + # Sugerencia: modificador '%c' desconocido -> opción '%c' desconocida. sv # ## usage - modo de empleo # ## pongo try - pruebe, como en otras traducciones. sv @@ -991,8 +1190,10 @@ msgstr "*Algo extraño* - terminal: %d val: %d\n" #~ msgstr "la opción -C se debe especificar separadamente" # Skeleton otra vez ( recuerdo máscara, o modelos ) em -#~ msgid "%s [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -ooutput -Pprefix -Sskeleton]\n" -#~ msgstr "%s [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -osalida -Pprefijo -Sesquema]\n" +#~ msgid "" +#~ "%s [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -ooutput -Pprefix -Sskeleton]\n" +#~ msgstr "" +#~ "%s [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -osalida -Pprefijo -Sesquema]\n" #~ msgid "\t[--help --version] [file ...]\n" #~ msgstr "\t[--help --version] [archivo ...]\n" @@ -1019,9 +1220,6 @@ msgstr "*Algo extraño* - terminal: %d val: %d\n" #~ msgid "\t-h produce this help message\n" #~ msgstr "\t-h produce este mensaje de ayuda\n" -#~ msgid "\t-i generate case-insensitive scanner\n" -#~ msgstr "\t-i genera un analizador que no distingue entre mayúsculas y minúsculas\n" - #~ msgid "\t-l maximal compatibility with original lex\n" #~ msgstr "\t-l compatibilidad máxima con el lex original\n" @@ -1031,10 +1229,14 @@ msgstr "*Algo extraño* - terminal: %d val: %d\n" # He cambiado el orden salida de error estándar, ponía em #~ msgid "\t-p generate performance report to stderr\n" -#~ msgstr "\t-p genera el informe de rendimiento en la salida de error estándar (stderr)\n" +#~ msgstr "" +#~ "\t-p genera el informe de rendimiento en la salida de error estándar " +#~ "(stderr)\n" #~ msgid "\t-s suppress default rule to ECHO unmatched text\n" -#~ msgstr "\t-s suprime la regla por defecto de visualizar (ECHO) el texto no emparejado\n" +#~ msgstr "" +#~ "\t-s suprime la regla por defecto de visualizar (ECHO) el texto no " +#~ "emparejado\n" #~ msgid "\t-t write generated scanner on stdout instead of %s\n" #~ msgstr "" @@ -1096,7 +1298,8 @@ msgstr "*Algo extraño* - terminal: %d val: %d\n" #~ msgstr "\t-? produce este mensaje de ayuda\n" #~ msgid "\t-C specify degree of table compression (default is -Cem):\n" -#~ msgstr "\t-C especifica el grado de compresión de la tabla (por defecto -Cem):\n" +#~ msgstr "" +#~ "\t-C especifica el grado de compresión de la tabla (por defecto -Cem):\n" #~ msgid "\t\t-Ca trade off larger tables for better memory alignment\n" #~ msgstr "" @@ -1107,10 +1310,14 @@ msgstr "*Algo extraño* - terminal: %d val: %d\n" #~ msgstr "\t\t-Ce construye clases de equivalencia\n" #~ msgid "\t\t-Cf do not compress scanner tables; use -f representation\n" -#~ msgstr "\t\t-Cf no comprime las tablas del analizador, utiliza la representación -f\n" +#~ msgstr "" +#~ "\t\t-Cf no comprime las tablas del analizador, utiliza la representación " +#~ "-f\n" #~ msgid "\t\t-CF do not compress scanner tables; use -F representation\n" -#~ msgstr "\t\t-CF no comprime las tablas del analizador, utiliza la representación -F\n" +#~ msgstr "" +#~ "\t\t-CF no comprime las tablas del analizador, utiliza la representación " +#~ "-F\n" #~ msgid "\t\t-Cm construct meta-equivalence classes\n" #~ msgstr "\t\t-cm construye clases de metaequivalencia\n" @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: flex 2.5.36\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-08-02 21:16+0200\n" "Last-Translator: Jorma Karvonen <karvonen.jorma@gmail.com>\n" "Language-Team: Finnish <translation-team-fi@lists.sourceforge.net>\n" @@ -16,45 +16,46 @@ 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=2; plural=(n != 1);\n" -#: buf.c:78 +#: src/buf.c:79 msgid "Allocation of buffer to print string failed" msgstr "Puskurin varaaminen merkkijonon tulostamiseen epäonnistui" -#: buf.c:100 +#: src/buf.c:107 msgid "Allocation of buffer for line directive failed" msgstr "Puskurin varaaminen rividirektiiville epäonnistui" -#: buf.c:177 +#: src/buf.c:177 msgid "Allocation of buffer for m4 def failed" msgstr "Puskurin varaaminen m4 def -määrittelylle epäonnistui" -#: buf.c:197 +#: src/buf.c:198 msgid "Allocation of buffer for m4 undef failed" msgstr "Puskurin varaaminen m4 undef -määrittelylle epäonnistui" -#: dfa.c:61 +#: src/dfa.c:59 #, c-format msgid "State #%d is non-accepting -\n" msgstr "Tila #%d on ei-hyväksyvä -\n" # Sanastollisessa analyysissä (lexical analysis) esimerkiksi kauttaviivalla ilmoitetaan, että viivan jälkeinen teksti kuuluu "trailing context"-tekstiin -#: dfa.c:124 +#: src/dfa.c:119 msgid "dangerous trailing context" msgstr "vaarallinen jättökonteksti" -#: dfa.c:166 +#: src/dfa.c:159 #, c-format msgid " associated rule line numbers:" msgstr " yhdistetyt sääntörivinumerot:" -#: dfa.c:202 +#: src/dfa.c:193 #, c-format msgid " out-transitions: " msgstr " ulossiirtymät: " -#: dfa.c:210 +#: src/dfa.c:201 #, c-format msgid "" "\n" @@ -63,12 +64,12 @@ msgstr "" "\n" " ruuhkasiirtymät: TIEDOSTONLOPPUMERKKI " -#: dfa.c:341 +#: src/dfa.c:331 msgid "consistency check failed in epsclosure()" msgstr "yhtenäisyystarkistus epäonnistui epsclosure()-funktiossa" # DFA on akronyymi käsitteelle "deterministic finite automaton" eli deterministinen äärellinen automaatti. -#: dfa.c:429 +#: src/dfa.c:419 msgid "" "\n" "\n" @@ -80,24 +81,24 @@ msgstr "" "Deterministisen äärellisen automaatin vedos:\n" "\n" -#: dfa.c:604 +#: src/dfa.c:587 msgid "could not create unique end-of-buffer state" msgstr "ei voitu luoda uniikkia puskurinlopputilaa" -#: dfa.c:625 +#: src/dfa.c:608 #, c-format msgid "state # %d:\n" msgstr "tila numero %d:\n" -#: dfa.c:785 +#: src/dfa.c:768 msgid "Could not write yynxt_tbl[][]" msgstr "Ei voitu kirjoittaa yynxt_tbl[][]" -#: dfa.c:1049 +#: src/dfa.c:1028 msgid "bad transition character detected in sympartition()" msgstr "väärä siirtymämerkki havaittu funktiossa sympartition()" -#: gen.c:478 +#: src/gen.c:480 msgid "" "\n" "\n" @@ -109,29 +110,29 @@ msgstr "" "Ekvivalenssiluokat:\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 "tila numero %d hyväksyy: [%d]\n" -#: gen.c:1110 +#: src/gen.c:1115 #, c-format msgid "state # %d accepts: " msgstr "tila numero %d hyväksyy: " -#: gen.c:1157 +#: src/gen.c:1162 msgid "Could not write yyacclist_tbl" msgstr "Ei voitu kirjoittaa: yyacclist_tbl" -#: gen.c:1233 +#: src/gen.c:1236 msgid "Could not write yyacc_tbl" msgstr "Ei voitu kirjoittaa: 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 "Ei voitu kirjoitaa ecstbl" -#: gen.c:1271 +#: src/gen.c:1271 msgid "" "\n" "\n" @@ -141,394 +142,409 @@ msgstr "" "\n" "Meta-ekvivalenssiluokkia:\n" -#: gen.c:1293 +#: src/gen.c:1293 msgid "Could not write yymeta_tbl" msgstr "Ei voitu kirjoittaa: yymeta_tbl" -#: gen.c:1354 +#: src/gen.c:1352 msgid "Could not write yybase_tbl" msgstr "Ei voitu kirjoittaa: yybase_tbl" -#: gen.c:1388 +#: src/gen.c:1384 msgid "Could not write yydef_tbl" msgstr "Ei voitu kirjoittaa: yydef_tbl" -#: gen.c:1428 +#: src/gen.c:1422 msgid "Could not write yynxt_tbl" msgstr "Ei voitu kirjoittaa: yynxt_tbl" -#: gen.c:1464 +#: src/gen.c:1456 msgid "Could not write yychk_tbl" msgstr "Ei voitu kirjoittaa: yychk_tbl" -#: gen.c:1618 gen.c:1647 +#: src/gen.c:1608 src/gen.c:1637 msgid "Could not write ftbl" msgstr "Ei voitu kirjoittaa: ftbl" -#: gen.c:1624 +#: src/gen.c:1614 msgid "Could not write ssltbl" msgstr "Ei voitu kirjoittaa: ssltbl" -#: gen.c:1675 +#: src/gen.c:1665 msgid "Could not write eoltbl" msgstr "Ei voitu kirjoittaa: eoltbl" -#: gen.c:1735 +#: src/gen.c:1722 msgid "Could not write yynultrans_tbl" msgstr "Ei voitu kirjoittaa: yynultrans_tbl" -#: main.c:189 +#: src/main.c:178 msgid "rule cannot be matched" msgstr "sääntö ei voinut täsmätä" -#: main.c:194 +#: src/main.c:183 msgid "-s option given but default rule can be matched" msgstr "valitsin -s annettu mutta oletussääntö ei voinut täsmätä" -#: main.c:234 +#: src/main.c:221 msgid "Can't use -+ with -l option" msgstr "Ei voi käyttää -+ valitsimen -l kanssa" -#: main.c:237 +#: src/main.c:224 msgid "Can't use -f or -F with -l option" msgstr "Ei voi käyttää valitsinta -f tai -F valitsimen -l kanssa" -#: main.c:241 +#: src/main.c:228 msgid "Can't use --reentrant or --bison-bridge with -l option" -msgstr "Ei voi käyttää valitsinta --reentrant tai --bison-bridge valitsimen -l kanssa" +msgstr "" +"Ei voi käyttää valitsinta --reentrant tai --bison-bridge valitsimen -l kanssa" -#: main.c:278 +#: src/main.c:260 msgid "-Cf/-CF and -Cm don't make sense together" msgstr "-Cf/-CF ja -Cm eivät ole järkeviä yhdessä" -#: main.c:281 +#: src/main.c:263 msgid "-Cf/-CF and -I are incompatible" msgstr "-Cf/-CF ja -I ovat yhteensopimattomia" -#: main.c:285 +#: src/main.c:267 msgid "-Cf/-CF are incompatible with lex-compatibility mode" msgstr "-Cf/-CF ovat yhteensopimattomia lex-yhteensopivuustilassa" -#: main.c:290 +#: src/main.c:272 msgid "-Cf and -CF are mutually exclusive" msgstr "-Cf ja -CF ovat toisensa poissulkevia" -#: main.c:294 +#: src/main.c:276 msgid "Can't use -+ with -CF option" msgstr "Ei voi käyttää valitsinta -+ valitsimen -CF kanssa" -#: main.c:297 +#: src/main.c:279 #, c-format msgid "%array incompatible with -+ option" msgstr "%array on yhteensopimaton valitsimen -+ kanssa" -#: main.c:302 +#: src/main.c:284 msgid "Options -+ and --reentrant are mutually exclusive." msgstr "Valitsimen -+ ja --reentrant ovat toisensa poissulkevia." # bison bridge tarkoittaa, että flex käyttää bison-ohjelmaa analyysissä -#: main.c:305 +#: src/main.c:287 msgid "bison bridge not supported for the C++ scanner." msgstr "â€bison bridgeâ€-menettelyä ei tueta C++-skannerille." -#: main.c:360 main.c:406 +#: src/main.c:336 src/main.c:419 #, c-format msgid "could not create %s" msgstr "ei voitu luoda %s" -#: main.c:419 +#: src/main.c:431 msgid "could not write tables header" msgstr "ei voitu kirjoittaa tauluotsaketta" -#: main.c:423 +#: src/main.c:435 #, c-format msgid "can't open skeleton file %s" msgstr "ei voi avata kehystiedostoa %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 "Makromäärityksen varaaminen epäonnistui" -#: main.c:507 +#: src/main.c:521 #, c-format msgid "input error reading skeleton file %s" msgstr "syötevirhe luettaessa kehystiedostoa %s" -#: main.c:511 +#: src/main.c:525 #, c-format msgid "error closing skeleton file %s" msgstr "virhe suljettaessa kehystiedostoa %s" -#: main.c:696 +#: src/main.c:709 #, c-format msgid "error creating header file %s" msgstr "virhe luotaessa otsaketiedostoa %s" -#: main.c:704 +#: src/main.c:717 #, c-format msgid "error writing output file %s" msgstr "virhe kirjoitettaessa tulostetiedostoa %s" -#: main.c:708 +#: src/main.c:721 #, c-format msgid "error closing output file %s" msgstr "virhe suljettaessa tulostetiedostoa %s" -#: main.c:712 +#: src/main.c:725 #, c-format msgid "error deleting output file %s" msgstr "virhe poistettaessa tulostetiedostoa %s" -#: main.c:719 +#: src/main.c:732 #, c-format msgid "No backing up.\n" msgstr "Ei varmuuskopiointia.\n" -#: main.c:723 +#: src/main.c:736 #, c-format msgid "%d backing up (non-accepting) states.\n" msgstr "%d (ei-hyväksyvää) varmuuskopiointitilaa.\n" -#: main.c:727 +#: src/main.c:740 #, c-format msgid "Compressed tables always back up.\n" msgstr "Tiivistetyt taulut varmuuskopioidaan aina.\n" -#: main.c:730 +#: src/main.c:743 #, c-format msgid "error writing backup file %s" msgstr "virhe kirjoitettaessa varmuuskopiotiedostoa %s" -#: main.c:734 +#: src/main.c:747 #, c-format msgid "error closing backup file %s" msgstr "virhe suljettaessa varmuuskopiotiedostoa %s" -#: main.c:739 +#: src/main.c:752 #, c-format msgid "%s version %s usage statistics:\n" msgstr "%s-version %s käyttötilastot:\n" -#: main.c:742 +#: src/main.c:755 #, c-format msgid " scanner options: -" msgstr " skannerivalitsimet: -" # Epädeterministinen äärellinen automaatti, lyh. NFA (engl. non-deterministic finite-state automaton) -#: main.c:821 +#: src/main.c:834 #, c-format msgid " %d/%d NFA states\n" msgstr " %d/%d Epädeterministisen äärellisen automaatin tilaa\n" -#: main.c:823 +#: src/main.c:836 #, c-format msgid " %d/%d DFA states (%d words)\n" msgstr " %d/%d Deterministisen äärellisen automaatin tilaa (%d sanaa)\n" -#: main.c:825 +#: src/main.c:838 #, c-format msgid " %d rules\n" msgstr " %d sääntöä\n" -#: main.c:830 +#: src/main.c:843 #, c-format msgid " No backing up\n" msgstr " Ei varmuuskopiointia\n" -#: main.c:834 +#: src/main.c:847 #, c-format msgid " %d backing-up (non-accepting) states\n" msgstr " %d (ei-hyväksyvää) varmuuskopiotilaa\n" -#: main.c:839 +#: src/main.c:852 #, c-format msgid " Compressed tables always back-up\n" msgstr " Tiivistetyt taulut varmuuskopioidaan aina\n" -#: main.c:843 +#: src/main.c:856 #, c-format msgid " Beginning-of-line patterns used\n" msgstr " Rivin-alku-malleja käytetään\n" -#: main.c:845 +#: src/main.c:858 #, c-format msgid " %d/%d start conditions\n" msgstr " %d/%d-käynnistysehtoja\n" -#: main.c:849 +#: src/main.c:862 #, c-format msgid " %d epsilon states, %d double epsilon states\n" msgstr " %d epsilon-tilaa, %d double epsilon-tilaa\n" -#: main.c:853 +#: src/main.c:866 #, c-format msgid " no character classes\n" msgstr " ei merkkiluokkia\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 merkkiluokkaa tarvittu %d/%d tallennussanaan, %d käytetty uudelleen\n" +msgstr "" +" %d/%d merkkiluokkaa tarvittu %d/%d tallennussanaan, %d käytetty uudelleen\n" -#: main.c:862 +#: src/main.c:875 #, c-format msgid " %d state/nextstate pairs created\n" msgstr " %d tila/seuraavatila-paria luotu\n" -#: main.c:865 +#: src/main.c:878 #, c-format msgid " %d/%d unique/duplicate transitions\n" msgstr " %d/%d uniikkia/kaksoiskappelsiirtymää\n" -#: main.c:870 +#: src/main.c:883 #, c-format msgid " %d table entries\n" msgstr " %d-tauluriviä\n" -#: main.c:878 +#: src/main.c:891 #, c-format msgid " %d/%d base-def entries created\n" msgstr " %d/%d base-def-alkiota luotu\n" -#: main.c:882 +#: src/main.c:895 #, c-format msgid " %d/%d (peak %d) nxt-chk entries created\n" msgstr " %d/%d (huippu %d) nxt-chk-alkiota luotu\n" -#: main.c:886 +#: src/main.c:899 #, c-format msgid " %d/%d (peak %d) template nxt-chk entries created\n" msgstr " %d/%d (huippu %d) malline nxt-chk-alkiota luotu\n" -#: main.c:890 +#: src/main.c:903 #, c-format msgid " %d empty table entries\n" msgstr " %d tyhjää taulualkiota\n" -#: main.c:892 +#: src/main.c:905 #, c-format msgid " %d protos created\n" msgstr " %d protoa luotu\n" -#: main.c:895 +#: src/main.c:908 #, c-format msgid " %d templates created, %d uses\n" msgstr " %d mallinetta luotu, %d käytetään\n" -#: main.c:903 +#: src/main.c:916 #, c-format msgid " %d/%d equivalence classes created\n" msgstr " %d/%d ekvivalenssiluokkaa luotu\n" -#: main.c:911 +#: src/main.c:924 #, c-format msgid " %d/%d meta-equivalence classes created\n" msgstr " %d/%d meta-ekvivalenssiluokkaa luotu\n" -#: main.c:917 +#: src/main.c:930 #, c-format msgid " %d (%d saved) hash collisions, %d DFAs equal\n" -msgstr " %d (%d tallennettu) hash-törmäykset, yhtäsuuri kuin %d Deterministisen äärellisen automaatin törmäystä\n" +msgstr "" +" %d (%d tallennettu) hash-törmäykset, yhtäsuuri kuin %d Deterministisen " +"äärellisen automaatin törmäystä\n" -#: main.c:919 +#: src/main.c:932 #, c-format msgid " %d sets of reallocations needed\n" msgstr " %d uudelleenvarausjoukkoa tarvittu\n" -#: main.c:921 +#: src/main.c:934 #, c-format msgid " %d total table entries needed\n" msgstr " %d taulukkoalkiota tarvittu yhteensä\n" -#: main.c:998 +#: src/main.c:1008 #, c-format msgid "Internal error. flexopts are malformed.\n" msgstr "Sisäinen virhe. flex-valitsimet ovat vääränmuotoisia.\n" -#: main.c:1008 +#: src/main.c:1018 #, c-format msgid "Try `%s --help' for more information.\n" msgstr "Lisätietoja käskyllä â€%s --helpâ€.\n" -#: main.c:1065 +#: src/main.c:1075 #, c-format msgid "unknown -C option '%c'" msgstr "tuntematon valitsin -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 "vakava jäsennysvirhe" -#: main.c:1501 +#: src/main.c:1508 #, c-format msgid "could not create backing-up info file %s" msgstr "ei voitu luoda varmuuskopiotietotiedostoa %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-yhteensopivuusvalitsin tuo mukanaan ison suorituskykysakon\n" +msgstr "" +"-l AT&T lex-yhteensopivuusvalitsin tuo mukanaan ison suorituskykysakon\n" -#: main.c:1525 +#: src/main.c:1532 #, c-format msgid " and may be the actual source of other reported performance penalties\n" -msgstr " ja saattaa olla muiden ilmoitettujen suorituskykysakkojen todellinen lähde\n" +msgstr "" +" ja saattaa olla muiden ilmoitettujen suorituskykysakkojen todellinen lähde\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" -msgstr "%%option yylineno tuo mukanaan suorituskykysakon VAIN säännöissä, jotka voivat täsmätä rivinvaihtomerkkeihin\n" +msgid "" +"%%option yylineno entails a performance penalty ONLY on rules that can match " +"newline characters\n" +msgstr "" +"%%option yylineno tuo mukanaan suorituskykysakon VAIN säännöissä, jotka " +"voivat täsmätä rivinvaihtomerkkeihin\n" -#: main.c:1538 +#: src/main.c:1545 #, c-format msgid "-I (interactive) entails a minor performance penalty\n" msgstr "-I (interaktiivinen) tuo mukanaan pienemmän suorituskykysakon\n" -#: main.c:1543 +#: src/main.c:1550 #, c-format msgid "yymore() entails a minor performance penalty\n" msgstr "yymore() tuo mukanaan pienemmän suorituskykysakon\n" -#: main.c:1549 +#: src/main.c:1556 #, c-format msgid "REJECT entails a large performance penalty\n" msgstr "REJECT tuo mukanaan ison suorituskykyrangaistuksen\n" -#: main.c:1554 +#: src/main.c:1561 #, c-format msgid "Variable trailing context rules entail a large performance penalty\n" msgstr "Muuttujajättökontekstisäännöt tuovat mukanaan ison suorityskykysakon\n" -#: main.c:1566 +#: src/main.c:1573 msgid "REJECT cannot be used with -f or -F" msgstr "REJECT ei voida käyttää valitsimen -f tai -F kanssa" -#: main.c:1569 +#: src/main.c:1576 #, c-format msgid "%option yylineno cannot be used with REJECT" msgstr "%option yylineno ei voi käyttää REJECT:n kanssa" -#: main.c:1572 +#: src/main.c:1579 msgid "variable trailing context rules cannot be used with -f or -F" -msgstr "muuttujajättökontekstisääntöjä ei voida käyttää valitsimen -f tai -F kanssa" +msgstr "" +"muuttujajättökontekstisääntöjä ei voida käyttää valitsimen -f tai -F kanssa" -#: main.c:1695 +#: src/main.c:1704 #, c-format msgid "%option yyclass only meaningful for C++ scanners" msgstr "%option yyclass on merkityksellinen vain C++-skannereille" -#: main.c:1802 +#: src/main.c:1791 #, c-format msgid "Usage: %s [OPTIONS] [FILE]...\n" msgstr "Käyttö: %s [VALITSIMET] [TIEDOSTO]...\n" -#: main.c:1805 -#, c-format +#: src/main.c:1794 +#, fuzzy, c-format msgid "" "Generates programs that perform pattern-matching on text.\n" "\n" @@ -551,13 +567,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" @@ -579,8 +598,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" @@ -594,12 +611,14 @@ msgstr "" "Luo ohjelmia, jotka suorittavat tekstin mallintäsmäystä.\n" "\n" "Taulutiivistys:\n" -" -Ca, --align kompromissi laajoissa taulukoissa parempaa muistitasausta varten\n" +" -Ca, --align kompromissi laajoissa taulukoissa parempaa " +"muistitasausta varten\n" " -Ce, --ecs rakenna ekvivalenssiluokkia\n" " -Cf älä tiivistä tauluja; käytä valitsinta -f esittelyyn\n" " -CF älä tiivistä tauluja; käytä valitsinta -F esittelyyn\n" " -Cm, --meta-ecs rakenna meta-ekvivalenssiluokkia\n" -" -Cr, --read käytä funktiota read() eikä vakiosyötettä skannerisyötteenä\n" +" -Cr, --read käytä funktiota read() eikä vakiosyötettä " +"skannerisyötteenä\n" " -f, --full tuota nopea, laaja skanneri. Sama kuin -Cfr\n" " -F, --fast käytä vaihtoehtoista tauluesittelyä. Sama kuin -CFr\n" " -Cem oletustiivistys (sama kuin --ecs --meta-ecs)\n" @@ -608,15 +627,18 @@ msgstr "" " -d, --debug ota käyttöön virheenjäljitystila skannerissa\n" " -b, --backup kirjoita varmuuskopiotietoja osoitteeseen %s\n" " -p, --perf-report kirjoita suorituskykyraportti vakiovirheeseen\n" -" -s, --nodefault vaimenna oletussääntö ECHO-täsmäämättömään tekstiin\n" +" -s, --nodefault vaimenna oletussääntö ECHO-täsmäämättömään " +"tekstiin\n" " -T, --trace %s pitäisi suorittaa jäljitystilassa\n" " -w, --nowarn älä tuota varoituksia\n" -" -v, --verbose kirjoita yhteenveto skanneritilastoista vakiotulosteeseen\n" +" -v, --verbose kirjoita yhteenveto skanneritilastoista " +"vakiotulosteeseen\n" "\n" "Tiedostot:\n" " -o, --outfile=TIEDOSTO määritä tulostetiedostonimi\n" " -S, --skel=TIEDOSTO määritä runkotiedosto\n" -" -t, --stdout kirjoita skanneri vakiotulosteeseen eikä kohteeseen %s\n" +" -t, --stdout kirjoita skanneri vakiotulosteeseen eikä " +"kohteeseen %s\n" " --yyclass=NIMI C++-luokan nimi\n" " --header-file=TIEDOSTO tuota C-otsaketiedosto etsijän lisäksi\n" " --tables-file[=TIEDOSTO] kirjoita taulut TIEDOSTOon\n" @@ -626,9 +648,11 @@ msgstr "" " -8, --8bit tuota 8-bittinen skanneri\n" " -B, --batch tuota eräajoskanneri (päinvastoin kuin -I)\n" " -i, --case-insensitive älä välitä kirjainkoosta malleissa\n" -" -l, --lex-compat maksimiyhteensopivuus alkueräisen lex-ohjelman kanssa\n" +" -l, --lex-compat maksimiyhteensopivuus alkueräisen lex-ohjelman " +"kanssa\n" " -X, --posix-compat maksimiyhteensopivuus POSIX lex-ohjelman kanssa\n" -" -I, --interactive tuota interaktiivinen skanneri (päinvastoin kuin -B)\n" +" -I, --interactive tuota interaktiivinen skanneri (päinvastoin kuin -" +"B)\n" " --yylineno jäljitä rivilukumäärä yylineno-ohjelmassa\n" "\n" "Generoitu koodi:\n" @@ -639,7 +663,8 @@ msgstr "" " -R, --reentrant tuota vapaakäyntinen C-skanneri\n" " --bison-bridge skanneri â€bison pureâ€-jäsentimelle.\n" " --bison-locations sisällytä yylloc-tuki.\n" -" --stdinit alusta yyin/yyout vakiosyötteeseen/vakiotulosteeseen\n" +" --stdinit alusta yyin/yyout vakiosyötteeseen/" +"vakiotulosteeseen\n" " --noansi-definitions vanhantyyliset funktiomäärittelyt\n" " --noansi-prototypes tyhjä parametriluettelo prototyypeissä\n" " --nounistd älä sisällytä <unistd.h>-tiedostoa\n" @@ -652,51 +677,52 @@ msgstr "" " -h, --help tuota tämä opastesanoma\n" " -V, --version ilmoita %s-versio\n" -#: misc.c:65 +#: src/misc.c:64 msgid "allocation of sko_stack failed" msgstr "sko_stack-varaaminen epäonnistui" -#: misc.c:102 misc.c:128 +#: src/misc.c:100 #, c-format msgid "name \"%s\" ridiculously long" msgstr "nimi â€%s†on naurettavan pitkä" -#: misc.c:177 +#: src/misc.c:155 msgid "memory allocation failed in allocate_array()" msgstr "muistinvaraus epäonnistui funktiossa allocate_array()" -#: misc.c:230 +#: src/misc.c:205 #, c-format msgid "bad character '%s' detected in check_char()" msgstr "väärä merkki â€%s†havaittu funktiossa check_char()" -#: misc.c:235 +#: src/misc.c:210 #, c-format msgid "scanner requires -8 flag to use the character %s" msgstr "skanneri vaatiin lipun -8 käytettäväksi merkille %s" -#: misc.c:268 -msgid "dynamic memory failure in copy_string()" -msgstr "dynaaminen muistivirhe funktiossa copy_string()" +#: src/misc.c:229 +#, fuzzy +msgid "memory allocation failure in xstrdup()" +msgstr "muistinvaraus epäonnistui funktiossa allocate_array()" -#: misc.c:367 +#: src/misc.c:303 #, c-format msgid "%s: fatal internal error, %s\n" msgstr "%s: vakava sisäinen virhe, %s\n" -#: misc.c:803 +#: src/misc.c:671 msgid "attempt to increase array size failed" msgstr "yritys taulukon koon kasvattamiseksi epäonnistui" -#: misc.c:930 +#: src/misc.c:795 msgid "bad line in skeleton file" msgstr "väärä rivi kehystiedostossa" -#: misc.c:979 +#: src/misc.c:845 msgid "memory allocation failed in yy_flex_xmalloc()" msgstr "muistinvaraus epäonnistui funktiossa yy_flex_xmalloc()" -#: nfa.c:104 +#: src/nfa.c:100 #, c-format msgid "" "\n" @@ -705,228 +731,246 @@ msgid "" msgstr "" "\n" "\n" -"********** Epädeterministisen äärellisen automaatin vedoksen alku aloitustilassa %d\n" +"********** Epädeterministisen äärellisen automaatin vedoksen alku " +"aloitustilassa %d\n" -#: nfa.c:115 +#: src/nfa.c:111 #, c-format msgid "state # %4d\t" msgstr "tila numero %4d\t" -#: nfa.c:130 +#: src/nfa.c:126 #, c-format msgid "********** end of dump\n" msgstr "********** vedoksen loppu\n" -#: nfa.c:174 +#: src/nfa.c:169 msgid "empty machine in dupmachine()" msgstr "tyhjä kone funktiossa dupmachine()" -#: nfa.c:240 +#: src/nfa.c:234 #, c-format msgid "Variable trailing context rule at line %d\n" msgstr "Muuttujajättökontekstisääntö rivillä %d\n" -#: nfa.c:353 +#: src/nfa.c:357 msgid "bad state type in mark_beginning_as_normal()" msgstr "väärä tilatyyppi funktiossa mark_beginning_as_normal()" -#: nfa.c:598 +#: src/nfa.c:595 #, c-format msgid "input rules are too complicated (>= %d NFA states)" -msgstr "syötesäännöt ovat liian mutkikkaita (>= %d Epädeterministisen äärellisen automaatin tilaa)" +msgstr "" +"syötesäännöt ovat liian mutkikkaita (>= %d Epädeterministisen äärellisen " +"automaatin tilaa)" -#: nfa.c:677 +#: src/nfa.c:673 msgid "found too many transitions in mkxtion()" msgstr "löytyi liian monta siirtymää funktiossa mkxtion()" -#: nfa.c:703 +#: src/nfa.c:699 #, c-format msgid "too many rules (> %d)!" msgstr "liian moni sääntöjä (> %d)!" -#: parse.y:159 +#: src/parse.y:159 msgid "unknown error processing section 1" msgstr "tuntematon virhe käsiteltäessä lohkoa 1" -#: parse.y:184 parse.y:351 +#: src/parse.y:184 src/parse.y:353 msgid "bad start condition list" msgstr "väärä alkuehtoluettelo" -#: parse.y:315 +#: src/parse.y:204 +msgid "Prefix must not contain [ or ]" +msgstr "" + +#: src/parse.y:317 msgid "unrecognized rule" msgstr "tunnistamaton sääntö" -#: 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 "jättökontekstia käytetty kahdesti" -#: 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 "vääriä iteraatioarvoja" -#: 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 "iteraatioarvon on oltava positiivinen" -#: 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 "merkkialue [%c-%c] ei ole yksiselitteinen skannerissa, joka ei välitä kirjainkoosta" +msgstr "" +"merkkialue [%c-%c] ei ole yksiselitteinen skannerissa, joka ei välitä " +"kirjainkoosta" -#: parse.y:819 +#: src/parse.y:821 msgid "negative range in character class" msgstr "negatiivinen lukualue merkkiluokassa" -#: parse.y:916 +#: src/parse.y:918 msgid "[:^lower:] is ambiguous in case insensitive scanner" -msgstr "[:^lower:] ei ole yksiselitteinen skannerissa, joka ei välitä kirjainkoosta" +msgstr "" +"[:^lower:] ei ole yksiselitteinen skannerissa, joka ei välitä kirjainkoosta" -#: parse.y:922 +#: src/parse.y:924 msgid "[:^upper:] ambiguous in case insensitive scanner" -msgstr "[:^upper:] ei ole yksiselitteinen skannerissa, joka ei välit kirjainkoosta" +msgstr "" +"[:^upper:] ei ole yksiselitteinen skannerissa, joka ei välit kirjainkoosta" -#: 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 "Syöterivi on liian pitkä\n" -#: scan.l:161 +#: src/scan.l:183 #, c-format msgid "malformed '%top' directive" msgstr "vääränmuotoinen â€%topâ€-direktiivi" -#: scan.l:183 +#: src/scan.l:205 #, no-c-format msgid "unrecognized '%' directive" msgstr "tunnistamaton â€%â€-direktiivi" -#: scan.l:192 +#: src/scan.l:214 msgid "Definition name too long\n" msgstr "Määritysnimi on liian pitkä\n" -#: scan.l:284 +#: src/scan.l:309 msgid "Unmatched '{'" msgstr "Pariton â€{â€" -#: scan.l:300 +#: src/scan.l:325 #, c-format msgid "Definition value for {%s} too long\n" msgstr "Määritysarvo kohteelle {%s} on liian pitkä\n" -#: scan.l:317 +#: src/scan.l:342 msgid "incomplete name definition" msgstr "epätäydellinen nimimäärittely" -#: scan.l:443 +#: src/scan.l:467 msgid "Option line too long\n" msgstr "Valitsinrivi on liian pitkä\n" -#: scan.l:451 +#: src/scan.l:475 #, c-format msgid "unrecognized %%option: %s" msgstr "tunnistamaton %%valitsin: %s" -#: scan.l:633 scan.l:800 +#: src/scan.l:659 src/scan.l:832 msgid "bad character class" msgstr "väärä merkkiluokka" -#: scan.l:683 +#: src/scan.l:709 #, c-format msgid "undefined definition {%s}" msgstr "määrittelemätön määrittely {%s}" -#: scan.l:755 +#: src/scan.l:772 +msgid "unbalanced parenthesis" +msgstr "" + +#: src/scan.l:787 #, c-format msgid "bad <start condition>: %s" msgstr "virheellinen <aloitusehto>: %s" -#: scan.l:768 +#: src/scan.l:800 msgid "missing quote" msgstr "puuttuva lainausmerkki" -#: scan.l:834 +#: src/scan.l:866 #, c-format msgid "bad character class expression: %s" msgstr "väärä merkkiluokkalauseke: %s" -#: scan.l:856 +#: src/scan.l:888 msgid "bad character inside {}'s" msgstr "väärä merkki aaltosulkeiden {} sisällä" -#: scan.l:862 +#: src/scan.l:894 msgid "missing }" msgstr "puuttuva }" -#: scan.l:940 +#: src/scan.l:972 msgid "EOF encountered inside an action" msgstr "Tiedoston loppumerkki EOF tavattu toiminnon sisällä" -#: scan.l:945 +#: src/scan.l:977 msgid "EOF encountered inside pattern" msgstr "Tiedoston loppumerkki EOF tavattu mallin sisällä" -#: scan.l:967 +#: src/scan.l:1010 #, c-format msgid "bad character: %s" msgstr "väärä merkki: %s" -#: scan.l:996 +#: src/scan.l:1038 #, c-format msgid "can't open %s" msgstr "ei voi avata %s" -#: scanopt.c:291 +#: src/scanopt.c:259 #, c-format msgid "Usage: %s [OPTIONS]...\n" msgstr "Käyttö: %s [VALITSIMET]...\n" -#: scanopt.c:564 +#: src/scanopt.c:524 #, c-format msgid "option `%s' doesn't allow an argument\n" msgstr "valitsin â€%s†ei salli argumenttia\n" -#: scanopt.c:569 +#: src/scanopt.c:529 #, c-format msgid "option `%s' requires an argument\n" msgstr "valitsin â€%s†vaatii argumentin\n" -#: scanopt.c:573 +#: src/scanopt.c:533 #, c-format msgid "option `%s' is ambiguous\n" msgstr "valitsin â€%s†ei ole yksiselitteinen\n" -#: scanopt.c:577 +#: src/scanopt.c:537 #, c-format msgid "Unrecognized option `%s'\n" msgstr "Tunnistamaton valitsin â€%sâ€\n" -#: scanopt.c:581 +#: src/scanopt.c:541 #, c-format msgid "Unknown error=(%d)\n" msgstr "Tuntematon virhe=(%d)\n" -#: sym.c:100 +#: src/sym.c:92 msgid "symbol table memory allocation failed" msgstr "symbolitaulun muistinvaraus epäonnistui" -#: sym.c:202 +#: src/sym.c:183 msgid "name defined twice" msgstr "nimi määritelty kahdesti" -#: sym.c:253 +#: src/sym.c:231 #, c-format msgid "start condition %s declared twice" msgstr "alkuehto %s esitelty kahdesti" -#: yylex.c:56 +#: src/yylex.c:57 msgid "premature EOF" msgstr "ennenaikainen tiedoston loppumerkki EOF" -#: yylex.c:198 +#: src/yylex.c:200 #, c-format msgid "End Marker\n" msgstr "Loppumerkki\n" -#: yylex.c:204 +#: src/yylex.c:206 #, c-format msgid "*Something Weird* - tok: %d val: %d\n" msgstr "*Jotain outoa - tok: %d arvo: %d\n" + +#~ msgid "dynamic memory failure in copy_string()" +#~ msgstr "dynaaminen muistivirhe funktiossa copy_string()" @@ -11,7 +11,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-09-19 21:01-0400\n" "Last-Translator: David Prévot <david@tilapin.org>\n" "Language-Team: French <traduc@traduc.org>\n" @@ -19,45 +19,46 @@ 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=2; plural=(n > 1);\n" "X-Generator: Lokalize 1.4\n" -#: buf.c:78 +#: src/buf.c:79 msgid "Allocation of buffer to print string failed" msgstr "Échec d'allocation de tampon pour afficher une chaîne" -#: buf.c:100 +#: src/buf.c:107 msgid "Allocation of buffer for line directive failed" msgstr "Échec d'allocation de tampon pour la directive de ligne" -#: buf.c:177 +#: src/buf.c:177 msgid "Allocation of buffer for m4 def failed" msgstr "Échec d'allocation de tampon pour m4 défini" -#: buf.c:197 +#: src/buf.c:198 msgid "Allocation of buffer for m4 undef failed" msgstr "Échec d'allocation de tampon pour m4 non défini" -#: dfa.c:61 +#: src/dfa.c:59 #, c-format msgid "State #%d is non-accepting -\n" msgstr "L'état nº %d n'accepte pas -\n" -#: dfa.c:124 +#: src/dfa.c:119 msgid "dangerous trailing context" msgstr "le contexte traîné est dangereux" -#: dfa.c:166 +#: src/dfa.c:159 #, c-format msgid " associated rule line numbers:" msgstr " numéros de ligne associés à la règle :" -#: dfa.c:202 +#: src/dfa.c:193 #, c-format msgid " out-transitions: " msgstr " transitions de sortie : " -#: dfa.c:210 +#: src/dfa.c:201 #, c-format msgid "" "\n" @@ -66,11 +67,11 @@ msgstr "" "\n" " transitions-bouchon : EOF " -#: dfa.c:341 +#: src/dfa.c:331 msgid "consistency check failed in epsclosure()" msgstr "le contrôle de cohérence a échoué dans epsclosure()" -#: dfa.c:429 +#: src/dfa.c:419 msgid "" "\n" "\n" @@ -82,24 +83,24 @@ msgstr "" "Vidage de l'AFD :\n" "\n" -#: dfa.c:604 +#: src/dfa.c:587 msgid "could not create unique end-of-buffer state" msgstr "impossible de créer un seul état de fin de tampon" -#: dfa.c:625 +#: src/dfa.c:608 #, c-format msgid "state # %d:\n" msgstr "état nº %d :\n" -#: dfa.c:785 +#: src/dfa.c:768 msgid "Could not write yynxt_tbl[][]" msgstr "Impossible d'écrire yynxt_tbl[][]" -#: dfa.c:1049 +#: src/dfa.c:1028 msgid "bad transition character detected in sympartition()" msgstr "mauvais caractère de transition détecté dans sympartition()" -#: gen.c:478 +#: src/gen.c:480 msgid "" "\n" "\n" @@ -111,29 +112,29 @@ msgstr "" "Classes d'équivalence :\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 "l'état nº %d accepte : [%d]\n" -#: gen.c:1110 +#: src/gen.c:1115 #, c-format msgid "state # %d accepts: " msgstr "l'état nº %d accepte : " -#: gen.c:1157 +#: src/gen.c:1162 msgid "Could not write yyacclist_tbl" msgstr "Impossible d'écrire yyacclist_tbl" -#: gen.c:1233 +#: src/gen.c:1236 msgid "Could not write yyacc_tbl" msgstr "Impossible d'écrire 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 "Impossible d'écrire ecstbl" -#: gen.c:1271 +#: src/gen.c:1271 msgid "" "\n" "\n" @@ -143,400 +144,412 @@ msgstr "" "\n" "Classes de métaéquivalence :\n" -#: gen.c:1293 +#: src/gen.c:1293 msgid "Could not write yymeta_tbl" msgstr "Impossible d'écrire yymeta_tbl" -#: gen.c:1354 +#: src/gen.c:1352 msgid "Could not write yybase_tbl" msgstr "Impossible d'écrire yybase_tbl" -#: gen.c:1388 +#: src/gen.c:1384 msgid "Could not write yydef_tbl" msgstr "Impossible d'écrire yydef_tbl" -#: gen.c:1428 +#: src/gen.c:1422 msgid "Could not write yynxt_tbl" msgstr "Impossible d'écrire yynxt_tbl" -#: gen.c:1464 +#: src/gen.c:1456 msgid "Could not write yychk_tbl" msgstr "Impossible d'écrire yychk_tbl" -#: gen.c:1618 gen.c:1647 +#: src/gen.c:1608 src/gen.c:1637 msgid "Could not write ftbl" msgstr "Impossible d'écrire ftbl" -#: gen.c:1624 +#: src/gen.c:1614 msgid "Could not write ssltbl" msgstr "Impossible d'écrire ssltbl" -#: gen.c:1675 +#: src/gen.c:1665 msgid "Could not write eoltbl" msgstr "Impossible d'écrire eoltbl" -#: gen.c:1735 +#: src/gen.c:1722 msgid "Could not write yynultrans_tbl" msgstr "Impossible d'écrire yynultrnas_tbl" -#: main.c:189 +#: src/main.c:178 msgid "rule cannot be matched" msgstr "la règle ne peut pas correspondre" -#: main.c:194 +#: src/main.c:183 msgid "-s option given but default rule can be matched" msgstr "l'option -s est donnée mais la règle par défaut peut correspondre" -#: main.c:234 +#: src/main.c:221 msgid "Can't use -+ with -l option" msgstr "L'option -+ ne peut pas être combinée à -l" -#: main.c:237 +#: src/main.c:224 msgid "Can't use -f or -F with -l option" msgstr "Les options -f et -F ne peuvent pas être combinées à -l" -#: main.c:241 +#: src/main.c:228 msgid "Can't use --reentrant or --bison-bridge with -l option" -msgstr "Les options --reentrant ou --bison-bridge ne peuvent pas être combinées à l'option -l" +msgstr "" +"Les options --reentrant ou --bison-bridge ne peuvent pas être combinées à " +"l'option -l" -#: main.c:278 +#: src/main.c:260 msgid "-Cf/-CF and -Cm don't make sense together" msgstr "-Cf ou -CF et -Cm ne peuvent pas être indiquées ensemble" -#: main.c:281 +#: src/main.c:263 msgid "-Cf/-CF and -I are incompatible" msgstr "-Cf ou -CF et -I sont incompatibles" -#: main.c:285 +#: src/main.c:267 msgid "-Cf/-CF are incompatible with lex-compatibility mode" -msgstr "les options -Cf ou -CF ne sont pas compatibles avec le mode de compatibilité « lex »" +msgstr "" +"les options -Cf ou -CF ne sont pas compatibles avec le mode de compatibilité " +"« lex »" -#: main.c:290 +#: src/main.c:272 msgid "-Cf and -CF are mutually exclusive" msgstr "-Cf et -CF sont mutuellement exclusifs" -#: main.c:294 +#: src/main.c:276 msgid "Can't use -+ with -CF option" msgstr "L'option -+ ne peut pas être combinée à -CF" -#: main.c:297 +#: src/main.c:279 #, c-format msgid "%array incompatible with -+ option" msgstr "%array incompatible avec l'option -+" -#: main.c:302 +#: src/main.c:284 msgid "Options -+ and --reentrant are mutually exclusive." msgstr "Les options +- et --reentrant sont mutuellement exclusives." -#: main.c:305 +#: src/main.c:287 msgid "bison bridge not supported for the C++ scanner." msgstr "bridge bison n'est pas pris en charge pour l'analyseur C++" -#: main.c:360 main.c:406 +#: src/main.c:336 src/main.c:419 #, c-format msgid "could not create %s" msgstr "impossible de créer %s" -#: main.c:419 +#: src/main.c:431 msgid "could not write tables header" msgstr "impossible d'écrire les tables d'en-tête" -#: main.c:423 +#: src/main.c:435 #, c-format msgid "can't open skeleton file %s" msgstr "impossible d'ouvrir le fichier canevas %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 "échec d'allocation de définition de macro" -#: main.c:507 +#: src/main.c:521 #, c-format msgid "input error reading skeleton file %s" msgstr "erreur de lecture du fichier canevas %s" -#: main.c:511 +#: src/main.c:525 #, c-format msgid "error closing skeleton file %s" msgstr "erreur de fermeture du fichier canevas %s" -#: main.c:696 +#: src/main.c:709 #, c-format msgid "error creating header file %s" msgstr "erreur de création du fichier d'en-tête %s" -#: main.c:704 +#: src/main.c:717 #, c-format msgid "error writing output file %s" msgstr "erreur d'écriture du fichier de sortie %s" -#: main.c:708 +#: src/main.c:721 #, c-format msgid "error closing output file %s" msgstr "erreur de fermeture du fichier de sortie %s" -#: main.c:712 +#: src/main.c:725 #, c-format msgid "error deleting output file %s" msgstr "erreur d'effacement du fichier de sortie %s" -#: main.c:719 +#: src/main.c:732 #, c-format msgid "No backing up.\n" msgstr "Pas d'archivage.\n" -#: main.c:723 +#: src/main.c:736 #, c-format msgid "%d backing up (non-accepting) states.\n" msgstr "%d états d'archivage (non acceptants).\n" -#: main.c:727 +#: src/main.c:740 #, c-format msgid "Compressed tables always back up.\n" msgstr "Les tables comprimées sont toujours archivées.\n" -#: main.c:730 +#: src/main.c:743 #, c-format msgid "error writing backup file %s" msgstr "erreur d'écriture du fichier de sauvegarde %s" -#: main.c:734 +#: src/main.c:747 #, c-format msgid "error closing backup file %s" msgstr "erreur de fermeture du fichier de sauvegarde %s" -#: main.c:739 +#: src/main.c:752 #, c-format msgid "%s version %s usage statistics:\n" msgstr "« %s » version %s, statistiques d'utilisation :\n" -#: main.c:742 +#: src/main.c:755 #, c-format msgid " scanner options: -" msgstr " options de l'analyseur lexical : -" -#: main.c:821 +#: src/main.c:834 #, c-format msgid " %d/%d NFA states\n" msgstr " %d/%d états NFA\n" -#: main.c:823 +#: src/main.c:836 #, c-format msgid " %d/%d DFA states (%d words)\n" msgstr " %d/%d états AFD (%d mots)\n" -#: main.c:825 +#: src/main.c:838 #, c-format msgid " %d rules\n" msgstr " %d règles\n" -#: main.c:830 +#: src/main.c:843 #, c-format msgid " No backing up\n" msgstr " Pas d'archivage\n" -#: main.c:834 +#: src/main.c:847 #, c-format msgid " %d backing-up (non-accepting) states\n" msgstr " %d états d'archivage (si non acceptants)\n" -#: main.c:839 +#: src/main.c:852 #, c-format msgid " Compressed tables always back-up\n" msgstr " Les tables comprimées sont toujours archivées\n" -#: main.c:843 +#: src/main.c:856 #, c-format msgid " Beginning-of-line patterns used\n" msgstr " Modèles utilisés en début de ligne\n" -#: main.c:845 +#: src/main.c:858 #, c-format msgid " %d/%d start conditions\n" msgstr " %d/%d conditions de départ\n" -#: main.c:849 +#: src/main.c:862 #, c-format msgid " %d epsilon states, %d double epsilon states\n" msgstr " %d états epsilon, %d états double epsilon\n" -#: main.c:853 +#: src/main.c:866 #, c-format msgid " no character classes\n" msgstr " pas de classes de caractères\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 classes de caractères nécessaires %d/%d mots-mémoire, %d recyclés\n" +msgstr "" +" %d/%d classes de caractères nécessaires %d/%d mots-mémoire, %d recyclés\n" -#: main.c:862 +#: src/main.c:875 #, c-format msgid " %d state/nextstate pairs created\n" msgstr " %d paires state/nextstate produites\n" -#: main.c:865 +#: src/main.c:878 #, c-format msgid " %d/%d unique/duplicate transitions\n" msgstr " %d/%d transitions uniques/dupliquées\n" -#: main.c:870 +#: src/main.c:883 #, c-format msgid " %d table entries\n" msgstr " %d entrées dans la table\n" -#: main.c:878 +#: src/main.c:891 #, c-format msgid " %d/%d base-def entries created\n" msgstr " %d/%d entrées base-def produites\n" -#: main.c:882 +#: src/main.c:895 #, c-format msgid " %d/%d (peak %d) nxt-chk entries created\n" msgstr " %d/%d (max. %d) entrées nxt-chk produites\n" -#: main.c:886 +#: src/main.c:899 #, c-format msgid " %d/%d (peak %d) template nxt-chk entries created\n" msgstr " %d/%d (max. %d) entrées de modèle nxt-chk produites\n" -#: main.c:890 +#: src/main.c:903 #, c-format msgid " %d empty table entries\n" msgstr " %d entrées vides dans la table\n" -#: main.c:892 +#: src/main.c:905 #, c-format msgid " %d protos created\n" msgstr " %d prototypes produits\n" -#: main.c:895 +#: src/main.c:908 #, c-format msgid " %d templates created, %d uses\n" msgstr " %d modèles produits, %d usages\n" -#: main.c:903 +#: src/main.c:916 #, c-format msgid " %d/%d equivalence classes created\n" msgstr " %d/%d classes d'équivalence produites\n" -#: main.c:911 +#: src/main.c:924 #, c-format msgid " %d/%d meta-equivalence classes created\n" msgstr " %d/%d classes de métaéquivalence produites\n" -#: main.c:917 +#: src/main.c:930 #, c-format msgid " %d (%d saved) hash collisions, %d DFAs equal\n" msgstr " %d (%d sauvés) collisions durant dispersion, %d AFD égaux\n" -#: main.c:919 +#: src/main.c:932 #, c-format msgid " %d sets of reallocations needed\n" msgstr " %d ensembles de réallocations nécessaires\n" -#: main.c:921 +#: src/main.c:934 #, c-format msgid " %d total table entries needed\n" msgstr " %d entrées nécessaires dans la table, au total\n" -#: main.c:998 +#: src/main.c:1008 #, c-format msgid "Internal error. flexopts are malformed.\n" msgstr "Erreur interne. Les options « flexopts » sont mal composées.\n" -#: main.c:1008 +#: src/main.c:1018 #, c-format msgid "Try `%s --help' for more information.\n" -msgstr "Exécutez « %s --help » pour obtenir des renseignements complémentaires.\n" +msgstr "" +"Exécutez « %s --help » pour obtenir des renseignements complémentaires.\n" -#: main.c:1065 +#: src/main.c:1075 #, c-format msgid "unknown -C option '%c'" msgstr "l'option -C « %c » inconnue" -#: 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 "erreur de lecture fatale" -#: main.c:1501 +#: src/main.c:1508 #, c-format msgid "could not create backing-up info file %s" msgstr "impossible de créer le fichier d'informations d'archivage %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'option -l de compatibilité avec le « lex » d'AT&T entraîne une importante\n" "perte de performance\n" -#: main.c:1525 +#: src/main.c:1532 #, c-format msgid " and may be the actual source of other reported performance penalties\n" msgstr " et peuvent être cause d'autres vices de performance observés\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'entraîne une importante perte de performance QUE sur\n" "les règles pouvant correspondre avec le caractère de changement de ligne\n" -#: main.c:1538 +#: src/main.c:1545 #, c-format msgid "-I (interactive) entails a minor performance penalty\n" msgstr "l'option -I (interactif) entraîne une faible perte de performance\n" -#: main.c:1543 +#: src/main.c:1550 #, c-format msgid "yymore() entails a minor performance penalty\n" msgstr "yymore() entraîne une faible baisse de performance\n" -#: main.c:1549 +#: src/main.c:1556 #, c-format msgid "REJECT entails a large performance penalty\n" msgstr "REJECT entraîne une importante baisse de performance\n" -#: main.c:1554 +#: src/main.c:1561 #, c-format msgid "Variable trailing context rules entail a large performance penalty\n" msgstr "" "Les règles de contexte traîné variable entraînent une importante baisse de\n" "performance\n" -#: main.c:1566 +#: src/main.c:1573 msgid "REJECT cannot be used with -f or -F" msgstr "REJECT ne peut pas être utilisé avec -f ou -F" -#: main.c:1569 +#: src/main.c:1576 #, c-format msgid "%option yylineno cannot be used with REJECT" msgstr "%option yylineno ne peut être utilisé avec REJECT" -#: main.c:1572 +#: src/main.c:1579 msgid "variable trailing context rules cannot be used with -f or -F" msgstr "" "les règles de contexte traîné variable ne peuvent pas être utilisées avec\n" "-f ou -F" -#: main.c:1695 +#: src/main.c:1704 #, c-format msgid "%option yyclass only meaningful for C++ scanners" msgstr "%option yyclass n'a de sens qu'avec les analyseurs C++" -#: main.c:1802 +#: src/main.c:1791 #, c-format msgid "Usage: %s [OPTIONS] [FILE]...\n" msgstr "Utilisation : %s [OPTIONS] [FICHIER]...\n" -#: main.c:1805 -#, c-format +#: src/main.c:1794 +#, fuzzy, c-format msgid "" "Generates programs that perform pattern-matching on text.\n" "\n" @@ -559,13 +572,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" @@ -587,8 +603,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" @@ -599,17 +613,23 @@ msgid "" " -h, --help produce this help message\n" " -V, --version report %s version\n" msgstr "" -"Génération de programmes qui réalisent des correspondances de motif de texte.\n" +"Génération de programmes qui réalisent des correspondances de motif de " +"texte.\n" "\n" "Compression de table :\n" -" -Ca, --align négocier grandes tables pour un meilleur alignement mémoire\n" +" -Ca, --align négocier grandes tables pour un meilleur alignement " +"mémoire\n" " -Ce, --ecs construire des équivalences de classes\n" -" -Cf ne pas compresser les tables ; utiliser la représentation -f\n" -" -CF ne pas compresser les tables ; utiliser la représentation -F\n" +" -Cf ne pas compresser les tables ; utiliser la " +"représentation -f\n" +" -CF ne pas compresser les tables ; utiliser la " +"représentation -F\n" " -Cm, --meta-ecs construire des métaéquivalences de classes\n" -" -Cr, --read utiliser read() au lieu de stdio pour le scanner d'entrée\n" +" -Cr, --read utiliser read() au lieu de stdio pour le scanner " +"d'entrée\n" " -f, --full générer rapidement, un grand scanner. Identique à -Cfr\n" -" -F, --fast utiliser une table alternative de représentation. Comme -CFr\n" +" -F, --fast utiliser une table alternative de représentation. Comme -" +"CFr\n" " -Cem compression par défaut (identique à --ecs --meta-ecs)\n" "\n" "Mise au point (mode débogage) :\n" @@ -620,14 +640,16 @@ msgstr "" " le texte non correspondant par ECHO\n" " -T, --trace %s devrait s'exécuter en mode trace\n" " -w, --nowarn ne pas générer d'avertissements\n" -" -v, --verbose produire des statistiques du scanner sur stdout\n" +" -v, --verbose produire des statistiques du scanner sur " +"stdout\n" "\n" "Fichiers :\n" " -o, --outfile=FICHIER indiquer un nom de fichier de sortie\n" " -S, --skel=FICHIER indiquer le fichier du squelette\n" " -t, --stdout produire le scanner sur stdout au lieu de %s\n" " --yyclass=NOM nom de la classe C++\n" -" --header-file=FICHIER créer le fichier d'en-tête C en plus du scanner\n" +" --header-file=FICHIER créer le fichier d'en-tête C en plus du " +"scanner\n" " --tables-file[=FICHIER] écrire les tables dans le FICHIER\n" "\n" "Comportement du scanner :\n" @@ -635,8 +657,10 @@ msgstr "" " -8, --8bit générer un scanner de 8 bits\n" " -B, --batch générer un scanner par lot (contraire de -I)\n" " -i, --case-insensitive ignorer la casse dans les patrons\n" -" -l, --lex-compat établir une compatibilité maximale avec lex d'origine\n" -" -X, --posix-compat établir une compatibilité maximale avec lex de POSIX\n" +" -l, --lex-compat établir une compatibilité maximale avec lex " +"d'origine\n" +" -X, --posix-compat établir une compatibilité maximale avec lex de " +"POSIX\n" " -I, --interactive générer un scanner interactif (contraire de -B)\n" " --yylineno suivre le compte de lignes dans yylineno\n" "\n" @@ -644,7 +668,8 @@ msgstr "" " -+, --c++ générer la classe C++ du scanner\n" " -Dmacro[=def] définition macro #define (« 1 » par défaut)\n" " -L, --noline supprimer les directives #line dans le scanner\n" -" -P, --prefix=CHAÃŽNE utiliser la CHAÃŽNE comme préfixe au lieu de « yy »\n" +" -P, --prefix=CHAÃŽNE utiliser la CHAÃŽNE comme préfixe au lieu de " +"« yy »\n" " -R, --reentrant générer un scanner C en code rentrant\n" " --bison-bridge scanner pour l'analyseur pur bison\n" " --bison-locations inclure la prise en charge de yylloc.\n" @@ -659,51 +684,53 @@ msgstr "" " -h, --help afficher l'aide-mémoire\n" " -V, --version afficher la version %s du logiciel\n" -#: misc.c:65 +#: src/misc.c:64 msgid "allocation of sko_stack failed" msgstr "échec d'allocation de sko_stack" -#: misc.c:102 misc.c:128 +#: src/misc.c:100 #, c-format msgid "name \"%s\" ridiculously long" msgstr "le nom « %s » est ridiculement long" -#: misc.c:177 +#: src/misc.c:155 msgid "memory allocation failed in allocate_array()" msgstr "échec d'allocation mémoire dans allocate_array()" -#: misc.c:230 +#: src/misc.c:205 #, c-format msgid "bad character '%s' detected in check_char()" msgstr "mauvais caractère « %s » détecté dans check_char()" -#: misc.c:235 +#: src/misc.c:210 #, c-format msgid "scanner requires -8 flag to use the character %s" -msgstr "l'analyseur nécessite l'option -8 pour pouvoir utiliser le caractère %s" +msgstr "" +"l'analyseur nécessite l'option -8 pour pouvoir utiliser le caractère %s" -#: misc.c:268 -msgid "dynamic memory failure in copy_string()" -msgstr "échec de mémoire dynamique dans copy_string()" +#: src/misc.c:229 +#, fuzzy +msgid "memory allocation failure in xstrdup()" +msgstr "échec d'allocation mémoire dans allocate_array()" -#: misc.c:367 +#: src/misc.c:303 #, c-format msgid "%s: fatal internal error, %s\n" msgstr "%s : erreur interne fatale, %s\n" -#: misc.c:803 +#: src/misc.c:671 msgid "attempt to increase array size failed" msgstr "échec de la tentative d'augmenter la taille du tableau" -#: misc.c:930 +#: src/misc.c:795 msgid "bad line in skeleton file" msgstr "mauvaise ligne dans le fichier canevas" -#: misc.c:979 +#: src/misc.c:845 msgid "memory allocation failed in yy_flex_xmalloc()" msgstr "échec d'allocation mémoire dans yy_flex_xmalloc()" -#: nfa.c:104 +#: src/nfa.c:100 #, c-format msgid "" "\n" @@ -714,230 +741,243 @@ msgstr "" "\n" "********** début du vidage de nfa avec %d pour état de départ\n" -#: nfa.c:115 +#: src/nfa.c:111 #, c-format msgid "state # %4d\t" msgstr "état nº %4d\t" -#: nfa.c:130 +#: src/nfa.c:126 #, c-format msgid "********** end of dump\n" msgstr "********** fin du vidage\n" -#: nfa.c:174 +#: src/nfa.c:169 msgid "empty machine in dupmachine()" msgstr "machine vide dans dupmachine()" -#: nfa.c:240 +#: src/nfa.c:234 #, c-format msgid "Variable trailing context rule at line %d\n" msgstr "Règle de contexte traîné variable à la ligne %d\n" -#: nfa.c:353 +#: src/nfa.c:357 msgid "bad state type in mark_beginning_as_normal()" msgstr "mauvais type d'état dans mark_beginning_as_normal()" -#: nfa.c:598 +#: src/nfa.c:595 #, c-format msgid "input rules are too complicated (>= %d NFA states)" msgstr "les règles d'entrée sont trop compliquées (>= %d états NFA)" -#: nfa.c:677 +#: src/nfa.c:673 msgid "found too many transitions in mkxtion()" msgstr "il y a trop de transitions dans mkxtion()" -#: nfa.c:703 +#: src/nfa.c:699 #, c-format msgid "too many rules (> %d)!" msgstr "trop de règles (> %d)." -#: parse.y:159 +#: src/parse.y:159 msgid "unknown error processing section 1" msgstr "erreur inconnue de traitement à la section 1" -#: parse.y:184 parse.y:351 +#: src/parse.y:184 src/parse.y:353 msgid "bad start condition list" msgstr "mauvaise liste de conditions de départ" -#: parse.y:315 +#: src/parse.y:204 +msgid "Prefix must not contain [ or ]" +msgstr "" + +#: src/parse.y:317 msgid "unrecognized rule" msgstr "règle non reconnue" -#: 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 "contexte traîné utilisé deux fois" -#: 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 "valeurs d'itération erronée" -#: 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 "la valeur d'itération doit être positive" -#: 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 "l'étendue de caractères [%c-%c] est ambiguë pour un scanner insensible à la casse" +msgstr "" +"l'étendue de caractères [%c-%c] est ambiguë pour un scanner insensible à la " +"casse" -#: parse.y:819 +#: src/parse.y:821 msgid "negative range in character class" msgstr "plage négative dans la classe de caractères" -#: parse.y:916 +#: src/parse.y:918 msgid "[:^lower:] is ambiguous in case insensitive scanner" msgstr "[:^lower:] est ambigu pour un scanner insensible à la casse" -#: parse.y:922 +#: src/parse.y:924 msgid "[:^upper:] ambiguous in case insensitive scanner" msgstr "[:^upper:] est ambigu pour un scanner insensible à la casse" -#: 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 "ligne d'entrée trop longue\n" -#: scan.l:161 +#: src/scan.l:183 #, c-format msgid "malformed '%top' directive" msgstr "directive « %top » mal composée" -#: scan.l:183 +#: src/scan.l:205 #, no-c-format msgid "unrecognized '%' directive" msgstr "directive « % » inconnue" -#: scan.l:192 +#: src/scan.l:214 msgid "Definition name too long\n" msgstr "Nom de définition trop long\n" -#: scan.l:284 +#: src/scan.l:309 msgid "Unmatched '{'" msgstr "« { » non apparié" -#: scan.l:300 +#: src/scan.l:325 #, c-format msgid "Definition value for {%s} too long\n" msgstr "Valeur de définition trop longue pour {%s}\n" -#: scan.l:317 +#: src/scan.l:342 msgid "incomplete name definition" msgstr "définition de nom incomplète" -#: scan.l:443 +#: src/scan.l:467 msgid "Option line too long\n" msgstr "Ligne d'option trop longue\n" -#: scan.l:451 +#: src/scan.l:475 #, c-format msgid "unrecognized %%option: %s" msgstr "%%option non reconnue : %s" -#: scan.l:633 scan.l:800 +#: src/scan.l:659 src/scan.l:832 msgid "bad character class" msgstr "mauvaise classe de caractères" -#: scan.l:683 +#: src/scan.l:709 #, c-format msgid "undefined definition {%s}" msgstr "définition {%s} non définie" -#: scan.l:755 +#: src/scan.l:772 +msgid "unbalanced parenthesis" +msgstr "" + +#: src/scan.l:787 #, c-format msgid "bad <start condition>: %s" msgstr "mauvaise <condition de départ> : %s" -#: scan.l:768 +#: src/scan.l:800 msgid "missing quote" msgstr "guillemet manquant" -#: scan.l:834 +#: src/scan.l:866 #, c-format msgid "bad character class expression: %s" msgstr "mauvaise expression de classe de caractères : %s" -#: scan.l:856 +#: src/scan.l:888 msgid "bad character inside {}'s" msgstr "mauvais caractère entre accolades « {} »" -#: scan.l:862 +#: src/scan.l:894 msgid "missing }" msgstr "« } » manquante" -#: scan.l:940 +#: src/scan.l:972 msgid "EOF encountered inside an action" msgstr "Fin de fichier rencontrée à l'intérieur d'une action" -#: scan.l:945 +#: src/scan.l:977 msgid "EOF encountered inside pattern" msgstr "Fin de fichier rencontrée à l'intérieur d'un modèle" -#: scan.l:967 +#: src/scan.l:1010 #, c-format msgid "bad character: %s" msgstr "mauvais caractère : %s" -#: scan.l:996 +#: src/scan.l:1038 #, c-format msgid "can't open %s" msgstr "impossible d'ouvrir %s" -#: scanopt.c:291 +#: src/scanopt.c:259 #, c-format msgid "Usage: %s [OPTIONS]...\n" msgstr "Utilisation : %s [OPTIONS]...\n" -#: scanopt.c:564 +#: src/scanopt.c:524 #, c-format msgid "option `%s' doesn't allow an argument\n" msgstr "l'option « %s » ne permet pas d'argument\n" -#: scanopt.c:569 +#: src/scanopt.c:529 #, c-format msgid "option `%s' requires an argument\n" msgstr "l'option « %s » nécessite un argument\n" -#: scanopt.c:573 +#: src/scanopt.c:533 #, c-format msgid "option `%s' is ambiguous\n" msgstr "l'option « %s » est ambiguë\n" -#: scanopt.c:577 +#: src/scanopt.c:537 #, c-format msgid "Unrecognized option `%s'\n" msgstr "Option « %s » non reconnue\n" -#: scanopt.c:581 +#: src/scanopt.c:541 #, c-format msgid "Unknown error=(%d)\n" msgstr "Erreur inconnue=(%d)\n" -#: sym.c:100 +#: src/sym.c:92 msgid "symbol table memory allocation failed" msgstr "échec d'allocation mémoire de la table des symboles" -#: sym.c:202 +#: src/sym.c:183 msgid "name defined twice" msgstr "nom défini deux fois" -#: sym.c:253 +#: src/sym.c:231 #, c-format msgid "start condition %s declared twice" msgstr "condition de départ %s déclarée deux fois" -#: yylex.c:56 +#: src/yylex.c:57 msgid "premature EOF" msgstr "fin de fichier inattendue" -#: yylex.c:198 +#: src/yylex.c:200 #, c-format msgid "End Marker\n" msgstr "Marqueur de fin\n" -#: yylex.c:204 +#: src/yylex.c:206 #, c-format msgid "*Something Weird* - tok: %d val: %d\n" msgstr "*Très bizarre* — tok : %d val : %d\n" +#~ msgid "dynamic memory failure in copy_string()" +#~ msgstr "échec de mémoire dynamique dans copy_string()" + #~ msgid "consistency check failed in symfollowset" #~ msgstr "le contrôle de cohérence a échoué dans symfollowset()" @@ -969,8 +1009,10 @@ msgstr "*Très bizarre* — tok : %d val : %d\n" #~ msgid "-C flag must be given separately" #~ msgstr "L'option -C doit être utilisée séparément" -#~ msgid "%s [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -ooutput -Pprefix -Sskeleton]\n" -#~ msgstr "%s [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -osortie -Ppréfixe -Scanevas]\n" +#~ msgid "" +#~ "%s [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -ooutput -Pprefix -Sskeleton]\n" +#~ msgstr "" +#~ "%s [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -osortie -Ppréfixe -Scanevas]\n" #~ msgid "\t[--help --version] [file ...]\n" #~ msgstr "\t[--help --version] [fichier ...]\n" @@ -1003,10 +1045,12 @@ msgstr "*Très bizarre* — tok : %d val : %d\n" #~ msgstr "\t-p affiche un rapport de performance sur stderr\n" #~ msgid "\t-s suppress default rule to ECHO unmatched text\n" -#~ msgstr "\t-s supprime la règle par défaut qui AFFICHE le texte non reconnu\n" +#~ msgstr "" +#~ "\t-s supprime la règle par défaut qui AFFICHE le texte non reconnu\n" #~ msgid "\t-t write generated scanner on stdout instead of %s\n" -#~ msgstr "\t-t écrit l'analyseur généré sur la sortie standard au lieu de %s\n" +#~ msgstr "" +#~ "\t-t écrit l'analyseur généré sur la sortie standard au lieu de %s\n" #~ msgid "\t-v write summary of scanner statistics to f\n" #~ msgstr "\t-v écrit un résumé des statistiques de l'analyseur sur f\n" @@ -1045,7 +1089,8 @@ msgstr "*Très bizarre* — tok : %d val : %d\n" #~ msgstr "\t-? affiche ce message d'aide\n" #~ msgid "\t-C specify degree of table compression (default is -Cem):\n" -#~ msgstr "\t-C spécifie le degré de compression des tables (-Cem par défaut) :\n" +#~ msgstr "" +#~ "\t-C spécifie le degré de compression des tables (-Cem par défaut) :\n" #~ msgid "\t\t-Ca trade off larger tables for better memory alignment\n" #~ msgstr "" @@ -1056,16 +1101,21 @@ msgstr "*Très bizarre* — tok : %d val : %d\n" #~ msgstr "\t\t-Ce construit des classes d'équivalence\n" #~ msgid "\t\t-Cf do not compress scanner tables; use -f representation\n" -#~ msgstr "\t\t-Cf ne comprime pas les tables de l'analyseur ; utilise la représentation -f\n" +#~ msgstr "" +#~ "\t\t-Cf ne comprime pas les tables de l'analyseur ; utilise la " +#~ "représentation -f\n" #~ msgid "\t\t-CF do not compress scanner tables; use -F representation\n" -#~ msgstr "\t\t-CF ne comprime pas les tables de l'analyseur ; utilise la représentation -F\n" +#~ msgstr "" +#~ "\t\t-CF ne comprime pas les tables de l'analyseur ; utilise la " +#~ "représentation -F\n" #~ msgid "\t\t-Cm construct meta-equivalence classes\n" #~ msgstr "\t\t-Cm construit des classes de meta-équivalence\n" #~ msgid "\t\t-Cr use read() instead of stdio for scanner input\n" -#~ msgstr "\t\t-Cr utilise read() au lieu de stdio pour l'entrée de l'analyseur\n" +#~ msgstr "" +#~ "\t\t-Cr utilise read() au lieu de stdio pour l'entrée de l'analyseur\n" #~ msgid "\t-o specify output filename\n" #~ msgstr "\t-o spécifie le nom du fichier de sortie\n" @@ -1,40 +1,58 @@ # Irish translations for flex. # Copyright (C) 2008 The Flex Project (msgids) # This file is distributed under the same license as the flex package. -# Kevin Patrick Scannell <scannell@SLU.EDU>, 2003, 2006, 2008. +# Kevin Patrick Scannell <scannell@SLU.EDU>, 2003, 2006, 2008, 2017. msgid "" msgstr "" -"Project-Id-Version: flex 2.5.34\n" +"Project-Id-Version: flex 2.5.38\n" "Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2007-12-12 16:05-0500\n" -"PO-Revision-Date: 2008-07-23 09:37-0500\n" +"POT-Creation-Date: 2017-05-06 10:49-0400\n" +"PO-Revision-Date: 2017-01-10 09:37-0500\n" "Last-Translator: Kevin Scannell <kscanne@gmail.com>\n" "Language-Team: Irish <gaeilge-gnulinux@lists.sourceforge.net>\n" +"Language: ga\n" "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" -#: dfa.c:61 +#: src/buf.c:79 +msgid "Allocation of buffer to print string failed" +msgstr "NÃorbh fhéidir spás a leagan amach chun teaghrán a phriontáil" + +#: src/buf.c:107 +msgid "Allocation of buffer for line directive failed" +msgstr "NÃorbh fhéidir spás a leagan amach do threoir lÃne" + +#: src/buf.c:177 +msgid "Allocation of buffer for m4 def failed" +msgstr "NÃorbh fhéidir spás a leagan amach do shainmhÃniú m4" + +#: src/buf.c:198 +msgid "Allocation of buffer for m4 undef failed" +msgstr "NÃorbh fhéidir spás a leagan amach do dhÃ-shainmhÃniú m4" + +#: src/dfa.c:59 #, c-format msgid "State #%d is non-accepting -\n" msgstr "NÃl an staid #%d ina staid ghlactha -\n" -#: dfa.c:124 +#: src/dfa.c:119 msgid "dangerous trailing context" -msgstr "comhthéacs sraoilleach baolach" +msgstr "comhthéacs leantach baolach" -#: dfa.c:166 +#: src/dfa.c:159 #, c-format msgid " associated rule line numbers:" -msgstr " lÃne-uimhreacha de na rialacha bainteacha:" +msgstr " lÃne-uimhreacha de na rialacha gaolmhara:" -#: dfa.c:202 +#: src/dfa.c:193 #, c-format msgid " out-transitions: " msgstr " athruithe amach: " # weak, I know -- KPS -#: dfa.c:210 +#: src/dfa.c:201 #, c-format msgid "" "\n" @@ -43,11 +61,11 @@ msgstr "" "\n" " athruithe plúchta: comhadchrÃoch " -#: dfa.c:341 +#: src/dfa.c:331 msgid "consistency check failed in epsclosure()" -msgstr "theip ar sheiceáil chomhionannais i epsclosure()" +msgstr "nÃorbh fhéidir comhsheasmhacht a sheiceáil in epsclosure()" -#: dfa.c:429 +#: src/dfa.c:419 msgid "" "\n" "\n" @@ -56,27 +74,27 @@ msgid "" msgstr "" "\n" "\n" -"Dumpáil DFA:\n" +"Dumpa DFA:\n" "\n" -#: dfa.c:604 +#: src/dfa.c:587 msgid "could not create unique end-of-buffer state" msgstr "nÃorbh fhéidir staid shainiúil a chruthú ag deireadh maoláin" -#: dfa.c:625 +#: src/dfa.c:608 #, c-format msgid "state # %d:\n" msgstr "staid # %d:\n" -#: dfa.c:785 +#: src/dfa.c:768 msgid "Could not write yynxt_tbl[][]" msgstr "NÃorbh fhéidir yynxt_tbl[][] a scrÃobh" -#: dfa.c:1052 +#: src/dfa.c:1028 msgid "bad transition character detected in sympartition()" msgstr "carachtar trasdula neamhbhailà i sympartition()" -#: gen.c:478 +#: src/gen.c:480 msgid "" "\n" "\n" @@ -88,29 +106,29 @@ msgstr "" "Aicmà Coibhéise:\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 "glacann staid # %d le: [%d]\n" -#: gen.c:1110 +#: src/gen.c:1115 #, c-format msgid "state # %d accepts: " msgstr "glacann staid # %d le: " -#: gen.c:1157 +#: src/gen.c:1162 msgid "Could not write yyacclist_tbl" msgstr "NÃorbh fhéidir yyacclist_tbl a scrÃobh" -#: gen.c:1233 +#: src/gen.c:1236 msgid "Could not write yyacc_tbl" msgstr "NÃorbh fhéidir yyacc_tbl a scrÃobh" -#: 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 "NÃorbh fhéidir ecstbl a scrÃobh" -#: gen.c:1271 +#: src/gen.c:1271 msgid "" "\n" "\n" @@ -120,389 +138,404 @@ msgstr "" "\n" "Aicmà Meiteachoibhéise:\n" -#: gen.c:1293 +#: src/gen.c:1293 msgid "Could not write yymeta_tbl" msgstr "NÃorbh fhéidir yymeta_tbl a scrÃobh" -#: gen.c:1354 +#: src/gen.c:1352 msgid "Could not write yybase_tbl" msgstr "NÃorbh fhéidir yybase_tbl a scrÃobh" -#: gen.c:1388 +#: src/gen.c:1384 msgid "Could not write yydef_tbl" msgstr "NÃorbh fhéidir yydef_tbl a scrÃobh" -#: gen.c:1428 +#: src/gen.c:1422 msgid "Could not write yynxt_tbl" msgstr "NÃorbh fhéidir yynxt_tbl a scrÃobh" -#: gen.c:1464 +#: src/gen.c:1456 msgid "Could not write yychk_tbl" msgstr "NÃorbh fhéidir yychk_tbl a scrÃobh" -#: gen.c:1618 gen.c:1647 +#: src/gen.c:1608 src/gen.c:1637 msgid "Could not write ftbl" msgstr "NÃorbh fhéidir ftbl a scrÃobh" -#: gen.c:1624 +#: src/gen.c:1614 msgid "Could not write ssltbl" msgstr "NÃorbh fhéidir ssltbl a scrÃobh" -#: gen.c:1675 +#: src/gen.c:1665 msgid "Could not write eoltbl" msgstr "NÃorbh fhéidir eoltbl a scrÃobh" -#: gen.c:1735 +#: src/gen.c:1722 msgid "Could not write yynultrans_tbl" msgstr "NÃorbh fhéidir yynultrans_tbl a scrÃobh" -#: main.c:189 +#: src/main.c:178 msgid "rule cannot be matched" -msgstr "Nà féidir riail chomhoiriúnach a aimsiú" +msgstr "nà féidir an riail a mheaitseáil" -#: main.c:194 +#: src/main.c:183 msgid "-s option given but default rule can be matched" -msgstr "bhà an rogha -s tugtha ach is féidir an riail réamhshocraithe a chur i gcomhoiriúnacht" +msgstr "tugadh rogha -s ach is féidir riail réamhshocraithe a mheaitseáil" -#: main.c:234 +#: src/main.c:221 msgid "Can't use -+ with -l option" -msgstr "NÃl -+ ar fáil in éineacht leis an rogha -l" +msgstr "NÃl -+ ar fáil in éineacht le rogha -l" -#: main.c:237 +#: src/main.c:224 msgid "Can't use -f or -F with -l option" -msgstr "NÃl -f nó -F ar fáil in éineacht leis an rogha -l" +msgstr "NÃl -f nó -F ar fáil in éineacht le -l" -#: main.c:241 +#: src/main.c:228 msgid "Can't use --reentrant or --bison-bridge with -l option" -msgstr "NÃl --reentrant nó --bison-bridge ar fáil in éineacht leis an rogha -l" +msgstr "NÃl --reentrant nó --bison-bridge ar fáil in éineacht le rogha -l" -#: main.c:278 +#: src/main.c:260 msgid "-Cf/-CF and -Cm don't make sense together" -msgstr "NÃl -Cf/-CF agus -Cm comhoiriúnach" +msgstr "Nà féidir -Cf/-CF agus -Cm a úsáid le chéile" -#: main.c:281 +#: src/main.c:263 msgid "-Cf/-CF and -I are incompatible" -msgstr "NÃl -Cf/-CF agus -I comhoiriúnach" +msgstr "Nà féidir -Cf/-CF agus -I a úsáid le chéile" -#: main.c:285 +#: src/main.c:267 msgid "-Cf/-CF are incompatible with lex-compatibility mode" -msgstr "NÃl -Cf/-CF ar fáil sa mhód comhoiriúnachta lex" +msgstr "NÃl -Cf/-CF ar fáil i mód comhoiriúnachta lex" -#: main.c:290 +#: src/main.c:272 msgid "-Cf and -CF are mutually exclusive" msgstr "Is comheisiatach iad na roghanna -Cf agus -CF" -#: main.c:294 +#: src/main.c:276 msgid "Can't use -+ with -CF option" -msgstr "NÃl -+ ar fáil in éineacht leis an rogha -CF" +msgstr "NÃl -+ ar fáil in éineacht le rogha -CF" -#: main.c:297 +#: src/main.c:279 #, c-format msgid "%array incompatible with -+ option" -msgstr "nÃl %array comhoiriúnach leis an rogha -+" +msgstr "Nà féidir %array a úsáid le rogha -+" -#: main.c:302 +#: src/main.c:284 msgid "Options -+ and --reentrant are mutually exclusive." msgstr "Is comheisiatach iad na roghanna -+ agus --reentrant." -#: main.c:305 +#: src/main.c:287 msgid "bison bridge not supported for the C++ scanner." msgstr "nÃl bison bridge ar fáil don scanóir C++." -#: main.c:360 main.c:406 +#: src/main.c:336 src/main.c:419 #, c-format msgid "could not create %s" msgstr "nÃorbh fhéidir %s a chruthú" -#: main.c:419 +#: src/main.c:431 msgid "could not write tables header" msgstr "nÃorbh fhéidir ceanntásc táblaà a scrÃobh" -#: main.c:423 +#: src/main.c:435 #, c-format msgid "can't open skeleton file %s" msgstr "nà féidir creatchomhad %s a oscailt" -#: main.c:505 +#: src/main.c:450 +msgid "Prefix cannot include '[' or ']'" +msgstr "" + +#: src/main.c:474 +msgid "allocation of macro definition failed" +msgstr "nÃorbh fhéidir spás a leagan amach do shainmhÃniú an mhacra" + +#: src/main.c:521 #, c-format msgid "input error reading skeleton file %s" msgstr "earráid agus creatchomhaid %s á léamh" -#: main.c:509 +#: src/main.c:525 #, c-format msgid "error closing skeleton file %s" msgstr "earráid agus creatchomhaid %s á dhúnadh" -#: main.c:694 +#: src/main.c:709 #, c-format msgid "error creating header file %s" msgstr "earráid agus comhad ceanntáisc %s á chruthú" -#: main.c:702 +#: src/main.c:717 #, c-format msgid "error writing output file %s" msgstr "earráid agus aschomhaid %s á scrÃobh" -#: main.c:706 +#: src/main.c:721 #, c-format msgid "error closing output file %s" msgstr "earráid agus aschomhad %s á dhúnadh" -#: main.c:710 +#: src/main.c:725 #, c-format msgid "error deleting output file %s" msgstr "earráid agus aschomhaid %s á scriosadh" -#: main.c:717 +#: src/main.c:732 #, c-format msgid "No backing up.\n" -msgstr "Ná cúlaÃtear.\n" +msgstr "Gan cúlú.\n" -#: main.c:721 +#: src/main.c:736 #, c-format msgid "%d backing up (non-accepting) states.\n" -msgstr "%d staid chúlaithe (nÃl ina staid ghlactha).\n" +msgstr "%d staid chúlaithe (nach bhfuil ina staid ghlactha).\n" -#: main.c:725 +#: src/main.c:740 #, c-format msgid "Compressed tables always back up.\n" msgstr "CúlaÃonn táblaà comhbhrúite i gcónaÃ.\n" -#: main.c:728 +#: src/main.c:743 #, c-format msgid "error writing backup file %s" msgstr "earráid agus comhad cúltaca %s á scrÃobh" -#: main.c:732 +#: src/main.c:747 #, c-format msgid "error closing backup file %s" msgstr "earráid agus comhad cúltaca %s á dhúnadh" -#: main.c:737 +#: src/main.c:752 #, c-format msgid "%s version %s usage statistics:\n" msgstr "%s leagan %s staitistic d'úsáid:\n" # fr uses "lexical analyzer"; scanóir seems fine though --KPS -#: main.c:740 +#: src/main.c:755 #, c-format msgid " scanner options: -" msgstr " roghanna don scanóir: -" -#: main.c:819 +#: src/main.c:834 #, c-format msgid " %d/%d NFA states\n" msgstr " %d/%d staid NFA\n" -#: main.c:821 +#: src/main.c:836 #, c-format msgid " %d/%d DFA states (%d words)\n" msgstr " %d/%d staid DFA (%d focal)\n" -#: main.c:823 +#: src/main.c:838 #, c-format msgid " %d rules\n" msgstr " %d riail\n" -#: main.c:828 +#: src/main.c:843 #, c-format msgid " No backing up\n" -msgstr " Ná cúlaÃtear\n" +msgstr " Gan cúlú\n" -#: main.c:832 +#: src/main.c:847 #, c-format msgid " %d backing-up (non-accepting) states\n" msgstr " %d staid chúlaithe (nÃl ina staid ghlactha)\n" -#: main.c:837 +#: src/main.c:852 #, c-format msgid " Compressed tables always back-up\n" msgstr " CúlaÃonn táblaà comhbhrúite i gcónaÃ\n" -#: main.c:841 +#: src/main.c:856 #, c-format msgid " Beginning-of-line patterns used\n" -msgstr " Patrúin úsáidte ag ceann lÃne\n" +msgstr " Patrúin úsáidte ag tús na lÃne\n" -#: main.c:843 +#: src/main.c:858 #, c-format msgid " %d/%d start conditions\n" msgstr " %d/%d coinnÃoll tosaigh\n" -#: main.c:847 +#: src/main.c:862 #, c-format msgid " %d epsilon states, %d double epsilon states\n" msgstr " %d staid eipsealóin, %d staid eipsealóin dúbailte\n" -#: main.c:851 +#: src/main.c:866 #, c-format msgid " no character classes\n" -msgstr " nÃl aon aicme charachtair\n" +msgstr " nÃl aon aicme charachtair ann\n" -#: main.c:855 +#: src/main.c:870 #, c-format msgid " %d/%d character classes needed %d/%d words of storage, %d reused\n" -msgstr " tá gá le %d/%d aicme charachtair %d/%d focal stórála, %d athúsáidte\n" +msgstr "" +" tá gá le %d/%d aicme charachtair %d/%d focal stórála, %d athúsáidte\n" -#: main.c:860 +#: src/main.c:875 #, c-format msgid " %d state/nextstate pairs created\n" msgstr " %d péire state/nextstate\n" -#: main.c:863 +#: src/main.c:878 #, c-format msgid " %d/%d unique/duplicate transitions\n" msgstr " %d/%d athrú sainiúil/dúblach\n" -#: main.c:868 +#: src/main.c:883 #, c-format msgid " %d table entries\n" msgstr " %d iontráil sa tábla\n" -#: main.c:876 +#: src/main.c:891 #, c-format msgid " %d/%d base-def entries created\n" msgstr " %d/%d iontráil base-def\n" -#: main.c:880 +#: src/main.c:895 #, c-format msgid " %d/%d (peak %d) nxt-chk entries created\n" msgstr " %d/%d (buaic %d) iontráil nxt-chk\n" -#: main.c:884 +#: src/main.c:899 #, c-format msgid " %d/%d (peak %d) template nxt-chk entries created\n" msgstr " %d/%d (buaic %d) iontráil teimpléid nxt-chk\n" -#: main.c:888 +#: src/main.c:903 #, c-format msgid " %d empty table entries\n" msgstr " %d iontráil tábla folamh\n" -#: main.c:890 +#: src/main.c:905 #, c-format msgid " %d protos created\n" msgstr " %d fréamhshamhail\n" -#: main.c:893 +#: src/main.c:908 #, c-format msgid " %d templates created, %d uses\n" msgstr " %d teimpléad, %d i bhfeidhm\n" -#: main.c:901 +#: src/main.c:916 #, c-format msgid " %d/%d equivalence classes created\n" msgstr " %d/%d aicme choibhéise\n" -#: main.c:909 +#: src/main.c:924 #, c-format msgid " %d/%d meta-equivalence classes created\n" msgstr " %d/%d aicme mheiteachoibhéise\n" -#: main.c:915 +#: src/main.c:930 #, c-format msgid " %d (%d saved) hash collisions, %d DFAs equal\n" msgstr " %d (%d sábháilte) tuairt haiseála, %d DFA comhionann le chéile\n" -#: main.c:917 +#: src/main.c:932 #, c-format msgid " %d sets of reallocations needed\n" msgstr " tá gá le %d sraith athdháilte\n" -#: main.c:919 +#: src/main.c:934 #, c-format msgid " %d total table entries needed\n" msgstr " tá gá le %d iontráil tábla ar fad\n" -#: main.c:996 +#: src/main.c:1008 #, c-format msgid "Internal error. flexopts are malformed.\n" msgstr "Earráid inmheánach (flexopts mÃchumtha).\n" -#: main.c:1006 +#: src/main.c:1018 #, c-format msgid "Try `%s --help' for more information.\n" msgstr "Bain triail as `%s --help' chun tuilleadh eolais a fháil.\n" -#: main.c:1063 +#: src/main.c:1075 #, c-format msgid "unknown -C option '%c'" msgstr "rogha -C anaithnid '%c'" -#: main.c:1192 +#: src/main.c:1204 #, c-format msgid "%s %s\n" msgstr "%s %s\n" -#: main.c:1467 +#: src/main.c:1476 msgid "fatal parse error" msgstr "earráid pharsála mharfach" -#: main.c:1499 +#: src/main.c:1508 #, c-format msgid "could not create backing-up info file %s" msgstr "nÃorbh fhéidir comhad %s a chruthú don eolas faoin chúlú" -#: main.c:1520 +#: src/main.c:1529 #, c-format msgid "-l AT&T lex compatibility option entails a large performance penalty\n" msgstr "is cúis le moilliú mór an rogha -l (comhoiriúnacht le AT&T lex)\n" -#: main.c:1523 +#: src/main.c:1532 #, c-format msgid " and may be the actual source of other reported performance penalties\n" -msgstr " agus is féidir gur cúis é le fadhbanna luais eile é\n" +msgstr " agus b'fhéidir gur cúis le fadhbanna luais eile é\n" -#: main.c:1529 +#: src/main.c:1538 #, c-format -msgid "%%option yylineno entails a performance penalty ONLY on rules that can match newline characters\n" -msgstr "is cúis le moilliú mór an %%rogha yylineno, Mà tá rialacha ann le lÃnte nua iontu\n" +msgid "" +"%%option yylineno entails a performance penalty ONLY on rules that can match " +"newline characters\n" +msgstr "" +"is cúis le moilliú mór an %%rogha yylineno, Mà tá rialacha ann a bhfuil " +"lÃnte nua iontu\n" -#: main.c:1536 +#: src/main.c:1545 #, c-format msgid "-I (interactive) entails a minor performance penalty\n" msgstr "is cúis le moilliú beag an rogha -I (idirghnÃomhach)\n" -#: main.c:1541 +#: src/main.c:1550 #, c-format msgid "yymore() entails a minor performance penalty\n" msgstr "is cúis le moilliú beag an fheidhm yymore()\n" -#: main.c:1547 +#: src/main.c:1556 #, c-format msgid "REJECT entails a large performance penalty\n" -msgstr "is REJECT cúis le moilliú mór\n" +msgstr "is cúis le moilliú mór é REJECT\n" -#: main.c:1552 +#: src/main.c:1561 #, c-format msgid "Variable trailing context rules entail a large performance penalty\n" -msgstr "is cúis le moilliú na rialacha maidir le comhthéacs sraoilleach athraitheach\n" +msgstr "" +"is cúis le moilliú na rialacha maidir le comhthéacs leantach athraitheach\n" -#: main.c:1564 +#: src/main.c:1573 msgid "REJECT cannot be used with -f or -F" msgstr "NÃl REJECT ar fáil leis na roghanna -f nó -F" -#: main.c:1567 +#: src/main.c:1576 #, c-format msgid "%option yylineno cannot be used with REJECT" msgstr "nÃl %option yylineno ar fáil le REJECT" -#: main.c:1570 +#: src/main.c:1579 msgid "variable trailing context rules cannot be used with -f or -F" -msgstr "nÃl rialacha maidir le comhthéacs sraoilleach athraitheach ar fáil le -f nó -F" +msgstr "" +"nÃl rialacha maidir le comhthéacs leantach athraitheach ar fáil le -f nó -F" -#: main.c:1691 +#: src/main.c:1704 #, c-format msgid "%option yyclass only meaningful for C++ scanners" msgstr "tá an %option yyclass gan bhrà ach amháin le scanóirà C++" -#: main.c:1798 +#: src/main.c:1791 #, c-format msgid "Usage: %s [OPTIONS] [FILE]...\n" msgstr "Úsáid: %s [ROGHANNA] [COMHAD]...\n" -#: main.c:1801 -#, c-format +#: src/main.c:1794 +#, fuzzy, c-format msgid "" "Generates programs that perform pattern-matching on text.\n" "\n" @@ -525,13 +558,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" @@ -553,8 +589,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" @@ -585,21 +619,24 @@ msgstr "" " -s, --nodefault ná déan macalla de théacs neamh-chomhoiriúnach\n" " -T, --trace ba chóir do %s a rith sa mhód loirg\n" " -w, --nowarn ná taispeáin rabhaidh\n" -" -v, --verbose taispeáin achoimre ar staitistic scanóra chuig stdout\n" +" -v, --verbose taispeáin achoimre ar staitistic scanóra chuig " +"stdout\n" "\n" "Comhaid:\n" " -o, --outfile=COMHAD roghnaigh ainm comhaid le haghaidh aschuir\n" " -S, --skel=COMHAD roghnaigh creatchomhad\n" " -t, --stdout scrÃobh an scanóir chuig stdout in ionad %s\n" " --yyclass=COMHAD ainm de `class' C++\n" -" --header-file=COMHAD scrÃobh comhad ceanntáisc C i dteannta an scanóra\n" +" --header-file=COMHAD scrÃobh comhad ceanntáisc C i dteannta an " +"scanóra\n" " --tables-file[=COMHAD] scrÃobh na táblaà chuig COMHAD\n" "\n" "Scanóir:\n" " -7, --7bit gin scanóir 7-giotán\n" " -8, --8bit gin scanóir 8-giotán\n" " -B, --batch gin scanóir baisce (i gcodarsnacht le -I)\n" -" -i, --case-insensitive déan neamhshuim ar cheannlitreacha/litreacha beaga\n" +" -i, --case-insensitive déan neamhshuim ar cheannlitreacha/litreacha " +"beaga\n" " -l, --lex-compat comhoiriúnacht le lex bunúsach, a mhéad is féidir\n" " -X, --posix-compat comhoiriúnacht le lex POSIX, a mhéad is féidir\n" " -I, --interactive gin scanóir idirghnÃomhach (i gcodarsnacht le -B)\n" @@ -626,47 +663,52 @@ msgstr "" " -h, --help taispeáin an chabhair seo\n" " -V, --version taispeáin leagan %s\n" -#: misc.c:100 misc.c:126 +#: src/misc.c:64 +msgid "allocation of sko_stack failed" +msgstr "nÃorbh fhéidir spás a leagan amach do sko_stack" + +#: src/misc.c:100 #, c-format msgid "name \"%s\" ridiculously long" msgstr "tá an t-ainm \"%s\" i bhfad Éireann rófhada" -#: misc.c:175 +#: src/misc.c:155 msgid "memory allocation failed in allocate_array()" msgstr "theip ar dháileadh na cuimhne i allocate_array()" -#: misc.c:250 +#: src/misc.c:205 #, c-format msgid "bad character '%s' detected in check_char()" msgstr "aimsÃodh carachtar neamhbhailà '%s' i check_char()" -#: misc.c:255 +#: src/misc.c:210 #, c-format msgid "scanner requires -8 flag to use the character %s" -msgstr "nà foláir an rogha -8 chun an charachtair %s a úsáid" +msgstr "teastaÃonn rogha -8 ón scanóir chun carachtar %s a úsáid" -#: misc.c:288 -msgid "dynamic memory failure in copy_string()" -msgstr "theip ar dháileadh na cuimhne i copy_string()" +#: src/misc.c:229 +#, fuzzy +msgid "memory allocation failure in xstrdup()" +msgstr "theip ar dháileadh na cuimhne i allocate_array()" -#: misc.c:422 +#: src/misc.c:303 #, c-format msgid "%s: fatal internal error, %s\n" msgstr "%s: earráid inmheánach mharfach, %s\n" -#: misc.c:875 +#: src/misc.c:671 msgid "attempt to increase array size failed" msgstr "theip ar mhéadú an eagair" -#: misc.c:1002 +#: src/misc.c:795 msgid "bad line in skeleton file" msgstr "drochlÃne i gcreatchomhad" -#: misc.c:1051 +#: src/misc.c:845 msgid "memory allocation failed in yy_flex_xmalloc()" -msgstr "theip ar dháileadh na cuimhne i yy_flex_xmalloc()" +msgstr "theip ar dháileadh cuimhne i yy_flex_xmalloc()" -#: nfa.c:104 +#: src/nfa.c:100 #, c-format msgid "" "\n" @@ -677,216 +719,246 @@ msgstr "" "\n" "********** ag tosú dumpála de nfa le staid tosaigh %d\n" -#: nfa.c:115 +#: src/nfa.c:111 #, c-format msgid "state # %4d\t" msgstr "staid # %4d\t" -#: nfa.c:130 +#: src/nfa.c:126 #, c-format msgid "********** end of dump\n" -msgstr "********** i ndeireadh dumpála\n" +msgstr "********** deireadh an dumpa\n" -#: nfa.c:174 +#: src/nfa.c:169 msgid "empty machine in dupmachine()" msgstr "meaisÃn folamh i dupmachine()" -#: nfa.c:240 +#: src/nfa.c:234 #, c-format msgid "Variable trailing context rule at line %d\n" -msgstr "riail maidir le comhthéacs sraoilleach athraitheach ag lÃne %d\n" +msgstr "Riail maidir le comhthéacs leantach athraitheach ag lÃne %d\n" -#: nfa.c:353 +#: src/nfa.c:357 msgid "bad state type in mark_beginning_as_normal()" msgstr "drochstaid i mark_beginning_as_normal()" -#: nfa.c:598 +#: src/nfa.c:595 #, c-format msgid "input rules are too complicated (>= %d NFA states)" msgstr "is róchasta na rialacha ionchuir (>= %d staid NFA)" -#: nfa.c:677 +#: src/nfa.c:673 msgid "found too many transitions in mkxtion()" msgstr "an iomarca athruithe i mkxtion()" -#: nfa.c:703 +#: src/nfa.c:699 #, c-format msgid "too many rules (> %d)!" msgstr "an iomarca rialacha (> %d)!" -#: parse.y:159 +#: src/parse.y:159 msgid "unknown error processing section 1" msgstr "earráid anaithnid agus an chéad pháirt á próiseáil" -#: parse.y:184 parse.y:351 +#: src/parse.y:184 src/parse.y:353 msgid "bad start condition list" -msgstr "is neamhbhailà liosta na coinnÃollacha tosaigh" +msgstr "is neamhbhailà liosta na gcoinnÃollacha tosaigh" + +#: src/parse.y:204 +msgid "Prefix must not contain [ or ]" +msgstr "" -#: parse.y:315 +#: src/parse.y:317 msgid "unrecognized rule" msgstr "riail anaithnid" -#: 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 "baineadh úsáid as comhthéacs sraoilleach faoi dhó" +msgstr "baineadh úsáid as comhthéacs leantach faoi dhó" -#: 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 "luachanna timthrialla neamhbhailÃ" -#: 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 "nà foláir luach timthrialla deimhneach" -#: parse.y:806 parse.y:816 +#: src/parse.y:806 src/parse.y:816 #, c-format msgid "the character range [%c-%c] is ambiguous in a case-insensitive scanner" -msgstr "tá an raon carachtair [%c-%c] débhrÃoch i scanóir a dhéanann neamhshuim ar cheannlitreacha agus litreacha beaga" +msgstr "" +"tá an raon carachtair [%c-%c] débhrÃoch i scanóir a dhéanann neamhshuim ar " +"cheannlitreacha agus litreacha beaga" -#: parse.y:821 +#: src/parse.y:821 msgid "negative range in character class" msgstr "raon diúltach in aicme charachtair" -#: parse.y:918 +#: src/parse.y:918 msgid "[:^lower:] is ambiguous in case insensitive scanner" -msgstr "tá [:^lower:] débhrÃoch i scanóir a dhéanann neamhshuim ar cheannlitreacha agus litreacha beaga" +msgstr "" +"tá [:^lower:] débhrÃoch i scanóir a dhéanann neamhshuim ar cheannlitreacha " +"agus litreacha beaga" -#: parse.y:924 +#: src/parse.y:924 msgid "[:^upper:] ambiguous in case insensitive scanner" -msgstr "tá [:^upper:] débhrÃoch i scanóir a dhéanann neamhshuim ar cheannlitreacha agus litreacha beaga" +msgstr "" +"tá [:^upper:] débhrÃoch i scanóir a dhéanann neamhshuim ar cheannlitreacha " +"agus litreacha beaga" -#: scan.l:75 scan.l:192 scan.l:300 scan.l:443 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 "Tá lÃne an ionchuir rófhada\n" +msgstr "LÃne ionchurtha rófhada\n" -#: scan.l:161 +#: src/scan.l:183 #, c-format msgid "malformed '%top' directive" msgstr "treoir '%top' mÃchumtha" -#: scan.l:183 +#: src/scan.l:205 #, no-c-format msgid "unrecognized '%' directive" msgstr "treoir '%' anaithnid" -#: scan.l:284 +#: src/scan.l:214 +msgid "Definition name too long\n" +msgstr "Ainm an tsainmhÃnithe rófhada\n" + +#: src/scan.l:309 msgid "Unmatched '{'" msgstr "'{' corr" -#: scan.l:317 +#: src/scan.l:325 +#, c-format +msgid "Definition value for {%s} too long\n" +msgstr "Luach an tsainmhÃnithe {%s} rófhada\n" + +#: src/scan.l:342 msgid "incomplete name definition" -msgstr "is neamhiomlán an sainmhÃniú ainm" +msgstr "is neamhiomlán sainmhÃniú an ainm" + +#: src/scan.l:467 +msgid "Option line too long\n" +msgstr "LÃne roghanna rófhada\n" -#: scan.l:451 +#: src/scan.l:475 #, c-format msgid "unrecognized %%option: %s" msgstr "rogha %% anaithnid: %s" -#: scan.l:633 scan.l:800 +#: src/scan.l:659 src/scan.l:832 msgid "bad character class" msgstr "aicme charachtair neamhbhailÃ" -#: scan.l:683 +#: src/scan.l:709 #, c-format msgid "undefined definition {%s}" msgstr "sainmhÃniú neamhshainithe {%s}" -#: scan.l:755 +#: src/scan.l:772 +msgid "unbalanced parenthesis" +msgstr "" + +#: src/scan.l:787 #, c-format msgid "bad <start condition>: %s" msgstr "<coinnÃoll tosaigh> neamhbhailÃ: %s" -#: scan.l:768 +#: src/scan.l:800 msgid "missing quote" msgstr "comhartha athfhriotal ar iarraidh" -#: scan.l:834 +#: src/scan.l:866 #, c-format msgid "bad character class expression: %s" msgstr "is neamhbhailà an slonn aicme carachtair: %s" -#: scan.l:856 +#: src/scan.l:888 msgid "bad character inside {}'s" msgstr "carachtar neamhbhailà idir {}" -#: scan.l:862 +#: src/scan.l:894 msgid "missing }" msgstr "} ar iarraidh." -#: scan.l:940 +#: src/scan.l:972 msgid "EOF encountered inside an action" -msgstr "Buaileadh comhadchrÃoch isteach i ngnÃomh" +msgstr "Buaileadh comhadchrÃoch laistigh de ghnÃomh" -#: scan.l:945 +#: src/scan.l:977 msgid "EOF encountered inside pattern" -msgstr "Buaileadh comhadchrÃoch isteach i bpatrún" +msgstr "Buaileadh comhadchrÃoch laistigh de phatrún" -#: scan.l:967 +#: src/scan.l:1010 #, c-format msgid "bad character: %s" msgstr "carachtar neamhbhailÃ: %s" -#: scan.l:996 +#: src/scan.l:1038 #, c-format msgid "can't open %s" msgstr "nà féidir %s a oscailt" -#: scanopt.c:291 +#: src/scanopt.c:259 #, c-format msgid "Usage: %s [OPTIONS]...\n" msgstr "Úsáid: %s [ROGHANNA]...\n" -#: scanopt.c:565 +#: src/scanopt.c:524 #, c-format msgid "option `%s' doesn't allow an argument\n" msgstr "nà cheadaÃtear argóint i ndiaidh na rogha `%s'\n" -#: scanopt.c:570 +#: src/scanopt.c:529 #, c-format msgid "option `%s' requires an argument\n" msgstr "tá argóint de dhÃth i ndiaidh na rogha `%s'\n" -#: scanopt.c:574 +#: src/scanopt.c:533 #, c-format msgid "option `%s' is ambiguous\n" msgstr "tá an rogha `%s' débhrÃoch\n" -#: scanopt.c:578 +#: src/scanopt.c:537 #, c-format msgid "Unrecognized option `%s'\n" msgstr "Rogha anaithnid `%s'\n" -#: scanopt.c:582 +#: src/scanopt.c:541 #, c-format msgid "Unknown error=(%d)\n" msgstr "Earráid anaithnid=(%d)\n" -#: sym.c:100 +#: src/sym.c:92 msgid "symbol table memory allocation failed" -msgstr "theip ar dháileadh na cuimhne don tábla siombalach" +msgstr "theip ar dháileadh na cuimhne don tábla na siombailÃ" -#: sym.c:202 +#: src/sym.c:183 msgid "name defined twice" msgstr "sainmhÃnÃodh an t-ainm faoi dhó" -#: sym.c:253 +#: src/sym.c:231 #, c-format msgid "start condition %s declared twice" msgstr "fógraÃodh an coinnÃoll tosaigh %s faoi dhó" -#: yylex.c:56 +#: src/yylex.c:57 msgid "premature EOF" -msgstr "comhadchrÃoch gan choinne" +msgstr "comhadchrÃoch gan súil leis" -#: yylex.c:198 +#: src/yylex.c:200 #, c-format msgid "End Marker\n" msgstr "Comhartha Deiridh\n" -#: yylex.c:204 +#: src/yylex.c:206 #, c-format msgid "*Something Weird* - tok: %d val: %d\n" msgstr "*Rud Éigin Aisteach* - tok: %d val: %d\n" +#~ msgid "dynamic memory failure in copy_string()" +#~ msgstr "theip ar chuimhne dhinimiciúil i copy_string()" + #~ msgid "consistency check failed in symfollowset" #~ msgstr "theip ar sheiceáil chomhionannais i symfollowset" @@ -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" @@ -5,650 +5,1034 @@ msgid "" msgstr "" "Project-Id-Version: flex 2.5.2\n" +"Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n" +"POT-Creation-Date: 2017-05-06 10:49-0400\n" "PO-Revision-Date: 1997-02-05 20:30\n" "Last-Translator: Choi Jun Ho <junker@jazz.snu.ac.kr>\n" "Language-Team: Korean <ko@li.org>\n" +"Language: ko\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=EUC-KR\n" "Content-Transfer-Encoding: 8-bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" -#: main.c:361 -msgid "input error reading skeleton file %s" -msgstr "½ºÄÌ·¹Åæ ÆÄÀÏ %s¸¦ Àд µµÁß ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù" - -#: main.c:898 -msgid " and may be the actual source of other reported performance penalties\n" -msgstr " ±×¸®°í ¾Æ¸¶µµ ´Ù¸¥ º¸°íµÈ ¼º´É ÀúÇÏÀÇ ½ÇÁ¦ ¿øÀÎÀÏ °ÍÀÔ´Ï´Ù\n" - -#: main.c:814 -msgid "" -"%s: unknown flag '%c'. For usage, try\n" -"\t%s --help\n" +#: src/buf.c:79 +msgid "Allocation of buffer to print string failed" msgstr "" -"%s: ¾Ë ¼ö ¾ø´Â ¿É¼Ç '%c'. »ç¿ë¹ýÀ» º¸·Á¸é \n" -"\t%s --help¶ó°í Çϼ¼¿ä.\n" -#: dfa.c:211 -msgid " out-transitions: " -msgstr " ³ª°¡´Â ÂÊ ÀüÀÌ: " +#: src/buf.c:107 +msgid "Allocation of buffer for line directive failed" +msgstr "" -#: main.c:394 -msgid "Compressed tables always back up.\n" -msgstr " ¾ÐÃàµÈ Å×À̺íÀº Ç×»ó ¹é¾÷ÇÕ´Ï´Ù.\n" +#: src/buf.c:177 +msgid "Allocation of buffer for m4 def failed" +msgstr "" -#: main.c:896 -msgid "-l AT&T lex compatibility option entails a large performance penalty\n" -msgstr "-l AT&T lex ȣȯ ¿É¼ÇÀº Å« ¼º´É ÀúÇϸ¦ ÀÏÀ¸Åµ´Ï´Ù\n" +#: src/buf.c:198 +msgid "Allocation of buffer for m4 undef failed" +msgstr "" -#: scan.l:493 -msgid "missing quote" -msgstr "Àοë±âÈ£ ºüÁü" +#: src/dfa.c:59 +#, c-format +msgid "State #%d is non-accepting -\n" +msgstr "»óŹøÈ£ %d´Â ¹Þ¾ÆµéÀÌÁö ¾Ê´Â -ÀÔ´Ï´Ù\n" -#: dfa.c:130 +#: src/dfa.c:119 msgid "dangerous trailing context" msgstr "À§ÇèÇÑ ÃßÀû ¹®¸Æ" -#: main.c:556 -msgid " %d/%d equivalence classes created\n" -msgstr " %d/%d°³ÀÇ µ¿Ä¡·ù°¡ ¸¸µé¾îÁ³½À´Ï´Ù\n" - -#: main.c:158 -msgid "-s option given but default rule can be matched" -msgstr "-s ¿É¼ÇÀÌ ÁÖ¾îÁ³Áö¸¸ ±âº» ±ÔÄ¢ÀÌ Àû¿ëµÉ ¼ö ÀÖ½À´Ï´Ù" +#: src/dfa.c:159 +#, c-format +msgid " associated rule line numbers:" +msgstr " °ü·Ã ±ÔÄ¢ Çà¹øÈ£:" -#: main.c:762 -msgid "-P flag must be given separately" -msgstr "-P Ç÷¡±×´Â µû·Î ÁÖ¾î¾ß ÇÕ´Ï´Ù" +#: src/dfa.c:193 +#, c-format +msgid " out-transitions: " +msgstr " ³ª°¡´Â ÂÊ ÀüÀÌ: " -#: gen.c:426 gen.c:902 -msgid "state # %d accepts: [%d]\n" -msgstr "»óŹøÈ£ %d´Â [%d]¸¦ ¹Þ¾ÆµéÀÔ´Ï´Ù\n" +#: src/dfa.c:201 +#, c-format +msgid "" +"\n" +" jam-transitions: EOF " +msgstr "" +"\n" +" Àë-ÀüÀÌ: EOF " -#: main.c:401 -msgid "error closing backup file %s" -msgstr "¹é¾÷ ÆÄÀÏ %s¸¦ ´Ý´Âµ¥ ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù" +#: src/dfa.c:331 +msgid "consistency check failed in epsclosure()" +msgstr "epsclosure()¿¡¼ ÀÏ°ü¼º °Ë»ç°¡ ½ÇÆÐÇß½À´Ï´Ù" -#: main.c:753 -msgid "-o flag must be given separately" -msgstr "-o Ç÷¡±×´Â µû·Î ÁÖ¾î¾ß ÇÕ´Ï´Ù" +#: src/dfa.c:419 +msgid "" +"\n" +"\n" +"DFA Dump:\n" +"\n" +msgstr "" +"\n" +"\n" +"DFA Ãâ·Â:\n" +"\n" -#: main.c:774 -msgid "-S flag must be given separately" -msgstr "-S Ç÷¡±×´Â µû·Î ÁÖ¾î¾ß ÇÕ´Ï´Ù" +#: src/dfa.c:587 +msgid "could not create unique end-of-buffer state" +msgstr "À¯ÀÏÇÑ ¹öÆÛÀÇ ³¡(end-of-buffer)»óŸ¦ ¸¸µé ¼ö ¾ø¾ú½À´Ï´Ù" -#: main.c:302 -msgid "can't open skeleton file %s" -msgstr "½ºÄÌ·¹Åæ ÆÄÀÏ %s¸¦ ¿ ¼ö ¾ø½À´Ï´Ù" +#: src/dfa.c:608 +#, c-format +msgid "state # %d:\n" +msgstr "»óŹøÈ£ %d:\n" -#: main.c:545 -msgid " %d protos created\n" -msgstr " %d°³ÀÇ ¿øÇüÀÌ ¸¸µé¾îÁ³½À´Ï´Ù\n" +#: src/dfa.c:768 +msgid "Could not write yynxt_tbl[][]" +msgstr "" -#: dfa.c:1043 +#: src/dfa.c:1028 msgid "bad transition character detected in sympartition()" msgstr "sympartition()¿¡¼ À߸øµÈ ÀüÀÌ ¹®ÀÚ¸¦ ã¾Ò½À´Ï´Ù" -#: dfa.c:606 -msgid "state # %d:\n" -msgstr "»óŹøÈ£ %d:\n" +#: src/gen.c:480 +msgid "" +"\n" +"\n" +"Equivalence Classes:\n" +"\n" +msgstr "" +"\n" +"\n" +"µ¿Ä¡·ù:\n" +"\n" -#: main.c:662 -msgid "-C flag must be given separately" -msgstr "-C Ç÷¡±×´Â µû·Î ÁÖ¾î¾ß ÇÕ´Ï´Ù" +#: src/gen.c:669 src/gen.c:698 src/gen.c:1218 +#, c-format +msgid "state # %d accepts: [%d]\n" +msgstr "»óŹøÈ£ %d´Â [%d]¸¦ ¹Þ¾ÆµéÀÔ´Ï´Ù\n" -#: main.c:390 -msgid "%d backing up (non-accepting) states.\n" -msgstr "%d°³ÀÇ µÇµ¹¸²(¹Þ¾ÆµéÀÌÁö ¾Ê´Â) »óÅÂ.\n" +#: src/gen.c:1115 +#, c-format +msgid "state # %d accepts: " +msgstr "»óŹøÈ£ %d´Â ´ÙÀ½À» ¹Þ¾ÆµéÀÔ´Ï´Ù: " -#: scan.l:136 -msgid "unrecognized '%' directive" -msgstr "¾Ë ¼ö ¾ø´Â '%' Áö½ÃÀÚ" +#: src/gen.c:1162 +msgid "Could not write yyacclist_tbl" +msgstr "" -#: main.c:543 -msgid " %d empty table entries\n" -msgstr " %d°³ÀÇ ºó Å×ÀÌºí ¿£Æ®¸®\n" +#: src/gen.c:1236 +msgid "Could not write yyacc_tbl" +msgstr "" -#: main.c:539 -msgid " %d/%d (peak %d) template nxt-chk entries created\n" -msgstr " %d/%d (ÃÖ´ë %d) ÅÛÇø®Æ® nxt-chk ¿£Æ®¸®°¡ ¸¸µé¾îÁ³½À´Ï´Ù\n" +#: src/gen.c:1251 src/gen.c:1623 src/gen.c:1646 +#, fuzzy +msgid "Could not write ecstbl" +msgstr "%s¸¦ ¸¸µé ¼ö ¾ø½À´Ï´Ù" -#: main.c:533 -msgid " %d/%d base-def entries created\n" -msgstr " %d/%d base-def ¿£Æ®¸®°¡ ¸¸µé¾îÁ³½À´Ï´Ù\n" +#: src/gen.c:1271 +msgid "" +"\n" +"\n" +"Meta-Equivalence Classes:\n" +msgstr "" +"\n" +"\n" +"¸ÞŸ-µ¿Ä¡·ùµé:\n" -#: dfa.c:173 -msgid " associated rule line numbers:" -msgstr " °ü·Ã ±ÔÄ¢ Çà¹øÈ£:" +#: src/gen.c:1293 +msgid "Could not write yymeta_tbl" +msgstr "" -#: scan.l:286 -msgid "unrecognized %%option: %s" -msgstr "¾Ë ¼ö ¾ø´Â %%option: %s" +#: src/gen.c:1352 +#, fuzzy +msgid "Could not write yybase_tbl" +msgstr "%s¸¦ ¸¸µé ¼ö ¾ø½À´Ï´Ù" -#: main.c:496 -msgid " Compressed tables always back-up\n" -msgstr " ¾ÐÃàµÈ Å×À̺íÀº Ç×»ó ¹é¾÷ÇÕ´Ï´Ù\n" +#: src/gen.c:1384 +msgid "Could not write yydef_tbl" +msgstr "" -#: main.c:573 -msgid " %d total table entries needed\n" -msgstr " ÃÑ %d°³ÀÇ Å×ÀÌºí ¿£Æ®¸®°¡ ÇÊ¿äÇÕ´Ï´Ù\n" +#: src/gen.c:1422 +msgid "Could not write yynxt_tbl" +msgstr "" -#: main.c:519 -msgid " %d/%d unique/duplicate transitions\n" -msgstr " %d/%d°³ÀÇ À¯ÀÏÇÑ/Áߺ¹µÇ´Â ÀüÀÌ\n" +#: src/gen.c:1456 +msgid "Could not write yychk_tbl" +msgstr "" -#: dfa.c:990 -msgid "consistency check failed in symfollowset" -msgstr "symfollowset¿¡¼ ÀÏ°ü¼º °Ë»ç°¡ ½ÇÆÐÇß½À´Ï´Ù" +#: src/gen.c:1608 src/gen.c:1637 +#, fuzzy +msgid "Could not write ftbl" +msgstr "%s¸¦ ¸¸µé ¼ö ¾ø½À´Ï´Ù" -#: scan.l:533 -msgid "bad character class expression: %s" -msgstr "À߸øµÈ ¹®ÀÚ ÁýÇÕ ½Ä: %s" +#: src/gen.c:1614 +#, fuzzy +msgid "Could not write ssltbl" +msgstr "%s¸¦ ¸¸µé ¼ö ¾ø½À´Ï´Ù" -#: scan.l:444 -msgid "undefined definition {%s}" -msgstr "Á¤ÀǵÇÁö ¾ÊÀº Á¤ÀÇ {%s}" +#: src/gen.c:1665 +#, fuzzy +msgid "Could not write eoltbl" +msgstr "%s¸¦ ¸¸µé ¼ö ¾ø½À´Ï´Ù" -#: main.c:397 -msgid "error writing backup file %s" -msgstr "¹é¾÷ ÆÄÀÏ %s¸¦ ¾²´Âµ¥ ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù" +#: src/gen.c:1722 +msgid "Could not write yynultrans_tbl" +msgstr "" -#: scan.l:628 -msgid "EOF encountered inside an action" -msgstr "µ¿ÀÛ µµÁß¿¡ EOF¸¦ ¸¸³µ½À´Ï´Ù" +#: src/main.c:178 +msgid "rule cannot be matched" +msgstr "¸Â´Â ±ÔÄ¢À» ãÀ» ¼ö ¾ø½À´Ï´Ù" -#: main.c:874 -msgid "could not create backing-up info file %s" -msgstr "µÇµ¹¸² Á¤º¸ ÆÄÀÏ %s¸¦ ¸¸µé ¼ö ¾ø¾ú½À´Ï´Ù" +#: src/main.c:183 +msgid "-s option given but default rule can be matched" +msgstr "-s ¿É¼ÇÀÌ ÁÖ¾îÁ³Áö¸¸ ±âº» ±ÔÄ¢ÀÌ Àû¿ëµÉ ¼ö ÀÖ½À´Ï´Ù" -#: main.c:548 -msgid " %d templates created, %d uses\n" -msgstr " %d°³ÀÇ ÅÛÇø®Æ®°¡ ¸¸µé¾îÁö°í, %d°³¸¦ ¾¹´Ï´Ù\n" +#: src/main.c:221 +msgid "Can't use -+ with -l option" +msgstr "-l¿É¼Ç¿¡´Â -+¿É¼ÇÀ» °°ÀÌ ¾µ ¼ö ¾ø½À´Ï´Ù" -#: main.c:228 -msgid "-Cf/-CF are incompatible with lex-compatibility mode" -msgstr "-Cf/-CF ´Â lexȣȯ ¸ðµå¿Í´Â °°ÀÌ ¾µ ¼ö ¾ø½À´Ï´Ù" +#: src/main.c:224 +msgid "Can't use -f or -F with -l option" +msgstr "-l¿É¼Ç¿¡ -f³ª -F¿É¼ÇÀ» ¾µ ¼ö ¾ø½À´Ï´Ù" -#: scan.l:677 -msgid "can't open %s" -msgstr "%s¸¦ ¿ ¼ö ¾ø½À´Ï´Ù" +#: src/main.c:228 +#, fuzzy +msgid "Can't use --reentrant or --bison-bridge with -l option" +msgstr "-l¿É¼Ç¿¡ -f³ª -F¿É¼ÇÀ» ¾µ ¼ö ¾ø½À´Ï´Ù" -#: main.c:489 -msgid " No backing up\n" -msgstr " µÇµ¹¸²ÀÌ ¾ø½À´Ï´Ù\n" +#: src/main.c:260 +msgid "-Cf/-CF and -Cm don't make sense together" +msgstr "-Cf/-CF´Â -Cm¿Í °°ÀÌ ¾²¸é Àǹ̰¡ ¾ø½À´Ï´Ù" -#: scan.l:555 -msgid "missing }" -msgstr "}ÀÌ ºüÁ³½À´Ï´Ù" +#: src/main.c:263 +msgid "-Cf/-CF and -I are incompatible" +msgstr "-Cf/-CF¿Í -I´Â °°ÀÌ ¾µ ¼ö ¾ø½À´Ï´Ù" -#: main.c:483 -msgid " %d/%d DFA states (%d words)\n" -msgstr " %d/%d°³ÀÇ DFA »óÅ (%d ´Ü¾î)\n" +#: src/main.c:267 +msgid "-Cf/-CF are incompatible with lex-compatibility mode" +msgstr "-Cf/-CF ´Â lexȣȯ ¸ðµå¿Í´Â °°ÀÌ ¾µ ¼ö ¾ø½À´Ï´Ù" -#: scan.l:648 -msgid "bad character: %s" -msgstr "À߸øµÈ ¹®ÀÚ: %s" +#: src/main.c:272 +msgid "-Cf and -CF are mutually exclusive" +msgstr "-Cf¿Í -CF´Â °°ÀÌ ¾µ ¼ö ¾ø½À´Ï´Ù" + +#: src/main.c:276 +msgid "Can't use -+ with -CF option" +msgstr "-CF¿É¼Ç¿¡ -+¿É¼ÇÀ» °°ÀÌ ¾µ ¼ö ¾ø½À´Ï´Ù" + +#: src/main.c:279 +#, c-format +msgid "%array incompatible with -+ option" +msgstr "%array´Â -+¿É¼Ç°ú °°ÀÌ ¾µ ¼ö ¾ø½À´Ï´Ù" -#: gen.c:925 -msgid "\n\nMeta-Equivalence Classes:\n" -msgstr "\n\n¸ÞŸ-µ¿Ä¡·ùµé:\n" +#: src/main.c:284 +#, fuzzy +msgid "Options -+ and --reentrant are mutually exclusive." +msgstr "-Cf¿Í -CF´Â °°ÀÌ ¾µ ¼ö ¾ø½À´Ï´Ù" -#: main.c:232 -msgid "-Cf/-CF and %option yylineno are incompatible" -msgstr "-Cf/-CF¿Í %option yylineno ´Â °°ÀÌ ¾µ ¼ö ¾ø½À´Ï´Ù" +#: src/main.c:287 +msgid "bison bridge not supported for the C++ scanner." +msgstr "" -#: main.c:296 +#: src/main.c:336 src/main.c:419 +#, c-format msgid "could not create %s" msgstr "%s¸¦ ¸¸µé ¼ö ¾ø½À´Ï´Ù" -#: dfa.c:585 -msgid "could not create unique end-of-buffer state" -msgstr "À¯ÀÏÇÑ ¹öÆÛÀÇ ³¡(end-of-buffer)»óŸ¦ ¸¸µé ¼ö ¾ø¾ú½À´Ï´Ù" +#: src/main.c:431 +#, fuzzy +msgid "could not write tables header" +msgstr "%s¸¦ ¸¸µé ¼ö ¾ø½À´Ï´Ù" -#: main.c:365 -msgid "error closing skeleton file %s" -msgstr "½ºÄÌ·¹Åæ ÆÄÀÏ %s¸¦ ´Ý´Âµ¥ ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù" +#: src/main.c:435 +#, c-format +msgid "can't open skeleton file %s" +msgstr "½ºÄÌ·¹Åæ ÆÄÀÏ %s¸¦ ¿ ¼ö ¾ø½À´Ï´Ù" -#: main.c:911 -msgid "-I (interactive) entails a minor performance penalty\n" -msgstr "-I (´ëÈÇü) Àº ¼Ò±Ô¸ðÀÇ ¼º´ÉÀúÇϸ¦ ÀÏÀ¸Åµ´Ï´Ù\n" +#: src/main.c:450 +msgid "Prefix cannot include '[' or ']'" +msgstr "" -#: main.c:536 -msgid " %d/%d (peak %d) nxt-chk entries created\n" -msgstr " %d/%d (ÃÖ´ë %d) nxt-chk ¿£Æ®¸®°¡ ¸¸µé¾îÁ³½À´Ï´Ù\n" +#: src/main.c:474 +msgid "allocation of macro definition failed" +msgstr "" -#: main.c:235 -msgid "-Cf and -CF are mutually exclusive" -msgstr "-Cf¿Í -CF´Â °°ÀÌ ¾µ ¼ö ¾ø½À´Ï´Ù" +#: src/main.c:521 +#, c-format +msgid "input error reading skeleton file %s" +msgstr "½ºÄÌ·¹Åæ ÆÄÀÏ %s¸¦ Àд µµÁß ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù" -#: main.c:407 -msgid "%s version %s usage statistics:\n" -msgstr "%s ¹öÀü %s »ç¿ë Åë°è:\n" +#: src/main.c:525 +#, c-format +msgid "error closing skeleton file %s" +msgstr "½ºÄÌ·¹Åæ ÆÄÀÏ %s¸¦ ´Ý´Âµ¥ ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù" -#: main.c:221 -msgid "-Cf/-CF and -Cm don't make sense together" -msgstr "-Cf/-CF´Â -Cm¿Í °°ÀÌ ¾²¸é Àǹ̰¡ ¾ø½À´Ï´Ù" +#: src/main.c:709 +#, fuzzy, c-format +msgid "error creating header file %s" +msgstr "¹é¾÷ ÆÄÀÏ %s¸¦ ¾²´Âµ¥ ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù" -#: main.c:512 -msgid " %d/%d character classes needed %d/%d words of storage, %d reused\n" -msgstr " %d/%d ¹®ÀÚ ÁýÇÕ¿¡ %d/%d°³ÀÇ ÀúÀå¿ë ¹®ÀÚ°¡ ÇÊ¿äÇß°í, %d°³´Â Àç»ç¿ëµÇ¾ú½À´Ï´Ù.\n" +#: src/main.c:717 +#, c-format +msgid "error writing output file %s" +msgstr "Ãâ·ÂÆÄÀÏ %s¸¦ ¾²´Â µ¥ ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù" -#: main.c:380 +#: src/main.c:721 +#, c-format +msgid "error closing output file %s" +msgstr "Ãâ·ÂÆÄÀÏ %s¸¦ ´Ý´Âµ¥ ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù" + +#: src/main.c:725 +#, c-format msgid "error deleting output file %s" msgstr "Ãâ·ÂÆÄÀÏ %s¸¦ Áö¿ì´Â µ¥ ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù" -#: dfa.c:356 -msgid "consistency check failed in epsclosure()" -msgstr "epsclosure()¿¡¼ ÀÏ°ü¼º °Ë»ç°¡ ½ÇÆÐÇß½À´Ï´Ù" +#: src/main.c:732 +#, c-format +msgid "No backing up.\n" +msgstr "µÇµ¹¸²ÀÌ ¾ø½À´Ï´Ù.\n" -#: main.c:481 -msgid " %d/%d NFA states\n" -msgstr " %d/%d°³ÀÇ NFA »óÅÂ\n" +#: src/main.c:736 +#, c-format +msgid "%d backing up (non-accepting) states.\n" +msgstr "%d°³ÀÇ µÇµ¹¸²(¹Þ¾ÆµéÀÌÁö ¾Ê´Â) »óÅÂ.\n" -#: main.c:509 -msgid " no character classes\n" -msgstr " ¹®ÀÚ·ù°¡ ¾ø½À´Ï´Ù\n" +#: src/main.c:740 +#, c-format +msgid "Compressed tables always back up.\n" +msgstr " ¾ÐÃàµÈ Å×À̺íÀº Ç×»ó ¹é¾÷ÇÕ´Ï´Ù.\n" -#: main.c:904 -msgid "%%option yylineno entails a large performance penalty\n" -msgstr "%%option yylineno´Â Å« ¼º´ÉÀúÇϸ¦ ÀÏÀ¸Åµ´Ï´Ù\n" +#: src/main.c:743 +#, c-format +msgid "error writing backup file %s" +msgstr "¹é¾÷ ÆÄÀÏ %s¸¦ ¾²´Âµ¥ ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù" -#: main.c:182 -msgid "Can't use -+ with -l option" -msgstr "-l¿É¼Ç¿¡´Â -+¿É¼ÇÀ» °°ÀÌ ¾µ ¼ö ¾ø½À´Ï´Ù" +#: src/main.c:747 +#, c-format +msgid "error closing backup file %s" +msgstr "¹é¾÷ ÆÄÀÏ %s¸¦ ´Ý´Âµ¥ ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù" -#: dfa.c:439 -msgid "\n\nDFA Dump:\n\n" -msgstr "\n\nDFA Ãâ·Â:\n\n" +#: src/main.c:752 +#, c-format +msgid "%s version %s usage statistics:\n" +msgstr "%s ¹öÀü %s »ç¿ë Åë°è:\n" -#: main.c:410 +#: src/main.c:755 +#, c-format msgid " scanner options: -" msgstr " ½ºÄ³³Ê ¿É¼Ç: -" -#: gen.c:823 -msgid "state # %d accepts: " -msgstr "»óŹøÈ£ %d´Â ´ÙÀ½À» ¹Þ¾ÆµéÀÔ´Ï´Ù: " +#: src/main.c:834 +#, c-format +msgid " %d/%d NFA states\n" +msgstr " %d/%d°³ÀÇ NFA »óÅÂ\n" -#: main.c:224 -msgid "-Cf/-CF and -I are incompatible" -msgstr "-Cf/-CF¿Í -I´Â °°ÀÌ ¾µ ¼ö ¾ø½À´Ï´Ù" +#: src/main.c:836 +#, c-format +msgid " %d/%d DFA states (%d words)\n" +msgstr " %d/%d°³ÀÇ DFA »óÅ (%d ´Ü¾î)\n" -#: scan.l:480 -msgid "bad <start condition>: %s" -msgstr "À߸øµÈ <½ÃÀÛ Á¶°Ç>: %s" +#: src/main.c:838 +#, c-format +msgid " %d rules\n" +msgstr " %d°³ÀÇ ±ÔÄ¢\n" -#: main.c:492 +#: src/main.c:843 +#, c-format +msgid " No backing up\n" +msgstr " µÇµ¹¸²ÀÌ ¾ø½À´Ï´Ù\n" + +#: src/main.c:847 +#, c-format msgid " %d backing-up (non-accepting) states\n" msgstr " %d°³ÀÇ µÇµ¹¸²(¹Þ¾ÆµéÀÌÁö ¾Ê´Â) »óÅÂ\n" -#: main.c:505 +#: src/main.c:852 +#, c-format +msgid " Compressed tables always back-up\n" +msgstr " ¾ÐÃàµÈ Å×À̺íÀº Ç×»ó ¹é¾÷ÇÕ´Ï´Ù\n" + +#: src/main.c:856 +#, c-format +msgid " Beginning-of-line patterns used\n" +msgstr " Çà ½ÃÀÛ(beginning-of-line) À¯ÇüÀ» »ç¿ëÇÏ¿´½À´Ï´Ù\n" + +#: src/main.c:858 +#, c-format +msgid " %d/%d start conditions\n" +msgstr " %d/%d°³ÀÇ ½ÃÀÛÁ¶°Ç\n" + +#: src/main.c:862 +#, c-format msgid " %d epsilon states, %d double epsilon states\n" msgstr " %d°³ÀÇ ¿¦½Ç·Ð »óÅÂ, %d°³ÀÇ ÀÌÁß ¿¦½Ç·Ð »óÅÂ\n" -#: main.c:239 -msgid "Can't use -+ with -CF option" -msgstr "-CF¿É¼Ç¿¡ -+¿É¼ÇÀ» °°ÀÌ ¾µ ¼ö ¾ø½À´Ï´Ù" +#: src/main.c:866 +#, c-format +msgid " no character classes\n" +msgstr " ¹®ÀÚ·ù°¡ ¾ø½À´Ï´Ù\n" -#: main.c:153 -msgid "rule cannot be matched" -msgstr "¸Â´Â ±ÔÄ¢À» ãÀ» ¼ö ¾ø½À´Ï´Ù" +#: 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:796 -msgid "%s version %s\n" -msgstr "%s ¹öÀü %s\n" +#: src/main.c:875 +#, c-format +msgid " %d state/nextstate pairs created\n" +msgstr " %d°³ÀÇ »óÅÂ/´ÙÀ½ »óÅ ½ÖÀÌ ¸¸µé¾îÁ³½À´Ï´Ù\n" -#: main.c:525 +#: src/main.c:878 +#, c-format +msgid " %d/%d unique/duplicate transitions\n" +msgstr " %d/%d°³ÀÇ À¯ÀÏÇÑ/Áߺ¹µÇ´Â ÀüÀÌ\n" + +#: src/main.c:883 +#, c-format msgid " %d table entries\n" msgstr " %d°³ÀÇ Å×ÀÌºí ¿£Æ®¸®\n" -#: main.c:702 -msgid "unknown -C option '%c'" -msgstr "¾Ë ¼ö ¾ø´Â -C ¿É¼Ç '%c'" - -#: scan.l:412 scan.l:512 -msgid "bad character class" -msgstr "À߸øµÈ ¹®ÀÚ·ù" +#: src/main.c:891 +#, c-format +msgid " %d/%d base-def entries created\n" +msgstr " %d/%d base-def ¿£Æ®¸®°¡ ¸¸µé¾îÁ³½À´Ï´Ù\n" -#: main.c:185 -msgid "Can't use -f or -F with -l option" -msgstr "-l¿É¼Ç¿¡ -f³ª -F¿É¼ÇÀ» ¾µ ¼ö ¾ø½À´Ï´Ù" +#: 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:571 -msgid " %d sets of reallocations needed\n" -msgstr " %d°³ÀÇ ÀçÇÒ´ç ÁýÇÕÀÌ ÇÊ¿äÇÕ´Ï´Ù\n" +#: 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:387 -msgid "No backing up.\n" -msgstr "µÇµ¹¸²ÀÌ ¾ø½À´Ï´Ù.\n" +#: src/main.c:903 +#, c-format +msgid " %d empty table entries\n" +msgstr " %d°³ÀÇ ºó Å×ÀÌºí ¿£Æ®¸®\n" -#: main.c:243 -msgid "%array incompatible with -+ option" -msgstr "%array´Â -+¿É¼Ç°ú °°ÀÌ ¾µ ¼ö ¾ø½À´Ï´Ù" +#: src/main.c:905 +#, c-format +msgid " %d protos created\n" +msgstr " %d°³ÀÇ ¿øÇüÀÌ ¸¸µé¾îÁ³½À´Ï´Ù\n" -#: main.c:485 -msgid " %d rules\n" -msgstr " %d°³ÀÇ ±ÔÄ¢\n" +#: src/main.c:908 +#, c-format +msgid " %d templates created, %d uses\n" +msgstr " %d°³ÀÇ ÅÛÇø®Æ®°¡ ¸¸µé¾îÁö°í, %d°³¸¦ ¾¹´Ï´Ù\n" -#: main.c:517 -msgid " %d state/nextstate pairs created\n" -msgstr " %d°³ÀÇ »óÅÂ/´ÙÀ½ »óÅ ½ÖÀÌ ¸¸µé¾îÁ³½À´Ï´Ù\n" +#: src/main.c:916 +#, c-format +msgid " %d/%d equivalence classes created\n" +msgstr " %d/%d°³ÀÇ µ¿Ä¡·ù°¡ ¸¸µé¾îÁ³½À´Ï´Ù\n" -#: scan.l:549 -msgid "bad character inside {}'s" -msgstr "{}¾ÈÀÇ À߸øµÈ ¹®ÀÚ" +#: src/main.c:924 +#, c-format +msgid " %d/%d meta-equivalence classes created\n" +msgstr " %d/%d ¸ÞŸ µ¿Ä¡·ù°¡ ¸¸µé¾îÁ³½À´Ï´Ù\n" -#: dfa.c:63 -msgid "State #%d is non-accepting -\n" -msgstr "»óŹøÈ£ %d´Â ¹Þ¾ÆµéÀÌÁö ¾Ê´Â -ÀÔ´Ï´Ù\n" +#: src/main.c:930 +#, c-format +msgid " %d (%d saved) hash collisions, %d DFAs equal\n" +msgstr " %d(%d ÀúÀåµÊ)°³ÀÇ ÇØ½Ì Ãæµ¹·Î %d°³ÀÇ DFA°¡ °°°Ô 󸮵˴ϴÙ\n" -#: dfa.c:219 -msgid "\n jam-transitions: EOF " -msgstr "\n Àë-ÀüÀÌ: EOF " +#: src/main.c:932 +#, c-format +msgid " %d sets of reallocations needed\n" +msgstr " %d°³ÀÇ ÀçÇÒ´ç ÁýÇÕÀÌ ÇÊ¿äÇÕ´Ï´Ù\n" -#: main.c:500 -msgid " Beginning-of-line patterns used\n" -msgstr " Çà ½ÃÀÛ(beginning-of-line) À¯ÇüÀ» »ç¿ëÇÏ¿´½À´Ï´Ù\n" +#: src/main.c:934 +#, c-format +msgid " %d total table entries needed\n" +msgstr " ÃÑ %d°³ÀÇ Å×ÀÌºí ¿£Æ®¸®°¡ ÇÊ¿äÇÕ´Ï´Ù\n" -#: main.c:564 -msgid " %d/%d meta-equivalence classes created\n" -msgstr " %d/%d ¸ÞŸ µ¿Ä¡·ù°¡ ¸¸µé¾îÁ³½À´Ï´Ù\n" +#: src/main.c:1008 +#, c-format +msgid "Internal error. flexopts are malformed.\n" +msgstr "" -#: main.c:372 -msgid "error writing output file %s" -msgstr "Ãâ·ÂÆÄÀÏ %s¸¦ ¾²´Â µ¥ ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù" +#: src/main.c:1018 +#, c-format +msgid "Try `%s --help' for more information.\n" +msgstr "" -#: gen.c:248 -msgid "\n\nEquivalence Classes:\n\n" -msgstr "\n\nµ¿Ä¡·ù:\n\n" +#: src/main.c:1075 +#, c-format +msgid "unknown -C option '%c'" +msgstr "¾Ë ¼ö ¾ø´Â -C ¿É¼Ç '%c'" -#: main.c:376 -msgid "error closing output file %s" -msgstr "Ãâ·ÂÆÄÀÏ %s¸¦ ´Ý´Âµ¥ ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù" +#: src/main.c:1204 +#, fuzzy, c-format +msgid "%s %s\n" +msgstr "%s ¹öÀü %s\n" -#: main.c:862 +#: src/main.c:1476 msgid "fatal parse error" msgstr "Ä¡¸íÀûÀÎ ÆÄ½Ì ¿¡·¯" -#: main.c:502 -msgid " %d/%d start conditions\n" -msgstr " %d/%d°³ÀÇ ½ÃÀÛÁ¶°Ç\n" +#: src/main.c:1508 +#, c-format +msgid "could not create backing-up info file %s" +msgstr "µÇµ¹¸² Á¤º¸ ÆÄÀÏ %s¸¦ ¸¸µé ¼ö ¾ø¾ú½À´Ï´Ù" -#: main.c:569 -msgid " %d (%d saved) hash collisions, %d DFAs equal\n" -msgstr " %d(%d ÀúÀåµÊ)°³ÀÇ ÇØ½Ì Ãæµ¹·Î %d°³ÀÇ DFA°¡ °°°Ô 󸮵˴ϴÙ\n" +#: 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" -#: scan.l:203 -msgid "incomplete name definition" -msgstr "ºÒ¿ÏÀüÇÑ À̸§ Á¤ÀÇ" +#: src/main.c:1532 +#, c-format +msgid " and may be the actual source of other reported performance penalties\n" +msgstr " ±×¸®°í ¾Æ¸¶µµ ´Ù¸¥ º¸°íµÈ ¼º´É ÀúÇÏÀÇ ½ÇÁ¦ ¿øÀÎÀÏ °ÍÀÔ´Ï´Ù\n" + +#: src/main.c:1538 +#, fuzzy, c-format +msgid "" +"%%option yylineno entails a performance penalty ONLY on rules that can match " +"newline characters\n" +msgstr "%%option yylineno´Â Å« ¼º´ÉÀúÇϸ¦ ÀÏÀ¸Åµ´Ï´Ù\n" -#: main.c:915 +#: src/main.c:1545 +#, c-format +msgid "-I (interactive) entails a minor performance penalty\n" +msgstr "-I (´ëÈÇü) Àº ¼Ò±Ô¸ðÀÇ ¼º´ÉÀúÇϸ¦ ÀÏÀ¸Åµ´Ï´Ù\n" + +#: src/main.c:1550 +#, c-format msgid "yymore() entails a minor performance penalty\n" msgstr "yymore()´Â ¼Ò±Ô¸ðÀÇ ¼º´ÉÀúÇϸ¦ ÀÏÀ¸Åµ´Ï´Ù\n" -#: main.c:920 +#: src/main.c:1556 +#, c-format msgid "REJECT entails a large performance penalty\n" msgstr "REJECT´Â Å« ¼º´ÉÀúÇϸ¦ ÀÏÀ¸Åµ´Ï´Ù\n" -#: main.c:924 +#: src/main.c:1561 +#, c-format msgid "Variable trailing context rules entail a large performance penalty\n" msgstr "°¡º¯ ÃßÀû ¹®¸Æ ±ÔÄ¢Àº Å« ¼º´ÉÀúÇϸ¦ ÀÏÀ¸Åµ´Ï´Ù\n" -#: main.c:937 +#: src/main.c:1573 msgid "REJECT cannot be used with -f or -F" msgstr "REJECT´Â -f³ª -F¿É¼Ç°ú °°ÀÌ ¾µ ¼ö ¾ø½À´Ï´Ù" -#: main.c:940 -msgid "%option yylineno cannot be used with -f or -F" +#: src/main.c:1576 +#, fuzzy, c-format +msgid "%option yylineno cannot be used with REJECT" msgstr "%option yylinenoÀº -f³ª -F¿É¼Ç°ú °°ÀÌ ¾µ ¼ö ¾ø½À´Ï´Ù" -#: main.c:943 +#: src/main.c:1579 msgid "variable trailing context rules cannot be used with -f or -F" msgstr "°¡º¯ ÃßÀû ¹®¸Æ ±ÔÄ¢Àº -f³ª -F¿É¼Ç°ú °°ÀÌ ¾µ ¼ö ¾ø½À´Ï´Ù" -#: main.c:1038 +#: src/main.c:1704 +#, c-format msgid "%option yyclass only meaningful for C++ scanners" msgstr "%option yyclass´Â C++½ºÄ³³Ê¿¡°Ô¸¸ Àǹ̰¡ ÀÖ½À´Ï´Ù" -#: main.c:1117 -msgid "%s [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -ooutput -Pprefix -Sskeleton]\n" -msgstr "%s [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -oÃâ·ÂÆÄÀÏ -PÁ¢µÎ»ç -S½ºÄÌ·¹Åæ]\n" +#: src/main.c:1791 +#, c-format +msgid "Usage: %s [OPTIONS] [FILE]...\n" +msgstr "" -#: main.c:1119 -msgid "\t[--help --version] [file ...]\n" -msgstr "\t[--help --version] [ÆÄÀÏ ...]\n" +#: src/main.c:1794 +#, 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 "" -#: main.c:1121 -msgid "\t-b generate backing-up information to %s\n" -msgstr "\t-b %s¿¡ µÇµ¹¸² Á¤º¸¸¦ ¸¸µì´Ï´Ù.\n" +#: src/misc.c:64 +msgid "allocation of sko_stack failed" +msgstr "" -#: main.c:1123 -msgid "\t-c do-nothing POSIX option\n" -msgstr "\t-c ¾Æ¹« Àϵµ ÇÏÁö ¾Ê´Â POSIX¿É¼Ç\n" +#: src/misc.c:100 +#, c-format +msgid "name \"%s\" ridiculously long" +msgstr "À̸§ \"%s\"´Â ºñÁ¤»óÀûÀ¸·Î ±é´Ï´Ù" -#: main.c:1124 -msgid "\t-d turn on debug mode in generated scanner\n" -msgstr "\t-d ¸¸µé¾îÁø ½ºÄ³³Ê¿¡¼ µð¹ö±× ¸ðµå·Î ¹Ù²ß´Ï´Ù\n" +#: src/misc.c:155 +msgid "memory allocation failed in allocate_array()" +msgstr "allocate_array()¿¡¼ ¸Þ¸ð¸® ÇÒ´çÀÌ ½ÇÆÐÇß½À´Ï´Ù" -#: main.c:1125 -msgid "\t-f generate fast, large scanner\n" -msgstr "\t-f ºü¸£Áö¸¸ Å« ½ºÄ³³Ê¸¦ ¸¸µì´Ï´Ù\n" +#: src/misc.c:205 +#, c-format +msgid "bad character '%s' detected in check_char()" +msgstr "check_char()¿¡¼ À߸øµÈ ¹®ÀÚ '%s'¸¦ ã¾Ò½À´Ï´Ù" -#: main.c:1126 -msgid "\t-h produce this help message\n" -msgstr "\t-h ÀÌ µµ¿ò¸» ¸Þ½ÃÁö¸¦ Ãâ·ÂÇÕ´Ï´Ù\n" +#: src/misc.c:210 +#, c-format +msgid "scanner requires -8 flag to use the character %s" +msgstr "½ºÄ³³Ê¿¡¼ ¹®ÀÚ %s¸¦ ¾²±â À§Çؼ´Â -8¿É¼ÇÀÌ ÇÊ¿äÇÕ´Ï´Ù" -#: main.c:1127 -msgid "\t-i generate case-insensitive scanner\n" -msgstr "\t-i ´ë¼Ò¹®ÀÚ ±¸º°¾ø´Â ½ºÄ³³Ê¸¦ ¸¸µì´Ï´Ù\n" +#: src/misc.c:229 +#, fuzzy +msgid "memory allocation failure in xstrdup()" +msgstr "allocate_array()¿¡¼ ¸Þ¸ð¸® ÇÒ´çÀÌ ½ÇÆÐÇß½À´Ï´Ù" -#: main.c:1128 -msgid "\t-l maximal compatibility with original lex\n" -msgstr "\t-l ¿À¸®Áö³Î lex¿Í ÃÖ´ëÇÑÀÇ È£È¯¼ºÀ» Á¦°øÇÕ´Ï´Ù\n" +#: src/misc.c:303 +#, c-format +msgid "%s: fatal internal error, %s\n" +msgstr "%s: Ä¡¸íÀûÀÎ ³»ºÎ ¿¡·¯, %s\n" -#: main.c:1129 -msgid "\t-n do-nothing POSIX option\n" -msgstr "\t-n ¾Æ¹« Àϵµ ÇÏÁö ¾Ê´Â POSIX¿É¼Ç\n" +#: src/misc.c:671 +msgid "attempt to increase array size failed" +msgstr "¹è¿ Å©±â¸¦ ´Ã¸®·Á´Â ½Ãµµ°¡ ½ÇÆÐÇß½À´Ï´Ù" -#: main.c:1130 -msgid "\t-p generate performance report to stderr\n" -msgstr "\t-p ¼º´É º¸°í¸¦ Ç¥ÁØ ¿¡·¯·Î Ãâ·ÂÇÕ´Ï´Ù\n" +#: src/misc.c:795 +msgid "bad line in skeleton file" +msgstr "½ºÄÌ·¹Åæ ÆÄÀÏ¿¡ À߸øµÈ Çà" -#: main.c:1132 -msgid "\t-s suppress default rule to ECHO unmatched text\n" -msgstr "\t-s ±âº» ±ÔÄ¢À» 'ECHO ãÁö¸øÇÑ ±Û'·Î Á¦ÇÑÇÕ´Ï´Ù\n" +#: src/misc.c:845 +msgid "memory allocation failed in yy_flex_xmalloc()" +msgstr "yy_flex_xmalloc()¿¡¼ ¸Þ¸ð¸® ÇÒ´çÀÌ ½ÇÆÐÇß½À´Ï´Ù" -#: main.c:1142 -msgid "\t-t write generated scanner on stdout instead of %s\n" -msgstr "\t-t %s ´ë½Å ¸¸µé¾îÁø ½ºÄ³³Ê¸¦ Ç¥ÁØ Ãâ·ÂÀ¸·Î ¾¹´Ï´Ù\n" +#: src/nfa.c:100 +#, c-format +msgid "" +"\n" +"\n" +"********** beginning dump of nfa with start state %d\n" +msgstr "" +"\n" +"\n" +"********** ½ÃÀÛ »óÅ %d¿¡¼ nfaÃâ·Â ½ÃÀÛ\n" -#: main.c:1146 -msgid "\t-v write summary of scanner statistics to f\n" -msgstr "\t-v ½ºÄ³³Ê Åë°è ¿ä¾àÀ» f¿¡ ¾¹´Ï´Ù\n" +#: src/nfa.c:111 +#, c-format +msgid "state # %4d\t" +msgstr "»óÅ ¹øÈ£ %4d\t" -#: main.c:1147 -msgid "\t-w do not generate warnings\n" -msgstr "\t-w °æ°í¸¦ ³»Áö ¾Ê½À´Ï´Ù\n" +#: src/nfa.c:126 +#, c-format +msgid "********** end of dump\n" +msgstr "********** Ãâ·Â ³¡\n" -#: main.c:1148 -msgid "\t-B generate batch scanner (opposite of -I)\n" -msgstr "\t-B ÀÏ°ýó¸® ½ºÄ³³Ê¸¦ ¸¸µì´Ï´Ù(-I¿Í ¹Ý´ë)\n" +#: src/nfa.c:169 +msgid "empty machine in dupmachine()" +msgstr "dupmachine()¿¡¼ÀÇ ºó ¸Ó½Å" -#: main.c:1150 -msgid "\t-F use alternative fast scanner representation\n" -msgstr "\t-F ´Ù¸¥ ¹æ¹ýÀÇ ºü¸¥ ½ºÄ³³Ê Ç¥Çö¹ýÀ» »ç¿ëÇÕ´Ï´Ù\n" +#: src/nfa.c:234 +#, c-format +msgid "Variable trailing context rule at line %d\n" +msgstr "%dÇà¿¡¼ °¡º¯ ÃßÀû ¹®¸Æ ±ÔÄ¢\n" -#: main.c:1152 -msgid "\t-I generate interactive scanner (opposite of -B)\n" -msgstr "\t-I ´ëÈÇü ½ºÄ³³Ê¸¦ ¸¸µì´Ï´Ù(-B¿Í ¹Ý´ë)\n" +#: src/nfa.c:357 +msgid "bad state type in mark_beginning_as_normal()" +msgstr "mark_beginning_as_normal()¿¡¼ À߸øµÈ »óÅÂÇü" -#: main.c:1153 -msgid "\t-L suppress #line directives in scanner\n" -msgstr "\t-L ½ºÄ³³Ê¿¡¼ #lineÁö½ÃÀÚ¸¦ ³»Áö ¾Êµµ·Ï ÇÕ´Ï´Ù\n" +#: src/nfa.c:595 +#, c-format +msgid "input rules are too complicated (>= %d NFA states)" +msgstr "ÀÔ·Â ±ÔÄ¢ÀÌ ³Ê¹« º¹ÀâÇÕ´Ï´Ù(>= NFA»óÅ %d°³)" -#: main.c:1154 -msgid "\t-T %s should run in trace mode\n" -msgstr "\t-T %s´Â ÃßÀû ¸ðµå¿¡¼ ½ÇÇàµÇµµ·Ï ÇÕ´Ï´Ù\n" +#: src/nfa.c:673 +msgid "found too many transitions in mkxtion()" +msgstr "mkxtion()¿¡ ÀüÀÌ°¡ ³Ê¹« ¸¹½À´Ï´Ù" -#: main.c:1155 -msgid "\t-V report %s version\n" -msgstr "\t-V %sÀÇ ¹öÀüÀ» Ãâ·ÂÇÕ´Ï´Ù\n" +#: src/nfa.c:699 +#, c-format +msgid "too many rules (> %d)!" +msgstr "±ÔÄ¢ÀÌ ³Ê¹« ¸¹½À´Ï´Ù (> %d)!" + +#: src/parse.y:159 +msgid "unknown error processing section 1" +msgstr "" + +#: src/parse.y:184 src/parse.y:353 +#, fuzzy +msgid "bad start condition list" +msgstr "À߸øµÈ <½ÃÀÛ Á¶°Ç>: %s" + +#: src/parse.y:204 +msgid "Prefix must not contain [ or ]" +msgstr "" -#: main.c:1156 -msgid "\t-7 generate 7-bit scanner\n" -msgstr "\t-7 7ºñÆ® ½ºÄ³³Ê¸¦ ¸¸µì´Ï´Ù\n" +#: src/parse.y:317 +#, fuzzy +msgid "unrecognized rule" +msgstr "¾Ë ¼ö ¾ø´Â '%' Áö½ÃÀÚ" -#: main.c:1157 -msgid "\t-8 generate 8-bit scanner\n" -msgstr "\t-8 8ºñÆ® ½ºÄ³³Ê¸¦ ¸¸µì´Ï´Ù\n" +#: src/parse.y:436 src/parse.y:449 src/parse.y:518 +#, fuzzy +msgid "trailing context used twice" +msgstr "%dÇà¿¡¼ °¡º¯ ÃßÀû ¹®¸Æ ±ÔÄ¢\n" -#: main.c:1158 -msgid "\t-+ generate C++ scanner class\n" -msgstr "\t-+ C++ ½ºÄ³³Ê Ŭ·¡½º¸¦ ¸¸µì´Ï´Ù\n" +#: src/parse.y:554 src/parse.y:564 src/parse.y:637 src/parse.y:647 +msgid "bad iteration values" +msgstr "" -#: main.c:1159 -msgid "\t-? produce this help message\n" -msgstr "\t-? ÀÌ µµ¿ò¸»À» Ãâ·ÂÇÕ´Ï´Ù\n" +#: src/parse.y:582 src/parse.y:600 src/parse.y:665 src/parse.y:683 +msgid "iteration value must be positive" +msgstr "" + +#: src/parse.y:806 src/parse.y:816 +#, c-format +msgid "the character range [%c-%c] is ambiguous in a case-insensitive scanner" +msgstr "" -#: main.c:1161 -msgid "\t-C specify degree of table compression (default is -Cem):\n" -msgstr "\t-C Å×ÀÌºí ¾ÐÃàÁ¤µµ¸¦ ÁöÁ¤ÇÕ´Ï´Ù(±âº»°ªÀº -Cem):\n" +#: src/parse.y:821 +#, fuzzy +msgid "negative range in character class" +msgstr " ¹®ÀÚ·ù°¡ ¾ø½À´Ï´Ù\n" -#: main.c:1163 -msgid "\t\t-Ca trade off larger tables for better memory alignment\n" -msgstr "\t\t-Ca ´õ ÁÁÀº ¸Þ¸ð¸® Á¤·ÄÀ» À§ÇØ Å« Å×À̺íÀ» ¸¸µì´Ï´Ù\n" +#: src/parse.y:918 +#, fuzzy +msgid "[:^lower:] is ambiguous in case insensitive scanner" +msgstr "\t-i ´ë¼Ò¹®ÀÚ ±¸º°¾ø´Â ½ºÄ³³Ê¸¦ ¸¸µì´Ï´Ù\n" -#: main.c:1164 -msgid "\t\t-Ce construct equivalence classes\n" -msgstr "\t\t-Ce µ¿Ä¡·ù¸¦ ¸¸µì´Ï´Ù\n" +#: src/parse.y:924 +#, fuzzy +msgid "[:^upper:] ambiguous in case insensitive scanner" +msgstr "\t-i ´ë¼Ò¹®ÀÚ ±¸º°¾ø´Â ½ºÄ³³Ê¸¦ ¸¸µì´Ï´Ù\n" -#: main.c:1166 -msgid "\t\t-Cf do not compress scanner tables; use -f representation\n" -msgstr "\t\t-Cf ½ºÄ³³Ê Å×À̺íÀ» ¾ÐÃàÇÏÁö ¾Ê½À´Ï´Ù. -fÇ¥Çö¹ýÀ» »ç¿ëÇÕ´Ï´Ù\n" +#: src/scan.l:82 src/scan.l:644 src/scan.l:702 +msgid "Input line too long\n" +msgstr "" -#: main.c:1168 -msgid "\t\t-CF do not compress scanner tables; use -F representation\n" -msgstr "\t\t-CF ½ºÄ³³Ê Å×À̺íÀ» ¾ÐÃàÇÏÁö ¾Ê½À´Ï´Ù. -FÇ¥Çö¹ýÀ» »ç¿ëÇÕ´Ï´Ù\n" +#: src/scan.l:183 +#, fuzzy, c-format +msgid "malformed '%top' directive" +msgstr "¾Ë ¼ö ¾ø´Â '%' Áö½ÃÀÚ" -#: main.c:1169 -msgid "\t\t-Cm construct meta-equivalence classes\n" -msgstr "\t\t-Cm ¸ÞŸ µ¿Ä¡·ù¸¦ ¸¸µì´Ï´Ù\n" +#: src/scan.l:205 +#, no-c-format +msgid "unrecognized '%' directive" +msgstr "¾Ë ¼ö ¾ø´Â '%' Áö½ÃÀÚ" -#: main.c:1171 -msgid "\t\t-Cr use read() instead of stdio for scanner input\n" -msgstr "\t\t-Cr ½ºÄ³³Ê ÀÔ·ÂÀ» stdio¶óÀ̺귯¸® ´ë½Å read()½Ã½ºÅÛ ÄÝÀ» »ç¿ëÇÕ´Ï´Ù\n" +#: src/scan.l:214 +msgid "Definition name too long\n" +msgstr "" -#: main.c:1172 -msgid "\t-o specify output filename\n" -msgstr "\t-o Ãâ·Â ÆÄÀÏÀ̸§À» ÁöÁ¤ÇÕ´Ï´Ù\n" +#: src/scan.l:309 +msgid "Unmatched '{'" +msgstr "" -#: main.c:1173 -msgid "\t-P specify scanner prefix other than \"yy\"\n" -msgstr "\t-P \"yy\"´ë½Å¿¡ ´Ù¸¥ ½ºÄ³³Ê Á¢µÎ»ç¸¦ ÁöÁ¤ÇÕ´Ï´Ù\n" +#: src/scan.l:325 +#, c-format +msgid "Definition value for {%s} too long\n" +msgstr "" -#: main.c:1174 -msgid "\t-S specify skeleton file\n" -msgstr "\t-S ½ºÄÌ·¹Åæ ÆÄÀÏÀ» ÁöÁ¤ÇÕ´Ï´Ù\n" +#: src/scan.l:342 +msgid "incomplete name definition" +msgstr "ºÒ¿ÏÀüÇÑ À̸§ Á¤ÀÇ" -#: main.c:1175 -msgid "\t--help produce this help message\n" -msgstr "\t--help ÀÌ µµ¿ò¸»À» Ãâ·ÂÇÕ´Ï´Ù\n" +#: src/scan.l:467 +msgid "Option line too long\n" +msgstr "" -#: main.c:1176 -msgid "\t--version report %s version\n" -msgstr "\t--version %sÀÇ ¹öÀüÀ» Ãâ·ÂÇÕ´Ï´Ù\n" +#: src/scan.l:475 +#, c-format +msgid "unrecognized %%option: %s" +msgstr "¾Ë ¼ö ¾ø´Â %%option: %s" -#: misc.c:42 -msgid "name \"%s\" ridiculously long" -msgstr "À̸§ \"%s\"´Â ºñÁ¤»óÀûÀ¸·Î ±é´Ï´Ù" +#: src/scan.l:659 src/scan.l:832 +msgid "bad character class" +msgstr "À߸øµÈ ¹®ÀÚ·ù" -#: misc.c:91 -msgid "memory allocation failed in allocate_array()" -msgstr "allocate_array()¿¡¼ ¸Þ¸ð¸® ÇÒ´çÀÌ ½ÇÆÐÇß½À´Ï´Ù" +#: src/scan.l:709 +#, c-format +msgid "undefined definition {%s}" +msgstr "Á¤ÀǵÇÁö ¾ÊÀº Á¤ÀÇ {%s}" -#: misc.c:169 -msgid "bad character '%s' detected in check_char()" -msgstr "check_char()¿¡¼ À߸øµÈ ¹®ÀÚ '%s'¸¦ ã¾Ò½À´Ï´Ù" +#: src/scan.l:772 +msgid "unbalanced parenthesis" +msgstr "" -#: misc.c:174 -msgid "scanner requires -8 flag to use the character %s" -msgstr "½ºÄ³³Ê¿¡¼ ¹®ÀÚ %s¸¦ ¾²±â À§Çؼ´Â -8¿É¼ÇÀÌ ÇÊ¿äÇÕ´Ï´Ù" +#: src/scan.l:787 +#, c-format +msgid "bad <start condition>: %s" +msgstr "À߸øµÈ <½ÃÀÛ Á¶°Ç>: %s" -#: misc.c:207 -msgid "dynamic memory failure in copy_string()" -msgstr "copy_string()¿¡¼ µ¿Àû ¸Þ¸ð¸® ÇÒ´çÀÌ ½ÇÆÐÇß½À´Ï´Ù" +#: src/scan.l:800 +msgid "missing quote" +msgstr "Àοë±âÈ£ ºüÁü" -#: misc.c:339 -msgid "%s: fatal internal error, %s\n" -msgstr "%s: Ä¡¸íÀûÀÎ ³»ºÎ ¿¡·¯, %s\n" +#: src/scan.l:866 +#, c-format +msgid "bad character class expression: %s" +msgstr "À߸øµÈ ¹®ÀÚ ÁýÇÕ ½Ä: %s" -#: misc.c:765 -msgid "attempt to increase array size failed" -msgstr "¹è¿ Å©±â¸¦ ´Ã¸®·Á´Â ½Ãµµ°¡ ½ÇÆÐÇß½À´Ï´Ù" +#: src/scan.l:888 +msgid "bad character inside {}'s" +msgstr "{}¾ÈÀÇ À߸øµÈ ¹®ÀÚ" -#: misc.c:811 -msgid "bad line in skeleton file" -msgstr "½ºÄÌ·¹Åæ ÆÄÀÏ¿¡ À߸øµÈ Çà" +#: src/scan.l:894 +msgid "missing }" +msgstr "}ÀÌ ºüÁ³½À´Ï´Ù" -#: misc.c:864 -msgid "memory allocation failed in yy_flex_xmalloc()" -msgstr "yy_flex_xmalloc()¿¡¼ ¸Þ¸ð¸® ÇÒ´çÀÌ ½ÇÆÐÇß½À´Ï´Ù" +#: src/scan.l:972 +msgid "EOF encountered inside an action" +msgstr "µ¿ÀÛ µµÁß¿¡ EOF¸¦ ¸¸³µ½À´Ï´Ù" -#: nfa.c:100 -msgid "\n\n********** beginning dump of nfa with start state %d\n" -msgstr "\n\n********** ½ÃÀÛ »óÅ %d¿¡¼ nfaÃâ·Â ½ÃÀÛ\n" +#: src/scan.l:977 +#, fuzzy +msgid "EOF encountered inside pattern" +msgstr "µ¿ÀÛ µµÁß¿¡ EOF¸¦ ¸¸³µ½À´Ï´Ù" -#: nfa.c:112 -msgid "state # %4d\t" -msgstr "»óÅ ¹øÈ£ %4d\t" +#: src/scan.l:1010 +#, c-format +msgid "bad character: %s" +msgstr "À߸øµÈ ¹®ÀÚ: %s" -#: nfa.c:127 -msgid "********** end of dump\n" -msgstr "********** Ãâ·Â ³¡\n" +#: src/scan.l:1038 +#, c-format +msgid "can't open %s" +msgstr "%s¸¦ ¿ ¼ö ¾ø½À´Ï´Ù" -#: nfa.c:173 -msgid "empty machine in dupmachine()" -msgstr "dupmachine()¿¡¼ÀÇ ºó ¸Ó½Å" +#: src/scanopt.c:259 +#, c-format +msgid "Usage: %s [OPTIONS]...\n" +msgstr "" -#: nfa.c:225 -msgid "Variable trailing context rule at line %d\n" -msgstr "%dÇà¿¡¼ °¡º¯ ÃßÀû ¹®¸Æ ±ÔÄ¢\n" +#: src/scanopt.c:524 +#, c-format +msgid "option `%s' doesn't allow an argument\n" +msgstr "" -#: nfa.c:347 -msgid "bad state type in mark_beginning_as_normal()" -msgstr "mark_beginning_as_normal()¿¡¼ À߸øµÈ »óÅÂÇü" +#: src/scanopt.c:529 +#, c-format +msgid "option `%s' requires an argument\n" +msgstr "" -#: nfa.c:600 -msgid "input rules are too complicated (>= %d NFA states)" -msgstr "ÀÔ·Â ±ÔÄ¢ÀÌ ³Ê¹« º¹ÀâÇÕ´Ï´Ù(>= NFA»óÅ %d°³)" +#: src/scanopt.c:533 +#, c-format +msgid "option `%s' is ambiguous\n" +msgstr "" -#: nfa.c:679 -msgid "found too many transitions in mkxtion()" -msgstr "mkxtion()¿¡ ÀüÀÌ°¡ ³Ê¹« ¸¹½À´Ï´Ù" +#: src/scanopt.c:537 +#, fuzzy, c-format +msgid "Unrecognized option `%s'\n" +msgstr "¾Ë ¼ö ¾ø´Â %%option: %s" -#: nfa.c:705 -msgid "too many rules (> %d)!" -msgstr "±ÔÄ¢ÀÌ ³Ê¹« ¸¹½À´Ï´Ù (> %d)!" +#: src/scanopt.c:541 +#, c-format +msgid "Unknown error=(%d)\n" +msgstr "" -#: sym.c:78 +#: src/sym.c:92 msgid "symbol table memory allocation failed" msgstr "½Éº¼ Å×ÀÌºí ¸Þ¸ð¸® ÇÒ´çÀÌ ½ÇÆÐÇß½À´Ï´Ù" -#: sym.c:188 +#: src/sym.c:183 msgid "name defined twice" msgstr "À̸§À» µÎ¹ø Á¤ÀÇÇß½À´Ï´Ù" -#: sym.c:243 +#: src/sym.c:231 +#, c-format msgid "start condition %s declared twice" msgstr "½ÃÀÛÁ¶°Ç %s¸¦ µÎ¹ø ¼±¾ðÇß½À´Ï´Ù" -#: yylex.c:55 +#: src/yylex.c:57 msgid "premature EOF" msgstr "°©ÀÛ½º·± EOF" -#: yylex.c:204 +#: src/yylex.c:200 +#, c-format msgid "End Marker\n" msgstr "Á¾·á Ç¥½Ã\n" -#: yylex.c:209 +#: src/yylex.c:206 +#, c-format msgid "*Something Weird* - tok: %d val: %d\n" msgstr "*¹«¾ð°¡ ÀÌ»óÇÕ´Ï´Ù* - tok: %d val: %d\n" +#~ msgid "" +#~ "%s: unknown flag '%c'. For usage, try\n" +#~ "\t%s --help\n" +#~ msgstr "" +#~ "%s: ¾Ë ¼ö ¾ø´Â ¿É¼Ç '%c'. »ç¿ë¹ýÀ» º¸·Á¸é \n" +#~ "\t%s --help¶ó°í Çϼ¼¿ä.\n" + +#~ msgid "-P flag must be given separately" +#~ msgstr "-P Ç÷¡±×´Â µû·Î ÁÖ¾î¾ß ÇÕ´Ï´Ù" + +#~ msgid "-o flag must be given separately" +#~ msgstr "-o Ç÷¡±×´Â µû·Î ÁÖ¾î¾ß ÇÕ´Ï´Ù" + +#~ msgid "-S flag must be given separately" +#~ msgstr "-S Ç÷¡±×´Â µû·Î ÁÖ¾î¾ß ÇÕ´Ï´Ù" + +#~ msgid "-C flag must be given separately" +#~ msgstr "-C Ç÷¡±×´Â µû·Î ÁÖ¾î¾ß ÇÕ´Ï´Ù" + +#~ msgid "consistency check failed in symfollowset" +#~ msgstr "symfollowset¿¡¼ ÀÏ°ü¼º °Ë»ç°¡ ½ÇÆÐÇß½À´Ï´Ù" + +#~ msgid "-Cf/-CF and %option yylineno are incompatible" +#~ msgstr "-Cf/-CF¿Í %option yylineno ´Â °°ÀÌ ¾µ ¼ö ¾ø½À´Ï´Ù" + +#~ msgid "" +#~ "%s [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -ooutput -Pprefix -Sskeleton]\n" +#~ msgstr "" +#~ "%s [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -oÃâ·ÂÆÄÀÏ -PÁ¢µÎ»ç -S½ºÄÌ·¹Åæ]\n" + +#~ msgid "\t[--help --version] [file ...]\n" +#~ msgstr "\t[--help --version] [ÆÄÀÏ ...]\n" + +#~ msgid "\t-b generate backing-up information to %s\n" +#~ msgstr "\t-b %s¿¡ µÇµ¹¸² Á¤º¸¸¦ ¸¸µì´Ï´Ù.\n" + +#~ msgid "\t-c do-nothing POSIX option\n" +#~ msgstr "\t-c ¾Æ¹« Àϵµ ÇÏÁö ¾Ê´Â POSIX¿É¼Ç\n" + +#~ msgid "\t-d turn on debug mode in generated scanner\n" +#~ msgstr "\t-d ¸¸µé¾îÁø ½ºÄ³³Ê¿¡¼ µð¹ö±× ¸ðµå·Î ¹Ù²ß´Ï´Ù\n" + +#~ msgid "\t-f generate fast, large scanner\n" +#~ msgstr "\t-f ºü¸£Áö¸¸ Å« ½ºÄ³³Ê¸¦ ¸¸µì´Ï´Ù\n" + +#~ msgid "\t-h produce this help message\n" +#~ msgstr "\t-h ÀÌ µµ¿ò¸» ¸Þ½ÃÁö¸¦ Ãâ·ÂÇÕ´Ï´Ù\n" + +#~ msgid "\t-l maximal compatibility with original lex\n" +#~ msgstr "\t-l ¿À¸®Áö³Î lex¿Í ÃÖ´ëÇÑÀÇ È£È¯¼ºÀ» Á¦°øÇÕ´Ï´Ù\n" + +#~ msgid "\t-n do-nothing POSIX option\n" +#~ msgstr "\t-n ¾Æ¹« Àϵµ ÇÏÁö ¾Ê´Â POSIX¿É¼Ç\n" + +#~ msgid "\t-p generate performance report to stderr\n" +#~ msgstr "\t-p ¼º´É º¸°í¸¦ Ç¥ÁØ ¿¡·¯·Î Ãâ·ÂÇÕ´Ï´Ù\n" + +#~ msgid "\t-s suppress default rule to ECHO unmatched text\n" +#~ msgstr "\t-s ±âº» ±ÔÄ¢À» 'ECHO ãÁö¸øÇÑ ±Û'·Î Á¦ÇÑÇÕ´Ï´Ù\n" + +#~ msgid "\t-t write generated scanner on stdout instead of %s\n" +#~ msgstr "\t-t %s ´ë½Å ¸¸µé¾îÁø ½ºÄ³³Ê¸¦ Ç¥ÁØ Ãâ·ÂÀ¸·Î ¾¹´Ï´Ù\n" + +#~ msgid "\t-v write summary of scanner statistics to f\n" +#~ msgstr "\t-v ½ºÄ³³Ê Åë°è ¿ä¾àÀ» f¿¡ ¾¹´Ï´Ù\n" + +#~ msgid "\t-w do not generate warnings\n" +#~ msgstr "\t-w °æ°í¸¦ ³»Áö ¾Ê½À´Ï´Ù\n" + +#~ msgid "\t-B generate batch scanner (opposite of -I)\n" +#~ msgstr "\t-B ÀÏ°ýó¸® ½ºÄ³³Ê¸¦ ¸¸µì´Ï´Ù(-I¿Í ¹Ý´ë)\n" + +#~ msgid "\t-F use alternative fast scanner representation\n" +#~ msgstr "\t-F ´Ù¸¥ ¹æ¹ýÀÇ ºü¸¥ ½ºÄ³³Ê Ç¥Çö¹ýÀ» »ç¿ëÇÕ´Ï´Ù\n" + +#~ msgid "\t-I generate interactive scanner (opposite of -B)\n" +#~ msgstr "\t-I ´ëÈÇü ½ºÄ³³Ê¸¦ ¸¸µì´Ï´Ù(-B¿Í ¹Ý´ë)\n" + +#~ msgid "\t-L suppress #line directives in scanner\n" +#~ msgstr "\t-L ½ºÄ³³Ê¿¡¼ #lineÁö½ÃÀÚ¸¦ ³»Áö ¾Êµµ·Ï ÇÕ´Ï´Ù\n" + +#~ msgid "\t-T %s should run in trace mode\n" +#~ msgstr "\t-T %s´Â ÃßÀû ¸ðµå¿¡¼ ½ÇÇàµÇµµ·Ï ÇÕ´Ï´Ù\n" + +#~ msgid "\t-V report %s version\n" +#~ msgstr "\t-V %sÀÇ ¹öÀüÀ» Ãâ·ÂÇÕ´Ï´Ù\n" + +#~ msgid "\t-7 generate 7-bit scanner\n" +#~ msgstr "\t-7 7ºñÆ® ½ºÄ³³Ê¸¦ ¸¸µì´Ï´Ù\n" + +#~ msgid "\t-8 generate 8-bit scanner\n" +#~ msgstr "\t-8 8ºñÆ® ½ºÄ³³Ê¸¦ ¸¸µì´Ï´Ù\n" + +#~ msgid "\t-+ generate C++ scanner class\n" +#~ msgstr "\t-+ C++ ½ºÄ³³Ê Ŭ·¡½º¸¦ ¸¸µì´Ï´Ù\n" + +#~ msgid "\t-? produce this help message\n" +#~ msgstr "\t-? ÀÌ µµ¿ò¸»À» Ãâ·ÂÇÕ´Ï´Ù\n" + +#~ msgid "\t-C specify degree of table compression (default is -Cem):\n" +#~ msgstr "\t-C Å×ÀÌºí ¾ÐÃàÁ¤µµ¸¦ ÁöÁ¤ÇÕ´Ï´Ù(±âº»°ªÀº -Cem):\n" + +#~ msgid "\t\t-Ca trade off larger tables for better memory alignment\n" +#~ msgstr "\t\t-Ca ´õ ÁÁÀº ¸Þ¸ð¸® Á¤·ÄÀ» À§ÇØ Å« Å×À̺íÀ» ¸¸µì´Ï´Ù\n" + +#~ msgid "\t\t-Ce construct equivalence classes\n" +#~ msgstr "\t\t-Ce µ¿Ä¡·ù¸¦ ¸¸µì´Ï´Ù\n" + +#~ msgid "\t\t-Cf do not compress scanner tables; use -f representation\n" +#~ msgstr "\t\t-Cf ½ºÄ³³Ê Å×À̺íÀ» ¾ÐÃàÇÏÁö ¾Ê½À´Ï´Ù. -fÇ¥Çö¹ýÀ» »ç¿ëÇÕ´Ï´Ù\n" + +#~ msgid "\t\t-CF do not compress scanner tables; use -F representation\n" +#~ msgstr "\t\t-CF ½ºÄ³³Ê Å×À̺íÀ» ¾ÐÃàÇÏÁö ¾Ê½À´Ï´Ù. -FÇ¥Çö¹ýÀ» »ç¿ëÇÕ´Ï´Ù\n" + +#~ msgid "\t\t-Cm construct meta-equivalence classes\n" +#~ msgstr "\t\t-Cm ¸ÞŸ µ¿Ä¡·ù¸¦ ¸¸µì´Ï´Ù\n" + +#~ msgid "\t\t-Cr use read() instead of stdio for scanner input\n" +#~ msgstr "" +#~ "\t\t-Cr ½ºÄ³³Ê ÀÔ·ÂÀ» stdio¶óÀ̺귯¸® ´ë½Å read()½Ã½ºÅÛ ÄÝÀ» »ç¿ëÇÕ´Ï´Ù\n" + +#~ msgid "\t-o specify output filename\n" +#~ msgstr "\t-o Ãâ·Â ÆÄÀÏÀ̸§À» ÁöÁ¤ÇÕ´Ï´Ù\n" + +#~ msgid "\t-P specify scanner prefix other than \"yy\"\n" +#~ msgstr "\t-P \"yy\"´ë½Å¿¡ ´Ù¸¥ ½ºÄ³³Ê Á¢µÎ»ç¸¦ ÁöÁ¤ÇÕ´Ï´Ù\n" + +#~ msgid "\t-S specify skeleton file\n" +#~ msgstr "\t-S ½ºÄÌ·¹Åæ ÆÄÀÏÀ» ÁöÁ¤ÇÕ´Ï´Ù\n" + +#~ msgid "\t--help produce this help message\n" +#~ msgstr "\t--help ÀÌ µµ¿ò¸»À» Ãâ·ÂÇÕ´Ï´Ù\n" + +#~ msgid "\t--version report %s version\n" +#~ msgstr "\t--version %sÀÇ ¹öÀüÀ» Ãâ·ÂÇÕ´Ï´Ù\n" + +#~ msgid "dynamic memory failure in copy_string()" +#~ msgstr "copy_string()¿¡¼ µ¿Àû ¸Þ¸ð¸® ÇÒ´çÀÌ ½ÇÆÐÇß½À´Ï´Ù" @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: flex-2.5.38\n" "Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2014-02-11 16:15-0500\n" +"POT-Creation-Date: 2017-05-06 10:49-0400\n" "PO-Revision-Date: 2014-02-13 22:25+0100\n" "Last-Translator: Benno Schulenberg <benno@vertaalt.nl>\n" "Language-Team: Dutch <vertaling@vrijschrift.org>\n" @@ -17,45 +17,46 @@ 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" "X-Generator: Lokalize 1.0\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: buf.c:78 +#: src/buf.c:79 msgid "Allocation of buffer to print string failed" msgstr "Geheugenreservering voor stringprintbuffer is mislukt" -#: buf.c:100 +#: src/buf.c:107 msgid "Allocation of buffer for line directive failed" msgstr "Geheugenreservering voor line-commandobuffer is mislukt" -#: buf.c:177 +#: src/buf.c:177 msgid "Allocation of buffer for m4 def failed" msgstr "Geheugenreservering voor buffer voor m4 def is mislukt" -#: buf.c:197 +#: src/buf.c:198 msgid "Allocation of buffer for m4 undef failed" msgstr "Geheugenreservering voor buffer voor m4 undef is mislukt" -#: dfa.c:61 +#: src/dfa.c:59 #, c-format msgid "State #%d is non-accepting -\n" msgstr "Toestand #%d is niet-accepterend -\n" -#: dfa.c:124 +#: src/dfa.c:119 msgid "dangerous trailing context" msgstr "gevaarlijke nakomende context" -#: dfa.c:166 +#: src/dfa.c:159 #, c-format msgid " associated rule line numbers:" msgstr " regelnummers van de betrokken voorschriften:" -#: dfa.c:202 +#: src/dfa.c:193 #, c-format msgid " out-transitions: " msgstr " uit-transities: " -#: dfa.c:210 +#: src/dfa.c:201 #, c-format msgid "" "\n" @@ -64,11 +65,11 @@ msgstr "" "\n" " vastlopende transities: EOF " -#: dfa.c:341 +#: src/dfa.c:331 msgid "consistency check failed in epsclosure()" msgstr "consistentiecontrole is mislukt in epsclosure()" -#: dfa.c:429 +#: src/dfa.c:419 msgid "" "\n" "\n" @@ -80,24 +81,24 @@ msgstr "" "DFA-dump:\n" "\n" -#: dfa.c:604 +#: src/dfa.c:587 msgid "could not create unique end-of-buffer state" msgstr "kon geen unieke toestand voor einde-van-buffer aanmaken" -#: dfa.c:625 +#: src/dfa.c:608 #, c-format msgid "state # %d:\n" msgstr "toestand # %d:\n" -#: dfa.c:785 +#: src/dfa.c:768 msgid "Could not write yynxt_tbl[][]" msgstr "Kan yynxt_tbl[][] niet schrijven" -#: dfa.c:1049 +#: src/dfa.c:1028 msgid "bad transition character detected in sympartition()" msgstr "onjuist transitieteken in sympartition()" -#: gen.c:478 +#: src/gen.c:480 msgid "" "\n" "\n" @@ -109,29 +110,29 @@ msgstr "" "Equivalentieklassen:\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 "toestand # %d accepteert: [%d]\n" -#: gen.c:1110 +#: src/gen.c:1115 #, c-format msgid "state # %d accepts: " msgstr "toestand # %d accepteert: " -#: gen.c:1157 +#: src/gen.c:1162 msgid "Could not write yyacclist_tbl" msgstr "Kan yyacclist_tbl niet schrijven" -#: gen.c:1233 +#: src/gen.c:1236 msgid "Could not write yyacc_tbl" msgstr "Kan yyacc_tbl niet schrijven" -#: 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 "Kan ecstbl niet schrijven" -#: gen.c:1271 +#: src/gen.c:1271 msgid "" "\n" "\n" @@ -141,392 +142,410 @@ msgstr "" "\n" "Meta-equivalentieklassen:\n" -#: gen.c:1293 +#: src/gen.c:1293 msgid "Could not write yymeta_tbl" msgstr "Kan yymeta_tbl niet schrijven" -#: gen.c:1354 +#: src/gen.c:1352 msgid "Could not write yybase_tbl" msgstr "Kan yybase_tbl niet schrijven" -#: gen.c:1388 +#: src/gen.c:1384 msgid "Could not write yydef_tbl" msgstr "Kan yydef_tbl niet schrijven" -#: gen.c:1428 +#: src/gen.c:1422 msgid "Could not write yynxt_tbl" msgstr "Kan yynxt_tbl niet schrijven" -#: gen.c:1464 +#: src/gen.c:1456 msgid "Could not write yychk_tbl" msgstr "Kan yychk_tbl niet schrijven" -#: gen.c:1618 gen.c:1647 +#: src/gen.c:1608 src/gen.c:1637 msgid "Could not write ftbl" msgstr "Kan ftbl niet schrijven" -#: gen.c:1624 +#: src/gen.c:1614 msgid "Could not write ssltbl" msgstr "Kan ssltbl niet schrijven" -#: gen.c:1675 +#: src/gen.c:1665 msgid "Could not write eoltbl" msgstr "Kan eoltbl niet schrijven" -#: gen.c:1735 +#: src/gen.c:1722 msgid "Could not write yynultrans_tbl" msgstr "Kan yynultrans_tbl niet schrijven" -#: main.c:191 +#: src/main.c:178 msgid "rule cannot be matched" msgstr "voorschrift geeft geen overeenkomsten" -#: main.c:196 +#: src/main.c:183 msgid "-s option given but default rule can be matched" -msgstr "optie '-s' is gegeven, maar het standaardvoorschrift geeft overeenkomsten" +msgstr "" +"optie '-s' is gegeven, maar het standaardvoorschrift geeft overeenkomsten" -#: main.c:236 +#: src/main.c:221 msgid "Can't use -+ with -l option" msgstr "Optie '-+' gaat niet samen met '-l'" -#: main.c:239 +#: src/main.c:224 msgid "Can't use -f or -F with -l option" msgstr "Optie '-f' of '-F' gaat niet samen met '-l'" -#: main.c:243 +#: src/main.c:228 msgid "Can't use --reentrant or --bison-bridge with -l option" msgstr "Optie '--reentrant' of '--bison-bridge' gaat niet samen met '-l'" -#: main.c:275 +#: src/main.c:260 msgid "-Cf/-CF and -Cm don't make sense together" msgstr "Opties -Cf/-CF en -Cm gaan niet samen" -#: main.c:278 +#: src/main.c:263 msgid "-Cf/-CF and -I are incompatible" msgstr "Opties -Cf/-CF en -I gaan niet samen" -#: main.c:282 +#: src/main.c:267 msgid "-Cf/-CF are incompatible with lex-compatibility mode" msgstr "Optie -Cf of -CF gaat niet samen met lex-compatibiliteitsmodus" -#: main.c:287 +#: src/main.c:272 msgid "-Cf and -CF are mutually exclusive" msgstr "Opties -Cf en -CF sluiten elkaar uit" -#: main.c:291 +#: src/main.c:276 msgid "Can't use -+ with -CF option" msgstr "Optie '-+' gaat niet samen met '-CF'" -#: main.c:294 +#: src/main.c:279 #, c-format msgid "%array incompatible with -+ option" msgstr "Optie '-+' gaat niet samen met %array" -#: main.c:299 +#: src/main.c:284 msgid "Options -+ and --reentrant are mutually exclusive." msgstr "Opties '-+' en '--reentrant' sluiten elkaar uit." -#: main.c:302 +#: src/main.c:287 msgid "bison bridge not supported for the C++ scanner." msgstr "bison bridge wordt niet ondersteund voor de C++-scanner." -#: main.c:357 main.c:403 +#: src/main.c:336 src/main.c:419 #, c-format msgid "could not create %s" msgstr "kan %s niet aanmaken" -#: main.c:416 +#: src/main.c:431 msgid "could not write tables header" msgstr "kan tabellenkop niet schrijven" -#: main.c:420 +#: src/main.c:435 #, c-format msgid "can't open skeleton file %s" msgstr "kan skeletbestand %s niet openen" -#: main.c:456 +#: src/main.c:450 +msgid "Prefix cannot include '[' or ']'" +msgstr "" + +#: src/main.c:474 msgid "allocation of macro definition failed" msgstr "geheugenreservering voor macrodefinitie is mislukt" -#: main.c:504 +#: src/main.c:521 #, c-format msgid "input error reading skeleton file %s" msgstr "invoerfout tijdens lezen van skeletbestand %s" -#: main.c:508 +#: src/main.c:525 #, c-format msgid "error closing skeleton file %s" msgstr "fout tijdens sluiten van skeletbestand %s" -#: main.c:693 +#: src/main.c:709 #, c-format msgid "error creating header file %s" msgstr "fout tijdens aanmaken van headerbestand %s" -#: main.c:701 +#: src/main.c:717 #, c-format msgid "error writing output file %s" msgstr "fout tijdens schrijven van uitvoerbestand %s" -#: main.c:705 +#: src/main.c:721 #, c-format msgid "error closing output file %s" msgstr "fout tijdens sluiten van uitvoerbestand %s" -#: main.c:709 +#: src/main.c:725 #, c-format msgid "error deleting output file %s" msgstr "fout tijdens verwijderen van uitvoerbestand %s" -#: main.c:716 +#: src/main.c:732 #, c-format msgid "No backing up.\n" msgstr "Terugstappen is niet mogelijk.\n" -#: main.c:720 +#: src/main.c:736 #, c-format msgid "%d backing up (non-accepting) states.\n" msgstr "%d terugstappende (niet-accepterende) toestanden.\n" -#: main.c:724 +#: src/main.c:740 #, c-format msgid "Compressed tables always back up.\n" msgstr "Gecomprimeerde tabellen kunnen altijd terugstappen.\n" -#: main.c:727 +#: src/main.c:743 #, c-format msgid "error writing backup file %s" msgstr "fout tijdens schrijven van terugstapbestand %s" -#: main.c:731 +#: src/main.c:747 #, c-format msgid "error closing backup file %s" msgstr "fout tijdens sluiten van terugstapbestand %s" -#: main.c:736 +#: src/main.c:752 #, c-format msgid "%s version %s usage statistics:\n" msgstr "%s versie %s gebruiksstatistieken:\n" -#: main.c:739 +#: src/main.c:755 #, c-format msgid " scanner options: -" msgstr " scanneropties: -" -#: main.c:818 +#: src/main.c:834 #, c-format msgid " %d/%d NFA states\n" msgstr " %d/%d NFA-toestanden\n" -#: main.c:820 +#: src/main.c:836 #, c-format msgid " %d/%d DFA states (%d words)\n" msgstr " %d/%d DFA-toestanden (%d woorden)\n" -#: main.c:822 +#: src/main.c:838 #, c-format msgid " %d rules\n" msgstr " %d voorschriften\n" -#: main.c:827 +#: src/main.c:843 #, c-format msgid " No backing up\n" msgstr " Terugstappen is niet mogelijk\n" -#: main.c:831 +#: src/main.c:847 #, c-format msgid " %d backing-up (non-accepting) states\n" msgstr " %d terugstappende (niet-accepterende) toestanden\n" -#: main.c:836 +#: src/main.c:852 #, c-format msgid " Compressed tables always back-up\n" msgstr " Gecomprimeerde tabellen kunnen altijd terugstappen\n" -#: main.c:840 +#: src/main.c:856 #, c-format msgid " Beginning-of-line patterns used\n" msgstr " Begin-van-regel-patronen gebruikt\n" -#: main.c:842 +#: src/main.c:858 #, c-format msgid " %d/%d start conditions\n" msgstr " %d/%d startvoorwaarden\n" -#: main.c:846 +#: src/main.c:862 #, c-format msgid " %d epsilon states, %d double epsilon states\n" msgstr " %d epsilontoestanden, %d dubbele epsilontoestanden\n" -#: main.c:850 +#: src/main.c:866 #, c-format msgid " no character classes\n" msgstr " geen tekenklassen\n" -#: main.c:854 +#: src/main.c:870 #, c-format msgid " %d/%d character classes needed %d/%d words of storage, %d reused\n" -msgstr " %d/%d tekenklassen hadden %d/%d opslagwoorden nodig, %d hergebruikt\n" +msgstr "" +" %d/%d tekenklassen hadden %d/%d opslagwoorden nodig, %d hergebruikt\n" -#: main.c:859 +#: src/main.c:875 #, c-format msgid " %d state/nextstate pairs created\n" msgstr " %d toestand/volgtoestand-paren aangemaakt\n" -#: main.c:862 +#: src/main.c:878 #, c-format msgid " %d/%d unique/duplicate transitions\n" msgstr " %d/%d unieke/dubbele transities\n" -#: main.c:867 +#: src/main.c:883 #, c-format msgid " %d table entries\n" msgstr " %d tabelitems\n" -#: main.c:875 +#: src/main.c:891 #, c-format msgid " %d/%d base-def entries created\n" msgstr " %d/%d base-def-items aangemaakt\n" -#: main.c:879 +#: src/main.c:895 #, c-format msgid " %d/%d (peak %d) nxt-chk entries created\n" msgstr " %d/%d (piek %d) nxt-chk-items aangemaakt\n" -#: main.c:883 +#: src/main.c:899 #, c-format msgid " %d/%d (peak %d) template nxt-chk entries created\n" msgstr " %d/%d (piek %d) sjabloon-nxt-chk-items aangemaakt\n" -#: main.c:887 +#: src/main.c:903 #, c-format msgid " %d empty table entries\n" msgstr " %d lege tabelitems\n" -#: main.c:889 +#: src/main.c:905 #, c-format msgid " %d protos created\n" msgstr " %d prototypes aangemaakt\n" -#: main.c:892 +#: src/main.c:908 #, c-format msgid " %d templates created, %d uses\n" msgstr " %d sjablonen aangemaakt, %d keer gebruikt\n" -#: main.c:900 +#: src/main.c:916 #, c-format msgid " %d/%d equivalence classes created\n" msgstr " %d/%d equivalentieklassen aangemaakt\n" -#: main.c:908 +#: src/main.c:924 #, c-format msgid " %d/%d meta-equivalence classes created\n" msgstr " %d/%d meta-equivalentieklassen aangemaakt\n" -#: main.c:914 +#: src/main.c:930 #, c-format msgid " %d (%d saved) hash collisions, %d DFAs equal\n" msgstr " %d (%d bewaarde) hash-botsingen, %d DFA's gelijk\n" -#: main.c:916 +#: src/main.c:932 #, c-format msgid " %d sets of reallocations needed\n" msgstr " %d sets van herallocaties waren nodig\n" -#: main.c:918 +#: src/main.c:934 #, c-format msgid " %d total table entries needed\n" msgstr " in totaal %d tabelitems nodig\n" -#: main.c:995 +#: src/main.c:1008 #, c-format msgid "Internal error. flexopts are malformed.\n" msgstr "*Interne fout*: ongeldige flexopts.\n" -#: main.c:1005 +#: src/main.c:1018 #, c-format msgid "Try `%s --help' for more information.\n" msgstr "Typ '%s --help' voor meer informatie.\n" -#: main.c:1062 +#: src/main.c:1075 #, c-format msgid "unknown -C option '%c'" msgstr "onbekende -C-optie '%c'" -#: main.c:1191 +#: src/main.c:1204 #, c-format msgid "%s %s\n" msgstr "%s %s\n" -#: main.c:1466 +#: src/main.c:1476 msgid "fatal parse error" msgstr "fatale ontledingsfout" -#: main.c:1498 +#: src/main.c:1508 #, c-format msgid "could not create backing-up info file %s" msgstr "kon terugstapbestand %s niet aanmaken" -#: main.c:1519 +#: src/main.c:1529 #, c-format msgid "-l AT&T lex compatibility option entails a large performance penalty\n" -msgstr "de AT&T-lexcompatibiliteitsoptie '-l' betekent een grote prestatievermindering\n" +msgstr "" +"de AT&T-lexcompatibiliteitsoptie '-l' betekent een grote " +"prestatievermindering\n" -#: main.c:1522 +#: src/main.c:1532 #, c-format msgid " and may be the actual source of other reported performance penalties\n" -msgstr " en zou de eigenlijke bron kunnen zijn van andere gemelde prestatieverminderingen\n" +msgstr "" +" en zou de eigenlijke bron kunnen zijn van andere gemelde " +"prestatieverminderingen\n" -#: main.c:1528 +#: src/main.c:1538 #, c-format -msgid "%%option yylineno entails a performance penalty ONLY on rules that can match newline characters\n" -msgstr "de %%optie yylineno betekent een prestatievermindering, maar ALLEEN voor voorschriften die met het regeleindeteken overeen kunnen komen\n" +msgid "" +"%%option yylineno entails a performance penalty ONLY on rules that can match " +"newline characters\n" +msgstr "" +"de %%optie yylineno betekent een prestatievermindering, maar ALLEEN voor " +"voorschriften die met het regeleindeteken overeen kunnen komen\n" -#: main.c:1535 +#: src/main.c:1545 #, c-format msgid "-I (interactive) entails a minor performance penalty\n" msgstr "optie '-I' (interactief) betekent een kleine prestatievermindering\n" -#: main.c:1540 +#: src/main.c:1550 #, c-format msgid "yymore() entails a minor performance penalty\n" msgstr "yymore() betekent een kleine prestatievermindering\n" -#: main.c:1546 +#: src/main.c:1556 #, c-format msgid "REJECT entails a large performance penalty\n" msgstr "REJECT betekent een grote prestatievermindering\n" -#: main.c:1551 +#: src/main.c:1561 #, c-format msgid "Variable trailing context rules entail a large performance penalty\n" -msgstr "Voorschriften met variabele nakomende context betekenen een grote prestatievermindering\n" +msgstr "" +"Voorschriften met variabele nakomende context betekenen een grote " +"prestatievermindering\n" -#: main.c:1563 +#: src/main.c:1573 msgid "REJECT cannot be used with -f or -F" msgstr "REJECT gaat niet samen met -f of -F" -#: main.c:1566 +#: src/main.c:1576 #, c-format msgid "%option yylineno cannot be used with REJECT" msgstr "%optie yylineno gaat niet samen met REJECT" -#: main.c:1569 +#: src/main.c:1579 msgid "variable trailing context rules cannot be used with -f or -F" -msgstr "voorschriften met variabele nakomende context gaan niet samen met '-f' of '-F'" +msgstr "" +"voorschriften met variabele nakomende context gaan niet samen met '-f' of '-" +"F'" -#: main.c:1692 +#: src/main.c:1704 #, c-format msgid "%option yyclass only meaningful for C++ scanners" msgstr "%optie yyclass heeft alleen betekenis voor C++-scanners" -#: main.c:1799 +#: src/main.c:1791 #, c-format msgid "Usage: %s [OPTIONS] [FILE]...\n" msgstr "Gebruik: %s [OPTIE...] [BESTAND...]\n" -#: main.c:1802 -#, c-format +#: src/main.c:1794 +#, fuzzy, c-format msgid "" "Generates programs that perform pattern-matching on text.\n" "\n" @@ -549,13 +568,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" @@ -577,8 +599,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" @@ -594,8 +614,10 @@ msgstr "" "Tabelcompressie:\n" " -Ca, --align meer geheugen gebruiken voor beter uitgelijnde tabellen\n" " -Ce, --ecs equivalentieklassen construeren\n" -" -Cf tabellen niet comprimeren; de -f-representatie gebruiken\n" -" -CF tabellen niet comprimeren; de -F-representatie gebruiken\n" +" -Cf tabellen niet comprimeren; de -f-representatie " +"gebruiken\n" +" -CF tabellen niet comprimeren; de -F-representatie " +"gebruiken\n" " -Cm, --meta-ecs meta-equivalentieklassen construeren\n" " -Cr, --read read() gebruiken in plaats van stdio voor scannerinvoer\n" " -f, --full een snelle, grote scanner genereren (zelfde als -Cfr)\n" @@ -606,7 +628,8 @@ msgstr "" " -d, --debug debugmodus in scanner aanzetten\n" " -b, --backup terugstap-informatie naar %s schrijven\n" " -p, --perf-report prestatierapport naar standaardfoutuitvoer schrijven\n" -" -s, --nodefault standaardvoorschrift dat onherkende tekst ECHO-t uitzetten\n" +" -s, --nodefault standaardvoorschrift dat onherkende tekst ECHO-t " +"uitzetten\n" " -T, --trace %s uitvoeren in tracemodus\n" " -w, --nowarn geen waarschuwingen geven\n" " -v, --verbose scannerstatistieken naar standaarduitvoer schrijven\n" @@ -614,15 +637,18 @@ msgstr "" "Bestanden:\n" " -o, --outfile=BESTAND dit uitvoerbestand gebruiken\n" " -S, --skel=BESTAND dit skeletbestand gebruiken\n" -" -t, --stdout scanner naar standaarduitvoer schrijven, niet naar %s\n" +" -t, --stdout scanner naar standaarduitvoer schrijven, niet naar " +"%s\n" " --yyclass=NAAM naam van de C++-klasse\n" -" --header-file=BESTAND behalve de scanner ook een C-headerbestand maken\n" +" --header-file=BESTAND behalve de scanner ook een C-headerbestand " +"maken\n" " --tables-file[=BESTAND] tabellen schrijven (naar dit BESTAND)\n" "\n" "Scannergedrag:\n" " -7, --7bit een 7-bits-scanner genereren\n" " -8, --8bit een 8-bits-scanner genereren\n" -" -B, --batch een batch-scanner genereren (tegengestelde van -I)\n" +" -B, --batch een batch-scanner genereren (tegengestelde van -" +"I)\n" " -i, --case-insensitive hoofd-/kleine letters in patronen negeren\n" " -l, --lex-compat maximale compatibiliteit met de originele 'lex'\n" " -X, --posix-compat maximale compatibiliteit met de POSIX 'lex'\n" @@ -650,51 +676,52 @@ msgstr "" " -h, --help deze hulptekst tonen\n" " -V, --version de versie van %s tonen\n" -#: misc.c:65 +#: src/misc.c:64 msgid "allocation of sko_stack failed" msgstr "geheugenreservering voor 'sko_stack' is mislukt" -#: misc.c:102 misc.c:128 +#: src/misc.c:100 #, c-format msgid "name \"%s\" ridiculously long" msgstr "naam is belachelijk lang: \"%s\"" -#: misc.c:177 +#: src/misc.c:155 msgid "memory allocation failed in allocate_array()" msgstr "geheugenreservering is mislukt in allocate_array()" -#: misc.c:230 +#: src/misc.c:205 #, c-format msgid "bad character '%s' detected in check_char()" msgstr "onjuist teken '%s' in check_char()" -#: misc.c:235 +#: src/misc.c:210 #, c-format msgid "scanner requires -8 flag to use the character %s" msgstr "scanner heeft de optie '-8' nodig om teken %s te kunnen gebruiken" -#: misc.c:268 -msgid "dynamic memory failure in copy_string()" -msgstr "dynamische geheugenfout in copy_string()" +#: src/misc.c:229 +#, fuzzy +msgid "memory allocation failure in xstrdup()" +msgstr "geheugenreservering is mislukt in allocate_array()" -#: misc.c:367 +#: src/misc.c:303 #, c-format msgid "%s: fatal internal error, %s\n" msgstr "%s: **fatale interne programmafout**, %s\n" -#: misc.c:803 +#: src/misc.c:671 msgid "attempt to increase array size failed" msgstr "vergroting van array is mislukt" -#: misc.c:930 +#: src/misc.c:795 msgid "bad line in skeleton file" msgstr "onjuiste regel in skeletbestand" -#: misc.c:979 +#: src/misc.c:845 msgid "memory allocation failed in yy_flex_xmalloc()" msgstr "geheugenreservering is mislukt in yy_flex_xmalloc()" -#: nfa.c:104 +#: src/nfa.c:100 #, c-format msgid "" "\n" @@ -705,226 +732,239 @@ msgstr "" "\n" "********** begin van dump van NFA met starttoestand %d\n" -#: nfa.c:115 +#: src/nfa.c:111 #, c-format msgid "state # %4d\t" msgstr "toestand # %4d\t" -#: nfa.c:130 +#: src/nfa.c:126 #, c-format msgid "********** end of dump\n" msgstr "********** einde van de dump\n" -#: nfa.c:174 +#: src/nfa.c:169 msgid "empty machine in dupmachine()" msgstr "lege machine in dupmachine()" -#: nfa.c:240 +#: src/nfa.c:234 #, c-format msgid "Variable trailing context rule at line %d\n" msgstr "Voorschrift met variabele nakomende context op regel %d\n" -#: nfa.c:364 +#: src/nfa.c:357 msgid "bad state type in mark_beginning_as_normal()" msgstr "onjuist toestandstype in mark_beginning_as_normal()" -#: nfa.c:609 +#: src/nfa.c:595 #, c-format msgid "input rules are too complicated (>= %d NFA states)" msgstr "invoervoorschriften zijn te ingewikkeld (>= %d NFA-toestanden)" -#: nfa.c:688 +#: src/nfa.c:673 msgid "found too many transitions in mkxtion()" msgstr "te veel transities gevonden in mkxtion()" -#: nfa.c:714 +#: src/nfa.c:699 #, c-format msgid "too many rules (> %d)!" msgstr "te veel voorschriften (> %d)!" -#: parse.y:159 +#: src/parse.y:159 msgid "unknown error processing section 1" msgstr "onbekende fout tijdens verwerken van sectie 1" -#: parse.y:184 parse.y:351 +#: src/parse.y:184 src/parse.y:353 msgid "bad start condition list" msgstr "onjuiste lijst van startvoorwaarden" -#: parse.y:315 +#: src/parse.y:204 +msgid "Prefix must not contain [ or ]" +msgstr "" + +#: src/parse.y:317 msgid "unrecognized rule" msgstr "onbekend voorschrift" -#: 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 "nakomende context twee keer gebruikt" -#: 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 "onjuiste iteratiewaarden" -#: 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 "iteratiewaarde moet positief zijn" -#: 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 "het tekenbereik [%c-%c] is niet eenduidig in een hoofdletterongevoelige scanner" +msgstr "" +"het tekenbereik [%c-%c] is niet eenduidig in een hoofdletterongevoelige " +"scanner" -#: parse.y:819 +#: src/parse.y:821 msgid "negative range in character class" msgstr "negatief bereik in tekenklasse" -#: parse.y:916 +#: src/parse.y:918 msgid "[:^lower:] is ambiguous in case insensitive scanner" msgstr "[:^lower:] is niet eenduidig in een hoofdletterongevoelige scanner" -#: parse.y:922 +#: src/parse.y:924 msgid "[:^upper:] ambiguous in case insensitive scanner" msgstr "[:^upper:] is niet eenduidig in een hoofdletterongevoelige scanner" -#: 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 "Invoerregel is te lang\n" -#: scan.l:161 +#: src/scan.l:183 #, c-format msgid "malformed '%top' directive" msgstr "verkeerde opbouw van '%top'-commando" -#: scan.l:183 +#: src/scan.l:205 #, no-c-format msgid "unrecognized '%' directive" msgstr "onbekend '%'-commando" -#: scan.l:192 +#: src/scan.l:214 msgid "Definition name too long\n" msgstr "Definitienaam is te lang\n" -#: scan.l:284 +#: src/scan.l:309 msgid "Unmatched '{'" msgstr "Ongepaarde '{'" -#: scan.l:300 +#: src/scan.l:325 #, c-format msgid "Definition value for {%s} too long\n" msgstr "Definitiewaarde voor {%s} is te lang\n" -#: scan.l:317 +#: src/scan.l:342 msgid "incomplete name definition" msgstr "onvolledige naamsdefinitie" -#: scan.l:443 +#: src/scan.l:467 msgid "Option line too long\n" msgstr "Optiesregel is te lang\n" -#: scan.l:451 +#: src/scan.l:475 #, c-format msgid "unrecognized %%option: %s" msgstr "onbekende %%option: %s" -#: scan.l:633 scan.l:800 +#: src/scan.l:659 src/scan.l:832 msgid "bad character class" msgstr "onjuiste tekenklasse" -#: scan.l:683 +#: src/scan.l:709 #, c-format msgid "undefined definition {%s}" msgstr "ongedefinieerde definitie {%s}" -#: scan.l:755 +#: src/scan.l:772 +msgid "unbalanced parenthesis" +msgstr "" + +#: src/scan.l:787 #, c-format msgid "bad <start condition>: %s" msgstr "onjuiste <startvoorwaarde>: %s" -#: scan.l:768 +#: src/scan.l:800 msgid "missing quote" msgstr "ontbrekend aanhalingsteken" -#: scan.l:834 +#: src/scan.l:866 #, c-format msgid "bad character class expression: %s" msgstr "onjuiste expressie '%s' in tekenklasse" -#: scan.l:856 +#: src/scan.l:888 msgid "bad character inside {}'s" msgstr "onjuist teken tussen {}'s" -#: scan.l:862 +#: src/scan.l:894 msgid "missing }" msgstr "ontbrekende }" -#: scan.l:940 +#: src/scan.l:972 msgid "EOF encountered inside an action" msgstr "EOF werd bereikt tijdens een actie" -#: scan.l:945 +#: src/scan.l:977 msgid "EOF encountered inside pattern" msgstr "EOF werd bereikt binnen een patroon" -#: scan.l:967 +#: src/scan.l:1010 #, c-format msgid "bad character: %s" msgstr "onjuist teken: %s" -#: scan.l:996 +#: src/scan.l:1038 #, c-format msgid "can't open %s" msgstr "kan %s niet openen" -#: scanopt.c:291 +#: src/scanopt.c:259 #, c-format msgid "Usage: %s [OPTIONS]...\n" msgstr "Gebruik: %s [OPTIE...]\n" -#: scanopt.c:564 +#: src/scanopt.c:524 #, c-format msgid "option `%s' doesn't allow an argument\n" msgstr "optie '%s' staat geen argument toe\n" -#: scanopt.c:569 +#: src/scanopt.c:529 #, c-format msgid "option `%s' requires an argument\n" msgstr "optie '%s' vereist een argument\n" -#: scanopt.c:573 +#: src/scanopt.c:533 #, c-format msgid "option `%s' is ambiguous\n" msgstr "optie '%s' is niet eenduidig\n" -#: scanopt.c:577 +#: src/scanopt.c:537 #, c-format msgid "Unrecognized option `%s'\n" msgstr "Onbekende optie '%s'\n" -#: scanopt.c:581 +#: src/scanopt.c:541 #, c-format msgid "Unknown error=(%d)\n" msgstr "Onbekende fout=(%d)\n" -#: sym.c:100 +#: src/sym.c:92 msgid "symbol table memory allocation failed" msgstr "geheugenreservering voor symbolentabel is mislukt" -#: sym.c:202 +#: src/sym.c:183 msgid "name defined twice" msgstr "naam is twee keer gedefinieerd" -#: sym.c:253 +#: src/sym.c:231 #, c-format msgid "start condition %s declared twice" msgstr "startvoorwaarde %s is twee keer vermeld" -#: yylex.c:56 +#: src/yylex.c:57 msgid "premature EOF" msgstr "voortijdig einde van bestand" -#: yylex.c:198 +#: src/yylex.c:200 #, c-format msgid "End Marker\n" msgstr "Eindmarkering\n" -#: yylex.c:204 +#: src/yylex.c:206 #, c-format msgid "*Something Weird* - tok: %d val: %d\n" msgstr "*Iets Raars* - token: %d waarde:%d\n" + +#~ msgid "dynamic memory failure in copy_string()" +#~ msgstr "dynamische geheugenfout in copy_string()" @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: flex 2.5.36\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-08-02 18:15+0200\n" "Last-Translator: Jakub Bogusz <qboosh@pld-linux.org>\n" "Language-Team: Polish <translation-team-pl@lists.sourceforge.net>\n" @@ -15,43 +15,44 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-2\n" "Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" -#: buf.c:78 +#: src/buf.c:79 msgid "Allocation of buffer to print string failed" msgstr "Przydzielenie bufora do wypisania ³añcucha nie powiod³o siê" -#: buf.c:100 +#: src/buf.c:107 msgid "Allocation of buffer for line directive failed" msgstr "Przydzielenie bufora dla dyrektywy linii nie powiod³o siê" -#: buf.c:177 +#: src/buf.c:177 msgid "Allocation of buffer for m4 def failed" msgstr "Przydzielenie bufora dla polecenia m4 def powiod³o siê" -#: buf.c:197 +#: src/buf.c:198 msgid "Allocation of buffer for m4 undef failed" msgstr "Przydzielenie bufora dla polecenia m4 undef powiod³o siê" -#: dfa.c:61 +#: src/dfa.c:59 #, c-format msgid "State #%d is non-accepting -\n" msgstr "Stan #%d jest nieakceptuj±cy -\n" -#: dfa.c:124 +#: src/dfa.c:119 msgid "dangerous trailing context" msgstr "niebezpieczny kontekst koñcowy" -#: dfa.c:166 +#: src/dfa.c:159 #, c-format msgid " associated rule line numbers:" msgstr " numery linii powi±zanych regu³:" -#: dfa.c:202 +#: src/dfa.c:193 #, c-format msgid " out-transitions: " msgstr " przej¶cia-wyj¶ciowe: " -#: dfa.c:210 +#: src/dfa.c:201 #, c-format msgid "" "\n" @@ -60,11 +61,11 @@ msgstr "" "\n" " przej¶cia-zapêtlaj±ce: EOF " -#: dfa.c:341 +#: src/dfa.c:331 msgid "consistency check failed in epsclosure()" msgstr "kontrola spójno¶ci nie powiod³a siê w epsclosure()" -#: dfa.c:429 +#: src/dfa.c:419 msgid "" "\n" "\n" @@ -76,24 +77,24 @@ msgstr "" "Zrzut DFA:\n" "\n" -#: dfa.c:604 +#: src/dfa.c:587 msgid "could not create unique end-of-buffer state" msgstr "nie mo¿na utworzyæ unikalnego stanu koñca bufora" -#: dfa.c:625 +#: src/dfa.c:608 #, c-format msgid "state # %d:\n" msgstr "stan # %d:\n" -#: dfa.c:785 +#: src/dfa.c:768 msgid "Could not write yynxt_tbl[][]" msgstr "Nie mo¿na zapisaæ yynxt_tbl[][]" -#: dfa.c:1049 +#: src/dfa.c:1028 msgid "bad transition character detected in sympartition()" msgstr "wykryto b³êdny znak przej¶cia w sympartition()" -#: gen.c:478 +#: src/gen.c:480 msgid "" "\n" "\n" @@ -105,29 +106,29 @@ msgstr "" "Klasy równowa¿no¶ci:\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 "stan # %d akceptuje: [%d]\n" -#: gen.c:1110 +#: src/gen.c:1115 #, c-format msgid "state # %d accepts: " msgstr "stan # %d akceptuje: " -#: gen.c:1157 +#: src/gen.c:1162 msgid "Could not write yyacclist_tbl" msgstr "Nie mo¿na zapisaæ yyacclist_tbl" -#: gen.c:1233 +#: src/gen.c:1236 msgid "Could not write yyacc_tbl" msgstr "Nie mo¿na zapisaæ 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 "Nie mo¿na zapisaæ ecstbl" -#: gen.c:1271 +#: src/gen.c:1271 msgid "" "\n" "\n" @@ -137,392 +138,402 @@ msgstr "" "\n" "Klasy meta-równowa¿no¶ci:\n" -#: gen.c:1293 +#: src/gen.c:1293 msgid "Could not write yymeta_tbl" msgstr "Nie mo¿na zapisaæ yymeta_tbl" -#: gen.c:1354 +#: src/gen.c:1352 msgid "Could not write yybase_tbl" msgstr "Nie mo¿na zapisaæ yybase_tbl" -#: gen.c:1388 +#: src/gen.c:1384 msgid "Could not write yydef_tbl" msgstr "Nie mo¿na zapisaæ yydef_tbl" -#: gen.c:1428 +#: src/gen.c:1422 msgid "Could not write yynxt_tbl" msgstr "Nie mo¿na zapisaæ yynxt_tbl" -#: gen.c:1464 +#: src/gen.c:1456 msgid "Could not write yychk_tbl" msgstr "Nie mo¿na zapisaæ yychk_tbl" -#: gen.c:1618 gen.c:1647 +#: src/gen.c:1608 src/gen.c:1637 msgid "Could not write ftbl" msgstr "Nie mo¿na zapisaæ ftbl" -#: gen.c:1624 +#: src/gen.c:1614 msgid "Could not write ssltbl" msgstr "Nie mo¿na zapisaæ ssltbl" -#: gen.c:1675 +#: src/gen.c:1665 msgid "Could not write eoltbl" msgstr "Nie mo¿na zapisaæ eoltbl" -#: gen.c:1735 +#: src/gen.c:1722 msgid "Could not write yynultrans_tbl" msgstr "Nie mo¿na zapisaæ yynultrans_tbl" -#: main.c:189 +#: src/main.c:178 msgid "rule cannot be matched" msgstr "nie mo¿na dopasowaæ regu³y" -#: main.c:194 +#: src/main.c:183 msgid "-s option given but default rule can be matched" msgstr "podano opcjê -s, ale domy¶lna regu³a mo¿e byæ dopasowana" -#: main.c:234 +#: src/main.c:221 msgid "Can't use -+ with -l option" msgstr "Nie mo¿na u¿yæ -+ z opcj± -l" -#: main.c:237 +#: src/main.c:224 msgid "Can't use -f or -F with -l option" msgstr "Nie mo¿na u¿yæ -f ani -F z opcj± -l" -#: main.c:241 +#: src/main.c:228 msgid "Can't use --reentrant or --bison-bridge with -l option" msgstr "Nie mo¿na u¿yæ --reentrant ani --bison-bridge z opcj± -l" -#: main.c:278 +#: src/main.c:260 msgid "-Cf/-CF and -Cm don't make sense together" msgstr "-Cf/-CF i -Cm razem nie maj± sensu" -#: main.c:281 +#: src/main.c:263 msgid "-Cf/-CF and -I are incompatible" msgstr "-Cf/-CF i -I s± niekompatybilne" -#: main.c:285 +#: src/main.c:267 msgid "-Cf/-CF are incompatible with lex-compatibility mode" msgstr "-Cf/-CF s± niekompatybilne z trybem kompatybilno¶ci z leksem" -#: main.c:290 +#: src/main.c:272 msgid "-Cf and -CF are mutually exclusive" msgstr "-Cf i -CF wykluczaj± siê wzajemnie" -#: main.c:294 +#: src/main.c:276 msgid "Can't use -+ with -CF option" msgstr "Nie mo¿na u¿yæ -+ z opcj± -CF" -#: main.c:297 +#: src/main.c:279 #, c-format msgid "%array incompatible with -+ option" msgstr "%array jest niekompatybilne z opcj± -+" -#: main.c:302 +#: src/main.c:284 msgid "Options -+ and --reentrant are mutually exclusive." msgstr "Opcje -+ i --reentrant wykluczaj± siê wzajemnie." -#: main.c:305 +#: src/main.c:287 msgid "bison bridge not supported for the C++ scanner." msgstr "pomost dla bisona nie jest obs³ugiwany dla skanera C++." -#: main.c:360 main.c:406 +#: src/main.c:336 src/main.c:419 #, c-format msgid "could not create %s" msgstr "nie mo¿na utworzyæ %s" -#: main.c:419 +#: src/main.c:431 msgid "could not write tables header" msgstr "nie mo¿na zapisaæ nag³ówka tablic" -#: main.c:423 +#: src/main.c:435 #, c-format msgid "can't open skeleton file %s" msgstr "nie mo¿na otworzyæ pliku szablonu %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 "przydzielenie pamiêci dla definicji makra nie powiod³o siê" -#: main.c:507 +#: src/main.c:521 #, c-format msgid "input error reading skeleton file %s" msgstr "b³±d wej¶cia podczas odczytu pliku szablonu %s" -#: main.c:511 +#: src/main.c:525 #, c-format msgid "error closing skeleton file %s" msgstr "b³±d podczas zamykania pliku szablonu %s" -#: main.c:696 +#: src/main.c:709 #, c-format msgid "error creating header file %s" msgstr "b³±d podczas tworzenia pliku nag³ówkowego %s" -#: main.c:704 +#: src/main.c:717 #, c-format msgid "error writing output file %s" msgstr "b³±d podczas zapisu pliku wyj¶ciowego %s" -#: main.c:708 +#: src/main.c:721 #, c-format msgid "error closing output file %s" msgstr "b³±d podczas zamykania pliku wyj¶ciowego %s" -#: main.c:712 +#: src/main.c:725 #, c-format msgid "error deleting output file %s" msgstr "b³±d podczas usuwania pliku wyj¶ciowego %s" -#: main.c:719 +#: src/main.c:732 #, c-format msgid "No backing up.\n" msgstr "Bez zapamiêtywania.\n" -#: main.c:723 +#: src/main.c:736 #, c-format msgid "%d backing up (non-accepting) states.\n" msgstr "%d zapamiêtywanych stanów (nie akceptuj±cych).\n" -#: main.c:727 +#: src/main.c:740 #, c-format msgid "Compressed tables always back up.\n" msgstr "Skompresowane tablice zawsze zapamiêtuj±.\n" -#: main.c:730 +#: src/main.c:743 #, c-format msgid "error writing backup file %s" msgstr "b³±d podczas zapisu pliku raportu z zapamiêtywania %s" -#: main.c:734 +#: src/main.c:747 #, c-format msgid "error closing backup file %s" msgstr "b³±d podczas zamykania pliku raportu z zapamiêtywania %s" -#: main.c:739 +#: src/main.c:752 #, c-format msgid "%s version %s usage statistics:\n" msgstr "%s w wersji %s - statystyka u¿ycia:\n" -#: main.c:742 +#: src/main.c:755 #, c-format msgid " scanner options: -" msgstr " opcje skanera: -" -#: main.c:821 +#: src/main.c:834 #, c-format msgid " %d/%d NFA states\n" msgstr " %d/%d stanów NFA\n" -#: main.c:823 +#: src/main.c:836 #, c-format msgid " %d/%d DFA states (%d words)\n" msgstr " %d/%d stanów DFA (%d s³ów)\n" -#: main.c:825 +#: src/main.c:838 #, c-format msgid " %d rules\n" msgstr " %d regu³\n" -#: main.c:830 +#: src/main.c:843 #, c-format msgid " No backing up\n" msgstr " Bez zapamiêtywania\n" -#: main.c:834 +#: src/main.c:847 #, c-format msgid " %d backing-up (non-accepting) states\n" msgstr " %d zapamiêtywanych stanów (nie akceptuj±cych)\n" -#: main.c:839 +#: src/main.c:852 #, c-format msgid " Compressed tables always back-up\n" msgstr " Skompresowane tablice zawsze zapamiêtuj±\n" -#: main.c:843 +#: src/main.c:856 #, c-format msgid " Beginning-of-line patterns used\n" msgstr " U¿ytych wzorców pocz±tek-linii\n" -#: main.c:845 +#: src/main.c:858 #, c-format msgid " %d/%d start conditions\n" msgstr " %d/%d warunków pocz±tkowych\n" -#: main.c:849 +#: src/main.c:862 #, c-format msgid " %d epsilon states, %d double epsilon states\n" msgstr " %d stanów epsilonowych, %d stanów podwójnie epsilonowych\n" -#: main.c:853 +#: src/main.c:866 #, c-format msgid " no character classes\n" msgstr " bez klas znaków\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 klas znaków potrzebuje %d/%d s³ów pamiêci, %d ponownie u¿ytych\n" +msgstr "" +" %d/%d klas znaków potrzebuje %d/%d s³ów pamiêci, %d ponownie u¿ytych\n" -#: main.c:862 +#: src/main.c:875 #, c-format msgid " %d state/nextstate pairs created\n" msgstr " %d utworzonych par stan/nastêpny-stan\n" -#: main.c:865 +#: src/main.c:878 #, c-format msgid " %d/%d unique/duplicate transitions\n" msgstr " %d/%d przej¶æ unikalny/duplikat\n" -#: main.c:870 +#: src/main.c:883 #, c-format msgid " %d table entries\n" msgstr " %d elementów tablicy\n" -#: main.c:878 +#: src/main.c:891 #, c-format msgid " %d/%d base-def entries created\n" msgstr " %d/%d utworzonych elementów 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 (maksymalnie %d) utworzonych elementów 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 (maksymalnie %d) utworzonych szablonowych elementów nxt-chk\n" -#: main.c:890 +#: src/main.c:903 #, c-format msgid " %d empty table entries\n" msgstr " %d pustych elementów tablicy\n" -#: main.c:892 +#: src/main.c:905 #, c-format msgid " %d protos created\n" msgstr " %d utworzonych prototypów\n" -#: main.c:895 +#: src/main.c:908 #, c-format msgid " %d templates created, %d uses\n" msgstr " %d utworzonych szablonów, %d u¿yæ\n" -#: main.c:903 +#: src/main.c:916 #, c-format msgid " %d/%d equivalence classes created\n" msgstr " %d/%d utworzonych klas równowa¿no¶ci\n" -#: main.c:911 +#: src/main.c:924 #, c-format msgid " %d/%d meta-equivalence classes created\n" msgstr " %d/%d utworzonych klas meta-równowa¿no¶ci\n" -#: main.c:917 +#: src/main.c:930 #, c-format msgid " %d (%d saved) hash collisions, %d DFAs equal\n" msgstr " %d (%d zachowanych) kolizji haszy, %d jednakowych DFA\n" -#: main.c:919 +#: src/main.c:932 #, c-format msgid " %d sets of reallocations needed\n" msgstr " %d potrzebnych zbiorów realokacji\n" -#: main.c:921 +#: src/main.c:934 #, c-format msgid " %d total table entries needed\n" msgstr " %d potrzebnych ogó³em elementów tablicy\n" -#: main.c:998 +#: src/main.c:1008 #, c-format msgid "Internal error. flexopts are malformed.\n" msgstr "B³±d wewnêtrzny. ¬le sformu³owane flexopts.\n" -#: main.c:1008 +#: src/main.c:1018 #, c-format msgid "Try `%s --help' for more information.\n" msgstr "`%s --help' poda wiêcej informacji.\n" -#: main.c:1065 +#: src/main.c:1075 #, c-format msgid "unknown -C option '%c'" msgstr "nieznana opcja -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 "krytyczny b³±d analizy sk³adni" -#: main.c:1501 +#: src/main.c:1508 #, c-format msgid "could not create backing-up info file %s" msgstr "nie mo¿na utworzyæ pliku informacji o zapamiêtywaniu %s" -#: main.c:1522 +#: src/main.c:1529 #, c-format msgid "-l AT&T lex compatibility option entails a large performance penalty\n" msgstr "opcja -l zgodno¶ci z leksem AT&T powoduje du¿± stratê wydajno¶ci\n" -#: main.c:1525 +#: src/main.c:1532 #, c-format msgid " and may be the actual source of other reported performance penalties\n" msgstr " i mo¿e byæ przyczyn± innych zg³aszanych strat wydajno¶ci\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" -msgstr "%%option yylineno powoduje straty wydajno¶ci TYLKO dla regu³ dopasowuj±cych znak koñca linii\n" +msgid "" +"%%option yylineno entails a performance penalty ONLY on rules that can match " +"newline characters\n" +msgstr "" +"%%option yylineno powoduje straty wydajno¶ci TYLKO dla regu³ dopasowuj±cych " +"znak koñca linii\n" -#: main.c:1538 +#: src/main.c:1545 #, c-format msgid "-I (interactive) entails a minor performance penalty\n" msgstr "-I (interaktywny) powoduje ma³± stratê wydajno¶ci\n" -#: main.c:1543 +#: src/main.c:1550 #, c-format msgid "yymore() entails a minor performance penalty\n" msgstr "yymore() powoduje ma³± stratê wydajno¶ci\n" -#: main.c:1549 +#: src/main.c:1556 #, c-format msgid "REJECT entails a large performance penalty\n" msgstr "REJECT powoduje du¿± stratê wydajno¶ci\n" -#: main.c:1554 +#: src/main.c:1561 #, c-format msgid "Variable trailing context rules entail a large performance penalty\n" -msgstr "Regu³y ze zmiennym koñcowym kontekstem powoduj± du¿± stratê wydajno¶ci\n" +msgstr "" +"Regu³y ze zmiennym koñcowym kontekstem powoduj± du¿± stratê wydajno¶ci\n" -#: main.c:1566 +#: src/main.c:1573 msgid "REJECT cannot be used with -f or -F" msgstr "REJECT nie mo¿e byæ u¿yte z -f ani -F" -#: main.c:1569 +#: src/main.c:1576 #, c-format msgid "%option yylineno cannot be used with REJECT" msgstr "%option yylineno nie mo¿e byæ u¿yte z REJECT" -#: main.c:1572 +#: src/main.c:1579 msgid "variable trailing context rules cannot be used with -f or -F" msgstr "regu³y ze zmiennym koñcowym kontekstem nie mog± byæ u¿yte z -f ani -F" -#: main.c:1695 +#: src/main.c:1704 #, c-format msgid "%option yyclass only meaningful for C++ scanners" msgstr "%option yyclass ma znaczenie tylko dla skanerów C++" -#: main.c:1802 +#: src/main.c:1791 #, c-format msgid "Usage: %s [OPTIONS] [FILE]...\n" msgstr "Sk³adnia: %s [OPCJE] [PLIK]...\n" -#: main.c:1805 -#, c-format +#: src/main.c:1794 +#, fuzzy, c-format msgid "" "Generates programs that perform pattern-matching on text.\n" "\n" @@ -545,13 +556,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" @@ -573,8 +587,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" @@ -594,19 +606,24 @@ msgstr "" " -CF nie kompresowanie tablic; u¿ycie reprezentacji -F\n" " -Cm, --meta-ecs konstruowanie klas meta-równowa¿no¶ci\n" " -Cr, --read u¿ycie read() zamiast stdio dla wej¶cia skanera\n" -" -f, --full wygenerowanie szybkiego, wielkiego skanera. To samo co -Cfr\n" -" -F, --fast u¿ycie alternatywnej reprezentacji tablic. To samo co -CFr\n" +" -f, --full wygenerowanie szybkiego, wielkiego skanera. To samo co -" +"Cfr\n" +" -F, --fast u¿ycie alternatywnej reprezentacji tablic. To samo co -" +"CFr\n" " -Cem domy¶lne kompresowanie (to samo co --ecs --meta-ecs)\n" "\n" "Diagnostyka:\n" -" -d, --debug w³±czenie trybu diagnostycznego (debug) w skanerze\n" +" -d, --debug w³±czenie trybu diagnostycznego (debug) w " +"skanerze\n" " -b, --backup zapisanie informacji o zapamiêtywaniu do %s\n" " -p, --perf-report wypisanie raportu o wydajno¶ci na stderr\n" -" -s, --nodefault pominiêcie domy¶lnej regu³y ECHO dla niedopasowanego\n" +" -s, --nodefault pominiêcie domy¶lnej regu³y ECHO dla " +"niedopasowanego\n" " tekstu\n" " -T, --trace %s powinien dzia³aæ w trybie ¶ledzenia\n" " -w, --nowarn nie generowanie ostrze¿eñ\n" -" -v, --verbose wypisanie podsumowania statystyk skanera na stdout\n" +" -v, --verbose wypisanie podsumowania statystyk skanera na " +"stdout\n" "\n" "Pliki:\n" " -o, --outfile=PLIK podanie nazwy pliku wyj¶ciowego\n" @@ -619,11 +636,13 @@ msgstr "" "Zachowanie skanera:\n" " -7, --7bit wygenerowanie skanera 7-bitowego\n" " -8, --8bit wygenerowanie skanera 8-bitowego\n" -" -B, --batch wygenerowanie skanera wsadowego (przeciwieñstwo -I)\n" +" -B, --batch wygenerowanie skanera wsadowego (przeciwieñstwo -" +"I)\n" " -i, --case-insensitive ignorowanie wielko¶ci liter we wzorcach\n" " -l, --lex-compat maksymalna kompatybilno¶æ z oryginalnym leksem\n" " -X, --posix-compat maksymalna kompatybilno¶æ z leksem POSIX\n" -" -I, --interactive wygenerowanie skanera interaktywnego (przeciw. -B)\n" +" -I, --interactive wygenerowanie skanera interaktywnego (przeciw. -" +"B)\n" " --yylineno ¶ledzenie liczby linii w yylineno\n" "\n" "Generowany kod:\n" @@ -647,51 +666,52 @@ msgstr "" " -h, --help wy¶wietlenie tego pomocnego opisu\n" " -V, --version podanie wersji programu %s\n" -#: misc.c:65 +#: src/misc.c:64 msgid "allocation of sko_stack failed" msgstr "przydzielenie sko_stack nie powiod³o siê" -#: misc.c:102 misc.c:128 +#: src/misc.c:100 #, c-format msgid "name \"%s\" ridiculously long" msgstr "nazwa \"%s\" jest ¶miesznie d³uga" -#: misc.c:177 +#: src/misc.c:155 msgid "memory allocation failed in allocate_array()" msgstr "nie uda³o siê przydzieliæ pamiêci w allocate_array()" -#: misc.c:230 +#: src/misc.c:205 #, c-format msgid "bad character '%s' detected in check_char()" msgstr "b³êdny znak '%s' usuniêty w check_char()" -#: misc.c:235 +#: src/misc.c:210 #, c-format msgid "scanner requires -8 flag to use the character %s" msgstr "skaner wymaga flagi -8 aby u¿yæ znaku %s" -#: misc.c:268 -msgid "dynamic memory failure in copy_string()" -msgstr "niepowodzenie dynamicznej pamiêci w copy_string()" +#: src/misc.c:229 +#, fuzzy +msgid "memory allocation failure in xstrdup()" +msgstr "nie uda³o siê przydzieliæ pamiêci w allocate_array()" -#: misc.c:367 +#: src/misc.c:303 #, c-format msgid "%s: fatal internal error, %s\n" msgstr "%s: krytyczny b³±d wewnêtrzny: %s\n" -#: misc.c:803 +#: src/misc.c:671 msgid "attempt to increase array size failed" msgstr "próba zwiêkszenia rozmiaru tablicy nie powiod³a siê" -#: misc.c:930 +#: src/misc.c:795 msgid "bad line in skeleton file" msgstr "b³êdna linia w pliku szablonu" -#: misc.c:979 +#: src/misc.c:845 msgid "memory allocation failed in yy_flex_xmalloc()" msgstr "nie uda³o siê przydzieliæ pamiêci w yy_flex_xmalloc()" -#: nfa.c:104 +#: src/nfa.c:100 #, c-format msgid "" "\n" @@ -702,226 +722,243 @@ msgstr "" "\n" "********** pocz±tek zrzutu NFA ze stanem pocz±tkowym %d\n" -#: nfa.c:115 +#: src/nfa.c:111 #, c-format msgid "state # %4d\t" msgstr "stan # %4d\t" -#: nfa.c:130 +#: src/nfa.c:126 #, c-format msgid "********** end of dump\n" msgstr "********** koniec zrzutu\n" -#: nfa.c:174 +#: src/nfa.c:169 msgid "empty machine in dupmachine()" msgstr "pusty automat w dupmachine()" -#: nfa.c:240 +#: src/nfa.c:234 #, c-format msgid "Variable trailing context rule at line %d\n" msgstr "Regu³a ze zmiennym koñcowym kontekstem w linii %d\n" -#: nfa.c:353 +#: src/nfa.c:357 msgid "bad state type in mark_beginning_as_normal()" msgstr "b³êdny typ stanu w mark_beginning_as_normal()" -#: nfa.c:598 +#: src/nfa.c:595 #, c-format msgid "input rules are too complicated (>= %d NFA states)" msgstr "regu³y wej¶ciowe s± zbyt skomplikowane (>= %d stanów NFA)" -#: nfa.c:677 +#: src/nfa.c:673 msgid "found too many transitions in mkxtion()" msgstr "znaleziono zbyt du¿o przej¶æ w mkxtion()" -#: nfa.c:703 +#: src/nfa.c:699 #, c-format msgid "too many rules (> %d)!" msgstr "zbyt du¿o regu³ (> %d)!" -#: parse.y:159 +#: src/parse.y:159 msgid "unknown error processing section 1" msgstr "nieznany b³±d podczas przetwarzania sekcji 1" -#: parse.y:184 parse.y:351 +#: src/parse.y:184 src/parse.y:353 msgid "bad start condition list" msgstr "b³êdna lista warunków pocz±tkowych" -#: parse.y:315 +#: src/parse.y:204 +msgid "Prefix must not contain [ or ]" +msgstr "" + +#: src/parse.y:317 msgid "unrecognized rule" msgstr "nierozpoznana regu³a" -#: 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 "koñcowy kontekst u¿yty dwukrotnie" -#: 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 "b³êdne warto¶ci iteracji" -#: 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 "warto¶æ iteracji musi byæ dodatnia" -#: 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 "przedzia³ znaków [%c-%c] jest niejednoznaczny w skanerze ignoruj±cym wielko¶æ liter" +msgstr "" +"przedzia³ znaków [%c-%c] jest niejednoznaczny w skanerze ignoruj±cym " +"wielko¶æ liter" -#: parse.y:819 +#: src/parse.y:821 msgid "negative range in character class" msgstr "ujemny przedzia³ w klasie znaków" -#: parse.y:916 +#: src/parse.y:918 msgid "[:^lower:] is ambiguous in case insensitive scanner" -msgstr "[:^lower:] jest niejednoznaczne w przypadku skanera ignoruj±cego wielko¶æ liter" +msgstr "" +"[:^lower:] jest niejednoznaczne w przypadku skanera ignoruj±cego wielko¶æ " +"liter" -#: parse.y:922 +#: src/parse.y:924 msgid "[:^upper:] ambiguous in case insensitive scanner" -msgstr "[:^upper:] jest niejednoznaczne w przypadku skanera ignoruj±cego wielko¶æ liter" +msgstr "" +"[:^upper:] jest niejednoznaczne w przypadku skanera ignoruj±cego wielko¶æ " +"liter" -#: 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 "Linia wej¶ciowa zbyt d³uga\n" -#: scan.l:161 +#: src/scan.l:183 #, c-format msgid "malformed '%top' directive" msgstr "¼le sformu³owana dyrektywa '%top'" -#: scan.l:183 +#: src/scan.l:205 #, no-c-format msgid "unrecognized '%' directive" msgstr "nierozpoznana dyrektywa '%'" -#: scan.l:192 +#: src/scan.l:214 msgid "Definition name too long\n" msgstr "Nazwa definizji zbyt d³uga\n" -#: scan.l:284 +#: src/scan.l:309 msgid "Unmatched '{'" msgstr "Niesparowany '{'" -#: scan.l:300 +#: src/scan.l:325 #, c-format msgid "Definition value for {%s} too long\n" msgstr "Definicja warto¶ci dla {%s} zbyt d³uga\n" -#: scan.l:317 +#: src/scan.l:342 msgid "incomplete name definition" msgstr "niekompletna definicja nazwy" -#: scan.l:443 +#: src/scan.l:467 msgid "Option line too long\n" msgstr "Linia opcji zbyt d³uga\n" -#: scan.l:451 +#: src/scan.l:475 #, c-format msgid "unrecognized %%option: %s" msgstr "nierozpoznane %%option: %s" -#: scan.l:633 scan.l:800 +#: src/scan.l:659 src/scan.l:832 msgid "bad character class" msgstr "b³êdna klasa znaków" -#: scan.l:683 +#: src/scan.l:709 #, c-format msgid "undefined definition {%s}" msgstr "niezdefiniowana definicja {%s}" -#: scan.l:755 +#: src/scan.l:772 +msgid "unbalanced parenthesis" +msgstr "" + +#: src/scan.l:787 #, c-format msgid "bad <start condition>: %s" msgstr "b³êdny <warunek pocz±tkowy>: %s" -#: scan.l:768 +#: src/scan.l:800 msgid "missing quote" msgstr "brak cudzys³owu" -#: scan.l:834 +#: src/scan.l:866 #, c-format msgid "bad character class expression: %s" msgstr "b³êdne wyra¿enie klasy znaków: %s" -#: scan.l:856 +#: src/scan.l:888 msgid "bad character inside {}'s" msgstr "b³êdny znak wewn±trz {}" -#: scan.l:862 +#: src/scan.l:894 msgid "missing }" msgstr "brak }" -#: scan.l:940 +#: src/scan.l:972 msgid "EOF encountered inside an action" msgstr "EOF napotkany wewn±trz akcji" -#: scan.l:945 +#: src/scan.l:977 msgid "EOF encountered inside pattern" msgstr "EOF napotkany wewn±trz wzorca" -#: scan.l:967 +#: src/scan.l:1010 #, c-format msgid "bad character: %s" msgstr "b³êdny znak: %s" -#: scan.l:996 +#: src/scan.l:1038 #, c-format msgid "can't open %s" msgstr "nie mo¿na otworzyæ %s" -#: scanopt.c:291 +#: src/scanopt.c:259 #, c-format msgid "Usage: %s [OPTIONS]...\n" msgstr "Sk³adnia: %s [OPCJE]...\n" -#: scanopt.c:564 +#: src/scanopt.c:524 #, c-format msgid "option `%s' doesn't allow an argument\n" msgstr "opcja `%s' nie przyjmuje argumentu\n" -#: scanopt.c:569 +#: src/scanopt.c:529 #, c-format msgid "option `%s' requires an argument\n" msgstr "opcja `%s' wymaga argumentu\n" -#: scanopt.c:573 +#: src/scanopt.c:533 #, c-format msgid "option `%s' is ambiguous\n" msgstr "opcja `%s' jest niejednoznaczna\n" -#: scanopt.c:577 +#: src/scanopt.c:537 #, c-format msgid "Unrecognized option `%s'\n" msgstr "Nierozpoznana opcja `%s'\n" -#: scanopt.c:581 +#: src/scanopt.c:541 #, c-format msgid "Unknown error=(%d)\n" msgstr "Nieznany b³±d=(%d)\n" -#: sym.c:100 +#: src/sym.c:92 msgid "symbol table memory allocation failed" msgstr "nie uda³o siê przydzieliæ pamiêci dla tablicy symboli" -#: sym.c:202 +#: src/sym.c:183 msgid "name defined twice" msgstr "nazwa zdefiniowana dwukrotnie" -#: sym.c:253 +#: src/sym.c:231 #, c-format msgid "start condition %s declared twice" msgstr "warunek pocz±tkowy %s zadeklarowany dwukrotnie" -#: yylex.c:56 +#: src/yylex.c:57 msgid "premature EOF" msgstr "przedwczesny EOF" -#: yylex.c:198 +#: src/yylex.c:200 #, c-format msgid "End Marker\n" msgstr "Znacznik koñca\n" -#: yylex.c:204 +#: src/yylex.c:206 #, c-format msgid "*Something Weird* - tok: %d val: %d\n" msgstr "*Co¶ dziwnego* - tok: %d val: %d\n" + +#~ msgid "dynamic memory failure in copy_string()" +#~ msgstr "niepowodzenie dynamicznej pamiêci w copy_string()" diff --git a/po/pt_BR.po b/po/pt_BR.po index 1d6db8a..fd9aa11 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -8,53 +8,55 @@ 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-11-27 08:09-0300\n" "Last-Translator: Rafael Ferreira <rafael.f.f1@gmail.com>\n" -"Language-Team: Brazilian Portuguese <ldpbr-translation@lists.sourceforge.net>\n" +"Language-Team: Brazilian Portuguese <ldpbr-translation@lists.sourceforge." +"net>\n" "Language: pt_BR\n" "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" "X-Generator: Poedit 1.5.7\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: buf.c:78 +#: src/buf.c:79 msgid "Allocation of buffer to print string failed" msgstr "A alocação de buffer para retornar string falhou" -#: buf.c:100 +#: src/buf.c:107 msgid "Allocation of buffer for line directive failed" msgstr "A alocação de buffer para diretiva de linha falhou" -#: buf.c:177 +#: src/buf.c:177 msgid "Allocation of buffer for m4 def failed" msgstr "A alocação de buffer para m4 def falhou" -#: buf.c:197 +#: src/buf.c:198 msgid "Allocation of buffer for m4 undef failed" msgstr "A alocação de buffer para m4 undef falhou" -#: dfa.c:61 +#: src/dfa.c:59 #, c-format msgid "State #%d is non-accepting -\n" msgstr "O estado #%d é não-aceita -\n" -#: dfa.c:124 +#: src/dfa.c:119 msgid "dangerous trailing context" msgstr "texto final perigoso" -#: dfa.c:166 +#: src/dfa.c:159 #, c-format msgid " associated rule line numbers:" msgstr " números de linha de regras associadas:" -#: dfa.c:202 +#: src/dfa.c:193 #, c-format msgid " out-transitions: " msgstr " transações de saÃda: " -#: dfa.c:210 +#: src/dfa.c:201 #, c-format msgid "" "\n" @@ -63,11 +65,11 @@ msgstr "" "\n" " transições presas: Fim de Arquivo " -#: dfa.c:341 +#: src/dfa.c:331 msgid "consistency check failed in epsclosure()" msgstr "verificação de consistência falhou em epsclosure()" -#: dfa.c:429 +#: src/dfa.c:419 msgid "" "\n" "\n" @@ -79,24 +81,24 @@ msgstr "" "Despejo DFA:\n" "\n" -#: dfa.c:604 +#: src/dfa.c:587 msgid "could not create unique end-of-buffer state" msgstr "não foi possÃvel criar um estado único de final de buffer" -#: dfa.c:625 +#: src/dfa.c:608 #, c-format msgid "state # %d:\n" msgstr "estado # %d:\n" -#: dfa.c:785 +#: src/dfa.c:768 msgid "Could not write yynxt_tbl[][]" msgstr "Não foi possÃvel escrever yynxt_tbl[][]" -#: dfa.c:1049 +#: src/dfa.c:1028 msgid "bad transition character detected in sympartition()" msgstr "caractere de transição inválido detectado em sympartition()" -#: gen.c:478 +#: src/gen.c:480 msgid "" "\n" "\n" @@ -108,29 +110,29 @@ msgstr "" "Classes de Equivalência:\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 "estado # %d aceita: [%d]\n" -#: gen.c:1110 +#: src/gen.c:1115 #, c-format msgid "state # %d accepts: " msgstr "estado # %d aceita: " -#: gen.c:1157 +#: src/gen.c:1162 msgid "Could not write yyacclist_tbl" msgstr "Não foi possÃvel escrever yyacclist_tbl" -#: gen.c:1233 +#: src/gen.c:1236 msgid "Could not write yyacc_tbl" msgstr "Não foi possÃvel escrever 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 "Não foi possÃvel escrever ecstbl" -#: gen.c:1271 +#: src/gen.c:1271 msgid "" "\n" "\n" @@ -140,392 +142,409 @@ msgstr "" "\n" "Classes de Meta-Equivalência:\n" -#: gen.c:1293 +#: src/gen.c:1293 msgid "Could not write yymeta_tbl" msgstr "Não foi possÃvel escrever yymeta_tbl" -#: gen.c:1354 +#: src/gen.c:1352 msgid "Could not write yybase_tbl" msgstr "Não foi possÃvel escrever yybase_tbl" -#: gen.c:1388 +#: src/gen.c:1384 msgid "Could not write yydef_tbl" msgstr "Não foi possÃvel escrever yydef_tbl" -#: gen.c:1428 +#: src/gen.c:1422 msgid "Could not write yynxt_tbl" msgstr "Não foi possÃvel escrever yynxt_tbl" -#: gen.c:1464 +#: src/gen.c:1456 msgid "Could not write yychk_tbl" msgstr "Não foi possÃvel escrever yychk_tbl" -#: gen.c:1618 gen.c:1647 +#: src/gen.c:1608 src/gen.c:1637 msgid "Could not write ftbl" msgstr "Não foi possÃvel escrever ftbl" -#: gen.c:1624 +#: src/gen.c:1614 msgid "Could not write ssltbl" msgstr "Não foi possÃvel escrever ssltbl" -#: gen.c:1675 +#: src/gen.c:1665 msgid "Could not write eoltbl" msgstr "Não foi possÃvel escrever eoltbl" -#: gen.c:1735 +#: src/gen.c:1722 msgid "Could not write yynultrans_tbl" msgstr "Não foi possÃvel escrever yynultrans_tbl" -#: main.c:189 +#: src/main.c:178 msgid "rule cannot be matched" msgstr "aplicação da regra não gerou nenhum resultado" -#: main.c:194 +#: src/main.c:183 msgid "-s option given but default rule can be matched" msgstr "a opção -s foi fornecida, mas a regra padrão pode ser aplicada" -#: main.c:234 +#: src/main.c:221 msgid "Can't use -+ with -l option" msgstr "Não é possÃvel usar -+ com a opção -l" -#: main.c:237 +#: src/main.c:224 msgid "Can't use -f or -F with -l option" msgstr "Não é possÃvel usar -f ou -F com a opção -l" -#: main.c:241 +#: src/main.c:228 msgid "Can't use --reentrant or --bison-bridge with -l option" msgstr "Não é possÃvel usar --reentrant ou --bison-bridge com a opção -l" -#: main.c:278 +#: src/main.c:260 msgid "-Cf/-CF and -Cm don't make sense together" msgstr "-Cf/-CF e -Cm não fazem sentido juntos" -#: main.c:281 +#: src/main.c:263 msgid "-Cf/-CF and -I are incompatible" msgstr "-Cf/-CF e -I são incompatÃveis" -#: main.c:285 +#: src/main.c:267 msgid "-Cf/-CF are incompatible with lex-compatibility mode" msgstr "-Cf/-CF são incompatÃveis com o modo de compatibilidade lex" -#: main.c:290 +#: src/main.c:272 msgid "-Cf and -CF are mutually exclusive" msgstr "-Cf e -CF são mutuamente exclusivos" -#: main.c:294 +#: src/main.c:276 msgid "Can't use -+ with -CF option" msgstr "Não é possÃvel usar -+ com a opção -CF" -#: main.c:297 +#: src/main.c:279 #, c-format msgid "%array incompatible with -+ option" msgstr "%array é incompatÃvel com a opção -+" -#: main.c:302 +#: src/main.c:284 msgid "Options -+ and --reentrant are mutually exclusive." msgstr "As opções -+ e --reentrant são mutuamente exclusivas." -#: main.c:305 +#: src/main.c:287 msgid "bison bridge not supported for the C++ scanner." msgstr "sem suporte à ponte bison pelo scanner de C++." -#: main.c:360 main.c:406 +#: src/main.c:336 src/main.c:419 #, c-format msgid "could not create %s" msgstr "não foi possÃvel criar %s" -#: main.c:419 +#: src/main.c:431 msgid "could not write tables header" msgstr "não foi possÃvel escrever o cabeçalho das tabelas" -#: main.c:423 +#: src/main.c:435 #, c-format msgid "can't open skeleton file %s" msgstr "não é possÃvel abrir o arquivo esqueleto %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 "a alocação de definição de macro falhou" -#: main.c:507 +#: src/main.c:521 #, c-format msgid "input error reading skeleton file %s" msgstr "erro lendo o arquivo esqueleto %s" -#: main.c:511 +#: src/main.c:525 #, c-format msgid "error closing skeleton file %s" msgstr "erro fechando o arquivo esqueleto %s" -#: main.c:696 +#: src/main.c:709 #, c-format msgid "error creating header file %s" msgstr "erro ao criar o arquivo cabeçalho %s" -#: main.c:704 +#: src/main.c:717 #, c-format msgid "error writing output file %s" msgstr "erro ao gravar o arquivo de saÃda %s" -#: main.c:708 +#: src/main.c:721 #, c-format msgid "error closing output file %s" msgstr "erro ao fechar o arquivo de saÃda %s" -#: main.c:712 +#: src/main.c:725 #, c-format msgid "error deleting output file %s" msgstr "erro ao remover o arquivo de saÃda %s" -#: main.c:719 +#: src/main.c:732 #, c-format msgid "No backing up.\n" msgstr "ImpossÃvel restaurar.\n" -#: main.c:723 +#: src/main.c:736 #, c-format msgid "%d backing up (non-accepting) states.\n" msgstr "%d fazendo cópia de segurança de estados (não-aceita).\n" -#: main.c:727 +#: src/main.c:740 #, c-format msgid "Compressed tables always back up.\n" msgstr "Tabelas compactadas sempre têm cópias de segurança.\n" -#: main.c:730 +#: src/main.c:743 #, c-format msgid "error writing backup file %s" msgstr "erro ao gravar a cópia de segurança %s" -#: main.c:734 +#: src/main.c:747 #, c-format msgid "error closing backup file %s" msgstr "erro ao fechar a cópia de segurança %s" -#: main.c:739 +#: src/main.c:752 #, c-format msgid "%s version %s usage statistics:\n" msgstr "%s versão %s estatÃsticas de uso:\n" -#: main.c:742 +#: src/main.c:755 #, c-format msgid " scanner options: -" msgstr " opções de scanner: -" -#: main.c:821 +#: src/main.c:834 #, c-format msgid " %d/%d NFA states\n" msgstr " %d/%d estados NFA\n" -#: main.c:823 +#: src/main.c:836 #, c-format msgid " %d/%d DFA states (%d words)\n" msgstr " %d/%d estados DFA (%d palavras)\n" -#: main.c:825 +#: src/main.c:838 #, c-format msgid " %d rules\n" msgstr " %d regras\n" -#: main.c:830 +#: src/main.c:843 #, c-format msgid " No backing up\n" msgstr " Sem cópia de segurança\n" -#: main.c:834 +#: src/main.c:847 #, c-format msgid " %d backing-up (non-accepting) states\n" msgstr " %d fazendo cópia de segurança de estados (não-aceita)\n" -#: main.c:839 +#: src/main.c:852 #, c-format msgid " Compressed tables always back-up\n" msgstr " Tabelas compactadas sempre têm cópias de segurança\n" -#: main.c:843 +#: src/main.c:856 #, c-format msgid " Beginning-of-line patterns used\n" msgstr " Padrões de inÃcio-de-linha usados\n" -#: main.c:845 +#: src/main.c:858 #, c-format msgid " %d/%d start conditions\n" msgstr " %d/%d condições de inÃcio\n" -#: main.c:849 +#: src/main.c:862 #, c-format msgid " %d epsilon states, %d double epsilon states\n" msgstr " %d estados epsilon, %d estados epsilon duplo\n" -#: main.c:853 +#: src/main.c:866 #, c-format msgid " no character classes\n" msgstr " nenhuma classe de caracteres\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 classes de caracteres precisaram de %d/%d palavras de armazenamento, %d reusadas\n" +msgstr "" +" %d/%d classes de caracteres precisaram de %d/%d palavras de armazenamento, " +"%d reusadas\n" -#: main.c:862 +#: src/main.c:875 #, c-format msgid " %d state/nextstate pairs created\n" msgstr " %d pares estado/próximoestado criados\n" -#: main.c:865 +#: src/main.c:878 #, c-format msgid " %d/%d unique/duplicate transitions\n" msgstr " %d/%d transições únicas/duplicadas\n" -#: main.c:870 +#: src/main.c:883 #, c-format msgid " %d table entries\n" msgstr " %d entradas de tabela\n" -#: main.c:878 +#: src/main.c:891 #, c-format msgid " %d/%d base-def entries created\n" msgstr " %d/%d entradas base-def criadas\n" -#: main.c:882 +#: src/main.c:895 #, c-format msgid " %d/%d (peak %d) nxt-chk entries created\n" msgstr " %d/%d (pico %d) entradas nxt-chk criadas\n" -#: main.c:886 +#: src/main.c:899 #, c-format msgid " %d/%d (peak %d) template nxt-chk entries created\n" msgstr " %d/%d (pico %d) modelos de entradas nxt-chk criadas\n" -#: main.c:890 +#: src/main.c:903 #, c-format msgid " %d empty table entries\n" msgstr " %d entradas vazias na tabela\n" -#: main.c:892 +#: src/main.c:905 #, c-format msgid " %d protos created\n" msgstr " %d protos criados\n" -#: main.c:895 +#: src/main.c:908 #, c-format msgid " %d templates created, %d uses\n" msgstr " %d modelos criados, %d usos\n" -#: main.c:903 +#: src/main.c:916 #, c-format msgid " %d/%d equivalence classes created\n" msgstr " %d/%d classes de equivalência criadas\n" -#: main.c:911 +#: src/main.c:924 #, c-format msgid " %d/%d meta-equivalence classes created\n" msgstr " %d/%d classes de meta-equivalência criadas\n" -#: main.c:917 +#: src/main.c:930 #, c-format msgid " %d (%d saved) hash collisions, %d DFAs equal\n" msgstr " %d (%d salvas) colisões de hash, %d DFAs iguais\n" -#: main.c:919 +#: src/main.c:932 #, c-format msgid " %d sets of reallocations needed\n" msgstr " %d conjuntos de realocação necessários\n" -#: main.c:921 +#: src/main.c:934 #, c-format msgid " %d total table entries needed\n" msgstr " %d total de entradas de tabela necessárias\n" -#: main.c:998 +#: src/main.c:1008 #, c-format msgid "Internal error. flexopts are malformed.\n" msgstr "Erro interno. flexopts estão malformados.\n" -#: main.c:1008 +#: src/main.c:1018 #, c-format msgid "Try `%s --help' for more information.\n" msgstr "Tente \"%s --help\" para maiores informações.\n" -#: main.c:1065 +#: src/main.c:1075 #, c-format msgid "unknown -C option '%c'" msgstr "opção -C \"%c\" desconhecida" -#: 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 "erro fatal de análise" -#: main.c:1501 +#: src/main.c:1508 #, c-format msgid "could not create backing-up info file %s" -msgstr "não foi possÃvel criar arquivo de cópia de segurança das informações %s" +msgstr "" +"não foi possÃvel criar arquivo de cópia de segurança das informações %s" -#: main.c:1522 +#: src/main.c:1529 #, c-format msgid "-l AT&T lex compatibility option entails a large performance penalty\n" -msgstr "a opção de compatibilidade com lex da AT&T \"-l\" acarreta em uma grande penalidade na performance\n" +msgstr "" +"a opção de compatibilidade com lex da AT&T \"-l\" acarreta em uma grande " +"penalidade na performance\n" -#: main.c:1525 +#: src/main.c:1532 #, c-format msgid " and may be the actual source of other reported performance penalties\n" -msgstr " e pode ser a fonte real de outras penalidades de performance reportadas\n" +msgstr "" +" e pode ser a fonte real de outras penalidades de performance reportadas\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" -msgstr "%%option yylineno acarreta em uma penalidade na performance APENAS em regras que podem bater caracteres de nova linha\n" +msgid "" +"%%option yylineno entails a performance penalty ONLY on rules that can match " +"newline characters\n" +msgstr "" +"%%option yylineno acarreta em uma penalidade na performance APENAS em regras " +"que podem bater caracteres de nova linha\n" -#: main.c:1538 +#: src/main.c:1545 #, c-format msgid "-I (interactive) entails a minor performance penalty\n" msgstr "-I (interativo) acarreta em uma pequena penalidade na performance\n" -#: main.c:1543 +#: src/main.c:1550 #, c-format msgid "yymore() entails a minor performance penalty\n" msgstr "yymore() acarreta em uma pequena penalidade na performance\n" -#: main.c:1549 +#: src/main.c:1556 #, c-format msgid "REJECT entails a large performance penalty\n" msgstr "REJECT acarreta em uma grande penalidade na performance\n" -#: main.c:1554 +#: src/main.c:1561 #, c-format msgid "Variable trailing context rules entail a large performance penalty\n" -msgstr "Variável seguindo regras de contexto implicam em grande perda de performance\n" +msgstr "" +"Variável seguindo regras de contexto implicam em grande perda de " +"performance\n" -#: main.c:1566 +#: src/main.c:1573 msgid "REJECT cannot be used with -f or -F" msgstr "REJECT não pode ser usado com -f ou -F" -#: main.c:1569 +#: src/main.c:1576 #, c-format msgid "%option yylineno cannot be used with REJECT" msgstr "%option yylineno não pode ser usada com REJECT" -#: main.c:1572 +#: src/main.c:1579 msgid "variable trailing context rules cannot be used with -f or -F" -msgstr "variáveis seguindo regras de contexto não podem ser usadas com -f ou -F" +msgstr "" +"variáveis seguindo regras de contexto não podem ser usadas com -f ou -F" -#: main.c:1695 +#: src/main.c:1704 #, c-format msgid "%option yyclass only meaningful for C++ scanners" msgstr "%option yyclass só tem sentido para scanners C++" -#: main.c:1802 +#: src/main.c:1791 #, c-format msgid "Usage: %s [OPTIONS] [FILE]...\n" msgstr "Uso: %s [OPÇÕES] [ARQUIVO]...\n" -#: main.c:1805 -#, c-format +#: src/main.c:1794 +#, fuzzy, c-format msgid "" "Generates programs that perform pattern-matching on text.\n" "\n" @@ -548,13 +567,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" @@ -576,8 +598,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" @@ -598,7 +618,8 @@ msgstr "" " -Cm, --meta-ecs construct meta-equivalence classes\n" " -Cr, --read use read() em vez da stdio para a entrada do scanner\n" " -f, --full gera scanner grande e rápido. O mesmo que -Cfr\n" -" -F, --fast usa representação de tabela alternativa. O mesmo que -CFr\n" +" -F, --fast usa representação de tabela alternativa. O mesmo que -" +"CFr\n" " -Cem compressão padrão (mesmo que --ecs --meta-ecs)\n" "\n" "Depuração:\n" @@ -609,7 +630,8 @@ msgstr "" " correspondente\n" " -T, --trace %s deveria executar em modo de ratro\n" " -w, --nowarn não gera avisos\n" -" -v, --verbose escreve um resumo das estatÃsticas do scanner para\n" +" -v, --verbose escreve um resumo das estatÃsticas do scanner " +"para\n" " stdout\n" "\n" "Arquivos:\n" @@ -653,51 +675,52 @@ msgstr "" " -h, --help produz esta mensagem de ajuda\n" " -V, --version informa a versão do %s\n" -#: misc.c:65 +#: src/misc.c:64 msgid "allocation of sko_stack failed" msgstr "alocação de sko_stack falhou" -#: misc.c:102 misc.c:128 +#: src/misc.c:100 #, c-format msgid "name \"%s\" ridiculously long" msgstr "nome \"%s\" ridiculamente longo" -#: misc.c:177 +#: src/misc.c:155 msgid "memory allocation failed in allocate_array()" msgstr "alocação de memória falhou em allocate_array()" -#: misc.c:230 +#: src/misc.c:205 #, c-format msgid "bad character '%s' detected in check_char()" msgstr "caractere inválido \"%s\" detectado em check_char()" -#: misc.c:235 +#: src/misc.c:210 #, c-format msgid "scanner requires -8 flag to use the character %s" msgstr "o scanner precisa da opção -8 para usar o caractere %s" -#: misc.c:268 -msgid "dynamic memory failure in copy_string()" -msgstr "falha dinâmica de memória em copy_string()" +#: src/misc.c:229 +#, fuzzy +msgid "memory allocation failure in xstrdup()" +msgstr "alocação de memória falhou em allocate_array()" -#: misc.c:367 +#: src/misc.c:303 #, c-format msgid "%s: fatal internal error, %s\n" msgstr "%s: erro interno fatal, %s\n" -#: misc.c:803 +#: src/misc.c:671 msgid "attempt to increase array size failed" msgstr "tentativa de aumentar o tamanho do vetor falhou" -#: misc.c:930 +#: src/misc.c:795 msgid "bad line in skeleton file" msgstr "linha inválida no arquivo de esqueleto" -#: misc.c:979 +#: src/misc.c:845 msgid "memory allocation failed in yy_flex_xmalloc()" msgstr "alocação de memória falhou em yy_flex_xmalloc()" -#: nfa.c:104 +#: src/nfa.c:100 #, c-format msgid "" "\n" @@ -708,235 +731,248 @@ msgstr "" "\n" "********** iniciando despejo de nfa com estado inicial %d\n" -#: nfa.c:115 +#: src/nfa.c:111 #, c-format msgid "state # %4d\t" msgstr "estado # %4d\t" -#: nfa.c:130 +#: src/nfa.c:126 #, c-format msgid "********** end of dump\n" msgstr "********** final do despejo\n" -#: nfa.c:174 +#: src/nfa.c:169 msgid "empty machine in dupmachine()" msgstr "máquina vazia em dupmachine()" -#: nfa.c:240 +#: src/nfa.c:234 #, c-format msgid "Variable trailing context rule at line %d\n" msgstr "Regra de final de contexto variável na linha %d\n" -#: nfa.c:353 +#: src/nfa.c:357 msgid "bad state type in mark_beginning_as_normal()" msgstr "estado de tipo inválido em mark_beginning_as_normal()" -#: nfa.c:598 +#: src/nfa.c:595 #, c-format msgid "input rules are too complicated (>= %d NFA states)" msgstr "regras de entrada são muito complicadas (>= %d estados NFA)" -#: nfa.c:677 +#: src/nfa.c:673 msgid "found too many transitions in mkxtion()" msgstr "muitas transições em mkxtion()" -#: nfa.c:703 +#: src/nfa.c:699 #, c-format msgid "too many rules (> %d)!" msgstr "muitas regras (> %d)!" -#: parse.y:159 +#: src/parse.y:159 msgid "unknown error processing section 1" msgstr "erro desconhecido processando a seção 1" -#: parse.y:184 parse.y:351 +#: src/parse.y:184 src/parse.y:353 msgid "bad start condition list" msgstr "lista de condições de inÃcio inválida" -#: parse.y:315 +#: src/parse.y:204 +msgid "Prefix must not contain [ or ]" +msgstr "" + +#: src/parse.y:317 msgid "unrecognized rule" msgstr "regra não reconhecida" -#: 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 "contexto final usado duas vezes" -#: 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 "valores de iteração inválidos" -#: 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 "valor de iteração deve ser positivo" -#: 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 "a faixa de caracteres [%c-%c] é ambÃgua em um scanner \"case-insensitive\"" +msgstr "" +"a faixa de caracteres [%c-%c] é ambÃgua em um scanner \"case-insensitive\"" -#: parse.y:819 +#: src/parse.y:821 msgid "negative range in character class" msgstr "faixa negativa na classe de caracteres" -#: parse.y:916 +#: src/parse.y:918 msgid "[:^lower:] is ambiguous in case insensitive scanner" msgstr "[:^lower:] é ambÃgua em um scanner \"case-insensitive\"" -#: parse.y:922 +#: src/parse.y:924 msgid "[:^upper:] ambiguous in case insensitive scanner" msgstr "[:^upper:] é ambÃgua em um scanner \"case-insensitive\"" -#: 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 "Linha de entrada muito longa\n" -#: scan.l:161 +#: src/scan.l:183 #, c-format msgid "malformed '%top' directive" msgstr "diretiva \"%top\" malformada" -#: scan.l:183 +#: src/scan.l:205 #, no-c-format msgid "unrecognized '%' directive" msgstr "diretiva \"%\" não reconhecida" -#: scan.l:192 +#: src/scan.l:214 msgid "Definition name too long\n" msgstr "Nome de definição muito longo\n" -#: scan.l:284 +#: src/scan.l:309 msgid "Unmatched '{'" msgstr "'{' sem fechamento" -#: scan.l:300 +#: src/scan.l:325 #, c-format msgid "Definition value for {%s} too long\n" msgstr "Valor de definição para {%s} muito longo\n" -#: scan.l:317 +#: src/scan.l:342 msgid "incomplete name definition" msgstr "definição de nome incompleta" -#: scan.l:443 +#: src/scan.l:467 msgid "Option line too long\n" msgstr "Linha de opção muito longa\n" -#: scan.l:451 +#: src/scan.l:475 #, c-format msgid "unrecognized %%option: %s" msgstr "%%option não reconhecida: %s" -#: scan.l:633 scan.l:800 +#: src/scan.l:659 src/scan.l:832 msgid "bad character class" msgstr "classe de caractere inválida" -#: scan.l:683 +#: src/scan.l:709 #, c-format msgid "undefined definition {%s}" msgstr "definição indefinida {%s}" -#: scan.l:755 +#: src/scan.l:772 +msgid "unbalanced parenthesis" +msgstr "" + +#: src/scan.l:787 #, c-format msgid "bad <start condition>: %s" msgstr "<condição de inÃcio> inválida: %s" -#: scan.l:768 +#: src/scan.l:800 msgid "missing quote" msgstr "faltou aspa" -#: scan.l:834 +#: src/scan.l:866 #, c-format msgid "bad character class expression: %s" msgstr "expressão de classe de caractere inválida: %s" -#: scan.l:856 +#: src/scan.l:888 msgid "bad character inside {}'s" msgstr "caracatere inválido entre {}'s" -#: scan.l:862 +#: src/scan.l:894 msgid "missing }" msgstr "faltou }" -#: scan.l:940 +#: src/scan.l:972 msgid "EOF encountered inside an action" msgstr "Fim de Arquivo encontrado dentro de uma ação" -#: scan.l:945 +#: src/scan.l:977 msgid "EOF encountered inside pattern" msgstr "Fim de Arquivo encontrado dentro do padrão" -#: scan.l:967 +#: src/scan.l:1010 #, c-format msgid "bad character: %s" msgstr "caracter inválido: %s" -#: scan.l:996 +#: src/scan.l:1038 #, c-format msgid "can't open %s" msgstr "não foi possÃvel abrir %s" -#: scanopt.c:291 +#: src/scanopt.c:259 #, c-format msgid "Usage: %s [OPTIONS]...\n" msgstr "Uso: %s [OPÇÕES]...\n" -#: scanopt.c:564 +#: src/scanopt.c:524 #, c-format msgid "option `%s' doesn't allow an argument\n" msgstr "opção \"%s\" não permite argumentos\n" -#: scanopt.c:569 +#: src/scanopt.c:529 #, c-format msgid "option `%s' requires an argument\n" msgstr "opção \"%s\" requer um argumento\n" -#: scanopt.c:573 +#: src/scanopt.c:533 #, c-format msgid "option `%s' is ambiguous\n" msgstr "opção \"%s\" é ambÃgua\n" -#: scanopt.c:577 +#: src/scanopt.c:537 #, c-format msgid "Unrecognized option `%s'\n" msgstr "Opção \"%s\" desconhecida\n" -#: scanopt.c:581 +#: src/scanopt.c:541 #, c-format msgid "Unknown error=(%d)\n" msgstr "Erro desconhecido=(%d)\n" -#: sym.c:100 +#: src/sym.c:92 msgid "symbol table memory allocation failed" msgstr "alocação da memória da tabela de sÃmbolos falhou" -#: sym.c:202 +#: src/sym.c:183 msgid "name defined twice" msgstr "nome definido duas vezes" -#: sym.c:253 +#: src/sym.c:231 #, c-format msgid "start condition %s declared twice" msgstr "condição de inÃcio %s declarada duas vezes" -#: yylex.c:56 +#: src/yylex.c:57 msgid "premature EOF" msgstr "Fim-de-Arquivo prematuro" -#: yylex.c:198 +#: src/yylex.c:200 #, c-format msgid "End Marker\n" msgstr "Marca de Fim\n" -#: yylex.c:204 +#: src/yylex.c:206 #, c-format msgid "*Something Weird* - tok: %d val: %d\n" msgstr "*Algo Estranho* - tok: %d val: %d\n" +#~ msgid "dynamic memory failure in copy_string()" +#~ msgstr "falha dinâmica de memória em copy_string()" + #~ msgid "consistency check failed in symfollowset" #~ msgstr "verificação de consistência falhou em symfollowset" #~ msgid "Can't specify header option if writing to stdout." -#~ msgstr "ImpossÃvel especificar a opção de cabeçalho se escrevendo em stdout." +#~ msgstr "" +#~ "ImpossÃvel especificar a opção de cabeçalho se escrevendo em stdout." #~ msgid "unknown -R option '%c'" #~ msgstr "opção -R '%c' desconecida" @@ -5,32 +5,54 @@ msgid "" msgstr "" "Project-Id-Version: flex 2.5.31\n" -"POT-Creation-Date: 2003-04-01 11:33-0500\n" +"Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n" +"POT-Creation-Date: 2017-05-06 10:49-0400\n" "PO-Revision-Date: 2003-11-22 11:07+0200\n" "Last-Translator: Eugen Hoanca <eugenh@urban-grafx.ro>\n" "Language-Team: Romanian <translation-team-ro@lists.sourceforge.net>\n" +"Language: ro\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-2\n" "Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" -#: dfa.c:61 +#: src/buf.c:79 +msgid "Allocation of buffer to print string failed" +msgstr "" + +#: src/buf.c:107 +msgid "Allocation of buffer for line directive failed" +msgstr "" + +#: src/buf.c:177 +msgid "Allocation of buffer for m4 def failed" +msgstr "" + +#: src/buf.c:198 +msgid "Allocation of buffer for m4 undef failed" +msgstr "" + +#: src/dfa.c:59 #, c-format msgid "State #%d is non-accepting -\n" msgstr "Starea #%d este de neacceptat. -\n" -#: dfa.c:124 +#: src/dfa.c:119 msgid "dangerous trailing context" msgstr "context de sfârºit(trailing) periculos" -#: dfa.c:166 +#: src/dfa.c:159 +#, c-format msgid " associated rule line numbers:" msgstr " numerele de linie asociate regulii:" -#: dfa.c:202 +#: src/dfa.c:193 +#, c-format msgid " out-transitions: " msgstr " tranziþii exterioare(out): " -#: dfa.c:210 +#: src/dfa.c:201 +#, c-format msgid "" "\n" " jam-transitions: EOF " @@ -38,11 +60,11 @@ msgstr "" "\n" " tranziþii jam: EOF " -#: dfa.c:341 +#: src/dfa.c:331 msgid "consistency check failed in epsclosure()" msgstr "verificare de consistenþã eºuatã în epsclosure()" -#: dfa.c:429 +#: src/dfa.c:419 msgid "" "\n" "\n" @@ -54,28 +76,24 @@ msgstr "" "Rezultat(dump) DFA:\n" "\n" -#: dfa.c:604 +#: src/dfa.c:587 msgid "could not create unique end-of-buffer state" msgstr "nu am putut crea sfârºit unic pentru starea buffer-ului" -#: dfa.c:625 +#: src/dfa.c:608 #, c-format msgid "state # %d:\n" msgstr "stare # %d:\n" -#: dfa.c:800 +#: src/dfa.c:768 msgid "Could not write yynxt_tbl[][]" msgstr "Nu am putut scrie yynxt_tbl[][]" -#: dfa.c:1023 -msgid "consistency check failed in symfollowset" -msgstr "verificare de consistenþã eºuatã în symfollowset" - -#: dfa.c:1071 +#: src/dfa.c:1028 msgid "bad transition character detected in sympartition()" msgstr "caracter greºit de tranziþie detectat în sympartition()" -#: gen.c:484 +#: src/gen.c:480 msgid "" "\n" "\n" @@ -87,29 +105,29 @@ msgstr "" "Clase de Echivalenþã:\n" "\n" -#: gen.c:668 gen.c:697 gen.c:1221 +#: src/gen.c:669 src/gen.c:698 src/gen.c:1218 #, c-format msgid "state # %d accepts: [%d]\n" msgstr "starea # %d acceptã: [%d]\n" -#: gen.c:1116 +#: src/gen.c:1115 #, c-format msgid "state # %d accepts: " msgstr "starea # %d acceptã: " -#: gen.c:1163 +#: src/gen.c:1162 msgid "Could not write yyacclist_tbl" msgstr "Nu am putut scrie yyacclist_tbl" -#: gen.c:1239 +#: src/gen.c:1236 msgid "Could not write yyacc_tbl" msgstr "Nu am putut scrie yyacc_tbl" -#: gen.c:1254 gen.c:1639 gen.c:1662 +#: src/gen.c:1251 src/gen.c:1623 src/gen.c:1646 msgid "Could not write ecstbl" msgstr "Nu am putut scrie ecstbl" -#: gen.c:1277 +#: src/gen.c:1271 msgid "" "\n" "\n" @@ -119,374 +137,406 @@ msgstr "" "\n" "Clase de Meta-Echivalenþã:\n" -#: gen.c:1299 +#: src/gen.c:1293 msgid "Could not write yymeta_tbl" msgstr "Nu am putut scrie yymeta_tbl" -#: gen.c:1360 +#: src/gen.c:1352 msgid "Could not write yybase_tbl" msgstr "Nu am putut scrie yybase_tbl" -#: gen.c:1394 +#: src/gen.c:1384 msgid "Could not write yydef_tbl" msgstr "Nu am putut scrie yydef_tbl" -#: gen.c:1434 +#: src/gen.c:1422 msgid "Could not write yynxt_tbl" msgstr "Nu am putut scrie yynxt_tbl" -#: gen.c:1470 +#: src/gen.c:1456 msgid "Could not write yychk_tbl" msgstr "Nu am putut scrie yychk_tbl" -#: gen.c:1624 gen.c:1653 +#: src/gen.c:1608 src/gen.c:1637 msgid "Could not write ftbl" msgstr "Nu am putut scrie ftbl" -#: gen.c:1630 +#: src/gen.c:1614 msgid "Could not write ssltbl" msgstr "Nu am putut scrie ssltbl" -#: gen.c:1681 +#: src/gen.c:1665 msgid "Could not write eoltbl" msgstr "Nu am putut scrie eoltbl" -#: gen.c:1741 +#: src/gen.c:1722 msgid "Could not write yynultrans_tbl" msgstr "Nu am putut scrie yynultrans_tbl" -#: main.c:176 +#: src/main.c:178 msgid "rule cannot be matched" msgstr "regula nu se potriveºte cu nimic" -#: main.c:181 +#: src/main.c:183 msgid "-s option given but default rule can be matched" msgstr "a fost datã opþiunea -s dar regula implicitã se poate potrivi" -#: main.c:217 +#: src/main.c:221 msgid "Can't use -+ with -l option" msgstr "Nu se poate folosi -+ cu opþiunea -l" -#: main.c:220 +#: src/main.c:224 msgid "Can't use -f or -F with -l option" msgstr "Nu se poate folosi -f sau -F cu opþiunea -l" -#: main.c:224 +#: src/main.c:228 msgid "Can't use --reentrant or --bison-bridge with -l option" msgstr "Nu se poate folosi --reentrant sau --bison-bridge cu opþiunea -l" -#: main.c:261 +#: src/main.c:260 msgid "-Cf/-CF and -Cm don't make sense together" msgstr "-Cf/-CF ºi -Cm nu au sens folosite împreunã" -#: main.c:264 +#: src/main.c:263 msgid "-Cf/-CF and -I are incompatible" msgstr "-Cf/-CF ºi -I sunt incompatibile" -#: main.c:268 +#: src/main.c:267 msgid "-Cf/-CF are incompatible with lex-compatibility mode" msgstr "-Cf/-CF sunt incompatibile cu module de compatibilitate lex" -#: main.c:273 +#: src/main.c:272 msgid "-Cf and -CF are mutually exclusive" msgstr "-Cf ºi -CF se exclud reciproc" -#: main.c:277 +#: src/main.c:276 msgid "Can't use -+ with -CF option" msgstr "Nu se poate folosi -+ cu opþiunea -CF" -#: main.c:280 +#: src/main.c:279 #, c-format msgid "%array incompatible with -+ option" msgstr "%array incompatibil cu opþiunea -+" -#: main.c:285 +#: src/main.c:284 msgid "Options -+ and --reentrant are mutually exclusive." msgstr "Opþiunile -+ and --reentrant se exclud reciproc" -#: main.c:288 +#: src/main.c:287 msgid "bison bridge not supported for the C++ scanner." msgstr "bridge bison nu este suportat pentru scannerul C++." -#: main.c:340 main.c:385 +#: src/main.c:336 src/main.c:419 #, c-format msgid "could not create %s" msgstr "nu am putut crea %s" -#: main.c:398 +#: src/main.c:431 msgid "could not write tables header" msgstr "Nu am putut scrie capul de tabel" -#: main.c:402 +#: src/main.c:435 #, c-format msgid "can't open skeleton file %s" msgstr "nu am putut deschide fiºierul schelet %s" -#: main.c:483 +#: 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 "eroare de intrare(input) în timpul citirii fiºierului schelet %s" -#: main.c:487 +#: src/main.c:525 #, c-format msgid "error closing skeleton file %s" msgstr "eroare în închiderea fiºierului schelet %s" -#: main.c:671 +#: src/main.c:709 #, c-format msgid "error creating header file %s" msgstr "eroare în crearea fiºierului de header %s" -#: main.c:679 +#: src/main.c:717 #, c-format msgid "error writing output file %s" msgstr "eroare în scrierea fiºierului de output %s" -#: main.c:683 +#: src/main.c:721 #, c-format msgid "error closing output file %s" msgstr "eroare în închiderea fiºierului de output %s" -#: main.c:687 +#: src/main.c:725 #, c-format msgid "error deleting output file %s" msgstr "eroare în ºtergerea fiºierului de output %s" -#: main.c:694 +#: src/main.c:732 +#, c-format msgid "No backing up.\n" msgstr "Nu se revine (backing-up).\n" -#: main.c:698 +#: src/main.c:736 #, c-format msgid "%d backing up (non-accepting) states.\n" msgstr "%d salvare de (inacceptabile) stãri.\n" -#: main.c:702 +#: src/main.c:740 +#, c-format msgid "Compressed tables always back up.\n" msgstr "Tabelele compresate întotdeauna au back-up.\n" -#: main.c:705 +#: src/main.c:743 #, c-format msgid "error writing backup file %s" msgstr "eroare în scrierea fiºierului de backup %s" -#: main.c:709 +#: src/main.c:747 #, c-format msgid "error closing backup file %s" msgstr "eroare în închiderea fiºierului de backup %s" -#: main.c:714 +#: src/main.c:752 #, c-format msgid "%s version %s usage statistics:\n" msgstr "%s versiunea %s statistici de folosire:\n" -#: main.c:717 +#: src/main.c:755 +#, c-format msgid " scanner options: -" msgstr " opþiuni de scanner: -" -#: main.c:796 +#: src/main.c:834 #, c-format msgid " %d/%d NFA states\n" msgstr " %d/%d stãri NFA\n" -#: main.c:798 +#: src/main.c:836 #, c-format msgid " %d/%d DFA states (%d words)\n" msgstr " %d/%d stãri DFA (%d cuvinte)\n" -#: main.c:800 +#: src/main.c:838 #, c-format msgid " %d rules\n" msgstr " %d reguli\n" -#: main.c:805 +#: src/main.c:843 +#, c-format msgid " No backing up\n" msgstr " Nu se face backup\n" -#: main.c:809 +#: src/main.c:847 #, c-format msgid " %d backing-up (non-accepting) states\n" msgstr " %d salvare de (inacceptabile) stãri\n" -#: main.c:814 +#: src/main.c:852 +#, c-format msgid " Compressed tables always back-up\n" msgstr " Tabelele compresate întotdeauna au back-up\n" -#: main.c:818 +#: src/main.c:856 +#, c-format msgid " Beginning-of-line patterns used\n" msgstr " Tipare de începuturi de linie folosite\n" -#: main.c:820 +#: src/main.c:858 #, c-format msgid " %d/%d start conditions\n" msgstr " %d/%d condiþii de start\n" -#: main.c:824 +#: src/main.c:862 #, c-format msgid " %d epsilon states, %d double epsilon states\n" msgstr " %d stãri epsilon, %d stãri dublu epsilon\n" -#: main.c:828 +#: src/main.c:866 +#, c-format msgid " no character classes\n" msgstr " nici o clasã de caractere\n" -#: main.c:832 +#: src/main.c:870 #, c-format msgid " %d/%d character classes needed %d/%d words of storage, %d reused\n" -msgstr " %d/%d clase de caractere necesare %d/%d cuvinte de stocare, %d refolosite\n" +msgstr "" +" %d/%d clase de caractere necesare %d/%d cuvinte de stocare, %d refolosite\n" -#: main.c:837 +#: src/main.c:875 #, c-format msgid " %d state/nextstate pairs created\n" msgstr " %d perechi de stare/stareurmãtoare create\n" -#: main.c:840 +#: src/main.c:878 #, c-format msgid " %d/%d unique/duplicate transitions\n" msgstr " %d/%d tranziþii unice/duplicate\n" -#: main.c:845 +#: src/main.c:883 #, c-format msgid " %d table entries\n" msgstr " %d intrãri în tabele\n" -#: main.c:853 +#: src/main.c:891 #, c-format msgid " %d/%d base-def entries created\n" msgstr " %d/%d base-def intrãri create\n" -#: main.c:857 +#: src/main.c:895 #, c-format msgid " %d/%d (peak %d) nxt-chk entries created\n" msgstr " %d/%d (maxim %d) nxt-chk intrãri create\n" -#: main.c:861 +#: src/main.c:899 #, c-format msgid " %d/%d (peak %d) template nxt-chk entries created\n" msgstr " %d/%d (maxim %d) model nxt-chk intrãri create\n" -#: main.c:865 +#: src/main.c:903 #, c-format msgid " %d empty table entries\n" msgstr " %d intrãri în tabel goale\n" -#: main.c:867 +#: src/main.c:905 #, c-format msgid " %d protos created\n" msgstr " %d prototipuri create\n" -#: main.c:870 +#: src/main.c:908 #, c-format msgid " %d templates created, %d uses\n" msgstr " %d modele create, %d folosiri\n" -#: main.c:878 +#: src/main.c:916 #, c-format msgid " %d/%d equivalence classes created\n" msgstr " %d/%d clase de echivalenþã create\n" -#: main.c:886 +#: src/main.c:924 #, c-format msgid " %d/%d meta-equivalence classes created\n" msgstr " %d/%d clase de meta-echivalenþã create\n" -#: main.c:892 +#: src/main.c:930 #, c-format msgid " %d (%d saved) hash collisions, %d DFAs equal\n" msgstr " %d (%d salvate) coliziuni disipate(hash), %d egaluri de DFA-uril\n" -#: main.c:894 +#: src/main.c:932 #, c-format msgid " %d sets of reallocations needed\n" msgstr " %d seturi de realocãri necesare\n" -#: main.c:896 +#: src/main.c:934 #, c-format msgid " %d total table entries needed\n" msgstr " %d intrãri totale în tabel necesare\n" -#: main.c:971 +#: src/main.c:1008 +#, c-format msgid "Internal error. flexopts are malformed.\n" msgstr "Eroare internã. Opþiunile flex(flexopts) sunt malformate.\n" -#: main.c:981 +#: src/main.c:1018 #, c-format msgid "Try `%s --help' for more information.\n" msgstr "Încercaþi `%s --help' pentru mai multe informaþii.\n" -#: main.c:1038 +#: src/main.c:1075 #, c-format msgid "unknown -C option '%c'" msgstr "opþiune -C necunoscutã `%c'" -#: main.c:1167 +#: src/main.c:1204 #, c-format msgid "%s %s\n" msgstr "%s %s\n" -#: main.c:1442 +#: src/main.c:1476 msgid "fatal parse error" msgstr "eroare fatalã de analizã(parse)" -#: main.c:1474 +#: src/main.c:1508 #, c-format msgid "could not create backing-up info file %s" msgstr "nu s-a putut crea fiºierul de informaþii de back-up %s" -#: main.c:1495 +#: src/main.c:1529 +#, c-format msgid "-l AT&T lex compatibility option entails a large performance penalty\n" -msgstr "-l opþiunea de compatibilitate AT&T lex determinã o scãdere drasticã a performanþei\n" +msgstr "" +"-l opþiunea de compatibilitate AT&T lex determinã o scãdere drasticã a " +"performanþei\n" -#: main.c:1498 +#: src/main.c:1532 +#, c-format msgid " and may be the actual source of other reported performance penalties\n" msgstr "ºi poate fi sursa realã a altor scãderi de performanþã raportate\n" -#: main.c:1504 +#: src/main.c:1538 #, c-format -msgid "%%option yylineno entails a performance penalty ONLY on rules that can match newline characters\n" -msgstr "%%opþiunea yylineno determinã o scãdere drasticã a performanþei DOAR în regulile care se potrivesc caracterelor linie_nouã(newline)\n" +msgid "" +"%%option yylineno entails a performance penalty ONLY on rules that can match " +"newline characters\n" +msgstr "" +"%%opþiunea yylineno determinã o scãdere drasticã a performanþei DOAR în " +"regulile care se potrivesc caracterelor linie_nouã(newline)\n" -#: main.c:1511 +#: src/main.c:1545 +#, c-format msgid "-I (interactive) entails a minor performance penalty\n" msgstr "-I (interactiãe) determinã o scãdere minorã a performanþei\n" -#: main.c:1516 +#: src/main.c:1550 +#, c-format msgid "yymore() entails a minor performance penalty\n" msgstr "yymore() determinã o scãdere minorã a performanþei\n" -#: main.c:1522 +#: src/main.c:1556 +#, c-format msgid "REJECT entails a large performance penalty\n" msgstr "REJECT determinã o scãdere drasticã a performanþei\n" -#: main.c:1527 +#: src/main.c:1561 +#, c-format msgid "Variable trailing context rules entail a large performance penalty\n" -msgstr "Contextul de sfârºit(trailing) variabil determinã o scãdere drasticã a performanþei\n" +msgstr "" +"Contextul de sfârºit(trailing) variabil determinã o scãdere drasticã a " +"performanþei\n" -#: main.c:1539 +#: src/main.c:1573 msgid "REJECT cannot be used with -f or -F" msgstr "REJECT nu poate fi folosit cu -f sau -F" -#: main.c:1542 +#: src/main.c:1576 #, c-format msgid "%option yylineno cannot be used with REJECT" msgstr "%opþiunea yylineno nu poate fi folositã cu REJECT" -#: main.c:1545 +#: src/main.c:1579 msgid "variable trailing context rules cannot be used with -f or -F" -msgstr "contextul de sfârºit(trailing) variabil nu poate fi folosit cu -f sau -F" +msgstr "" +"contextul de sfârºit(trailing) variabil nu poate fi folosit cu -f sau -F" -#: main.c:1661 +#: src/main.c:1704 #, c-format msgid "%option yyclass only meaningful for C++ scanners" msgstr "%opþunea yyclass este folositoare doar pentru scannerele C++" -#: main.c:1768 +#: src/main.c:1791 #, c-format msgid "Usage: %s [OPTIONS] [FILE]...\n" msgstr "Folosire: %s [OPÞIUNI] [FIªIER]...\n" -#: main.c:1771 -#, c-format +#: src/main.c:1794 +#, fuzzy, c-format msgid "" "Generates programs that perform pattern-matching on text.\n" "\n" @@ -509,13 +559,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" @@ -537,8 +590,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" @@ -552,13 +603,16 @@ msgstr "" "Genereazã programe care cautã potriviri de tipare pe un text\n" "\n" "Compresie de tabele:\n" -" -Ca, --align renunþã la tabelele mari în favoarea unui aliniament mai bun al memoriei\n" +" -Ca, --align renunþã la tabelele mari în favoarea unui aliniament mai " +"bun al memoriei\n" " -Ce, --ecs construieºte clase de echivalenþã\n" " -Cf nu compreseazã tabelele; foloseºte reprezentare -f \n" " -CF nu compreseazã tabelele; foloseºte reprezentare -F\n" " -Cm, --meta-ecs construieºte clase de meta-echivalenþã\n" -" -Cr, --read foloseºte read() în loc de stdio pentru intrarea de scanner\n" -" -F, --fast foloseºte reprezentare alternativã de tabele. Asemãnãtor lui -CFr\n" +" -Cr, --read foloseºte read() în loc de stdio pentru intrarea de " +"scanner\n" +" -F, --fast foloseºte reprezentare alternativã de tabele. Asemãnãtor " +"lui -CFr\n" " -f, --full genereazã scannere rapide, mari. Asemãnãtor lui -Cfr\n" " -Cem compresie implicitã (asemãnãtor lui --ecs --meta-ecs)\n" "\n" @@ -566,10 +620,12 @@ msgstr "" " -d, --debug activeazã modul debug în scanner\n" " -b, --backup scriere de informaþii de backup în %s\n" " -p, --perf-report scrie raportul de performanþã la stderr\n" -" -s, --nodefault eliminã regula implicitã de ECHO text care nu se potriveºte\n" +" -s, --nodefault eliminã regula implicitã de ECHO text care nu se " +"potriveºte\n" " -T, --trace %s ar trebui sã ruleze în mod trace\n" " -w, --nowarn nu genereazã avertismente\n" -" -v, --verbose scrie cuprinsul statisticilor scanner-ului la stdout\n" +" -v, --verbose scrie cuprinsul statisticilor scanner-ului la " +"stdout\n" "\n" "Fiºiere:\n" " -o, --outfile=FIªIER specificã numele de fiºier de ieºire\n" @@ -582,7 +638,8 @@ msgstr "" "Comportament scanner:\n" " -7, --7bit genereazã scanner pe 7-biþi\n" " -8, --8bit genereazã scanner pe 8-biþi\n" -" -B, --batch genereazã scanner comandã(batch) (inversul lui -I)\n" +" -B, --batch genereazã scanner comandã(batch) (inversul lui -" +"I)\n" " -i, --case-insensitive ignorã cazul în tipare\n" " -l, --lex-compat compatibilitate maximã cu lex original\n" " -X, --posix-compat compatibilitate maximã cu lex POSIX\n" @@ -610,47 +667,52 @@ msgstr "" " -h, --help produce acest mesaj de ajutor\n" " -V, --version raporteazã versiunea %s\n" -#: misc.c:100 misc.c:126 +#: src/misc.c:64 +msgid "allocation of sko_stack failed" +msgstr "" + +#: src/misc.c:100 #, c-format msgid "name \"%s\" ridiculously long" msgstr "numele \"%s\" este ridicol de lung" -#: misc.c:175 +#: src/misc.c:155 msgid "memory allocation failed in allocate_array()" msgstr "alocare de memorie eºuatã în allocate_array()" -#: misc.c:250 +#: src/misc.c:205 #, c-format msgid "bad character '%s' detected in check_char()" msgstr "caracter greºit `%s' detectat în check_char()" -#: misc.c:255 +#: src/misc.c:210 #, c-format msgid "scanner requires -8 flag to use the character %s" msgstr "scannerul necesitã parametrul(flag) -8 pentru a folosi caracterul %s" -#: misc.c:288 -msgid "dynamic memory failure in copy_string()" -msgstr "eroare de memorie dinamicã în copy_string()" +#: src/misc.c:229 +#, fuzzy +msgid "memory allocation failure in xstrdup()" +msgstr "alocare de memorie eºuatã în allocate_array()" -#: misc.c:422 +#: src/misc.c:303 #, c-format msgid "%s: fatal internal error, %s\n" msgstr "%s: eroare internã fatalã, %s\n" -#: misc.c:875 +#: src/misc.c:671 msgid "attempt to increase array size failed" msgstr "încercare de a mãri dimensiunea domeniului eºuatã" -#: misc.c:1002 +#: src/misc.c:795 msgid "bad line in skeleton file" msgstr "linie greºitã în fiºierul schelet" -#: misc.c:1051 +#: src/misc.c:845 msgid "memory allocation failed in yy_flex_xmalloc()" msgstr "alocare de memorie eºuatã în yy_flex_xmalloc()" -#: nfa.c:104 +#: src/nfa.c:100 #, c-format msgid "" "\n" @@ -661,203 +723,255 @@ msgstr "" "\n" "********** începerea aducerii(dump) nfa cu starea de început %d\n" -#: nfa.c:115 +#: src/nfa.c:111 #, c-format msgid "state # %4d\t" msgstr "stare # %4d\t" -#: nfa.c:130 +#: src/nfa.c:126 +#, c-format msgid "********** end of dump\n" msgstr "********** sfârºit de aducere(dump)\n" -#: nfa.c:174 +#: src/nfa.c:169 msgid "empty machine in dupmachine()" msgstr "maºinã vidã în dupmachine()" -#: nfa.c:240 +#: src/nfa.c:234 #, c-format msgid "Variable trailing context rule at line %d\n" msgstr "Regulã de context de sfârºit variabil la linia %d\n" -#: nfa.c:353 +#: src/nfa.c:357 msgid "bad state type in mark_beginning_as_normal()" msgstr "tip de stare greºitã în mark_beginning_as_normal()" -#: nfa.c:598 +#: src/nfa.c:595 #, c-format msgid "input rules are too complicated (>= %d NFA states)" msgstr "regulile de intrare(input) sunt prea complicate (>= %d stãri NFA)" -#: nfa.c:677 +#: src/nfa.c:673 msgid "found too many transitions in mkxtion()" msgstr "s-au gãsit prea multe tranziþii în mkxtion()" -#: nfa.c:703 +#: src/nfa.c:699 #, c-format msgid "too many rules (> %d)!" msgstr "prea multe reguli (> %d)!" -#: parse.y:183 +#: src/parse.y:159 msgid "unknown error processing section 1" msgstr "eroare necunoscutã în procesarea secþiunii 1" -#: parse.y:208 parse.y:373 +#: src/parse.y:184 src/parse.y:353 msgid "bad start condition list" msgstr "listã de stãri în condiþie proastã" -#: parse.y:337 +#: src/parse.y:204 +msgid "Prefix must not contain [ or ]" +msgstr "" + +#: src/parse.y:317 msgid "unrecognized rule" msgstr "regulã necunoscutã" -#: parse.y:456 parse.y:469 parse.y:538 +#: src/parse.y:436 src/parse.y:449 src/parse.y:518 msgid "trailing context used twice" msgstr "context de sfârºit(trailing) utilizat de douã ori" -#: parse.y:574 parse.y:584 parse.y:657 parse.y:667 +#: src/parse.y:554 src/parse.y:564 src/parse.y:637 src/parse.y:647 msgid "bad iteration values" msgstr "valori de iteraþie greºite" -#: parse.y:602 parse.y:620 parse.y:685 parse.y:703 +#: src/parse.y:582 src/parse.y:600 src/parse.y:665 src/parse.y:683 msgid "iteration value must be positive" msgstr "valoarea iteraþiei trebuie sã fie pozitivã" -#: parse.y:817 parse.y:827 +#: src/parse.y:806 src/parse.y:816 #, c-format msgid "the character range [%c-%c] is ambiguous in a case-insensitive scanner" -msgstr "intervalul(range) de caracter [%c %c] este ambiguu într-un scanner caz-insenzitiv" +msgstr "" +"intervalul(range) de caracter [%c %c] este ambiguu într-un scanner caz-" +"insenzitiv" -#: parse.y:832 +#: src/parse.y:821 msgid "negative range in character class" msgstr "domeniu negativ în clasa de caractere" -#: scan.l:70 scan.l:180 scan.l:267 scan.l:409 scan.l:548 scan.l:598 +#: src/parse.y:918 +#, fuzzy +msgid "[:^lower:] is ambiguous in case insensitive scanner" +msgstr "" +"intervalul(range) de caracter [%c %c] este ambiguu într-un scanner caz-" +"insenzitiv" + +#: src/parse.y:924 +#, fuzzy +msgid "[:^upper:] ambiguous in case insensitive scanner" +msgstr "" +"intervalul(range) de caracter [%c %c] este ambiguu într-un scanner caz-" +"insenzitiv" + +#: src/scan.l:82 src/scan.l:644 src/scan.l:702 msgid "Input line too long\n" msgstr "Linie de intrare(input) prea lungã\n" -#: scan.l:149 +#: src/scan.l:183 #, c-format msgid "malformed '%top' directive" msgstr "directivã '%top' malformatã" -#: scan.l:171 +#: src/scan.l:205 #, no-c-format msgid "unrecognized '%' directive" msgstr "directivã '%' necunoscutã" -#: scan.l:251 +#: src/scan.l:214 +#, fuzzy +msgid "Definition name too long\n" +msgstr "Linie de intrare(input) prea lungã\n" + +#: src/scan.l:309 msgid "Unmatched '{'" msgstr "'{' fãrã corespondent" -#: scan.l:284 +#: src/scan.l:325 +#, c-format +msgid "Definition value for {%s} too long\n" +msgstr "" + +#: src/scan.l:342 msgid "incomplete name definition" msgstr "definire de nume incompletã" -#: scan.l:417 +#: src/scan.l:467 +#, fuzzy +msgid "Option line too long\n" +msgstr "Linie de intrare(input) prea lungã\n" + +#: src/scan.l:475 #, c-format msgid "unrecognized %%option: %s" msgstr "%%opþiune necunoscutã: %s" -#: scan.l:558 scan.l:677 +#: src/scan.l:659 src/scan.l:832 msgid "bad character class" msgstr "clasã de caractere greºitã" -#: scan.l:605 +#: src/scan.l:709 #, c-format msgid "undefined definition {%s}" msgstr "definiþie nedefinitã {%s}" -#: scan.l:645 +#: src/scan.l:772 +msgid "unbalanced parenthesis" +msgstr "" + +#: src/scan.l:787 #, c-format msgid "bad <start condition>: %s" msgstr "<condiþie de start> greºitã: %s" -#: scan.l:658 +#: src/scan.l:800 msgid "missing quote" msgstr "menþionare(quote) lipsã" -#: scan.l:698 +#: src/scan.l:866 #, c-format msgid "bad character class expression: %s" msgstr "expresie clasã caracter greºitã: %s" -#: scan.l:720 +#: src/scan.l:888 msgid "bad character inside {}'s" msgstr "caracter eronat între {}" -#: scan.l:726 +#: src/scan.l:894 msgid "missing }" msgstr "lipseºte }" -#: scan.l:799 +#: src/scan.l:972 msgid "EOF encountered inside an action" msgstr "EOF întâlnit în mijlocul acþiunii" -#: scan.l:819 +#: src/scan.l:977 +#, fuzzy +msgid "EOF encountered inside pattern" +msgstr "EOF întâlnit în mijlocul acþiunii" + +#: src/scan.l:1010 #, c-format msgid "bad character: %s" msgstr "caracter eronat: %s" -#: scan.l:848 +#: src/scan.l:1038 #, c-format msgid "can't open %s" msgstr "nu pot deschide %s" -#: scanopt.c:291 +#: src/scanopt.c:259 #, c-format msgid "Usage: %s [OPTIONS]...\n" msgstr "Folosire: %s [OPÞIUNI]...\n" -#: scanopt.c:565 +#: src/scanopt.c:524 #, c-format msgid "option `%s' doesn't allow an argument\n" msgstr "opþiunea `%s' nu permite parametri\n" -#: scanopt.c:570 +#: src/scanopt.c:529 #, c-format msgid "option `%s' requires an argument\n" msgstr "opþiunea `%s' necesitã un parametru\n" -#: scanopt.c:574 +#: src/scanopt.c:533 #, c-format msgid "option `%s' is ambiguous\n" msgstr "opþiunea `%s' este ambiguã\n" -#: scanopt.c:578 +#: src/scanopt.c:537 #, c-format msgid "Unrecognized option `%s'\n" msgstr "Opþiune necunoscutã `%s'\n" -#: scanopt.c:582 +#: src/scanopt.c:541 #, c-format msgid "Unknown error=(%d)\n" msgstr "Eroare necunoscutã=(%d)\n" -#: sym.c:100 +#: src/sym.c:92 msgid "symbol table memory allocation failed" msgstr "alocare de memorie pentru tabela de simboluri eºuatã" -#: sym.c:203 +#: src/sym.c:183 msgid "name defined twice" msgstr "nume definit de douã ori" -#: sym.c:254 +#: src/sym.c:231 #, c-format msgid "start condition %s declared twice" msgstr "condiþie de start %s definitã de douã ori" -#: yylex.c:56 +#: src/yylex.c:57 msgid "premature EOF" msgstr "EOF prematur" -#: yylex.c:198 +#: src/yylex.c:200 +#, c-format msgid "End Marker\n" msgstr "Marcaj de sfârºit\n" -#: yylex.c:204 +#: src/yylex.c:206 #, c-format msgid "*Something Weird* - tok: %d val: %d\n" msgstr "*Ceva Ciudat* - tok: %d val: %d\n" +#~ msgid "consistency check failed in symfollowset" +#~ msgstr "verificare de consistenþã eºuatã în symfollowset" + +#~ msgid "dynamic memory failure in copy_string()" +#~ msgstr "eroare de memorie dinamicã în copy_string()" + #~ msgid "Can't specify header option if writing to stdout." #~ msgstr "Nu se poate specifica opþiunea de header dacã se scrie la stdout" @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: flex 2.5.38\n" "Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2014-02-11 16:15-0500\n" +"POT-Creation-Date: 2017-05-06 10:49-0400\n" "PO-Revision-Date: 2014-02-16 10:00+0400\n" "Last-Translator: Yuri Kozlov <yuray@komyakino.ru>\n" "Language-Team: Russian <gnu@mx.ru>\n" @@ -16,45 +16,47 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8-bit\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 "Ðе удалоÑÑŒ выделить буфер Ð´Ð»Ñ 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 " out-переходы: " -#: dfa.c:210 +#: src/dfa.c:201 #, c-format msgid "" "\n" @@ -63,11 +65,11 @@ msgstr "" "\n" " jam-переходы: EOF " -#: 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" @@ -79,24 +81,24 @@ msgstr "" "Дамп ДКÐ:\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" @@ -108,29 +110,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" @@ -140,392 +142,409 @@ 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:191 +#: src/main.c:178 msgid "rule cannot be matched" msgstr "невозможно применить правило" -#: main.c:196 +#: src/main.c:183 msgid "-s option given but default rule can be matched" msgstr "указан параметр -s, но правило по умолчанию не может быть применено" -#: main.c:236 +#: src/main.c:221 msgid "Can't use -+ with -l option" msgstr "Ðевозможно иÑпользовать -+ Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð¾Ð¼ -l" -#: main.c:239 +#: src/main.c:224 msgid "Can't use -f or -F with -l option" msgstr "Ðевозможно иÑпользовать -f или -F Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð¾Ð¼ -l" -#: main.c:243 +#: src/main.c:228 msgid "Can't use --reentrant or --bison-bridge with -l option" msgstr "Ðевозможно иÑпользовать --reentrant или --bison-bridge Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð¾Ð¼ -l" -#: main.c:275 +#: src/main.c:260 msgid "-Cf/-CF and -Cm don't make sense together" msgstr "Параметры -Cf/-CF и -Cm вмеÑте не имеют ÑмыÑла" -#: main.c:278 +#: src/main.c:263 msgid "-Cf/-CF and -I are incompatible" msgstr "Параметры -Cf/-CF и -I неÑовмеÑтимы" -#: main.c:282 +#: src/main.c:267 msgid "-Cf/-CF are incompatible with lex-compatibility mode" msgstr "Параметры -Cf/-CF неÑовмеÑтимы Ñ Ñ€ÐµÐ¶Ð¸Ð¼Ð¾Ð¼ lex-ÑовмеÑтимоÑти" -#: main.c:287 +#: src/main.c:272 msgid "-Cf and -CF are mutually exclusive" msgstr "Параметры -Cf и -CF ÑвлÑÑŽÑ‚ÑÑ Ð²Ð·Ð°Ð¸Ð¼Ð¾Ð¸Ñключающими" -#: main.c:291 +#: src/main.c:276 msgid "Can't use -+ with -CF option" msgstr "Ðевозможно иÑпользовать -+ Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð¾Ð¼ -CF" -#: main.c:294 +#: src/main.c:279 #, c-format msgid "%array incompatible with -+ option" msgstr "%array неÑовмеÑтим Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð¾Ð¼ -+" -#: main.c:299 +#: src/main.c:284 msgid "Options -+ and --reentrant are mutually exclusive." msgstr "Параметры -+ и --reentrant ÑвлÑÑŽÑ‚ÑÑ Ð²Ð·Ð°Ð¸Ð¼Ð¾Ð¸Ñключающими." -#: main.c:302 +#: src/main.c:287 msgid "bison bridge not supported for the C++ scanner." msgstr "bison bridge не поддерживаетÑÑ Ð´Ð»Ñ Ñканера C++." -#: main.c:357 main.c:403 +#: src/main.c:336 src/main.c:419 #, c-format msgid "could not create %s" msgstr "невозможно Ñоздать %s" -#: main.c:416 +#: src/main.c:431 msgid "could not write tables header" msgstr "Ðевозможно запиÑать заголовок таблиц" -#: main.c:420 +#: src/main.c:435 #, c-format msgid "can't open skeleton file %s" msgstr "Ðевозможно открыть файл-ÐºÐ°Ñ€ÐºÐ°Ñ %s" -#: main.c:456 +#: src/main.c:450 +msgid "Prefix cannot include '[' or ']'" +msgstr "" + +#: src/main.c:474 msgid "allocation of macro definition failed" msgstr "Ðе удалоÑÑŒ размеÑтить определение макроÑа" -#: main.c:504 +#: src/main.c:521 #, c-format msgid "input error reading skeleton file %s" msgstr "ошибка Ñ‡Ñ‚ÐµÐ½Ð¸Ñ Ñ„Ð°Ð¹Ð»Ð°-каркаÑа %s" -#: main.c:508 +#: src/main.c:525 #, c-format msgid "error closing skeleton file %s" msgstr "ошибка при закрытии файла-каркаÑа %s" -#: main.c:693 +#: src/main.c:709 #, c-format msgid "error creating header file %s" msgstr "ошибка ÑÐ¾Ð·Ð´Ð°Ð½Ð¸Ñ Ð·Ð°Ð³Ð¾Ð»Ð¾Ð²Ð¾Ñ‡Ð½Ð¾Ð³Ð¾ файла %s" -#: main.c:701 +#: src/main.c:717 #, c-format msgid "error writing output file %s" msgstr "ошибка запиÑи в выходной файл %s" -#: main.c:705 +#: src/main.c:721 #, c-format msgid "error closing output file %s" msgstr "ошибка Ð·Ð°ÐºÑ€Ñ‹Ñ‚Ð¸Ñ Ð²Ñ‹Ñ…Ð¾Ð´Ð½Ð¾Ð³Ð¾ файла %s" -#: main.c:709 +#: src/main.c:725 #, c-format msgid "error deleting output file %s" msgstr "ошибка ÑƒÐ´Ð°Ð»ÐµÐ½Ð¸Ñ Ð²Ñ‹Ñ…Ð¾Ð´Ð½Ð¾Ð³Ð¾ файла %s" -#: main.c:716 +#: src/main.c:732 #, c-format msgid "No backing up.\n" msgstr "Резервное копирование отключено.\n" -#: main.c:720 +#: src/main.c:736 #, c-format msgid "%d backing up (non-accepting) states.\n" msgstr "резервное копирование %d (недопуÑтимых) ÑоÑтоÑний.\n" -#: main.c:724 +#: src/main.c:740 #, c-format msgid "Compressed tables always back up.\n" msgstr "Резервное копирование Ñжатых таблиц выполнÑетÑÑ Ð²Ñегда.\n" -#: main.c:727 +#: src/main.c:743 #, c-format msgid "error writing backup file %s" msgstr "ошибка запиÑи резервной копии файла %s" -#: main.c:731 +#: src/main.c:747 #, c-format msgid "error closing backup file %s" msgstr "ошибка Ð·Ð°ÐºÑ€Ñ‹Ñ‚Ð¸Ñ Ñ€ÐµÐ·ÐµÑ€Ð²Ð½Ð¾Ð¹ копии файла %s" -#: main.c:736 +#: src/main.c:752 #, c-format msgid "%s version %s usage statistics:\n" msgstr "ÑтатиÑтика иÑÐ¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ð½Ð¸Ñ %s верÑии %s:\n" -#: main.c:739 +#: src/main.c:755 #, c-format msgid " scanner options: -" msgstr " параметры Ñканера: -" -#: main.c:818 +#: src/main.c:834 #, c-format msgid " %d/%d NFA states\n" msgstr " %d/%d ÑоÑтоÑний ÐКÐ\n" -#: main.c:820 +#: src/main.c:836 #, c-format msgid " %d/%d DFA states (%d words)\n" msgstr " %d/%d ÑоÑтоÑний ДКР(%d Ñлов)\n" -#: main.c:822 +#: src/main.c:838 #, c-format msgid " %d rules\n" msgstr " %d правил\n" -#: main.c:827 +#: src/main.c:843 #, c-format msgid " No backing up\n" msgstr " Резервное копирование отключено\n" -#: main.c:831 +#: src/main.c:847 #, c-format msgid " %d backing-up (non-accepting) states\n" msgstr " резервное копирование %d (недопуÑтимых) ÑоÑтоÑний\n" -#: main.c:836 +#: src/main.c:852 #, c-format msgid " Compressed tables always back-up\n" msgstr " Резервное копирование Ñжатых таблиц выполнÑетÑÑ Ð²Ñегда\n" -#: main.c:840 +#: src/main.c:856 #, c-format msgid " Beginning-of-line patterns used\n" msgstr " ИÑпользуютÑÑ ÑˆÐ°Ð±Ð»Ð¾Ð½Ñ‹ начала Ñтроки\n" -#: main.c:842 +#: src/main.c:858 #, c-format msgid " %d/%d start conditions\n" msgstr " %d/%d начальных уÑловий\n" -#: main.c:846 +#: src/main.c:862 #, c-format msgid " %d epsilon states, %d double epsilon states\n" msgstr " %d ÑпÑилон-ÑоÑтоÑний, %d двойных ÑпÑилон-ÑоÑтоÑний\n" -#: main.c:850 +#: src/main.c:866 #, c-format msgid " no character classes\n" msgstr " отÑутÑтвуют клаÑÑÑ‹ Ñимволов\n" -#: main.c:854 +#: 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" +msgstr "" +" %d/%d клаÑÑов Ñимволов требуют %d/%d Ñлов Ð´Ð»Ñ Ñ…Ñ€Ð°Ð½ÐµÐ½Ð¸Ñ, %d повторно " +"иÑпользовано\n" -#: main.c:859 +#: src/main.c:875 #, c-format msgid " %d state/nextstate pairs created\n" msgstr " Ñоздано %d пар ÑоÑтоÑние/Ñлед_ÑоÑтоÑние\n" -#: main.c:862 +#: src/main.c:878 #, c-format msgid " %d/%d unique/duplicate transitions\n" msgstr " %d/%d уникальных/повторÑющихÑÑ Ð¿ÐµÑ€ÐµÑ…Ð¾Ð´Ð¾Ð²\n" -#: main.c:867 +#: src/main.c:883 #, c-format msgid " %d table entries\n" msgstr " %d Ñлементов таблицы\n" -#: main.c:875 +#: src/main.c:891 #, c-format msgid " %d/%d base-def entries created\n" msgstr " Ñоздано %d/%d base-def Ñлементов\n" -#: main.c:879 +#: 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:883 +#: 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:887 +#: src/main.c:903 #, c-format msgid " %d empty table entries\n" msgstr " %d пуÑÑ‚Ñ‹Ñ… Ñлементов таблицы\n" -#: main.c:889 +#: src/main.c:905 #, c-format msgid " %d protos created\n" msgstr " Ñоздано %d прототипов\n" -#: main.c:892 +#: src/main.c:908 #, c-format msgid " %d templates created, %d uses\n" msgstr " Ñоздано %d шаблонов, %d иÑпользуютÑÑ\n" -#: main.c:900 +#: src/main.c:916 #, c-format msgid " %d/%d equivalence classes created\n" msgstr " Ñозданы клаÑÑÑ‹ ÑквивалентноÑти %d/%d\n" -#: main.c:908 +#: src/main.c:924 #, c-format msgid " %d/%d meta-equivalence classes created\n" msgstr " %d/%d мета-Ñквивалентных клаÑÑов Ñоздано\n" -#: main.c:914 +#: src/main.c:930 #, c-format msgid " %d (%d saved) hash collisions, %d DFAs equal\n" msgstr " %d (%d запиÑано) коллизий Ñ…Ñш-таблицы, %d Ñквивалентных ДКÐ\n" -#: main.c:916 +#: src/main.c:932 #, c-format msgid " %d sets of reallocations needed\n" msgstr " требуетÑÑ %d наборов повторных размещений\n" -#: main.c:918 +#: src/main.c:934 #, c-format msgid " %d total table entries needed\n" msgstr " вÑего требуетÑÑ %d Ñлементов таблицы\n" -#: main.c:995 +#: src/main.c:1008 #, c-format msgid "Internal error. flexopts are malformed.\n" msgstr "ВнутреннÑÑ Ð¾ÑˆÐ¸Ð±ÐºÐ°. Ðеправильное значение flexopts.\n" -#: main.c:1005 +#: src/main.c:1018 #, c-format msgid "Try `%s --help' for more information.\n" msgstr "Попробуйте «%s --help» Ð´Ð»Ñ Ð¿Ð¾Ð»ÑƒÑ‡ÐµÐ½Ð¸Ñ Ð±Ð¾Ð»ÐµÐµ подробного опиÑаниÑ.\n" -#: main.c:1062 +#: src/main.c:1075 #, c-format msgid "unknown -C option '%c'" msgstr "неизвеÑтное значение «%c» Ð´Ð»Ñ -C" -#: main.c:1191 +#: src/main.c:1204 #, c-format msgid "%s %s\n" msgstr "%s %s\n" -#: main.c:1466 +#: src/main.c:1476 msgid "fatal parse error" msgstr "Ñ„Ð°Ñ‚Ð°Ð»ÑŒÐ½Ð°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ° разбора" -#: main.c:1498 +#: src/main.c:1508 #, c-format msgid "could not create backing-up info file %s" msgstr "невозможно Ñоздать резервную копию информационного файла %s" -#: main.c:1519 +#: 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" +msgstr "" +"Параметр -l ÑовмеÑтимоÑти Ñ AT&T lex влечёт значительное Ñнижение " +"производительноÑти\n" -#: main.c:1522 +#: src/main.c:1532 #, c-format msgid " and may be the actual source of other reported performance penalties\n" -msgstr " и также может быть иÑтинным иÑточником проблем Ñ Ð¿Ñ€Ð¾Ð¸Ð·Ð²Ð¾Ð´Ð¸Ñ‚ÐµÐ»ÑŒÐ½Ð¾Ñтью\n" +msgstr "" +" и также может быть иÑтинным иÑточником проблем Ñ Ð¿Ñ€Ð¾Ð¸Ð·Ð²Ð¾Ð´Ð¸Ñ‚ÐµÐ»ÑŒÐ½Ð¾Ñтью\n" -#: main.c:1528 +#: src/main.c:1538 #, c-format -msgid "%%option yylineno entails a performance penalty ONLY on rules that can match newline characters\n" -msgstr "%%option yylineno влечёт значительное Ñнижение производительноÑти ТОЛЬКО Ð´Ð»Ñ Ð¿Ñ€Ð°Ð²Ð¸Ð», которые могут Ñовпадать Ñ Ñимволами новой Ñтроки\n" +msgid "" +"%%option yylineno entails a performance penalty ONLY on rules that can match " +"newline characters\n" +msgstr "" +"%%option yylineno влечёт значительное Ñнижение производительноÑти ТОЛЬКО Ð´Ð»Ñ " +"правил, которые могут Ñовпадать Ñ Ñимволами новой Ñтроки\n" -#: main.c:1535 +#: src/main.c:1545 #, c-format msgid "-I (interactive) entails a minor performance penalty\n" msgstr "-I (интерактивный) влечёт незначительное Ñнижение производительноÑти\n" -#: main.c:1540 +#: src/main.c:1550 #, c-format msgid "yymore() entails a minor performance penalty\n" msgstr "yymore() приводит к небольшому Ñнижению производительноÑти\n" -#: main.c:1546 +#: src/main.c:1556 #, c-format msgid "REJECT entails a large performance penalty\n" msgstr "REJECT влечёт значительное Ñнижение производительноÑти\n" -#: main.c:1551 +#: src/main.c:1561 #, c-format msgid "Variable trailing context rules entail a large performance penalty\n" -msgstr "Правила Ñ Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ñ‹Ð¼ замыкающим контекÑтом приводÑÑ‚ к значительному Ñнижению производительноÑти\n" +msgstr "" +"Правила Ñ Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ñ‹Ð¼ замыкающим контекÑтом приводÑÑ‚ к значительному Ñнижению " +"производительноÑти\n" -#: main.c:1563 +#: src/main.c:1573 msgid "REJECT cannot be used with -f or -F" msgstr "REJECT не может быть иÑпользован вмеÑте Ñ -f или -F" -#: main.c:1566 +#: src/main.c:1576 #, c-format msgid "%option yylineno cannot be used with REJECT" msgstr "%option yylineno не может быть иÑпользован Ñ REJECT" -#: main.c:1569 +#: src/main.c:1579 msgid "variable trailing context rules cannot be used with -f or -F" -msgstr "правила Ñ Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ñ‹Ð¼ замыкающим контекÑтом не могут быть иÑпользованы Ñ -f или -F" +msgstr "" +"правила Ñ Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ñ‹Ð¼ замыкающим контекÑтом не могут быть иÑпользованы Ñ -f " +"или -F" -#: main.c:1692 +#: src/main.c:1704 #, c-format msgid "%option yyclass only meaningful for C++ scanners" msgstr "%option yyclass имеет ÑмыÑл только Ð´Ð»Ñ Ñканеров C++" -#: main.c:1799 +#: src/main.c:1791 #, c-format msgid "Usage: %s [OPTIONS] [FILE]...\n" msgstr "ИÑпользование: %s [ПÐÐ ÐМЕТРЫ] [ФÐЙЛ]…\n" -#: main.c:1802 -#, c-format +#: src/main.c:1794 +#, fuzzy, c-format msgid "" "Generates programs that perform pattern-matching on text.\n" "\n" @@ -548,13 +567,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" @@ -576,8 +598,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" @@ -657,51 +677,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 "ошибка Ð²Ñ‹Ð´ÐµÐ»ÐµÐ½Ð¸Ñ Ð¿Ð°Ð¼Ñти в allocate_array()" -#: misc.c:230 +#: src/misc.c:205 #, c-format msgid "bad character '%s' detected in check_char()" msgstr "найден неверный Ñимвол «%s» в check_char()" -#: misc.c:235 +#: src/misc.c:210 #, c-format msgid "scanner requires -8 flag to use the character %s" msgstr "Ð´Ð»Ñ Ð¸ÑÐ¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ð½Ð¸Ñ Ñимвола %s Ñканеру требуетÑÑ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€ -8" -#: misc.c:268 -msgid "dynamic memory failure in copy_string()" -msgstr "ошибка при работе Ñ Ð´Ð¸Ð½Ð°Ð¼Ð¸Ñ‡ÐµÑкой памÑтью в copy_string()" +#: src/misc.c:229 +#, fuzzy +msgid "memory allocation failure in xstrdup()" +msgstr "ошибка Ð²Ñ‹Ð´ÐµÐ»ÐµÐ½Ð¸Ñ Ð¿Ð°Ð¼Ñти в allocate_array()" -#: 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" @@ -712,230 +733,247 @@ msgstr "" "\n" "******** начало дампа конечного автомата Ñ Ð½Ð°Ñ‡Ð°Ð»ÑŒÐ½Ñ‹Ð¼ ÑоÑтоÑнием %d\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:364 +#: src/nfa.c:357 msgid "bad state type in mark_beginning_as_normal()" msgstr "неверный тип ÑоÑтоÑÐ½Ð¸Ñ Ð² mark_beginning_as_normal()" -#: nfa.c:609 +#: src/nfa.c:595 #, c-format msgid "input rules are too complicated (>= %d NFA states)" msgstr "входные правила Ñлишком Ñложные (>= %d ÑоÑтоÑний ÐКÐ)" -#: nfa.c:688 +#: src/nfa.c:673 msgid "found too many transitions in mkxtion()" msgstr "найдено Ñлишком много переходов в mkxtion()" -#: nfa.c:714 +#: 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] Ñомнительно в Ñканере, не чувÑтвительном к региÑтру" +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:] Ñомнительно Ð´Ð»Ñ Ñканера, не чувÑтвительного к региÑтру" +msgstr "" +"иÑпользование [:^lower:] Ñомнительно Ð´Ð»Ñ Ñканера, не чувÑтвительного к " +"региÑтру" -#: parse.y:922 +#: src/parse.y:924 msgid "[:^upper:] ambiguous in case insensitive scanner" -msgstr "иÑпользование [:^upper:] Ñомнительно Ð´Ð»Ñ Ñканера, не чувÑтвительного к региÑтру" +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 "вÑтречен EOF внутри дейÑтвиÑ" -#: scan.l:945 +#: src/scan.l:977 msgid "EOF encountered inside pattern" msgstr "вÑтречен EOF внутри шаблона" -#: 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 "неожиданный EOF" -#: 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 "ошибка при работе Ñ Ð´Ð¸Ð½Ð°Ð¼Ð¸Ñ‡ÐµÑкой памÑтью в copy_string()" + #~ msgid "consistency check failed in symfollowset" #~ msgstr "ошибка при проверке на целоÑтноÑÑ‚ÑŒ в symfollowset" @@ -6,7 +6,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-10-30 18:20+0200\n" "Last-Translator: МироÑлав Ðиколић <miroslavnikolic@rocketmail.com>\n" "Language-Team: Serbian <(nothing)>\n" @@ -14,44 +14,46 @@ 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" -#: 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 "Ðије уÑпело додељивање међумеморије за одредницу м4" -#: buf.c:197 +#: src/buf.c:198 msgid "Allocation of buffer for m4 undef failed" msgstr "Ðије уÑпело додељивање међумеморије за поништавање одреднице м4" -#: 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" @@ -60,11 +62,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" @@ -76,24 +78,24 @@ msgstr "" "ДФРиÑпиÑ:\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" @@ -105,29 +107,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" @@ -137,392 +139,403 @@ 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 "Ðе могу да запишем „ychk_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“ Ñу неÑаглаÑни Ñа режимом лекÑ-ÑаглаÑноÑти" -#: 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 "%aниз није ÑаглаÑан Ñа опцијом -+" -#: 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 "бизонов моÑÑ‚ није подржан за Ц++ Ñкенер." -#: 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 ÐФРÑтања\n" -#: main.c:823 +#: src/main.c:836 #, c-format msgid " %d/%d DFA states (%d words)\n" msgstr " %d/%d ДФРÑтања (%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" +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 уноÑа оÑновне одреднице\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 једнак ДФÐ-Ñу\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 опција ÑаглаÑноÑти ÐТ&Т лекÑа изазива велико Ñмањење учинка\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" -msgstr "%%опција „yylineno“ изазива Ñмањење учинка СÐМО на правилима која могу да поклопе знакове новог реда\n" +msgid "" +"%%option yylineno entails a performance penalty ONLY on rules that can match " +"newline characters\n" +msgstr "" +"%%опција „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 "%oпција „yylineno“ не може да Ñе кориÑти Ñа „REJECT“" -#: main.c:1572 +#: src/main.c:1579 msgid "variable trailing context rules cannot be used with -f or -F" -msgstr "променљива правила пратећег контекÑта не могу бити коришћена Ñа „-f“ или „-F“" +msgstr "" +"променљива правила пратећег контекÑта не могу бити коришћена Ñа „-f“ или „-F“" -#: main.c:1695 +#: src/main.c:1704 #, c-format msgid "%option yyclass only meaningful for C++ scanners" msgstr "%oпција „yyclass“ има ÑмиÑла Ñамо за Ц++ Ñкенере" -#: 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" @@ -545,13 +558,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" @@ -573,8 +589,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" @@ -588,31 +602,41 @@ msgstr "" "Стварајте програме који обављају поклапање према шаблону у текÑту.\n" "\n" "Сабијање табеле:\n" -" -Ca, --align обрађује веће табеле зарад бољег поравнања меморије\n" +" -Ca, --align обрађује веће табеле зарад бољег поравнања " +"меморије\n" " -Ce, --ecs изграђује разреде једнакоÑти\n" -" -Cf не Ñажима табеле; кориÑти „-f“ representation†предÑтављање\n" -" -CF не Ñажима табеле; кориÑти „-F“ representation†предÑтављање\n" +" -Cf не Ñажима табеле; кориÑти „-f“ " +"representation†предÑтављање\n" +" -CF не Ñажима табеле; кориÑти „-F“ " +"representation†предÑтављање\n" " -Cm, --meta-ecs изграђује разреде мета-једнакоÑти\n" -" -Cr, --read кориÑти „read()умеÑто Ñтндардног уи за улаз Ñкенера\n" +" -Cr, --read кориÑти „read()умеÑто Ñтндардног уи за улаз " +"Ñкенера\n" " -f, --full Ñтвара брзи, велики Ñкенер. ИÑто као „-Cfr“\n" -" -F, --fast кориÑти заменÑко предÑтављање табеле. ИÑто као „-CFr“\n" -" -Cem задато Ñажимање (иÑто као „--ecs --meta-ecs“)\n" +" -F, --fast кориÑти заменÑко предÑтављање табеле. ИÑто " +"као „-CFr“\n" +" -Cem задато Ñажимање (иÑто као „--ecs --meta-" +"ecs“)\n" "\n" "Прочишћавање:\n" " -d, --debug укључује режим прочишћавања у Ñкенеру\n" " -b, --backup запиÑује податке о Ñтварању резерве у „%s“\n" " -p, --perf-report запиÑује извештај о учинку Ñтандардну грешку\n" -" -s, --nodefault потиÑкује задато правило у „ECHO“ непоклопљени текÑÑ‚\n" +" -s, --nodefault потиÑкује задато правило у „ECHO“ " +"непоклопљени текÑÑ‚\n" " -T, --trace %s треба да ради у режиму праћења\n" " -w, --nowarn не Ñтвара упозорења\n" -" -v, --verbose запиÑује Ñажетак ÑтатиÑтике Ñкенера на Ñтандардни излаз\n" +" -v, --verbose запиÑује Ñажетак ÑтатиÑтике Ñкенера на " +"Ñтандардни излаз\n" "\n" "Датотеке:\n" " -o, --outfile=ДÐТОТЕКРнаводи излазни назив датотеке\n" " -S, --skel=ДÐТОТЕКРнаводи датотеку окоÑнице\n" -" -t, --stdout запиÑује Ñкенер на Ñтандардни излазумеÑто на „%s“\n" +" -t, --stdout запиÑује Ñкенер на Ñтандардни излазумеÑто на " +"„%s“\n" " --yyclass=ÐÐЗИВ назив Ц++ разреда\n" -" --header-file=ДÐТОТЕКРÑтвара датотеку Ц заглавља као додатак Ñкенеру\n" +" --header-file=ДÐТОТЕКРÑтвара датотеку Ц заглавља као додатак " +"Ñкенеру\n" " --tables-file[=ДÐТОТЕКÐ] запиÑује табеле у ДÐТОТЕКУ\n" "\n" "Понашање Ñкенера:\n" @@ -622,7 +646,8 @@ msgstr "" " -i, --case-insensitive занемарује величину Ñлова у шаблонима\n" " -l, --lex-compat највећа ÑаглаÑноÑÑ‚ Ñа изворним лекÑом\n" " -X, --posix-compat највећа ÑаглаÑноÑÑ‚ Ñа лекÑом ПОСИКС-а\n" -" -I, --interactive Ñтвара међудејÑтвени Ñкенер (Ñупротно од „-B“)\n" +" -I, --interactive Ñтвара међудејÑтвени Ñкенер (Ñупротно од „-" +"B“)\n" " --yylineno прати број реда у „yylineno“\n" "\n" "Створени код:\n" @@ -646,51 +671,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 "није уÑпело додељивање меморије у „allocate_array()“" -#: misc.c:230 +#: src/misc.c:205 #, c-format msgid "bad character '%s' detected in check_char()" msgstr "лош знак „%s“ је откривен у „check_char()“" -#: 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 "неуÑпех динамичке меморије у „copy_string()“" +#: src/misc.c:229 +#, fuzzy +msgid "memory allocation failure in xstrdup()" +msgstr "није уÑпело додељивање меморије у „allocate_array()“" -#: 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" @@ -701,226 +727,237 @@ msgstr "" "\n" "********** започињем иÑÐ¿Ð¸Ñ Ð½Ñ„Ð°-а Ñа почетним Ñтањем %d\n" -#: nfa.c:115 +#: src/nfa.c:111 #, c-format msgid "state # %4d\t" msgstr "Ñтање # %4d" -#: 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.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 "непозната %%опција: %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 "*Ðешто је чудно* — ток: %d вред: %d\n" + +#~ msgid "dynamic memory failure in copy_string()" +#~ msgstr "неуÑпех динамичке меморије у „copy_string()“" @@ -1,49 +1,75 @@ # Swedish messages for flex. -# Copyright (C) 2003 The Flex Project +# Copyright (C) 2014 The Flex Project (msgids) +# This file is distributed under the same license as the flex package. +# # Johan Linde <jl@theophys.kth.se>, 1996. # Christian Rose <menthos@menthos.com>, 2002, 2004. +# Göran Uddeborg <goeran@uddeborg.se>, 2016 # +# $Revision: 1.5 $ msgid "" msgstr "" -"Project-Id-Version: flex 2.5.31\n" -"POT-Creation-Date: 2003-04-01 11:33-0500\n" -"PO-Revision-Date: 2004-03-21 22:51+0100\n" -"Last-Translator: Christian Rose <menthos@menthos.com>\n" -"Language-Team: Swedish <sv@li.org>\n" +"Project-Id-Version: flex 2.5.38\n" +"Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n" +"POT-Creation-Date: 2017-05-06 10:49-0400\n" +"PO-Revision-Date: 2016-06-06 19:10+0200\n" +"Last-Translator: Göran Uddeborg <goeran@uddeborg.se>\n" +"Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n" +"Language: sv\n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=iso-8859-1\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" + +#: src/buf.c:79 +msgid "Allocation of buffer to print string failed" +msgstr "Allokeringen av buffert för utskriftssträng misslyckades" + +#: src/buf.c:107 +msgid "Allocation of buffer for line directive failed" +msgstr "Allokeringen av buffert för raddirektiv misslyckades" -#: dfa.c:61 +#: src/buf.c:177 +msgid "Allocation of buffer for m4 def failed" +msgstr "Allokeringen av buffert för m4-def misslyckades" + +#: src/buf.c:198 +msgid "Allocation of buffer for m4 undef failed" +msgstr "Allokering av buffert för m4-undef misslyckades" + +#: src/dfa.c:59 #, c-format msgid "State #%d is non-accepting -\n" -msgstr "Tillstånd %d är icke-accepterande -\n" +msgstr "TillstÃ¥nd %d är icke-accepterande -\n" -#: dfa.c:124 +#: src/dfa.c:119 msgid "dangerous trailing context" -msgstr "farligt efterföljande sammanhang" +msgstr "farlig efterföljande kontext" -#: dfa.c:166 +#: src/dfa.c:159 +#, c-format msgid " associated rule line numbers:" -msgstr " radnummer för associerad regel:" +msgstr " radnummer för associerad regel:" -#: dfa.c:202 +#: src/dfa.c:193 +#, c-format msgid " out-transitions: " -msgstr " utövergångar: " +msgstr " utövergÃ¥ngar: " -#: dfa.c:210 +#: src/dfa.c:201 +#, c-format msgid "" "\n" " jam-transitions: EOF " msgstr "" "\n" -" stoppövergångar: filslut " +" stoppövergÃ¥ngar: filslut " -#: dfa.c:341 +#: src/dfa.c:331 msgid "consistency check failed in epsclosure()" msgstr "konsekvenskontrollen misslyckades i epsclosure()" -#: dfa.c:429 +#: src/dfa.c:419 msgid "" "\n" "\n" @@ -55,30 +81,26 @@ msgstr "" "DFA-utskrift:\n" "\n" -#: dfa.c:604 +#: src/dfa.c:587 msgid "could not create unique end-of-buffer state" -msgstr "kunde inte skapa ett unikt buffertsluttillstånd" +msgstr "kunde inte skapa ett unikt buffertsluttillstÃ¥nd" -#: dfa.c:625 +#: src/dfa.c:608 #, c-format msgid "state # %d:\n" -msgstr "tillstånd %d:\n" +msgstr "tillstÃ¥nd %d:\n" -# Det här är ju helt sjukt. Har buggrapporterat detta att det bör -# ersättas med %s -#: dfa.c:800 +# Det här är ju helt sjukt. Har buggrapporterat detta att det bör +# ersättas med %s +#: src/dfa.c:768 msgid "Could not write yynxt_tbl[][]" msgstr "Kunde inte skriva yynxt_tbl[][]" -#: dfa.c:1023 -msgid "consistency check failed in symfollowset" -msgstr "konsekvenskontrollen misslyckades i symfollowset" - -#: dfa.c:1071 +#: src/dfa.c:1028 msgid "bad transition character detected in sympartition()" -msgstr "otillåtet övergångstecken funnet i sympartition()" +msgstr "otillÃ¥tet övergÃ¥ngstecken funnet i sympartition()" -#: gen.c:484 +#: src/gen.c:480 msgid "" "\n" "\n" @@ -90,29 +112,29 @@ msgstr "" "Ekvivalensklasser:\n" "\n" -#: gen.c:668 gen.c:697 gen.c:1221 +#: src/gen.c:669 src/gen.c:698 src/gen.c:1218 #, c-format msgid "state # %d accepts: [%d]\n" -msgstr "tillstånd %d accepterar: [%d]\n" +msgstr "tillstÃ¥nd %d accepterar: [%d]\n" -#: gen.c:1116 +#: src/gen.c:1115 #, c-format msgid "state # %d accepts: " -msgstr "tillstånd %d accepterar: " +msgstr "tillstÃ¥nd %d accepterar: " -#: gen.c:1163 +#: src/gen.c:1162 msgid "Could not write yyacclist_tbl" msgstr "Kunde inte skriva yyacclist_tbl" -#: gen.c:1239 +#: src/gen.c:1236 msgid "Could not write yyacc_tbl" msgstr "Kunde inte skriva yyacc_tbl" -#: gen.c:1254 gen.c:1639 gen.c:1662 +#: src/gen.c:1251 src/gen.c:1623 src/gen.c:1646 msgid "Could not write ecstbl" msgstr "Kunde inte skriva ecstbl" -#: gen.c:1277 +#: src/gen.c:1271 msgid "" "\n" "\n" @@ -122,377 +144,407 @@ msgstr "" "\n" "Metaekvivalensklasser:\n" -#: gen.c:1299 +#: src/gen.c:1293 msgid "Could not write yymeta_tbl" msgstr "Kunde inte skriva yymeta_tbl" -#: gen.c:1360 +#: src/gen.c:1352 msgid "Could not write yybase_tbl" msgstr "Kunde inte skriva yybase_tbl" -#: gen.c:1394 +#: src/gen.c:1384 msgid "Could not write yydef_tbl" msgstr "Kunde inte skriva yydef_tbl" -#: gen.c:1434 +#: src/gen.c:1422 msgid "Could not write yynxt_tbl" msgstr "Kunde inte skriva yynxt_tbl" -#: gen.c:1470 +#: src/gen.c:1456 msgid "Could not write yychk_tbl" msgstr "Kunde inte skriva yychk_tbl" -#: gen.c:1624 gen.c:1653 +#: src/gen.c:1608 src/gen.c:1637 msgid "Could not write ftbl" msgstr "Kunde inte skriva ftbl" -#: gen.c:1630 +#: src/gen.c:1614 msgid "Could not write ssltbl" msgstr "Kunde inte skriva ssltbl" -#: gen.c:1681 +#: src/gen.c:1665 msgid "Could not write eoltbl" msgstr "Kunde inte skriva eoltbl" -#: gen.c:1741 +#: src/gen.c:1722 msgid "Could not write yynultrans_tbl" msgstr "Kunde inte skriva yynultrans_tbl" -#: main.c:176 +#: src/main.c:178 msgid "rule cannot be matched" msgstr "regeln kan inte matchas" -#: main.c:181 +#: src/main.c:183 msgid "-s option given but default rule can be matched" -msgstr "flaggan -s angiven men standardregeln kan följas" +msgstr "flaggan -s angiven men standardregeln kan följas" -#: main.c:217 +#: src/main.c:221 msgid "Can't use -+ with -l option" -msgstr "-+ kan inte användas tillsammans med flaggan -l" +msgstr "-+ kan inte användas tillsammans med flaggan -l" -#: main.c:220 +#: src/main.c:224 msgid "Can't use -f or -F with -l option" -msgstr "-f eller -F kan inte användas tillsammans med flaggan -l" +msgstr "-f eller -F kan inte användas tillsammans med flaggan -l" -#: main.c:224 +#: src/main.c:228 msgid "Can't use --reentrant or --bison-bridge with -l option" -msgstr "--reentrant eller --bison-bridge kan inte användas tillsammans med flaggan -l" +msgstr "" +"--reentrant eller --bison-bridge kan inte användas tillsammans med flaggan -l" -#: main.c:261 +#: src/main.c:260 msgid "-Cf/-CF and -Cm don't make sense together" -msgstr "-Cf/-CF och -Cm kan inte användas tillsammans" +msgstr "-Cf/-CF och -Cm kan inte användas tillsammans" -#: main.c:264 +#: src/main.c:263 msgid "-Cf/-CF and -I are incompatible" -msgstr "-Cf/-CF och -I kan inte användas tillsammans" +msgstr "-Cf/-CF och -I kan inte användas tillsammans" -#: main.c:268 +#: src/main.c:267 msgid "-Cf/-CF are incompatible with lex-compatibility mode" -msgstr "-Cf/-CF kan inte användas i lex-kompatibilitetsläge" +msgstr "-Cf/-CF kan inte användas i lex-kompatibilitetsläge" -#: main.c:273 +#: src/main.c:272 msgid "-Cf and -CF are mutually exclusive" -msgstr "-Cf och -CF är ömsesidigt uteslutande" +msgstr "-Cf och -CF är ömsesidigt uteslutande" -#: main.c:277 +#: src/main.c:276 msgid "Can't use -+ with -CF option" -msgstr "-+ kan inte användas tillsammans med flaggan -CF" +msgstr "-+ kan inte användas tillsammans med flaggan -CF" -#: main.c:280 +#: src/main.c:279 #, c-format msgid "%array incompatible with -+ option" -msgstr "%array kan inte användas tillsammans med flaggan -+" +msgstr "%array kan inte användas tillsammans med flaggan -+" -#: main.c:285 +#: src/main.c:284 msgid "Options -+ and --reentrant are mutually exclusive." -msgstr "Flaggorna -+ och --reentrant är ömsesidigt uteslutande." +msgstr "Flaggorna -+ och --reentrant är ömsesidigt uteslutande." -#: main.c:288 +#: src/main.c:287 msgid "bison bridge not supported for the C++ scanner." -msgstr "bisonbrygga stöds inte för C++-inläsaren." +msgstr "bisonbrygga stöds inte för C++-inläsaren." -#: main.c:340 main.c:385 +#: src/main.c:336 src/main.c:419 #, c-format msgid "could not create %s" msgstr "kunde inte skapa %s" -#: main.c:398 +#: src/main.c:431 msgid "could not write tables header" msgstr "kunde inte skriva tabellhuvud" -#: main.c:402 +#: src/main.c:435 #, c-format msgid "can't open skeleton file %s" -msgstr "kan inte öppna mallfilen %s" +msgstr "kan inte öppna mallfilen %s" + +#: src/main.c:450 +msgid "Prefix cannot include '[' or ']'" +msgstr "" -#: main.c:483 +#: src/main.c:474 +msgid "allocation of macro definition failed" +msgstr "allokering av makrodefinitioner misslyckades" + +#: src/main.c:521 #, c-format msgid "input error reading skeleton file %s" -msgstr "indatafel vid läsande av mallfilen %s" +msgstr "indatafel vid läsande av mallfilen %s" -#: main.c:487 +#: src/main.c:525 #, c-format msgid "error closing skeleton file %s" -msgstr "fel vid stängande av mallfilen %s" +msgstr "fel vid stängande av mallfilen %s" -#: main.c:671 +#: src/main.c:709 #, c-format msgid "error creating header file %s" msgstr "fel vid skapande av huvudfilen %s" -#: main.c:679 +#: src/main.c:717 #, c-format msgid "error writing output file %s" msgstr "fel vid skrivande av utfilen %s" -#: main.c:683 +#: src/main.c:721 #, c-format msgid "error closing output file %s" -msgstr "fel vid stängande av utfilen %s" +msgstr "fel vid stängande av utfilen %s" -#: main.c:687 +#: src/main.c:725 #, c-format msgid "error deleting output file %s" msgstr "fel vid borttagning av utfilen %s" -# "Back up" i det här sammanhanget handlar om att flexmaskinen backar. -#: main.c:694 +# "Back up" i det här sammanhanget handlar om att flexmaskinen backar. +#: src/main.c:732 +#, c-format msgid "No backing up.\n" msgstr "Backar inte.\n" -#: main.c:698 +#: src/main.c:736 #, c-format msgid "%d backing up (non-accepting) states.\n" -msgstr "%d säkerhetskopierande (icke-accepterande) tillstånd.\n" +msgstr "%d backar (icke-accepterande) tillstÃ¥nd.\n" -#: main.c:702 +#: src/main.c:740 +#, c-format msgid "Compressed tables always back up.\n" -msgstr "Komprimerade tabeller säkerhetskopierar alltid.\n" +msgstr "Komprimerade tabeller backar alltid.\n" -#: main.c:705 +#: src/main.c:743 #, c-format msgid "error writing backup file %s" -msgstr "fel när säkerhetskopian %s skulle skrivas" +msgstr "fel när backningsfilen %s skrevs" -#: main.c:709 +#: src/main.c:747 #, c-format msgid "error closing backup file %s" -msgstr "fel när säkerhetskopian %s skulle stängas" +msgstr "fel när backningsfilen %s stängdes" -#: main.c:714 +#: src/main.c:752 #, c-format msgid "%s version %s usage statistics:\n" -msgstr "Statistik över användning av %s version %s:\n" +msgstr "Statistik över användning av %s version %s:\n" -#: main.c:717 +#: src/main.c:755 +#, c-format msgid " scanner options: -" -msgstr " inläsarflaggor: -" +msgstr " inläsarflaggor: -" -#: main.c:796 +#: src/main.c:834 #, c-format msgid " %d/%d NFA states\n" -msgstr " %d/%d NFA-tillstånd\n" +msgstr " %d/%d NFA-tillstÃ¥nd\n" -#: main.c:798 +#: src/main.c:836 #, c-format msgid " %d/%d DFA states (%d words)\n" -msgstr " %d/%d DFA-tillstånd (%d ord)\n" +msgstr " %d/%d DFA-tillstÃ¥nd (%d ord)\n" -#: main.c:800 +#: src/main.c:838 #, c-format msgid " %d rules\n" msgstr " %d regler\n" -#: main.c:805 +#: src/main.c:843 +#, c-format msgid " No backing up\n" -msgstr " Inget säkerhetskopierande\n" +msgstr " Inget backande\n" -#: main.c:809 +#: src/main.c:847 #, c-format msgid " %d backing-up (non-accepting) states\n" -msgstr " %d (icke-accepterande) tillstånd för säkerhetskopiering\n" +msgstr " %d backande (icke-accepterande) tillstÃ¥nd\n" -#: main.c:814 +#: src/main.c:852 +#, c-format msgid " Compressed tables always back-up\n" -msgstr " Komprimerade tabeller säkerhetskopierar alltid\n" +msgstr " Komprimerade tabeller backar alltid\n" -#: main.c:818 +#: src/main.c:856 +#, c-format msgid " Beginning-of-line patterns used\n" -msgstr " Början-av-rad-mönster använda\n" +msgstr " Början-av-rad-mönster använda\n" -#: main.c:820 +#: src/main.c:858 #, c-format msgid " %d/%d start conditions\n" msgstr " %d/%d startvillkor\n" -#: main.c:824 +#: src/main.c:862 #, c-format msgid " %d epsilon states, %d double epsilon states\n" -msgstr " %d epsilontillstånd, %d dubbla epsilontillstånd\n" +msgstr " %d epsilontillstÃ¥nd, %d dubbla epsilontillstÃ¥nd\n" -#: main.c:828 +#: src/main.c:866 +#, c-format msgid " no character classes\n" msgstr " inga teckenklasser\n" -#: main.c:832 +#: src/main.c:870 #, c-format msgid " %d/%d character classes needed %d/%d words of storage, %d reused\n" -msgstr " %d/%d teckenklasser behövde %d/%d ord för lagring, %d återanvända\n" +msgstr " %d/%d teckenklasser behövde %d/%d ord för lagring, %d Ã¥teranvända\n" -#: main.c:837 +#: src/main.c:875 #, c-format msgid " %d state/nextstate pairs created\n" -msgstr " %d par med tillstånd/nästa-tillstånd skapade\n" +msgstr " %d par med tillstÃ¥nd/nästa-tillstÃ¥nd skapade\n" -#: main.c:840 +#: src/main.c:878 #, c-format msgid " %d/%d unique/duplicate transitions\n" -msgstr " %d/%d unika/duplicerade övergångar\n" +msgstr " %d/%d unika/duplicerade övergÃ¥ngar\n" -#: main.c:845 +#: src/main.c:883 #, c-format msgid " %d table entries\n" msgstr " %d tabellposter\n" -#: main.c:853 +#: src/main.c:891 #, c-format msgid " %d/%d base-def entries created\n" msgstr " %d/%d basstandardposter skapade\n" -#: main.c:857 +#: src/main.c:895 #, c-format msgid " %d/%d (peak %d) nxt-chk entries created\n" -msgstr " %d/%d (max %d) poster för nästa kontroll skapade\n" +msgstr " %d/%d (max %d) poster för nästa kontroll skapade\n" -#: main.c:861 +#: src/main.c:899 #, c-format msgid " %d/%d (peak %d) template nxt-chk entries created\n" -msgstr " %d/%d (max %d) mallposter för nästa kontroll skapade\n" +msgstr " %d/%d (max %d) mallposter för nästa kontroll skapade\n" -#: main.c:865 +#: src/main.c:903 #, c-format msgid " %d empty table entries\n" msgstr " %d tomma tabellposter\n" -#: main.c:867 +#: src/main.c:905 #, c-format msgid " %d protos created\n" msgstr " %d prototyper skapade\n" -#: main.c:870 +#: src/main.c:908 #, c-format msgid " %d templates created, %d uses\n" -msgstr " %d mallar skapade, %d användningar\n" +msgstr " %d mallar skapade, %d användningar\n" -#: main.c:878 +#: src/main.c:916 #, c-format msgid " %d/%d equivalence classes created\n" msgstr " %d/%d ekvivalensklasser skapade\n" -#: main.c:886 +#: src/main.c:924 #, c-format msgid " %d/%d meta-equivalence classes created\n" msgstr " %d/%d metaekvivalensklasser skapade\n" -#: main.c:892 +#: src/main.c:930 #, c-format msgid " %d (%d saved) hash collisions, %d DFAs equal\n" msgstr " %d (%d sparade) hashkollisioner, %d DFA lika\n" -#: main.c:894 +#: src/main.c:932 #, c-format msgid " %d sets of reallocations needed\n" -msgstr " %d uppsättningar med omallokeringar krävdes\n" +msgstr " %d uppsättningar med omallokeringar krävdes\n" -#: main.c:896 +#: src/main.c:934 #, c-format msgid " %d total table entries needed\n" -msgstr " %d tabellposter krävs totalt\n" +msgstr " %d tabellposter krävs totalt\n" -#: main.c:971 +#: src/main.c:1008 +#, c-format msgid "Internal error. flexopts are malformed.\n" -msgstr "Internt fel. flexopts är felaktiga.\n" +msgstr "Internt fel. flexopts är felaktiga.\n" -#: main.c:981 +#: src/main.c:1018 #, c-format msgid "Try `%s --help' for more information.\n" -msgstr "Prova \"%s --help\" för mer information.\n" +msgstr "Prova \"%s --help\" för mer information.\n" -#: main.c:1038 +#: src/main.c:1075 #, c-format msgid "unknown -C option '%c'" -msgstr "okänd flagga till -C \"%c\"" +msgstr "okänd flagga till -C \"%c\"" -#: main.c:1167 +#: src/main.c:1204 #, c-format msgid "%s %s\n" msgstr "%s %s\n" -#: main.c:1442 +#: src/main.c:1476 msgid "fatal parse error" msgstr "allvarligt fel vid tolkningen" -#: main.c:1474 +#: src/main.c:1508 #, c-format msgid "could not create backing-up info file %s" -msgstr "kunde inte skapa filen %s med säkerhetskopieringsinformation" +msgstr "kunde inte skapa filen %s med backningsinformation" -#: main.c:1495 +#: src/main.c:1529 +#, c-format msgid "-l AT&T lex compatibility option entails a large performance penalty\n" -msgstr "flaggan -l för beteende som AT&T:s lex medför en väsentlig prestandaförlust\n" +msgstr "" +"flaggan -l för beteende som AT&T:s lex medför en väsentlig prestandaförlust\n" -#: main.c:1498 +#: src/main.c:1532 +#, c-format msgid " and may be the actual source of other reported performance penalties\n" msgstr " och kan vara den egentliga orsaken till andra rapporter om detta\n" -#: main.c:1504 +#: src/main.c:1538 #, c-format -msgid "%%option yylineno entails a performance penalty ONLY on rules that can match newline characters\n" -msgstr "%%option yylineno medför en prestandaförlust ENDAST på regler som kan matcha nyradstecken\n" +msgid "" +"%%option yylineno entails a performance penalty ONLY on rules that can match " +"newline characters\n" +msgstr "" +"%%option yylineno medför en prestandaförlust ENDAST pÃ¥ regler som kan matcha " +"nyradstecken\n" -#: main.c:1511 +#: src/main.c:1545 +#, c-format msgid "-I (interactive) entails a minor performance penalty\n" -msgstr "-I (interaktiv) medför en mindre prestandaförlust\n" +msgstr "-I (interaktiv) medför en mindre prestandaförlust\n" -#: main.c:1516 +#: src/main.c:1550 +#, c-format msgid "yymore() entails a minor performance penalty\n" -msgstr "yymore() medför en mindre prestandaförlust\n" +msgstr "yymore() medför en mindre prestandaförlust\n" -#: main.c:1522 +#: src/main.c:1556 +#, c-format msgid "REJECT entails a large performance penalty\n" -msgstr "REJECT medför en väsentlig prestandaförlust\n" +msgstr "REJECT medför en väsentlig prestandaförlust\n" -#: main.c:1527 +#: src/main.c:1561 +#, c-format msgid "Variable trailing context rules entail a large performance penalty\n" -msgstr "Regler för varierbar efterföljande sammanhang medför en väsentlig prestandaförlust\n" +msgstr "" +"Regler för varierbar efterföljande kontext medför en väsentlig " +"prestandaförlust\n" -#: main.c:1539 +#: src/main.c:1573 msgid "REJECT cannot be used with -f or -F" -msgstr "REJECT kan inte användas tillsammans med -f eller -F" +msgstr "REJECT kan inte användas tillsammans med -f eller -F" -#: main.c:1542 +#: src/main.c:1576 #, c-format msgid "%option yylineno cannot be used with REJECT" -msgstr "%option yylineno kan inte användas tillsammans med REJECT" +msgstr "%option yylineno kan inte användas tillsammans med REJECT" -#: main.c:1545 +#: src/main.c:1579 msgid "variable trailing context rules cannot be used with -f or -F" msgstr "" -"regler för varierbar efterföljande kontext kan inte användas\n" +"regler för varierbar efterföljande kontext kan inte användas\n" "tillsammans med -f eller -F" -#: main.c:1661 +#: src/main.c:1704 #, c-format msgid "%option yyclass only meaningful for C++ scanners" -msgstr "%option yyclass är bara meningsfull för C++-inläsare" +msgstr "%option yyclass är bara meningsfull för C++-inläsare" -#: main.c:1768 +#: src/main.c:1791 #, c-format msgid "Usage: %s [OPTIONS] [FILE]...\n" -msgstr "Användning: %s [FLAGGOR] [FIL]...\n" +msgstr "Användning: %s [FLAGGOR] [FIL]...\n" -#: main.c:1771 -#, c-format +#: src/main.c:1794 +#, fuzzy, c-format msgid "" "Generates programs that perform pattern-matching on text.\n" "\n" @@ -515,13 +567,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" @@ -543,8 +598,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" @@ -555,56 +608,56 @@ msgid "" " -h, --help produce this help message\n" " -V, --version report %s version\n" msgstr "" -"Genererar program som utför mönstermatchning på text.\n" +"Genererar program som utför mönstermatchning pÃ¥ text.\n" "\n" "Tabellkomprimering:\n" -" -Ca, --align bättre minnesjustering till priset av större tabeller\n" +" -Ca, --align bättre minnesjustering till priset av större tabeller\n" " -Ce, --ecs konstruera ekvivalensklasser\n" -" -Cf komprimera inte tabeller; använd -f-representation\n" -" -CF komprimera inte tabeller; använd -F-representation\n" +" -Cf komprimera inte tabeller; använd -f-representation\n" +" -CF komprimera inte tabeller; använd -F-representation\n" " -Cm, --meta-ecs konstruera metaekvivalensklasser\n" -" -Cr, --read använd read() istället för stdio för inläsarindata\n" -" -f, --full generera snabb, stor inläsare. Samma som -Cfr\n" -" -F, --fast använd alternativ tabellrepresentation. Samma som -CFr\n" +" -Cr, --read använd read() istället för stdio för inläsarindata\n" +" -f, --full generera snabb, stor inläsare. Samma som -Cfr\n" +" -F, --fast använd alternativ tabellrepresentation. Samma som -CFr\n" " -Cem standardkomprimering (samma som --ecs --meta-ecs)\n" "\n" -"Felsökning:\n" -" -d, --debug aktivera felsökningsläge i inläsare\n" -" -b, --backup skriv säkerhetskopieringsinformation till %s\n" +"Felsökning:\n" +" -d, --debug aktivera felsökningsläge i inläsare\n" +" -b, --backup skriv backningsinformation till %s\n" " -p, --perf-report skriv prestandarapport till standard fel\n" -" -s, --nodefault undertryck standardregel att använda \"ECHO\" på\n" +" -s, --nodefault undertryck standardregel att använda \"ECHO\" pÃ¥\n" " omatchad text\n" -" -T, --trace %s ska köra i spårningsläge\n" +" -T, --trace %s ska köra i spÃ¥rningsläge\n" " -w, --nowarn generera inte varningar\n" -" -v, --verbose skriv sammanfattning av inläsarstatistik till\n" +" -v, --verbose skriv sammanfattning av inläsarstatistik till\n" " standard ut\n" "\n" "Filer:\n" -" -o, --outfile=FIL ange namn på utfil\n" +" -o, --outfile=FIL ange namn pÃ¥ utfil\n" " -S, --skel=FIL ange mallfil\n" -" -t, --stdout skriv inläsare på standard ut istället för %s\n" -" --yyclass=NAMN namn på C++-klass\n" -" --header-file=FIL skapa en C-huvudfil förutom inläsaren\n" +" -t, --stdout skriv inläsare pÃ¥ standard ut istället för %s\n" +" --yyclass=NAMN namn pÃ¥ C++-klass\n" +" --header-file=FIL skapa en C-huvudfil förutom inläsaren\n" " --tables-file[=FIL] skriv tabeller till FIL\n" "\n" -"Beteende för inläsare:\n" -" -7, --7bit generera 7-bitarsinläsare\n" -" -8, --8bit generera 8-bitarsinläsare\n" -" -B, --batch generera batchinläsare (motsats till -I)\n" -" -i, --case-insensitive ignorera skiftläge i mönster\n" +"Beteende för inläsare:\n" +" -7, --7bit generera 7-bitarsinläsare\n" +" -8, --8bit generera 8-bitarsinläsare\n" +" -B, --batch generera batchinläsare (motsats till -I)\n" +" -i, --case-insensitive ignorera skiftläge i mönster\n" " -l, --lex-compat maximal kompatibilitet med ursprungliga lex\n" " -X, --posix-compat maximal kompatibilitet med POSIX lex\n" -" -I, --interactive generera interaktiv inläsare (motsats till -B)\n" -" --yylineno spåra radantal i yylineno\n" +" -I, --interactive generera interaktiv inläsare (motsats till -B)\n" +" --yylineno spÃ¥ra radantal i yylineno\n" "\n" "Genererad kod:\n" -" -+, --c++ generera C++-inläsarklass\n" -" -Dmacro[=defn] definiera makrodefinition (standardefn är \"1\")\n" -" -L, --noline undertryck #line-direktiv i inläsaren\n" -" -P, --prefix=STRÄNG använd STRÄNG som prefix istället för \"yy\"\n" -" -R, --reentrant generera en återanropbar C-inläsare\n" -" --bison-bridge inläsare för ren bisontolk.\n" -" --bison-locations inkludera stöd för yylloc.\n" +" -+, --c++ generera C++-inläsarklass\n" +" -Dmacro[=defn] definiera makrodefinition (standardefn är \"1\")\n" +" -L, --noline undertryck #line-direktiv i inläsaren\n" +" -P, --prefix=STRÄNG använd STRÄNG som prefix istället för \"yy\"\n" +" -R, --reentrant generera en Ã¥teranropbar C-inläsare\n" +" --bison-bridge inläsare för ren bisontolk.\n" +" --bison-locations inkludera stöd för yylloc.\n" " --stdinit initiera yyin/yyout till standard in/ut\n" " --noansi-definitions funktionsdefinitioner i gammal stil\n" " --noansi-prototypes tom parameterlista i prototyper\n" @@ -612,53 +665,58 @@ msgstr "" " --noFUNKTION generera inte en speciell FUNKTION\n" "\n" "Diverse:\n" -" -c POSIX-flagga som inte gör något\n" -" -n POSIX-flagga som inte gör något\n" +" -c POSIX-flagga som inte gör nÃ¥got\n" +" -n POSIX-flagga som inte gör nÃ¥got\n" " -?\n" -" -h, --help visa detta hjälpmeddelande\n" -" -V, --version visa versionsinformation för %s\n" +" -h, --help visa detta hjälpmeddelande\n" +" -V, --version visa versionsinformation för %s\n" + +#: src/misc.c:64 +msgid "allocation of sko_stack failed" +msgstr "allokering av sko_stack misslyckades" -#: misc.c:100 misc.c:126 +#: src/misc.c:100 #, c-format msgid "name \"%s\" ridiculously long" -msgstr "namnet \"%s\" är löjligt långt" +msgstr "namnet \"%s\" är löjligt lÃ¥ngt" -#: misc.c:175 +#: src/misc.c:155 msgid "memory allocation failed in allocate_array()" msgstr "minnesallokeringen misslyckades i allocate_array()" -#: misc.c:250 +#: src/misc.c:205 #, c-format msgid "bad character '%s' detected in check_char()" -msgstr "otillåtet tecken \"%s\" funnet i check_char()" +msgstr "otillÃ¥tet tecken \"%s\" funnet i check_char()" -#: misc.c:255 +#: src/misc.c:210 #, c-format msgid "scanner requires -8 flag to use the character %s" -msgstr "inläsaren kräver flaggan -8 för att kunna använda tecknet %s" +msgstr "inläsaren kräver flaggan -8 för att kunna använda tecknet %s" -#: misc.c:288 -msgid "dynamic memory failure in copy_string()" -msgstr "dynamiskt minnesfel i copy_string()" +#: src/misc.c:229 +#, fuzzy +msgid "memory allocation failure in xstrdup()" +msgstr "minnesallokeringen misslyckades i allocate_array()" -#: misc.c:422 +#: src/misc.c:303 #, c-format msgid "%s: fatal internal error, %s\n" msgstr "%s: allvarligt internt fel, %s\n" -#: misc.c:875 +#: src/misc.c:671 msgid "attempt to increase array size failed" -msgstr "försök att öka arraystorlek misslyckades" +msgstr "försök att öka arraystorlek misslyckades" -#: misc.c:1002 +#: src/misc.c:795 msgid "bad line in skeleton file" -msgstr "otillåten rad i mallfilen" +msgstr "otillÃ¥ten rad i mallfilen" -#: misc.c:1051 +#: src/misc.c:845 msgid "memory allocation failed in yy_flex_xmalloc()" msgstr "minnesallokeringen misslyckades i yy_flex_xmalloc()" -#: nfa.c:104 +#: src/nfa.c:100 #, c-format msgid "" "\n" @@ -667,344 +725,240 @@ msgid "" msgstr "" "\n" "\n" -"********** början av utskrift av nfa med starttillstånd %d\n" +"********** början av utskrift av nfa med starttillstÃ¥nd %d\n" -#: nfa.c:115 +#: src/nfa.c:111 #, c-format msgid "state # %4d\t" -msgstr "tillstånd %4d\t" +msgstr "tillstÃ¥nd %4d\t" -#: nfa.c:130 +#: src/nfa.c:126 +#, c-format msgid "********** end of dump\n" -msgstr "********** slut på utskrift\n" +msgstr "********** slut pÃ¥ utskrift\n" -#: nfa.c:174 +#: src/nfa.c:169 msgid "empty machine in dupmachine()" msgstr "tom maskin i dupmachine()" -#: nfa.c:240 +#: src/nfa.c:234 #, c-format msgid "Variable trailing context rule at line %d\n" -msgstr "Regel för varierbar efterföljande kontext på rad %d\n" +msgstr "Regel för varierbar efterföljande kontext pÃ¥ rad %d\n" -#: nfa.c:353 +#: src/nfa.c:357 msgid "bad state type in mark_beginning_as_normal()" -msgstr "otillåten tillståndstyp i mark_beginning_as_normal()" +msgstr "otillÃ¥ten tillstÃ¥ndstyp i mark_beginning_as_normal()" -#: nfa.c:598 +#: src/nfa.c:595 #, c-format msgid "input rules are too complicated (>= %d NFA states)" -msgstr "indatareglerna är för komplicerade (>= %d NFA-tillstånd)" +msgstr "indatareglerna är för komplicerade (>= %d NFA-tillstÃ¥nd)" -#: nfa.c:677 +#: src/nfa.c:673 msgid "found too many transitions in mkxtion()" -msgstr "fann för många övergångar i mkxtion()" +msgstr "fann för mÃ¥nga övergÃ¥ngar i mkxtion()" -#: nfa.c:703 +#: src/nfa.c:699 #, c-format msgid "too many rules (> %d)!" -msgstr "för många regler (> %d)!" +msgstr "för mÃ¥nga regler (> %d)!" -#: parse.y:183 +#: src/parse.y:159 msgid "unknown error processing section 1" -msgstr "okänt fel vid tolkning av avsnitt 1" +msgstr "okänt fel vid tolkning av avsnitt 1" -#: parse.y:208 parse.y:373 +#: src/parse.y:184 src/parse.y:353 msgid "bad start condition list" msgstr "felaktig lista med startvillkor" -#: parse.y:337 +#: src/parse.y:204 +msgid "Prefix must not contain [ or ]" +msgstr "" + +#: src/parse.y:317 msgid "unrecognized rule" -msgstr "okänd regel" +msgstr "okänd regel" -#: parse.y:456 parse.y:469 parse.y:538 +#: src/parse.y:436 src/parse.y:449 src/parse.y:518 msgid "trailing context used twice" -msgstr "efterföljande kontext används två gånger" +msgstr "efterföljande kontext används tvÃ¥ gÃ¥nger" -#: parse.y:574 parse.y:584 parse.y:657 parse.y:667 +#: src/parse.y:554 src/parse.y:564 src/parse.y:637 src/parse.y:647 msgid "bad iteration values" -msgstr "felaktiga iterationsvärden" +msgstr "felaktiga iterationsvärden" -#: parse.y:602 parse.y:620 parse.y:685 parse.y:703 +#: src/parse.y:582 src/parse.y:600 src/parse.y:665 src/parse.y:683 msgid "iteration value must be positive" -msgstr "iterationsvärde måste vara positivt" +msgstr "iterationsvärde mÃ¥ste vara positivt" -#: parse.y:817 parse.y:827 +#: src/parse.y:806 src/parse.y:816 #, c-format msgid "the character range [%c-%c] is ambiguous in a case-insensitive scanner" -msgstr "teckenintervallet [%c-%c] är tvetydigt i en skiftlägesokänslig inläsare" +msgstr "" +"teckenintervallet [%c-%c] är tvetydigt i en skiftlägesokänslig inläsare" -#: parse.y:832 +#: src/parse.y:821 msgid "negative range in character class" msgstr "negativt intervall i teckenklass" -#: scan.l:70 scan.l:180 scan.l:267 scan.l:409 scan.l:548 scan.l:598 +#: src/parse.y:918 +msgid "[:^lower:] is ambiguous in case insensitive scanner" +msgstr "[:^lower:] är tvetydigt i en skiftlägesokänslig inläsare" + +#: src/parse.y:924 +msgid "[:^upper:] ambiguous in case insensitive scanner" +msgstr "[:^upper:] är tvetydigt i en skiftlägesokänslig inläsare" + +#: src/scan.l:82 src/scan.l:644 src/scan.l:702 msgid "Input line too long\n" -msgstr "För lång indatarad\n" +msgstr "För lÃ¥ng indatarad\n" -#: scan.l:149 +#: src/scan.l:183 #, c-format msgid "malformed '%top' directive" msgstr "felaktigt \"%top\"-direktiv" -#: scan.l:171 +#: src/scan.l:205 #, no-c-format msgid "unrecognized '%' directive" -msgstr "okänt \"%\"-direktiv" +msgstr "okänt \"%\"-direktiv" + +#: src/scan.l:214 +msgid "Definition name too long\n" +msgstr "För lÃ¥ngt definitionsnamn\n" -#: scan.l:251 +#: src/scan.l:309 msgid "Unmatched '{'" msgstr "Ensamt \"{\"" -#: scan.l:284 +#: src/scan.l:325 +#, c-format +msgid "Definition value for {%s} too long\n" +msgstr "Definitionsvärdet för {%s} är för lÃ¥ngt\n" + +#: src/scan.l:342 msgid "incomplete name definition" -msgstr "ofullständig namndefinition" +msgstr "ofullständig namndefinition" + +#: src/scan.l:467 +msgid "Option line too long\n" +msgstr "För lÃ¥ng alternativrad\n" -#: scan.l:417 +#: src/scan.l:475 #, c-format msgid "unrecognized %%option: %s" -msgstr "okänd %%option: %s" +msgstr "okänd %%option: %s" -#: scan.l:558 scan.l:677 +#: src/scan.l:659 src/scan.l:832 msgid "bad character class" -msgstr "otillåten teckenklass" +msgstr "otillÃ¥ten teckenklass" -#: scan.l:605 +#: src/scan.l:709 #, c-format msgid "undefined definition {%s}" msgstr "odefinierad definition {%s}" -#: scan.l:645 +#: src/scan.l:772 +msgid "unbalanced parenthesis" +msgstr "" + +#: src/scan.l:787 #, c-format msgid "bad <start condition>: %s" -msgstr "otillåtet <startvillkor>: %s" +msgstr "otillÃ¥tet <startvillkor>: %s" -#: scan.l:658 +#: src/scan.l:800 msgid "missing quote" msgstr "citationstecken saknas" -#: scan.l:698 +#: src/scan.l:866 #, c-format msgid "bad character class expression: %s" -msgstr "otillåtet uttryck för teckenklass: %s" +msgstr "otillÃ¥tet uttryck för teckenklass: %s" -#: scan.l:720 +#: src/scan.l:888 msgid "bad character inside {}'s" -msgstr "otillåtet tecken inom {}" +msgstr "otillÃ¥tet tecken inom {}" -#: scan.l:726 +#: src/scan.l:894 msgid "missing }" msgstr "} saknas" -#: scan.l:799 +#: src/scan.l:972 msgid "EOF encountered inside an action" -msgstr "filslut påträffat inuti en handling" +msgstr "filslut pÃ¥träffat inuti en handling" + +#: src/scan.l:977 +msgid "EOF encountered inside pattern" +msgstr "filslut pÃ¥träffat inuti ett mönster" -#: scan.l:819 +#: src/scan.l:1010 #, c-format msgid "bad character: %s" -msgstr "otillåtet tecken: %s" +msgstr "otillÃ¥tet tecken: %s" -#: scan.l:848 +#: src/scan.l:1038 #, c-format msgid "can't open %s" -msgstr "kan inte öppna %s" +msgstr "kan inte öppna %s" -#: scanopt.c:291 +#: src/scanopt.c:259 #, c-format msgid "Usage: %s [OPTIONS]...\n" -msgstr "Användning: %s [FLAGGOR]...\n" +msgstr "Användning: %s [FLAGGOR]...\n" -#: scanopt.c:565 +#: src/scanopt.c:524 #, c-format msgid "option `%s' doesn't allow an argument\n" msgstr "flaggan \"%s\" tar inget argument\n" -#: scanopt.c:570 +#: src/scanopt.c:529 #, c-format msgid "option `%s' requires an argument\n" -msgstr "flaggan \"%s\" kräver ett argument\n" +msgstr "flaggan \"%s\" kräver ett argument\n" -#: scanopt.c:574 +#: src/scanopt.c:533 #, c-format msgid "option `%s' is ambiguous\n" -msgstr "flaggan \"%s\" är tvetydig\n" +msgstr "flaggan \"%s\" är tvetydig\n" -#: scanopt.c:578 +#: src/scanopt.c:537 #, c-format msgid "Unrecognized option `%s'\n" -msgstr "Okänd flagga \"%s\"\n" +msgstr "Okänd flagga \"%s\"\n" -#: scanopt.c:582 +#: src/scanopt.c:541 #, c-format msgid "Unknown error=(%d)\n" -msgstr "Okänt fel=(%d)\n" +msgstr "Okänt fel=(%d)\n" -#: sym.c:100 +#: src/sym.c:92 msgid "symbol table memory allocation failed" -msgstr "minnesallokering för symboltabell misslyckades" +msgstr "minnesallokering för symboltabell misslyckades" -#: sym.c:203 +#: src/sym.c:183 msgid "name defined twice" -msgstr "namnet definierat två gånger" +msgstr "namnet definierat tvÃ¥ gÃ¥nger" -#: sym.c:254 +#: src/sym.c:231 #, c-format msgid "start condition %s declared twice" -msgstr "startvillkoret %s deklarerat två gånger" +msgstr "startvillkoret %s deklarerat tvÃ¥ gÃ¥nger" -#: yylex.c:56 +#: src/yylex.c:57 msgid "premature EOF" -msgstr "för tidigt filslut" +msgstr "för tidigt filslut" -#: yylex.c:198 +#: src/yylex.c:200 +#, c-format msgid "End Marker\n" msgstr "Slutmarkering\n" -#: yylex.c:204 +#: src/yylex.c:206 #, c-format msgid "*Something Weird* - tok: %d val: %d\n" -msgstr "*Något märkligt* - tecken: %d värde: %d\n" - -#~ msgid "Can't specify header option if writing to stdout." -#~ msgstr "Kan inte ange huvudflagga då utskrift sker till standard ut." - -#~ msgid "unknown -R option '%c'" -#~ msgstr "okänd flagga till -R \"%c\"" - -#~ msgid "Could not write %s" -#~ msgstr "Kunde inte skriva %s" - -#~ msgid "-Cf/-CF and %option yylineno are incompatible" -#~ msgstr "-Cf/-CF och %option yylineno kan inte användas tillsammans" - -#~ msgid "" -#~ "For usage, try\n" -#~ "\t%s --help\n" -#~ msgstr "" -#~ "Prova\n" -#~ "\t%s --help\n" -#~ "för användning\n" - -#~ msgid "-P flag must be given separately" -#~ msgstr "flaggan -P måste anges separat" - -#~ msgid "-o flag must be given separately" -#~ msgstr "flaggan -o måste anges separat" - -#~ msgid "-S flag must be given separately" -#~ msgstr "flaggan -S måste anges separat" - -#~ msgid "-C flag must be given separately" -#~ msgstr "flaggan -C måste anges separat" - -#~ msgid "%s [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -ooutput -Pprefix -Sskeleton]\n" -#~ msgstr "%s [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -outfil -Pprefix -Smallfil]\n" - -#~ msgid "\t[--help --version] [file ...]\n" -#~ msgstr "\t[--help --version] [fil ...]\n" - -#~ msgid "\t-b generate backing-up information to %s\n" -#~ msgstr "\t-b skriv information om backande till %s\n" - -#~ msgid "\t-c do-nothing POSIX option\n" -#~ msgstr "\t-c POSIX-flaggan gör ingenting\n" - -#~ msgid "\t-d turn on debug mode in generated scanner\n" -#~ msgstr "\t-d ställ den skapade inläsaren i felsökningsläge\n" - -#~ msgid "\t-f generate fast, large scanner\n" -#~ msgstr "\t-f skapa en snabb, stor inläsare\n" - -#~ msgid "\t-h produce this help message\n" -#~ msgstr "\t-h visa denna hjälptext\n" - -#~ msgid "\t-i generate case-insensitive scanner\n" -#~ msgstr "\t-i skapa en skiftlägesokänslig inläsare\n" - -#~ msgid "\t-l maximal compatibility with original lex\n" -#~ msgstr "\t-l maximal kompatibilitet med ursprungliga lex\n" - -#~ msgid "\t-n do-nothing POSIX option\n" -#~ msgstr "\t-n POSIX-flaggan gör ingenting\n" - -#~ msgid "\t-p generate performance report to stderr\n" -#~ msgstr "\t-p skicka rapport om utförandet till standard fel\n" - -#~ msgid "\t-s suppress default rule to ECHO unmatched text\n" -#~ msgstr "\t-s undertryck standardregeln att skriva ut text som ej kunde matchas\n" - -#~ msgid "\t-t write generated scanner on stdout instead of %s\n" -#~ msgstr "\t-t skriv den skapade inläsaren till standard ut i stället för %s\n" - -#~ msgid "\t-v write summary of scanner statistics to f\n" -#~ msgstr "\t-v skriv en sammanställning av inläsarstatistik till f\n" - -#~ msgid "\t-w do not generate warnings\n" -#~ msgstr "\t-w visa inga varningar\n" - -#~ msgid "\t-B generate batch scanner (opposite of -I)\n" -#~ msgstr "\t-B skapa en icke interaktiv inläsare (motsatsen till -I)\n" - -#~ msgid "\t-F use alternative fast scanner representation\n" -#~ msgstr "\t-F använd en alternativ snabb inläsarrepresentation\n" - -#~ msgid "\t-I generate interactive scanner (opposite of -B)\n" -#~ msgstr "\t-I skapa en interaktiv inläsare (motsatsen till -B)\n" - -#~ msgid "\t-L suppress #line directives in scanner\n" -#~ msgstr "\t-L undertryck #line-direktiv i inläsaren\n" - -#~ msgid "\t-T %s should run in trace mode\n" -#~ msgstr "\t-T %s ska köras i spårningsläge\n" - -#~ msgid "\t-V report %s version\n" -#~ msgstr "\t-V visa %s version\n" - -#~ msgid "\t-7 generate 7-bit scanner\n" -#~ msgstr "\t-7 skapa en 7-bitars inläsare\n" - -#~ msgid "\t-8 generate 8-bit scanner\n" -#~ msgstr "\t-8 skapa en 8-bitars inläsare\n" - -#~ msgid "\t-+ generate C++ scanner class\n" -#~ msgstr "\t-+ skapa en C++-inläsarklass\n" - -#~ msgid "\t-? produce this help message\n" -#~ msgstr "\t-? visa denna hjälptext\n" - -#~ msgid "\t-C specify degree of table compression (default is -Cem):\n" -#~ msgstr "\t-C ange graden av tabellkompression (standard -Cem):\n" - -#~ msgid "\t\t-Ca trade off larger tables for better memory alignment\n" -#~ msgstr "\t\t-Ca byt ut stora tabeller för att förbättra minneshanteringen\n" - -#~ msgid "\t\t-Ce construct equivalence classes\n" -#~ msgstr "\t\t-Ce skapa ekvivalensklasser\n" - -#~ msgid "\t\t-Cf do not compress scanner tables; use -f representation\n" -#~ msgstr "\t\t-Cf komprimera inte inläsartabellerna; använd representationen -f\n" - -#~ msgid "\t\t-CF do not compress scanner tables; use -F representation\n" -#~ msgstr "\t\t-CF komprimera inte inläsartabellerna; använd representationen -F\n" - -#~ msgid "\t\t-Cm construct meta-equivalence classes\n" -#~ msgstr "\t\t-Cm skapa meta-ekvivalensklasser\n" - -#~ msgid "\t\t-Cr use read() instead of stdio for scanner input\n" -#~ msgstr "\t\t-Cr använd read() i stället för standard in som indata till inläsaren\n" - -#~ msgid "\t-o specify output filename\n" -#~ msgstr "\t-o ange namnet på utfilen\n" - -#~ msgid "\t-P specify scanner prefix other than \"yy\"\n" -#~ msgstr "\t-P ange annat scannerprefix än \"yy\"\n" - -#~ msgid "\t-S specify skeleton file\n" -#~ msgstr "\t-S ange mallfil\n" - -#~ msgid "\t--help produce this help message\n" -#~ msgstr "\t--help visa denna hjälptext\n" +msgstr "*NÃ¥got märkligt* - tecken: %d värde: %d\n" -#~ msgid "\t--version report %s version\n" -#~ msgstr "\t--version visa %s version\n" +#~ msgid "dynamic memory failure in copy_string()" +#~ msgstr "dynamiskt minnesfel i copy_string()" @@ -5,33 +5,55 @@ msgid "" msgstr "" "Project-Id-Version: flex 2.5.31\n" -"POT-Creation-Date: 2003-04-01 11:33-0500\n" +"Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n" +"POT-Creation-Date: 2017-05-06 10:49-0400\n" "PO-Revision-Date: 2004-05-16 18:36+0300\n" "Last-Translator: Deniz Akkus Kanca <deniz@arayan.com>\n" "Language-Team: Turkish <gnu-tr-u12a@lists.sourceforge.net>\n" +"Language: tr\n" "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" "X-Generator: KBabel 1.0.2\n" -#: dfa.c:61 +#: src/buf.c:79 +msgid "Allocation of buffer to print string failed" +msgstr "" + +#: src/buf.c:107 +msgid "Allocation of buffer for line directive failed" +msgstr "" + +#: src/buf.c:177 +msgid "Allocation of buffer for m4 def failed" +msgstr "" + +#: src/buf.c:198 +msgid "Allocation of buffer for m4 undef failed" +msgstr "" + +#: src/dfa.c:59 #, c-format msgid "State #%d is non-accepting -\n" msgstr "Durum #%d kabul etmiyor -\n" -#: dfa.c:124 +#: src/dfa.c:119 msgid "dangerous trailing context" msgstr "izleyen baÄŸlam tehlikeli" -#: dfa.c:166 +#: src/dfa.c:159 +#, c-format msgid " associated rule line numbers:" msgstr " alakalı kural satır numaraları:" -#: dfa.c:202 +#: src/dfa.c:193 +#, c-format msgid " out-transitions: " msgstr " dış-geçiÅŸler: " -#: dfa.c:210 +#: src/dfa.c:201 +#, c-format msgid "" "\n" " jam-transitions: EOF " @@ -39,11 +61,11 @@ msgstr "" "\n" " sıkışık-geçiÅŸler: EOF " -#: dfa.c:341 +#: src/dfa.c:331 msgid "consistency check failed in epsclosure()" msgstr "epsclosure() içindeki tutarlılık kontrolü baÅŸarısız" -#: dfa.c:429 +#: src/dfa.c:419 msgid "" "\n" "\n" @@ -55,28 +77,24 @@ msgstr "" "DFA Dökümü:\n" "\n" -#: dfa.c:604 +#: src/dfa.c:587 msgid "could not create unique end-of-buffer state" msgstr "tekil tampon sonu durumu yaratılamadı" -#: dfa.c:625 +#: src/dfa.c:608 #, c-format msgid "state # %d:\n" msgstr "durum # %d:\n" -#: dfa.c:800 +#: src/dfa.c:768 msgid "Could not write yynxt_tbl[][]" msgstr "yynxt_tbl[][] yazılamadı" -#: dfa.c:1023 -msgid "consistency check failed in symfollowset" -msgstr "symfollowset içindeki tutarlık kontrolü baÅŸarısız" - -#: dfa.c:1071 +#: src/dfa.c:1028 msgid "bad transition character detected in sympartition()" msgstr "sympartition() içinde hatalı geçiÅŸ karakterleri saptandı" -#: gen.c:484 +#: src/gen.c:480 msgid "" "\n" "\n" @@ -88,29 +106,29 @@ msgstr "" "Denklik Sınıfları:\n" "\n" -#: gen.c:668 gen.c:697 gen.c:1221 +#: src/gen.c:669 src/gen.c:698 src/gen.c:1218 #, c-format msgid "state # %d accepts: [%d]\n" msgstr "durum # %d kabul eder: [%d]\n" -#: gen.c:1116 +#: src/gen.c:1115 #, c-format msgid "state # %d accepts: " msgstr "durum # %d kabul eder: " -#: gen.c:1163 +#: src/gen.c:1162 msgid "Could not write yyacclist_tbl" msgstr "yyacclist_tbl yazılamadı" -#: gen.c:1239 +#: src/gen.c:1236 msgid "Could not write yyacc_tbl" msgstr "yyacc_tbl yazılamadı" -#: gen.c:1254 gen.c:1639 gen.c:1662 +#: src/gen.c:1251 src/gen.c:1623 src/gen.c:1646 msgid "Could not write ecstbl" msgstr "ecstbl yazılamadı" -#: gen.c:1277 +#: src/gen.c:1271 msgid "" "\n" "\n" @@ -120,374 +138,404 @@ msgstr "" "\n" "Ara-Denklik Sınıfları:\n" -#: gen.c:1299 +#: src/gen.c:1293 msgid "Could not write yymeta_tbl" msgstr "yymeta_tbl yazılamadı" -#: gen.c:1360 +#: src/gen.c:1352 msgid "Could not write yybase_tbl" msgstr "yybase_tbl yazılamadı" -#: gen.c:1394 +#: src/gen.c:1384 msgid "Could not write yydef_tbl" msgstr "yydef_tbl yazılamadı" -#: gen.c:1434 +#: src/gen.c:1422 msgid "Could not write yynxt_tbl" msgstr "yynxt_tbl yazılamadı" -#: gen.c:1470 +#: src/gen.c:1456 msgid "Could not write yychk_tbl" msgstr "yychk_tbl yazılamadı" -#: gen.c:1624 gen.c:1653 +#: src/gen.c:1608 src/gen.c:1637 msgid "Could not write ftbl" msgstr "ftbl yazılamadı" -#: gen.c:1630 +#: src/gen.c:1614 msgid "Could not write ssltbl" msgstr "ssltbl yazılamadı" -#: gen.c:1681 +#: src/gen.c:1665 msgid "Could not write eoltbl" msgstr "eoltbl yazılamadı" -#: gen.c:1741 +#: src/gen.c:1722 msgid "Could not write yynultrans_tbl" msgstr "yynultrans_tbl yazılamadı" -#: main.c:176 +#: src/main.c:178 msgid "rule cannot be matched" msgstr "kural eÅŸlenemedi" -#: main.c:181 +#: src/main.c:183 msgid "-s option given but default rule can be matched" msgstr "-s seçeneÄŸi verilmiÅŸ fakat öntanımlı kural eÅŸlenebiliyor" -#: main.c:217 +#: src/main.c:221 msgid "Can't use -+ with -l option" msgstr "-+'yi -l seçeneÄŸi ile kullanma" -#: main.c:220 +#: src/main.c:224 msgid "Can't use -f or -F with -l option" msgstr "-f veya -F'yi -l seçeneÄŸi ile kullanma" -#: main.c:224 +#: src/main.c:228 msgid "Can't use --reentrant or --bison-bridge with -l option" msgstr "-l seçeneÄŸi ile --reentrant veya --bison-bridge bir arada kullanılamaz" -#: main.c:261 +#: src/main.c:260 msgid "-Cf/-CF and -Cm don't make sense together" msgstr "-Cf/-CF ve -Cm birlikte anlam ifade etmiyor" -#: main.c:264 +#: src/main.c:263 msgid "-Cf/-CF and -I are incompatible" msgstr "-Cf/-CF ve -I uyumsuz" -#: main.c:268 +#: src/main.c:267 msgid "-Cf/-CF are incompatible with lex-compatibility mode" msgstr "-Cf/-CF lex-uyumluluk kipi ile uyumsuz" -#: main.c:273 +#: src/main.c:272 msgid "-Cf and -CF are mutually exclusive" msgstr "-Cf ve -CF bir arada kullanılamaz" -#: main.c:277 +#: src/main.c:276 msgid "Can't use -+ with -CF option" msgstr "-+, -CF seçeneÄŸi ile kullanılamaz" -#: main.c:280 +#: src/main.c:279 #, c-format msgid "%array incompatible with -+ option" msgstr "%array, -+ seçeneÄŸi ile uyumsuz" -#: main.c:285 +#: src/main.c:284 msgid "Options -+ and --reentrant are mutually exclusive." msgstr "-+ ve --reentrant seçenekleri bir arada kullanılamaz" -#: main.c:288 +#: src/main.c:287 msgid "bison bridge not supported for the C++ scanner." msgstr "bison bridge, C++ tarayıcısı için desteklenmiyor." -#: main.c:340 main.c:385 +#: src/main.c:336 src/main.c:419 #, c-format msgid "could not create %s" msgstr "%s oluÅŸturulamadı" -#: main.c:398 +#: src/main.c:431 msgid "could not write tables header" msgstr "tablo baÅŸlığı yazılamadı" -#: main.c:402 +#: src/main.c:435 #, c-format msgid "can't open skeleton file %s" msgstr "iskelet dosyası %s açılamadı" -#: main.c:483 +#: 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 "iskelet dosyası %s okunurken girdi hatası" -#: main.c:487 +#: src/main.c:525 #, c-format msgid "error closing skeleton file %s" msgstr "iskelet dosyası %s kapatılırken hata" -#: main.c:671 +#: src/main.c:709 #, c-format msgid "error creating header file %s" msgstr "baÅŸlık dosyası %s oluÅŸturulurken hata" -#: main.c:679 +#: src/main.c:717 #, c-format msgid "error writing output file %s" msgstr "çıktı dosyası %s yazılırken hata" -#: main.c:683 +#: src/main.c:721 #, c-format msgid "error closing output file %s" msgstr "çıktı dosyası %s kapatılırken hata" -#: main.c:687 +#: src/main.c:725 #, c-format msgid "error deleting output file %s" msgstr "çıktı dosyası %s silinirken hata" -#: main.c:694 +#: src/main.c:732 +#, c-format msgid "No backing up.\n" msgstr "Yedekleme yok.\n" -#: main.c:698 +#: src/main.c:736 #, c-format msgid "%d backing up (non-accepting) states.\n" msgstr "%d yedeklenen (kabul-etmeyen) durumlar.\n" -#: main.c:702 +#: src/main.c:740 +#, c-format msgid "Compressed tables always back up.\n" msgstr "Sıkıştırılmış tablolar daima yedeklidir.\n" -#: main.c:705 +#: src/main.c:743 #, c-format msgid "error writing backup file %s" msgstr "yedek dosyası %s yazılırken hata" -#: main.c:709 +#: src/main.c:747 #, c-format msgid "error closing backup file %s" msgstr "yedek dosyası %s kapatılırken hata" -#: main.c:714 +#: src/main.c:752 #, c-format msgid "%s version %s usage statistics:\n" msgstr "%s sürüm %s kullanım istatistikleri:\n" -#: main.c:717 +#: src/main.c:755 +#, c-format msgid " scanner options: -" msgstr " tarayıcı seçenekleri: -" -#: main.c:796 +#: src/main.c:834 #, c-format msgid " %d/%d NFA states\n" msgstr " %d/%d NFA durumu\n" -#: main.c:798 +#: src/main.c:836 #, c-format msgid " %d/%d DFA states (%d words)\n" msgstr " %d/%d DFA durumu (%d sözcük)\n" -#: main.c:800 +#: src/main.c:838 #, c-format msgid " %d rules\n" msgstr " %d kural\n" -#: main.c:805 +#: src/main.c:843 +#, c-format msgid " No backing up\n" msgstr " Yedekleme yok\n" -#: main.c:809 +#: src/main.c:847 #, c-format msgid " %d backing-up (non-accepting) states\n" msgstr " %d yedeklenmiÅŸ (kabul-edilmeyen) durum\n" -#: main.c:814 +#: src/main.c:852 +#, c-format msgid " Compressed tables always back-up\n" msgstr " Sıkıştırılmış tablolar daima yedeklenir\n" -#: main.c:818 +#: src/main.c:856 +#, c-format msgid " Beginning-of-line patterns used\n" msgstr " BaÅŸlangıç-satırı kalıpları kullanıldı\n" -#: main.c:820 +#: src/main.c:858 #, c-format msgid " %d/%d start conditions\n" msgstr " %d/%d baÅŸlangıç ÅŸartları\n" -#: main.c:824 +#: src/main.c:862 #, c-format msgid " %d epsilon states, %d double epsilon states\n" msgstr " %d epsilon durumu, %d çift epsilon durumu\n" -#: main.c:828 +#: src/main.c:866 +#, c-format msgid " no character classes\n" msgstr " karakter sınıfı yok\n" -#: main.c:832 +#: src/main.c:870 #, c-format msgid " %d/%d character classes needed %d/%d words of storage, %d reused\n" -msgstr " %d/%d ihtiyaç duyulan karakter sınıfı %d/%d depolanan sözcük, %d yeniden kullanıldı\n" +msgstr "" +" %d/%d ihtiyaç duyulan karakter sınıfı %d/%d depolanan sözcük, %d yeniden " +"kullanıldı\n" -#: main.c:837 +#: src/main.c:875 #, c-format msgid " %d state/nextstate pairs created\n" msgstr " %d durumu/sonrakidurum çifti yaratıldı\n" -#: main.c:840 +#: src/main.c:878 #, c-format msgid " %d/%d unique/duplicate transitions\n" msgstr " %d/%d tekil/çift geçiÅŸler\n" -#: main.c:845 +#: src/main.c:883 #, c-format msgid " %d table entries\n" msgstr " %d tablo girdileri\n" -#: main.c:853 +#: src/main.c:891 #, c-format msgid " %d/%d base-def entries created\n" msgstr " %d/%d temel-tanım girdileri yaratıldı\n" -#: main.c:857 +#: src/main.c:895 #, c-format msgid " %d/%d (peak %d) nxt-chk entries created\n" msgstr " %d/%d (en yüksek %d) nxt-chk girdileri yaratıldı\n" -#: main.c:861 +#: src/main.c:899 #, c-format msgid " %d/%d (peak %d) template nxt-chk entries created\n" msgstr " %d/%d (en yüksek %d) ÅŸablon nxt-chk girdileri yaratıldı\n" -#: main.c:865 +#: src/main.c:903 #, c-format msgid " %d empty table entries\n" msgstr " %d boÅŸ tablo girdileri\n" -#: main.c:867 +#: src/main.c:905 #, c-format msgid " %d protos created\n" msgstr " %d prototip yaratıldı\n" -#: main.c:870 +#: src/main.c:908 #, c-format msgid " %d templates created, %d uses\n" msgstr " %d ÅŸablon yaratıldı, %d kullanıldı\n" -#: main.c:878 +#: src/main.c:916 #, c-format msgid " %d/%d equivalence classes created\n" msgstr " %d/%d denklik sınıfı yaratıldı\n" -#: main.c:886 +#: src/main.c:924 #, c-format msgid " %d/%d meta-equivalence classes created\n" msgstr " %d/%d ara-denklik sınıfı yaratıldı\n" -#: main.c:892 +#: src/main.c:930 #, c-format msgid " %d (%d saved) hash collisions, %d DFAs equal\n" msgstr " %d (%d kaydedildi) saçılma çarpışması, %d DFA denk\n" -#: main.c:894 +#: src/main.c:932 #, c-format msgid " %d sets of reallocations needed\n" msgstr " %d tekrar ayırım kümesine ihtiyaç var\n" -#: main.c:896 +#: src/main.c:934 #, c-format msgid " %d total table entries needed\n" msgstr " %d toplam tablo girdisine ihtiyaç var\n" -#: main.c:971 +#: src/main.c:1008 +#, c-format msgid "Internal error. flexopts are malformed.\n" msgstr "İç hata. flexopt'lar bozuk.\n" -#: main.c:981 +#: src/main.c:1018 #, c-format msgid "Try `%s --help' for more information.\n" msgstr "Daha fazla bilgi için `%s --help' yazın.\n" -#: main.c:1038 +#: src/main.c:1075 #, c-format msgid "unknown -C option '%c'" msgstr "bilinmeyen -C seçeneÄŸi '%c'" -#: main.c:1167 +#: src/main.c:1204 #, c-format msgid "%s %s\n" msgstr "%s %s\n" -#: main.c:1442 +#: src/main.c:1476 msgid "fatal parse error" msgstr "ölümcül ayrıştırma hatası" -#: main.c:1474 +#: src/main.c:1508 #, c-format msgid "could not create backing-up info file %s" msgstr "yedekleme bilgi dosyası %s oluÅŸturulamadı" -#: main.c:1495 +#: src/main.c:1529 +#, c-format msgid "-l AT&T lex compatibility option entails a large performance penalty\n" msgstr "-l AT&T lex uyumluluÄŸu seçeneÄŸi önemli ölçüde yavaÅŸlamaya yol açar\n" -#: main.c:1498 +#: src/main.c:1532 +#, c-format msgid " and may be the actual source of other reported performance penalties\n" -msgstr " ve belki bildirilen baÅŸka performans kayıplarının da kaynağı olabilir\n" +msgstr "" +" ve belki bildirilen baÅŸka performans kayıplarının da kaynağı olabilir\n" -#: main.c:1504 +#: src/main.c:1538 #, c-format -msgid "%%option yylineno entails a performance penalty ONLY on rules that can match newline characters\n" -msgstr "yylineno %%seçeneÄŸi YALNIZCA yenisatır karakterlerini de eÅŸleyen satırlarda yavaÅŸlar.\n" +msgid "" +"%%option yylineno entails a performance penalty ONLY on rules that can match " +"newline characters\n" +msgstr "" +"yylineno %%seçeneÄŸi YALNIZCA yenisatır karakterlerini de eÅŸleyen satırlarda " +"yavaÅŸlar.\n" -#: main.c:1511 +#: src/main.c:1545 +#, c-format msgid "-I (interactive) entails a minor performance penalty\n" msgstr "-I (etkileÅŸimli) küçük ölçekli bir yavaÅŸlamaya neden olur\n" -#: main.c:1516 +#: src/main.c:1550 +#, c-format msgid "yymore() entails a minor performance penalty\n" msgstr "yymore() küçük ölçekli bir yavaÅŸlamaya neden olur\n" -#: main.c:1522 +#: src/main.c:1556 +#, c-format msgid "REJECT entails a large performance penalty\n" msgstr "REJECT büyük ölçekli bir yavaÅŸlamaya neden olur\n" -#: main.c:1527 +#: src/main.c:1561 +#, c-format msgid "Variable trailing context rules entail a large performance penalty\n" -msgstr "DeÄŸiÅŸken izleyen baÄŸlam kuralları, büyük ölçekli yavaÅŸlamaya neden olur\n" +msgstr "" +"DeÄŸiÅŸken izleyen baÄŸlam kuralları, büyük ölçekli yavaÅŸlamaya neden olur\n" -#: main.c:1539 +#: src/main.c:1573 msgid "REJECT cannot be used with -f or -F" msgstr "REJECT, -f veya -F ile kullanılamaz" -#: main.c:1542 +#: src/main.c:1576 #, c-format msgid "%option yylineno cannot be used with REJECT" msgstr "%option yylineno, REJECT ile birlikte kullanılamaz" -#: main.c:1545 +#: src/main.c:1579 msgid "variable trailing context rules cannot be used with -f or -F" msgstr "deÄŸiÅŸken izleme ortamı kuralları, -f veya -F ile birlikte kullanılamaz" -#: main.c:1661 +#: src/main.c:1704 #, c-format msgid "%option yyclass only meaningful for C++ scanners" msgstr "%option yyclass, sadece C++ tarayıcıları için anlamlıdır" -#: main.c:1768 +#: src/main.c:1791 #, c-format msgid "Usage: %s [OPTIONS] [FILE]...\n" msgstr "Kullanım: %s [SEÇENEKLER...] [DOSYA...]\n" -#: main.c:1771 -#, c-format +#: src/main.c:1794 +#, fuzzy, c-format msgid "" "Generates programs that perform pattern-matching on text.\n" "\n" @@ -510,13 +558,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" @@ -538,8 +589,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" @@ -612,47 +661,52 @@ msgstr "" " -h, --help bu yardım bilgisini gösterir\n" " -V, --version %s sürümünü bildirir\n" -#: misc.c:100 misc.c:126 +#: src/misc.c:64 +msgid "allocation of sko_stack failed" +msgstr "" + +#: src/misc.c:100 #, c-format msgid "name \"%s\" ridiculously long" msgstr "\"%s\" ismi gülünç derecede uzun" -#: misc.c:175 +#: src/misc.c:155 msgid "memory allocation failed in allocate_array()" msgstr "allocate_array() içinde bellek ayırımı baÅŸarısız" -#: misc.c:250 +#: src/misc.c:205 #, c-format msgid "bad character '%s' detected in check_char()" msgstr "check_char() içinde hatalı karakter '%s' saptandı" -#: misc.c:255 +#: src/misc.c:210 #, c-format msgid "scanner requires -8 flag to use the character %s" msgstr "tarayıcı %s karakterini kullanmak için -8 bayrağına ihtiyaç duyar" -#: misc.c:288 -msgid "dynamic memory failure in copy_string()" -msgstr "copy_string() içinde dinamik bellek hatası" +#: src/misc.c:229 +#, fuzzy +msgid "memory allocation failure in xstrdup()" +msgstr "allocate_array() içinde bellek ayırımı baÅŸarısız" -#: misc.c:422 +#: src/misc.c:303 #, c-format msgid "%s: fatal internal error, %s\n" msgstr "%s: ölümcül iç hata, %s\n" -#: misc.c:875 +#: src/misc.c:671 msgid "attempt to increase array size failed" msgstr "dizi boyutunu artırma denemesi baÅŸarısız" -#: misc.c:1002 +#: src/misc.c:795 msgid "bad line in skeleton file" msgstr "iskelet dosya içinde hatalı satır" -#: misc.c:1051 +#: src/misc.c:845 msgid "memory allocation failed in yy_flex_xmalloc()" msgstr "yy_flex_xmalloc() içinde bellek ayırımı baÅŸarısız" -#: nfa.c:104 +#: src/nfa.c:100 #, c-format msgid "" "\n" @@ -663,201 +717,251 @@ msgstr "" "\n" "********** baÅŸlangıç durumu %d olan nfa'nın dökümüne baÅŸlanıyor\n" -#: nfa.c:115 +#: src/nfa.c:111 #, c-format msgid "state # %4d\t" msgstr "durum # %4d\t" -#: nfa.c:130 +#: src/nfa.c:126 +#, c-format msgid "********** end of dump\n" msgstr "********** döküm sonu\n" -#: nfa.c:174 +#: src/nfa.c:169 msgid "empty machine in dupmachine()" msgstr "dupmachine() içinde boÅŸ makine" -#: nfa.c:240 +#: src/nfa.c:234 #, c-format msgid "Variable trailing context rule at line %d\n" msgstr "%d satırında deÄŸiÅŸken izleyen baÄŸlam kuralı\n" -#: nfa.c:353 +#: src/nfa.c:357 msgid "bad state type in mark_beginning_as_normal()" msgstr "mark_beginning_as_normal() içinde hatalı durum türü" -#: nfa.c:598 +#: src/nfa.c:595 #, c-format msgid "input rules are too complicated (>= %d NFA states)" msgstr "girdi kuralları fazla karışık (>= %d NFA durumu)" -#: nfa.c:677 +#: src/nfa.c:673 msgid "found too many transitions in mkxtion()" msgstr "mkxtion() içinde çok fazla geçiÅŸ bulundu" -#: nfa.c:703 +#: src/nfa.c:699 #, c-format msgid "too many rules (> %d)!" msgstr "çok fazla kural (> %d)!" -#: parse.y:183 +#: src/parse.y:159 msgid "unknown error processing section 1" msgstr "1. bölüm iÅŸlenirken bilinmeyen hata oluÅŸtu" -#: parse.y:208 parse.y:373 +#: src/parse.y:184 src/parse.y:353 msgid "bad start condition list" msgstr "hatalı baÅŸlangıç ÅŸart listesi" -#: parse.y:337 +#: src/parse.y:204 +msgid "Prefix must not contain [ or ]" +msgstr "" + +#: src/parse.y:317 msgid "unrecognized rule" msgstr "bilinmeyen kural" -#: parse.y:456 parse.y:469 parse.y:538 +#: src/parse.y:436 src/parse.y:449 src/parse.y:518 msgid "trailing context used twice" msgstr "izleyen baÄŸlam iki defa kullanılmış" -#: parse.y:574 parse.y:584 parse.y:657 parse.y:667 +#: src/parse.y:554 src/parse.y:564 src/parse.y:637 src/parse.y:647 msgid "bad iteration values" msgstr "hatalı yineleme deÄŸerleri" -#: parse.y:602 parse.y:620 parse.y:685 parse.y:703 +#: src/parse.y:582 src/parse.y:600 src/parse.y:665 src/parse.y:683 msgid "iteration value must be positive" msgstr "yineleme deÄŸeri pozitif olmalı" -#: parse.y:817 parse.y:827 +#: 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] karakter aralığı, büyük/küçük harf farkı gözetmeyen bir tarayıcıda\n" "belirsiz anlamlı" -#: parse.y:832 +#: src/parse.y:821 msgid "negative range in character class" msgstr "karakter sınıflarında negatif aralık" -#: scan.l:70 scan.l:180 scan.l:267 scan.l:409 scan.l:548 scan.l:598 +#: src/parse.y:918 +#, fuzzy +msgid "[:^lower:] is ambiguous in case insensitive scanner" +msgstr "" +"[%c-%c] karakter aralığı, büyük/küçük harf farkı gözetmeyen bir tarayıcıda\n" +"belirsiz anlamlı" + +#: src/parse.y:924 +#, fuzzy +msgid "[:^upper:] ambiguous in case insensitive scanner" +msgstr "" +"[%c-%c] karakter aralığı, büyük/küçük harf farkı gözetmeyen bir tarayıcıda\n" +"belirsiz anlamlı" + +#: src/scan.l:82 src/scan.l:644 src/scan.l:702 msgid "Input line too long\n" msgstr "Girdi satırı fazla uzun\n" -#: scan.l:149 +#: src/scan.l:183 #, c-format msgid "malformed '%top' directive" msgstr "hatalı `%top' yönergesi" -#: scan.l:171 +#: src/scan.l:205 #, no-c-format msgid "unrecognized '%' directive" msgstr "'%' yönergesi bilinmiyor" -#: scan.l:251 +#: src/scan.l:214 +#, fuzzy +msgid "Definition name too long\n" +msgstr "Girdi satırı fazla uzun\n" + +#: src/scan.l:309 msgid "Unmatched '{'" msgstr "'{' eÅŸleÅŸmiyor" -#: scan.l:284 +#: src/scan.l:325 +#, c-format +msgid "Definition value for {%s} too long\n" +msgstr "" + +#: src/scan.l:342 msgid "incomplete name definition" msgstr "eksik isim tanımlaması" -#: scan.l:417 +#: src/scan.l:467 +#, fuzzy +msgid "Option line too long\n" +msgstr "Girdi satırı fazla uzun\n" + +#: src/scan.l:475 #, c-format msgid "unrecognized %%option: %s" msgstr "geçersiz %%seçenek: %s" -#: scan.l:558 scan.l:677 +#: src/scan.l:659 src/scan.l:832 msgid "bad character class" msgstr "hatalı karakter sınıfı" -#: scan.l:605 +#: src/scan.l:709 #, c-format msgid "undefined definition {%s}" msgstr "belirsiz tanım {%s}" -#: scan.l:645 +#: src/scan.l:772 +msgid "unbalanced parenthesis" +msgstr "" + +#: src/scan.l:787 #, c-format msgid "bad <start condition>: %s" msgstr "hatalı <baÅŸlangıç ÅŸartı>: %s" -#: scan.l:658 +#: src/scan.l:800 msgid "missing quote" msgstr "eksik çift tırnak" -#: scan.l:698 +#: src/scan.l:866 #, c-format msgid "bad character class expression: %s" msgstr "bozuk karakter sınıfı ifadesi: %s" -#: scan.l:720 +#: src/scan.l:888 msgid "bad character inside {}'s" msgstr "{}'ler içinde hatalı karakter" -#: scan.l:726 +#: src/scan.l:894 msgid "missing }" msgstr "eksik }" -#: scan.l:799 +#: src/scan.l:972 msgid "EOF encountered inside an action" msgstr "bir eylem içinde EOF ile karşılaşıldı" -#: scan.l:819 +#: src/scan.l:977 +#, fuzzy +msgid "EOF encountered inside pattern" +msgstr "bir eylem içinde EOF ile karşılaşıldı" + +#: src/scan.l:1010 #, c-format msgid "bad character: %s" msgstr "hatalı karakter: %s" -#: scan.l:848 +#: src/scan.l:1038 #, c-format msgid "can't open %s" msgstr "%s açılamıyor" -#: scanopt.c:291 +#: src/scanopt.c:259 #, c-format msgid "Usage: %s [OPTIONS]...\n" msgstr "Kullanım: %s [SEÇENEKLER...]\n" -#: scanopt.c:565 +#: src/scanopt.c:524 #, c-format msgid "option `%s' doesn't allow an argument\n" msgstr "`%s' seçeneÄŸi argüman kullanmaz\n" -#: scanopt.c:570 +#: src/scanopt.c:529 #, c-format msgid "option `%s' requires an argument\n" msgstr "`%s' seçeneÄŸi için argüman zorunludur\n" -#: scanopt.c:574 +#: src/scanopt.c:533 #, c-format msgid "option `%s' is ambiguous\n" msgstr "`%s' seçeneÄŸi belirsiz\n" -#: scanopt.c:578 +#: src/scanopt.c:537 #, c-format msgid "Unrecognized option `%s'\n" msgstr "Bilinmeyen seçenek: `%s'\n" -#: scanopt.c:582 +#: src/scanopt.c:541 #, c-format msgid "Unknown error=(%d)\n" msgstr "Bilinmeyen hata=(%d)\n" -#: sym.c:100 +#: src/sym.c:92 msgid "symbol table memory allocation failed" msgstr "simge tablosu bellek ayırımı baÅŸarısız" -#: sym.c:203 +#: src/sym.c:183 msgid "name defined twice" msgstr "isim iki defa tanımlandı" -#: sym.c:254 +#: src/sym.c:231 #, c-format msgid "start condition %s declared twice" msgstr "baÅŸlangıç ÅŸartı %s iki defa bildirildi" -#: yylex.c:56 +#: src/yylex.c:57 msgid "premature EOF" msgstr "erken EOF" -#: yylex.c:198 +#: src/yylex.c:200 +#, c-format msgid "End Marker\n" msgstr "BitiÅŸ Ä°ÅŸaretçisi\n" -#: yylex.c:204 +#: src/yylex.c:206 #, c-format msgid "*Something Weird* - tok: %d val: %d\n" msgstr "*Garip Bir Åžey* -andaç: %d deÄŸer: %d\n" + +#~ msgid "consistency check failed in symfollowset" +#~ msgstr "symfollowset içindeki tutarlık kontrolü baÅŸarısız" + +#~ msgid "dynamic memory failure in copy_string()" +#~ msgstr "copy_string() içinde dinamik bellek hatası" diff --git a/po/update_linguas.sh b/po/update_linguas.sh new file mode 100755 index 0000000..a1be4d8 --- /dev/null +++ b/po/update_linguas.sh @@ -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 @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: flex-2.5.38\n" "Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2014-02-11 16:15-0500\n" +"POT-Creation-Date: 2017-05-06 10:49-0400\n" "PO-Revision-Date: 2014-02-14 08:17+0700\n" "Last-Translator: Trần Ngá»c Quân <vnwildman@gmail.com>\n" "Language-Team: Vietnamese <translation-team-vi@lists.sourceforge.net>\n" @@ -18,46 +18,47 @@ 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" "X-Generator: Poedit 1.5.5\n" "X-Poedit-SourceCharset: utf-8\n" -#: buf.c:78 +#: src/buf.c:79 msgid "Allocation of buffer to print string failed" msgstr "Việc phân bổ bá»™ đệm cho lệnh in chuá»—i gặp lá»—i" -#: buf.c:100 +#: src/buf.c:107 msgid "Allocation of buffer for line directive failed" msgstr "Việc phân bổ bá»™ đệm cho chỉ thị dòng gặp lá»—i" -#: buf.c:177 +#: src/buf.c:177 msgid "Allocation of buffer for m4 def failed" msgstr "Việc phân bổ bá»™ đệm cho “m4 def†gặp lá»—i" -#: buf.c:197 +#: src/buf.c:198 msgid "Allocation of buffer for m4 undef failed" msgstr "Việc phân bổ bá»™ đệm cho “m4 undef†gặp lá»—i" -#: dfa.c:61 +#: src/dfa.c:59 #, c-format msgid "State #%d is non-accepting -\n" msgstr "Trạng thái #%d là không chấp nháºn -\n" -#: dfa.c:124 +#: src/dfa.c:119 msgid "dangerous trailing context" msgstr "ngữ cảnh theo sau là nguy hiểm" -#: dfa.c:166 +#: src/dfa.c:159 #, c-format msgid " associated rule line numbers:" msgstr " số thứ tá»± dòng quy tắc tÆ°Æ¡ng ứng:" -#: dfa.c:202 +#: src/dfa.c:193 #, c-format msgid " out-transitions: " msgstr " việc chuyển tiếp xuất: " -#: dfa.c:210 +#: src/dfa.c:201 #, c-format msgid "" "\n" @@ -66,11 +67,11 @@ msgstr "" "\n" " chuyển tiếp kẹt: gặp kết thúc táºp tin " -#: dfa.c:341 +#: src/dfa.c:331 msgid "consistency check failed in epsclosure()" msgstr "việc kiểm tra sá»± thống nhất bị lá»—i trong epsclosure()" -#: dfa.c:429 +#: src/dfa.c:419 msgid "" "\n" "\n" @@ -82,24 +83,24 @@ msgstr "" "Äổ DFA:\n" "\n" -#: dfa.c:604 +#: src/dfa.c:587 msgid "could not create unique end-of-buffer state" msgstr "không thể tạo trạng thái kết-thúc-bá»™-đệm duy nhất" -#: dfa.c:625 +#: src/dfa.c:608 #, c-format msgid "state # %d:\n" msgstr "trạng thái# %d:\n" -#: dfa.c:785 +#: src/dfa.c:768 msgid "Could not write yynxt_tbl[][]" msgstr "Không thể ghi \"yynxt_tbl[][]\"" -#: dfa.c:1049 +#: src/dfa.c:1028 msgid "bad transition character detected in sympartition()" msgstr "phát hiện ký tá»± chuyển tiếp sai trong sympartition()" -#: gen.c:478 +#: src/gen.c:480 msgid "" "\n" "\n" @@ -111,29 +112,29 @@ msgstr "" "Lá»›p tÆ°Æ¡ng Ä‘Æ°Æ¡ng:\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 "trạng thái # %d chấp nháºn: [%d]\n" -#: gen.c:1110 +#: src/gen.c:1115 #, c-format msgid "state # %d accepts: " msgstr "trạng thái # %d chấp nháºn: " -#: gen.c:1157 +#: src/gen.c:1162 msgid "Could not write yyacclist_tbl" msgstr "Không thể ghi \"yyacclist_tbl\"" -#: gen.c:1233 +#: src/gen.c:1236 msgid "Could not write yyacc_tbl" msgstr "Không thể ghi \"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 "Không thể ghi \"ecstbl\"" -#: gen.c:1271 +#: src/gen.c:1271 msgid "" "\n" "\n" @@ -143,392 +144,409 @@ msgstr "" "\n" "Lá»›p tÆ°Æ¡ng-Ä‘Æ°Æ¡ng-meta:\n" -#: gen.c:1293 +#: src/gen.c:1293 msgid "Could not write yymeta_tbl" msgstr "Không thể ghi \"yymeta_tbl\"" -#: gen.c:1354 +#: src/gen.c:1352 msgid "Could not write yybase_tbl" msgstr "Không thể ghi \"yybase_tbl\"" -#: gen.c:1388 +#: src/gen.c:1384 msgid "Could not write yydef_tbl" msgstr "Không thể ghi \"yydef_tbl\"" -#: gen.c:1428 +#: src/gen.c:1422 msgid "Could not write yynxt_tbl" msgstr "Không thể ghi \"yynxt_tbl\"" -#: gen.c:1464 +#: src/gen.c:1456 msgid "Could not write yychk_tbl" msgstr "Không thể ghi \"yychk_tbl\"" -#: gen.c:1618 gen.c:1647 +#: src/gen.c:1608 src/gen.c:1637 msgid "Could not write ftbl" msgstr "Không thể ghi \"ftbl\"" -#: gen.c:1624 +#: src/gen.c:1614 msgid "Could not write ssltbl" msgstr "Không thể ghi \"ssltbl\"" -#: gen.c:1675 +#: src/gen.c:1665 msgid "Could not write eoltbl" msgstr "Không thể ghi \"eoltbl\"" -#: gen.c:1735 +#: src/gen.c:1722 msgid "Could not write yynultrans_tbl" msgstr "Không thể ghi \"yynultrans_tbl\"" -#: main.c:191 +#: src/main.c:178 msgid "rule cannot be matched" msgstr "quy tắc không thể được khá»›p" -#: main.c:196 +#: src/main.c:183 msgid "-s option given but default rule can be matched" msgstr "Ä‘Æ°a ra tùy chá»n \"-s\" còn quy tắc mặc định có thể được khá»›p" -#: main.c:236 +#: src/main.c:221 msgid "Can't use -+ with -l option" msgstr "Không thể dùng ký tá»± \"-+\" vá»›i tùy chá»n \"-l\"" -#: main.c:239 +#: src/main.c:224 msgid "Can't use -f or -F with -l option" msgstr "Không thể dùng cá» \"-f\" hoặc \"-F\" vá»›i tùy chá»n \"-l\"" -#: main.c:243 +#: src/main.c:228 msgid "Can't use --reentrant or --bison-bridge with -l option" -msgstr "Không thể dùng đối số \"--reentrant\" (Ä‘iá»u và o lại) hoặc \"--bison-bridge\" (chiếc cầu bison) vá»›i tùy chá»n \"-l\"" +msgstr "" +"Không thể dùng đối số \"--reentrant\" (Ä‘iá»u và o lại) hoặc \"--bison-bridge" +"\" (chiếc cầu bison) vá»›i tùy chá»n \"-l\"" -#: main.c:275 +#: src/main.c:260 msgid "-Cf/-CF and -Cm don't make sense together" msgstr "Hai tùy chá»n \"-Cf/-CF\" và \"-Cm\" vá»›i nhau thì không có ý nghÄ©a" -#: main.c:278 +#: src/main.c:263 msgid "-Cf/-CF and -I are incompatible" msgstr "Hai tùy chá»n \"-Cf/-CF\" và \"-I\" không tÆ°Æ¡ng thÃch vá»›i nhau" -#: main.c:282 +#: src/main.c:267 msgid "-Cf/-CF are incompatible with lex-compatibility mode" -msgstr "Tùy chá»n \"-Cf/-CF\" không tÆ°Æ¡ng thÃch vá»›i chế Ä‘á»™ \"lex-compatibility\" (tÆ°Æ¡ng thÃch vá»›i lex)" +msgstr "" +"Tùy chá»n \"-Cf/-CF\" không tÆ°Æ¡ng thÃch vá»›i chế Ä‘á»™ \"lex-compatibility" +"\" (tÆ°Æ¡ng thÃch vá»›i lex)" -#: main.c:287 +#: src/main.c:272 msgid "-Cf and -CF are mutually exclusive" msgstr "Hai tùy chá»n \"-Cf\" and \"-CF\" loại từ lẫn nhau" -#: main.c:291 +#: src/main.c:276 msgid "Can't use -+ with -CF option" msgstr "Không thể dùng ký tá»± \"-+\" vá»›i tùy chá»n \"-CF\"" -#: main.c:294 +#: src/main.c:279 #, c-format msgid "%array incompatible with -+ option" msgstr "\"%array\" (mảng) không tÆ°Æ¡ng thÃch vá»›i tùy chá»n \"-+\"" -#: main.c:299 +#: src/main.c:284 msgid "Options -+ and --reentrant are mutually exclusive." msgstr "Hai tùy chá»n \"- +\" và \"--reentrant\" xung Ä‘á»™t vá»›i nhau." -#: main.c:302 +#: src/main.c:287 msgid "bison bridge not supported for the C++ scanner." msgstr "bison bridge (chiếc cầu bison) không được há»— trợ vá»›i bá»™ quét C++." -#: main.c:357 main.c:403 +#: src/main.c:336 src/main.c:419 #, c-format msgid "could not create %s" msgstr "không thể tạo %s" -#: main.c:416 +#: src/main.c:431 msgid "could not write tables header" msgstr "không thể ghi phần đầu bảng" -#: main.c:420 +#: src/main.c:435 #, c-format msgid "can't open skeleton file %s" msgstr "không thể mở táºp tin khung sÆ°á»n %s" -#: main.c:456 +#: src/main.c:450 +msgid "Prefix cannot include '[' or ']'" +msgstr "" + +#: src/main.c:474 msgid "allocation of macro definition failed" msgstr "việc phân bổ cho định nghÄ©a macro gặp lá»—i" -#: main.c:504 +#: src/main.c:521 #, c-format msgid "input error reading skeleton file %s" msgstr "gặp lá»—i nháºp và o khi Ä‘á»c táºp tin khung sÆ°á»n %s" -#: main.c:508 +#: src/main.c:525 #, c-format msgid "error closing skeleton file %s" msgstr "gặp lá»—i khi đóng táºp tin khung sÆ°á»n %s" -#: main.c:693 +#: src/main.c:709 #, c-format msgid "error creating header file %s" msgstr "gặp lá»—i khi tạo táºp tin phần đầu %s" -#: main.c:701 +#: src/main.c:717 #, c-format msgid "error writing output file %s" msgstr "gặp lá»—i khi ghi táºp tin xuất %s" -#: main.c:705 +#: src/main.c:721 #, c-format msgid "error closing output file %s" msgstr "gặp lá»—i khi đóng táºp tin xuất %s" -#: main.c:709 +#: src/main.c:725 #, c-format msgid "error deleting output file %s" msgstr "gặp lá»—i khi xoá bá» táºp tin xuất %s" -#: main.c:716 +#: src/main.c:732 #, c-format msgid "No backing up.\n" msgstr "Không sao lÆ°u.\n" -#: main.c:720 +#: src/main.c:736 #, c-format msgid "%d backing up (non-accepting) states.\n" msgstr "%d Ä‘ang sao lÆ°u các trạng thái (kiểu không chấp nháºn).\n" -#: main.c:724 +#: src/main.c:740 #, c-format msgid "Compressed tables always back up.\n" msgstr "Bảng đã nén lúc nà o cÅ©ng sao lÆ°u.\n" -#: main.c:727 +#: src/main.c:743 #, c-format msgid "error writing backup file %s" msgstr "găp lá»—i khi ghi táºp tin sao lÆ°u %s" -#: main.c:731 +#: src/main.c:747 #, c-format msgid "error closing backup file %s" msgstr "gặp lá»—i khi đóng táºp tin sao lÆ°u %s" -#: main.c:736 +#: src/main.c:752 #, c-format msgid "%s version %s usage statistics:\n" msgstr "%s phiên bản %s thống kê sá» dụng:\n" -#: main.c:739 +#: src/main.c:755 #, c-format msgid " scanner options: -" msgstr " tùy chá»n bá»™ quét: —" -#: main.c:818 +#: src/main.c:834 #, c-format msgid " %d/%d NFA states\n" msgstr " %d/%d trạng thái NFA\n" -#: main.c:820 +#: src/main.c:836 #, c-format msgid " %d/%d DFA states (%d words)\n" msgstr " %d/%d trạng thái DFA (%d từ)\n" -#: main.c:822 +#: src/main.c:838 #, c-format msgid " %d rules\n" msgstr " %d quy tắc\n" -#: main.c:827 +#: src/main.c:843 #, c-format msgid " No backing up\n" msgstr " Không sao lÆ°u\n" -#: main.c:831 +#: src/main.c:847 #, c-format msgid " %d backing-up (non-accepting) states\n" msgstr " %d Ä‘ang sao lÆ°u các trạng thái (kiểu không chấp nháºn)\n" -#: main.c:836 +#: src/main.c:852 #, c-format msgid " Compressed tables always back-up\n" msgstr " Bảng đã nén lúc nà o cÅ©ng sao lÆ°u\n" -#: main.c:840 +#: src/main.c:856 #, c-format msgid " Beginning-of-line patterns used\n" msgstr " Dùng mẫu kiểu đầu dòng\n" -#: main.c:842 +#: src/main.c:858 #, c-format msgid " %d/%d start conditions\n" msgstr " %d/%d Ä‘iá»u kiện bắt đầu\n" -#: main.c:846 +#: src/main.c:862 #, c-format msgid " %d epsilon states, %d double epsilon states\n" msgstr " %d trạng thái épxilông (ε), %d trạng thái épxilông đôi\n" -#: main.c:850 +#: src/main.c:866 #, c-format msgid " no character classes\n" msgstr " không có lá»›p ký tá»±\n" -#: main.c:854 +#: src/main.c:870 #, c-format msgid " %d/%d character classes needed %d/%d words of storage, %d reused\n" msgstr " %d/%d lá»›p ký tá»± cần %d/%d từ bá»™ nhá»›, %d được dùng lại\n" -#: main.c:859 +#: src/main.c:875 #, c-format msgid " %d state/nextstate pairs created\n" msgstr " %d cặp trạng_thái/trạng_thái_kế đã được tạo\n" -#: main.c:862 +#: src/main.c:878 #, c-format msgid " %d/%d unique/duplicate transitions\n" msgstr " %d/%d việc chuyển tiếp duy nhất/trùng\n" -#: main.c:867 +#: src/main.c:883 #, c-format msgid " %d table entries\n" msgstr " %d mục tin bảng\n" -#: main.c:875 +#: src/main.c:891 #, c-format msgid " %d/%d base-def entries created\n" msgstr " %d/%d mục tin base-def (định nghÄ©a cÆ¡ bản) đã được tạo\n" -#: main.c:879 +#: src/main.c:895 #, c-format msgid " %d/%d (peak %d) nxt-chk entries created\n" msgstr " %d/%d (tối Ä‘a %d) mục tin nxt-chk (kiểm tra kế tiếp) đã được tạo\n" -#: main.c:883 +#: src/main.c:899 #, c-format msgid " %d/%d (peak %d) template nxt-chk entries created\n" -msgstr " %d/%d (tối Ä‘a %d) mục tin biểu mẫu nxt-chk (kiểm tra kế tiếp) đã được tạo\n" +msgstr "" +" %d/%d (tối Ä‘a %d) mục tin biểu mẫu nxt-chk (kiểm tra kế tiếp) đã được tạo\n" -#: main.c:887 +#: src/main.c:903 #, c-format msgid " %d empty table entries\n" msgstr " %d mục tin bảng trống\n" -#: main.c:889 +#: src/main.c:905 #, c-format msgid " %d protos created\n" msgstr " %d proto (khai báo nguyên mẫu) đã được tạo\n" -#: main.c:892 +#: src/main.c:908 #, c-format msgid " %d templates created, %d uses\n" msgstr " %d mẫu đã được tạo, %d lần dùng\n" -#: main.c:900 +#: src/main.c:916 #, c-format msgid " %d/%d equivalence classes created\n" msgstr " %d/%d lá»›p kiểu tÆ°Æ¡ng Ä‘Æ°Æ¡ng đã được tạo\n" -#: main.c:908 +#: src/main.c:924 #, c-format msgid " %d/%d meta-equivalence classes created\n" msgstr " %d/%d lá»›p tÆ°Æ¡ng-Ä‘Æ°Æ¡ng-meta đã được tạo\n" -#: main.c:914 +#: src/main.c:930 #, c-format msgid " %d (%d saved) hash collisions, %d DFAs equal\n" msgstr " %d (%d được lÆ°u) lần va chạm mã băm, %d DFA bằng nhau\n" -#: main.c:916 +#: src/main.c:932 #, c-format msgid " %d sets of reallocations needed\n" msgstr " cần %d táºp hợp tái cấp phát\n" -#: main.c:918 +#: src/main.c:934 #, c-format msgid " %d total table entries needed\n" msgstr " cần tổng %d mục tin bảng\n" -#: main.c:995 +#: src/main.c:1008 #, c-format msgid "Internal error. flexopts are malformed.\n" msgstr "Gặp lá»—i ná»™i bá»™ vì những flexopts sai dạng.\n" -#: main.c:1005 +#: src/main.c:1018 #, c-format msgid "Try `%s --help' for more information.\n" msgstr "Hãy thá» lệnh \"%s --help\" (trợ giúp) để xem thêm thông tin.\n" -#: main.c:1062 +#: src/main.c:1075 #, c-format msgid "unknown -C option '%c'" msgstr "không hiểu tùy chá»n \"-C\" là \"%c\"" -#: main.c:1191 +#: src/main.c:1204 #, c-format msgid "%s %s\n" msgstr "%s %s\n" -#: main.c:1466 +#: src/main.c:1476 msgid "fatal parse error" msgstr "gặp lá»—i phân tÃch nghiêm trá»ng" -#: main.c:1498 +#: src/main.c:1508 #, c-format msgid "could not create backing-up info file %s" msgstr "không thể tạo táºp tin thông tin sao lÆ°u %s" -#: main.c:1519 +#: src/main.c:1529 #, c-format msgid "-l AT&T lex compatibility option entails a large performance penalty\n" -msgstr "Tùy chá»n kiểu tÆ°Æ¡ng thÃch lex AT&T \"-l\" là m giảm hiệu suất rất nhiá»u\n" +msgstr "" +"Tùy chá»n kiểu tÆ°Æ¡ng thÃch lex AT&T \"-l\" là m giảm hiệu suất rất nhiá»u\n" -#: main.c:1522 +#: src/main.c:1532 #, c-format msgid " and may be the actual source of other reported performance penalties\n" msgstr " thì có lẽ tháºt gây ra trÆ°á»ng hợp giảm hiệu suất khác\n" -#: main.c:1528 +#: src/main.c:1538 #, c-format -msgid "%%option yylineno entails a performance penalty ONLY on rules that can match newline characters\n" -msgstr "%%tùy chá»n \"yylineno\" giảm hiệu suất CHỈ vá»›i quy tắc khá»›p vá»›i ký tá»± dòng má»›i\n" +msgid "" +"%%option yylineno entails a performance penalty ONLY on rules that can match " +"newline characters\n" +msgstr "" +"%%tùy chá»n \"yylineno\" giảm hiệu suất CHỈ vá»›i quy tắc khá»›p vá»›i ký tá»± dòng " +"má»›i\n" -#: main.c:1535 +#: src/main.c:1545 #, c-format msgid "-I (interactive) entails a minor performance penalty\n" msgstr "Tùy chá»n \"-I\" (tÆ°Æ¡ng tác) giảm hiệu suất má»™t Ãt\n" -#: main.c:1540 +#: src/main.c:1550 #, c-format msgid "yymore() entails a minor performance penalty\n" msgstr "yymore() giảm hiệu suất má»™t Ãt\n" -#: main.c:1546 +#: src/main.c:1556 #, c-format msgid "REJECT entails a large performance penalty\n" msgstr "REJECT (đẩy ra) là m suy giảm hiệu suất nghiêm trá»ng\n" -#: main.c:1551 +#: src/main.c:1561 #, c-format msgid "Variable trailing context rules entail a large performance penalty\n" msgstr "Quy tắc ngữ cảnh theo sau biến rất giảm hiệu suất\n" -#: main.c:1563 +#: src/main.c:1573 msgid "REJECT cannot be used with -f or -F" msgstr "Không cho phép dùng REJECT (đẩy ra) vá»›i tùy chá»n \"-f\" hay \"-F\"" -#: main.c:1566 +#: src/main.c:1576 #, c-format msgid "%option yylineno cannot be used with REJECT" -msgstr "Không cho phép dùng %option (tùy chá»n) \"yylineno\" vá»›i REJECT (đẩy ra)" +msgstr "" +"Không cho phép dùng %option (tùy chá»n) \"yylineno\" vá»›i REJECT (đẩy ra)" -#: main.c:1569 +#: src/main.c:1579 msgid "variable trailing context rules cannot be used with -f or -F" -msgstr "không cho phép dùng quy tắc ngữ cảnh theo sau biến vá»›i tùy chá»n \"-f\" hay \"-F\"" +msgstr "" +"không cho phép dùng quy tắc ngữ cảnh theo sau biến vá»›i tùy chá»n \"-f\" hay " +"\"-F\"" -#: main.c:1692 +#: src/main.c:1704 #, c-format msgid "%option yyclass only meaningful for C++ scanners" msgstr "%option (tùy chá»n) \"yyclass\" chỉ có ý nghÄ©a vá»›i bá»™ quét C++" -#: main.c:1799 +#: src/main.c:1791 #, c-format msgid "Usage: %s [OPTIONS] [FILE]...\n" msgstr "Cách dùng: %s [TÙY_CHỌN] [TẬP_TIN]...\n" -#: main.c:1802 -#, c-format +#: src/main.c:1794 +#, fuzzy, c-format msgid "" "Generates programs that perform pattern-matching on text.\n" "\n" @@ -551,13 +569,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" @@ -579,8 +600,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" @@ -594,29 +613,35 @@ msgstr "" "Tạo ra chÆ°Æ¡ng trình để thá»±c hiện tiến trình khá»›p mẫu trên văn bản thÆ°á»ng.\n" "\n" "Cách nén bảng:\n" -" -Ca, --align thoả hiệp giữa bảng lá»›n hÆ¡n và độ _canh lá»_ bá»™ nhá»› khá hÆ¡n\n" +" -Ca, --align thoả hiệp giữa bảng lá»›n hÆ¡n và độ _canh lá»_ bá»™ nhá»› khá " +"hÆ¡n\n" " -Ce, --ecs cấu tạo lá»›p kiểu tÆ°Æ¡ng Ä‘Æ°Æ¡ng\n" " -Cf không nén bảng; dùng sá»± tiêu biểu \"-f\"\n" " -CF không nén bảng; dùng sá»± cách tiêu biểu \"-F\"\n" " -Cm, --meta-ecs cấu tạo lá»›p kiểu meta tÆ°Æ¡ng Ä‘Æ°Æ¡ng\n" -" -Cr, --read dùng chức năng read() thay thế thiết bị nháºp/xuất chuẩn để nháºp bá»™ quét\n" +" -Cr, --read dùng chức năng read() thay thế thiết bị nháºp/xuất chuẩn " +"để nháºp bá»™ quét\n" " -f, --full tạo ra bá»™ quét nhanh và lá»›n; bằng -Cfr (_đầy đủ_)\n" " -F, --fast dùng sá»± tiêu biểu bảng xen kẽ; bằng -CFr (_nhanh_)\n" -" -Cem phÆ°Æ¡ng pháp nén mặc định; bằng \"--ecs\" \"--meta-ecs\")\n" +" -Cem phÆ°Æ¡ng pháp nén mặc định; bằng \"--ecs\" \"--meta-ecs" +"\")\n" "\n" "Gỡ lá»—i:\n" " -d, --debug báºt chế Ä‘á»™ _gỡ lá»—i_ trong bá»™ quét\n" " -b, --backup ghi thông tin _sao lÆ°u_ và o %s\n" " -p, --perf-report ghi _thông báo hiệu suất_ và o thiết bị lá»—i chuẩn\n" -" -s, --nodefault thu hồi quy tắc _mặc định_ để ECHO (vá»ng) Ä‘oạn chÆ°a khá»›p\n" +" -s, --nodefault thu hồi quy tắc _mặc định_ để ECHO (vá»ng) Ä‘oạn " +"chÆ°a khá»›p\n" " -T, --trace %s nên chạy trong chế Ä‘á»™ theo _dấu vết_\n" " -w, --nowarn _không_ tạo ra lá»i _cảnh báo_\n" -" -v, --verbose ghi tóm tắt các thống kê bá»™ quét và o thiết bị xuất chuẩn (_chi tiêt_)\n" +" -v, --verbose ghi tóm tắt các thống kê bá»™ quét và o thiết bị xuất " +"chuẩn (_chi tiêt_)\n" "\n" "Táºp tin:\n" " -o, --outfile=TẬP_TIN ghi rõ tên _táºp tin xuất_\n" " -S, --skel=TẬP_TIN ghi rõ táºp tin _khung sÆ°á»n_\n" -" -t, --stdout ghi bá»™ quét ra _thiết bị xuất chuẩn_ thay thế ra %s\n" +" -t, --stdout ghi bá»™ quét ra _thiết bị xuất chuẩn_ thay thế ra " +"%s\n" " --yyclass=TÊN tên của _lá»›p_ C++\n" " --header-file=TẬP_TIN tạo _táºp tin phần đầu_ C thêm và o bá»™ quét\n" " --tables-file[=TẬP_TIN] ghi các bảng và o TẬP_TIN nà y\n" @@ -633,15 +658,20 @@ msgstr "" "\n" "Mã đã tạo ra :\n" " -+, --c++ tạo ra hang bá»™ quét kiểu C++\n" -" -Dmacro[=định_nghÄ©a] _định nghÄ©a_ cho lệnh #define (mặc định là \"1\")\n" +" -Dmacro[=định_nghÄ©a] _định nghÄ©a_ cho lệnh #define (mặc định là " +"\"1\")\n" " -L, --noline thu hồi các chỉ thị #line trong bá»™ quét\n" " -P, --prefix=CHUá»–I dùng CHUá»–I nà y là _tiá»n tố_ thay thế \"yy\"\n" " -R, --reentrant tạo ra má»™t bá»™ quét C kiểu _và o lại_\n" -" --bison-bridge bá»™ quét cho trình phân tách thuần tuý kiểu bison.\n" +" --bison-bridge bá»™ quét cho trình phân tách thuần tuý kiểu " +"bison.\n" " --bison-locations gồm khả năng há»— trợ yylloc (_địa Ä‘iểm_).\n" -" --stdinit khởi Ä‘á»™ng yyin/yyout và o thiết bị nháºp/xuất chuẩn\n" -" --noansi-definitions _lá»i định nghÄ©a_ chức năng kiểu cÅ© (_không ANSI_)\n" -" --noansi-prototypes danh sách tham số trống trong _khai báo nghi thức_ (_không ANSI_)\n" +" --stdinit khởi Ä‘á»™ng yyin/yyout và o thiết bị nháºp/xuất " +"chuẩn\n" +" --noansi-definitions _lá»i định nghÄ©a_ chức năng kiểu cÅ© (_không " +"ANSI_)\n" +" --noansi-prototypes danh sách tham số trống trong _khai báo nghi " +"thức_ (_không ANSI_)\n" " --nounistd _không_ bao gồm <unistd.h>\n" " --noCHỨC_NÄ‚NG không tạo ra má»™t CHỨC NÄ‚NG cá biệt\n" "\n" @@ -652,51 +682,52 @@ msgstr "" " -h, --help hiển thị _trợ giúp_ nà y\n" " -V, --version thông báo phiên bản %s\n" -#: misc.c:65 +#: src/misc.c:64 msgid "allocation of sko_stack failed" msgstr "việc phân bổ cho sko_stack gặp lá»—i" -#: misc.c:102 misc.c:128 +#: src/misc.c:100 #, c-format msgid "name \"%s\" ridiculously long" msgstr "tên \"%s\" là dà i nhố nhăng" -#: misc.c:177 +#: src/misc.c:155 msgid "memory allocation failed in allocate_array()" msgstr "việc phân chia bá»™ nhá»› bị lá»—i trong allocate_array() (phân bổ mảng)" -#: misc.c:230 +#: src/misc.c:205 #, c-format msgid "bad character '%s' detected in check_char()" msgstr "phát hiện ký tá»± sai \"%s\" trong check_char() (kiểm tra ký tá»±)" -#: misc.c:235 +#: src/misc.c:210 #, c-format msgid "scanner requires -8 flag to use the character %s" msgstr "bá»™ quét cần thiết cá» \"-8\" để dùng ký tá»± %s" -#: misc.c:268 -msgid "dynamic memory failure in copy_string()" -msgstr "bá»™ nhá»› Ä‘á»™ng đã thất bại trong copy_string() (sao chép chuá»—i)" +#: src/misc.c:229 +#, fuzzy +msgid "memory allocation failure in xstrdup()" +msgstr "việc phân chia bá»™ nhá»› bị lá»—i trong allocate_array() (phân bổ mảng)" -#: misc.c:367 +#: src/misc.c:303 #, c-format msgid "%s: fatal internal error, %s\n" msgstr "%s: gặp lá»—i nôi bá»™ nghiêm trá»ng, %s\n" -#: misc.c:803 +#: src/misc.c:671 msgid "attempt to increase array size failed" msgstr "việc thá» tăng kÃch cỡ mảng đã thất bại" -#: misc.c:930 +#: src/misc.c:795 msgid "bad line in skeleton file" msgstr "gặp dòng sai trong táºp tin khung sÆ°á»n" -#: misc.c:979 +#: src/misc.c:845 msgid "memory allocation failed in yy_flex_xmalloc()" msgstr "việc phân bổ bá»™ nhá»› bị lá»—i trong yy_flex_xmalloc()" -#: nfa.c:104 +#: src/nfa.c:100 #, c-format msgid "" "\n" @@ -707,226 +738,240 @@ msgstr "" "\n" "********** bắt đầu đổ NFA có trạng thái bắt đầu là %d\n" -#: nfa.c:115 +#: src/nfa.c:111 #, c-format msgid "state # %4d\t" msgstr "trạng thái # %4d\t" -#: nfa.c:130 +#: src/nfa.c:126 #, c-format msgid "********** end of dump\n" msgstr "********** đổ xong\n" -#: nfa.c:174 +#: src/nfa.c:169 msgid "empty machine in dupmachine()" msgstr "máy trống trong dupmachine() (nhân đôi máy)" -#: nfa.c:240 +#: src/nfa.c:234 #, c-format msgid "Variable trailing context rule at line %d\n" msgstr "Gặp quy tắc ngữ cảnh theo sau biến tại dòng %d\n" -#: nfa.c:364 +#: src/nfa.c:357 msgid "bad state type in mark_beginning_as_normal()" -msgstr "kiểu trạng thái sai trong mark_beginning_as_normal() (đánh dấu đầu là thÆ°á»ng)" +msgstr "" +"kiểu trạng thái sai trong mark_beginning_as_normal() (đánh dấu đầu là thÆ°á»ng)" -#: nfa.c:609 +#: src/nfa.c:595 #, c-format msgid "input rules are too complicated (>= %d NFA states)" msgstr "các quy tắc đầu và o là quá phức tạp (≥ %d trạng thái NFA)" -#: nfa.c:688 +#: src/nfa.c:673 msgid "found too many transitions in mkxtion()" msgstr "gặp quá nhiá»u chuyển tiếp trong mkxtion()" -#: nfa.c:714 +#: src/nfa.c:699 #, c-format msgid "too many rules (> %d)!" msgstr "quá nhiá»u quy tắc (> %d) !" -#: parse.y:159 +#: src/parse.y:159 msgid "unknown error processing section 1" msgstr "gặp lá»—i không rõ khi xá» lý phần 1" -#: parse.y:184 parse.y:351 +#: src/parse.y:184 src/parse.y:353 msgid "bad start condition list" msgstr "danh sách Ä‘iá»u kiện bắt đầu là sai" -#: parse.y:315 +#: src/parse.y:204 +msgid "Prefix must not contain [ or ]" +msgstr "" + +#: src/parse.y:317 msgid "unrecognized rule" msgstr "gặp quy tắc không được thừa nháºn" -#: 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 "ngữ cảnh theo sau được dùng hai lần" -#: 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 "gặp giá trị lặp lại sai" -#: 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 "giá trị lặp lại phải là số dÆ°Æ¡ng" -#: 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 "phạm vi ký tá»± [%c-%c] là chÆ°a rõ rà ng trong trÆ°á»ng hợp quét bá» qua chữ HOA/thÆ°á»ng" +msgstr "" +"phạm vi ký tá»± [%c-%c] là chÆ°a rõ rà ng trong trÆ°á»ng hợp quét bá» qua chữ HOA/" +"thÆ°á»ng" -#: parse.y:819 +#: src/parse.y:821 msgid "negative range in character class" msgstr "gặp phạm vi âm trong lá»›p ký tá»±" -#: parse.y:916 +#: src/parse.y:918 msgid "[:^lower:] is ambiguous in case insensitive scanner" msgstr "[:^lower:] là chÆ°a rõ rà ng trong trÆ°á»ng hợp quét bá» qua chữ HOA/thÆ°á»ng" -#: parse.y:922 +#: src/parse.y:924 msgid "[:^upper:] ambiguous in case insensitive scanner" msgstr "[:^upper:] là chÆ°a rõ rà ng trong trÆ°á»ng hợp quét bá» qua chữ HOA/thÆ°á»ng" -#: 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 "dòng nháºp quá dà i\n" -#: scan.l:161 +#: src/scan.l:183 #, c-format msgid "malformed '%top' directive" msgstr "chỉ thị kiểu \"%top\" (đầu) dạng sai" -#: scan.l:183 +#: src/scan.l:205 #, no-c-format msgid "unrecognized '%' directive" msgstr "gặp chỉ thị kiểu \"%\" không được nháºn dạng" -#: scan.l:192 +#: src/scan.l:214 msgid "Definition name too long\n" msgstr "Tên định nghÄ©a quá dà i\n" -#: scan.l:284 +#: src/scan.l:309 msgid "Unmatched '{'" msgstr "ChÆ°a khá»›p \"{\"" -#: scan.l:300 +#: src/scan.l:325 #, c-format msgid "Definition value for {%s} too long\n" msgstr "Giá trị định nghÄ©a cho {%s} quá dà i\n" -#: scan.l:317 +#: src/scan.l:342 msgid "incomplete name definition" msgstr "lá»i Ä‘inh nghÄ©a tên chÆ°a hoà n tất" -#: scan.l:443 +#: src/scan.l:467 msgid "Option line too long\n" msgstr "dòng tùy chá»n quá dà i\n" -#: scan.l:451 +#: src/scan.l:475 #, c-format msgid "unrecognized %%option: %s" msgstr "gặp tùy chá»n %% không được nháºn dạng: %s" -#: scan.l:633 scan.l:800 +#: src/scan.l:659 src/scan.l:832 msgid "bad character class" msgstr "lá»›p ký tá»± sai" -#: scan.l:683 +#: src/scan.l:709 #, c-format msgid "undefined definition {%s}" msgstr "chÆ°a định nghÄ©a định danh {%s}" -#: scan.l:755 +#: src/scan.l:772 +msgid "unbalanced parenthesis" +msgstr "" + +#: src/scan.l:787 #, c-format msgid "bad <start condition>: %s" msgstr "<start condition> (Ä‘iệu kiện bắt đầu) sai: %s" -#: scan.l:768 +#: src/scan.l:800 msgid "missing quote" msgstr "thiếu dấu trÃch dẫn" -#: scan.l:834 +#: src/scan.l:866 #, c-format msgid "bad character class expression: %s" msgstr "biểu thức lá»›p ký tá»± sai: %s" -#: scan.l:856 +#: src/scan.l:888 msgid "bad character inside {}'s" msgstr "có ký tá»± sai ở trong hai dấu ngoặc móc {}" -#: scan.l:862 +#: src/scan.l:894 msgid "missing }" msgstr "thiếu }" -#: scan.l:940 +#: src/scan.l:972 msgid "EOF encountered inside an action" msgstr "gặp kết thúc táºp tin ở trong má»™t hà nh Ä‘á»™ng" -#: scan.l:945 +#: src/scan.l:977 msgid "EOF encountered inside pattern" msgstr "gặp kết thúc táºp tin ở trong mẫu" -#: scan.l:967 +#: src/scan.l:1010 #, c-format msgid "bad character: %s" msgstr "ký tá»± sai: %s" -#: scan.l:996 +#: src/scan.l:1038 #, c-format msgid "can't open %s" msgstr "không thể mở %s" -#: scanopt.c:291 +#: src/scanopt.c:259 #, c-format msgid "Usage: %s [OPTIONS]...\n" msgstr "Cách dùng: %s [TÙY_CHỌN]...\n" -#: scanopt.c:564 +#: src/scanopt.c:524 #, c-format msgid "option `%s' doesn't allow an argument\n" msgstr "tùy chá»n \"%s\" không cho phép đối số\n" -#: scanopt.c:569 +#: src/scanopt.c:529 #, c-format msgid "option `%s' requires an argument\n" msgstr "tùy chá»n \"%s\" cần má»™t đối số\n" -#: scanopt.c:573 +#: src/scanopt.c:533 #, c-format msgid "option `%s' is ambiguous\n" msgstr "tùy chá»n \"%s\" chÆ°a rõ rà ng\n" -#: scanopt.c:577 +#: src/scanopt.c:537 #, c-format msgid "Unrecognized option `%s'\n" msgstr "Không nháºn ra tùy chá»n \"%s\"\n" -#: scanopt.c:581 +#: src/scanopt.c:541 #, c-format msgid "Unknown error=(%d)\n" msgstr "Không rõ lá»—i=(%d)\n" -#: sym.c:100 +#: src/sym.c:92 msgid "symbol table memory allocation failed" msgstr "gặp lá»—i khi phân bổ bá»™ nhá»› của bảng ký hiệu" -#: sym.c:202 +#: src/sym.c:183 msgid "name defined twice" msgstr "tên đã được định nghÄ©a hai lần" -#: sym.c:253 +#: src/sym.c:231 #, c-format msgid "start condition %s declared twice" msgstr "Ä‘iá»u kiện bắt đầu %s đã được khai báo hai lần" -#: yylex.c:56 +#: src/yylex.c:57 msgid "premature EOF" msgstr "gặp kết thúc táºp tin quá sá»›m" -#: yylex.c:198 +#: src/yylex.c:200 #, c-format msgid "End Marker\n" msgstr "Dấu kết thúc\n" -#: yylex.c:204 +#: src/yylex.c:206 #, c-format msgid "*Something Weird* - tok: %d val: %d\n" msgstr "* Äiá»u lạ * — thẻ bà i: %d giá trị: %d\n" + +#~ msgid "dynamic memory failure in copy_string()" +#~ msgstr "bá»™ nhá»› Ä‘á»™ng đã thất bại trong copy_string() (sao chép chuá»—i)" diff --git a/po/zh_CN.po b/po/zh_CN.po index e03ab9c..01cee78 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -1,46 +1,73 @@ # Chinese translations for flex. -# Copyright (C) 2002 The Flex Project +# Copyright (C) 2014 The Flex Project (msgids) +# This file is distributed under the same license as the flex package. # Wang Li <charles@linux.net.cn>, 2002. -# +# Wei-Lun Chao <bluebat@member.fsf.org>, 2009, 2013. +# Mingye Wang <arthur200126@gmail.com>, 2015. msgid "" msgstr "" -"Project-Id-Version: flex 2.5.8\n" -"POT-Creation-Date: 2002-06-19 09:43-0400\n" -"PO-Revision-Date: 2002-08-18 10:37+0800\n" -"Last-Translator: Wang Li <charles@linux.net.cn>\n" +"Project-Id-Version: flex 2.5.38\n" +"Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n" +"POT-Creation-Date: 2017-05-06 10:49-0400\n" +"PO-Revision-Date: 2015-08-27 16:54+0800\n" +"Last-Translator: Mingye Wang <arthur200126@gmail.com>\n" "Language-Team: Chinese (simplified) <i18n-zh@googlegroups.com>\n" +"Language: zh_CN\n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=gb2312\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" +"X-Generator: Poedit 1.8.4\n" -#: dfa.c:64 +#: src/buf.c:79 +msgid "Allocation of buffer to print string failed" +msgstr "给予缓冲区é…é¢ä»¥æ‰“å°å—串时失败" + +#: src/buf.c:107 +msgid "Allocation of buffer for line directive failed" +msgstr "给予缓冲区é…é¢ç”¨äºŽåˆ—指令时失败" + +#: src/buf.c:177 +msgid "Allocation of buffer for m4 def failed" +msgstr "给予缓冲区é…é¢ç”¨äºŽ m4 def 时失败" + +#: src/buf.c:198 +msgid "Allocation of buffer for m4 undef failed" +msgstr "给予缓冲区é…é¢ç”¨äºŽ m4 undef 时失败" + +#: src/dfa.c:59 #, c-format msgid "State #%d is non-accepting -\n" -msgstr "" +msgstr "#%d æ£å¤„于éžè®¿é—®çŠ¶æ€ -\n" -#: dfa.c:131 +#: src/dfa.c:119 msgid "dangerous trailing context" -msgstr "" +msgstr "ä¸å®‰å…¨çš„末端上下文" -#: dfa.c:174 +#: src/dfa.c:159 +#, c-format msgid " associated rule line numbers:" -msgstr "" +msgstr " å…³è”的规则列å·ï¼š" -#: dfa.c:212 +#: src/dfa.c:193 +#, c-format msgid " out-transitions: " -msgstr "" +msgstr " 外转æ¢ï¼š" -#: dfa.c:220 +#: src/dfa.c:201 +#, c-format msgid "" "\n" " jam-transitions: EOF " msgstr "" +"\n" +" åˆå¹¶è½¬æ¢ï¼šæ–‡ä»¶ç»“å°¾ " -#: dfa.c:357 +#: src/dfa.c:331 msgid "consistency check failed in epsclosure()" -msgstr "epsclosure() ÖеÄÒ»ÖÂÐÔ¼ì²éʧ°Ü" +msgstr "epsclosure() ä¸çš„一致性检查失败" -#: dfa.c:443 +#: src/dfa.c:419 msgid "" "\n" "\n" @@ -49,27 +76,27 @@ msgid "" msgstr "" "\n" "\n" -"DFA Êä³ö£º\n" +"DFA 转储:\n" "\n" -#: dfa.c:589 +#: src/dfa.c:587 msgid "could not create unique end-of-buffer state" -msgstr "ÎÞ·¨´´½¨¶ÀÁ¢µÄ end-of-buffer ״̬" +msgstr "æ— æ³•åˆ›å»ºç‹¬ç«‹çš„ end-of-buffer 状æ€" -#: dfa.c:610 +#: src/dfa.c:608 #, c-format msgid "state # %d:\n" -msgstr "״̬ # %d£º\n" +msgstr "çŠ¶æ€ # %d:\n" -#: dfa.c:994 -msgid "consistency check failed in symfollowset" -msgstr "symfollowset ÖеÄÒ»ÖÂÐÔ¼ì²éʧ°Ü" +#: src/dfa.c:768 +msgid "Could not write yynxt_tbl[][]" +msgstr "æ— æ³•å†™å…¥ yynxt_tbl[][]" -#: dfa.c:1047 +#: src/dfa.c:1028 msgid "bad transition character detected in sympartition()" -msgstr "ÔÚ sympartition() ¼ì²âµ½´íÎóµÄ±ä»»×Ö·û" +msgstr "在 sympartition() 检测到错误的å˜æ¢å—符" -#: gen.c:251 +#: src/gen.c:480 msgid "" "\n" "\n" @@ -78,364 +105,434 @@ msgid "" msgstr "" "\n" "\n" -"µÈ¼ÛÀࣺ\n" +"ç‰ä»·ç±»ï¼š\n" "\n" -#: gen.c:429 gen.c:913 +#: src/gen.c:669 src/gen.c:698 src/gen.c:1218 #, c-format msgid "state # %d accepts: [%d]\n" -msgstr "" +msgstr "çŠ¶æ€ # %d 接å—:[%d]\n" -#: gen.c:834 +#: src/gen.c:1115 #, c-format msgid "state # %d accepts: " -msgstr "" +msgstr "çŠ¶æ€ # %d 接å—:" + +#: src/gen.c:1162 +msgid "Could not write yyacclist_tbl" +msgstr "æ— æ³•å†™å…¥ yyacclist_tbl" -#: gen.c:936 +#: src/gen.c:1236 +msgid "Could not write yyacc_tbl" +msgstr "æ— æ³•å†™å…¥ yyacc_tbl" + +#: src/gen.c:1251 src/gen.c:1623 src/gen.c:1646 +msgid "Could not write ecstbl" +msgstr "æ— æ³•å†™å…¥ ecstbl" + +#: src/gen.c:1271 msgid "" "\n" "\n" "Meta-Equivalence Classes:\n" msgstr "" +"\n" +"\n" +"å…ƒç‰ä»·ç±»ï¼š\n" + +#: src/gen.c:1293 +msgid "Could not write yymeta_tbl" +msgstr "æ— æ³•å†™å…¥ yymeta_tbl" -#: main.c:163 +#: src/gen.c:1352 +msgid "Could not write yybase_tbl" +msgstr "æ— æ³•å†™å…¥ yybase_tbl" + +#: src/gen.c:1384 +msgid "Could not write yydef_tbl" +msgstr "æ— æ³•å†™å…¥ yydef_tbl" + +#: src/gen.c:1422 +msgid "Could not write yynxt_tbl" +msgstr "æ— æ³•å†™å…¥ yynxt_tbl" + +#: src/gen.c:1456 +msgid "Could not write yychk_tbl" +msgstr "æ— æ³•å†™å…¥ yychk_tbl" + +#: src/gen.c:1608 src/gen.c:1637 +msgid "Could not write ftbl" +msgstr "æ— æ³•å†™å…¥ ftbl" + +#: src/gen.c:1614 +msgid "Could not write ssltbl" +msgstr "æ— æ³•å†™å…¥ ssltbl" + +#: src/gen.c:1665 +msgid "Could not write eoltbl" +msgstr "æ— æ³•å†™å…¥ eoltbl" + +#: src/gen.c:1722 +msgid "Could not write yynultrans_tbl" +msgstr "æ— æ³•å†™å…¥ yynultrans_tbl" + +#: src/main.c:178 msgid "rule cannot be matched" -msgstr "ÎÞ·¨Æ¥Åä¹æÔò" +msgstr "æ— æ³•åŒ¹é…规则" -#: main.c:168 +#: src/main.c:183 msgid "-s option given but default rule can be matched" -msgstr "" +msgstr "-s 选项已给定但是å¯ä»¥å»åˆç¼ºçœè§„则" -#: main.c:203 +#: src/main.c:221 msgid "Can't use -+ with -l option" -msgstr "" +msgstr "æ— æ³•å°† -+ 与 -l 选项共åŒä½¿ç”¨" -#: main.c:206 +#: src/main.c:224 msgid "Can't use -f or -F with -l option" -msgstr "" +msgstr "æ— æ³•å°† -f 或 -F 与 -l 选项共åŒä½¿ç”¨" -#: main.c:209 -msgid "Can't use -R or -Rb with -l option" -msgstr "" +#: src/main.c:228 +msgid "Can't use --reentrant or --bison-bridge with -l option" +msgstr "æ— æ³•å°† --reentrant 或 --bison-bridge 与 -l 选项共åŒä½¿ç”¨" -#: main.c:223 -msgid "Can't specify header option if writing to stdout." -msgstr "" - -#: main.c:249 +#: src/main.c:260 msgid "-Cf/-CF and -Cm don't make sense together" -msgstr "" +msgstr "-Cf/-CF å’Œ -Cm 共用时ä¸å…·ä»»ä½•æ„义" -#: main.c:252 +#: src/main.c:263 msgid "-Cf/-CF and -I are incompatible" -msgstr "" +msgstr "-Cf/-CF å’Œ -I 是ä¸å…¼å®¹çš„" -#: main.c:256 +#: src/main.c:267 msgid "-Cf/-CF are incompatible with lex-compatibility mode" -msgstr "" - -#: main.c:260 -#, c-format -msgid "-Cf/-CF and %option yylineno are incompatible" -msgstr "" +msgstr "-Cf/-CF 与 lex 兼容模å¼æ˜¯ä¸å…¼å®¹çš„" -#: main.c:263 +#: src/main.c:272 msgid "-Cf and -CF are mutually exclusive" -msgstr "" +msgstr "-Cf å’Œ -CF 是互斥的" -#: main.c:267 +#: src/main.c:276 msgid "Can't use -+ with -CF option" -msgstr "" +msgstr "æ— æ³•å°† -+ 与 -CF 选项共åŒä½¿ç”¨" -#: main.c:271 +#: src/main.c:279 #, c-format msgid "%array incompatible with -+ option" -msgstr "" +msgstr "%array 与 -+ 选项ä¸å…¼å®¹" -#: main.c:276 -msgid "Options -+ and -R are mutually exclusive." -msgstr "" +#: src/main.c:284 +msgid "Options -+ and --reentrant are mutually exclusive." +msgstr "选项 -+ å’Œ --reentrant 是互斥的。" + +#: src/main.c:287 +msgid "bison bridge not supported for the C++ scanner." +msgstr "bison 桥接器ä¸å— C++ 扫æ程åºæ”¯æŒã€‚" -#: main.c:328 main.c:524 +#: src/main.c:336 src/main.c:419 #, c-format msgid "could not create %s" -msgstr "ÎÞ·¨´´½¨ %s" +msgstr "æ— æ³•åˆ›å»º %s" -#: main.c:334 +#: src/main.c:431 +msgid "could not write tables header" +msgstr "æ— æ³•å†™å…¥è¡¨å¤´" + +#: src/main.c:435 #, c-format msgid "can't open skeleton file %s" -msgstr "ÎÞ·¨´ò¿ª¹Ç¼ÜÎļþ %s" +msgstr "æ— æ³•æ‰“å¼€éª¨æž¶æ–‡ä»¶ %s" + +#: src/main.c:450 +msgid "Prefix cannot include '[' or ']'" +msgstr "" -#: main.c:492 +#: 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 ʱÊäÈë´íÎó" +msgstr "读å–骨架文件 %s 时输入错误" -#: main.c:496 +#: src/main.c:525 #, c-format msgid "error closing skeleton file %s" -msgstr "¹Ø±Õ¹Ç¼ÜÎļþ %s ³ö´í" +msgstr "å…³é—骨架文件 %s 出错" -#: main.c:690 +#: src/main.c:709 #, c-format msgid "error creating header file %s" -msgstr "´´½¨Í·Îļþ %s ³ö´í" +msgstr "创建头文件 %s 出错" -#: main.c:698 +#: src/main.c:717 #, c-format msgid "error writing output file %s" -msgstr "дÈëÊä³öÎļþ %s ³ö´í" +msgstr "写入输出文件 %s 出错" -#: main.c:702 +#: src/main.c:721 #, c-format msgid "error closing output file %s" -msgstr "¹Ø±ÕÊä³öÎļþ %s ³ö´í" +msgstr "å…³é—输出文件 %s 出错" -#: main.c:706 +#: src/main.c:725 #, c-format msgid "error deleting output file %s" -msgstr "ɾ³ýÊä³öÎļþ %s ³ö´í" +msgstr "åˆ é™¤è¾“å‡ºæ–‡ä»¶ %s 出错" -#: main.c:714 +# See Concept Index. fr translation is wrong for that 'archive'. +#: src/main.c:732 +#, c-format msgid "No backing up.\n" -msgstr "" +msgstr "没有回溯。\n" -#: main.c:717 +#: src/main.c:736 #, c-format msgid "%d backing up (non-accepting) states.\n" -msgstr "" +msgstr "%d 回溯 (éžæŽ¥å—) 状æ€ã€‚\n" -#: main.c:721 +#: src/main.c:740 +#, c-format msgid "Compressed tables always back up.\n" -msgstr "" +msgstr "åŽ‹ç¼©è¿‡çš„è¡¨æ ¼æ€»ä¼šè‡ªåŠ¨å›žæº¯ã€‚\n" -#: main.c:724 +#: src/main.c:743 #, c-format msgid "error writing backup file %s" -msgstr "дÈ뱸·ÝÎļþ %s ³ö´í" +msgstr "写入回溯文件 %s 出错" -#: main.c:728 +#: src/main.c:747 #, c-format msgid "error closing backup file %s" -msgstr "¹Ø±Õ±¸·ÝÎļþ %s ³ö´í" +msgstr "å…³é—回溯文件 %s 出错" -#: main.c:734 +#: src/main.c:752 #, c-format msgid "%s version %s usage statistics:\n" -msgstr "" +msgstr "%s 版本 %s 用法统计:\n" -#: main.c:737 +#: src/main.c:755 +#, c-format msgid " scanner options: -" -msgstr " ɨÃèÆ÷Ñ¡Ï-" +msgstr " 扫æ器选项:-" -#: main.c:817 +#: src/main.c:834 #, c-format msgid " %d/%d NFA states\n" -msgstr "" +msgstr " %d/%d NFA 状æ€\n" -#: main.c:819 +#: src/main.c:836 #, c-format msgid " %d/%d DFA states (%d words)\n" -msgstr "" +msgstr " %d/%d DFA çŠ¶æ€ (%d 个å—è¯)\n" -#: main.c:821 +#: src/main.c:838 #, c-format msgid " %d rules\n" -msgstr " %d Ìõ¹æÔò\n" +msgstr " %d æ¡è§„则\n" -#: main.c:825 +#: src/main.c:843 +#, c-format msgid " No backing up\n" -msgstr "" +msgstr " 没有回溯\n" -#: main.c:828 +#: src/main.c:847 #, c-format msgid " %d backing-up (non-accepting) states\n" -msgstr "" +msgstr " %d 回溯 (éžæŽ¥å—) 状æ€\n" -#: main.c:832 +#: src/main.c:852 +#, c-format msgid " Compressed tables always back-up\n" -msgstr "" +msgstr " åŽ‹ç¼©è¿‡çš„è¡¨æ ¼æ€»ä¼šè‡ªåŠ¨å›žæº¯\n" -#: main.c:836 +#: src/main.c:856 +#, c-format msgid " Beginning-of-line patterns used\n" -msgstr "" +msgstr " 列首å¼æ ·å·²ä½¿ç”¨\n" -#: main.c:838 +#: src/main.c:858 #, c-format msgid " %d/%d start conditions\n" -msgstr "" +msgstr " %d/%d 起始æ¡ä»¶\n" -#: main.c:841 +#: src/main.c:862 #, c-format msgid " %d epsilon states, %d double epsilon states\n" -msgstr "" +msgstr " %d ε状æ€ï¼Œ%d åŒå€ÎµçŠ¶æ€\n" -#: main.c:845 +#: src/main.c:866 +#, c-format msgid " no character classes\n" -msgstr "" +msgstr " æ— å—符类别\n" -#: main.c:848 +#: src/main.c:870 #, c-format msgid " %d/%d character classes needed %d/%d words of storage, %d reused\n" -msgstr "" +msgstr " %d/%d å—符类别所需 %d/%d å—è¯çš„ä¿å˜ä½“,%d é‡æ–°ä½¿ç”¨\n" -#: main.c:853 +#: src/main.c:875 #, c-format msgid " %d state/nextstate pairs created\n" -msgstr "" +msgstr " %d 状æ€/下一状æ€å¯¹å·²åˆ›å»º\n" -#: main.c:855 +#: src/main.c:878 #, c-format msgid " %d/%d unique/duplicate transitions\n" -msgstr "" +msgstr " %d/%d 独一/é‡å¤è½¬æ¢\n" -#: main.c:861 +#: src/main.c:883 #, c-format msgid " %d table entries\n" -msgstr "" +msgstr " %d è¡¨æ ¼é¡¹ç›®\n" -#: main.c:869 +#: src/main.c:891 #, c-format msgid " %d/%d base-def entries created\n" -msgstr "" +msgstr " %d/%d base-def 项目已创建\n" -#: main.c:872 +#: src/main.c:895 #, c-format msgid " %d/%d (peak %d) nxt-chk entries created\n" -msgstr "" +msgstr " %d/%d (峰值 %d) nxt-chk 项目已创建\n" -#: main.c:875 +#: src/main.c:899 #, c-format msgid " %d/%d (peak %d) template nxt-chk entries created\n" -msgstr "" +msgstr " %d/%d (峰值 %d) æ¨¡æ¿ nxt-chk 项目已创建\n" -#: main.c:879 +#: src/main.c:903 #, c-format msgid " %d empty table entries\n" -msgstr "" +msgstr " %d æ¸…ç©ºè¡¨æ ¼é¡¹ç›®\n" -#: main.c:881 +#: src/main.c:905 #, c-format msgid " %d protos created\n" -msgstr "" +msgstr " %d 原型已创建\n" -#: main.c:884 +#: src/main.c:908 #, c-format msgid " %d templates created, %d uses\n" -msgstr "" +msgstr " %d 范本已创建,%d 使用\n" -#: main.c:892 +#: src/main.c:916 #, c-format msgid " %d/%d equivalence classes created\n" -msgstr "" +msgstr " %d/%d ç‰ä»·ç±»åˆ«å·²åˆ›å»º\n" -#: main.c:900 +#: src/main.c:924 #, c-format msgid " %d/%d meta-equivalence classes created\n" -msgstr "" +msgstr " %d/%d åŽè®¾ç‰ä»·ç±»åˆ«å·²åˆ›å»º\n" -#: main.c:905 +#: src/main.c:930 #, c-format msgid " %d (%d saved) hash collisions, %d DFAs equal\n" -msgstr "" +msgstr " %d (%d å·²ä¿å˜) 哈希碰撞,%d DFAs 相ç‰\n" -#: main.c:907 +#: src/main.c:932 #, c-format msgid " %d sets of reallocations needed\n" -msgstr "" +msgstr " éœ€è¦ %d 组é‡æ–°é…ç½®\n" -#: main.c:909 +#: src/main.c:934 #, c-format msgid " %d total table entries needed\n" -msgstr "" +msgstr " æ€»è®¡éœ€è¦ %d è¡¨æ ¼é¡¹ç›®\n" -#: main.c:966 +#: src/main.c:1008 +#, c-format msgid "Internal error. flexopts are malformed.\n" -msgstr "" +msgstr "内部错误。flexopts 功能异常。\n" -#: main.c:974 +#: src/main.c:1018 #, c-format msgid "Try `%s --help' for more information.\n" -msgstr "" +msgstr "å°è¯•ã€Œ%s --helpã€ä»¥èŽ·å¾—更多信æ¯ã€‚\n" -#: main.c:1033 +#: src/main.c:1075 #, c-format msgid "unknown -C option '%c'" -msgstr "δ֪µÄ -C Ñ¡Ïî¡°%c¡±" +msgstr "未知的 -C 选项“%câ€" -#: main.c:1116 -#, c-format -msgid "unknown -R option '%c'" -msgstr "δ֪µÄ -R Ñ¡Ïî¡°%c¡±" - -#: main.c:1153 +#: src/main.c:1204 #, c-format msgid "%s %s\n" msgstr "%s %s\n" -#: main.c:1395 +#: src/main.c:1476 msgid "fatal parse error" -msgstr "ÖÂÃüµÄ½âÎö´íÎó" +msgstr "致命的解æžé”™è¯¯" -#: main.c:1407 +#: src/main.c:1508 #, c-format msgid "could not create backing-up info file %s" -msgstr "" +msgstr "æ— æ³•åˆ›å»ºå›žæº¯ä¿¡æ¯æ–‡ä»¶ %s" -#: main.c:1429 +#: src/main.c:1529 +#, c-format msgid "-l AT&T lex compatibility option entails a large performance penalty\n" -msgstr "" +msgstr "-l AT&T lex 兼容性选项会导致大幅性能å‡é€€\n" -#: main.c:1431 +#: src/main.c:1532 +#, c-format msgid " and may be the actual source of other reported performance penalties\n" -msgstr "" +msgstr " åŒæ—¶ä¹Ÿè®¸æ˜¯å…¶ä»–回报性能å‡é€€çš„实际æ¥æº\n" -#: main.c:1437 +#: src/main.c:1538 #, c-format -msgid "%%option yylineno entails a large performance penalty\n" -msgstr "" +msgid "" +"%%option yylineno entails a performance penalty ONLY on rules that can match " +"newline characters\n" +msgstr "%%option yylineno 导致性能å‡é€€ï¼Œåªæœ‰å½“该规则该å»åˆæ–°åˆ—å—符时æ‰ä¼š\n" -#: main.c:1444 +#: src/main.c:1545 +#, c-format msgid "-I (interactive) entails a minor performance penalty\n" -msgstr "" +msgstr "-I (交互å¼) 导致å°å¹…性能å‡é€€\n" -#: main.c:1448 +#: src/main.c:1550 +#, c-format msgid "yymore() entails a minor performance penalty\n" -msgstr "" +msgstr "yymore() 导致å°å¹…性能å‡é€€\n" -#: main.c:1453 +#: src/main.c:1556 +#, c-format msgid "REJECT entails a large performance penalty\n" -msgstr "" +msgstr "REJECT 导致大幅性能å‡é€€\n" -#: main.c:1457 +#: src/main.c:1561 +#, c-format msgid "Variable trailing context rules entail a large performance penalty\n" -msgstr "" +msgstr "å˜é‡æœ«å°¾ä¸Šä¸‹æ–‡è§„则导致大幅性能å‡é€€\n" -#: main.c:1470 +#: src/main.c:1573 msgid "REJECT cannot be used with -f or -F" -msgstr "" +msgstr "REJECT æ— æ³•ä¸Ž -f 或 -F å…±åŒä½¿ç”¨" -#: main.c:1473 +#: src/main.c:1576 #, c-format -msgid "%option yylineno cannot be used with -f or -F" -msgstr "" +msgid "%option yylineno cannot be used with REJECT" +msgstr "%option yylineno æ— æ³•ä¸Ž REJECT å…±åŒä½¿ç”¨" -#: main.c:1476 +#: src/main.c:1579 msgid "variable trailing context rules cannot be used with -f or -F" -msgstr "" +msgstr "å˜é‡æœ«å°¾ä¸Šä¸‹æ–‡è§„åˆ™æ— æ³•ä¸Ž -f 或 -F å…±åŒä½¿ç”¨" -#: main.c:1607 +#: src/main.c:1704 #, c-format msgid "%option yyclass only meaningful for C++ scanners" -msgstr "" +msgstr "%option yyclass åªå¯¹äºŽ C++ 扫æ程åºæœ‰æ„义" -#: main.c:1711 +#: src/main.c:1791 #, c-format msgid "Usage: %s [OPTIONS] [FILE]...\n" -msgstr "Ó÷¨£º%s [Ñ¡Ïî] [Îļþ]...\n" +msgstr "用法:%s [选项] [文件]...\n" -#: main.c:1714 -#, c-format +#: src/main.c:1794 +#, fuzzy, c-format msgid "" "Generates programs that perform pattern-matching on text.\n" "\n" @@ -458,13 +555,17 @@ 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 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" " -7, --7bit generate 7-bit scanner\n" @@ -482,7 +583,8 @@ msgid "" " -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" -" -Rb, --reentrant-bison reentrant scanner for bison pure parser.\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" @@ -494,48 +596,113 @@ msgid "" " -h, --help produce this help message\n" " -V, --version report %s version\n" msgstr "" +"äº§ç”Ÿèƒ½å¤Ÿæ ¹æ®æ–‡æœ¬è¿›è¡Œå¼æ ·åŒ¹é…的程åºã€‚\n" +"\n" +"è¡¨æ ¼åŽ‹ç¼©ï¼š\n" +" -Ca,--align æ¢æŽ‰è¾ƒå¤§è¡¨æ ¼ä»¥èŽ·å–较佳内å˜å¯¹ä½\n" +" -Ce,--ecs 建构ç‰ä»·ç±»åˆ«\n" +" -Cf ä¸åŽ‹ç¼©è¡¨æ ¼ï¼›ä½¿ç”¨ -f 表示法\n" +" -CF ä¸åŽ‹ç¼©è¡¨æ ¼ï¼›ä½¿ç”¨ -F 表示法\n" +" -Cm,--meta-ecs æž„é€ åŽè®¾ç‰ä»·ç±»åˆ«\n" +" -Cr,--read 使用 read() 以代替 stdio 用于扫æ程åºçš„输入\n" +" -f, --full 产生快速,大型扫æ程åºã€‚å¦‚åŒ -Cfr\n" +" -F, --fast ä½¿ç”¨äº¤æ›¿è¡¨æ ¼è¡¨ç¤ºæ³•ã€‚å¦‚åŒ -CFr\n" +" -Cem 缺çœåŽ‹ç¼© (å¦‚åŒ --ecs --meta-ecs)\n" +"\n" +"调试:\n" +" -d, --debug 在扫æ程åºä¸å¯ç”¨é™¤é”™æ¨¡å¼\n" +" -b, --backup 写入回溯信æ¯åˆ° %s\n" +" -p, --perf-report å°†æ€§èƒ½æŠ¥å‘Šå†™å…¥æ ‡å‡†å‹˜è¯¯\n" +" -s, --nodefault 抑制缺çœè§„则以回应ä¸ç¬¦åˆçš„文本\n" +" -T, --trace %s 应该在追踪模å¼ä¸è¿è¡Œ\n" +" -w, --nowarn ä¸äº§ç”Ÿè¦å‘Š\n" +" -v, --verbose 将概è¦çš„扫æ程åºç»Ÿè®¡å†™å…¥æ ‡å‡†è¾“出\n" +"\n" +"文件:\n" +" -o, --outfile=文件 指定输出文件å\n" +" -S, --skel=文件 指定架构文件\n" +" -t, --stdout 将扫æ程åºå†™å…¥æ ‡å‡†è¾“出以代替 %s\n" +" --yyclass=å称 C++ 类别的å称\n" +" --header-file=文件 扫æ程åºä¹‹å¤–创建 C æ ‡å¤´æ¡£\n" +" --tables-file[=文件] å°†è¡¨æ ¼å†™å…¥æ–‡ä»¶\n" +"\n" +"扫æ程åºè¡Œä¸ºï¼š\n" +" -7, --7bit 产生七比特扫æ程åº\n" +" -8, --8bit 产生八比特扫æ程åº\n" +" -B, --batch 产生批次扫æç¨‹åº (相对于 -I)\n" +" -i, --case-insensitive 忽略å¼æ ·ä¸çš„大å°å†™\n" +" -l, --lex-compat 与原始 lex 最大兼容\n" +" -X, --posix-compat 与 POSIX lex 最大兼容\n" +" -I, --interactive 产生交互å¼æ‰«æç¨‹åº (相对于 -B)\n" +" --yylineno 在 yylineno ä¸è®¡æ•°è½¨åˆ—\n" +"\n" +"产生的编ç :\n" +" -+, --c++ 产生 C++ 扫æ程åºç±»åˆ«\n" +" -Dmacro [=defn] #define å® defn (ç¼ºçœ defn 为「1ã€)\n" +" -L, --noline 在扫æ程åºä¸æŠ‘制 # 列指令\n" +" -P, --prefix=å—串 使用å—串作为å‰ç¼€ä»¥ä»£æ›¿ã€Œyyã€\n" +" -R, --reentrant 产生é‡æ–°è¿›å…¥ C 扫æ程åº\n" +" --bison-bridge 扫æ程åºç”¨äºŽ bison pure 剖æžå™¨ã€‚\n" +" --bison-locations åŒ…å« yylloc 支æŒã€‚\n" +" --stdinit åˆå§‹åŒ– yyin/yyout åˆ°æ ‡å‡†è¾“å…¥/æ ‡å‡†è¾“å‡º\n" +" --noansi-definitions æ—§å¼å‡½æ•°å®šä¹‰\n" +" --noansi-prototypes 在原型ä¸æ¸…空å‚数清å•\n" +" --nounistd ä¸åŒ…å« <unistd.h>\n" +" --noFUNCTION ä¸äº§ç”Ÿç‰¹å®šå‡½æ•°\n" +"\n" +"æ‚项:\n" +" -c do-nothing POSIX 选项\n" +" -n do-nothing POSIX 选项\n" +" -?\n" +" -h, --help 产生这个说明消æ¯\n" +" -V, --version 报告 %s 版本\n" + +#: src/misc.c:64 +msgid "allocation of sko_stack failed" +msgstr "给予 sko_stack é…é¢æ—¶å¤±è´¥" -#: misc.c:47 +#: src/misc.c:100 #, c-format msgid "name \"%s\" ridiculously long" -msgstr "" +msgstr "å称「%sã€æœ‰è’谬的长度" -#: misc.c:101 +#: src/misc.c:155 msgid "memory allocation failed in allocate_array()" -msgstr "" +msgstr "在 allocatearray() ä¸å†…å˜é…置失败" -#: misc.c:179 +#: src/misc.c:205 #, c-format msgid "bad character '%s' detected in check_char()" -msgstr "" +msgstr "在 checkchar() ä¸ä¾¦æµ‹åˆ°ä¸å½“çš„å—符「%sã€" -#: misc.c:184 +#: src/misc.c:210 #, c-format msgid "scanner requires -8 flag to use the character %s" -msgstr "" +msgstr "扫æ程åºéœ€è¦ -8 æ——æ ‡ä»¥ä½¿ç”¨å—符 %s" -#: misc.c:217 -msgid "dynamic memory failure in copy_string()" -msgstr "" +#: src/misc.c:229 +#, fuzzy +msgid "memory allocation failure in xstrdup()" +msgstr "在 allocatearray() ä¸å†…å˜é…置失败" -#: misc.c:349 +#: src/misc.c:303 #, c-format msgid "%s: fatal internal error, %s\n" -msgstr "" +msgstr "%s:严é‡å†…部错误,%s\n" -#: misc.c:775 +#: src/misc.c:671 msgid "attempt to increase array size failed" -msgstr "ÊÔͼÔö¼ÓÊý×é´óСʱʧ°Ü" +msgstr "è¯•å›¾å¢žåŠ æ•°ç»„å¤§å°æ—¶å¤±è´¥" -#: misc.c:847 +#: src/misc.c:795 msgid "bad line in skeleton file" -msgstr "¹Ç¼ÜÎļþÖдíÎóµÄÐÐ" +msgstr "骨架文件ä¸é”™è¯¯çš„è¡Œ" -#: misc.c:892 +#: src/misc.c:845 msgid "memory allocation failed in yy_flex_xmalloc()" -msgstr "ÔÚ yy_flex_xmalloc() ÖеÄÄÚ´æ·ÖÅäʧ°Ü" +msgstr "在 yy_flex_xmalloc() ä¸çš„内å˜åˆ†é…失败" -#: nfa.c:103 +#: src/nfa.c:100 #, c-format msgid "" "\n" @@ -544,183 +711,245 @@ msgid "" msgstr "" "\n" "\n" -"********** ¿ªÊ¼Êä³öÆðʼ״̬Ϊ %d µÄ NFA\n" +"********** 开始输出起始状æ€ä¸º %d çš„ NFA\n" -#: nfa.c:115 +#: src/nfa.c:111 #, c-format msgid "state # %4d\t" -msgstr "״̬ # %4d\t" +msgstr "çŠ¶æ€ # %4d\t" -#: nfa.c:130 +#: src/nfa.c:126 +#, c-format msgid "********** end of dump\n" -msgstr "********** Êä³ö½áÊø\n" +msgstr "********** 输出结æŸ\n" -#: nfa.c:176 +#: src/nfa.c:169 msgid "empty machine in dupmachine()" -msgstr "" +msgstr "在 dupmachine() ä¸æ¸…空机器" -#: nfa.c:228 +#: src/nfa.c:234 #, c-format msgid "Variable trailing context rule at line %d\n" -msgstr "" +msgstr "å˜é‡æœ«å°¾ä¸Šä¸‹æ–‡è§„则于列 %d\n" -#: nfa.c:350 +#: src/nfa.c:357 msgid "bad state type in mark_beginning_as_normal()" -msgstr "" +msgstr "在 mark_beginning_as_normal() ä¸æœ‰ä¸å½“的状æ€è¾“å…¥" -#: nfa.c:603 +#: src/nfa.c:595 #, c-format msgid "input rules are too complicated (>= %d NFA states)" -msgstr "" +msgstr "输入规则太å¤æ‚ (>= %d NFA 状æ€)" -#: nfa.c:682 +#: src/nfa.c:673 msgid "found too many transitions in mkxtion()" -msgstr "" +msgstr "在 mkxtion() ä¸æ‰¾åˆ°å¤ªå¤šè½¬æ¢" -#: nfa.c:708 +#: src/nfa.c:699 #, c-format msgid "too many rules (> %d)!" -msgstr "¹æÔò¹ý¶à (> %d)£¡" +msgstr "规则过多 (> %d)ï¼" -#: parse.y:174 +#: src/parse.y:159 msgid "unknown error processing section 1" -msgstr "δ֪µÄ´íÎó´¦Àí½Ú 1" +msgstr "未知的错误处ç†èŠ‚ 1" -#: parse.y:199 parse.y:362 +#: src/parse.y:184 src/parse.y:353 msgid "bad start condition list" -msgstr "´íÎóµÄÆðʼ״̬Áбí" +msgstr "错误的起始状æ€åˆ—表" + +#: src/parse.y:204 +msgid "Prefix must not contain [ or ]" +msgstr "" -#: parse.y:326 +#: src/parse.y:317 msgid "unrecognized rule" -msgstr "²»ÄÜʶ±ðµÄ¹æÔò" +msgstr "ä¸èƒ½è¯†åˆ«çš„规则" -#: parse.y:444 parse.y:457 parse.y:526 +#: src/parse.y:436 src/parse.y:449 src/parse.y:518 msgid "trailing context used twice" -msgstr "" +msgstr "末尾上下文已使用两次" -#: parse.y:562 parse.y:572 parse.y:645 parse.y:655 +#: src/parse.y:554 src/parse.y:564 src/parse.y:637 src/parse.y:647 msgid "bad iteration values" -msgstr "" +msgstr "ä¸å½“çš„è¿ä»£å€¼" -#: parse.y:590 parse.y:608 parse.y:673 parse.y:691 +#: src/parse.y:582 src/parse.y:600 src/parse.y:665 src/parse.y:683 msgid "iteration value must be positive" -msgstr "" +msgstr "è¿ä»£å€¼å¿…须是æ£å€¼" + +#: 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:785 +#: src/parse.y:821 msgid "negative range in character class" -msgstr "" +msgstr "在å—符类别ä¸æœ‰è´Ÿå€¼èŒƒå›´" + +#: src/parse.y:918 +msgid "[:^lower:] is ambiguous in case insensitive scanner" +msgstr "在大å°å†™ä¸é¡»ç›¸ç¬¦çš„扫æ程åºä¸ï¼Œ[:^lower:] 是模棱两å¯çš„" + +#: src/parse.y:924 +msgid "[:^upper:] ambiguous in case insensitive scanner" +msgstr "在大å°å†™ä¸é¡»ç›¸ç¬¦çš„扫æ程åºä¸ï¼Œ[:^upper:] 是模棱两å¯çš„" + +#: src/scan.l:82 src/scan.l:644 src/scan.l:702 +msgid "Input line too long\n" +msgstr "输入列太长\n" -#: scan.l:140 +#: src/scan.l:183 +#, c-format +msgid "malformed '%top' directive" +msgstr "异常的「%topã€æŒ‡ä»¤" + +#: src/scan.l:205 #, no-c-format msgid "unrecognized '%' directive" -msgstr "" +msgstr "æ— æ³•è¾¨è¯†çš„ã€Œ%ã€æŒ‡ä»¤" + +#: src/scan.l:214 +msgid "Definition name too long\n" +msgstr "定义å称太长\n" + +#: src/scan.l:309 +msgid "Unmatched '{'" +msgstr "ä¸æˆå¯¹çš„「{ã€" -#: scan.l:207 +#: src/scan.l:325 +#, c-format +msgid "Definition value for {%s} too long\n" +msgstr "{%s} 的定义值太长\n" + +#: src/scan.l:342 msgid "incomplete name definition" -msgstr "²»ÍêÕûµÄÃû³Æ¶¨Òå" +msgstr "ä¸å®Œæ•´çš„å称定义" + +#: src/scan.l:467 +msgid "Option line too long\n" +msgstr "选项列太长\n" -#: scan.l:316 +#: src/scan.l:475 #, c-format msgid "unrecognized %%option: %s" -msgstr "²»ÄÜʶ±ðµÄ %%Ñ¡Ï%s" +msgstr "ä¸èƒ½è¯†åˆ«çš„ %%选项:%s" -#: scan.l:449 scan.l:549 +#: src/scan.l:659 src/scan.l:832 msgid "bad character class" -msgstr "´íÎóµÄ×Ö·ûÀà±ð" +msgstr "错误的å—符类别" -#: scan.l:481 +#: src/scan.l:709 #, c-format msgid "undefined definition {%s}" -msgstr "䶨ÒåµÄ¶¨Òå {%s}" +msgstr "未定义的定义 {%s}" + +#: src/scan.l:772 +msgid "unbalanced parenthesis" +msgstr "" -#: scan.l:517 +#: src/scan.l:787 #, c-format msgid "bad <start condition>: %s" -msgstr "´íÎó <ÆðʼÌõ¼þ>£º%s" +msgstr "错误 <起始æ¡ä»¶>:%s" -#: scan.l:530 +#: src/scan.l:800 msgid "missing quote" -msgstr "ÒÅ©ÒýºÅ" +msgstr "é—æ¼å¼•å·" -#: scan.l:570 +#: src/scan.l:866 #, c-format msgid "bad character class expression: %s" -msgstr "´íÎóµÄ×Ö·ûÀà±ð±í´ïʽ£º%s" +msgstr "错误的å—符类别表达å¼ï¼š%s" -#: scan.l:592 +#: src/scan.l:888 msgid "bad character inside {}'s" -msgstr "" +msgstr "ä¸å½“å—符于 {} 内部" -#: scan.l:598 +#: src/scan.l:894 msgid "missing }" -msgstr "ÒÅ© }" +msgstr "é—æ¼ }" -#: scan.l:671 +#: src/scan.l:972 msgid "EOF encountered inside an action" -msgstr "ÔÚ¶¯×÷ÖÐÎļþ½áÊø" +msgstr "在动作ä¸æ–‡ä»¶ç»“æŸ" + +#: src/scan.l:977 +msgid "EOF encountered inside pattern" +msgstr "在å¼æ ·ä¹‹å†…é‡åˆ°æ–‡ä»¶ç»“æŸ" -#: scan.l:691 +#: src/scan.l:1010 #, c-format msgid "bad character: %s" -msgstr "´íÎóµÄ×Ö·û£º%s" +msgstr "错误的å—符:%s" -#: scan.l:720 +#: src/scan.l:1038 #, c-format msgid "can't open %s" -msgstr "ÎÞ·¨´ò¿ª %s" +msgstr "æ— æ³•æ‰“å¼€ %s" -#: scanopt.c:267 +#: src/scanopt.c:259 #, c-format msgid "Usage: %s [OPTIONS]...\n" -msgstr "Ó÷¨£º%s [Ñ¡Ïî]...\n" +msgstr "用法:%s [选项]...\n" -#: scanopt.c:516 +#: src/scanopt.c:524 #, c-format msgid "option `%s' doesn't allow an argument\n" -msgstr "Ñ¡Ïî¡°%s¡±²»½ÓÊܲÎÊý\n" +msgstr "选项“%sâ€ä¸æŽ¥å—å‚æ•°\n" -#: scanopt.c:519 +#: src/scanopt.c:529 #, c-format msgid "option `%s' requires an argument\n" -msgstr "Ñ¡Ïî¡°%s¡±ÐèÒªÒ»¸ö²ÎÊý\n" +msgstr "选项“%sâ€éœ€è¦ä¸€ä¸ªå‚æ•°\n" -#: scanopt.c:522 +#: src/scanopt.c:533 #, c-format msgid "option `%s' is ambiguous\n" -msgstr "" +msgstr "选项「%sã€æ˜¯æ¨¡æ£±ä¸¤å¯çš„\n" -#: scanopt.c:525 +#: src/scanopt.c:537 #, c-format msgid "Unrecognized option `%s'\n" -msgstr "δ֪µÄÑ¡Ïî¡°%s¡±\n" +msgstr "未知的选项“%sâ€\n" -#: scanopt.c:528 +#: src/scanopt.c:541 #, c-format msgid "Unknown error=(%d)\n" -msgstr "δ֪´íÎó=(%d)\n" +msgstr "未知错误=(%d)\n" -#: sym.c:100 +#: src/sym.c:92 msgid "symbol table memory allocation failed" -msgstr "·ûºÅ±íÄÚ´æ·ÖÅäʧ°Ü" +msgstr "符å·è¡¨å†…å˜åˆ†é…失败" -#: sym.c:210 +#: src/sym.c:183 msgid "name defined twice" -msgstr "Ãû³Æ¶¨ÒåÁËÁ½´Î" +msgstr "å称定义了两次" -#: sym.c:265 +#: src/sym.c:231 #, c-format msgid "start condition %s declared twice" -msgstr "ÆðʼÌõ¼þ %s ÉùÃ÷ÁËÁ½´Î" +msgstr "起始æ¡ä»¶ %s 声明了两次" -#: yylex.c:58 +#: src/yylex.c:57 msgid "premature EOF" -msgstr "" +msgstr "过早出现文件结尾" -#: yylex.c:207 +#: src/yylex.c:200 +#, c-format msgid "End Marker\n" -msgstr "" +msgstr "结æŸæ ‡å¿—\n" -#: yylex.c:212 +#: src/yylex.c:206 #, c-format msgid "*Something Weird* - tok: %d val: %d\n" -msgstr "" +msgstr "*情况很怪异* - tok:%d val:%d\n" + +#~ msgid "dynamic memory failure in copy_string()" +#~ msgstr "在 copystring() ä¸åŠ¨æ€å†…å˜å¤±è´¥" + +#~ msgid "consistency check failed in symfollowset" +#~ msgstr "symfollowset ä¸çš„一致性检查失败" + +#~ msgid "unknown -R option '%c'" +#~ msgstr "未知的 -R 选项“%câ€" diff --git a/po/zh_TW.po b/po/zh_TW.po index 4b491db..f0f0ca0 100644 --- a/po/zh_TW.po +++ b/po/zh_TW.po @@ -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() ä¸å‹•æ…‹è¨˜æ†¶é«”失敗" diff --git a/src/.gitignore b/src/.gitignore new file mode 100644 index 0000000..1daa9f8 --- /dev/null +++ b/src/.gitignore @@ -0,0 +1,12 @@ +*.la +*.lo +*.o +config.h +config.h.in +flex +parse.c +parse.h +scan.c +skel.c +stage1scan.[cl] +stage1flex diff --git a/Android.bp b/src/Android.bp index 5c3a879..8184a67 100644 --- a/Android.bp +++ b/src/Android.bp @@ -36,12 +36,14 @@ cc_binary_host { "-DHAVE_STDBOOL_H=1", "-DHAVE_REGEX_H=1", "-DSTDC_HEADERS=1", - "-DVERSION=\"2.5.39\"", + "-DVERSION=\"2.6.4\"", // TODO: This should use a hermetic m4 -- this is a default that can be overwritten // overwritten with the M4 environment variable, which may be simpler within the build. "-DM4=\"m4\"", + "-Wno-pointer-sign", + "-Wno-unused-parameter", "-Wno-unused-variable", "-Wno-unused-label", @@ -55,10 +57,11 @@ cc_binary_host { genrule { name: "flex_skel.c", // This is lightly modified from Makefile.am - cmd: "sed 's/m4_/m4postproc_/g; s/m4preproc_/m4_/g' $(in) | m4 -P -I $$(dirname $(in)) -DFLEX_MAJOR_VERSION=2 -DFLEX_MINOR_VERSION=5 -DFLEX_SUBMINOR_VERSION=39 | sed 's/m4postproc_/m4_/g' | /bin/bash $(location mkskel.sh) >$(out)", + cmd: "/bin/bash $(location mkskel.sh) `dirname $(in)` m4 2.6.4 >$(out)", tool_files: [ "mkskel.sh", "flexint.h", + "tables_shared.c", "tables_shared.h", ], srcs: [ diff --git a/src/FlexLexer.h b/src/FlexLexer.h new file mode 100644 index 0000000..c4dad2b --- /dev/null +++ b/src/FlexLexer.h @@ -0,0 +1,220 @@ +// -*-C++-*- +// FlexLexer.h -- define interfaces for lexical analyzer classes generated +// by flex + +// Copyright (c) 1993 The Regents of the University of California. +// All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Kent Williams and Tom Epperly. +// +// 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. + +// This file defines FlexLexer, an abstract class which specifies the +// external interface provided to flex C++ lexer objects, and yyFlexLexer, +// which defines a particular lexer class. +// +// If you want to create multiple lexer classes, you use the -P flag +// to rename each yyFlexLexer to some other xxFlexLexer. You then +// include <FlexLexer.h> in your other sources once per lexer class: +// +// #undef yyFlexLexer +// #define yyFlexLexer xxFlexLexer +// #include <FlexLexer.h> +// +// #undef yyFlexLexer +// #define yyFlexLexer zzFlexLexer +// #include <FlexLexer.h> +// ... + +#ifndef __FLEX_LEXER_H +// Never included before - need to define base class. +#define __FLEX_LEXER_H + +#include <iostream> + +extern "C++" { + +struct yy_buffer_state; +typedef int yy_state_type; + +class FlexLexer +{ +public: + virtual ~FlexLexer() { } + + const char* YYText() const { return yytext; } + int YYLeng() const { return yyleng; } + + virtual void + yy_switch_to_buffer( yy_buffer_state* new_buffer ) = 0; + virtual yy_buffer_state* yy_create_buffer( std::istream* s, int size ) = 0; + virtual yy_buffer_state* yy_create_buffer( std::istream& s, int size ) = 0; + virtual void yy_delete_buffer( yy_buffer_state* b ) = 0; + virtual void yyrestart( std::istream* s ) = 0; + virtual void yyrestart( std::istream& s ) = 0; + + virtual int yylex() = 0; + + // Call yylex with new input/output sources. + int yylex( std::istream& new_in, std::ostream& new_out ) + { + switch_streams( new_in, new_out ); + return yylex(); + } + + int yylex( std::istream* new_in, std::ostream* new_out = 0) + { + switch_streams( new_in, new_out ); + return yylex(); + } + + // Switch to new input/output streams. A nil stream pointer + // indicates "keep the current one". + virtual void switch_streams( std::istream* new_in, + std::ostream* new_out ) = 0; + virtual void switch_streams( std::istream& new_in, + std::ostream& new_out ) = 0; + + int lineno() const { return yylineno; } + + int debug() const { return yy_flex_debug; } + void set_debug( int flag ) { yy_flex_debug = flag; } + +protected: + char* yytext; + int yyleng; + int yylineno; // only maintained if you use %option yylineno + int yy_flex_debug; // only has effect with -d or "%option debug" +}; + +} +#endif // FLEXLEXER_H + +#if defined(yyFlexLexer) || ! defined(yyFlexLexerOnce) +// Either this is the first time through (yyFlexLexerOnce not defined), +// or this is a repeated include to define a different flavor of +// yyFlexLexer, as discussed in the flex manual. +# define yyFlexLexerOnce + +extern "C++" { + +class yyFlexLexer : public FlexLexer { +public: + // arg_yyin and arg_yyout default to the cin and cout, but we + // only make that assignment when initializing in yylex(). + yyFlexLexer( std::istream& arg_yyin, std::ostream& arg_yyout ); + yyFlexLexer( std::istream* arg_yyin = 0, std::ostream* arg_yyout = 0 ); +private: + void ctor_common(); + +public: + + virtual ~yyFlexLexer(); + + void yy_switch_to_buffer( yy_buffer_state* new_buffer ); + yy_buffer_state* yy_create_buffer( std::istream* s, int size ); + yy_buffer_state* yy_create_buffer( std::istream& s, int size ); + void yy_delete_buffer( yy_buffer_state* b ); + void yyrestart( std::istream* s ); + void yyrestart( std::istream& s ); + + void yypush_buffer_state( yy_buffer_state* new_buffer ); + void yypop_buffer_state(); + + virtual int yylex(); + virtual void switch_streams( std::istream& new_in, std::ostream& new_out ); + virtual void switch_streams( std::istream* new_in = 0, std::ostream* new_out = 0 ); + virtual int yywrap(); + +protected: + virtual int LexerInput( char* buf, int max_size ); + virtual void LexerOutput( const char* buf, int size ); + virtual void LexerError( const char* msg ); + + void yyunput( int c, char* buf_ptr ); + int yyinput(); + + void yy_load_buffer_state(); + void yy_init_buffer( yy_buffer_state* b, std::istream& s ); + void yy_flush_buffer( yy_buffer_state* b ); + + int yy_start_stack_ptr; + int yy_start_stack_depth; + int* yy_start_stack; + + void yy_push_state( int new_state ); + void yy_pop_state(); + int yy_top_state(); + + yy_state_type yy_get_previous_state(); + yy_state_type yy_try_NUL_trans( yy_state_type current_state ); + int yy_get_next_buffer(); + + std::istream yyin; // input source for default LexerInput + std::ostream yyout; // output sink for default LexerOutput + + // yy_hold_char holds the character lost when yytext is formed. + char yy_hold_char; + + // Number of characters read into yy_ch_buf. + int yy_n_chars; + + // Points to current character in buffer. + char* yy_c_buf_p; + + int yy_init; // whether we need to initialize + int yy_start; // start state number + + // Flag which is used to allow yywrap()'s to do buffer switches + // instead of setting up a fresh yyin. A bit of a hack ... + int yy_did_buffer_switch_on_eof; + + + size_t yy_buffer_stack_top; /**< index of top of stack. */ + size_t yy_buffer_stack_max; /**< capacity of stack. */ + yy_buffer_state ** yy_buffer_stack; /**< Stack as an array. */ + void yyensure_buffer_stack(void); + + // The following are not always needed, but may be depending + // on use of certain flex features (like REJECT or yymore()). + + yy_state_type yy_last_accepting_state; + char* yy_last_accepting_cpos; + + yy_state_type* yy_state_buf; + yy_state_type* yy_state_ptr; + + char* yy_full_match; + int* yy_full_state; + int yy_full_lp; + + int yy_lp; + int yy_looking_for_trail_begin; + + int yy_more_flag; + int yy_more_len; + int yy_more_offset; + int yy_prev_more_offset; +}; + +} + +#endif // yyFlexLexer || ! yyFlexLexerOnce diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..e379692 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,168 @@ +AM_YFLAGS = -d +AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" +LIBS = @LIBS@ + +m4 = @M4@ + +bin_PROGRAMS = flex +if ENABLE_BOOTSTRAP +noinst_PROGRAMS = stage1flex +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) + +nodist_flex_SOURCES = \ + stage1scan.c + +flex_CFLAGS = $(AM_CFLAGS) $(WARNINGFLAGS) + +COMMON_SOURCES = \ + buf.c \ + ccl.c \ + dfa.c \ + ecs.c \ + filter.c \ + flexdef.h \ + flexint.h \ + gen.c \ + main.c \ + misc.c \ + nfa.c \ + options.c \ + options.h \ + parse.y \ + regex.c \ + scanflags.c \ + scanopt.c \ + scanopt.h \ + skel.c \ + sym.c \ + tables.c \ + tables.h \ + tables_shared.c \ + tables_shared.h \ + tblcmp.c \ + version.h \ + yylex.c + +LDADD = $(LIBOBJS) @LIBINTL@ + +include_HEADERS = \ + FlexLexer.h + +EXTRA_DIST = \ + flex.skl \ + mkskel.sh \ + gettext.h + +CLEANFILES = stage1scan.c stage1flex$(EXEEXT) + +MAINTAINERCLEANFILES = skel.c + +skel.c: flex.skl mkskel.sh flexint.h tables_shared.h tables_shared.c + $(SHELL) $(srcdir)/mkskel.sh $(srcdir) $(m4) $(VERSION) > $@.tmp + mv $@.tmp $@ + +if ENABLE_BOOTSTRAP +stage1scan.c: scan.l stage1flex$(EXEEXT) + ./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. + +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. +# +# Whole idea: +# 1. Check for .indent.pro, otherwise indent will use unknown +# settings, or worse, the GNU defaults.) +# 2. Check that this is GNU indent. +# 3. Make sure to process only the NON-generated .c and .h files. +# 4. Run indent twice per file. The first time is a test. +# Otherwise, indent overwrites your file even if it fails! +indentfiles = \ + buf.c \ + ccl.c \ + dfa.c \ + ecs.c \ + scanflags.c \ + filter.c \ + flexdef.h \ + gen.c \ + libmain.c \ + libyywrap.c \ + main.c \ + misc.c \ + nfa.c \ + options.c \ + options.h \ + regex.c \ + scanopt.c \ + scanopt.h \ + sym.c \ + tables.c \ + tables.h \ + tables_shared.c \ + tables_shared.h \ + tblcmp.c + +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 @@ -73,12 +73,13 @@ struct Buf *buf_prints (struct Buf *buf, const char *fmt, const char *s) char *t; size_t tsz; - t = flex_alloc (tsz = strlen (fmt) + strlen (s) + 1); + tsz = strlen(fmt) + strlen(s) + 1; + t = malloc(tsz); if (!t) flexfatal (_("Allocation of buffer to print string failed")); snprintf (t, tsz, fmt, s); buf = buf_strappend (buf, t); - flex_free (t); + free(t); return buf; } @@ -90,22 +91,28 @@ struct Buf *buf_prints (struct Buf *buf, const char *fmt, const char *s) */ struct Buf *buf_linedir (struct Buf *buf, const char* filename, int lineno) { - char *dst, *src, *t; + char *dst, *t; + const char *src; + size_t tsz; - t = flex_alloc (strlen ("#line \"\"\n") + /* constant parts */ - 2 * strlen (filename) + /* filename with possibly all backslashes escaped */ - (int) (1 + log10 (abs (lineno))) + /* line number */ - 1); /* NUL */ + if (gen_line_dirs) + return buf; + + tsz = strlen("#line \"\"\n") + /* constant parts */ + 2 * strlen (filename) + /* filename with possibly all backslashes escaped */ + (size_t) (1 + ceil (log10 (abs (lineno)))) + /* line number */ + 1; /* NUL */ + t = malloc(tsz); if (!t) flexfatal (_("Allocation of buffer for line directive failed")); - for (dst = t + sprintf (t, "#line %d \"", lineno), src = filename; *src; *dst++ = *src++) + for (dst = t + snprintf (t, tsz, "#line %d \"", lineno), src = filename; *src; *dst++ = *src++) if (*src == '\\') /* escape backslashes */ *dst++ = '\\'; *dst++ = '"'; *dst++ = '\n'; *dst = '\0'; buf = buf_strappend (buf, t); - flex_free (t); + free(t); return buf; } @@ -123,10 +130,7 @@ struct Buf *buf_concat(struct Buf* dest, const struct Buf* src) /* Appends n characters in str to buf. */ -struct Buf *buf_strnappend (buf, str, n) - struct Buf *buf; - const char *str; - int n; +struct Buf *buf_strnappend (struct Buf *buf, const char *str, int n) { buf_append (buf, str, n + 1); @@ -137,18 +141,13 @@ struct Buf *buf_strnappend (buf, str, n) } /* Appends characters in str to buf. */ -struct Buf *buf_strappend (buf, str) - struct Buf *buf; - const char *str; +struct Buf *buf_strappend (struct Buf *buf, const char *str) { - return buf_strnappend (buf, str, strlen (str)); + return buf_strnappend (buf, str, (int) strlen (str)); } /* appends "#define str def\n" */ -struct Buf *buf_strdefine (buf, str, def) - struct Buf *buf; - const char *str; - const char *def; +struct Buf *buf_strdefine (struct Buf *buf, const char *str, const char *def) { buf_strappend (buf, "#define "); buf_strappend (buf, " "); @@ -167,12 +166,13 @@ struct Buf *buf_strdefine (buf, str, 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; val = val?val:""; - str = (char*)flex_alloc(strsz = strlen(fmt) + strlen(def) + strlen(val) + 2); + strsz = strlen(fmt) + strlen(def) + strlen(val) + 2; + str = malloc(strsz); if (!str) flexfatal (_("Allocation of buffer for m4 def failed")); @@ -192,7 +192,8 @@ struct Buf *buf_m4_undefine (struct Buf *buf, const char* def) char * str; size_t strsz; - str = (char*)flex_alloc(strsz = strlen(fmt) + strlen(def) + 2); + strsz = strlen(fmt) + strlen(def) + 2; + str = malloc(strsz); if (!str) flexfatal (_("Allocation of buffer for m4 undef failed")); @@ -202,23 +203,21 @@ struct Buf *buf_m4_undefine (struct Buf *buf, const char* def) } /* create buf with 0 elements, each of size elem_size. */ -void buf_init (buf, elem_size) - struct Buf *buf; - size_t elem_size; +void buf_init (struct Buf *buf, size_t elem_size) { - buf->elts = (void *) 0; + buf->elts = NULL; buf->nelts = 0; buf->elt_size = elem_size; buf->nmax = 0; } /* frees memory */ -void buf_destroy (buf) - struct Buf *buf; +void buf_destroy (struct Buf *buf) { - if (buf && buf->elts) - flex_free (buf->elts); - buf->elts = (void *) 0; + if (buf) { + free(buf->elts); + buf->elts = NULL; + } } @@ -228,10 +227,7 @@ void buf_destroy (buf) * We grow by mod(512) boundaries. */ -struct Buf *buf_append (buf, ptr, n_elem) - struct Buf *buf; - const void *ptr; - int n_elem; +struct Buf *buf_append (struct Buf *buf, const void *ptr, int n_elem) { int n_alloc = 0; @@ -241,30 +237,30 @@ struct Buf *buf_append (buf, ptr, n_elem) /* May need to alloc more. */ if (n_elem + buf->nelts > buf->nmax) { - /* exact amount needed... */ - n_alloc = (n_elem + buf->nelts) * buf->elt_size; + /* exact count needed... */ + n_alloc = n_elem + buf->nelts; /* ...plus some extra */ - if (((n_alloc * buf->elt_size) % 512) != 0 + if ((((size_t) n_alloc * buf->elt_size) % 512) != 0 && buf->elt_size < 512) - n_alloc += - (512 - - ((n_alloc * buf->elt_size) % 512)) / - buf->elt_size; + n_alloc += (int) + ((512 - + (((size_t) n_alloc * buf->elt_size) % 512)) / + buf->elt_size); if (!buf->elts) buf->elts = - allocate_array (n_alloc, buf->elt_size); + allocate_array ((int) n_alloc, buf->elt_size); else buf->elts = - reallocate_array (buf->elts, n_alloc, + reallocate_array (buf->elts, (int) n_alloc, buf->elt_size); buf->nmax = n_alloc; } - memcpy ((char *) buf->elts + buf->nelts * buf->elt_size, ptr, - n_elem * buf->elt_size); + memcpy ((char *) buf->elts + (size_t) buf->nelts * buf->elt_size, ptr, + (size_t) n_elem * buf->elt_size); buf->nelts += n_elem; return buf; @@ -52,9 +52,7 @@ ccl_contains (const int cclp, const int ch) /* ccladd - add a single character to a ccl */ -void ccladd (cclp, ch) - int cclp; - int ch; +void ccladd (int cclp, int ch) { int ind, len, newpos, i; @@ -85,20 +83,20 @@ void ccladd (cclp, ch) } ccllen[cclp] = len + 1; - ccltbl[newpos] = ch; + ccltbl[newpos] = (unsigned char) ch; } /* dump_cclp - same thing as list_character_set, but for cclps. */ static void dump_cclp (FILE* file, int cclp) { - register int i; + int i; putc ('[', file); for (i = 0; i < csize; ++i) { if (ccl_contains(cclp, i)){ - register int start_char = i; + int start_char = i; putc (' ', file); @@ -185,7 +183,7 @@ ccl_set_union (int a, int b) /* cclinit - return an empty ccl */ -int cclinit () +int cclinit (void) { if (++lastccl >= current_maxccls) { current_maxccls += MAX_CCLS_INCREMENT; @@ -225,8 +223,7 @@ int cclinit () /* cclnegate - negate the given ccl */ -void cclnegate (cclp) - int cclp; +void cclnegate (int cclp) { cclng[cclp] = 1; ccl_has_nl[cclp] = !ccl_has_nl[cclp]; @@ -240,17 +237,15 @@ void cclnegate (cclp) * has a non-zero value in the cset array. */ -void list_character_set (file, cset) - FILE *file; - int cset[]; +void list_character_set (FILE *file, int cset[]) { - register int i; + int i; putc ('[', file); for (i = 0; i < csize; ++i) { if (cset[i]) { - register int start_char = i; + int start_char = i; putc (' ', file); @@ -34,10 +34,10 @@ /* declare functions that have forward references */ -void dump_associated_rules PROTO ((FILE *, int)); -void dump_transitions PROTO ((FILE *, int[])); -void sympartition PROTO ((int[], int, int[], int[])); -int symfollowset PROTO ((int[], int, int, int[])); +void dump_associated_rules(FILE *, int); +void dump_transitions(FILE *, int[]); +void sympartition(int[], int, int[], int[]); +int symfollowset(int[], int, int, int[]); /* check_for_backing_up - check a DFA state for backing up @@ -49,9 +49,7 @@ int symfollowset PROTO ((int[], int, int, int[])); * indexed by equivalence class. */ -void check_for_backing_up (ds, state) - int ds; - int state[]; +void check_for_backing_up (int ds, int state[]) { if ((reject && !dfaacc[ds].dfaacc_set) || (!reject && !dfaacc[ds].dfaacc_state)) { /* state is non-accepting */ ++num_backing_up; @@ -96,17 +94,14 @@ void check_for_backing_up (ds, state) * accset[1 .. nacc] is the list of accepting numbers for the DFA state. */ -void check_trailing_context (nfa_states, num_states, accset, nacc) - int *nfa_states, num_states; - int *accset; - int nacc; +void check_trailing_context (int *nfa_states, int num_states, int *accset, int nacc) { - register int i, j; + int i, j; for (i = 1; i <= num_states; ++i) { int ns = nfa_states[i]; - register int type = state_type[ns]; - register int ar = assoc_rule[ns]; + int type = state_type[ns]; + int ar = assoc_rule[ns]; if (type == STATE_NORMAL || rule_type[ar] != RULE_VARIABLE) { /* do nothing */ } @@ -137,18 +132,16 @@ void check_trailing_context (nfa_states, num_states, accset, nacc) * and writes a report to the given file. */ -void dump_associated_rules (file, ds) - FILE *file; - int ds; +void dump_associated_rules (FILE *file, int ds) { - register int i, j; - register int num_associated_rules = 0; - int rule_set[MAX_ASSOC_RULES + 1]; - int *dset = dss[ds]; - int size = dfasiz[ds]; + int i, j; + int num_associated_rules = 0; + int rule_set[MAX_ASSOC_RULES + 1]; + int *dset = dss[ds]; + int size = dfasiz[ds]; for (i = 1; i <= size; ++i) { - register int rule_num = rule_linenum[assoc_rule[dset[i]]]; + int rule_num = rule_linenum[assoc_rule[dset[i]]]; for (j = 1; j <= num_associated_rules; ++j) if (rule_num == rule_set[j]) @@ -161,7 +154,7 @@ void dump_associated_rules (file, ds) } } - qsort (&rule_set [1], num_associated_rules, sizeof (rule_set [1]), intcmp); + qsort (&rule_set [1], (size_t) num_associated_rules, sizeof (rule_set [1]), intcmp); fprintf (file, _(" associated rule line numbers:")); @@ -187,12 +180,10 @@ void dump_associated_rules (file, ds) * is done to the given file. */ -void dump_transitions (file, state) - FILE *file; - int state[]; +void dump_transitions (FILE *file, int state[]) { - register int i, ec; - int out_char_set[CSIZE]; + int i, ec; + int out_char_set[CSIZE]; for (i = 0; i < csize; ++i) { ec = ABS (ecgroup[i]); @@ -235,10 +226,9 @@ void dump_transitions (file, state) * hashval is the hash value for the dfa corresponding to the state set. */ -int *epsclosure (t, ns_addr, accset, nacc_addr, hv_addr) - int *t, *ns_addr, accset[], *nacc_addr, *hv_addr; +int *epsclosure (int *t, int *ns_addr, int accset[], int *nacc_addr, int *hv_addr) { - register int stkpos, ns, tsp; + int stkpos, ns, tsp; int numstates = *ns_addr, nacc, hashval, transsym, nfaccnum; int stkend, nstate; static int did_stk_init = false, *stk; @@ -351,7 +341,7 @@ ADD_STATE(state); \ /* increase_max_dfas - increase the maximum number of DFAs */ -void increase_max_dfas () +void increase_max_dfas (void) { current_max_dfas += MAX_DFAS_INCREMENT; @@ -378,7 +368,7 @@ void increase_max_dfas () * dfa starts out in state #1. */ -void ntod () +void ntod (void) { int *accset, ds, nacc, newds; int sym, hashval, numstates, dsize; @@ -400,7 +390,7 @@ void ntod () * from 1 to CSIZE, so their size must be CSIZE + 1. */ int duplist[CSIZE + 1], state[CSIZE + 1]; - int targfreq[CSIZE + 1], targstate[CSIZE + 1]; + int targfreq[CSIZE + 1] = {0}, targstate[CSIZE + 1]; /* accset needs to be large enough to hold all of the rules present * in the input, *plus* their YY_TRAILING_HEAD_MASK variants. @@ -473,14 +463,9 @@ void ntod () /* 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) @@ -521,15 +506,13 @@ void ntod () * So we'll have to realloc() on the way... * we'll wait until we can calculate yynxt_tbl->td_hilen. */ - yynxt_tbl = - (struct yytbl_data *) calloc (1, - sizeof (struct - yytbl_data)); + yynxt_tbl = calloc(1, sizeof (struct yytbl_data)); + yytbl_data_init (yynxt_tbl, YYTD_ID_NXT); yynxt_tbl->td_hilen = 1; - yynxt_tbl->td_lolen = num_full_table_rows; + yynxt_tbl->td_lolen = (flex_uint32_t) num_full_table_rows; yynxt_tbl->td_data = yynxt_data = - (flex_int32_t *) calloc (yynxt_tbl->td_lolen * + calloc(yynxt_tbl->td_lolen * yynxt_tbl->td_hilen, sizeof (flex_int32_t)); yynxt_curr = 0; @@ -543,12 +526,12 @@ void ntod () */ if (gentables) out_str_dec - ("static yyconst %s yy_nxt[][%d] =\n {\n", + ("static const %s yy_nxt[][%d] =\n {\n", long_align ? "flex_int32_t" : "flex_int16_t", num_full_table_rows); else { out_dec ("#undef YY_NXT_LOLEN\n#define YY_NXT_LOLEN (%d)\n", num_full_table_rows); - out_str ("static yyconst %s *yy_nxt =0;\n", + out_str ("static const %s *yy_nxt =0;\n", long_align ? "flex_int32_t" : "flex_int16_t"); } @@ -713,7 +696,7 @@ void ntod () /* Each time we hit here, it's another td_hilen, so we realloc. */ yynxt_tbl->td_hilen++; yynxt_tbl->td_data = yynxt_data = - (flex_int32_t *) realloc (yynxt_data, + realloc (yynxt_data, yynxt_tbl->td_hilen * yynxt_tbl->td_lolen * sizeof (flex_int32_t)); @@ -805,8 +788,8 @@ void ntod () mkdeftbl (); } - flex_free ((void *) accset); - flex_free ((void *) nset); + free(accset); + free(nset); } @@ -820,12 +803,11 @@ void ntod () * On return, the dfa state number is in newds. */ -int snstods (sns, numstates, accset, nacc, hashval, newds_addr) - int sns[], numstates, accset[], nacc, hashval, *newds_addr; +int snstods (int sns[], int numstates, int accset[], int nacc, int hashval, int *newds_addr) { - int didsort = 0; - register int i, j; - int newds, *oldsns; + int didsort = 0; + int i, j; + int newds, *oldsns; for (i = 1; i <= lastdfa; ++i) if (hashval == dhash[i]) { @@ -836,7 +818,7 @@ int snstods (sns, numstates, accset, nacc, hashval, newds_addr) /* We sort the states in sns so we * can compare it to oldsns quickly. */ - qsort (&sns [1], numstates, sizeof (sns [1]), intcmp); + qsort (&sns [1], (size_t) numstates, sizeof (sns [1]), intcmp); didsort = 1; } @@ -871,7 +853,7 @@ int snstods (sns, numstates, accset, nacc, hashval, newds_addr) */ if (!didsort) - qsort (&sns [1], numstates, sizeof (sns [1]), intcmp); + qsort (&sns [1], (size_t) numstates, sizeof (sns [1]), intcmp); for (i = 1; i <= numstates; ++i) dss[newds][i] = sns[i]; @@ -881,7 +863,7 @@ int snstods (sns, numstates, accset, nacc, hashval, newds_addr) if (nacc == 0) { if (reject) - dfaacc[newds].dfaacc_set = (int *) 0; + dfaacc[newds].dfaacc_set = NULL; else dfaacc[newds].dfaacc_state = 0; @@ -894,7 +876,7 @@ int snstods (sns, numstates, accset, nacc, hashval, newds_addr) * match in the event of ties will work. */ - qsort (&accset [1], nacc, sizeof (accset [1]), intcmp); + qsort (&accset [1], (size_t) nacc, sizeof (accset [1]), intcmp); dfaacc[newds].dfaacc_set = allocate_integer_array (nacc + 1); @@ -942,8 +924,7 @@ int snstods (sns, numstates, accset, nacc, hashval, newds_addr) * int transsym, int nset[current_max_dfa_size] ); */ -int symfollowset (ds, dsize, transsym, nset) - int ds[], dsize, transsym, nset[]; +int symfollowset (int ds[], int dsize, int transsym, int nset[]) { int ns, tsp, sym, i, j, lenccl, ch, numstates, ccllist; @@ -1020,9 +1001,7 @@ int symfollowset (ds, dsize, transsym, nset) * int symlist[numecs], int duplist[numecs] ); */ -void sympartition (ds, numstates, symlist, duplist) - int ds[], numstates; - int symlist[], duplist[]; +void sympartition (int ds[], int numstates, int symlist[], int duplist[]) { int tch, i, j, k, ns, dupfwd[CSIZE + 1], lenccl, cclp, ich; @@ -36,7 +36,7 @@ /* ccl2ecl - convert character classes to set of equivalence classes */ -void ccl2ecl () +void ccl2ecl (void) { int i, ich, newlen, cclp, ccls, cclmec; @@ -56,7 +56,8 @@ void ccl2ecl () cclmec = ecgroup[ich]; if (cclmec > 0) { - ccltbl[cclp + newlen] = cclmec; + /* Note: range 1..256 is mapped to 1..255,0 */ + ccltbl[cclp + newlen] = (unsigned char) cclmec; ++newlen; } } @@ -74,8 +75,7 @@ void ccl2ecl () * Returned is the number of classes. */ -int cre8ecs (fwd, bck, num) - int fwd[], bck[], num; +int cre8ecs (int fwd[], int bck[], int num) { int i, j, numcl; @@ -100,9 +100,9 @@ int cre8ecs (fwd, bck, num) /* mkeccl - update equivalence classes based on character class xtions * * synopsis - * Char ccls[]; + * unsigned char ccls[]; * int lenccl, fwd[llsiz], bck[llsiz], llsiz, NUL_mapping; - * void mkeccl( Char ccls[], int lenccl, int fwd[llsiz], int bck[llsiz], + * void mkeccl( unsigned char ccls[], int lenccl, int fwd[llsiz], int bck[llsiz], * int llsiz, int NUL_mapping ); * * ccls contains the elements of the character class, lenccl is the @@ -112,9 +112,7 @@ int cre8ecs (fwd, bck, num) * NUL_mapping is the value which NUL (0) should be mapped to. */ -void mkeccl (ccls, lenccl, fwd, bck, llsiz, NUL_mapping) - Char ccls[]; - int lenccl, fwd[], bck[], llsiz, NUL_mapping; +void mkeccl (unsigned char ccls[], int lenccl, int fwd[], int bck[], int llsiz, int NUL_mapping) { int cclp, oldec, newec; int cclm, i, j; @@ -139,7 +137,7 @@ void mkeccl (ccls, lenccl, fwd, bck, llsiz, NUL_mapping) for (i = fwd[cclm]; i != NIL && i <= llsiz; i = fwd[i]) { /* look for the symbol in the character class */ for (; j < lenccl; ++j) { - register int ccl_char; + int ccl_char; if (NUL_mapping && ccls[j] == 0) ccl_char = NUL_mapping; @@ -191,7 +189,7 @@ void mkeccl (ccls, lenccl, fwd, bck, llsiz, NUL_mapping) /* Find next ccl member to process. */ - for (++cclp; cclflags[cclp] && cclp < lenccl; ++cclp) { + for (++cclp; cclp < lenccl && cclflags[cclp]; ++cclp) { /* Reset "doesn't need processing" flag. */ cclflags[cclp] = 0; } @@ -201,8 +199,7 @@ void mkeccl (ccls, lenccl, fwd, bck, llsiz, NUL_mapping) /* mkechar - create equivalence class for single character */ -void mkechar (tch, fwd, bck) - int tch, fwd[], bck[]; +void mkechar (int tch, int fwd[], int bck[]) { /* If until now the character has been a proper subset of * an equivalence class, break it away to create a new ec @@ -47,9 +47,9 @@ struct filter *filter_create_ext (struct filter *chain, const char *cmd, va_list ap; /* allocate and initialize new filter */ - f = (struct filter *) flex_alloc (sizeof (struct filter)); + f = malloc(sizeof(struct filter)); if (!f) - flexerror (_("flex_alloc failed (f) in filter_create_ext")); + flexerror(_("malloc failed (f) in filter_create_ext")); memset (f, 0, sizeof (*f)); f->filter_func = NULL; f->extra = NULL; @@ -66,23 +66,16 @@ struct filter *filter_create_ext (struct filter *chain, const char *cmd, /* allocate argv, and populate it with the argument list. */ max_args = 8; - f->argv = - (const char **) flex_alloc (sizeof (char *) * - (max_args + 1)); + f->argv = malloc(sizeof(char *) * (size_t) (max_args + 1)); if (!f->argv) - flexerror (_("flex_alloc failed (f->argv) in filter_create_ext")); + flexerror(_("malloc failed (f->argv) in filter_create_ext")); f->argv[f->argc++] = cmd; va_start (ap, cmd); while ((s = va_arg (ap, const char *)) != NULL) { if (f->argc >= max_args) { max_args += 8; - f->argv = - (const char **) flex_realloc (f->argv, - sizeof (char - *) * - (max_args + - 1)); + f->argv = realloc(f->argv, sizeof(char*) * (size_t) (max_args + 1)); } f->argv[f->argc++] = s; } @@ -107,9 +100,9 @@ struct filter *filter_create_int (struct filter *chain, struct filter *f; /* allocate and initialize new filter */ - f = (struct filter *) flex_alloc (sizeof (struct filter)); + f = malloc(sizeof(struct filter)); if (!f) - flexerror (_("flex_alloc failed in filter_create_int")); + flexerror(_("malloc failed in filter_create_int")); memset (f, 0, sizeof (*f)); f->next = NULL; f->argc = 0; @@ -135,9 +128,6 @@ struct filter *filter_create_int (struct filter *chain, bool filter_apply_chain (struct filter * chain) { int pid, pipes[2]; - int r; - const int readsz = 512; - char *buf; /* Tricky recursion, since we want to begin the chain @@ -177,6 +167,8 @@ clearerr(stdin); flexfatal (_("dup2(pipes[0],0)")); close (pipes[0]); fseek (stdin, 0, SEEK_CUR); + ungetc(' ', stdin); /* still an evil hack, but one that works better */ + (void)fgetc(stdin); /* on NetBSD than the fseek attempt does */ /* run as a filter, either internally or by exec */ if (chain->filter_func) { @@ -184,16 +176,16 @@ clearerr(stdin); if ((r = chain->filter_func (chain)) == -1) flexfatal (_("filter_func failed")); - exit (0); + FLEX_EXIT (0); } else { execvp (chain->argv[0], (char **const) (chain->argv)); - lerrsf_fatal ( _("exec of %s failed"), + lerr_fatal ( _("exec of %s failed"), chain->argv[0]); } - exit (1); + FLEX_EXIT (1); } /* Parent */ @@ -291,9 +283,9 @@ int filter_tee_header (struct filter *chain) fprintf (to_c, "m4_define( [[M4_YY_OUTFILE_NAME]],[[%s]])m4_dnl\n", outfilename ? outfilename : "<stdout>"); - buf = (char *) flex_alloc (readsz); + buf = malloc((size_t) readsz); if (!buf) - flexerror (_("flex_alloc failed in filter_tee_header")); + flexerror(_("malloc failed in filter_tee_header")); while (fgets (buf, readsz, stdin)) { fputs (buf, to_c); if (write_header) @@ -304,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); @@ -312,26 +305,26 @@ int filter_tee_header (struct filter *chain) fflush (to_h); if (ferror (to_h)) - lerrsf (_("error writing output file %s"), + lerr (_("error writing output file %s"), (char *) chain->extra); else if (fclose (to_h)) - lerrsf (_("error closing output file %s"), + lerr (_("error closing output file %s"), (char *) chain->extra); } fflush (to_c); if (ferror (to_c)) - lerrsf (_("error writing output file %s"), + lerr (_("error writing output file %s"), outfilename ? outfilename : "<stdout>"); else if (fclose (to_c)) - lerrsf (_("error closing output file %s"), + lerr (_("error closing output file %s"), outfilename ? outfilename : "<stdout>"); while (wait (0) > 0) ; - exit (0); + FLEX_EXIT (0); return 0; } @@ -344,7 +337,7 @@ int filter_tee_header (struct filter *chain) int filter_fix_linedirs (struct filter *chain) { char *buf; - const int readsz = 512; + const size_t readsz = 512; int lineno = 1; bool in_gen = true; /* in generated code */ bool last_was_blank = false; @@ -352,11 +345,11 @@ int filter_fix_linedirs (struct filter *chain) if (!chain) return 0; - buf = (char *) flex_alloc (readsz); + buf = malloc(readsz); if (!buf) - flexerror (_("flex_alloc failed in filter_fix_linedirs")); + flexerror(_("malloc failed in filter_fix_linedirs")); - while (fgets (buf, readsz, stdin)) { + while (fgets (buf, (int) readsz, stdin)) { regmatch_t m[10]; @@ -364,11 +357,9 @@ int filter_fix_linedirs (struct filter *chain) if (buf[0] == '#' && regexec (®ex_linedir, buf, 3, m, 0) == 0) { - int num; char *fname; /* extract the line number and filename */ - num = regmatch_strtol (&m[1], buf, NULL, 0); fname = regmatch_dup (&m[2], buf); if (strcmp (fname, @@ -400,7 +391,7 @@ int filter_fix_linedirs (struct filter *chain) /* Adjust the line directives. */ in_gen = true; snprintf (buf, readsz, "#line %d \"%s\"\n", - lineno + 1, filename); + lineno, filename); } else { /* it's a #line directive for code we didn't write */ @@ -431,11 +422,11 @@ int filter_fix_linedirs (struct filter *chain) } fflush (stdout); if (ferror (stdout)) - lerrsf (_("error writing output file %s"), + lerr (_("error writing output file %s"), outfilename ? outfilename : "<stdout>"); else if (fclose (stdout)) - lerrsf (_("error closing output file %s"), + lerr (_("error closing output file %s"), outfilename ? outfilename : "<stdout>"); return 0; @@ -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> @@ -223,58 +244,25 @@ m4preproc_include(`flexint.h') /* end standard C++ headers. */ %endif -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST +/* TODO: this is always defined, so inline it */ #define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) #else -#define yyconst +#define yynoreturn #endif -%# For compilers that can not handle prototypes. -%# e.g., -%# The function prototype -%# int foo(int x, char* y); -%# -%# ...should be written as -%# int foo M4_YY_PARAMS(int x, char* y); -%# -%# ...which could possibly generate -%# int foo (); -%# -m4_ifdef( [[M4_YY_NO_ANSI_FUNC_PROTOS]], -[[ - m4_define( [[M4_YY_PARAMS]], [[()]]) -]], -[[ - m4_define( [[M4_YY_PARAMS]], [[($*)]]) -]]) - %not-for-header /* Returned upon end-of-file. */ #define YY_NULL 0 %ok-for-header %not-for-header -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) %ok-for-header @@ -298,16 +286,8 @@ m4_define( [[YY_G]], [[yyg->$1]]) m4_define( [[M4_YY_PROTO_LAST_ARG]], [[, yyscan_t yyscanner]]) m4_define( [[M4_YY_PROTO_ONLY_ARG]], [[yyscan_t yyscanner]]) -%# For use in function definitions to append the additional argument. -m4_ifdef( [[M4_YY_NO_ANSI_FUNC_DEFS]], -[[ - m4_define( [[M4_YY_DEF_LAST_ARG]], [[, yyscanner]]) - m4_define( [[M4_YY_DEF_ONLY_ARG]], [[yyscanner]]) -]], -[[ - m4_define( [[M4_YY_DEF_LAST_ARG]], [[, yyscan_t yyscanner]]) - m4_define( [[M4_YY_DEF_ONLY_ARG]], [[yyscan_t yyscanner]]) -]]) +m4_define( [[M4_YY_DEF_LAST_ARG]], [[, yyscan_t yyscanner]]) +m4_define( [[M4_YY_DEF_ONLY_ARG]], [[yyscan_t yyscanner]]) m4_define( [[M4_YY_DECL_LAST_ARG]], [[yyscan_t yyscanner;]]) %# For use in function calls to pass the additional argument. @@ -329,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) @@ -342,7 +322,7 @@ m4_define( [[M4_YY_INCR_LINENO]], %if-not-reentrant m4_define( [[M4_YY_INCR_LINENO]], -[[ +[[ yylineno++; ]]) @@ -354,60 +334,19 @@ m4_define( [[M4_YY_PROTO_LAST_ARG]]) m4_define( [[M4_YY_PROTO_ONLY_ARG]], [[void]]) m4_define( [[M4_YY_DEF_LAST_ARG]]) -m4_ifdef( [[M4_YY_NO_ANSI_FUNC_DEFS]], -[[ - m4_define( [[M4_YY_DEF_ONLY_ARG]]) -]], -[[ - m4_define( [[M4_YY_DEF_ONLY_ARG]], [[void]]) -]]) +m4_define( [[M4_YY_DEF_ONLY_ARG]], [[void]]) m4_define([[M4_YY_DECL_LAST_ARG]]) m4_define([[M4_YY_CALL_LAST_ARG]]) m4_define([[M4_YY_CALL_ONLY_ARG]]) -m4_define( [[M4_YY_DOC_PARAM]], [[]]) +m4_define( [[M4_YY_DOC_PARAM]], ) %endif -m4_ifdef( [[M4_YY_NO_ANSI_FUNC_DEFS]], -[[ -%# For compilers that need traditional function definitions. -%# e.g., -%# The function prototype taking 2 arguments -%# int foo (int x, char* y) -%# -%# ...should be written as -%# int foo YYFARGS2(int,x, char*,y) -%# -%# ...which could possibly generate -%# int foo (x,y,yyscanner) -%# int x; -%# char * y; -%# yyscan_t yyscanner; -%# -%# Generate traditional function defs - m4_define( [[YYFARGS0]], [[(M4_YY_DEF_ONLY_ARG) [[\]] - M4_YY_DECL_LAST_ARG]]) - m4_define( [[YYFARGS1]], [[($2 M4_YY_DEF_LAST_ARG) [[\]] - $1 $2; [[\]] - M4_YY_DECL_LAST_ARG]]) - m4_define( [[YYFARGS2]], [[($2,$4 M4_YY_DEF_LAST_ARG) [[\]] - $1 $2; [[\]] - $3 $4; [[\]] - M4_YY_DECL_LAST_ARG]]) - m4_define( [[YYFARGS3]], [[($2,$4,$6 M4_YY_DEF_LAST_ARG) [[\]] - $1 $2; [[\]] - $3 $4; [[\]] - $5 $6; [[\]] - M4_YY_DECL_LAST_ARG]]) -]], -[[ %# Generate C99 function defs. - m4_define( [[YYFARGS0]], [[(M4_YY_DEF_ONLY_ARG)]]) - m4_define( [[YYFARGS1]], [[($1 $2 M4_YY_DEF_LAST_ARG)]]) - m4_define( [[YYFARGS2]], [[($1 $2, $3 $4 M4_YY_DEF_LAST_ARG)]]) - m4_define( [[YYFARGS3]], [[($1 $2, $3 $4, $5 $6 M4_YY_DEF_LAST_ARG)]]) -]]) +m4_define( [[YYFARGS1]], [[($1 $2 M4_YY_DEF_LAST_ARG)]]) +m4_define( [[YYFARGS2]], [[($1 $2, $3 $4 M4_YY_DEF_LAST_ARG)]]) +m4_define( [[YYFARGS3]], [[($1 $2, $3 $4, $5 $6 M4_YY_DEF_LAST_ARG)]]) m4_ifdef( [[M4_YY_NOT_IN_HEADER]], [[ @@ -416,38 +355,30 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]], * definition of BEGIN. */ #define BEGIN YY_G(yy_start) = 1 + 2 * -]]) - -m4_ifdef( [[M4_YY_NOT_IN_HEADER]], -[[ /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START ((YY_G(yy_start) - 1) / 2) #define YYSTATE YY_START -]]) - -m4_ifdef( [[M4_YY_NOT_IN_HEADER]], -[[ /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) -]]) - -m4_ifdef( [[M4_YY_NOT_IN_HEADER]], -[[ /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE yyrestart( yyin M4_YY_CALL_LAST_ARG ) -]]) - -m4_ifdef( [[M4_YY_NOT_IN_HEADER]], -[[ #define YY_END_OF_BUFFER_CHAR 0 ]]) /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif m4_ifdef( [[M4_YY_NOT_IN_HEADER]], @@ -469,7 +400,7 @@ typedef size_t yy_size_t; #endif %if-not-reentrant -extern yy_size_t yyleng; +extern int yyleng; %endif %if-c-only @@ -483,15 +414,11 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]], #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 -]]) - -m4_ifdef( [[M4_YY_NOT_IN_HEADER]], -[[ m4_ifdef( [[M4_YY_USE_LINENO]], [[ /* 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. @@ -515,10 +442,6 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]], #define YY_LESS_LINENO(n) #define YY_LINENO_REWIND_TO(ptr) ]]) -]]) - -m4_ifdef( [[M4_YY_NOT_IN_HEADER]], -[[ /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ @@ -532,10 +455,6 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]], YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) -]]) - -m4_ifdef( [[M4_YY_NOT_IN_HEADER]], -[[ #define unput(c) yyunput( c, YY_G(yytext_ptr) M4_YY_CALL_LAST_ARG ) ]]) @@ -548,7 +467,7 @@ struct yy_buffer_state %endif %if-c++-only - std::istream* yy_input_file; + std::streambuf* yy_input_file; %endif @@ -558,12 +477,12 @@ struct yy_buffer_state /* Size of input buffer in bytes, not including room for EOB * characters. */ - yy_size_t yy_buf_size; + int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - yy_size_t yy_n_chars; + int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -586,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. @@ -620,7 +539,7 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]], /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ +static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ %endif %ok-for-header %endif @@ -636,10 +555,6 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]], #define YY_CURRENT_BUFFER ( YY_G(yy_buffer_stack) \ ? YY_G(yy_buffer_stack)[YY_G(yy_buffer_stack_top)] \ : NULL) -]]) - -m4_ifdef( [[M4_YY_NOT_IN_HEADER]], -[[ /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ @@ -652,11 +567,11 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]], %not-for-header /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; -static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ -yy_size_t yyleng; +static int yy_n_chars; /* number of characters read into yy_ch_buf */ +int yyleng; /* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; +static char *yy_c_buf_p = NULL; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ @@ -667,43 +582,35 @@ static int yy_did_buffer_switch_on_eof; %ok-for-header %endif -void yyrestart M4_YY_PARAMS( FILE *input_file M4_YY_PROTO_LAST_ARG ); -void yy_switch_to_buffer M4_YY_PARAMS( YY_BUFFER_STATE new_buffer M4_YY_PROTO_LAST_ARG ); -YY_BUFFER_STATE yy_create_buffer M4_YY_PARAMS( FILE *file, int size M4_YY_PROTO_LAST_ARG ); -void yy_delete_buffer M4_YY_PARAMS( YY_BUFFER_STATE b M4_YY_PROTO_LAST_ARG ); -void yy_flush_buffer M4_YY_PARAMS( YY_BUFFER_STATE b M4_YY_PROTO_LAST_ARG ); -void yypush_buffer_state M4_YY_PARAMS( YY_BUFFER_STATE new_buffer M4_YY_PROTO_LAST_ARG ); -void yypop_buffer_state M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG ); - -m4_ifdef( [[M4_YY_NOT_IN_HEADER]], -[[ -static void yyensure_buffer_stack M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG ); -static void yy_load_buffer_state M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG ); -static void yy_init_buffer M4_YY_PARAMS( YY_BUFFER_STATE b, FILE *file M4_YY_PROTO_LAST_ARG ); -]]) +void yyrestart ( FILE *input_file M4_YY_PROTO_LAST_ARG ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer M4_YY_PROTO_LAST_ARG ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size M4_YY_PROTO_LAST_ARG ); +void yy_delete_buffer ( YY_BUFFER_STATE b M4_YY_PROTO_LAST_ARG ); +void yy_flush_buffer ( YY_BUFFER_STATE b M4_YY_PROTO_LAST_ARG ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer M4_YY_PROTO_LAST_ARG ); +void yypop_buffer_state ( M4_YY_PROTO_ONLY_ARG ); m4_ifdef( [[M4_YY_NOT_IN_HEADER]], [[ +static void yyensure_buffer_stack ( M4_YY_PROTO_ONLY_ARG ); +static void yy_load_buffer_state ( M4_YY_PROTO_ONLY_ARG ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file M4_YY_PROTO_LAST_ARG ); #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER M4_YY_CALL_LAST_ARG) ]]) -YY_BUFFER_STATE yy_scan_buffer M4_YY_PARAMS( char *base, yy_size_t size M4_YY_PROTO_LAST_ARG ); -YY_BUFFER_STATE yy_scan_string M4_YY_PARAMS( yyconst char *yy_str M4_YY_PROTO_LAST_ARG ); -YY_BUFFER_STATE yy_scan_bytes M4_YY_PARAMS( yyconst char *bytes, yy_size_t len M4_YY_PROTO_LAST_ARG ); +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size M4_YY_PROTO_LAST_ARG ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str M4_YY_PROTO_LAST_ARG ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len M4_YY_PROTO_LAST_ARG ); %endif -void *yyalloc M4_YY_PARAMS( yy_size_t M4_YY_PROTO_LAST_ARG ); -void *yyrealloc M4_YY_PARAMS( void *, yy_size_t M4_YY_PROTO_LAST_ARG ); -void yyfree M4_YY_PARAMS( void * M4_YY_PROTO_LAST_ARG ); +void *yyalloc ( yy_size_t M4_YY_PROTO_LAST_ARG ); +void *yyrealloc ( void *, yy_size_t M4_YY_PROTO_LAST_ARG ); +void yyfree ( void * M4_YY_PROTO_LAST_ARG ); m4_ifdef( [[M4_YY_NOT_IN_HEADER]], [[ #define yy_new_buffer yy_create_buffer -]]) - -m4_ifdef( [[M4_YY_NOT_IN_HEADER]], -[[ #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ @@ -713,10 +620,6 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]], } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } -]]) - -m4_ifdef( [[M4_YY_NOT_IN_HEADER]], -[[ #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ @@ -726,10 +629,6 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]], } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } -]]) - -m4_ifdef( [[M4_YY_NOT_IN_HEADER]], -[[ #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) ]]) @@ -744,10 +643,10 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]], m4_ifdef( [[M4_YY_NOT_IN_HEADER]], [[ -static yy_state_type yy_get_previous_state M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG ); -static yy_state_type yy_try_NUL_trans M4_YY_PARAMS( yy_state_type current_state M4_YY_PROTO_LAST_ARG); -static int yy_get_next_buffer M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG ); -static void yy_fatal_error M4_YY_PARAMS( yyconst char msg[] M4_YY_PROTO_LAST_ARG ); +static yy_state_type yy_get_previous_state ( M4_YY_PROTO_ONLY_ARG ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state M4_YY_PROTO_LAST_ARG); +static int yy_get_next_buffer ( M4_YY_PROTO_ONLY_ARG ); +static void yynoreturn yy_fatal_error ( const char* msg M4_YY_PROTO_LAST_ARG ); ]]) %endif @@ -764,10 +663,6 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]], *yy_cp = '\0'; \ %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ YY_G(yy_c_buf_p) = yy_cp; -]]) - -m4_ifdef( [[M4_YY_NOT_IN_HEADER]], -[[ %% [4.0] data tables for the DFA and the user's section 1 definitions go here ]]) @@ -820,8 +715,8 @@ struct yyguts_t size_t yy_buffer_stack_max; /**< capacity of stack. */ YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ char yy_hold_char; - yy_size_t yy_n_chars; - yy_size_t yyleng_r; + int yy_n_chars; + int yyleng_r; char *yy_c_buf_p; int yy_init; int yy_start; @@ -879,7 +774,7 @@ m4_ifdef( [[<M4_YY_BISON_LLOC>]], %if-c-only m4_ifdef( [[M4_YY_NOT_IN_HEADER]], [[ -static int yy_init_globals M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG ); +static int yy_init_globals ( M4_YY_PROTO_ONLY_ARG ); ]]) %endif @@ -900,9 +795,9 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]], ]]) ]]) -int yylex_init M4_YY_PARAMS(yyscan_t* scanner); +int yylex_init (yyscan_t* scanner); -int yylex_init_extra M4_YY_PARAMS( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); %endif @@ -913,74 +808,74 @@ int yylex_init_extra M4_YY_PARAMS( YY_EXTRA_TYPE user_defined, yyscan_t* scanner m4_ifdef( [[M4_YY_NO_DESTROY]],, [[ -int yylex_destroy M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG ); +int yylex_destroy ( M4_YY_PROTO_ONLY_ARG ); ]]) m4_ifdef( [[M4_YY_NO_GET_DEBUG]],, [[ -int yyget_debug M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG ); +int yyget_debug ( M4_YY_PROTO_ONLY_ARG ); ]]) m4_ifdef( [[M4_YY_NO_SET_DEBUG]],, [[ -void yyset_debug M4_YY_PARAMS( int debug_flag M4_YY_PROTO_LAST_ARG ); +void yyset_debug ( int debug_flag M4_YY_PROTO_LAST_ARG ); ]]) m4_ifdef( [[M4_YY_NO_GET_EXTRA]],, [[ -YY_EXTRA_TYPE yyget_extra M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG ); +YY_EXTRA_TYPE yyget_extra ( M4_YY_PROTO_ONLY_ARG ); ]]) m4_ifdef( [[M4_YY_NO_SET_EXTRA]],, [[ -void yyset_extra M4_YY_PARAMS( YY_EXTRA_TYPE user_defined M4_YY_PROTO_LAST_ARG ); +void yyset_extra ( YY_EXTRA_TYPE user_defined M4_YY_PROTO_LAST_ARG ); ]]) m4_ifdef( [[M4_YY_NO_GET_IN]],, [[ -FILE *yyget_in M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG ); +FILE *yyget_in ( M4_YY_PROTO_ONLY_ARG ); ]]) m4_ifdef( [[M4_YY_NO_SET_IN]],, [[ -void yyset_in M4_YY_PARAMS( FILE * in_str M4_YY_PROTO_LAST_ARG ); +void yyset_in ( FILE * _in_str M4_YY_PROTO_LAST_ARG ); ]]) m4_ifdef( [[M4_YY_NO_GET_OUT]],, [[ -FILE *yyget_out M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG ); +FILE *yyget_out ( M4_YY_PROTO_ONLY_ARG ); ]]) m4_ifdef( [[M4_YY_NO_SET_OUT]],, [[ -void yyset_out M4_YY_PARAMS( FILE * out_str M4_YY_PROTO_LAST_ARG ); +void yyset_out ( FILE * _out_str M4_YY_PROTO_LAST_ARG ); ]]) m4_ifdef( [[M4_YY_NO_GET_LENG]],, [[ -yy_size_t yyget_leng M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG ); + int yyget_leng ( M4_YY_PROTO_ONLY_ARG ); ]]) m4_ifdef( [[M4_YY_NO_GET_TEXT]],, [[ -char *yyget_text M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG ); +char *yyget_text ( M4_YY_PROTO_ONLY_ARG ); ]]) m4_ifdef( [[M4_YY_NO_GET_LINENO]],, [[ -int yyget_lineno M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG ); +int yyget_lineno ( M4_YY_PROTO_ONLY_ARG ); ]]) m4_ifdef( [[M4_YY_NO_SET_LINENO]],, [[ -void yyset_lineno M4_YY_PARAMS( int line_number M4_YY_PROTO_LAST_ARG ); +void yyset_lineno ( int _line_number M4_YY_PROTO_LAST_ARG ); ]]) m4_ifdef( [[M4_YY_REENTRANT]], [[ m4_ifdef( [[M4_YY_NO_GET_COLUMN]],, [[ -int yyget_column M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG ); +int yyget_column ( M4_YY_PROTO_ONLY_ARG ); ]]) ]]) @@ -988,28 +883,28 @@ m4_ifdef( [[M4_YY_REENTRANT]], [[ m4_ifdef( [[M4_YY_NO_SET_COLUMN]],, [[ -void yyset_column M4_YY_PARAMS( int column_no M4_YY_PROTO_LAST_ARG ); +void yyset_column ( int _column_no M4_YY_PROTO_LAST_ARG ); ]]) ]]) %if-bison-bridge m4_ifdef( [[M4_YY_NO_GET_LVAL]],, [[ -YYSTYPE * yyget_lval M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG ); +YYSTYPE * yyget_lval ( M4_YY_PROTO_ONLY_ARG ); ]]) -void yyset_lval M4_YY_PARAMS( YYSTYPE * yylval_param M4_YY_PROTO_LAST_ARG ); +void yyset_lval ( YYSTYPE * yylval_param M4_YY_PROTO_LAST_ARG ); m4_ifdef( [[<M4_YY_BISON_LLOC>]], [[ m4_ifdef( [[M4_YY_NO_GET_LLOC]],, [[ - YYLTYPE *yyget_lloc M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG ); + YYLTYPE *yyget_lloc ( M4_YY_PROTO_ONLY_ARG ); ]]) m4_ifdef( [[M4_YY_NO_SET_LLOC]],, [[ - void yyset_lloc M4_YY_PARAMS( YYLTYPE * yylloc_param M4_YY_PROTO_LAST_ARG ); + void yyset_lloc ( YYLTYPE * yylloc_param M4_YY_PROTO_LAST_ARG ); ]]) ]]) %endif @@ -1020,35 +915,37 @@ m4_ifdef( [[<M4_YY_BISON_LLOC>]], #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int yywrap M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG ); +extern "C" int yywrap ( M4_YY_PROTO_ONLY_ARG ); #else -extern int yywrap M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG ); +extern int yywrap ( M4_YY_PROTO_ONLY_ARG ); #endif #endif %not-for-header +#ifndef YY_NO_UNPUT m4_ifdef( [[M4_YY_NO_UNPUT]],, [[ - static void yyunput M4_YY_PARAMS( int c, char *buf_ptr M4_YY_PROTO_LAST_ARG); + static void yyunput ( int c, char *buf_ptr M4_YY_PROTO_LAST_ARG); ]]) +#endif %ok-for-header %endif #ifndef yytext_ptr -static void yy_flex_strncpy M4_YY_PARAMS( char *, yyconst char *, int M4_YY_PROTO_LAST_ARG); +static void yy_flex_strncpy ( char *, const char *, int M4_YY_PROTO_LAST_ARG); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen M4_YY_PARAMS( yyconst char * M4_YY_PROTO_LAST_ARG); +static int yy_flex_strlen ( const char * M4_YY_PROTO_LAST_ARG); #endif #ifndef YY_NO_INPUT %if-c-only Standard (non-C++) definition %not-for-header #ifdef __cplusplus -static int yyinput M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG ); +static int yyinput ( M4_YY_PROTO_ONLY_ARG ); #else -static int input M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG ); +static int input ( M4_YY_PROTO_ONLY_ARG ); #endif %ok-for-header %endif @@ -1074,15 +971,15 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]], [[ m4_ifdef( [[M4_YY_NO_PUSH_STATE]],, [[ - static void yy_push_state M4_YY_PARAMS( int new_state M4_YY_PROTO_LAST_ARG); + static void yy_push_state ( int _new_state M4_YY_PROTO_LAST_ARG); ]]) m4_ifdef( [[M4_YY_NO_POP_STATE]],, [[ - static void yy_pop_state M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG ); + static void yy_pop_state ( M4_YY_PROTO_ONLY_ARG ); ]]) m4_ifdef( [[M4_YY_NO_TOP_STATE]],, [[ - static int yy_top_state M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG ); + static int yy_top_state ( M4_YY_PROTO_ONLY_ARG ); ]]) ]]) @@ -1096,7 +993,12 @@ m4_define( [[M4_YY_NO_TOP_STATE]]) /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif m4_ifdef( [[M4_YY_NOT_IN_HEADER]], @@ -1107,7 +1009,7 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]], /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) %endif %if-c++-only C++ definition #define ECHO LexerOutput( yytext, yyleng ) @@ -1125,7 +1027,7 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]], %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ \ %if-c++-only C++ definition \ - if ( (result = LexerInput( (char *) buf, max_size )) < 0 ) \ + if ( (int)(result = LexerInput( (char *) buf, max_size )) < 0 ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); %endif @@ -1165,15 +1067,15 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]], m4preproc_include(`tables_shared.h') /* Load the DFA tables from the given stream. */ -int yytables_fload M4_YY_PARAMS(FILE * fp M4_YY_PROTO_LAST_ARG); +int yytables_fload (FILE * fp M4_YY_PROTO_LAST_ARG); /* Unload the tables from memory. */ -int yytables_destroy M4_YY_PARAMS(M4_YY_PROTO_ONLY_ARG); +int yytables_destroy (M4_YY_PROTO_ONLY_ARG); %not-for-header /** 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 */ @@ -1207,8 +1109,8 @@ struct yytbl_reader { %if-c-only Standard (non-C++) definition -m4_define( [[M4_YY_LEX_PROTO]], [[M4_YY_PARAMS(M4_YY_PROTO_ONLY_ARG)]]) -m4_define( [[M4_YY_LEX_DECLARATION]], [[YYFARGS0(void)]]) +m4_define( [[M4_YY_LEX_PROTO]], [[(M4_YY_PROTO_ONLY_ARG)]]) +m4_define( [[M4_YY_LEX_DECLARATION]], [[(M4_YY_DEF_ONLY_ARG)]]) m4_ifdef( [[M4_YY_BISON_LVAL]], [[ @@ -1216,7 +1118,7 @@ m4_ifdef( [[M4_YY_BISON_LVAL]], m4_dnl accept the lval parameter. m4_define( [[M4_YY_LEX_PROTO]], [[\]] - [[M4_YY_PARAMS(YYSTYPE * yylval_param M4_YY_PROTO_LAST_ARG)]]) + [[(YYSTYPE * yylval_param M4_YY_PROTO_LAST_ARG)]]) m4_define( [[M4_YY_LEX_DECLARATION]], [[\]] [[YYFARGS1(YYSTYPE *,yylval_param)]]) ]]) @@ -1226,7 +1128,7 @@ m4_ifdef( [[<M4_YY_BISON_LLOC>]], m4_dnl Locations are used. yylex should also accept the ylloc parameter. m4_define( [[M4_YY_LEX_PROTO]], [[\]] - [[M4_YY_PARAMS(YYSTYPE * yylval_param, YYLTYPE * yylloc_param M4_YY_PROTO_LAST_ARG)]]) + [[(YYSTYPE * yylval_param, YYLTYPE * yylloc_param M4_YY_PROTO_LAST_ARG)]]) m4_define( [[M4_YY_LEX_DECLARATION]], [[\]] [[YYFARGS2(YYSTYPE *,yylval_param, YYLTYPE *,yylloc_param)]]) ]]) @@ -1254,7 +1156,7 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]], [[ /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK break; +#define YY_BREAK /*LINTED*/break; #endif ]]) @@ -1268,9 +1170,9 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]], */ YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; M4_YY_DECL_GUTS_VAR(); m4_ifdef( [[M4_YY_NOT_REENTRANT]], @@ -1320,7 +1222,7 @@ m4_ifdef( [[M4_YY_USES_REJECT]], yyin = stdin; %endif %if-c++-only - yyin = & std::cin; + yyin.rdbuf(std::cin.rdbuf()); %endif if ( ! yyout ) @@ -1328,7 +1230,7 @@ m4_ifdef( [[M4_YY_USES_REJECT]], yyout = stdout; %endif %if-c++-only - yyout = & std::cout; + yyout.rdbuf(std::cout.rdbuf()); %endif if ( ! YY_CURRENT_BUFFER ) { @@ -1343,7 +1245,7 @@ m4_ifdef( [[M4_YY_USES_REJECT]], { %% [7.0] user's declarations go here - while ( 1 ) /* loops until end-of-file is reached */ + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { %% [8.0] yymore()-related code goes here yy_cp = YY_G(yy_c_buf_p); @@ -1394,7 +1296,12 @@ do_action: /* This label is used only to access EOF actions. */ * back-up) that will match for the new input source. */ YY_G(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; +%if-c-only YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; +%endif +%if-c++-only + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin.rdbuf(); +%endif YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } @@ -1507,11 +1414,29 @@ do_action: /* This label is used only to access EOF actions. */ %if-c++-only %not-for-header /* The contents of this function are C++ specific, so the YY_G macro is not used. + * This constructor simply maintains backward compatibility. + * DEPRECATED + */ +yyFlexLexer::yyFlexLexer( std::istream* arg_yyin, std::ostream* arg_yyout ): + yyin(arg_yyin ? arg_yyin->rdbuf() : std::cin.rdbuf()), + yyout(arg_yyout ? arg_yyout->rdbuf() : std::cout.rdbuf()) +{ + ctor_common(); +} + +/* The contents of this function are C++ specific, so the YY_G macro is not used. + */ +yyFlexLexer::yyFlexLexer( std::istream& arg_yyin, std::ostream& arg_yyout ): + yyin(arg_yyin.rdbuf()), + yyout(arg_yyout.rdbuf()) +{ + ctor_common(); +} + +/* The contents of this function are C++ specific, so the YY_G macro is not used. */ -yyFlexLexer::yyFlexLexer( std::istream* arg_yyin, std::ostream* arg_yyout ) +void yyFlexLexer::ctor_common() { - yyin = arg_yyin; - yyout = arg_yyout; yy_c_buf_p = 0; yy_init = 0; yy_start = 0; @@ -1528,7 +1453,7 @@ yyFlexLexer::yyFlexLexer( std::istream* arg_yyin, std::ostream* arg_yyout ) yy_start_stack_ptr = yy_start_stack_depth = 0; yy_start_stack = NULL; - yy_buffer_stack = 0; + yy_buffer_stack = NULL; yy_buffer_stack_top = 0; yy_buffer_stack_max = 0; @@ -1554,16 +1479,29 @@ yyFlexLexer::~yyFlexLexer() /* The contents of this function are C++ specific, so the YY_G macro is not used. */ +void yyFlexLexer::switch_streams( std::istream& new_in, std::ostream& new_out ) +{ + // was if( new_in ) + yy_delete_buffer( YY_CURRENT_BUFFER M4_YY_CALL_LAST_ARG); + yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE M4_YY_CALL_LAST_ARG) M4_YY_CALL_LAST_ARG); + + // was if( new_out ) + yyout.rdbuf(new_out.rdbuf()); +} + +/* The contents of this function are C++ specific, so the YY_G macro is not used. + */ void yyFlexLexer::switch_streams( std::istream* new_in, std::ostream* new_out ) { - if ( new_in ) - { - yy_delete_buffer( YY_CURRENT_BUFFER M4_YY_CALL_LAST_ARG); - yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE M4_YY_CALL_LAST_ARG) M4_YY_CALL_LAST_ARG); - } + if( ! new_in ) { + new_in = &yyin; + } + + if ( ! new_out ) { + new_out = &yyout; + } - if ( new_out ) - yyout = new_out; + switch_streams(*new_in, *new_out); } #ifdef YY_INTERACTIVE @@ -1572,33 +1510,33 @@ int yyFlexLexer::LexerInput( char* buf, int /* max_size */ ) int yyFlexLexer::LexerInput( char* buf, int max_size ) #endif { - if ( yyin->eof() || yyin->fail() ) + if ( yyin.eof() || yyin.fail() ) return 0; #ifdef YY_INTERACTIVE - yyin->get( buf[0] ); + yyin.get( buf[0] ); - if ( yyin->eof() ) + if ( yyin.eof() ) return 0; - if ( yyin->bad() ) + if ( yyin.bad() ) return -1; return 1; #else - (void) yyin->read( buf, max_size ); + (void) yyin.read( buf, max_size ); - if ( yyin->bad() ) + if ( yyin.bad() ) return -1; else - return yyin->gcount(); + return yyin.gcount(); #endif } void yyFlexLexer::LexerOutput( const char* buf, int size ) { - (void) yyout->write( buf, size ); + (void) yyout.write( buf, size ); } %ok-for-header %endif @@ -1613,16 +1551,16 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]], * EOB_ACT_END_OF_FILE - end of file */ %if-c-only -static int yy_get_next_buffer YYFARGS0(void) +static int yy_get_next_buffer (M4_YY_DEF_ONLY_ARG) %endif %if-c++-only int yyFlexLexer::yy_get_next_buffer() %endif { M4_YY_DECL_GUTS_VAR(); - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = YY_G(yytext_ptr); - register int number_to_move, i; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = YY_G(yytext_ptr); + int number_to_move, i; int ret_val; if ( YY_G(yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_G(yy_n_chars) + 1] ) @@ -1651,7 +1589,7 @@ int yyFlexLexer::yy_get_next_buffer() /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) (YY_G(yy_c_buf_p) - YY_G(yytext_ptr)) - 1; + number_to_move = (int) (YY_G(yy_c_buf_p) - YY_G(yytext_ptr) - 1); for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -1664,7 +1602,7 @@ int yyFlexLexer::yy_get_next_buffer() else { - yy_size_t num_to_read = + int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) @@ -1683,7 +1621,7 @@ m4_ifdef( [[M4_YY_USES_REJECT]], if ( b->yy_is_our_buffer ) { - yy_size_t new_size = b->yy_buf_size * 2; + int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -1693,11 +1631,11 @@ m4_ifdef( [[M4_YY_USES_REJECT]], b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ yyrealloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 M4_YY_CALL_LAST_ARG ); + (yy_size_t) (b->yy_buf_size + 2) M4_YY_CALL_LAST_ARG ); } else /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; + b->yy_ch_buf = NULL; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( @@ -1739,13 +1677,15 @@ m4_ifdef( [[M4_YY_USES_REJECT]], else ret_val = EOB_ACT_CONTINUE_SCAN; - if ((yy_size_t) (YY_G(yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + if ((YY_G(yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = YY_G(yy_n_chars) + number_to_move + (YY_G(yy_n_chars) >> 1); + int new_size = YY_G(yy_n_chars) + number_to_move + (YY_G(yy_n_chars) >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( - (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, new_size M4_YY_CALL_LAST_ARG ); + (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; @@ -1762,14 +1702,14 @@ m4_ifdef( [[M4_YY_USES_REJECT]], %if-c-only %not-for-header - static yy_state_type yy_get_previous_state YYFARGS0(void) + static yy_state_type yy_get_previous_state (M4_YY_DEF_ONLY_ARG) %endif %if-c++-only yy_state_type yyFlexLexer::yy_get_previous_state() %endif { - register yy_state_type yy_current_state; - register char *yy_cp; + yy_state_type yy_current_state; + char *yy_cp; M4_YY_DECL_GUTS_VAR(); %% [15.0] code to get the start state into yy_current_state goes here @@ -1795,7 +1735,7 @@ m4_ifdef( [[M4_YY_USES_REJECT]], yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state ) %endif { - register int yy_is_jam; + int yy_is_jam; M4_YY_DECL_GUTS_VAR(); /* This var may be unused depending upon options. */ %% [17.0] code to find the next state, and perhaps do backing up, goes here @@ -1804,16 +1744,17 @@ m4_ifdef( [[M4_YY_USES_REJECT]], } +#ifndef YY_NO_UNPUT %if-c-only m4_ifdef( [[M4_YY_NO_UNPUT]],, [[ - static void yyunput YYFARGS2( int,c, register char *,yy_bp) + static void yyunput YYFARGS2( int,c, char *,yy_bp) %endif %if-c++-only - void yyFlexLexer::yyunput( int c, register char* yy_bp) + void yyFlexLexer::yyunput( int c, char* yy_bp) %endif { - register char *yy_cp; + char *yy_cp; M4_YY_DECL_GUTS_VAR(); yy_cp = YY_G(yy_c_buf_p); @@ -1824,10 +1765,10 @@ m4_ifdef( [[M4_YY_NO_UNPUT]],, if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register yy_size_t number_to_move = YY_G(yy_n_chars) + 2; - register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + int number_to_move = YY_G(yy_n_chars) + 2; + char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - register char *source = + char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) @@ -1836,7 +1777,7 @@ m4_ifdef( [[M4_YY_NO_UNPUT]],, yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = - YY_G(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + YY_G(yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size; if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); @@ -1859,13 +1800,14 @@ m4_ifdef( [[M4_YY_USE_LINENO]], %if-c-only ]]) %endif +#endif %if-c-only #ifndef YY_NO_INPUT #ifdef __cplusplus - static int yyinput YYFARGS0(void) + static int yyinput (M4_YY_DEF_ONLY_ARG) #else - static int input YYFARGS0(void) + static int input (M4_YY_DEF_ONLY_ARG) #endif %endif @@ -1890,7 +1832,7 @@ m4_ifdef( [[M4_YY_USE_LINENO]], else { /* need more input */ - yy_size_t offset = YY_G(yy_c_buf_p) - YY_G(yytext_ptr); + int offset = (int) (YY_G(yy_c_buf_p) - YY_G(yytext_ptr)); ++YY_G(yy_c_buf_p); switch ( yy_get_next_buffer( M4_YY_CALL_ONLY_ARG ) ) @@ -1914,7 +1856,7 @@ m4_ifdef( [[M4_YY_USE_LINENO]], case EOB_ACT_END_OF_FILE: { if ( yywrap( M4_YY_CALL_ONLY_ARG ) ) - return EOF; + return 0; if ( ! YY_G(yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -1953,7 +1895,7 @@ m4_ifdef( [[M4_YY_USE_LINENO]], void yyrestart YYFARGS1( FILE *,input_file) %endif %if-c++-only - void yyFlexLexer::yyrestart( std::istream* input_file ) + void yyFlexLexer::yyrestart( std::istream& input_file ) %endif { M4_YY_DECL_GUTS_VAR(); @@ -1968,6 +1910,21 @@ m4_ifdef( [[M4_YY_USE_LINENO]], yy_load_buffer_state( M4_YY_CALL_ONLY_ARG ); } +%if-c++-only +/** Delegate to the new version that takes an istream reference. + * @param input_file A readable stream. + * M4_YY_DOC_PARAM + * @note This function does not reset the start condition to @c INITIAL . + */ +void yyFlexLexer::yyrestart( std::istream* input_file ) +{ + if( ! input_file ) { + input_file = &yyin; + } + yyrestart( *input_file ); +} +%endif + /** Switch to a different input buffer. * @param new_buffer The new input buffer. * M4_YY_DOC_PARAM @@ -2011,7 +1968,7 @@ m4_ifdef( [[M4_YY_USE_LINENO]], %if-c-only -static void yy_load_buffer_state YYFARGS0(void) +static void yy_load_buffer_state (M4_YY_DEF_ONLY_ARG) %endif %if-c++-only void yyFlexLexer::yy_load_buffer_state() @@ -2020,7 +1977,12 @@ static void yy_load_buffer_state YYFARGS0(void) M4_YY_DECL_GUTS_VAR(); YY_G(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; YY_G(yytext_ptr) = YY_G(yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; +%if-c-only yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; +%endif +%if-c++-only + yyin.rdbuf(YY_CURRENT_BUFFER_LVALUE->yy_input_file); +%endif YY_G(yy_hold_char) = *YY_G(yy_c_buf_p); } @@ -2034,7 +1996,7 @@ static void yy_load_buffer_state YYFARGS0(void) YY_BUFFER_STATE yy_create_buffer YYFARGS2( FILE *,file, int ,size) %endif %if-c++-only - YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( std::istream* file, int size ) + YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( std::istream& file, int size ) %endif { YY_BUFFER_STATE b; @@ -2049,7 +2011,7 @@ static void yy_load_buffer_state YYFARGS0(void) /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ - b->yy_ch_buf = (char *) yyalloc( b->yy_buf_size + 2 M4_YY_CALL_LAST_ARG ); + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) M4_YY_CALL_LAST_ARG ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); @@ -2060,6 +2022,19 @@ static void yy_load_buffer_state YYFARGS0(void) return b; } +%if-c++-only +/** Delegate creation of buffers to the new version that takes an istream reference. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * M4_YY_DOC_PARAM + * @return the allocated buffer state. + */ + YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( std::istream* file, int size ) +{ + return yy_create_buffer( *file, size ); +} +%endif + /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() * M4_YY_DOC_PARAM @@ -2094,7 +2069,7 @@ static void yy_load_buffer_state YYFARGS0(void) static void yy_init_buffer YYFARGS2( YY_BUFFER_STATE ,b, FILE *,file) %endif %if-c++-only - void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, std::istream* file ) + void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, std::istream& file ) %endif { @@ -2103,7 +2078,12 @@ static void yy_load_buffer_state YYFARGS0(void) yy_flush_buffer( b M4_YY_CALL_LAST_ARG); +%if-c-only b->yy_input_file = file; +%endif +%if-c++-only + b->yy_input_file = file.rdbuf(); +%endif b->yy_fill_buffer = 1; /* If b is the current buffer, then yy_init_buffer was _probably_ @@ -2216,7 +2196,7 @@ void yyFlexLexer::yypush_buffer_state (YY_BUFFER_STATE new_buffer) * M4_YY_DOC_PARAM */ %if-c-only -void yypop_buffer_state YYFARGS0(void) +void yypop_buffer_state (M4_YY_DEF_ONLY_ARG) %endif %if-c++-only void yyFlexLexer::yypop_buffer_state (void) @@ -2244,7 +2224,7 @@ void yyFlexLexer::yypop_buffer_state (void) * Guarantees space for at least one push. */ %if-c-only -static void yyensure_buffer_stack YYFARGS0(void) +static void yyensure_buffer_stack (M4_YY_DEF_ONLY_ARG) %endif %if-c++-only void yyFlexLexer::yyensure_buffer_stack(void) @@ -2259,16 +2239,16 @@ void yyFlexLexer::yyensure_buffer_stack(void) * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ - num_to_alloc = 1; + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ YY_G(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) 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; @@ -2277,7 +2257,7 @@ void yyFlexLexer::yyensure_buffer_stack(void) if (YY_G(yy_buffer_stack_top) >= (YY_G(yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; + yy_size_t grow_size = 8 /* arbitrary grow size */; num_to_alloc = YY_G(yy_buffer_stack_max) + grow_size; YY_G(yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc @@ -2304,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) { @@ -2315,16 +2295,16 @@ YY_BUFFER_STATE yy_scan_buffer YYFARGS2( char *,base, yy_size_t ,size) base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ - return 0; + return NULL; b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) M4_YY_CALL_LAST_ARG ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; - b->yy_input_file = 0; + b->yy_input_file = NULL; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; @@ -2350,11 +2330,11 @@ m4_ifdef( [[M4_YY_NO_SCAN_STRING]],, * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ -YY_BUFFER_STATE yy_scan_string YYFARGS1( yyconst char *, yystr) +YY_BUFFER_STATE yy_scan_string YYFARGS1( const char *, yystr) { m4_dnl M4_YY_DECL_GUTS_VAR(); - return yy_scan_bytes( yystr, strlen(yystr) M4_YY_CALL_LAST_ARG); + return yy_scan_bytes( yystr, (int) strlen(yystr) M4_YY_CALL_LAST_ARG); } %endif ]]) @@ -2370,16 +2350,16 @@ m4_ifdef( [[M4_YY_NO_SCAN_BYTES]],, * M4_YY_DOC_PARAM * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE yy_scan_bytes YYFARGS2( yyconst char *,yybytes, yy_size_t ,_yybytes_len) +YY_BUFFER_STATE yy_scan_bytes YYFARGS2( const char *,yybytes, int ,_yybytes_len) { YY_BUFFER_STATE b; char *buf; yy_size_t n; - yy_size_t i; + int i; m4_dnl M4_YY_DECL_GUTS_VAR(); /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; + n = (yy_size_t) (_yybytes_len + 2); buf = (char *) yyalloc( n M4_YY_CALL_LAST_ARG ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); @@ -2407,10 +2387,10 @@ YY_BUFFER_STATE yy_scan_bytes YYFARGS2( yyconst char *,yybytes, yy_size_t ,_yyb m4_ifdef( [[M4_YY_NO_PUSH_STATE]],, [[ %if-c-only - static void yy_push_state YYFARGS1( int ,new_state) + static void yy_push_state YYFARGS1( int ,_new_state) %endif %if-c++-only - void yyFlexLexer::yy_push_state( int new_state ) + void yyFlexLexer::yy_push_state( int _new_state ) %endif { M4_YY_DECL_GUTS_VAR(); @@ -2419,7 +2399,7 @@ m4_ifdef( [[M4_YY_NO_PUSH_STATE]],, yy_size_t new_size; YY_G(yy_start_stack_depth) += YY_START_STACK_INCR; - new_size = YY_G(yy_start_stack_depth) * sizeof( int ); + new_size = (yy_size_t) YY_G(yy_start_stack_depth) * sizeof( int ); if ( ! YY_G(yy_start_stack) ) YY_G(yy_start_stack) = (int *) yyalloc( new_size M4_YY_CALL_LAST_ARG ); @@ -2434,7 +2414,7 @@ m4_ifdef( [[M4_YY_NO_PUSH_STATE]],, YY_G(yy_start_stack)[YY_G(yy_start_stack_ptr)++] = YY_START; - BEGIN(new_state); + BEGIN(_new_state); } ]]) @@ -2442,7 +2422,7 @@ m4_ifdef( [[M4_YY_NO_PUSH_STATE]],, m4_ifdef( [[M4_YY_NO_POP_STATE]],, [[ %if-c-only - static void yy_pop_state YYFARGS0(void) + static void yy_pop_state (M4_YY_DEF_ONLY_ARG) %endif %if-c++-only void yyFlexLexer::yy_pop_state() @@ -2460,7 +2440,7 @@ m4_ifdef( [[M4_YY_NO_POP_STATE]],, m4_ifdef( [[M4_YY_NO_TOP_STATE]],, [[ %if-c-only - static int yy_top_state YYFARGS0(void) + static int yy_top_state (M4_YY_DEF_ONLY_ARG) %endif %if-c++-only int yyFlexLexer::yy_top_state() @@ -2476,15 +2456,16 @@ m4_ifdef( [[M4_YY_NO_TOP_STATE]],, #endif %if-c-only -static void yy_fatal_error YYFARGS1(yyconst char*, msg) +static void yynoreturn yy_fatal_error YYFARGS1(const char*, msg) { - m4_dnl M4_YY_DECL_GUTS_VAR(); - (void) fprintf( stderr, "%s\n", msg ); + M4_YY_DECL_GUTS_VAR(); + M4_YY_NOOP_GUTS_VAR(); + fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } %endif %if-c++-only -void yyFlexLexer::LexerError( yyconst char msg[] ) +void yyFlexLexer::LexerError( const char* msg ) { M4_YY_DECL_GUTS_VAR(); std::cerr << msg << std::endl; @@ -2520,7 +2501,7 @@ m4_ifdef( [[M4_YY_NO_GET_EXTRA]],, /** Get the user-defined data for this scanner. * M4_YY_DOC_PARAM */ -YY_EXTRA_TYPE yyget_extra YYFARGS0(void) +YY_EXTRA_TYPE yyget_extra (M4_YY_DEF_ONLY_ARG) { M4_YY_DECL_GUTS_VAR(); return yyextra; @@ -2533,10 +2514,10 @@ m4_ifdef( [[M4_YY_NO_GET_LINENO]],, /** Get the current line number. * M4_YY_DOC_PARAM */ -int yyget_lineno YYFARGS0(void) +int yyget_lineno (M4_YY_DEF_ONLY_ARG) { M4_YY_DECL_GUTS_VAR(); - + m4_ifdef( [[M4_YY_REENTRANT]], [[ if (! YY_CURRENT_BUFFER) @@ -2553,10 +2534,10 @@ m4_ifdef( [[M4_YY_NO_GET_COLUMN]],, /** Get the current column number. * M4_YY_DOC_PARAM */ -int yyget_column YYFARGS0(void) +int yyget_column (M4_YY_DEF_ONLY_ARG) { M4_YY_DECL_GUTS_VAR(); - + m4_ifdef( [[M4_YY_REENTRANT]], [[ if (! YY_CURRENT_BUFFER) @@ -2572,7 +2553,7 @@ m4_ifdef( [[M4_YY_NO_GET_IN]],, /** Get the input stream. * M4_YY_DOC_PARAM */ -FILE *yyget_in YYFARGS0(void) +FILE *yyget_in (M4_YY_DEF_ONLY_ARG) { M4_YY_DECL_GUTS_VAR(); return yyin; @@ -2584,7 +2565,7 @@ m4_ifdef( [[M4_YY_NO_GET_OUT]],, /** Get the output stream. * M4_YY_DOC_PARAM */ -FILE *yyget_out YYFARGS0(void) +FILE *yyget_out (M4_YY_DEF_ONLY_ARG) { M4_YY_DECL_GUTS_VAR(); return yyout; @@ -2596,7 +2577,7 @@ m4_ifdef( [[M4_YY_NO_GET_LENG]],, /** Get the length of the current token. * M4_YY_DOC_PARAM */ -yy_size_t yyget_leng YYFARGS0(void) +int yyget_leng (M4_YY_DEF_ONLY_ARG) { M4_YY_DECL_GUTS_VAR(); return yyleng; @@ -2608,7 +2589,7 @@ yy_size_t yyget_leng YYFARGS0(void) */ m4_ifdef( [[M4_YY_NO_GET_TEXT]],, [[ -char *yyget_text YYFARGS0(void) +char *yyget_text (M4_YY_DEF_ONLY_ARG) { M4_YY_DECL_GUTS_VAR(); return yytext; @@ -2633,10 +2614,10 @@ void yyset_extra YYFARGS1( YY_EXTRA_TYPE ,user_defined) m4_ifdef( [[M4_YY_NO_SET_LINENO]],, [[ /** Set the current line number. - * @param line_number + * @param _line_number line number * M4_YY_DOC_PARAM */ -void yyset_lineno YYFARGS1( int ,line_number) +void yyset_lineno YYFARGS1( int ,_line_number) { M4_YY_DECL_GUTS_VAR(); @@ -2646,7 +2627,7 @@ void yyset_lineno YYFARGS1( int ,line_number) if (! YY_CURRENT_BUFFER ) YY_FATAL_ERROR( "yyset_lineno called with no buffer" ); ]]) - yylineno = line_number; + yylineno = _line_number; } ]]) @@ -2655,10 +2636,10 @@ m4_ifdef( [[M4_YY_REENTRANT]], m4_ifdef( [[M4_YY_NO_SET_COLUMN]],, [[ /** Set the current column. - * @param line_number + * @param _column_no column number * M4_YY_DOC_PARAM */ -void yyset_column YYFARGS1( int , column_no) +void yyset_column YYFARGS1( int , _column_no) { M4_YY_DECL_GUTS_VAR(); @@ -2668,7 +2649,7 @@ void yyset_column YYFARGS1( int , column_no) if (! YY_CURRENT_BUFFER ) YY_FATAL_ERROR( "yyset_column called with no buffer" ); ]]) - yycolumn = column_no; + yycolumn = _column_no; } ]]) ]]) @@ -2678,30 +2659,30 @@ m4_ifdef( [[M4_YY_NO_SET_IN]],, [[ /** Set the input stream. This does not discard the current * input buffer. - * @param in_str A readable stream. + * @param _in_str A readable stream. * M4_YY_DOC_PARAM * @see yy_switch_to_buffer */ -void yyset_in YYFARGS1( FILE * ,in_str) +void yyset_in YYFARGS1( FILE * ,_in_str) { M4_YY_DECL_GUTS_VAR(); - yyin = in_str ; + yyin = _in_str ; } ]]) m4_ifdef( [[M4_YY_NO_SET_OUT]],, [[ -void yyset_out YYFARGS1( FILE * ,out_str) +void yyset_out YYFARGS1( FILE * ,_out_str) { M4_YY_DECL_GUTS_VAR(); - yyout = out_str ; + yyout = _out_str ; } ]]) m4_ifdef( [[M4_YY_NO_GET_DEBUG]],, [[ -int yyget_debug YYFARGS0(void) +int yyget_debug (M4_YY_DEF_ONLY_ARG) { M4_YY_DECL_GUTS_VAR(); return yy_flex_debug; @@ -2710,10 +2691,10 @@ int yyget_debug YYFARGS0(void) m4_ifdef( [[M4_YY_NO_SET_DEBUG]],, [[ -void yyset_debug YYFARGS1( int ,bdebug) +void yyset_debug YYFARGS1( int ,_bdebug) { M4_YY_DECL_GUTS_VAR(); - yy_flex_debug = bdebug ; + yy_flex_debug = _bdebug ; } ]]) %endif @@ -2724,7 +2705,7 @@ void yyset_debug YYFARGS1( int ,bdebug) %if-bison-bridge m4_ifdef( [[M4_YY_NO_GET_LVAL]],, [[ -YYSTYPE * yyget_lval YYFARGS0(void) +YYSTYPE * yyget_lval (M4_YY_DEF_ONLY_ARG) { M4_YY_DECL_GUTS_VAR(); return yylval; @@ -2744,7 +2725,7 @@ m4_ifdef( [[<M4_YY_BISON_LLOC>]], [[ m4_ifdef( [[M4_YY_NO_GET_LLOC]],, [[ -YYLTYPE *yyget_lloc YYFARGS0(void) +YYLTYPE *yyget_lloc (M4_YY_DEF_ONLY_ARG) { M4_YY_DECL_GUTS_VAR(); return yylloc; @@ -2770,14 +2751,7 @@ void yyset_lloc YYFARGS1( YYLTYPE * ,yylloc_param) * the ONLY reentrant function that doesn't take the scanner as the last argument. * That's why we explicitly handle the declaration, instead of using our macros. */ -m4_ifdef( [[M4_YY_NO_ANSI_FUNC_DEFS]], -[[ -int yylex_init( ptr_yy_globals ) - yyscan_t* ptr_yy_globals; -]], -[[ int yylex_init(yyscan_t* ptr_yy_globals) -]]) { if (ptr_yy_globals == NULL){ errno = EINVAL; @@ -2805,15 +2779,7 @@ int yylex_init(yyscan_t* ptr_yy_globals) * The user defined value in the first argument will be available to yyalloc in * the yyextra field. */ -m4_ifdef( [[M4_YY_NO_ANSI_FUNC_DEFS]], -[[ -int yylex_init_extra( yy_user_defined, ptr_yy_globals ) - YY_EXTRA_TYPE yy_user_defined; - yyscan_t* ptr_yy_globals; -]], -[[ int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals ) -]]) { struct yyguts_t dummy_yyguts; @@ -2823,28 +2789,28 @@ 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 ); } %endif if-c-only - +%# Actually, that ended an if-rentrant section %if-c-only -static int yy_init_globals YYFARGS0(void) +static int yy_init_globals (M4_YY_DEF_ONLY_ARG) { M4_YY_DECL_GUTS_VAR(); /* Initialization is the same as for the non-reentrant scanner. @@ -2859,10 +2825,10 @@ m4_ifdef( [[M4_YY_USE_LINENO]], yylineno = 1; ]]) ]]) - YY_G(yy_buffer_stack) = 0; + YY_G(yy_buffer_stack) = NULL; YY_G(yy_buffer_stack_top) = 0; YY_G(yy_buffer_stack_max) = 0; - YY_G(yy_c_buf_p) = (char *) 0; + YY_G(yy_c_buf_p) = NULL; YY_G(yy_init) = 0; YY_G(yy_start) = 0; @@ -2893,8 +2859,8 @@ m4_ifdef( [[M4_YY_TEXT_IS_ARRAY]], yyin = stdin; yyout = stdout; #else - yyin = (FILE *) 0; - yyout = (FILE *) 0; + yyin = NULL; + yyout = NULL; #endif /* For future reference: Set errno on error, since we are called by @@ -2907,7 +2873,7 @@ m4_ifdef( [[M4_YY_TEXT_IS_ARRAY]], %if-c-only SNIP! this currently causes conflicts with the c++ scanner /* yylex_destroy is for both reentrant and non-reentrant scanners. */ -int yylex_destroy YYFARGS0(void) +int yylex_destroy (M4_YY_DEF_ONLY_ARG) { M4_YY_DECL_GUTS_VAR(); @@ -2959,9 +2925,12 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]], m4_ifdef( [[M4_YY_NOT_IN_HEADER]], [[ #ifndef yytext_ptr -static void yy_flex_strncpy YYFARGS3( char*,s1, yyconst char *,s2, int,n) +static void yy_flex_strncpy YYFARGS3( char*,s1, const char *,s2, int,n) { - register int i; + M4_YY_DECL_GUTS_VAR(); + M4_YY_NOOP_GUTS_VAR(); + + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } @@ -2971,9 +2940,9 @@ static void yy_flex_strncpy YYFARGS3( char*,s1, yyconst char *,s2, int,n) m4_ifdef( [[M4_YY_NOT_IN_HEADER]], [[ #ifdef YY_NEED_STRLEN -static int yy_flex_strlen YYFARGS1( yyconst char *,s) +static int yy_flex_strlen YYFARGS1( const char *,s) { - register int n; + int n; for ( n = 0; s[n]; ++n ) ; @@ -2986,7 +2955,9 @@ m4_ifdef( [[M4_YY_NO_FLEX_ALLOC]],, [[ void *yyalloc YYFARGS1( yy_size_t ,size) { - return (void *) malloc( size ); + M4_YY_DECL_GUTS_VAR(); + M4_YY_NOOP_GUTS_VAR(); + return malloc(size); } ]]) @@ -2994,6 +2965,9 @@ m4_ifdef( [[M4_YY_NO_FLEX_REALLOC]],, [[ void *yyrealloc YYFARGS2( void *,ptr, yy_size_t ,size) { + M4_YY_DECL_GUTS_VAR(); + M4_YY_NOOP_GUTS_VAR(); + /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -3001,7 +2975,7 @@ void *yyrealloc YYFARGS2( void *,ptr, yy_size_t ,size) * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ - return (void *) realloc( (char *) ptr, size ); + return realloc(ptr, size); } ]]) @@ -3009,6 +2983,8 @@ m4_ifdef( [[M4_YY_NO_FLEX_FREE]],, [[ void yyfree YYFARGS1( void *,ptr) { + M4_YY_DECL_GUTS_VAR(); + M4_YY_NOOP_GUTS_VAR(); free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } ]]) @@ -3023,7 +2999,7 @@ static int yytbl_read8 (void *v, struct yytbl_reader * rd) errno = EIO; return -1; } - rd->bread += sizeof(flex_uint8_t); + rd->bread += (flex_uint32_t) sizeof(flex_uint8_t); return 0; } @@ -3035,7 +3011,7 @@ static int yytbl_read16 (void *v, struct yytbl_reader * rd) return -1; } *((flex_uint16_t *) v) = ntohs (*((flex_uint16_t *) v)); - rd->bread += sizeof(flex_uint16_t); + rd->bread += (flex_uint32_t) sizeof(flex_uint16_t); return 0; } @@ -3047,14 +3023,14 @@ static int yytbl_read32 (void *v, struct yytbl_reader * rd) return -1; } *((flex_uint32_t *) v) = ntohl (*((flex_uint32_t *) v)); - rd->bread += sizeof(flex_uint32_t); + rd->bread += (flex_uint32_t) sizeof(flex_uint32_t); return 0; } /** Read the header */ static int yytbl_hdr_read YYFARGS2(struct yytbl_hdr *, th, struct yytbl_reader *, rd) { - int bytes; + size_t bytes; memset (th, 0, sizeof (struct yytbl_hdr)); if (yytbl_read32 (&(th->th_magic), rd) != 0) @@ -3090,7 +3066,7 @@ static int yytbl_hdr_read YYFARGS2(struct yytbl_hdr *, th, struct yytbl_reader * return -1; } else - rd->bread += bytes; + rd->bread += (flex_uint32_t) bytes; th->th_name = th->th_version + strlen (th->th_version) + 1; return 0; @@ -3103,15 +3079,18 @@ static int yytbl_hdr_read YYFARGS2(struct yytbl_hdr *, th, struct yytbl_reader * static struct yytbl_dmap *yytbl_dmap_lookup YYFARGS2(struct yytbl_dmap *, dmap, int, id) { + M4_YY_DECL_GUTS_VAR(); + M4_YY_NOOP_GUTS_VAR(); + while (dmap->dm_id) - if (dmap->dm_id == id) + if ((int)(dmap->dm_id) == id) return dmap; else 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 */ @@ -3156,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); @@ -3203,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; } @@ -3260,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 @@ -3271,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; } @@ -3386,8 +3365,8 @@ int yytables_fload YYFARGS1(FILE *, fp) } /** Destroy the loaded tables, freeing memory, etc.. */ -int yytables_destroy YYFARGS0(void) -{ +int yytables_destroy (M4_YY_DEF_ONLY_ARG) +{ struct yytbl_dmap *dmap=0; if(!M4_YY_TABLES_VERIFY){ @@ -3410,7 +3389,7 @@ int yytables_destroy YYFARGS0(void) m4_ifdef([[M4_YY_MAIN]], [[ -int main M4_YY_PARAMS(void); +int main (void); int main () { @@ -3444,4 +3423,5 @@ m4_ifdef( [[M4_YY_IN_HEADER]], #undef YY_DECL_IS_OURS #undef YY_DECL #endif +m4preproc_undivert(1) ]]) diff --git a/flexdef.h b/src/flexdef.h index 046dd9a..9dac654 100644 --- a/flexdef.h +++ b/src/flexdef.h @@ -39,30 +39,15 @@ #include <config.h> #endif -/* AIX requires this to be the first thing in the file. */ -#ifndef __GNUC__ -# if HAVE_ALLOCA_H -# include <alloca.h> -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -char *alloca (); -# endif -# endif -# endif -#endif - -#ifdef STDC_HEADERS #include <stdio.h> #include <stdlib.h> #include <stdarg.h> #include <setjmp.h> #include <ctype.h> +#include <libgen.h> /* for XPG version of basename(3) */ #include <string.h> #include <math.h> -#endif + #ifdef HAVE_ASSERT_H #include <assert.h> #else @@ -72,28 +57,24 @@ char *alloca (); #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_WAIT_H +/* Required: stat() in <sys/stat.h> */ +#include <sys/stat.h> +/* Required: wait() in <sys/wait.h> */ #include <sys/wait.h> -#endif -#ifdef HAVE_STDBOOL_H #include <stdbool.h> -#else -#define bool int -#define true 1 -#define false 0 -#endif -#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 _() */ @@ -109,33 +90,12 @@ char *alloca (); /* Always be prepared to generate an 8-bit scanner. */ #define CSIZE 256 -#define Char unsigned char /* Size of input alphabet - should be size of ASCII set. */ #ifndef DEFAULT_CSIZE #define DEFAULT_CSIZE 128 #endif -#ifndef PROTO -#if defined(__STDC__) -#define PROTO(proto) proto -#else -#define PROTO(proto) () -#endif -#endif - -#ifdef VMS -#ifndef __VMS_POSIX -#define unlink remove -#define SHORT_FILE_NAMES -#endif -#endif - -#ifdef MS_DOS -#define SHORT_FILE_NAMES -#endif - - /* Maximum line length we'll have to deal with. */ #define MAXLINE 2048 @@ -149,11 +109,8 @@ char *alloca (); #define ABS(x) ((x) < 0 ? -(x) : (x)) #endif - -/* ANSI C does not guarantee that isascii() is defined */ -#ifndef isascii -#define isascii(c) ((c) <= 0177) -#endif +/* Whether an integer is a power of two */ +#define is_power_of_2(n) ((n) > 0 && ((n) & ((n) - 1)) == 0) #define unspecified -1 @@ -395,6 +352,7 @@ char *alloca (); * yymore_really_used - whether to treat yymore() as really used, regardless * of what we think based on references to it in the user's actions. * reject_really_used - same for REJECT + * trace_hex - use hexadecimal numbers in trace/debug outputs instead of octals */ extern int printstats, syntaxerror, eofseen, ddebug, trace, nowarn, @@ -403,13 +361,12 @@ extern int interactive, lex_compat, posix_compat, do_yylineno; extern int useecs, fulltbl, usemecs, fullspd; extern int gen_line_dirs, performance_report, backing_up_report; extern int reentrant, bison_bridge_lval, bison_bridge_lloc; -extern bool ansi_func_defs, ansi_func_protos; extern int C_plus_plus, long_align, use_read, yytext_is_array, do_yywrap; extern int csize; extern int yymore_used, reject, real_reject, continued_action, in_rule; extern int yymore_really_used, reject_really_used; - +extern int trace_hex; /* Variables used in the flex input routines: * datapos - characters on current output line @@ -444,7 +401,7 @@ extern int yymore_really_used, reject_really_used; */ extern int datapos, dataline, linenum; -extern FILE *skelfile, *yyin, *backing_up_file; +extern FILE *skelfile, *backing_up_file; extern const char *skel[]; extern int skel_ind; extern char *infilename, *outfilename, *headerfilename; @@ -646,7 +603,7 @@ extern int end_of_buffer_state; extern int lastccl, *cclmap, *ccllen, *cclng, cclreuse; extern int current_maxccls, current_max_ccl_tbl_size; -extern Char *ccltbl; +extern unsigned char *ccltbl; /* Variables for miscellaneous information: @@ -674,62 +631,54 @@ extern int sectnum, nummt, hshcol, dfaeql, numeps, eps2, num_reallocs; extern int tmpuses, totnst, peakpairs, numuniq, numdup, hshsave; extern int num_backing_up, bol_needed; -void *allocate_array PROTO ((int, size_t)); -void *reallocate_array PROTO ((void *, int, size_t)); +#ifndef HAVE_REALLOCARRAY +void *reallocarray(void *, size_t, size_t); +#endif -void *flex_alloc PROTO ((size_t)); -void *flex_realloc PROTO ((void *, size_t)); -void flex_free PROTO ((void *)); +void *allocate_array(int, size_t); +void *reallocate_array(void *, int, size_t); #define allocate_integer_array(size) \ - (int *) allocate_array( size, sizeof( int ) ) + allocate_array(size, sizeof(int)) #define reallocate_integer_array(array,size) \ - (int *) reallocate_array( (void *) array, size, sizeof( int ) ) + reallocate_array((void *) array, size, sizeof(int)) #define allocate_bool_array(size) \ - (bool *) allocate_array( size, sizeof( bool ) ) + allocate_array(size, sizeof(bool)) #define reallocate_bool_array(array,size) \ - (bool *) reallocate_array( (void *) array, size, sizeof( bool ) ) + reallocate_array((void *) array, size, sizeof(bool)) #define allocate_int_ptr_array(size) \ - (int **) allocate_array( size, sizeof( int * ) ) + allocate_array(size, sizeof(int *)) #define allocate_char_ptr_array(size) \ - (char **) allocate_array( size, sizeof( char * ) ) + allocate_array(size, sizeof(char *)) #define allocate_dfaacc_union(size) \ - (union dfaacc_union *) \ - allocate_array( size, sizeof( union dfaacc_union ) ) + allocate_array(size, sizeof(union dfaacc_union)) #define reallocate_int_ptr_array(array,size) \ - (int **) reallocate_array( (void *) array, size, sizeof( int * ) ) + reallocate_array((void *) array, size, sizeof(int *)) #define reallocate_char_ptr_array(array,size) \ - (char **) reallocate_array( (void *) array, size, sizeof( char * ) ) + reallocate_array((void *) array, size, sizeof(char *)) #define reallocate_dfaacc_union(array, size) \ - (union dfaacc_union *) \ - reallocate_array( (void *) array, size, sizeof( union dfaacc_union ) ) + reallocate_array((void *) array, size, sizeof(union dfaacc_union)) #define allocate_character_array(size) \ - (char *) allocate_array( size, sizeof( char ) ) + allocate_array( size, sizeof(char)) #define reallocate_character_array(array,size) \ - (char *) reallocate_array( (void *) array, size, sizeof( char ) ) + reallocate_array((void *) array, size, sizeof(char)) #define allocate_Character_array(size) \ - (Char *) allocate_array( size, sizeof( Char ) ) + allocate_array(size, sizeof(unsigned char)) #define reallocate_Character_array(array,size) \ - (Char *) reallocate_array( (void *) array, size, sizeof( Char ) ) - - -/* Used to communicate between scanner and parser. The type should really - * be YYSTYPE, but we can't easily get our hands on it. - */ -extern int yylval; + reallocate_array((void *) array, size, sizeof(unsigned char)) /* External functions that are cross-referenced among the flex source files. */ @@ -737,146 +686,143 @@ extern int yylval; /* from file ccl.c */ -extern void ccladd PROTO ((int, int)); /* add a single character to a ccl */ -extern int cclinit PROTO ((void)); /* make an empty ccl */ -extern void cclnegate PROTO ((int)); /* negate a ccl */ +extern void ccladd(int, int); /* add a single character to a ccl */ +extern int cclinit(void); /* make an empty ccl */ +extern void cclnegate(int); /* negate a ccl */ extern int ccl_set_diff (int a, int b); /* set difference of two ccls. */ extern int ccl_set_union (int a, int b); /* set union of two ccls. */ /* List the members of a set of characters in CCL form. */ -extern void list_character_set PROTO ((FILE *, int[])); +extern void list_character_set(FILE *, int[]); /* from file dfa.c */ /* Check a DFA state for backing up. */ -extern void check_for_backing_up PROTO ((int, int[])); +extern void check_for_backing_up(int, int[]); /* Check to see if NFA state set constitutes "dangerous" trailing context. */ -extern void check_trailing_context PROTO ((int *, int, int *, int)); +extern void check_trailing_context(int *, int, int *, int); /* Construct the epsilon closure of a set of ndfa states. */ -extern int *epsclosure PROTO ((int *, int *, int[], int *, int *)); +extern int *epsclosure(int *, int *, int[], int *, int *); /* Increase the maximum number of dfas. */ -extern void increase_max_dfas PROTO ((void)); +extern void increase_max_dfas(void); -extern void ntod PROTO ((void)); /* convert a ndfa to a dfa */ +extern void ntod(void); /* convert a ndfa to a dfa */ /* Converts a set of ndfa states into a dfa state. */ -extern int snstods PROTO ((int[], int, int[], int, int, int *)); +extern int snstods(int[], int, int[], int, int, int *); /* from file ecs.c */ /* Convert character classes to set of equivalence classes. */ -extern void ccl2ecl PROTO ((void)); +extern void ccl2ecl(void); /* Associate equivalence class numbers with class members. */ -extern int cre8ecs PROTO ((int[], int[], int)); +extern int cre8ecs(int[], int[], int); /* Update equivalence classes based on character class transitions. */ -extern void mkeccl PROTO ((Char[], int, int[], int[], int, int)); +extern void mkeccl(unsigned char[], int, int[], int[], int, int); /* Create equivalence class for single character. */ -extern void mkechar PROTO ((int, int[], int[])); +extern void mkechar(int, int[], int[]); /* from file gen.c */ -extern void do_indent PROTO ((void)); /* indent to the current level */ +extern void do_indent(void); /* indent to the current level */ /* Generate the code to keep backing-up information. */ -extern void gen_backing_up PROTO ((void)); +extern void gen_backing_up(void); /* Generate the code to perform the backing up. */ -extern void gen_bu_action PROTO ((void)); +extern void gen_bu_action(void); /* Generate full speed compressed transition table. */ -extern void genctbl PROTO ((void)); +extern void genctbl(void); /* Generate the code to find the action number. */ -extern void gen_find_action PROTO ((void)); +extern void gen_find_action(void); -extern void genftbl PROTO ((void)); /* generate full transition table */ +extern void genftbl(void); /* generate full transition table */ /* Generate the code to find the next compressed-table state. */ -extern void gen_next_compressed_state PROTO ((char *)); +extern void gen_next_compressed_state(char *); /* Generate the code to find the next match. */ -extern void gen_next_match PROTO ((void)); +extern void gen_next_match(void); /* Generate the code to find the next state. */ -extern void gen_next_state PROTO ((int)); +extern void gen_next_state(int); /* Generate the code to make a NUL transition. */ -extern void gen_NUL_trans PROTO ((void)); +extern void gen_NUL_trans(void); /* Generate the code to find the start state. */ -extern void gen_start_state PROTO ((void)); +extern void gen_start_state(void); /* Generate data statements for the transition tables. */ -extern void gentabs PROTO ((void)); +extern void gentabs(void); /* Write out a formatted string at the current indentation level. */ -extern void indent_put2s PROTO ((const char *, const char *)); +extern void indent_put2s(const char *, const char *); /* Write out a string + newline at the current indentation level. */ -extern void indent_puts PROTO ((const char *)); +extern void indent_puts(const char *); -extern void make_tables PROTO ((void)); /* generate transition tables */ +extern void make_tables(void); /* generate transition tables */ /* from file main.c */ -extern void check_options PROTO ((void)); -extern void flexend PROTO ((int)); -extern void usage PROTO ((void)); +extern void check_options(void); +extern void flexend(int); +extern void usage(void); /* from file misc.c */ /* Add a #define to the action file. */ -extern void action_define PROTO ((const char *defname, int value)); +extern void action_define(const char *defname, int value); /* Add the given text to the stored actions. */ -extern void add_action PROTO ((const char *new_text)); +extern void add_action(const char *new_text); /* True if a string is all lower case. */ -extern int all_lower PROTO ((register char *)); +extern int all_lower(char *); /* True if a string is all upper case. */ -extern int all_upper PROTO ((register char *)); +extern int all_upper(char *); /* Compare two integers for use by qsort. */ -extern int intcmp PROTO ((const void *, const void *)); +extern int intcmp(const void *, const void *); /* Check a character to make sure it's in the expected range. */ -extern void check_char PROTO ((int c)); +extern void check_char(int c); /* Replace upper-case letter to lower-case. */ -extern Char clower PROTO ((int)); +extern unsigned char clower(int); -/* Returns a dynamically allocated copy of a string. */ -extern char *copy_string PROTO ((register const char *)); - -/* Returns a dynamically allocated copy of a (potentially) unsigned string. */ -extern Char *copy_unsigned_string PROTO ((register Char *)); +/* strdup() that fails fatally on allocation failures. */ +extern char *xstrdup(const char *); /* Compare two characters for use by qsort with '\0' sorting last. */ -extern int cclcmp PROTO ((const void *, const void *)); +extern int cclcmp(const void *, const void *); /* Finish up a block of data declarations. */ -extern void dataend PROTO ((void)); +extern void dataend(void); /* Flush generated data statements. */ -extern void dataflush PROTO ((void)); +extern void dataflush(void); /* Report an error message and terminate. */ -extern void flexerror PROTO ((const char *)); +extern void flexerror(const char *); /* Report a fatal error message and terminate. */ -extern void flexfatal PROTO ((const char *)); +extern void flexfatal(const char *); /* Report a fatal error with a pinpoint, and terminate */ #if HAVE_DECL___FUNC__ @@ -899,203 +845,195 @@ extern void flexfatal PROTO ((const char *)); }while(0) #endif /* ! HAVE_DECL___func__ */ -/* Convert a hexadecimal digit string to an integer value. */ -extern int htoi PROTO ((Char[])); - -/* Report an error message formatted with one integer argument. */ -extern void lerrif PROTO ((const char *, int)); - -/* Report an error message formatted with one string argument. */ -extern void lerrsf PROTO ((const char *, const char *)); +/* Report an error message formatted */ +extern void lerr(const char *, ...) +#if defined(__GNUC__) && __GNUC__ >= 3 + __attribute__((__format__(__printf__, 1, 2))) +#endif +; -/* Like lerrsf, but also exit after displaying message. */ -extern void lerrsf_fatal PROTO ((const char *, const char *)); +/* Like lerr, but also exit after displaying message. */ +extern void lerr_fatal(const char *, ...) +#if defined(__GNUC__) && __GNUC__ >= 3 + __attribute__((__format__(__printf__, 1, 2))) +#endif +; /* Spit out a "#line" statement. */ -extern void line_directive_out PROTO ((FILE *, int)); +extern void line_directive_out(FILE *, int); /* Mark the current position in the action array as the end of the section 1 * user defs. */ -extern void mark_defs1 PROTO ((void)); +extern void mark_defs1(void); /* Mark the current position in the action array as the end of the prolog. */ -extern void mark_prolog PROTO ((void)); +extern void mark_prolog(void); /* Generate a data statment for a two-dimensional array. */ -extern void mk2data PROTO ((int)); +extern void mk2data(int); -extern void mkdata PROTO ((int)); /* generate a data statement */ +extern void mkdata(int); /* generate a data statement */ /* Return the integer represented by a string of digits. */ -extern int myctoi PROTO ((const char *)); +extern int myctoi(const char *); /* Return character corresponding to escape sequence. */ -extern Char myesc PROTO ((Char[])); - -/* Convert an octal digit string to an integer value. */ -extern int otoi PROTO ((Char[])); +extern unsigned char myesc(unsigned char[]); /* Output a (possibly-formatted) string to the generated scanner. */ -extern void out PROTO ((const char *)); -extern void out_dec PROTO ((const char *, int)); -extern void out_dec2 PROTO ((const char *, int, int)); -extern void out_hex PROTO ((const char *, unsigned int)); -extern void out_str PROTO ((const char *, const char *)); -extern void out_str3 -PROTO ((const char *, const char *, const char *, const char *)); -extern void out_str_dec PROTO ((const char *, const char *, int)); -extern void outc PROTO ((int)); -extern void outn PROTO ((const char *)); -extern void out_m4_define (const char* def, const char* val); +extern void out(const char *); +extern void out_dec(const char *, int); +extern void out_dec2(const char *, int, int); +extern void out_hex(const char *, unsigned int); +extern void out_str(const char *, const char *); +extern void out_str3(const char *, const char *, const char *, const char *); +extern void out_str_dec(const char *, const char *, int); +extern void outc(int); +extern void outn(const char *); +extern void out_m4_define(const char* def, const char* val); /* Return a printable version of the given character, which might be * 8-bit. */ -extern char *readable_form PROTO ((int)); +extern char *readable_form(int); /* Write out one section of the skeleton file. */ -extern void skelout PROTO ((void)); +extern void skelout(void); /* Output a yy_trans_info structure. */ -extern void transition_struct_out PROTO ((int, int)); +extern void transition_struct_out(int, int); /* Only needed when using certain broken versions of bison to build parse.c. */ -extern void *yy_flex_xmalloc PROTO ((int)); - -/* Set a region of memory to 0. */ -extern void zero_out PROTO ((char *, size_t)); +extern void *yy_flex_xmalloc(int); /* from file nfa.c */ /* Add an accepting state to a machine. */ -extern void add_accept PROTO ((int, int)); +extern void add_accept(int, int); /* Make a given number of copies of a singleton machine. */ -extern int copysingl PROTO ((int, int)); +extern int copysingl(int, int); /* Debugging routine to write out an nfa. */ -extern void dumpnfa PROTO ((int)); +extern void dumpnfa(int); /* Finish up the processing for a rule. */ -extern void finish_rule PROTO ((int, int, int, int, int)); +extern void finish_rule(int, int, int, int, int); /* Connect two machines together. */ -extern int link_machines PROTO ((int, int)); +extern int link_machines(int, int); /* Mark each "beginning" state in a machine as being a "normal" (i.e., * not trailing context associated) state. */ -extern void mark_beginning_as_normal PROTO ((register int)); +extern void mark_beginning_as_normal(int); /* Make a machine that branches to two machines. */ -extern int mkbranch PROTO ((int, int)); +extern int mkbranch(int, int); -extern int mkclos PROTO ((int)); /* convert a machine into a closure */ -extern int mkopt PROTO ((int)); /* make a machine optional */ +extern int mkclos(int); /* convert a machine into a closure */ +extern int mkopt(int); /* make a machine optional */ /* Make a machine that matches either one of two machines. */ -extern int mkor PROTO ((int, int)); +extern int mkor(int, int); /* Convert a machine into a positive closure. */ -extern int mkposcl PROTO ((int)); +extern int mkposcl(int); -extern int mkrep PROTO ((int, int, int)); /* make a replicated machine */ +extern int mkrep(int, int, int); /* make a replicated machine */ /* Create a state with a transition on a given symbol. */ -extern int mkstate PROTO ((int)); +extern int mkstate(int); -extern void new_rule PROTO ((void)); /* initialize for a new rule */ +extern void new_rule(void); /* initialize for a new rule */ /* from file parse.y */ /* Build the "<<EOF>>" action for the active start conditions. */ -extern void build_eof_action PROTO ((void)); +extern void build_eof_action(void); /* Write out a message formatted with one string, pinpointing its location. */ -extern void format_pinpoint_message PROTO ((const char *, const char *)); +extern void format_pinpoint_message(const char *, const char *); /* Write out a message, pinpointing its location. */ -extern void pinpoint_message PROTO ((const char *)); +extern void pinpoint_message(const char *); /* Write out a warning, pinpointing it at the given line. */ -extern void line_warning PROTO ((const char *, int)); +extern void line_warning(const char *, int); /* Write out a message, pinpointing it at the given line. */ -extern void line_pinpoint PROTO ((const char *, int)); +extern void line_pinpoint(const char *, int); /* Report a formatted syntax error. */ -extern void format_synerr PROTO ((const char *, const char *)); -extern void synerr PROTO ((const char *)); /* report a syntax error */ -extern void format_warn PROTO ((const char *, const char *)); -extern void warn PROTO ((const char *)); /* report a warning */ -extern void yyerror PROTO ((const char *)); /* report a parse error */ -extern int yyparse PROTO ((void)); /* the YACC parser */ +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 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 */ /* The Flex-generated scanner for flex. */ -extern int flexscan PROTO ((void)); +extern int flexscan(void); /* Open the given file (if NULL, stdin) for scanning. */ -extern void set_input_file PROTO ((char *)); - -/* Wrapup a file in the lexical analyzer. */ -extern int yywrap PROTO ((void)); +extern void set_input_file(char *); /* from file sym.c */ /* Save the text of a character class. */ -extern void cclinstal PROTO ((Char[], int)); +extern void cclinstal(char[], int); /* Lookup the number associated with character class. */ -extern int ccllookup PROTO ((Char[])); +extern int ccllookup(char[]); -extern void ndinstal PROTO ((const char *, Char[])); /* install a name definition */ -extern Char *ndlookup PROTO ((const char *)); /* lookup a name definition */ +extern void ndinstal(const char *, char[]); /* install a name definition */ +extern char *ndlookup(const char *); /* lookup a name definition */ /* Increase maximum number of SC's. */ -extern void scextend PROTO ((void)); -extern void scinstal PROTO ((const char *, int)); /* make a start condition */ +extern void scextend(void); +extern void scinstal(const char *, int); /* make a start condition */ /* Lookup the number associated with a start condition. */ -extern int sclookup PROTO ((const char *)); +extern int sclookup(const char *); /* from file tblcmp.c */ /* Build table entries for dfa state. */ -extern void bldtbl PROTO ((int[], int, int, int, int)); +extern void bldtbl(int[], int, int, int, int); -extern void cmptmps PROTO ((void)); /* compress template table entries */ -extern void expand_nxt_chk PROTO ((void)); /* increase nxt/chk arrays */ +extern void cmptmps(void); /* compress template table entries */ +extern void expand_nxt_chk(void); /* increase nxt/chk arrays */ /* Finds a space in the table for a state to be placed. */ -extern int find_table_space PROTO ((int *, int)); -extern void inittbl PROTO ((void)); /* initialize transition tables */ +extern int find_table_space(int *, int); +extern void inittbl(void); /* initialize transition tables */ /* Make the default, "jam" table entries. */ -extern void mkdeftbl PROTO ((void)); +extern void mkdeftbl(void); /* Create table entries for a state (or state fragment) which has * only one out-transition. */ -extern void mk1tbl PROTO ((int, int, int, int)); +extern void mk1tbl(int, int, int, int); /* Place a state into full speed transition table. */ -extern void place_state PROTO ((int *, int, int)); +extern void place_state(int *, int, int); /* Save states with only one out-transition to be processed later. */ -extern void stack1 PROTO ((int, int, int, int)); +extern void stack1(int, int, int, int); /* from file yylex.c */ -extern int yylex PROTO ((void)); +extern int yylex(void); /* A growable array. See buf.c. */ struct Buf { @@ -1105,30 +1043,28 @@ struct Buf { int nmax; /* max capacity of elements. */ }; -extern void buf_init PROTO ((struct Buf * buf, size_t elem_size)); -extern void buf_destroy PROTO ((struct Buf * buf)); -extern struct Buf *buf_append -PROTO ((struct Buf * buf, const void *ptr, int n_elem)); -extern struct Buf *buf_concat PROTO((struct Buf* dest, const struct Buf* src)); -extern struct Buf *buf_strappend PROTO ((struct Buf *, const char *str)); -extern struct Buf *buf_strnappend -PROTO ((struct Buf *, const char *str, int nchars)); -extern struct Buf *buf_strdefine -PROTO ((struct Buf * buf, const char *str, const char *def)); -extern struct Buf *buf_prints PROTO((struct Buf *buf, const char *fmt, const char* s)); -extern struct Buf *buf_m4_define PROTO((struct Buf *buf, const char* def, const char* val)); -extern struct Buf *buf_m4_undefine PROTO((struct Buf *buf, const char* def)); -extern struct Buf *buf_print_strings PROTO((struct Buf * buf, FILE* out)); -extern struct Buf *buf_linedir PROTO((struct Buf *buf, const char* filename, int lineno)); +extern void buf_init(struct Buf * buf, size_t elem_size); +extern void buf_destroy(struct Buf * buf); +extern struct Buf *buf_append(struct Buf * buf, const void *ptr, int n_elem); +extern struct Buf *buf_concat(struct Buf* dest, const struct Buf* src); +extern struct Buf *buf_strappend(struct Buf *, const char *str); +extern struct Buf *buf_strnappend(struct Buf *, const char *str, int nchars); +extern struct Buf *buf_strdefine(struct Buf * buf, const char *str, const char *def); +extern struct Buf *buf_prints(struct Buf *buf, const char *fmt, const char* s); +extern struct Buf *buf_m4_define(struct Buf *buf, const char* def, const char* val); +extern struct Buf *buf_m4_undefine(struct Buf *buf, const char* def); +extern struct Buf *buf_print_strings(struct Buf * buf, FILE* out); +extern struct Buf *buf_linedir(struct Buf *buf, const char* filename, int lineno); extern struct Buf userdef_buf; /* a string buffer for #define's generated by user-options on cmd line. */ extern struct Buf defs_buf; /* a char* buffer to save #define'd some symbols generated by flex. */ extern struct Buf yydmap_buf; /* a string buffer to hold yydmap elements */ extern struct Buf m4defs_buf; /* Holds m4 definitions. */ extern struct Buf top_buf; /* contains %top code. String buffer. */ +extern bool no_section3_escape; /* True if the undocumented option --unsafe-no-m4-sect3-escape was passed */ /* For blocking out code from the header file. */ -#define OUT_BEGIN_CODE() outn("m4_ifdef( [[M4_YY_IN_HEADER]],,[[") +#define OUT_BEGIN_CODE() outn("m4_ifdef( [[M4_YY_IN_HEADER]],,[[m4_dnl") #define OUT_END_CODE() outn("]])") /* For setjmp/longjmp (instead of calling exit(2)). Linkage in main.c */ @@ -1181,14 +1117,14 @@ struct filter { /* output filter chain */ extern struct filter * output_chain; -extern struct filter *filter_create_ext PROTO((struct filter * chain, const char *cmd, ...)); -struct filter *filter_create_int PROTO((struct filter *chain, +extern struct filter *filter_create_ext (struct filter * chain, const char *cmd, ...); +struct filter *filter_create_int(struct filter *chain, int (*filter_func) (struct filter *), - void *extra)); -extern bool filter_apply_chain PROTO((struct filter * chain)); -extern int filter_truncate (struct filter * chain, int max_len); -extern int filter_tee_header PROTO((struct filter *chain)); -extern int filter_fix_linedirs PROTO((struct filter *chain)); + void *extra); +extern bool filter_apply_chain(struct filter * chain); +extern int filter_truncate(struct filter * chain, int max_len); +extern int filter_tee_header(struct filter *chain); +extern int filter_fix_linedirs(struct filter *chain); /* @@ -1208,9 +1144,9 @@ bool regmatch_empty (regmatch_t * m); typedef unsigned int scanflags_t; extern scanflags_t* _sf_stk; extern size_t _sf_top_ix, _sf_max; /**< stack of scanner flags. */ -#define _SF_CASE_INS 0x0001 -#define _SF_DOT_ALL 0x0002 -#define _SF_SKIP_WS 0x0004 +#define _SF_CASE_INS ((scanflags_t) 0x0001) +#define _SF_DOT_ALL ((scanflags_t) 0x0002) +#define _SF_SKIP_WS ((scanflags_t) 0x0004) #define sf_top() (_sf_stk[_sf_top_ix]) #define sf_case_ins() (sf_top() & _SF_CASE_INS) #define sf_dot_all() (sf_top() & _SF_DOT_ALL) diff --git a/flexint.h b/src/flexint.h index f9fa80c..43bb3a8 100644 --- a/flexint.h +++ b/src/flexint.h @@ -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 */ @@ -37,16 +37,11 @@ /* declare functions that have forward references */ -void gen_next_state PROTO ((int)); -void genecs PROTO ((void)); -void indent_put2s PROTO ((const char *, const char *)); -void indent_puts PROTO ((const char *)); +void genecs(void); static int indent_level = 0; /* each level is 8 spaces */ -#define indent_up() (++indent_level) -#define indent_down() (--indent_level) #define set_indent(indent_val) indent_level = indent_val /* Almost everything is done in terms of arrays starting at 1, so provide @@ -58,30 +53,37 @@ static int indent_level = 0; /* each level is 8 spaces */ static const char *get_int16_decl (void) { return (gentables) - ? "static yyconst flex_int16_t %s[%d] =\n { 0,\n" - : "static yyconst flex_int16_t * %s = 0;\n"; + ? "static const flex_int16_t %s[%d] =\n { 0,\n" + : "static const flex_int16_t * %s = 0;\n"; } static const char *get_int32_decl (void) { return (gentables) - ? "static yyconst flex_int32_t %s[%d] =\n { 0,\n" - : "static yyconst flex_int32_t * %s = 0;\n"; + ? "static const flex_int32_t %s[%d] =\n { 0,\n" + : "static const flex_int32_t * %s = 0;\n"; } static const char *get_state_decl (void) { return (gentables) - ? "static yyconst yy_state_type %s[%d] =\n { 0,\n" - : "static yyconst yy_state_type * %s = 0;\n"; + ? "static const yy_state_type %s[%d] =\n { 0,\n" + : "static const yy_state_type * %s = 0;\n"; +} + +static const char *get_yy_char_decl (void) +{ + return (gentables) + ? "static const YY_CHAR %s[%d] =\n { 0,\n" + : "static const YY_CHAR * %s = 0;\n"; } /* Indent to the current level. */ -void do_indent () +void do_indent (void) { - register int i = indent_level * 8; + int i = indent_level * 8; while (i >= 8) { outc ('\t'); @@ -104,12 +106,12 @@ static struct yytbl_data *mkeoltbl (void) flex_int8_t *tdata = 0; struct yytbl_data *tbl; - tbl = (struct yytbl_data *) calloc (1, sizeof (struct yytbl_data)); + tbl = calloc(1, sizeof (struct yytbl_data)); yytbl_data_init (tbl, YYTD_ID_RULE_CAN_MATCH_EOL); tbl->td_flags = YYTD_DATA8; - tbl->td_lolen = num_rules + 1; + tbl->td_lolen = (flex_uint32_t) (num_rules + 1); tbl->td_data = tdata = - (flex_int8_t *) calloc (tbl->td_lolen, sizeof (flex_int8_t)); + calloc(tbl->td_lolen, sizeof (flex_int8_t)); for (i = 1; i <= num_rules; i++) tdata[i] = rule_has_nl[i] ? 1 : 0; @@ -121,7 +123,7 @@ static struct yytbl_data *mkeoltbl (void) } /* Generate the table for possible eol matches. */ -static void geneoltbl () +static void geneoltbl (void) { int i; @@ -145,7 +147,7 @@ static void geneoltbl () /* Generate the code to keep backing-up information. */ -void gen_backing_up () +void gen_backing_up (void) { if (reject || num_backing_up == 0) return; @@ -155,18 +157,18 @@ void gen_backing_up () else indent_puts ("if ( yy_accept[yy_current_state] )"); - indent_up (); + ++indent_level; indent_puts ("{"); indent_puts ("YY_G(yy_last_accepting_state) = yy_current_state;"); indent_puts ("YY_G(yy_last_accepting_cpos) = yy_cp;"); indent_puts ("}"); - indent_down (); + --indent_level; } /* Generate the code to perform the backing up. */ -void gen_bu_action () +void gen_bu_action (void) { if (reject || num_backing_up == 0) return; @@ -201,7 +203,7 @@ void gen_bu_action () static struct yytbl_data *mkctbl (void) { - register int i; + int i; struct yytbl_data *tbl = 0; flex_int32_t *tdata = 0, curr = 0; int end_of_buffer_action = num_rules + 1; @@ -211,14 +213,14 @@ static struct yytbl_data *mkctbl (void) ((tblend + numecs + 1) >= INT16_MAX || long_align) ? "flex_int32_t" : "flex_int16_t"); - tbl = (struct yytbl_data *) calloc (1, sizeof (struct yytbl_data)); + tbl = calloc(1, sizeof (struct yytbl_data)); yytbl_data_init (tbl, YYTD_ID_TRANSITION); tbl->td_flags = YYTD_DATA32 | YYTD_STRUCT; tbl->td_hilen = 0; - tbl->td_lolen = tblend + numecs + 1; /* number of structs */ + tbl->td_lolen = (flex_uint32_t) (tblend + numecs + 1); /* number of structs */ tbl->td_data = tdata = - (flex_int32_t *) calloc (tbl->td_lolen * 2, sizeof (flex_int32_t)); + calloc(tbl->td_lolen * 2, sizeof (flex_int32_t)); /* We want the transition to be represented as the offset to the * next state, not the actual state number, which is what it currently @@ -307,14 +309,14 @@ static struct yytbl_data *mkssltbl (void) flex_int32_t *tdata = 0; flex_int32_t i; - tbl = (struct yytbl_data *) calloc (1, sizeof (struct yytbl_data)); + tbl = calloc(1, sizeof (struct yytbl_data)); yytbl_data_init (tbl, YYTD_ID_START_STATE_LIST); tbl->td_flags = YYTD_DATA32 | YYTD_PTRANS; tbl->td_hilen = 0; - tbl->td_lolen = lastsc * 2 + 1; + tbl->td_lolen = (flex_uint32_t) (lastsc * 2 + 1); tbl->td_data = tdata = - (flex_int32_t *) calloc (tbl->td_lolen, sizeof (flex_int32_t)); + calloc(tbl->td_lolen, sizeof (flex_int32_t)); for (i = 0; i <= lastsc * 2; ++i) tdata[i] = base[i]; @@ -330,16 +332,16 @@ static struct yytbl_data *mkssltbl (void) /* genctbl - generates full speed compressed transition table */ -void genctbl () +void genctbl (void) { - register int i; + int i; int end_of_buffer_action = num_rules + 1; /* Table of verify for transition and offset to next state. */ if (gentables) - out_dec ("static yyconst struct yy_trans_info yy_transition[%d] =\n {\n", tblend + numecs + 1); + out_dec ("static const struct yy_trans_info yy_transition[%d] =\n {\n", tblend + numecs + 1); else - outn ("static yyconst struct yy_trans_info *yy_transition = 0;"); + outn ("static const struct yy_trans_info *yy_transition = 0;"); /* We want the transition to be represented as the offset to the * next state, not the actual state number, which is what it currently @@ -411,9 +413,9 @@ void genctbl () /* Table of pointers to start states. */ if (gentables) - out_dec ("static yyconst struct yy_trans_info *yy_start_state_list[%d] =\n", lastsc * 2 + 1); + out_dec ("static const struct yy_trans_info *yy_start_state_list[%d] =\n", lastsc * 2 + 1); else - outn ("static yyconst struct yy_trans_info **yy_start_state_list =0;"); + outn ("static const struct yy_trans_info **yy_start_state_list =0;"); if (gentables) { outn (" {"); @@ -431,20 +433,20 @@ void genctbl () /* mkecstbl - Make equivalence-class tables. */ -struct yytbl_data *mkecstbl (void) +static struct yytbl_data *mkecstbl (void) { - register int i; + int i; struct yytbl_data *tbl = 0; flex_int32_t *tdata = 0; - tbl = (struct yytbl_data *) calloc (1, sizeof (struct yytbl_data)); + tbl = calloc(1, sizeof (struct yytbl_data)); yytbl_data_init (tbl, YYTD_ID_EC); tbl->td_flags |= YYTD_DATA32; tbl->td_hilen = 0; - tbl->td_lolen = csize; + tbl->td_lolen = (flex_uint32_t) csize; tbl->td_data = tdata = - (flex_int32_t *) calloc (tbl->td_lolen, sizeof (flex_int32_t)); + calloc(tbl->td_lolen, sizeof (flex_int32_t)); for (i = 1; i < csize; ++i) { ecgroup[i] = ABS (ecgroup[i]); @@ -453,19 +455,19 @@ struct yytbl_data *mkecstbl (void) buf_prints (&yydmap_buf, "\t{YYTD_ID_EC, (void**)&yy_ec, sizeof(%s)},\n", - "flex_int32_t"); + "YY_CHAR"); return tbl; } /* Generate equivalence-class tables. */ -void genecs () +void genecs (void) { - register int i, j; + int i, j; int numrows; - out_str_dec (get_int32_decl (), "yy_ec", csize); + out_str_dec (get_yy_char_decl (), "yy_ec", csize); for (i = 1; i < csize; ++i) { ecgroup[i] = ABS (ecgroup[i]); @@ -495,7 +497,7 @@ void genecs () /* Generate the code to find the action number. */ -void gen_find_action () +void gen_find_action (void) { if (fullspd) indent_puts ("yy_act = yy_current_state[-1].yy_nxt;"); @@ -507,18 +509,23 @@ void gen_find_action () indent_puts ("yy_current_state = *--YY_G(yy_state_ptr);"); indent_puts ("YY_G(yy_lp) = yy_accept[yy_current_state];"); - outn ("find_rule: /* we branch to this label when backing up */"); + 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 */"); - indent_up (); + ++indent_level; indent_puts ("{"); indent_puts ("if ( YY_G(yy_lp) && YY_G(yy_lp) < yy_accept[yy_current_state + 1] )"); - indent_up (); + ++indent_level; indent_puts ("{"); indent_puts ("yy_act = yy_acclist[YY_G(yy_lp)];"); @@ -526,25 +533,25 @@ void gen_find_action () indent_puts ("if ( yy_act & YY_TRAILING_HEAD_MASK ||"); indent_puts (" YY_G(yy_looking_for_trail_begin) )"); - indent_up (); + ++indent_level; indent_puts ("{"); indent_puts ("if ( yy_act == YY_G(yy_looking_for_trail_begin) )"); - indent_up (); + ++indent_level; indent_puts ("{"); indent_puts ("YY_G(yy_looking_for_trail_begin) = 0;"); indent_puts ("yy_act &= ~YY_TRAILING_HEAD_MASK;"); indent_puts ("break;"); indent_puts ("}"); - indent_down (); + --indent_level; indent_puts ("}"); - indent_down (); + --indent_level; indent_puts ("else if ( yy_act & YY_TRAILING_MASK )"); - indent_up (); + ++indent_level; indent_puts ("{"); indent_puts ("YY_G(yy_looking_for_trail_begin) = yy_act & ~YY_TRAILING_MASK;"); @@ -563,10 +570,10 @@ void gen_find_action () } indent_puts ("}"); - indent_down (); + --indent_level; indent_puts ("else"); - indent_up (); + ++indent_level; indent_puts ("{"); indent_puts ("YY_G(yy_full_match) = yy_cp;"); indent_puts @@ -574,7 +581,7 @@ void gen_find_action () indent_puts ("YY_G(yy_full_lp) = YY_G(yy_lp);"); indent_puts ("break;"); indent_puts ("}"); - indent_down (); + --indent_level; indent_puts ("++YY_G(yy_lp);"); indent_puts ("goto find_rule;"); @@ -584,16 +591,16 @@ void gen_find_action () /* Remember matched text in case we back up due to * trailing context plus REJECT. */ - indent_up (); + ++indent_level; indent_puts ("{"); indent_puts ("YY_G(yy_full_match) = yy_cp;"); indent_puts ("break;"); indent_puts ("}"); - indent_down (); + --indent_level; } indent_puts ("}"); - indent_down (); + --indent_level; indent_puts ("--yy_cp;"); @@ -606,7 +613,7 @@ void gen_find_action () indent_puts ("}"); - indent_down (); + --indent_level; } else { /* compressed */ @@ -617,7 +624,7 @@ void gen_find_action () * the match. */ indent_puts ("if ( yy_act == 0 )"); - indent_up (); + ++indent_level; indent_puts ("{ /* have to back up */"); indent_puts ("yy_cp = YY_G(yy_last_accepting_cpos);"); @@ -626,7 +633,7 @@ void gen_find_action () indent_puts ("yy_act = yy_accept[yy_current_state];"); indent_puts ("}"); - indent_down (); + --indent_level; } } } @@ -637,24 +644,24 @@ void gen_find_action () struct yytbl_data *mkftbl (void) { - register int i; + int i; int end_of_buffer_action = num_rules + 1; struct yytbl_data *tbl; flex_int32_t *tdata = 0; - tbl = (struct yytbl_data *) calloc (1, sizeof (struct yytbl_data)); + tbl = calloc(1, sizeof (struct yytbl_data)); yytbl_data_init (tbl, YYTD_ID_ACCEPT); tbl->td_flags |= YYTD_DATA32; tbl->td_hilen = 0; /* it's a one-dimensional array */ - tbl->td_lolen = lastdfa + 1; + tbl->td_lolen = (flex_uint32_t) (lastdfa + 1); tbl->td_data = tdata = - (flex_int32_t *) calloc (tbl->td_lolen, sizeof (flex_int32_t)); + calloc(tbl->td_lolen, sizeof (flex_int32_t)); dfaacc[end_of_buffer_state].dfaacc_state = end_of_buffer_action; for (i = 1; i <= lastdfa; ++i) { - register int anum = dfaacc[i].dfaacc_state; + int anum = dfaacc[i].dfaacc_state; tdata[i] = anum; @@ -672,9 +679,9 @@ struct yytbl_data *mkftbl (void) /* genftbl - generate full transition table */ -void genftbl () +void genftbl (void) { - register int i; + int i; int end_of_buffer_action = num_rules + 1; out_str_dec (long_align ? get_int32_decl () : get_int16_decl (), @@ -683,7 +690,7 @@ void genftbl () dfaacc[end_of_buffer_state].dfaacc_state = end_of_buffer_action; for (i = 1; i <= lastdfa; ++i) { - register int anum = dfaacc[i].dfaacc_state; + int anum = dfaacc[i].dfaacc_state; mkdata (anum); @@ -705,10 +712,9 @@ void genftbl () /* Generate the code to find the next compressed-table state. */ -void gen_next_compressed_state (char_map) - char *char_map; +void gen_next_compressed_state (char *char_map) { - indent_put2s ("register YY_CHAR yy_c = %s;", char_map); + indent_put2s ("YY_CHAR yy_c = %s;", char_map); /* Save the backing-up info \before/ computing the next state * because we always compute one more state than needed - we @@ -718,7 +724,7 @@ void gen_next_compressed_state (char_map) indent_puts ("while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )"); - indent_up (); + ++indent_level; indent_puts ("{"); indent_puts ("yy_current_state = (int) yy_def[yy_current_state];"); @@ -735,22 +741,22 @@ void gen_next_compressed_state (char_map) /* lastdfa + 2 is the beginning of the templates */ out_dec ("if ( yy_current_state >= %d )\n", lastdfa + 2); - indent_up (); - indent_puts ("yy_c = yy_meta[(unsigned int) yy_c];"); - indent_down (); + ++indent_level; + indent_puts ("yy_c = yy_meta[yy_c];"); + --indent_level; } indent_puts ("}"); - indent_down (); + --indent_level; indent_puts - ("yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];"); + ("yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];"); } /* Generate the code to find the next match. */ -void gen_next_match () +void gen_next_match (void) { /* NOTE - changes in here should be reflected in gen_next_state() and * gen_NUL_trans(). @@ -771,7 +777,7 @@ void gen_next_match () ("while ( (yy_current_state = yy_nxt[yy_current_state*YY_NXT_LOLEN + %s ]) > 0 )", char_map); - indent_up (); + ++indent_level; if (num_backing_up > 0) { indent_puts ("{"); @@ -785,7 +791,7 @@ void gen_next_match () indent_puts ("}"); - indent_down (); + --indent_level; outc ('\n'); indent_puts ("yy_current_state = -yy_current_state;"); @@ -794,15 +800,15 @@ void gen_next_match () else if (fullspd) { indent_puts ("{"); indent_puts - ("register yyconst struct yy_trans_info *yy_trans_info;\n"); - indent_puts ("register YY_CHAR yy_c;\n"); + ("const struct yy_trans_info *yy_trans_info;\n"); + indent_puts ("YY_CHAR yy_c;\n"); indent_put2s ("for ( yy_c = %s;", char_map); indent_puts - (" (yy_trans_info = &yy_current_state[(unsigned int) yy_c])->"); + (" (yy_trans_info = &yy_current_state[yy_c])->"); indent_puts ("yy_verify == yy_c;"); indent_put2s (" yy_c = %s )", char_map_2); - indent_up (); + ++indent_level; if (num_backing_up > 0) indent_puts ("{"); @@ -815,14 +821,14 @@ void gen_next_match () indent_puts ("}"); } - indent_down (); + --indent_level; indent_puts ("}"); } else { /* compressed */ indent_puts ("do"); - indent_up (); + ++indent_level; indent_puts ("{"); gen_next_state (false); @@ -831,7 +837,7 @@ void gen_next_match () indent_puts ("}"); - indent_down (); + --indent_level; do_indent (); @@ -856,8 +862,7 @@ void gen_next_match () /* Generate the code to find the next state. */ -void gen_next_state (worry_about_NULs) - int worry_about_NULs; +void gen_next_state (int worry_about_NULs) { /* NOTE - changes in here should be reflected in gen_next_match() */ char char_map[256]; @@ -883,7 +888,7 @@ void gen_next_state (worry_about_NULs) gen_backing_up (); indent_puts ("if ( *yy_cp )"); - indent_up (); + ++indent_level; indent_puts ("{"); } @@ -909,12 +914,12 @@ void gen_next_state (worry_about_NULs) if (worry_about_NULs && nultrans) { indent_puts ("}"); - indent_down (); + --indent_level; indent_puts ("else"); - indent_up (); + ++indent_level; indent_puts ("yy_current_state = yy_NUL_trans[yy_current_state];"); - indent_down (); + --indent_level; } if (fullspd || fulltbl) @@ -927,7 +932,7 @@ void gen_next_state (worry_about_NULs) /* Generate the code to make a NUL transition. */ -void gen_NUL_trans () +void gen_NUL_trans (void) { /* NOTE - changes in here should be reflected in gen_next_match() */ /* Only generate a definition for "yy_cp" if we'll generate code * that uses it. Otherwise lint and the like complain. @@ -938,7 +943,7 @@ void gen_NUL_trans () /* We're going to need yy_cp lying around for the call * below to gen_backing_up(). */ - indent_puts ("register char *yy_cp = YY_G(yy_c_buf_p);"); + indent_puts ("char *yy_cp = YY_G(yy_c_buf_p);"); outc ('\n'); @@ -959,10 +964,10 @@ void gen_NUL_trans () else if (fullspd) { do_indent (); - out_dec ("register int yy_c = %d;\n", NUL_ec); + out_dec ("int yy_c = %d;\n", NUL_ec); indent_puts - ("register yyconst struct yy_trans_info *yy_trans_info;\n"); + ("const struct yy_trans_info *yy_trans_info;\n"); indent_puts ("yy_trans_info = &yy_current_state[(unsigned int) yy_c];"); indent_puts ("yy_current_state += yy_trans_info->yy_nxt;"); @@ -987,10 +992,10 @@ void gen_NUL_trans () * the state stack and yy_c_buf_p get out of sync. */ indent_puts ("if ( ! yy_is_jam )"); - indent_up (); + ++indent_level; indent_puts ("*YY_G(yy_state_ptr)++ = yy_current_state;"); - indent_down (); + --indent_level; } } @@ -1001,18 +1006,18 @@ void gen_NUL_trans () if (need_backing_up && (fullspd || fulltbl)) { outc ('\n'); indent_puts ("if ( ! yy_is_jam )"); - indent_up (); + ++indent_level; indent_puts ("{"); gen_backing_up (); indent_puts ("}"); - indent_down (); + --indent_level; } } /* Generate the code to find the start state. */ -void gen_start_state () +void gen_start_state (void) { if (fullspd) { if (bol_needed) { @@ -1045,7 +1050,7 @@ void gen_start_state () /* gentabs - generate data statements for the transition tables */ -void gentabs () +void gentabs (void) { int i, j, k, *accset, nacc, *acc_array, total_states; int end_of_buffer_action = num_rules + 1; @@ -1089,11 +1094,11 @@ void gentabs () "\t{YYTD_ID_ACCLIST, (void**)&yy_acclist, sizeof(%s)},\n", long_align ? "flex_int32_t" : "flex_int16_t"); - yyacclist_tbl = (struct yytbl_data*)calloc(1,sizeof(struct yytbl_data)); + yyacclist_tbl = calloc(1,sizeof(struct yytbl_data)); yytbl_data_init (yyacclist_tbl, YYTD_ID_ACCLIST); - yyacclist_tbl->td_lolen = MAX(numas,1) + 1; + yyacclist_tbl->td_lolen = (flex_uint32_t) (MAX(numas,1) + 1); yyacclist_tbl->td_data = yyacclist_data = - (flex_int32_t *) calloc (yyacclist_tbl->td_lolen, sizeof (flex_int32_t)); + calloc(yyacclist_tbl->td_lolen, sizeof (flex_int32_t)); yyacclist_curr = 1; j = 1; /* index into "yy_acclist" array */ @@ -1198,13 +1203,11 @@ void gentabs () "\t{YYTD_ID_ACCEPT, (void**)&yy_accept, sizeof(%s)},\n", long_align ? "flex_int32_t" : "flex_int16_t"); - yyacc_tbl = - (struct yytbl_data *) calloc (1, - sizeof (struct yytbl_data)); + yyacc_tbl = calloc(1, sizeof (struct yytbl_data)); yytbl_data_init (yyacc_tbl, YYTD_ID_ACCEPT); - yyacc_tbl->td_lolen = k; + yyacc_tbl->td_lolen = (flex_uint32_t) k; yyacc_tbl->td_data = yyacc_data = - (flex_int32_t *) calloc (yyacc_tbl->td_lolen, sizeof (flex_int32_t)); + calloc(yyacc_tbl->td_lolen, sizeof (flex_int32_t)); yyacc_curr=1; for (i = 1; i <= lastdfa; ++i) { @@ -1257,24 +1260,21 @@ void gentabs () * templates with). */ flex_int32_t *yymecs_data = 0; - yymeta_tbl = - (struct yytbl_data *) calloc (1, - sizeof (struct - yytbl_data)); + yymeta_tbl = calloc(1, sizeof (struct yytbl_data)); yytbl_data_init (yymeta_tbl, YYTD_ID_META); - yymeta_tbl->td_lolen = numecs + 1; + yymeta_tbl->td_lolen = (flex_uint32_t) (numecs + 1); yymeta_tbl->td_data = yymecs_data = - (flex_int32_t *) calloc (yymeta_tbl->td_lolen, + calloc(yymeta_tbl->td_lolen, sizeof (flex_int32_t)); if (trace) fputs (_("\n\nMeta-Equivalence Classes:\n"), stderr); - out_str_dec (get_int32_decl (), "yy_meta", numecs + 1); + out_str_dec (get_yy_char_decl (), "yy_meta", numecs + 1); buf_prints (&yydmap_buf, "\t{YYTD_ID_META, (void**)&yy_meta, sizeof(%s)},\n", - "flex_int32_t"); + "YY_CHAR"); for (i = 1; i <= numecs; ++i) { if (trace) @@ -1308,18 +1308,16 @@ void gentabs () "\t{YYTD_ID_BASE, (void**)&yy_base, sizeof(%s)},\n", (tblend >= INT16_MAX || long_align) ? "flex_int32_t" : "flex_int16_t"); - yybase_tbl = - (struct yytbl_data *) calloc (1, - sizeof (struct yytbl_data)); + yybase_tbl = calloc (1, sizeof (struct yytbl_data)); yytbl_data_init (yybase_tbl, YYTD_ID_BASE); - yybase_tbl->td_lolen = total_states + 1; + yybase_tbl->td_lolen = (flex_uint32_t) (total_states + 1); yybase_tbl->td_data = yybase_data = - (flex_int32_t *) calloc (yybase_tbl->td_lolen, + calloc(yybase_tbl->td_lolen, sizeof (flex_int32_t)); yybase_curr = 1; for (i = 1; i <= lastdfa; ++i) { - register int d = def[i]; + int d = def[i]; if (base[i] == JAMSTATE) base[i] = jambase; @@ -1368,13 +1366,11 @@ void gentabs () (total_states >= INT16_MAX || long_align) ? "flex_int32_t" : "flex_int16_t"); - yydef_tbl = - (struct yytbl_data *) calloc (1, - sizeof (struct yytbl_data)); + yydef_tbl = calloc(1, sizeof (struct yytbl_data)); yytbl_data_init (yydef_tbl, YYTD_ID_DEF); - yydef_tbl->td_lolen = total_states + 1; + yydef_tbl->td_lolen = (flex_uint32_t) (total_states + 1); yydef_tbl->td_data = yydef_data = - (flex_int32_t *) calloc (yydef_tbl->td_lolen, sizeof (flex_int32_t)); + calloc(yydef_tbl->td_lolen, sizeof (flex_int32_t)); for (i = 1; i <= total_states; ++i) { mkdata (def[i]); @@ -1402,13 +1398,11 @@ void gentabs () (total_states >= INT16_MAX || long_align) ? "flex_int32_t" : "flex_int16_t"); - yynxt_tbl = - (struct yytbl_data *) calloc (1, - sizeof (struct yytbl_data)); + yynxt_tbl = calloc (1, sizeof (struct yytbl_data)); yytbl_data_init (yynxt_tbl, YYTD_ID_NXT); - yynxt_tbl->td_lolen = tblend + 1; + yynxt_tbl->td_lolen = (flex_uint32_t) (tblend + 1); yynxt_tbl->td_data = yynxt_data = - (flex_int32_t *) calloc (yynxt_tbl->td_lolen, sizeof (flex_int32_t)); + calloc (yynxt_tbl->td_lolen, sizeof (flex_int32_t)); for (i = 1; i <= tblend; ++i) { /* Note, the order of the following test is important. @@ -1441,13 +1435,11 @@ void gentabs () (total_states >= INT16_MAX || long_align) ? "flex_int32_t" : "flex_int16_t"); - yychk_tbl = - (struct yytbl_data *) calloc (1, - sizeof (struct yytbl_data)); + yychk_tbl = calloc (1, sizeof (struct yytbl_data)); yytbl_data_init (yychk_tbl, YYTD_ID_CHK); - yychk_tbl->td_lolen = tblend + 1; + yychk_tbl->td_lolen = (flex_uint32_t) (tblend + 1); yychk_tbl->td_data = yychk_data = - (flex_int32_t *) calloc (yychk_tbl->td_lolen, sizeof (flex_int32_t)); + calloc(yychk_tbl->td_lolen, sizeof (flex_int32_t)); for (i = 1; i <= tblend; ++i) { if (chk[i] == 0) @@ -1467,7 +1459,7 @@ void gentabs () } /* End generating yy_chk */ - flex_free ((void *) acc_array); + free(acc_array); } @@ -1475,8 +1467,7 @@ void gentabs () * current indentation level, adding a final newline. */ -void indent_put2s (fmt, arg) - const char *fmt, *arg; +void indent_put2s (const char *fmt, const char *arg) { do_indent (); out_str (fmt, arg); @@ -1488,8 +1479,7 @@ void indent_put2s (fmt, arg) * newline. */ -void indent_puts (str) - const char *str; +void indent_puts (const char *str) { do_indent (); outn (str); @@ -1499,11 +1489,11 @@ void indent_puts (str) /* make_tables - generate transition tables and finishes generating output file */ -void make_tables () +void make_tables (void) { - register int i; - int did_eof_rule = false; - struct yytbl_data *yynultrans_tbl; + int i; + int did_eof_rule = false; + struct yytbl_data *yynultrans_tbl = NULL; skelout (); /* %% [2.0] - break point in skel */ @@ -1516,11 +1506,11 @@ void make_tables () if (yymore_used && !yytext_is_array) { indent_puts ("YY_G(yytext_ptr) -= YY_G(yy_more_len); \\"); indent_puts - ("yyleng = (size_t) (yy_cp - YY_G(yytext_ptr)); \\"); + ("yyleng = (int) (yy_cp - YY_G(yytext_ptr)); \\"); } else - indent_puts ("yyleng = (size_t) (yy_cp - yy_bp); \\"); + indent_puts ("yyleng = (int) (yy_cp - yy_bp); \\"); /* Now also deal with copying yytext_ptr to yytext if needed. */ skelout (); /* %% [3.0] - break point in skel */ @@ -1531,10 +1521,10 @@ void make_tables () else indent_puts ("if ( yyleng >= YYLMAX ) \\"); - indent_up (); + ++indent_level; indent_puts ("YY_FATAL_ERROR( \"token too large, exceeds YYLMAX\" ); \\"); - indent_down (); + --indent_level; if (yymore_used) { indent_puts @@ -1571,7 +1561,7 @@ void make_tables () set_indent (0); indent_puts ("struct yy_trans_info"); - indent_up (); + ++indent_level; indent_puts ("{"); /* We require that yy_verify and yy_nxt must be of the same size int. */ @@ -1587,7 +1577,7 @@ void make_tables () indent_put2s ("%s yy_nxt;", trans_offset_type); indent_puts ("};"); - indent_down (); + --indent_level; } else { /* We generate a bogus 'struct yy_trans_info' data type @@ -1599,12 +1589,12 @@ void make_tables () ("/* This struct is not used in this scanner,"); indent_puts (" but its presence is necessary. */"); indent_puts ("struct yy_trans_info"); - indent_up (); + ++indent_level; indent_puts ("{"); indent_puts ("flex_int32_t yy_verify;"); indent_puts ("flex_int32_t yy_nxt;"); indent_puts ("};"); - indent_down (); + --indent_level; } if (fullspd) { @@ -1702,16 +1692,13 @@ void make_tables () (fullspd) ? "struct yy_trans_info*" : "flex_int32_t"); - yynultrans_tbl = - (struct yytbl_data *) calloc (1, - sizeof (struct - yytbl_data)); + yynultrans_tbl = calloc(1, sizeof (struct yytbl_data)); yytbl_data_init (yynultrans_tbl, YYTD_ID_NUL_TRANS); if (fullspd) yynultrans_tbl->td_flags |= YYTD_PTRANS; - yynultrans_tbl->td_lolen = lastdfa + 1; + yynultrans_tbl->td_lolen = (flex_uint32_t) (lastdfa + 1); yynultrans_tbl->td_data = yynultrans_data = - (flex_int32_t *) calloc (yynultrans_tbl->td_lolen, + calloc(yynultrans_tbl->td_lolen, sizeof (flex_int32_t)); for (i = 1; i <= lastdfa; ++i) { @@ -1733,9 +1720,13 @@ void make_tables () 0) flexerror (_ ("Could not write yynultrans_tbl")); + } + + if (yynultrans_tbl != NULL) { yytbl_data_destroy (yynultrans_tbl); yynultrans_tbl = NULL; - } + } + /* End generating yy_NUL_trans */ } @@ -1824,13 +1815,13 @@ void make_tables () indent_puts ("#define YY_MORE_ADJ 0"); indent_puts ("#define YY_RESTORE_YY_MORE_OFFSET \\"); - indent_up (); + ++indent_level; indent_puts ("{ \\"); indent_puts ("YY_G(yy_more_offset) = YY_G(yy_prev_more_offset); \\"); indent_puts ("yyleng -= YY_G(yy_more_offset); \\"); indent_puts ("}"); - indent_down (); + --indent_level; } else { indent_puts @@ -1874,7 +1865,7 @@ void make_tables () if (!C_plus_plus) { if (use_read) { outn ("\terrno=0; \\"); - outn ("\twhile ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \\"); + outn ("\twhile ( (result = (int) read( fileno(yyin), buf, (yy_size_t) max_size )) < 0 ) \\"); outn ("\t{ \\"); outn ("\t\tif( errno != EINTR) \\"); outn ("\t\t{ \\"); @@ -1890,7 +1881,7 @@ void make_tables () outn ("\tif ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \\"); outn ("\t\t{ \\"); outn ("\t\tint c = '*'; \\"); - outn ("\t\tsize_t n; \\"); + outn ("\t\tint n; \\"); outn ("\t\tfor ( n = 0; n < max_size && \\"); outn ("\t\t\t (c = getc( yyin )) != EOF && c != '\\n'; ++n ) \\"); outn ("\t\t\tbuf[n] = (char) c; \\"); @@ -1903,7 +1894,7 @@ void make_tables () outn ("\telse \\"); outn ("\t\t{ \\"); outn ("\t\terrno=0; \\"); - outn ("\t\twhile ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \\"); + outn ("\t\twhile ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \\"); outn ("\t\t\t{ \\"); outn ("\t\t\tif( errno != EINTR) \\"); outn ("\t\t\t\t{ \\"); @@ -1920,16 +1911,16 @@ void make_tables () skelout (); /* %% [6.0] - break point in skel */ indent_puts ("#define YY_RULE_SETUP \\"); - indent_up (); + ++indent_level; if (bol_needed) { indent_puts ("if ( yyleng > 0 ) \\"); - indent_up (); + ++indent_level; indent_puts ("YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \\"); indent_puts ("\t\t(yytext[yyleng - 1] == '\\n'); \\"); - indent_down (); + --indent_level; } indent_puts ("YY_USER_ACTION"); - indent_down (); + --indent_level; skelout (); /* %% [7.0] - break point in skel */ @@ -1945,13 +1936,13 @@ void make_tables () if (yymore_used && !yytext_is_array) { indent_puts ("YY_G(yy_more_len) = 0;"); indent_puts ("if ( YY_G(yy_more_flag) )"); - indent_up (); + ++indent_level; indent_puts ("{"); indent_puts - ("YY_G(yy_more_len) = YY_G(yy_c_buf_p) - YY_G(yytext_ptr);"); + ("YY_G(yy_more_len) = (int) (YY_G(yy_c_buf_p) - YY_G(yytext_ptr));"); indent_puts ("YY_G(yy_more_flag) = 0;"); indent_puts ("}"); - indent_down (); + --indent_level; } skelout (); /* %% [9.0] - break point in skel */ @@ -1970,39 +1961,39 @@ void make_tables () outn ("m4_ifdef( [[M4_YY_USE_LINENO]],[["); indent_puts ("if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )"); - indent_up (); + ++indent_level; indent_puts ("{"); - indent_puts ("yy_size_t yyl;"); + indent_puts ("int yyl;"); do_indent (); out_str ("for ( yyl = %s; yyl < yyleng; ++yyl )\n", yymore_used ? (yytext_is_array ? "YY_G(yy_prev_more_offset)" : "YY_G(yy_more_len)") : "0"); - indent_up (); + ++indent_level; indent_puts ("if ( yytext[yyl] == '\\n' )"); - indent_up (); + ++indent_level; indent_puts ("M4_YY_INCR_LINENO();"); - indent_down (); - indent_down (); + --indent_level; + --indent_level; indent_puts ("}"); - indent_down (); + --indent_level; outn ("]])"); skelout (); /* %% [12.0] - break point in skel */ if (ddebug) { indent_puts ("if ( yy_flex_debug )"); - indent_up (); + ++indent_level; indent_puts ("{"); indent_puts ("if ( yy_act == 0 )"); - indent_up (); + ++indent_level; indent_puts (C_plus_plus ? "std::cerr << \"--scanner backing up\\n\";" : "fprintf( stderr, \"--scanner backing up\\n\" );"); - indent_down (); + --indent_level; do_indent (); out_dec ("else if ( yy_act < %d )\n", num_rules); - indent_up (); + ++indent_level; if (C_plus_plus) { indent_puts @@ -2018,11 +2009,11 @@ void make_tables () (" (long)yy_rule_linenum[yy_act], yytext );"); } - indent_down (); + --indent_level; do_indent (); out_dec ("else if ( yy_act == %d )\n", num_rules); - indent_up (); + ++indent_level; if (C_plus_plus) { indent_puts @@ -2034,21 +2025,21 @@ void make_tables () indent_puts (" yytext );"); } - indent_down (); + --indent_level; do_indent (); out_dec ("else if ( yy_act == %d )\n", num_rules + 1); - indent_up (); + ++indent_level; indent_puts (C_plus_plus ? "std::cerr << \"--(end of buffer or a NUL)\\n\";" : "fprintf( stderr, \"--(end of buffer or a NUL)\\n\" );"); - indent_down (); + --indent_level; do_indent (); outn ("else"); - indent_up (); + ++indent_level; if (C_plus_plus) { indent_puts @@ -2059,15 +2050,15 @@ void make_tables () ("fprintf( stderr, \"--EOF (start condition %d)\\n\", YY_START );"); } - indent_down (); + --indent_level; indent_puts ("}"); - indent_down (); + --indent_level; } /* Copy actions to output file. */ skelout (); /* %% [13.0] - break point in skel */ - indent_up (); + ++indent_level; gen_bu_action (); out (&action_array[action_offset]); @@ -2082,9 +2073,9 @@ void make_tables () } if (did_eof_rule) { - indent_up (); + ++indent_level; indent_puts ("yyterminate();"); - indent_down (); + --indent_level; } @@ -2142,17 +2133,17 @@ void make_tables () if (do_yylineno) { indent_puts ("if ( YY_CURRENT_BUFFER_LVALUE->yy_at_bol )"); - indent_up (); + ++indent_level; indent_puts ("M4_YY_INCR_LINENO();"); - indent_down (); + --indent_level; } } else if (do_yylineno) { indent_puts ("if ( c == '\\n' )"); - indent_up (); + ++indent_level; indent_puts ("M4_YY_INCR_LINENO();"); - indent_down (); + --indent_level; } skelout (); @@ -2163,7 +2154,11 @@ void make_tables () if (sectnum == 3) { OUT_BEGIN_CODE (); + if (!no_section3_escape) + fputs("[[", stdout); (void) flexscan (); /* copy remainder of input to output */ + if (!no_section3_escape) + fputs("]]", stdout); OUT_END_CODE (); } } diff --git a/gettext.h b/src/gettext.h index ea67f30..ea67f30 100644 --- a/gettext.h +++ b/src/gettext.h diff --git a/libmain.c b/src/libmain.c index 49262e4..bb2fe35 100644 --- a/libmain.c +++ b/src/libmain.c @@ -21,13 +21,16 @@ /* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */ /* PURPOSE. */ -extern int yylex (); +#include <stdlib.h> -int main (argc, argv) - int argc; - char *argv[]; +extern int yylex (void); + +int main (int argc, char *argv[]) { + (void)argc; + (void)argv; + while (yylex () != 0) ; - return 0; + exit(0); } diff --git a/libyywrap.c b/src/libyywrap.c index 8561a43..b0427c4 100644 --- a/libyywrap.c +++ b/src/libyywrap.c @@ -21,6 +21,8 @@ /* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */ /* PURPOSE. */ +int yywrap (void); + int yywrap (void) { return 1; @@ -36,15 +36,15 @@ #include "version.h" #include "options.h" #include "tables.h" +#include "parse.h" static char flex_version[] = FLEX_VERSION; /* declare functions that have forward references */ -void flexinit PROTO ((int, char **)); -void readin PROTO ((void)); -void set_up_initial_allocations PROTO ((void)); -static char *basename2 PROTO ((char *path, int should_strip_ext)); +void flexinit(int, char **); +void readin(void); +void set_up_initial_allocations(void); /* these globals are all defined and commented in flexdef.h */ @@ -57,6 +57,7 @@ int C_plus_plus, long_align, use_read, yytext_is_array, do_yywrap, int reentrant, bison_bridge_lval, bison_bridge_lloc; int yymore_used, reject, real_reject, continued_action, in_rule; int yymore_really_used, reject_really_used; +int trace_hex = 0; int datapos, dataline, linenum; FILE *skelfile = NULL; int skel_ind = 0; @@ -93,7 +94,7 @@ int *accsiz, *dhash, numas; int numsnpairs, jambase, jamstate; int lastccl, *cclmap, *ccllen, *cclng, cclreuse; int current_maxccls, current_max_ccl_tbl_size; -Char *ccltbl; +unsigned char *ccltbl; char nmstr[MAXLINE]; int sectnum, nummt, hshcol, dfaeql, numeps, eps2, num_reallocs; int tmpuses, totnst, peakpairs, numuniq, numdup, hshsave; @@ -105,7 +106,6 @@ int num_input_files; jmp_buf flex_main_jmp_buf; bool *rule_has_nl, *ccl_has_nl; int nlch = '\n'; -bool ansi_func_defs, ansi_func_protos; bool tablesext, tablesverify, gentables; char *tablesfilename=0,*tablesname=0; @@ -116,19 +116,9 @@ struct yytbl_writer tableswr; */ char *program_name = "flex"; -#ifndef SHORT_FILE_NAMES -static char *outfile_template = "lex.%s.%s"; -static char *backing_name = "lex.backup"; -static char *tablesfile_template = "lex.%s.tables"; -#else -static char *outfile_template = "lex%s.%s"; -static char *backing_name = "lex.bck"; -static char *tablesfile_template = "lex%s.tbl"; -#endif - -#ifdef MS_DOS -extern unsigned _stklen = 16384; -#endif +static const char outfile_template[] = "lex.%s.%s"; +static const char backing_name[] = "lex.backup"; +static const char tablesfile_template[] = "lex.%s.tables"; /* From scan.l */ extern FILE* yyout; @@ -137,18 +127,15 @@ static char outfile_path[MAXLINE]; static int outfile_created = 0; static char *skelname = NULL; static int _stdout_closed = 0; /* flag to prevent double-fclose() on stdout. */ -const char *escaped_qstart = "[[]]M4_YY_NOOP[M4_YY_NOOP[M4_YY_NOOP[[]]"; -const char *escaped_qend = "[[]]M4_YY_NOOP]M4_YY_NOOP]M4_YY_NOOP[[]]"; +const char *escaped_qstart = "]]M4_YY_NOOP[M4_YY_NOOP[M4_YY_NOOP[["; +const char *escaped_qend = "]]M4_YY_NOOP]M4_YY_NOOP]M4_YY_NOOP[["; /* For debugging. The max number of filters to apply to skeleton. */ static int preproc_level = 1000; -int flex_main PROTO ((int argc, char *argv[])); -int main PROTO ((int argc, char *argv[])); +int flex_main (int argc, char *argv[]); -int flex_main (argc, argv) - int argc; - char *argv[]; +int flex_main (int argc, char *argv[]) { int i, exit_status, child_status; @@ -208,9 +195,7 @@ int flex_main (argc, argv) } /* Wrapper around flex_main, so flex_main can be built as a library. */ -int main (argc, argv) - int argc; - char *argv[]; +int main (int argc, char *argv[]) { #if ENABLE_NLS #if HAVE_LOCALE_H @@ -226,7 +211,7 @@ int main (argc, argv) /* check_options - check user-specified options */ -void check_options () +void check_options (void) { int i; const char * m4 = NULL; @@ -291,7 +276,7 @@ void check_options () 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; } @@ -325,14 +310,8 @@ void check_options () } } - if (!ansi_func_defs) - buf_m4_define( &m4defs_buf, "M4_YY_NO_ANSI_FUNC_DEFS", NULL); - - if (!ansi_func_protos) - buf_m4_define( &m4defs_buf, "M4_YY_NO_ANSI_FUNC_PROTOS", NULL); - - 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; @@ -354,7 +333,7 @@ void check_options () prev_stdout = freopen (outfilename, "w+", stdout); if (prev_stdout == NULL) - lerrsf (_("could not create %s"), outfilename); + lerr (_("could not create %s"), outfilename); outfile_created = 1; } @@ -362,8 +341,45 @@ void check_options () /* Setup the filter chain. */ output_chain = filter_create_int(NULL, filter_tee_header, headerfilename); - if ( !(m4 = getenv("M4"))) - m4 = M4; + if ( !(m4 = getenv("M4"))) { + char *slash; + m4 = M4; + if ((slash = strrchr(M4, '/')) != NULL) { + m4 = slash+1; + /* break up $PATH */ + const char *path = getenv("PATH"); + if (!path) { + m4 = M4; + } else { + int m4_length = strlen(m4); + do { + size_t length = strlen(path); + struct stat sbuf; + + const char *endOfDir = strchr(path, ':'); + if (!endOfDir) + endOfDir = path+length; + + { + char *m4_path = calloc(endOfDir-path + 1 + m4_length + 1, 1); + + 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]); + if (!path[0]) + m4 = M4; + } + } + } filter_create_ext(output_chain, m4, "-P", 0); filter_create_int(output_chain, filter_fix_linedirs, NULL); @@ -389,26 +405,25 @@ void check_options () FILE *tablesout; struct yytbl_hdr hdr; char *pname = 0; - int nbytes = 0; + size_t nbytes = 0; buf_m4_define (&m4defs_buf, "M4_YY_TABLES_EXTERNAL", NULL); if (!tablesfilename) { nbytes = strlen (prefix) + strlen (tablesfile_template) + 2; - tablesfilename = pname = (char *) calloc (nbytes, 1); + tablesfilename = pname = calloc(nbytes, 1); snprintf (pname, nbytes, tablesfile_template, prefix); } if ((tablesout = fopen (tablesfilename, "w")) == NULL) - lerrsf (_("could not create %s"), tablesfilename); - if (pname) - free (pname); + lerr (_("could not create %s"), tablesfilename); + free(pname); tablesfilename = 0; yytbl_writer_init (&tableswr, tablesout); nbytes = strlen (prefix) + strlen ("tables") + 2; - tablesname = (char *) calloc (nbytes, 1); + tablesname = calloc(nbytes, 1); snprintf (tablesname, nbytes, "%stables", prefix); yytbl_hdr_init (&hdr, flex_version, tablesname); @@ -417,7 +432,7 @@ void check_options () } if (skelname && (skelfile = fopen (skelname, "r")) == NULL) - lerrsf (_("can't open skeleton file %s"), skelname); + lerr (_("can't open skeleton file %s"), skelname); if (reentrant) { buf_m4_define (&m4defs_buf, "M4_YY_REENTRANT", NULL); @@ -431,6 +446,8 @@ void check_options () 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) @@ -451,7 +468,8 @@ void check_options () char *str, *fmt = "#define %s %d\n"; size_t strsz; - str = (char*)flex_alloc(strsz = strlen(fmt) + strlen(scname[i]) + (int)(1 + log10(i)) + 2); + strsz = strlen(fmt) + strlen(scname[i]) + (size_t)(1 + ceil (log10(i))) + 2; + str = malloc(strsz); if (!str) flexfatal(_("allocation of macro definition failed")); snprintf(str, strsz, fmt, scname[i], i - 1); @@ -473,7 +491,8 @@ void check_options () m4defs_buf.nelts = 0; /* memory leak here. */ /* Place a bogus line directive, it will be fixed in the filter. */ - outn("#line 0 \"M4_YY_OUTFILE_NAME\"\n"); + if (gen_line_dirs) + outn("#line 0 \"M4_YY_OUTFILE_NAME\"\n"); /* Dump the user defined preproc directives. */ if (userdef_buf.elts) @@ -489,9 +508,7 @@ void check_options () * This routine does not return. */ -void flexend (exit_status) - int exit_status; - +void flexend (int exit_status) { static int called_before = -1; /* prevent infinite recursion. */ int tblsiz; @@ -501,11 +518,11 @@ void flexend (exit_status) if (skelfile != NULL) { if (ferror (skelfile)) - lerrsf (_("input error reading skeleton file %s"), + lerr (_("input error reading skeleton file %s"), skelname); else if (fclose (skelfile)) - lerrsf (_("error closing skeleton file %s"), + lerr (_("error closing skeleton file %s"), skelname); } @@ -538,7 +555,6 @@ void flexend (exit_status) "EOB_ACT_END_OF_FILE", "EOB_ACT_LAST_MATCH", "FLEX_SCANNER", - "FLEX_STD", "REJECT", "YYFARGS0", "YYFARGS1", @@ -625,7 +641,7 @@ void flexend (exit_status) "yypop_buffer_state", "yyensure_buffer_stack", "yyalloc", - "yyconst", + "const", "yyextra", "yyfree", "yyget_debug", @@ -690,7 +706,7 @@ void flexend (exit_status) fprintf (header_out, "#endif /* %sHEADER_H */\n", prefix); if (ferror (header_out)) - lerrsf (_("error creating header file %s"), + lerr (_("error creating header file %s"), headerfilename); fflush (header_out); fclose (header_out); @@ -698,15 +714,15 @@ void flexend (exit_status) if (exit_status != 0 && outfile_created) { if (ferror (stdout)) - lerrsf (_("error writing output file %s"), + lerr (_("error writing output file %s"), outfilename); else if ((_stdout_closed = 1) && fclose (stdout)) - lerrsf (_("error closing output file %s"), + lerr (_("error closing output file %s"), outfilename); else if (unlink (outfilename)) - lerrsf (_("error deleting output file %s"), + lerr (_("error deleting output file %s"), outfilename); } @@ -724,11 +740,11 @@ void flexend (exit_status) _("Compressed tables always back up.\n")); if (ferror (backing_up_file)) - lerrsf (_("error writing backup file %s"), + lerr (_("error writing backup file %s"), backing_name); else if (fclose (backing_up_file)) - lerrsf (_("error closing backup file %s"), + lerr (_("error closing backup file %s"), backing_name); } @@ -925,9 +941,7 @@ void flexend (exit_status) /* flexinit - initialize flex */ -void flexinit (argc, argv) - int argc; - char **argv; +void flexinit (int argc, char **argv) { int i, sawcmpflag, rv, optind; char *arg; @@ -952,7 +966,6 @@ void flexinit (argc, argv) tablesext = tablesverify = false; gentables = true; tablesfilename = tablesname = NULL; - ansi_func_defs = ansi_func_protos = true; sawcmpflag = false; @@ -981,9 +994,9 @@ void flexinit (argc, argv) flex_init_regex(); /* Enable C++ if program name ends with '+'. */ - program_name = basename2 (argv[0], 0); + program_name = basename (argv[0]); - if (program_name[0] != '\0' && + if (program_name != NULL && program_name[strlen (program_name) - 1] == '+') C_plus_plus = true; @@ -1058,9 +1071,9 @@ void flexinit (argc, argv) break; default: - lerrif (_ + lerr (_ ("unknown -C option '%c'"), - (int) arg[i]); + arg[i]); break; } break; @@ -1104,7 +1117,7 @@ void flexinit (argc, argv) break; case OPT_PREPROC_LEVEL: - preproc_level = strtol(arg,NULL,0); + preproc_level = (int) strtol(arg,NULL,0); break; case OPT_MAIN: @@ -1267,7 +1280,7 @@ void flexinit (argc, argv) } else { buf_strnappend (&userdef_buf, arg, - def - arg); + (int) (def - arg)); buf_strappend (&userdef_buf, " "); buf_strappend (&userdef_buf, def + 1); @@ -1329,14 +1342,6 @@ void flexinit (argc, argv) reject_really_used = false; break; - case OPT_NO_ANSI_FUNC_DEFS: - ansi_func_defs = false; - break; - - case OPT_NO_ANSI_FUNC_PROTOS: - ansi_func_protos = false; - break; - case OPT_NO_YY_PUSH_STATE: //buf_strdefine (&userdef_buf, "YY_NO_PUSH_STATE", "1"); buf_m4_define( &m4defs_buf, "M4_YY_NO_PUSH_STATE",0); @@ -1421,7 +1426,12 @@ void flexinit (argc, argv) //buf_strdefine (&userdef_buf, "YY_NO_SET_LLOC", "1"); buf_m4_define( &m4defs_buf, "M4_YY_NO_SET_LLOC",0); break; - + case OPT_HEX: + trace_hex = 1; + break; + case OPT_NO_SECT3_ESCAPE: + no_section3_escape = true; + break; } /* switch */ } /* while scanopt() */ @@ -1454,13 +1464,13 @@ void flexinit (argc, argv) /* readin - read in the rules section of the input file(s) */ -void readin () +void readin (void) { static char yy_stdinit[] = "FILE *yyin = stdin, *yyout = stdout;"; static char yy_nostdinit[] = - "FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;"; + "FILE *yyin = NULL, *yyout = NULL;"; - line_directive_out ((FILE *) 0, 1); + line_directive_out(NULL, 1); if (yyparse ()) { pinpoint_message (_("fatal parse error")); @@ -1494,7 +1504,7 @@ void readin () if (backing_up_report) { backing_up_file = fopen (backing_name, "w"); if (backing_up_file == NULL) - lerrsf (_ + lerr (_ ("could not create backing-up info file %s"), backing_name); } @@ -1575,11 +1585,12 @@ void readin () } if (!do_yywrap) { - if (!C_plus_plus) + if (!C_plus_plus) { if (reentrant) - outn ("\n#define yywrap(yyscanner) 1"); + out_str ("\n#define %swrap(yyscanner) (/*CONSTCOND*/1)\n", prefix); else - outn ("\n#define yywrap() 1"); + out_str ("\n#define %swrap() (/*CONSTCOND*/1)\n", prefix); + } outn ("#define YY_SKIP_YYWRAP"); } @@ -1587,10 +1598,7 @@ void readin () outn ("\n#define FLEX_DEBUG"); OUT_BEGIN_CODE (); - if (csize == 256) - outn ("typedef unsigned char YY_CHAR;"); - else - outn ("typedef char YY_CHAR;"); + outn ("typedef flex_uint8_t YY_CHAR;"); OUT_END_CODE (); if (C_plus_plus) { @@ -1634,7 +1642,7 @@ void readin () OUT_BEGIN_CODE (); if (fullspd) - outn ("typedef yyconst struct yy_trans_info *yy_state_type;"); + outn ("typedef const struct yy_trans_info *yy_state_type;"); else if (!C_plus_plus) outn ("typedef int yy_state_type;"); OUT_END_CODE (); @@ -1683,6 +1691,10 @@ void readin () } else { outn ("extern char *yytext;"); + + outn("#ifdef yytext_ptr"); + outn("#undef yytext_ptr"); + outn("#endif"); outn ("#define yytext_ptr yytext"); } } @@ -1708,7 +1720,7 @@ void readin () /* set_up_initial_allocations - allocate memory for internal tables */ -void set_up_initial_allocations () +void set_up_initial_allocations (void) { maximum_mns = (long_align ? MAXIMUM_MNS_LONG : MAXIMUM_MNS); current_mns = INITIAL_MNS; @@ -1762,31 +1774,11 @@ void set_up_initial_allocations () dss = allocate_int_ptr_array (current_max_dfas); dfaacc = allocate_dfaacc_union (current_max_dfas); - nultrans = (int *) 0; + nultrans = NULL; } -/* extracts basename from path, optionally stripping the extension "\.*" - * (same concept as /bin/sh `basename`, but different handling of extension). */ -static char *basename2 (path, strip_ext) - char *path; - int strip_ext; /* boolean */ -{ - char *b, *e = 0; - - b = path; - for (b = path; *path; path++) - if (*path == '/') - b = path + 1; - else if (*path == '.') - e = path; - - if (strip_ext && e && e > b) - *e = '\0'; - return b; -} - -void usage () +void usage (void) { FILE *f = stdout; @@ -1818,6 +1810,7 @@ void usage () " -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" @@ -1843,8 +1836,6 @@ void usage () " --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" "Miscellaneous:\n" @@ -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" @@ -60,14 +59,15 @@ static void sko_push(bool dc) { if(!sko_stack){ sko_sz = 1; - sko_stack = (struct sko_state*)flex_alloc(sizeof(struct sko_state)*sko_sz); + sko_stack = malloc(sizeof(struct sko_state) * (size_t) sko_sz); if (!sko_stack) flexfatal(_("allocation of sko_stack failed")); sko_len = 0; } if(sko_len >= sko_sz){ sko_sz *= 2; - sko_stack = (struct sko_state*)flex_realloc(sko_stack,sizeof(struct sko_state)*sko_sz); + sko_stack = realloc(sko_stack, + sizeof(struct sko_state) * (size_t) sko_sz); } /* initialize to zero and push */ @@ -90,9 +90,7 @@ static void sko_pop(bool* dc) } /* Append "#define defname value\n" to the running buffer. */ -void action_define (defname, value) - const char *defname; - int value; +void action_define (const char *defname, int value) { char buf[MAXLINE]; char *cpy; @@ -108,37 +106,14 @@ void action_define (defname, value) add_action (buf); /* track #defines so we can undef them when we're done. */ - cpy = copy_string (defname); + cpy = xstrdup(defname); buf_append (&defs_buf, &cpy, 1); } - -/** Append "m4_define([[defname]],[[value]])m4_dnl\n" to the running buffer. - * @param defname The macro name. - * @param value The macro value, can be NULL, which is the same as the empty string. - */ -void action_m4_define (const char *defname, const char * value) -{ - char buf[MAXLINE]; - - flexfatal ("DO NOT USE THIS FUNCTION!"); - - if ((int) strlen (defname) > MAXLINE / 2) { - format_pinpoint_message (_ - ("name \"%s\" ridiculously long"), - defname); - return; - } - - snprintf (buf, sizeof(buf), "m4_define([[%s]],[[%s]])m4_dnl\n", defname, value?value:""); - add_action (buf); -} - /* Append "new_text" to the running buffer. */ -void add_action (new_text) - const char *new_text; +void add_action (const char *new_text) { - int len = strlen (new_text); + int len = (int) strlen (new_text); while (len + action_index >= action_size - 10 /* slop */ ) { int new_size = action_size * 2; @@ -164,14 +139,17 @@ void add_action (new_text) /* allocate_array - allocate memory for an integer array of the given size */ -void *allocate_array (size, element_size) - int size; - size_t element_size; +void *allocate_array (int size, size_t element_size) { - register void *mem; - size_t num_bytes = element_size * size; - - mem = flex_alloc (num_bytes); + void *mem; +#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()")); @@ -182,11 +160,10 @@ void *allocate_array (size, element_size) /* all_lower - true if a string is all lower-case */ -int all_lower (str) - register char *str; +int all_lower (char *str) { while (*str) { - if (!isascii ((Char) * str) || !islower ((Char) * str)) + if (!isascii ((unsigned char) * str) || !islower ((unsigned char) * str)) return 0; ++str; } @@ -197,11 +174,10 @@ int all_lower (str) /* all_upper - true if a string is all upper-case */ -int all_upper (str) - register char *str; +int all_upper (char *str) { while (*str) { - if (!isascii ((Char) * str) || !isupper ((Char) * str)) + if (!isascii ((unsigned char) * str) || !isupper ((unsigned char) * str)) return 0; ++str; } @@ -223,15 +199,14 @@ int intcmp (const void *a, const void *b) * and exits. */ -void check_char (c) - int c; +void check_char (int c) { if (c >= CSIZE) - lerrsf (_("bad character '%s' detected in check_char()"), + lerr (_("bad character '%s' detected in check_char()"), readable_form (c)); if (c >= csize) - lerrsf (_ + lerr (_ ("scanner requires -8 flag to use the character %s"), readable_form (c)); } @@ -240,57 +215,20 @@ void check_char (c) /* clower - replace upper-case letter to lower-case */ -Char clower (c) - register int c; +unsigned char clower (int c) { - return (Char) ((isascii (c) && isupper (c)) ? tolower (c) : c); + return (unsigned char) ((isascii (c) && isupper (c)) ? tolower (c) : c); } -/* copy_string - returns a dynamically allocated copy of a string */ - -char *copy_string (str) - register const char *str; +char *xstrdup(const char *s) { - register const char *c1; - register char *c2; - char *copy; - unsigned int size; - - /* find length */ - for (c1 = str; *c1; ++c1) ; + char *s2; - size = (c1 - str + 1) * sizeof (char); + if ((s2 = strdup(s)) == NULL) + flexfatal (_("memory allocation failure in xstrdup()")); - copy = (char *) flex_alloc (size); - - if (copy == NULL) - flexfatal (_("dynamic memory failure in copy_string()")); - - for (c2 = copy; (*c2++ = *str++) != 0;) ; - - return copy; -} - - -/* copy_unsigned_string - - * returns a dynamically allocated copy of a (potentially) unsigned string - */ - -Char *copy_unsigned_string (str) - register Char *str; -{ - register Char *c; - Char *copy; - - /* find length */ - for (c = str; *c; ++c) ; - - copy = allocate_Character_array (c - str + 1); - - for (c = copy; (*c++ = *str++) != 0;) ; - - return copy; + return s2; } @@ -298,19 +236,19 @@ Char *copy_unsigned_string (str) int cclcmp (const void *a, const void *b) { - if (!*(const Char *) a) + if (!*(const unsigned char *) a) return 1; else - if (!*(const Char *) b) + if (!*(const unsigned char *) b) return - 1; else - return *(const Char *) a - *(const Char *) b; + return *(const unsigned char *) a - *(const unsigned char *) b; } /* dataend - finish up a block of data declarations */ -void dataend () +void dataend (void) { /* short circuit any output */ if (gentables) { @@ -328,7 +266,7 @@ void dataend () /* dataflush - flush generated data statements */ -void dataflush () +void dataflush (void) { /* short circuit any output */ if (!gentables) @@ -351,8 +289,7 @@ void dataflush () /* flexerror - report an error message and terminate */ -void flexerror (msg) - const char *msg; +void flexerror (const char *msg) { fprintf (stderr, "%s: %s\n", program_name, msg); flexend (1); @@ -361,8 +298,7 @@ void flexerror (msg) /* flexfatal - report a fatal error message and terminate */ -void flexfatal (msg) - const char *msg; +void flexfatal (const char *msg) { fprintf (stderr, _("%s: fatal internal error, %s\n"), program_name, msg); @@ -370,67 +306,41 @@ void flexfatal (msg) } -/* htoi - convert a hexadecimal digit string to an integer value */ - -int htoi (str) - Char str[]; -{ - unsigned int result; - - (void) sscanf ((char *) str, "%x", &result); - - return result; -} - - -/* lerrif - report an error message formatted with one integer argument */ +/* lerr - report an error message */ -void lerrif (msg, arg) - const char *msg; - int arg; +void lerr (const char *msg, ...) { char errmsg[MAXLINE]; + va_list args; - snprintf (errmsg, sizeof(errmsg), msg, arg); + va_start(args, msg); + vsnprintf (errmsg, sizeof(errmsg), msg, args); + va_end(args); flexerror (errmsg); } -/* lerrsf - report an error message formatted with one string argument */ +/* lerr_fatal - as lerr, but call flexfatal */ -void lerrsf (msg, arg) - const char *msg, arg[]; +void lerr_fatal (const char *msg, ...) { char errmsg[MAXLINE]; + va_list args; + va_start(args, msg); - snprintf (errmsg, sizeof(errmsg)-1, msg, arg); - errmsg[sizeof(errmsg)-1] = 0; /* ensure NULL termination */ - flexerror (errmsg); -} - - -/* lerrsf_fatal - as lerrsf, but call flexfatal */ - -void lerrsf_fatal (msg, arg) - const char *msg, arg[]; -{ - char errmsg[MAXLINE]; - - snprintf (errmsg, sizeof(errmsg)-1, msg, arg); - errmsg[sizeof(errmsg)-1] = 0; /* ensure NULL termination */ + vsnprintf (errmsg, sizeof(errmsg), msg, args); + va_end(args); flexfatal (errmsg); } /* line_directive_out - spit out a "#line" statement */ -void line_directive_out (output_file, do_infile) - FILE *output_file; - int do_infile; +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; @@ -444,8 +354,8 @@ void line_directive_out (output_file, do_infile) s3 = &filename[sizeof (filename) - 2]; while (s2 < s3 && *s1) { - if (*s1 == '\\') - /* Escape the '\' */ + if (*s1 == '\\' || *s1 == '"') + /* Escape the '\' or '"' */ *s2++ = '\\'; *s2++ = *s1++; @@ -474,7 +384,7 @@ void line_directive_out (output_file, do_infile) * representing where the user's section 1 definitions end * and the prolog begins */ -void mark_defs1 () +void mark_defs1 (void) { defs1_offset = 0; action_array[action_index++] = '\0'; @@ -486,7 +396,7 @@ void mark_defs1 () /* mark_prolog - mark the current position in the action array as * representing the end of the action prolog */ -void mark_prolog () +void mark_prolog (void) { action_array[action_index++] = '\0'; action_offset = action_index; @@ -498,8 +408,7 @@ void mark_prolog () * * Generates a data statement initializing the current 2-D array to "value". */ -void mk2data (value) - int value; +void mk2data (int value) { /* short circuit any output */ if (!gentables) @@ -528,8 +437,7 @@ void mk2data (value) * Generates a data statement initializing the current array element to * "value". */ -void mkdata (value) - int value; +void mkdata (int value) { /* short circuit any output */ if (!gentables) @@ -554,8 +462,7 @@ void mkdata (value) /* myctoi - return the integer represented by a string of digits */ -int myctoi (array) - const char *array; +int myctoi (const char *array) { int val = 0; @@ -567,10 +474,9 @@ int myctoi (array) /* myesc - return character corresponding to escape sequence */ -Char myesc (array) - Char array[]; +unsigned char myesc (unsigned char array[]) { - Char c, esc_char; + unsigned char c, esc_char; switch (array[1]) { case 'b': @@ -583,19 +489,10 @@ Char myesc (array) return '\r'; case 't': return '\t'; - -#if defined (__STDC__) case 'a': return '\a'; case 'v': return '\v'; -#else - case 'a': - return '\007'; - case 'v': - return '\013'; -#endif - case '0': case '1': case '2': @@ -607,18 +504,15 @@ Char myesc (array) { /* \<octal> */ int sptr = 1; - while (isascii (array[sptr]) && - isdigit (array[sptr])) - /* Don't increment inside loop control - * because if isdigit() is a macro it might - * expand into multiple increments ... - */ + while (sptr <= 3 && + array[sptr] >= '0' && array[sptr] <= '7') { ++sptr; + } c = array[sptr]; array[sptr] = '\0'; - esc_char = otoi (array + 1); + esc_char = (unsigned char) strtoul (array + 1, NULL, 8); array[sptr] = c; @@ -629,18 +523,18 @@ Char myesc (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 = htoi (array + 2); + esc_char = (unsigned char) strtoul (array + 2, NULL, 16); array[sptr] = c; @@ -653,76 +547,51 @@ Char myesc (array) } -/* otoi - convert an octal digit string to an integer value */ - -int otoi (str) - 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. */ -void out (str) - const char *str; +void out (const char *str) { fputs (str, stdout); } -void out_dec (fmt, n) - const char *fmt; - int n; +void out_dec (const char *fmt, int n) { fprintf (stdout, fmt, n); } -void out_dec2 (fmt, n1, n2) - const char *fmt; - int n1, n2; +void out_dec2 (const char *fmt, int n1, int n2) { fprintf (stdout, fmt, n1, n2); } -void out_hex (fmt, x) - const char *fmt; - unsigned int x; +void out_hex (const char *fmt, unsigned int x) { fprintf (stdout, fmt, x); } -void out_str (fmt, str) - const char *fmt, str[]; +void out_str (const char *fmt, const char str[]) { fprintf (stdout,fmt, str); } -void out_str3 (fmt, s1, s2, s3) - const char *fmt, s1[], s2[], s3[]; +void out_str3 (const char *fmt, const char s1[], const char s2[], const char s3[]) { fprintf (stdout,fmt, s1, s2, s3); } -void out_str_dec (fmt, str, n) - const char *fmt, str[]; - int n; +void out_str_dec (const char *fmt, const char str[], int n) { fprintf (stdout,fmt, str, n); } -void outc (c) - int c; +void outc (int c) { fputc (c, stdout); } -void outn (str) - const char *str; +void outn (const char *str) { fputs (str,stdout); fputc('\n',stdout); @@ -731,7 +600,6 @@ void outn (str) /** Print "m4_define( [[def]], [[val]])m4_dnl\n". * @param def The m4 symbol to define. * @param val The definition; may be NULL. - * @return buf */ void out_m4_define (const char* def, const char* val) { @@ -745,10 +613,9 @@ void out_m4_define (const char* def, const char* val) * The returned string is in static storage. */ -char *readable_form (c) - register int c; +char *readable_form (int c) { - static char rform[10]; + static char rform[20]; if ((c >= 0 && c < 32) || c >= 127) { switch (c) { @@ -762,16 +629,15 @@ char *readable_form (c) return "\\r"; case '\t': return "\\t"; - -#if defined (__STDC__) case '\a': return "\\a"; case '\v': return "\\v"; -#endif - default: - snprintf (rform, sizeof(rform), "\\%.3o", (unsigned int) c); + if(trace_hex) + snprintf (rform, sizeof(rform), "\\x%.2x", (unsigned int) c); + else + snprintf (rform, sizeof(rform), "\\%.3o", (unsigned int) c); return rform; } } @@ -780,7 +646,7 @@ char *readable_form (c) return "' '"; else { - rform[0] = c; + rform[0] = (char) c; rform[1] = '\0'; return rform; @@ -790,15 +656,17 @@ char *readable_form (c) /* reallocate_array - increase the size of a dynamic array */ -void *reallocate_array (array, size, element_size) - void *array; - int size; - size_t element_size; +void *reallocate_array (void *array, int size, size_t element_size) { - register void *new_array; - size_t num_bytes = element_size * size; - - new_array = flex_realloc (array, num_bytes); + void *new_array; +#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")); @@ -812,7 +680,7 @@ void *reallocate_array (array, size, element_size) * Copies skelfile or skel array to stdout until a line beginning with * "%%" or EOF is found. */ -void skelout () +void skelout (void) { char buf_storage[MAXLINE]; char *buf = buf_storage; @@ -923,9 +791,6 @@ void skelout () /* %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")); } @@ -943,8 +808,7 @@ void skelout () * element_n. Formats the output with spaces and carriage returns. */ -void transition_struct_out (element_v, element_n) - int element_v, element_n; +void transition_struct_out (int element_v, int element_n) { /* short circuit any output */ @@ -968,12 +832,14 @@ void transition_struct_out (element_v, element_n) /* The following is only needed when building flex's parser using certain * broken versions of bison. + * + * XXX: this is should go soon */ -void *yy_flex_xmalloc (size) - int size; +void *yy_flex_xmalloc (int size) { - void *result = flex_alloc ((size_t) size); + void *result; + result = malloc((size_t) size); if (!result) flexfatal (_ ("memory allocation failed in yy_flex_xmalloc()")); @@ -982,29 +848,10 @@ void *yy_flex_xmalloc (size) } -/* zero_out - set a region of memory to 0 - * - * Sets region_ptr[0] through region_ptr[size_in_bytes - 1] to zero. - */ - -void zero_out (region_ptr, size_in_bytes) - char *region_ptr; - size_t size_in_bytes; -{ - register char *rp, *rp_end; - - rp = region_ptr; - rp_end = region_ptr + size_in_bytes; - - while (rp < rp_end) - *rp++ = 0; -} - /* Remove all '\n' and '\r' characters, if any, from the end of str. * str can be any null-terminated string, or NULL. * returns str. */ -char *chomp (str) - char *str; +char *chomp (char *str) { char *p = str; diff --git a/mkskel.sh b/src/mkskel.sh index 02c397a..1aa59e1 100755 --- a/mkskel.sh +++ b/src/mkskel.sh @@ -21,17 +21,34 @@ # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR # PURPOSE. -cat <<! -/* File created from flex.skl via mkskel.sh */ +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/\\/&&/g' | sed 's/"/\\"/g' | sed 's/.*/ "&",/' - -cat <<! - 0 -}; -! +const char *skel[] = {' +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/.*/ "&",/' + +echo ' 0 +};' @@ -36,8 +36,8 @@ /* declare functions that have forward references */ -int dupmachine PROTO ((int)); -void mkxtion PROTO ((int, int)); +int dupmachine(int); +void mkxtion(int, int); /* add_accept - add an accepting state to a machine @@ -45,8 +45,7 @@ void mkxtion PROTO ((int, int)); * accepting_number becomes mach's accepting number. */ -void add_accept (mach, accepting_number) - int mach, accepting_number; +void add_accept (int mach, int accepting_number) { /* Hang the accepting number off an epsilon state. if it is associated * with a state that has a non-epsilon out-transition, then the state @@ -77,8 +76,7 @@ void add_accept (mach, accepting_number) * num - the number of copies of singl to be present in newsng */ -int copysingl (singl, num) - int singl, num; +int copysingl (int singl, int num) { int copy, i; @@ -93,9 +91,7 @@ int copysingl (singl, num) /* dumpnfa - debugging routine to write out an nfa */ -void dumpnfa (state1) - int state1; - +void dumpnfa (int state1) { int sym, tsp1, tsp2, anum, ns; @@ -148,8 +144,7 @@ void dumpnfa (state1) * states accessible by the arrays firstst and lastst */ -int dupmachine (mach) - int mach; +int dupmachine (int mach) { int i, init, state_offset; int state = 0; @@ -196,9 +191,8 @@ int dupmachine (mach) * context has variable length. */ -void finish_rule (mach, variable_trail_rule, headcnt, trailcnt, - pcont_act) - int mach, variable_trail_rule, headcnt, trailcnt, pcont_act; +void finish_rule (int mach, int variable_trail_rule, int headcnt, int trailcnt, + int pcont_act) { char action_text[MAXLINE]; @@ -292,7 +286,8 @@ void finish_rule (mach, variable_trail_rule, headcnt, trailcnt, if (!continued_action) add_action ("YY_RULE_SETUP\n"); - line_directive_out ((FILE *) 0, 1); + line_directive_out(NULL, 1); + add_action("[["); } @@ -312,8 +307,7 @@ void finish_rule (mach, variable_trail_rule, headcnt, trailcnt, * FIRST is set to new by the operation. last is unmolested. */ -int link_machines (first, last) - int first, last; +int link_machines (int first, int last) { if (first == NIL) return last; @@ -339,8 +333,7 @@ int link_machines (first, last) * The "beginning" states are the epsilon closure of the first state */ -void mark_beginning_as_normal (mach) - register int mach; +void mark_beginning_as_normal (int mach) { switch (state_type[mach]) { case STATE_NORMAL: @@ -381,8 +374,7 @@ void mark_beginning_as_normal (mach) * more mkbranch's. Compare with mkor() */ -int mkbranch (first, second) - int first, second; +int mkbranch (int first, int second) { int eps; @@ -409,8 +401,7 @@ int mkbranch (first, second) * new - a new state which matches the closure of "state" */ -int mkclos (state) - int state; +int mkclos (int state) { return mkopt (mkposcl (state)); } @@ -430,8 +421,7 @@ int mkclos (state) * 2. mach is destroyed by the call */ -int mkopt (mach) - int mach; +int mkopt (int mach) { int eps; @@ -467,8 +457,7 @@ int mkopt (mach) * the number of epsilon states needed */ -int mkor (first, second) - int first, second; +int mkor (int first, int second) { int eps, orend; @@ -523,8 +512,7 @@ int mkor (first, second) * new - a machine matching the positive closure of "state" */ -int mkposcl (state) - int state; +int mkposcl (int state) { int eps; @@ -553,8 +541,7 @@ int mkposcl (state) * if "ub" is INFINITE_REPEAT then "new" matches "lb" or more occurrences of "mach" */ -int mkrep (mach, lb, ub) - int mach, lb, ub; +int mkrep (int mach, int lb, int ub) { int base_mach, tail, copy, i; @@ -600,12 +587,11 @@ int mkrep (mach, lb, ub) * that it admittedly is) */ -int mkstate (sym) - int sym; +int mkstate (int sym) { if (++lastnfa >= current_mns) { if ((current_mns += MNS_INCREMENT) >= maximum_mns) - lerrif (_ + lerr(_ ("input rules are too complicated (>= %d NFA states)"), current_mns); @@ -677,8 +663,7 @@ current_mns); * stateto - the state to which the transition is to be made */ -void mkxtion (statefrom, stateto) - int statefrom, stateto; +void mkxtion (int statefrom, int stateto) { if (trans1[statefrom] == NO_TRANSITION) trans1[statefrom] = stateto; @@ -695,7 +680,7 @@ void mkxtion (statefrom, stateto) /* new_rule - initialize for a new rule */ -void new_rule () +void new_rule (void) { if (++num_rules >= current_max_rules) { ++num_reallocs; @@ -711,7 +696,7 @@ void new_rule () } if (num_rules > MAX_RULE) - lerrif (_("too many rules (> %d)!"), MAX_RULE); + lerr (_("too many rules (> %d)!"), MAX_RULE); rule_linenum[num_rules] = linenum; rule_useful[num_rules] = false; diff --git a/options.c b/src/options.c index c673173..366bc2e 100644 --- a/options.c +++ b/src/options.c @@ -117,6 +117,8 @@ optspec_t flexopts[] = { , {"--help", OPT_HELP, 0} , /* Produce this help message. */ + {"--hex", OPT_HEX, 0} + , /* Use hexadecimals in debug/trace outputs */ {"-I", OPT_INTERACTIVE, 0} , {"--interactive", OPT_INTERACTIVE, 0} @@ -211,10 +213,6 @@ optspec_t flexopts[] = { , {"--nowarn", OPT_NO_WARN, 0} , /* Suppress warning messages. */ - {"--noansi-definitions", OPT_NO_ANSI_FUNC_DEFS, 0} - , - {"--noansi-prototypes", OPT_NO_ANSI_FUNC_PROTOS, 0} - , {"--yyclass=NAME", OPT_YYCLASS, 0} , {"--yylineno", OPT_YYLINENO, 0} @@ -273,7 +271,8 @@ optspec_t flexopts[] = { , {"--noyyset_lloc", OPT_NO_YYSET_LLOC, 0} , - + {"--unsafe-no-m4-sect3-escape", OPT_NO_SECT3_ESCAPE, 0} + , {0, 0, 0} /* required final NULL entry. */ }; diff --git a/options.h b/src/options.h index 1f3925b..5b51c23 100644 --- a/options.h +++ b/src/options.h @@ -60,6 +60,7 @@ enum flexopt_flag_t { OPT_FULL, OPT_HEADER_FILE, OPT_HELP, + OPT_HEX, OPT_INTERACTIVE, OPT_LEX_COMPAT, OPT_POSIX_COMPAT, @@ -67,8 +68,6 @@ enum flexopt_flag_t { OPT_META_ECS, OPT_NEVER_INTERACTIVE, OPT_NO_ALIGN, - OPT_NO_ANSI_FUNC_DEFS, - OPT_NO_ANSI_FUNC_PROTOS, OPT_NO_DEBUG, OPT_NO_DEFAULT, OPT_NO_ECS, @@ -126,7 +125,8 @@ enum flexopt_flag_t { OPT_YYCLASS, OPT_YYLINENO, OPT_YYMORE, - OPT_YYWRAP + OPT_YYWRAP, + OPT_NO_SECT3_ESCAPE, }; #endif @@ -1,8 +1,8 @@ /* parse.y - parser for flex input */ %token CHAR NUMBER SECTEND SCDECL XSCDECL NAME PREVCCL EOF_OP -%token OPTION_OP OPT_OUTFILE OPT_PREFIX OPT_YYCLASS OPT_HEADER OPT_EXTRA_TYPE -%token OPT_TABLES +%token TOK_OPTION TOK_OUTFILE TOK_PREFIX TOK_YYCLASS TOK_HEADER_FILE TOK_EXTRA_TYPE +%token TOK_TABLES_FILE %token CCE_ALNUM CCE_ALPHA CCE_BLANK CCE_CNTRL CCE_DIGIT CCE_GRAPH %token CCE_LOWER CCE_PRINT CCE_PUNCT CCE_SPACE CCE_UPPER CCE_XDIGIT @@ -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. */ @@ -140,7 +140,7 @@ goal : initlex sect1 sect1end sect2 initforrule else add_action( "ECHO" ); - add_action( ";\n\tYY_BREAK\n" ); + add_action( ";\n\tYY_BREAK]]\n" ); } ; @@ -184,28 +184,30 @@ namelist1 : namelist1 NAME { synerr( _("bad start condition list") ); } ; -options : OPTION_OP optionlist +options : TOK_OPTION optionlist ; optionlist : optionlist option | ; -option : OPT_OUTFILE '=' NAME +option : TOK_OUTFILE '=' NAME { - outfilename = copy_string( nmstr ); + outfilename = xstrdup(nmstr); did_outfilename = 1; } - | OPT_EXTRA_TYPE '=' NAME - { extra_type = copy_string( nmstr ); } - | OPT_PREFIX '=' NAME - { prefix = copy_string( nmstr ); } - | OPT_YYCLASS '=' NAME - { yyclass = copy_string( nmstr ); } - | OPT_HEADER '=' NAME - { headerfilename = copy_string( nmstr ); } - | OPT_TABLES '=' NAME - { tablesext = true; tablesfilename = copy_string( nmstr ); } + | TOK_EXTRA_TYPE '=' NAME + { extra_type = xstrdup(nmstr); } + | TOK_PREFIX '=' NAME + { prefix = xstrdup(nmstr); + if (strchr(prefix, '[') || strchr(prefix, ']')) + flexerror(_("Prefix must not contain [ or ]")); } + | TOK_YYCLASS '=' NAME + { yyclass = xstrdup(nmstr); } + | TOK_HEADER_FILE '=' NAME + { headerfilename = xstrdup(nmstr); } + | TOK_TABLES_FILE '=' NAME + { tablesext = true; tablesfilename = xstrdup(nmstr); } ; sect2 : sect2 scon initforrule flexrule '\n' @@ -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; @@ -725,7 +727,7 @@ singleton : singleton '*' { /* Sort characters for fast searching. */ - qsort( ccltbl + cclmap[$1], ccllen[$1], sizeof (*ccltbl), cclcmp ); + qsort( ccltbl + cclmap[$1], (size_t) ccllen[$1], sizeof (*ccltbl), cclcmp ); if ( useecs ) mkeccl( ccltbl + cclmap[$1], ccllen[$1], @@ -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); } @@ -951,9 +953,9 @@ string : string CHAR * conditions */ -void build_eof_action() +void build_eof_action(void) { - register int i; + int i; char action_text[MAXLINE]; for ( i = 1; i <= scon_stk_ptr; ++i ) @@ -976,7 +978,8 @@ void build_eof_action() } } - line_directive_out( (FILE *) 0, 1 ); + line_directive_out(NULL, 1); + add_action("[["); /* This isn't a normal rule after all - don't count it as * such, so we don't have any holes in the rule numbering @@ -990,8 +993,7 @@ void build_eof_action() /* format_synerr - write out formatted syntax error */ -void format_synerr( msg, arg ) -const char *msg, arg[]; +void format_synerr( const char *msg, const char arg[] ) { char errmsg[MAXLINE]; @@ -1002,8 +1004,7 @@ const char *msg, arg[]; /* synerr - report a syntax error */ -void synerr( str ) -const char *str; +void synerr( const char *str ) { syntaxerror = true; pinpoint_message( str ); @@ -1012,20 +1013,18 @@ const char *str; /* format_warn - write out formatted warning */ -void format_warn( msg, arg ) -const char *msg, arg[]; +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( str ) -const char *str; +void lwarn( const char *str ) { line_warning( str, linenum ); } @@ -1034,8 +1033,7 @@ const char *str; * pinpointing its location */ -void format_pinpoint_message( msg, arg ) -const char *msg, arg[]; +void format_pinpoint_message( const char *msg, const char arg[] ) { char errmsg[MAXLINE]; @@ -1046,8 +1044,7 @@ const char *msg, arg[]; /* pinpoint_message - write out a message, pinpointing its location */ -void pinpoint_message( str ) -const char *str; +void pinpoint_message( const char *str ) { line_pinpoint( str, linenum ); } @@ -1055,9 +1052,7 @@ const char *str; /* line_warning - report a warning at a given line, unless -w was given */ -void line_warning( str, line ) -const char *str; -int line; +void line_warning( const char *str, int line ) { char warning[MAXLINE]; @@ -1071,9 +1066,7 @@ int line; /* line_pinpoint - write out a message, pinpointing it at the given line */ -void line_pinpoint( str, line ) -const char *str; -int line; +void line_pinpoint( const char *str, int line ) { fprintf( stderr, "%s:%d: %s\n", infilename, line, str ); } @@ -1083,7 +1076,7 @@ int line; * currently, messages are ignore */ -void yyerror( msg ) -const char *msg; +void yyerror( const char *msg ) { + (void)msg; } @@ -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 int errbuf_sz = 200; - char *errbuf, *rxerr; + const size_t errbuf_sz = 200; + char *errbuf; + int n; - errbuf = (char*)flex_alloc(errbuf_sz *sizeof(char)); + errbuf = malloc(errbuf_sz * sizeof(char)); if (!errbuf) flexfatal(_("Unable to allocate buffer to report regcomp")); - rxerr = (char*)flex_alloc(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); - - flexfatal (errbuf); - free(errbuf); - free(rxerr); + n = snprintf(errbuf, errbuf_sz, "regcomp for \"%s\" failed: ", regex); + regerror(err, preg, errbuf+n, errbuf_sz-(size_t)n); + + flexfatal (errbuf); /* never returns - no need to free(errbuf) */ } } @@ -80,12 +76,12 @@ void flex_regcomp(regex_t *preg, const char *regex, int cflags) char *regmatch_dup (regmatch_t * m, const char *src) { char *str; - int len; + size_t len; - if (m == NULL || m->rm_so < 0) + if (m == NULL || m->rm_so < 0 || m->rm_eo < m->rm_so) return NULL; - len = m->rm_eo - m->rm_so; - str = (char *) flex_alloc ((len + 1) * sizeof (char)); + len = (size_t) (m->rm_eo - m->rm_so); + str = malloc((len + 1) * sizeof(char)); if (!str) flexfatal(_("Unable to allocate a copy of the match")); strncpy (str, src + m->rm_so, len); @@ -107,13 +103,12 @@ char *regmatch_cpy (regmatch_t * m, char *dest, const char *src) return dest; } - snprintf (dest, regmatch_len(m), "%s", src + m->rm_so); + snprintf (dest, (size_t) regmatch_len(m), "%s", src + m->rm_so); return dest; } /** Get the length in characters of the match. * @param m A match as returned by regexec(). - * @param src The source string that was passed to regexec(). * @return The length of the match. */ int regmatch_len (regmatch_t * m) @@ -151,7 +146,7 @@ int regmatch_strtol (regmatch_t * m, const char *src, char **endptr, else s = regmatch_dup (m, src); - n = strtol (s, endptr, base); + n = (int) strtol (s, endptr, base); if (s != buf) free (s); @@ -38,6 +38,12 @@ extern bool tablesverify, tablesext; extern int trlcontxt; /* Set in parse.y for each rule. */ extern const char *escaped_qstart, *escaped_qend; +#define M4QSTART "[""[" +#define M4QEND "]""]" + +#define ESCAPED_QSTART "[" M4QEND M4QSTART "[" M4QEND M4QSTART +#define ESCAPED_QEND M4QEND "]" M4QSTART M4QEND "]" M4QSTART + #define ACTION_ECHO add_action( yytext ) #define ACTION_IFDEF(def, should_define) \ { \ @@ -45,8 +51,8 @@ extern const char *escaped_qstart, *escaped_qend; action_define( def, 1 ); \ } -#define ACTION_ECHO_QSTART add_action (escaped_qstart) -#define ACTION_ECHO_QEND add_action (escaped_qend) +#define ACTION_ECHO_QSTART add_action (ESCAPED_QSTART) +#define ACTION_ECHO_QEND add_action (ESCAPED_QEND) #define ACTION_M4_IFDEF(def, should_define) \ do{ \ @@ -59,7 +65,7 @@ extern const char *escaped_qstart, *escaped_qend; #define MARK_END_OF_PROLOG mark_prolog(); #define YY_DECL \ - int flexscan() + int flexscan(void) #define RETURNCHAR \ yylval = (unsigned char) yytext[0]; \ @@ -68,18 +74,20 @@ extern const char *escaped_qstart, *escaped_qend; #define RETURNNAME \ if(yyleng < MAXLINE) \ { \ - strcpy( nmstr, yytext ); \ + strncpy( nmstr, yytext, sizeof(nmstr) ); \ + return NAME; \ } \ else \ - { \ + do { \ synerr(_("Input line too long\n")); \ FLEX_EXIT(EXIT_FAILURE); \ - } \ - return NAME; + } while (0) #define PUT_BACK_STRING(str, start) \ - for ( i = strlen( str ) - 1; i >= start; --i ) \ - unput((str)[i]) + { size_t i = strlen( str ); \ + while ( i > start ) \ + unput((str)[--i]); \ + } #define CHECK_REJECT(str) \ if ( all_upper( str ) ) \ @@ -93,9 +101,26 @@ extern const char *escaped_qstart, *escaped_qend; if ( getenv("POSIXLY_CORRECT") ) \ 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) + +#define END_CODEBLOCK do { \ + yy_pop_state();\ + add_action(M4QEND); \ + if (!indented_code) line_directive_out(NULL, 0);\ +} while (0) + %} -%option caseless nodefault stack noyy_top_state +%option caseless nodefault noreject stack noyy_top_state %option nostdinit %x SECT2 SECT2PROLOG SECT3 CODEBLOCK PICKUPDEF SC CARETISBOL NUM QUOTE @@ -104,7 +129,9 @@ extern const char *escaped_qstart, *escaped_qend; %x GROUP_WITH_PARAMS %x GROUP_MINUS_PARAMS %x EXTENDED_COMMENT -%x COMMENT_DISCARD +%x COMMENT_DISCARD CODE_COMMENT +%x SECT3_NOESCAPE +%x CHARACTER_CONSTANT WS [[:blank:]]+ OPTWS [[:blank:]]* @@ -125,8 +152,8 @@ CCL_EXPR ("[:"^?[[:alpha:]]+":]") LEXOPT [aceknopr] -M4QSTART "[[" -M4QEND "]]" +M4QSTART "[""[" +M4QEND "]""]" %% static int bracelevel, didadef, indented_code; @@ -134,22 +161,17 @@ M4QEND "]]" static int option_sense; int doing_codeblock = false; - int i, brace_depth=0, brace_start_line=0; - Char nmdef[MAXLINE]; + int brace_depth=0, brace_start_line=0; + char nmdef[MAXLINE]; <INITIAL>{ - ^{WS} indented_code = true; BEGIN(CODEBLOCK); - ^"/*" ACTION_ECHO; yy_push_state( COMMENT ); + ^{WS} START_CODEBLOCK(true); + ^"/*" add_action("/*[""["); yy_push_state( COMMENT ); ^#{OPTWS}line{WS} yy_push_state( LINEDIR ); ^"%s"{NAME}? return SCDECL; ^"%x"{NAME}? return XSCDECL; - ^"%{".*{NL} { - ++linenum; - line_directive_out( (FILE *) 0, 1 ); - indented_code = false; - BEGIN(CODEBLOCK); - } + ^"%{".*{NL} START_CODEBLOCK(false); ^"%top"[[:blank:]]*"{"[[:blank:]]*{NL} { brace_start_line = linenum; ++linenum; @@ -166,7 +188,7 @@ M4QEND "]]" sectnum = 2; bracelevel = 0; mark_defs1(); - line_directive_out( (FILE *) 0, 1 ); + line_directive_out(NULL, 1); BEGIN(SECT2PROLOG); return SECTEND; } @@ -174,7 +196,7 @@ M4QEND "]]" ^"%pointer".*{NL} yytext_is_array = false; ++linenum; ^"%array".*{NL} yytext_is_array = true; ++linenum; - ^"%option" BEGIN(OPTION); return OPTION_OP; + ^"%option" BEGIN(OPTION); return TOK_OPTION; ^"%"{LEXOPT}{OPTWS}[[:digit:]]*{OPTWS}{NL} ++linenum; /* ignore */ ^"%"{LEXOPT}{WS}.*{NL} ++linenum; /* ignore */ @@ -185,7 +207,7 @@ M4QEND "]]" ^{NAME} { if(yyleng < MAXLINE) { - strcpy( nmstr, yytext ); + strncpy( nmstr, yytext, sizeof(nmstr) ); } else { @@ -203,14 +225,18 @@ M4QEND "]]" } -<COMMENT>{ - "*/" ACTION_ECHO; yy_pop_state(); - "*" ACTION_ECHO; - {M4QSTART} ACTION_ECHO_QSTART; - {M4QEND} ACTION_ECHO_QEND; - [^*\n] ACTION_ECHO; +<COMMENT,CODE_COMMENT>{ /* */ + [^\[\]\*\n]* ACTION_ECHO; + . ACTION_ECHO; + {NL} ++linenum; ACTION_ECHO; } +<COMMENT>{ + "*/" add_action("*/]""]"); yy_pop_state(); +} +<CODE_COMMENT>{ + "*/" ACTION_ECHO; yy_pop_state(); +} <COMMENT_DISCARD>{ /* This is the same as COMMENT, but is discarded rather than output. */ @@ -223,7 +249,7 @@ M4QEND "]]" <EXTENDED_COMMENT>{ ")" yy_pop_state(); [^\n\)]+ ; - {NL} ++linenum; + {NL} ++linenum; } <LINEDIR>{ @@ -231,25 +257,25 @@ M4QEND "]]" [[:digit:]]+ linenum = myctoi( yytext ); \"[^"\n]*\" { - flex_free( (void *) infilename ); - infilename = copy_string( yytext + 1 ); + free(infilename); + infilename = xstrdup(yytext + 1); infilename[strlen( infilename ) - 1] = '\0'; } . /* ignore spurious characters */ } +<ACTION,CODEBLOCK,ACTION_STRING,PERCENT_BRACE_ACTION,CHARACTER_CONSTANT,COMMENT,CODE_COMMENT>{ + {M4QSTART} ACTION_ECHO_QSTART; + {M4QEND} ACTION_ECHO_QEND; +} <CODEBLOCK>{ - ^"%}".*{NL} ++linenum; BEGIN(INITIAL); - - {M4QSTART} ACTION_ECHO_QSTART; - {M4QEND} ACTION_ECHO_QEND; - . ACTION_ECHO; - + ^"%}".*{NL} ++linenum; END_CODEBLOCK; + [^\n%\[\]]* ACTION_ECHO; + . ACTION_ECHO; {NL} { ++linenum; ACTION_ECHO; - if ( indented_code ) - BEGIN(INITIAL); + if ( indented_code ) END_CODEBLOCK; } } @@ -272,12 +298,11 @@ M4QEND "]]" buf_strnappend(&top_buf, yytext, yyleng); } - {M4QSTART} buf_strnappend(&top_buf, escaped_qstart, strlen(escaped_qstart)); - {M4QEND} buf_strnappend(&top_buf, escaped_qend, strlen(escaped_qend)); - - [^{}\r\n] { - buf_strnappend(&top_buf, yytext, yyleng); - } + {M4QSTART} buf_strnappend(&top_buf, escaped_qstart, (int) strlen(escaped_qstart)); + {M4QEND} buf_strnappend(&top_buf, escaped_qend, (int) strlen(escaped_qend)); + ([^{}\r\n\[\]]+)|[^{}\r\n] { + buf_strnappend(&top_buf, yytext, yyleng); + } <<EOF>> { linenum = brace_start_line; @@ -293,7 +318,7 @@ M4QEND "]]" {NOT_WS}[^\r\n]* { if(yyleng < MAXLINE) { - strcpy( (char *) nmdef, yytext ); + strncpy( nmdef, yytext, sizeof(nmdef) ); } else { @@ -301,12 +326,12 @@ M4QEND "]]" FLEX_EXIT(EXIT_FAILURE); } /* Skip trailing whitespace. */ - for ( i = strlen( (char *) nmdef ) - 1; - i >= 0 && (nmdef[i] == ' ' || nmdef[i] == '\t'); - --i ) - ; - - nmdef[i + 1] = '\0'; + { + size_t i = strlen( nmdef ); + while (i > 0 && (nmdef[i-1] == ' ' || nmdef[i-1] == '\t')) + --i; + nmdef[i] = '\0'; + } ndinstal( nmstr, nmdef ); didadef = true; @@ -338,8 +363,6 @@ M4QEND "]]" interactive = option_sense; } array yytext_is_array = option_sense; - ansi-definitions ansi_func_defs = option_sense; - ansi-prototypes ansi_func_protos = option_sense; backup backing_up_report = option_sense; batch interactive = ! option_sense; bison-bridge bison_bridge_lval = option_sense; @@ -364,6 +387,7 @@ M4QEND "]]" interactive interactive = option_sense; lex-compat lex_compat = option_sense; posix-compat posix_compat = option_sense; + line gen_line_dirs = option_sense; main { ACTION_M4_IFDEF( "M4""_YY_MAIN", option_sense); /* Override yywrap */ @@ -420,12 +444,12 @@ M4QEND "]]" yyget_lloc ACTION_M4_IFDEF("M4""_YY_NO_GET_LLOC", ! option_sense); yyset_lloc ACTION_M4_IFDEF("M4""_YY_NO_SET_LLOC", ! option_sense); - extra-type return OPT_EXTRA_TYPE; - outfile return OPT_OUTFILE; - prefix return OPT_PREFIX; - yyclass return OPT_YYCLASS; - header(-file)? return OPT_HEADER; - tables-file return OPT_TABLES; + extra-type return TOK_EXTRA_TYPE; + outfile return TOK_OUTFILE; + prefix return TOK_PREFIX; + yyclass return TOK_YYCLASS; + header(-file)? return TOK_HEADER_FILE; + tables-file return TOK_TABLES_FILE; tables-verify { tablesverify = option_sense; if(!tablesext && option_sense) @@ -436,7 +460,7 @@ M4QEND "]]" \"[^"\n]*\" { if(yyleng-1 < MAXLINE) { - strcpy( nmstr, yytext + 1 ); + strncpy( nmstr, yytext + 1, sizeof(nmstr) ); } else { @@ -461,19 +485,20 @@ M4QEND "]]" ^"%{".* ++bracelevel; yyless( 2 ); /* eat only %{ */ ^"%}".* --bracelevel; yyless( 2 ); /* eat only %} */ - ^{WS}.* ACTION_ECHO; /* 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; - } + ^{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 { + START_CODEBLOCK(true); + } + } . ACTION_ECHO; {NL} ++linenum; ACTION_ECHO; @@ -527,11 +552,11 @@ M4QEND "]]" if (sf_skip_ws()){ /* We're in the middle of a (?x: ) pattern. */ /* Push back everything starting at the "|" */ - size_t amt; - amt = strchr (yytext, '|') - yytext; + int amt = (int) (strchr (yytext, '|') - yytext); yyless(amt); } else { + add_action("]""]"); continued_action = true; ++linenum; return '\n'; @@ -601,9 +626,10 @@ M4QEND "]]" ^"%%".* { sectnum = 3; - BEGIN(SECT3); + BEGIN(no_section3_escape ? SECT3_NOESCAPE : SECT3); outn("/* Begin user sect3 */"); yyterminate(); /* to stop the parser */ + } "["({FIRST_CCL_CHAR}|{CCL_EXPR})({CCL_CHAR}|{CCL_EXPR})* { @@ -611,7 +637,7 @@ M4QEND "]]" if(yyleng < MAXLINE) { - strcpy( nmstr, yytext ); + strncpy( nmstr, yytext, sizeof(nmstr) ); } else { @@ -627,7 +653,7 @@ M4QEND "]]" * The reason it was disabled is so yacc/bison can parse * ccl operations, such as ccl difference and union. */ - && (cclval = ccllookup( (Char *) nmstr )) != 0 ) + && (cclval = ccllookup( nmstr )) != 0 ) { if ( input() != ']' ) synerr( _( "bad character class" ) ); @@ -641,7 +667,7 @@ M4QEND "]]" /* We fudge a bit. We know that this ccl will * soon be numbered as lastccl + 1 by cclinit. */ - cclinstal( (Char *) nmstr, lastccl + 1 ); + cclinstal( nmstr, lastccl + 1 ); /* Push back everything but the leading bracket * so the ccl can be rescanned. @@ -661,7 +687,7 @@ M4QEND "]]" * context. */ "{"{NAME}"}"[[:space:]]? { - register Char *nmdefptr; + char *nmdefptr; int end_is_ws, end_ch; end_ch = yytext[yyleng-1]; @@ -669,7 +695,7 @@ M4QEND "]]" if(yyleng-1 < MAXLINE) { - strcpy( nmstr, yytext + 1 ); + strncpy( nmstr, yytext + 1, sizeof(nmstr) ); } else { @@ -685,7 +711,7 @@ nmstr[yyleng - 2 - end_is_ws] = '\0'; /* chop trailing brace */ else { /* push back name surrounded by ()'s */ - int len = strlen( (char *) nmdefptr ); + size_t len = strlen( nmdefptr ); if (end_is_ws) unput(end_ch); @@ -693,7 +719,7 @@ nmstr[yyleng - 2 - end_is_ws] = '\0'; /* chop trailing brace */ (len > 0 && nmdefptr[len - 1] == '$') || (end_is_ws && trlcontxt && !sf_skip_ws())) { /* don't use ()'s after all */ - PUT_BACK_STRING((char *) nmdefptr, 0); + PUT_BACK_STRING(nmdefptr, 0); if ( nmdefptr[0] == '^' ) BEGIN(CARETISBOL); @@ -702,7 +728,7 @@ nmstr[yyleng - 2 - end_is_ws] = '\0'; /* chop trailing brace */ else { unput(')'); - PUT_BACK_STRING((char *) nmdefptr, 0); + PUT_BACK_STRING(nmdefptr, 0); unput('('); } } @@ -738,7 +764,13 @@ nmstr[yyleng - 2 - end_is_ws] = '\0'; /* chop trailing brace */ return '('; } "(" sf_push(); return '('; - ")" sf_pop(); return ')'; + ")" { + if (_sf_top_ix > 0) { + sf_pop(); + return ')'; + } else + synerr(_("unbalanced parenthesis")); + } [/|*+?.(){}] return (unsigned char) yytext[0]; . RETURNCHAR; @@ -870,35 +902,31 @@ nmstr[yyleng - 2 - end_is_ws] = '\0'; /* chop trailing brace */ <PERCENT_BRACE_ACTION>{ {OPTWS}"%}".* bracelevel = 0; - <ACTION>"/*" ACTION_ECHO; yy_push_state( COMMENT ); + <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); + } } - {M4QSTART} ACTION_ECHO_QSTART; - {M4QEND} ACTION_ECHO_QEND; - . 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); - } - } + . 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); + } + } } @@ -906,37 +934,41 @@ nmstr[yyleng - 2 - end_is_ws] = '\0'; /* chop trailing brace */ <ACTION>{ "{" ACTION_ECHO; ++bracelevel; "}" ACTION_ECHO; --bracelevel; - {M4QSTART} ACTION_ECHO_QSTART; - {M4QEND} ACTION_ECHO_QEND; - [^[:alpha:]_{}"'/\n\[\]]+ ACTION_ECHO; - [\[\]] ACTION_ECHO; - {NAME} ACTION_ECHO; - "'"([^'\\\n]|\\.)*"'" ACTION_ECHO; /* character constant */ + [^[:alpha:]_{}\"'/\n\[\]]+ ACTION_ECHO; + {NAME} ACTION_ECHO; + "'"([^\'\\\n]|\\.)"'" ACTION_ECHO; /* 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]+ ACTION_ECHO; - \\. ACTION_ECHO; - {NL} ++linenum; ACTION_ECHO; BEGIN(ACTION); + [^\[\]\"\\\n]+ ACTION_ECHO; \" ACTION_ECHO; BEGIN(ACTION); - . ACTION_ECHO; +} +<CHARACTER_CONSTANT>{ + [^\[\]\'\\\n]+ ACTION_ECHO; + \' ACTION_ECHO; BEGIN(ACTION); +} +<ACTION_STRING,CHARACTER_CONSTANT>{ + (\\\n)* ACTION_ECHO; + \\(\\\n)*. ACTION_ECHO; + {NL} ++linenum; ACTION_ECHO; if (bracelevel <= 0) { BEGIN(SECT2); } else { BEGIN(ACTION); } + . ACTION_ECHO; } -<COMMENT,COMMENT_DISCARD,ACTION,ACTION_STRING><<EOF>> { +<COMMENT,CODE_COMMENT,COMMENT_DISCARD,ACTION,ACTION_STRING,CHARACTER_CONSTANT><<EOF>> { synerr( _( "EOF encountered inside an action" ) ); yyterminate(); } @@ -947,7 +979,7 @@ nmstr[yyleng - 2 - end_is_ws] = '\0'; /* chop trailing brace */ } <SECT2,QUOTE,FIRSTCCL,CCL>{ESCSEQ} { - yylval = myesc( (Char *) yytext ); + yylval = myesc( (unsigned char *) yytext ); if ( YY_START == FIRSTCCL ) BEGIN(CCL); @@ -955,21 +987,32 @@ nmstr[yyleng - 2 - end_is_ws] = '\0'; /* chop trailing brace */ return CHAR; } - <SECT3>{ - {M4QSTART} fwrite (escaped_qstart, 1, strlen(escaped_qstart), yyout); - {M4QEND} fwrite (escaped_qend, 1, strlen(escaped_qend), yyout); - [^\[\]\n]*(\n?) ECHO; - (.|\n) ECHO; - <<EOF>> sectnum = 0; yyterminate(); + {M4QSTART} fputs(escaped_qstart, yyout); + {M4QEND} fputs(escaped_qend, yyout); + [^\[\]]* ECHO; + [][] ECHO; + <<EOF>> { + sectnum = 0; + yyterminate(); + } +} +<SECT3_NOESCAPE>{ + {M4QSTART} fprintf(yyout, "[""[%s]""]", escaped_qstart); + {M4QEND} fprintf(yyout, "[""[%s]""]", escaped_qend); + [^][]* ECHO; + [][] ECHO; + <<EOF>> { + sectnum = 0; + yyterminate(); + } } - <*>.|\n format_synerr( _( "bad character: %s" ), yytext ); %% -int yywrap() +int yywrap(void) { if ( --num_input_files > 0 ) { @@ -984,46 +1027,22 @@ int yywrap() /* set_input_file - open the given file (if NULL, stdin) for scanning */ -void set_input_file( file ) -char *file; +void set_input_file( char *file ) { if ( file && strcmp( file, "-" ) ) { - infilename = copy_string( file ); + infilename = xstrdup(file); yyin = fopen( infilename, "r" ); if ( yyin == NULL ) - lerrsf( _( "can't open %s" ), file ); + lerr( _( "can't open %s" ), file ); } else { yyin = stdin; - infilename = copy_string( "<stdin>" ); + infilename = xstrdup("<stdin>"); } linenum = 1; } - - -/* Wrapper routines for accessing the scanner's malloc routines. */ - -void *flex_alloc( size ) -size_t size; - { - return (void *) malloc( size ); - } - -void *flex_realloc( ptr, size ) -void *ptr; -size_t size; - { - return (void *) realloc( ptr, size ); - } - -void flex_free( ptr ) -void *ptr; - { - if ( ptr ) - free( ptr ); - } diff --git a/scanflags.c b/src/scanflags.c index f75aa82..9699a31 100644 --- a/scanflags.c +++ b/src/scanflags.c @@ -39,8 +39,10 @@ size_t _sf_top_ix=0, _sf_max=0; void sf_push (void) { - if (_sf_top_ix + 1 >= _sf_max) - _sf_stk = (scanflags_t*) flex_realloc ( (void*) _sf_stk, sizeof(scanflags_t) * (_sf_max += 32)); + if (_sf_top_ix + 1 >= _sf_max) { + _sf_max += 32; + _sf_stk = realloc(_sf_stk, sizeof(scanflags_t) * _sf_max); + } // copy the top element _sf_stk[_sf_top_ix + 1] = _sf_stk[_sf_top_ix]; @@ -59,10 +61,10 @@ void sf_init (void) { assert(_sf_stk == NULL); - _sf_stk = (scanflags_t*) flex_alloc ( sizeof(scanflags_t) * (_sf_max = 32)); + _sf_max = 32; + _sf_stk = malloc(sizeof(scanflags_t) * _sf_max); if (!_sf_stk) - lerrsf_fatal(_("Unable to allocate %ld of stack"), - (long)sizeof(scanflags_t)); + lerr_fatal(_("Unable to allocate %zu of stack"), sizeof(scanflags_t)); _sf_stk[_sf_top_ix] = 0; } diff --git a/scanopt.c b/src/scanopt.c index f76ecd3..a475b6f 100644 --- a/scanopt.c +++ b/src/scanopt.c @@ -37,20 +37,6 @@ /* Internal structures */ -#ifdef HAVE_STRCASECMP -#define STRCASECMP(a,b) strcasecmp(a,b) -#else -static int STRCASECMP PROTO ((const char *, const char *)); - -static int STRCASECMP (a, b) - const char *a; - const char *b; -{ - while (tolower (*a++) == tolower (*b++)) ; - return b - a; -} -#endif - #define ARG_NONE 0x01 #define ARG_REQ 0x02 #define ARG_OPT 0x04 @@ -77,56 +63,45 @@ struct _scanopt_t { }; /* Accessor functions. These WOULD be one-liners, but portability calls. */ -static const char *NAME PROTO ((struct _scanopt_t *, int)); -static int PRINTLEN PROTO ((struct _scanopt_t *, int)); -static int RVAL PROTO ((struct _scanopt_t *, int)); -static int FLAGS PROTO ((struct _scanopt_t *, int)); -static const char *DESC PROTO ((struct _scanopt_t *, int)); -static int scanopt_err PROTO ((struct _scanopt_t *, int, int, int)); -static int matchlongopt PROTO ((char *, char **, int *, char **, int *)); -static int find_opt -PROTO ((struct _scanopt_t *, int, char *, int, int *, int *opt_offset)); - -static const char *NAME (s, i) - struct _scanopt_t *s; - int i; +static const char *NAME(struct _scanopt_t *, int); +static int PRINTLEN(struct _scanopt_t *, int); +static int RVAL(struct _scanopt_t *, int); +static int FLAGS(struct _scanopt_t *, int); +static const char *DESC(struct _scanopt_t *, int); +static int scanopt_err(struct _scanopt_t *, int, int); +static int matchlongopt(char *, char **, int *, char **, int *); +static int find_opt(struct _scanopt_t *, int, char *, int, int *, int *opt_offset); + +static const char *NAME (struct _scanopt_t *s, int i) { return s->options[i].opt_fmt + ((s->aux[i].flags & IS_LONG) ? 2 : 1); } -static int PRINTLEN (s, i) - struct _scanopt_t *s; - int i; +static int PRINTLEN (struct _scanopt_t *s, int i) { return s->aux[i].printlen; } -static int RVAL (s, i) - struct _scanopt_t *s; - int i; +static int RVAL (struct _scanopt_t *s, int i) { return s->options[i].r_val; } -static int FLAGS (s, i) - struct _scanopt_t *s; - int i; +static int FLAGS (struct _scanopt_t *s, int i) { return s->aux[i].flags; } -static const char *DESC (s, i) - struct _scanopt_t *s; - int i; +static const char *DESC (struct _scanopt_t *s, int i) { return s->options[i].desc ? s->options[i].desc : ""; } #ifndef NO_SCANOPT_USAGE -static int get_cols PROTO ((void)); +static int get_cols (void); -static int get_cols () +static int get_cols (void) { char *env; int cols = 80; /* default */ @@ -159,15 +134,11 @@ static int get_cols () (s)->subscript= 0; \ }while(0) -scanopt_t *scanopt_init (options, argc, argv, flags) - const optspec_t *options; - int argc; - char **argv; - int flags; +scanopt_t *scanopt_init (const optspec_t *options, int argc, char **argv, int flags) { int i; struct _scanopt_t *s; - s = (struct _scanopt_t *) malloc (sizeof (struct _scanopt_t)); + s = malloc(sizeof (struct _scanopt_t)); s->options = options; s->optc = 0; @@ -186,10 +157,10 @@ scanopt_t *scanopt_init (options, argc, argv, flags) s->optc++; /* Build auxiliary data */ - s->aux = (struct _aux *) malloc (s->optc * sizeof (struct _aux)); + s->aux = malloc((size_t) s->optc * sizeof (struct _aux)); for (i = 0; i < s->optc; i++) { - const Char *p, *pname; + const unsigned char *p, *pname; const struct optspec_t *opt; struct _aux *aux; @@ -200,36 +171,36 @@ scanopt_t *scanopt_init (options, argc, argv, flags) if (opt->opt_fmt[0] == '-' && opt->opt_fmt[1] == '-') { aux->flags |= IS_LONG; - pname = (const Char *)(opt->opt_fmt + 2); + pname = (const unsigned char *)(opt->opt_fmt + 2); s->has_long = 1; } else { - pname = (const Char *)(opt->opt_fmt + 1); + pname = (const unsigned char *)(opt->opt_fmt + 1); s->has_short = 1; } - aux->printlen = strlen (opt->opt_fmt); + aux->printlen = (int) strlen (opt->opt_fmt); aux->namelen = 0; for (p = pname + 1; *p; p++) { /* detect required arg */ - if (*p == '=' || isspace (*p) + if (*p == '=' || isspace ((unsigned char)*p) || !(aux->flags & IS_LONG)) { if (aux->namelen == 0) - aux->namelen = p - pname; + aux->namelen = (int) (p - pname); aux->flags |= ARG_REQ; aux->flags &= ~ARG_NONE; } /* detect optional arg. This overrides required arg. */ if (*p == '[') { if (aux->namelen == 0) - aux->namelen = p - pname; + aux->namelen = (int) (p - pname); aux->flags &= ~(ARG_REQ | ARG_NONE); aux->flags |= ARG_OPT; break; } } if (aux->namelen == 0) - aux->namelen = p - pname; + aux->namelen = (int) (p - pname); } return (scanopt_t *) s; } @@ -255,10 +226,7 @@ typedef struct usg_elem usg_elem; [indent][option, alias1, alias2...][indent][description line1 description line2...] */ -int scanopt_usage (scanner, fp, usage) - scanopt_t *scanner; - FILE *fp; - const char *usage; +int scanopt_usage (scanopt_t *scanner, FILE *fp, const char *usage) { struct _scanopt_t *s; int i, columns, indent = 2; @@ -293,7 +261,7 @@ int scanopt_usage (scanner, fp, usage) fprintf (fp, "\n"); /* Sort by r_val and string. Yes, this is O(n*n), but n is small. */ - store = (usg_elem *) malloc (s->optc * sizeof (usg_elem)); + store = malloc((size_t) s->optc * sizeof (usg_elem)); for (i = 0; i < s->optc; i++) { /* grab the next preallocate node. */ @@ -319,7 +287,7 @@ int scanopt_usage (scanner, fp, usage) } if (!ptr_if_no_alias && - STRCASECMP (NAME (s, (*ue_curr)->idx), + strcasecmp (NAME (s, (*ue_curr)->idx), NAME (s, ue->idx)) > 0) { ptr_if_no_alias = ue_curr; } @@ -391,7 +359,7 @@ int scanopt_usage (scanner, fp, usage) maxlen[0] = len; /* It's much easier to calculate length for description column! */ - len = strlen (DESC (s, ue->idx)); + len = (int) strlen (DESC (s, ue->idx)); if (len > maxlen[1]) maxlen[1] = len; } @@ -481,7 +449,7 @@ int scanopt_usage (scanner, fp, usage) while (*p && n < maxlen[1] && *p != '\n') { - if (isspace ((Char)(*p)) + if (isspace ((unsigned char)(*p)) || *p == '-') lastws = p; n++; @@ -529,18 +497,10 @@ int scanopt_usage (scanner, fp, usage) #endif /* no scanopt_usage */ -static int scanopt_err (s, opt_offset, is_short, err) - struct _scanopt_t *s; - int opt_offset; - int is_short; - int err; +static int scanopt_err (struct _scanopt_t *s, int is_short, int err) { const char *optname = ""; char optchar[2]; - const optspec_t *opt = NULL; - - if (opt_offset >= 0) - opt = s->options + opt_offset; if (!s->no_err_msg) { @@ -592,16 +552,11 @@ static int scanopt_err (s, opt_offset, is_short, err) * optname will point to str + 2 * */ -static int matchlongopt (str, optname, optlen, arg, arglen) - char *str; - char **optname; - int *optlen; - char **arg; - int *arglen; +static int matchlongopt (char *str, char **optname, int *optlen, char **arg, int *arglen) { char *p; - *optname = *arg = (char *) 0; + *optname = *arg = NULL; *optlen = *arglen = 0; /* Match regex /--./ */ @@ -610,13 +565,13 @@ static int matchlongopt (str, optname, optlen, arg, arglen) return 0; p += 2; - *optname = (char *) p; + *optname = p; /* find the end of optname */ while (*p && *p != '=') ++p; - *optlen = p - *optname; + *optlen = (int) (p - *optname); if (!*p) /* an option with no '=...' part. */ @@ -628,7 +583,7 @@ static int matchlongopt (str, optname, optlen, arg, arglen) *arg = p; while (*p) ++p; - *arglen = p - *arg; + *arglen = (int) (p - *arg); return 1; } @@ -639,13 +594,8 @@ static int matchlongopt (str, optname, optlen, arg, arglen) * Short options must be exact. * Return boolean true if found and no error. * Error stored in err_code or zero if no error. */ -static int find_opt (s, lookup_long, optstart, len, err_code, opt_offset) - struct _scanopt_t *s; - int lookup_long; - char *optstart; - int len; - int *err_code; - int *opt_offset; +static int find_opt (struct _scanopt_t *s, int lookup_long, char *optstart, int + len, int *err_code, int *opt_offset) { int nmatch = 0, lastr_val = 0, i; @@ -656,17 +606,15 @@ static int find_opt (s, lookup_long, optstart, len, err_code, opt_offset) return 0; for (i = 0; i < s->optc; i++) { - char *optname; + const char *optname; - optname = - (char *) (s->options[i].opt_fmt + - (lookup_long ? 2 : 1)); + optname = s->options[i].opt_fmt + (lookup_long ? 2 : 1); if (lookup_long && (s->aux[i].flags & IS_LONG)) { if (len > s->aux[i].namelen) continue; - if (strncmp (optname, optstart, len) == 0) { + if (strncmp (optname, optstart, (size_t) len) == 0) { nmatch++; *opt_offset = i; @@ -704,10 +652,7 @@ static int find_opt (s, lookup_long, optstart, len, err_code, opt_offset) } -int scanopt (svoid, arg, optindex) - scanopt_t *svoid; - char **arg; - int *optindex; +int scanopt (scanopt_t *svoid, char **arg, int *optindex) { char *optname = NULL, *optarg = NULL, *pstart; int namelen = 0, arglen = 0; @@ -749,7 +694,7 @@ int scanopt (svoid, arg, optindex) if (!find_opt (s, 1, optname, namelen, &errcode, &opt_offset)) { - scanopt_err (s, opt_offset, 0, errcode); + scanopt_err (s, 0, errcode); return errcode; } /* We handle this below. */ @@ -784,7 +729,7 @@ int scanopt (svoid, arg, optindex) if (!find_opt (s, 0, pstart, namelen, &errcode, &opt_offset)) { - return scanopt_err (s, opt_offset, 1, errcode); + return scanopt_err (s, 1, errcode); } optarg = pstart + 1; @@ -793,7 +738,7 @@ int scanopt (svoid, arg, optindex) arglen = 0; } else - arglen = strlen (optarg); + arglen = (int) strlen (optarg); } /* At this point, we have a long or short option matched at opt_offset into @@ -812,8 +757,7 @@ int scanopt (svoid, arg, optindex) /* case: no args allowed */ if (auxp->flags & ARG_NONE) { if (optarg && !is_short) { - scanopt_err (s, opt_offset, is_short, errcode = - SCANOPT_ERR_ARG_NOT_ALLOWED); + scanopt_err (s, is_short, errcode = SCANOPT_ERR_ARG_NOT_ALLOWED); INC_INDEX (s, 1); return errcode; } @@ -827,8 +771,7 @@ int scanopt (svoid, arg, optindex) /* case: required */ if (auxp->flags & ARG_REQ) { if (!optarg && !has_next) - return scanopt_err (s, opt_offset, is_short, - SCANOPT_ERR_ARG_NOT_FOUND); + return scanopt_err (s, is_short, SCANOPT_ERR_ARG_NOT_FOUND); if (!optarg) { /* Let the next argv element become the argument. */ @@ -855,16 +798,14 @@ int scanopt (svoid, arg, optindex) } -int scanopt_destroy (svoid) - scanopt_t *svoid; +int scanopt_destroy (scanopt_t *svoid) { struct _scanopt_t *s; s = (struct _scanopt_t *) svoid; - if (s) { - if (s->aux) - free (s->aux); - free (s); + if (s != NULL) { + free(s->aux); + free(s); } return 0; } diff --git a/scanopt.h b/src/scanopt.h index 359a18a..c6e7dec 100644 --- a/scanopt.h +++ b/src/scanopt.h @@ -47,9 +47,6 @@ #ifdef __cplusplus extern "C" { #endif -#ifndef PROTO -#define PROTO(args) args -#endif /* Error codes. */ enum scanopt_err_t { SCANOPT_ERR_OPT_UNRECOGNIZED = -1, /* Unrecognized option. */ SCANOPT_ERR_OPT_AMBIGUOUS = -2, /* It matched more than one option name. */ @@ -85,12 +82,12 @@ extern "C" { * flags - Control behavior. * Return: A malloc'd pointer . */ - scanopt_t *scanopt_init PROTO ((const optspec_t * options, - int argc, char **argv, int flags)); + scanopt_t *scanopt_init (const optspec_t * options, int argc, + char **argv, int flags); /* Frees memory used by scanner. * Always returns 0. */ - int scanopt_destroy PROTO ((scanopt_t * scanner)); + int scanopt_destroy (scanopt_t * scanner); #ifndef NO_SCANOPT_USAGE /* Prints a usage message based on contents of optlist. @@ -100,10 +97,7 @@ extern "C" { * usage - Text to be prepended to option list. May be NULL. * Return: Always returns 0 (zero). */ - int scanopt_usage - PROTO ( - (scanopt_t * scanner, FILE * fp, - const char *usage)); + int scanopt_usage (scanopt_t * scanner, FILE * fp, const char *usage); #endif /* Scans command-line options in argv[]. @@ -120,10 +114,7 @@ extern "C" { * < 0 on error (return value is an error code). * */ - int scanopt - PROTO ( - (scanopt_t * scanner, char **optarg, - int *optindex)); + int scanopt (scanopt_t * scanner, char **optarg, int *optindex); #ifdef __cplusplus } @@ -59,12 +59,10 @@ static struct hash_entry *ccltab[CCL_HASH_SIZE]; /* declare functions that have forward references */ -static int addsym PROTO ((register char[], char *, int, hash_table, int)); -static struct hash_entry *findsym PROTO ((register const char *sym, - hash_table table, - - int table_size)); -static int hashfunct PROTO ((register const char *, int)); +static int addsym(char[], char *, int, hash_table, int); +static struct hash_entry *findsym (const char *sym, hash_table table, + int table_size); +static int hashfunct(const char *, int); /* addsym - add symbol and definitions to symbol table @@ -72,17 +70,12 @@ static int hashfunct PROTO ((register const char *, int)); * -1 is returned if the symbol already exists, and the change not made. */ -static int addsym (sym, str_def, int_def, table, table_size) - register char sym[]; - char *str_def; - int int_def; - hash_table table; - int table_size; +static int addsym (char sym[], char *str_def, int int_def, hash_table table, int table_size) { - int hash_val = hashfunct (sym, table_size); - register struct hash_entry *sym_entry = table[hash_val]; - register struct hash_entry *new_entry; - register struct hash_entry *successor; + int hash_val = hashfunct (sym, table_size); + struct hash_entry *sym_entry = table[hash_val]; + struct hash_entry *new_entry; + struct hash_entry *successor; while (sym_entry) { if (!strcmp (sym, sym_entry->name)) { /* entry already exists */ @@ -93,8 +86,7 @@ static int addsym (sym, str_def, int_def, table, table_size) } /* create new entry */ - new_entry = (struct hash_entry *) - flex_alloc (sizeof (struct hash_entry)); + new_entry = malloc(sizeof(struct hash_entry)); if (new_entry == NULL) flexfatal (_("symbol table memory allocation failed")); @@ -119,15 +111,13 @@ static int addsym (sym, str_def, int_def, table, table_size) /* cclinstal - save the text of a character class */ -void cclinstal (ccltxt, cclnum) - Char ccltxt[]; - int cclnum; +void cclinstal (char ccltxt[], int cclnum) { /* We don't bother checking the return status because we are not * called unless the symbol is new. */ - (void) addsym ((char *) copy_unsigned_string (ccltxt), + (void) addsym (xstrdup(ccltxt), (char *) 0, cclnum, ccltab, CCL_HASH_SIZE); } @@ -137,25 +127,20 @@ void cclinstal (ccltxt, cclnum) * Returns 0 if there's no CCL associated with the text. */ -int ccllookup (ccltxt) - Char ccltxt[]; +int ccllookup (char ccltxt[]) { - return findsym ((char *) ccltxt, ccltab, CCL_HASH_SIZE)->int_val; + return findsym (ccltxt, ccltab, CCL_HASH_SIZE)->int_val; } /* findsym - find symbol in symbol table */ -static struct hash_entry *findsym (sym, table, table_size) - register const char *sym; - hash_table table; - int table_size; +static struct hash_entry *findsym (const char *sym, hash_table table, int table_size) { static struct hash_entry empty_entry = { - (struct hash_entry *) 0, (struct hash_entry *) 0, - (char *) 0, (char *) 0, 0, + NULL, NULL, NULL, NULL, 0, }; - register struct hash_entry *sym_entry = + struct hash_entry *sym_entry = table[hashfunct (sym, table_size)]; @@ -170,12 +155,10 @@ static struct hash_entry *findsym (sym, table, table_size) /* hashfunct - compute the hash value for "str" and hash size "hash_size" */ -static int hashfunct (str, hash_size) - register const char *str; - int hash_size; +static int hashfunct (const char *str, int hash_size) { - register int hashval; - register int locstr; + int hashval; + int locstr; hashval = 0; locstr = 0; @@ -191,13 +174,11 @@ static int hashfunct (str, hash_size) /* ndinstal - install a name definition */ -void ndinstal (name, definition) - const char *name; - Char definition[]; +void ndinstal (const char *name, char definition[]) { - if (addsym (copy_string (name), - (char *) copy_unsigned_string (definition), 0, + if (addsym (xstrdup(name), + xstrdup(definition), 0, ndtbl, NAME_TABLE_HASH_SIZE)) synerr (_("name defined twice")); } @@ -208,16 +189,15 @@ void ndinstal (name, definition) * Returns a nil pointer if the name definition does not exist. */ -Char *ndlookup (nd) - const char *nd; +char *ndlookup (const char *nd) { - return (Char *) findsym (nd, ndtbl, NAME_TABLE_HASH_SIZE)->str_val; + return findsym (nd, ndtbl, NAME_TABLE_HASH_SIZE)->str_val; } /* scextend - increase the maximum number of start conditions */ -void scextend () +void scextend (void) { current_max_scs += MAX_SCS_INCREMENT; @@ -237,17 +217,15 @@ void scextend () * The start condition is "exclusive" if xcluflg is true. */ -void scinstal (str, xcluflg) - const char *str; - int xcluflg; +void scinstal (const char *str, int xcluflg) { if (++lastsc >= current_max_scs) scextend (); - scname[lastsc] = copy_string (str); + scname[lastsc] = xstrdup(str); - if (addsym (scname[lastsc], (char *) 0, lastsc, + if (addsym(scname[lastsc], NULL, lastsc, sctbl, START_COND_HASH_SIZE)) format_pinpoint_message (_ ("start condition %s declared twice"), @@ -265,8 +243,7 @@ str); * Returns 0 if no such start condition. */ -int sclookup (str) - const char *str; +int sclookup (const char *str) { return findsym (str, sctbl, START_COND_HASH_SIZE)->int_val; } @@ -55,7 +55,7 @@ int yytbl_write32 (struct yytbl_writer *wr, flex_uint32_t v); int yytbl_write16 (struct yytbl_writer *wr, flex_uint16_t v); int yytbl_write8 (struct yytbl_writer *wr, flex_uint8_t v); -int yytbl_writen (struct yytbl_writer *wr, void *v, flex_int32_t len); +int yytbl_writen (struct yytbl_writer *wr, void *v, int len); static flex_int32_t yytbl_data_geti (const struct yytbl_data *tbl, int i); /* XXX Not used static flex_int32_t yytbl_data_getijk (const struct yytbl_data *tbl, int i, @@ -65,7 +65,7 @@ static flex_int32_t yytbl_data_getijk (const struct yytbl_data *tbl, int i, /** Initialize the table writer. * @param wr an uninitialized writer - * @param the output file + * @param out the output file * @return 0 on success */ int yytbl_writer_init (struct yytbl_writer *wr, FILE * out) @@ -86,17 +86,17 @@ int yytbl_hdr_init (struct yytbl_hdr *th, const char *version_str, memset (th, 0, sizeof (struct yytbl_hdr)); th->th_magic = YYTBL_MAGIC; - th->th_hsize = 14 + strlen (version_str) + 1 + strlen (name) + 1; + th->th_hsize = (flex_uint32_t) (14 + strlen (version_str) + 1 + strlen (name) + 1); th->th_hsize += yypad64 (th->th_hsize); th->th_ssize = 0; // Not known at this point. th->th_flags = 0; - th->th_version = copy_string (version_str); - th->th_name = copy_string (name); + th->th_version = xstrdup(version_str); + th->th_name = xstrdup(name); return 0; } /** Allocate and initialize a table data structure. - * @param tbl a pointer to an uninitialized table + * @param td a pointer to an uninitialized table * @param id the table identifier * @return 0 on success */ @@ -115,8 +115,7 @@ int yytbl_data_init (struct yytbl_data *td, enum yytbl_id id) */ int yytbl_data_destroy (struct yytbl_data *td) { - if (td->td_data) - free (td->td_data); + free(td->td_data); td->td_data = 0; free (td); return 0; @@ -137,7 +136,7 @@ static int yytbl_write_pad64 (struct yytbl_writer *wr) } /** write the header. - * @param out the output stream + * @param wr the output stream * @param th table header to be written * @return -1 on error, or bytes written on success. */ @@ -159,12 +158,12 @@ int yytbl_hdr_fwrite (struct yytbl_writer *wr, const struct yytbl_hdr *th) flex_die (_("th_ssize|th_flags write failed")); bwritten += 6; - sz = strlen (th->th_version) + 1; + sz = (int) strlen (th->th_version) + 1; if ((rv = yytbl_writen (wr, th->th_version, sz)) != sz) flex_die (_("th_version writen failed")); bwritten += rv; - sz = strlen (th->th_name) + 1; + sz = (int) strlen (th->th_name) + 1; if ((rv = yytbl_writen (wr, th->th_name, sz)) != sz) flex_die (_("th_name writen failed")); bwritten += rv; @@ -183,7 +182,7 @@ int yytbl_hdr_fwrite (struct yytbl_writer *wr, const struct yytbl_hdr *th) /** Write this table. - * @param out the file writer + * @param wr the file writer * @param td table data to be written * @return -1 on error, or bytes written on success. */ @@ -214,13 +213,13 @@ int yytbl_data_fwrite (struct yytbl_writer *wr, struct yytbl_data *td) for (i = 0; i < total_len; i++) { switch (YYTDFLAGS2BYTES (td->td_flags)) { case sizeof (flex_int8_t): - rv = yytbl_write8 (wr, yytbl_data_geti (td, i)); + rv = yytbl_write8 (wr, (flex_uint8_t) yytbl_data_geti (td, i)); break; case sizeof (flex_int16_t): - rv = yytbl_write16 (wr, yytbl_data_geti (td, i)); + rv = yytbl_write16 (wr, (flex_uint16_t) yytbl_data_geti (td, i)); break; case sizeof (flex_int32_t): - rv = yytbl_write32 (wr, yytbl_data_geti (td, i)); + rv = yytbl_write32 (wr, (flex_uint32_t) yytbl_data_geti (td, i)); break; default: flex_die (_("invalid td_flags detected")); @@ -233,7 +232,7 @@ int yytbl_data_fwrite (struct yytbl_writer *wr, struct yytbl_data *td) } /* Sanity check */ - if (bwritten != (int) (12 + total_len * YYTDFLAGS2BYTES (td->td_flags))) { + if (bwritten != (12 + total_len * (int) YYTDFLAGS2BYTES (td->td_flags))) { flex_die (_("insanity detected")); return -1; } @@ -248,14 +247,14 @@ int yytbl_data_fwrite (struct yytbl_writer *wr, struct yytbl_data *td) /* Now go back and update the th_hsize member */ if (fgetpos (wr->out, &pos) != 0 || fsetpos (wr->out, &(wr->th_ssize_pos)) != 0 - || yytbl_write32 (wr, wr->total_written) < 0 + || yytbl_write32 (wr, (flex_uint32_t) wr->total_written) < 0 || fsetpos (wr->out, &pos)) { flex_die (_("get|set|fwrite32 failed")); return -1; } else /* Don't count the int we just wrote. */ - wr->total_written -= sizeof (flex_int32_t); + wr->total_written -= (int) sizeof (flex_int32_t); return bwritten; } @@ -265,11 +264,11 @@ int yytbl_data_fwrite (struct yytbl_writer *wr, struct yytbl_data *td) * @param len number of bytes * @return -1 on error. number of bytes written on success. */ -int yytbl_writen (struct yytbl_writer *wr, void *v, flex_int32_t len) +int yytbl_writen (struct yytbl_writer *wr, void *v, int len) { int rv; - rv = fwrite (v, 1, len, wr->out); + rv = (int) fwrite (v, 1, (size_t) len, wr->out); if (rv != len) return -1; wr->total_written += len; @@ -284,11 +283,11 @@ int yytbl_writen (struct yytbl_writer *wr, void *v, flex_int32_t len) int yytbl_write32 (struct yytbl_writer *wr, flex_uint32_t v) { flex_uint32_t vnet; - size_t bytes, rv; + int bytes, rv; vnet = htonl (v); - bytes = sizeof (flex_uint32_t); - rv = fwrite (&vnet, bytes, 1, wr->out); + bytes = (int) sizeof (flex_uint32_t); + rv = (int) fwrite (&vnet, (size_t) bytes, 1, wr->out); if (rv != 1) return -1; wr->total_written += bytes; @@ -303,11 +302,11 @@ int yytbl_write32 (struct yytbl_writer *wr, flex_uint32_t v) int yytbl_write16 (struct yytbl_writer *wr, flex_uint16_t v) { flex_uint16_t vnet; - size_t bytes, rv; + int bytes, rv; vnet = htons (v); - bytes = sizeof (flex_uint16_t); - rv = fwrite (&vnet, bytes, 1, wr->out); + bytes = (int) sizeof (flex_uint16_t); + rv = (int) fwrite (&vnet, (size_t) bytes, 1, wr->out); if (rv != 1) return -1; wr->total_written += bytes; @@ -321,10 +320,10 @@ int yytbl_write16 (struct yytbl_writer *wr, flex_uint16_t v) */ int yytbl_write8 (struct yytbl_writer *wr, flex_uint8_t v) { - size_t bytes, rv; + int bytes, rv; - bytes = sizeof (flex_uint8_t); - rv = fwrite (&v, bytes, 1, wr->out); + bytes = (int) sizeof (flex_uint8_t); + rv = (int) fwrite (&v, (size_t) bytes, 1, wr->out); if (rv != 1) return -1; wr->total_written += bytes; @@ -428,7 +427,7 @@ static void yytbl_data_seti (const struct yytbl_data *tbl, int i, */ static size_t min_int_size (struct yytbl_data *tbl) { - flex_uint32_t i, total_len; + flex_int32_t i, total_len; flex_int32_t max = 0; total_len = yytbl_calc_total_len (tbl); @@ -438,7 +437,7 @@ static size_t min_int_size (struct yytbl_data *tbl) n = abs (yytbl_data_geti (tbl, i)); - if (n > max) + if (max < n) max = n; } @@ -461,7 +460,8 @@ static size_t min_int_size (struct yytbl_data *tbl) */ void yytbl_data_compress (struct yytbl_data *tbl) { - flex_int32_t i, newsz, total_len; + flex_int32_t i, total_len; + size_t newsz; struct yytbl_data newtbl; yytbl_data_init (&newtbl, tbl->td_id); @@ -472,19 +472,19 @@ void yytbl_data_compress (struct yytbl_data *tbl) newsz = min_int_size (tbl); - if (newsz == (int) YYTDFLAGS2BYTES (tbl->td_flags)) + if (newsz == YYTDFLAGS2BYTES (tbl->td_flags)) /* No change in this table needed. */ return; - if (newsz > (int) YYTDFLAGS2BYTES (tbl->td_flags)) { + if (newsz > YYTDFLAGS2BYTES (tbl->td_flags)) { flex_die (_("detected negative compression")); return; } total_len = yytbl_calc_total_len (tbl); - newtbl.td_data = calloc (total_len, newsz); - newtbl.td_flags = - TFLAGS_CLRDATA (newtbl.td_flags) | BYTES2TFLAG (newsz); + newtbl.td_data = calloc ((size_t) total_len, newsz); + newtbl.td_flags = (flex_uint16_t) + (TFLAGS_CLRDATA (newtbl.td_flags) | BYTES2TFLAG (newsz)); for (i = 0; i < total_len; i++) { flex_int32_t g; @@ -45,7 +45,7 @@ extern "C" { #include "tables_shared.h" struct yytbl_writer { FILE *out; - flex_uint32_t total_written; + int total_written; /**< bytes written so far */ fpos_t th_ssize_pos; /**< position of th_ssize */ diff --git a/tables_shared.c b/src/tables_shared.c index b962666..fca0438 100644 --- a/tables_shared.c +++ b/src/tables_shared.c @@ -52,12 +52,12 @@ dnl /** Get the number of integers in this table. This is NOT the * same thing as the number of elements. - * @param td the table + * @param tbl the table * @return the number of integers in the table */ yyskel_static flex_int32_t yytbl_calc_total_len (const struct yytbl_data *tbl) { - flex_int32_t n; + flex_uint32_t n; /* total number of ints */ n = tbl->td_lolen; @@ -66,5 +66,5 @@ yyskel_static flex_int32_t yytbl_calc_total_len (const struct yytbl_data *tbl) if (tbl->td_id == YYTD_ID_TRANSITION) n *= 2; - return n; + return (flex_int32_t) n; } diff --git a/tables_shared.h b/src/tables_shared.h index bbf9910..bbf9910 100644 --- a/tables_shared.h +++ b/src/tables_shared.h @@ -36,11 +36,11 @@ /* declarations for functions that have forward references */ -void mkentry PROTO ((register int *, int, int, int, int)); -void mkprot PROTO ((int[], int, int)); -void mktemplate PROTO ((int[], int, int)); -void mv2front PROTO ((int)); -int tbldiff PROTO ((int[], int, int[])); +void mkentry(int *, int, int, int, int); +void mkprot(int[], int, int); +void mktemplate(int[], int, int); +void mv2front(int); +int tbldiff(int[], int, int[]); /* bldtbl - build table entries for dfa state @@ -78,8 +78,7 @@ int tbldiff PROTO ((int[], int, int[])); * cost only one difference. */ -void bldtbl (state, statenum, totaltrans, comstate, comfreq) - int state[], statenum, totaltrans, comstate, comfreq; +void bldtbl (int state[], int statenum, int totaltrans, int comstate, int comfreq) { int extptr, extrct[2][CSIZE + 1]; int mindiff, minprot, i, d; @@ -221,11 +220,11 @@ void bldtbl (state, statenum, totaltrans, comstate, comfreq) * classes. */ -void cmptmps () +void cmptmps (void) { - int tmpstorage[CSIZE + 1]; - register int *tmp = tmpstorage, i, j; - int totaltrans, trans; + int tmpstorage[CSIZE + 1]; + int *tmp = tmpstorage, i, j; + int totaltrans, trans; peakpairs = numtemps * numecs + tblend; @@ -289,9 +288,9 @@ void cmptmps () /* expand_nxt_chk - expand the next check arrays */ -void expand_nxt_chk () +void expand_nxt_chk (void) { - register int old_max = current_max_xpairs; + int old_max = current_max_xpairs; current_max_xpairs += MAX_XPAIRS_INCREMENT; @@ -300,8 +299,7 @@ void expand_nxt_chk () nxt = reallocate_integer_array (nxt, current_max_xpairs); chk = reallocate_integer_array (chk, current_max_xpairs); - zero_out ((char *) (chk + old_max), - (size_t) (MAX_XPAIRS_INCREMENT * sizeof (int))); + memset(chk + old_max, 0, MAX_XPAIRS_INCREMENT * sizeof(int)); } @@ -324,15 +322,14 @@ void expand_nxt_chk () * and an action number will be added in [-1]. */ -int find_table_space (state, numtrans) - int *state, numtrans; +int find_table_space (int *state, int numtrans) { /* Firstfree is the position of the first possible occurrence of two * consecutive unused records in the chk and nxt arrays. */ - register int i; - register int *state_ptr, *chk_ptr; - register int *ptr_to_last_entry_in_state; + int i; + int *state_ptr, *chk_ptr; + int *ptr_to_last_entry_in_state; /* If there are too many out-transitions, put the state at the end of * nxt and chk. @@ -419,13 +416,11 @@ int find_table_space (state, numtrans) * Initializes "firstfree" to be one beyond the end of the table. Initializes * all "chk" entries to be zero. */ -void inittbl () +void inittbl (void) { - register int i; + int i; - zero_out ((char *) chk, - - (size_t) (current_max_xpairs * sizeof (int))); + memset(chk, 0, (size_t) current_max_xpairs * sizeof(int)); tblend = 0; firstfree = tblend + 1; @@ -451,7 +446,7 @@ void inittbl () /* mkdeftbl - make the default, "jam" table entries */ -void mkdeftbl () +void mkdeftbl (void) { int i; @@ -500,12 +495,11 @@ void mkdeftbl () * state array. */ -void mkentry (state, numchars, statenum, deflink, totaltrans) - register int *state; - int numchars, statenum, deflink, totaltrans; +void mkentry (int *state, int numchars, int statenum, int deflink, + int totaltrans) { - register int minec, maxec, i, baseaddr; - int tblbase, tbllast; + int minec, maxec, i, baseaddr; + int tblbase, tbllast; if (totaltrans == 0) { /* there are no out-transitions */ if (deflink == JAMSTATE) @@ -616,8 +610,7 @@ void mkentry (state, numchars, statenum, deflink, totaltrans) * has only one out-transition */ -void mk1tbl (state, sym, onenxt, onedef) - int state, sym, onenxt, onedef; +void mk1tbl (int state, int sym, int onenxt, int onedef) { if (firstfree < sym) firstfree = sym; @@ -642,8 +635,7 @@ void mk1tbl (state, sym, onenxt, onedef) /* mkprot - create new proto entry */ -void mkprot (state, statenum, comstate) - int state[], statenum, comstate; +void mkprot (int state[], int statenum, int comstate) { int i, slot, tblbase; @@ -680,11 +672,10 @@ void mkprot (state, statenum, comstate) * to it */ -void mktemplate (state, statenum, comstate) - int state[], statenum, comstate; +void mktemplate (int state[], int statenum, int comstate) { int i, numdiff, tmpbase, tmp[CSIZE + 1]; - Char transset[CSIZE + 1]; + unsigned char transset[CSIZE + 1]; int tsptr; ++numtemps; @@ -712,7 +703,8 @@ void mktemplate (state, statenum, comstate) if (state[i] == 0) tnxt[tmpbase + i] = 0; else { - transset[tsptr++] = i; + /* Note: range 1..256 is mapped to 1..255,0 */ + transset[tsptr++] = (unsigned char) i; tnxt[tmpbase + i] = comstate; } @@ -732,8 +724,7 @@ void mktemplate (state, statenum, comstate) /* mv2front - move proto queue element to front of queue */ -void mv2front (qelm) - int qelm; +void mv2front (int qelm) { if (firstprot != qelm) { if (qelm == lastprot) @@ -759,12 +750,11 @@ void mv2front (qelm) * Transnum is the number of out-transitions for the state. */ -void place_state (state, statenum, transnum) - int *state, statenum, transnum; +void place_state (int *state, int statenum, int transnum) { - register int i; - register int *state_ptr; - int position = find_table_space (state, transnum); + int i; + int *state_ptr; + int position = find_table_space (state, transnum); /* "base" is the table of start positions. */ base[statenum] = position; @@ -802,8 +792,7 @@ void place_state (state, statenum, transnum) * no room, we process the sucker right now. */ -void stack1 (statenum, sym, nextstate, deflink) - int statenum, sym, nextstate, deflink; +void stack1 (int statenum, int sym, int nextstate, int deflink) { if (onesp >= ONE_STACK_SIZE - 1) mk1tbl (statenum, sym, nextstate, deflink); @@ -832,11 +821,10 @@ void stack1 (statenum, sym, nextstate, deflink) * number is "numecs" minus the number of "SAME_TRANS" entries in "ext". */ -int tbldiff (state, pr, ext) - int state[], pr, ext[]; +int tbldiff (int state[], int pr, int ext[]) { - register int i, *sp = state, *ep = ext, *protp; - register int numdiff = 0; + int i, *sp = state, *ep = ext, *protp; + int numdiff = 0; protp = &protsave[numecs * (pr - 1)]; diff --git a/version.h b/src/version.h index b9e5d6c..b9e5d6c 100644 --- a/version.h +++ b/src/version.h @@ -37,18 +37,19 @@ /* yylex - scan for a regular expression token */ - -int yylex () +extern char *yytext; +extern FILE *yyout; +bool no_section3_escape = false; +int yylex (void) { int toktype; static int beglin = false; - extern char *yytext; - if (eofseen) + if (eofseen) { toktype = EOF; - else + } else { toktype = flexscan (); - + } if (toktype == EOF || toktype == 0) { eofseen = 1; @@ -150,11 +151,12 @@ int yylex () break; default: - if (!isascii (yylval) || !isprint (yylval)) - fprintf (stderr, - "\\%.3o", - (unsigned int) yylval); - else + if (!isascii (yylval) || !isprint (yylval)) { + if(trace_hex) + fprintf (stderr, "\\x%02x", (unsigned int) yylval); + else + fprintf (stderr, "\\%.3o", (unsigned int) yylval); + } else (void) putc (yylval, stderr); break; } @@ -173,12 +175,12 @@ int yylex () fprintf (stderr, "<<EOF>>"); break; - case OPTION_OP: + case TOK_OPTION: fprintf (stderr, "%s ", yytext); break; - case OPT_OUTFILE: - case OPT_PREFIX: + case TOK_OUTFILE: + case TOK_PREFIX: case CCE_ALNUM: case CCE_ALPHA: case CCE_BLANK: diff --git a/tests/.gitignore b/tests/.gitignore index 16bafe8..e5c42b3 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -1,11 +1,105 @@ -autom4te.cache -config.cache -configure -config.in -config.status -config.h -config.log -Makefile -aclocal.m4 -stamp-* -Makefile.in +*.log +*.trs +*.o +*.tables +alloc_extra +alloc_extra.c +array_nr +array_nr.c +array_r +array_r.c +basic_nr +basic_nr.c +basic_r +basic_r.c +bison_nr +bison_nr_scanner.[ch] +bison_nr_parser.[ch] +bison_yylloc +bison_yylloc_parser.[ch] +bison_yylloc_scanner.[ch] +bison_yylval +bison_yylval_parser.[ch] +bison_yylval_scanner.[ch] +c_cxx_nr +c_cxx_nr.cc +c_cxx_r +c_cxx_r.cc +ccl +ccl.c +cxx_basic +cxx_basic.cc +cxx_multiple_scanners +cxx_multiple_scanners_[12].cc +cxx_restart +cxx_restart.cc +cxx_yywrap.i3 +cxx_yywrap.cc +debug_nr +debug_nr.c +debug_r +debug_r.c +extended +extended.c +header_nr +header_nr_scanner.[ch] +header_r +header_r_scanner.[ch] +include_by_buffer.direct +include_by_buffer.direct.c +include_by_push.direct +include_by_push.direct.c +include_by_reentrant.direct +include_by_reentrant.direct.c +lineno_nr.one +lineno_nr.c +lineno_r.one +lineno_r.c +lineno_trailing.one +lineno_trailing.c +mem_nr +mem_nr.c +mem_r +mem_r.c +multiple_scanners_nr +multiple_scanners_nr_[12].[ch] +multiple_scanners_r +multiple_scanners_r_[12].[ch] +posix +posix.c +posixly_correct +posixly_correct.c +prefix_nr +prefix_nr.c +prefix_r +prefix_r.c +pthread.pthread +pthread.c +reject_nr.reject +reject_nr.reject.c +reject_r.reject +reject_r.reject.c +reject_ver.table +reject_ver.table.c +reject_ser.table +reject_ser.table.c +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 +string_nr.c +string_r +string_r.c +top +top.[ch] +yyextra +yyextra.c +tableopts_*.c +*.opt +*.ser +*.ver diff --git a/tests/Makefile.am b/tests/Makefile.am index 25d8b0c..2cb51df 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -19,129 +19,489 @@ # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR # PURPOSE. +AM_CFLAGS = $(WARNINGFLAGS) + +TESTS = $(check_PROGRAMS) options.cn + +# The script testwrapper.sh will run most tests as is. A couple tests +# in the suite end in .reject, .table and the like so that we can pass +# different arguments to the test runner. We list those extensions so +# automake knows how to distinguish between the various kinds of tests +# we have. + +TEST_EXTENSIONS = .reject .table .direct .cn .i3 .pthread .one .opt .ser .ver + +LOG_COMPILER = $(SHELL) $(srcdir)/testwrapper.sh +AM_LOG_FLAGS = -d $(srcdir) -r + +REJECT_LOG_COMPILER = $(SHELL) $(srcdir)/testwrapper.sh +AM_REJECT_LOG_FLAGS = -d $(srcdir) -i $(srcdir)/reject.txt -r + +TABLE_LOG_COMPILER = $(SHELL) $(srcdir)/testwrapper.sh +AM_TABLE_LOG_FLAGS = -d $(builddir) -i $(srcdir)/reject.txt -t + +DIRECT_LOG_COMPILER = $(SHELL) $(srcdir)/testwrapper-direct.sh +AM_DIRECT_LOG_FLAGS = -b $(abs_builddir) -s $(srcdir) + +CN_LOG_COMPILER = $(SHELL) $(srcdir)/options.cn +AM_CN_LOG_FLAGS = $(FLEX) + +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 = $(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 = $(SHELL) $(srcdir)/testwrapper.sh +AM_ONE_LOG_FLAGS = -1 -d $(srcdir) + +AM_YFLAGS = -d -p test +AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src + +check_PROGRAMS = $(simple_tests) $(reject_tests) $(TABLE_TESTS) $(DIRECT_TESTS) $(I3_TESTS) $(PTHREAD_TESTS) $(ONE_TESTS) $(TABLEOPTS_TESTS) + +simple_tests = \ + alloc_extra \ + array_nr \ + array_r \ + basic_nr \ + basic_r \ + bison_nr \ + bison_yylloc \ + bison_yylval \ + c_cxx_nr \ + c_cxx_r \ + ccl \ + cxx_basic \ + cxx_multiple_scanners \ + cxx_restart \ + debug_nr \ + debug_r \ + extended \ + header_nr \ + header_r \ + mem_nr \ + mem_r \ + multiple_scanners_nr \ + multiple_scanners_r \ + posix \ + posixly_correct \ + prefix_nr \ + prefix_r \ + quote_in_comment \ + quotes \ + string_nr \ + string_r \ + top \ + yyextra + +reject_tests = \ + reject_nr.reject \ + reject_r.reject + +TABLE_TESTS = \ + reject_ver.table \ + reject_ser.table + +DIRECT_TESTS = \ + include_by_buffer.direct \ + include_by_push.direct \ + include_by_reentrant.direct \ + rescan_nr.direct \ + rescan_r.direct + +I3_TESTS = \ + cxx_yywrap.i3 + +PTHREAD_TESTS = \ + pthread.pthread + +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 +cxx_basic_SOURCES = cxx_basic.ll +cxx_restart_SOURCES = cxx_restart.ll +cxx_multiple_scanners_SOURCES = cxx_multiple_scanners_main.cc cxx_multiple_scanners_1.ll cxx_multiple_scanners_2.ll +cxx_yywrap_i3_SOURCES = cxx_yywrap.ll +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 +lineno_nr_one_SOURCES = lineno_nr.l +lineno_r_one_SOURCES = lineno_r.l +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 +prefix_r_SOURCES = prefix_r.l +pthread_pthread_SOURCES = pthread.l +quotes_SOURCES = quotes.l +reject_nr_reject_SOURCES = reject.l4 +reject_r_reject_SOURCES = reject.l4 +reject_ver_table_SOURCES = reject.l4 +reject_ser_table_SOURCES = reject.l4 +rescan_nr_direct_SOURCES = rescan_nr.direct.l +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 + +# 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 +# without having a flex binary, we want to not distribute the files +# built by flex in the test suite. The dist-hook target accomplishes +# this goal. It's also handy to have the list of files to clean since +# automake doesn't know about the whacky ways in which we're abusing +# it. + +CLEANFILES = \ + alloc_extra.c \ + array_nr.c \ + array_r.c \ + basic_nr.c \ + basic_r.c \ + bison_nr_parser.c \ + bison_nr_parser.h \ + bison_nr_scanner.c \ + bison_nr_scanner.h \ + bison_yylloc_parser.c \ + bison_yylloc_parser.h \ + bison_yylloc_scanner.c \ + bison_yylloc_scanner.h \ + bison_yylval_parser.c \ + bison_yylval_parser.h \ + bison_yylval_scanner.c \ + bison_yylval_scanner.h \ + c_cxx_nr.cc \ + c_cxx_r.cc \ + ccl.c \ + cxx_basic.cc \ + cxx_multiple_scanners_1.cc \ + cxx_multiple_scanners_2.cc \ + cxx_restart.cc \ + cxx_yywrap.cc \ + debug_nr.c \ + debug_r.c \ + extended.c \ + header_nr_scanner.c \ + header_nr_scanner.h \ + header_r_scanner.c \ + header_r_scanner.h \ + include_by_buffer.direct.c \ + include_by_push.direct.c \ + include_by_reentrant.direct.c \ + lineno_nr.c \ + lineno_r.c \ + lineno_trailing.c \ + mem_nr.c \ + mem_r.c \ + multiple_scanners_nr_1.c \ + multiple_scanners_nr_1.h \ + multiple_scanners_nr_2.c \ + multiple_scanners_nr_2.h \ + multiple_scanners_r_1.c \ + multiple_scanners_r_1.h \ + multiple_scanners_r_2.c \ + multiple_scanners_r_2.h \ + posix.c \ + posixly_correct.c \ + prefix_nr.c \ + prefix_r.c \ + pthread.c \ + quote_in_comment.c \ + quotes.c \ + reject_nr.reject.c \ + reject_r.reject.c \ + reject_ser.table.c \ + reject_ser.table.tables \ + reject_ver.table.c \ + reject_ver.table.tables \ + rescan_nr.direct.c \ + rescan_r.direct.c \ + string_nr.c \ + string_r.c \ + top.c \ + top.h \ + yyextra.c \ + $(tableopts_c) \ + $(tableopts_tables) + +dist-hook: + for file in $(CLEANFILES) ; do \ + rm -f $(distdir)/$$file \ + ; done + EXTRA_DIST = \ - README + README \ + alloc_extra.txt \ + array_nr.txt \ + array_r.txt \ + basic_nr.txt \ + basic_r.txt \ + bison_nr.txt \ + bison_yylloc.txt \ + bison_yylval.txt \ + c_cxx_nr.txt \ + c_cxx_r.txt \ + ccl.txt \ + cxx_basic.txt \ + cxx_multiple_scanners.txt \ + cxx_restart.txt \ + cxx_yywrap.txt \ + debug_nr.txt \ + debug_r.txt \ + extended.txt \ + header_nr.txt \ + header_r.txt \ + include_by_buffer.direct.txt \ + include_by_buffer.direct_2.txt \ + include_by_buffer.direct_3.txt \ + include_by_push.direct.txt \ + include_by_push.direct_2.txt \ + include_by_push.direct_3.txt \ + include_by_reentrant.direct.txt \ + include_by_reentrant.direct_2.txt \ + include_by_reentrant.direct_3.txt \ + lineno_nr.one.txt \ + lineno_r.one.txt \ + lineno_trailing.one.txt \ + mem_nr.txt \ + mem_r.txt \ + prefix_nr.txt \ + prefix_r.txt \ + pthread_1.txt \ + pthread_2.txt \ + pthread_3.txt \ + pthread_4.txt \ + pthread_5.txt \ + reject.txt \ + rescan_nr.direct.txt \ + rescan_r.direct.txt \ + quote_in_comment.txt \ + quotes.txt \ + top.txt \ + yyextra.txt \ + tableopts.txt dist_noinst_SCRIPTS = \ - create-test - -DIST_SUBDIRS = \ - test-concatenated-options \ - test-c++-yywrap \ - test-extended \ - test-ccl \ - test-quotes \ - test-rescan-r \ - test-rescan-nr \ - test-basic-nr \ - test-basic-r \ - test-bison-yylloc \ - test-bison-yylval \ - test-bison-nr \ - test-multiple-scanners-nr \ - test-multiple-scanners-r \ - test-header-nr \ - test-header-r \ - test-reject \ - test-c++-multiple-scanners \ - test-c++-basic \ - test-posixly-correct \ - test-posix \ - test-mem-r \ - test-mem-nr \ - test-debug-nr \ - test-debug-r \ - test-lineno-r \ - test-lineno-nr \ - test-lineno-trailing \ - test-linedir-r \ - TEMPLATE \ - test-top \ - test-array-nr \ - test-array-r \ - test-c-cpp-nr \ - test-c-cpp-r \ - test-include-by-buffer \ - test-include-by-push \ - test-include-by-reentrant \ - test-prefix-nr \ - test-prefix-r \ - test-pthread \ - test-string-nr \ - test-string-r \ - test-yyextra \ - test-alloc-extra \ - test-noansi-nr \ - test-noansi-r \ - test-table-opts - -SUBDIRS = \ - test-concatenated-options \ - test-c++-yywrap \ - test-extended \ - test-ccl \ - test-quotes \ - test-rescan-r \ - test-rescan-nr \ - test-basic-nr \ - test-basic-r \ - test-bison-yylloc \ - test-bison-yylval \ - test-bison-nr \ - test-multiple-scanners-nr \ - test-multiple-scanners-r \ - test-header-nr \ - test-header-r \ - test-reject \ - test-c++-multiple-scanners \ - test-c++-basic \ - test-posixly-correct \ - test-posix \ - test-mem-r \ - test-mem-nr \ - test-debug-nr \ - test-debug-r \ - test-lineno-r \ - test-lineno-nr \ - test-lineno-trailing \ - test-linedir-r \ - test-array-nr \ - test-array-r \ - test-c-cpp-nr \ - test-c-cpp-r \ - test-include-by-buffer \ - test-include-by-push \ - test-include-by-reentrant \ - test-prefix-nr \ - test-prefix-r \ - test-pthread \ - test-string-nr \ - test-string-r \ - test-yyextra \ - test-alloc-extra \ - test-noansi-nr \ - test-noansi-r \ - test-top \ - test-table-opts - -# clean up before running the test suite so we dont test old builds of test code - -check-local: clean - NOK=;\ - NFAIL=;\ - for dir in $(SUBDIRS) ; do \ - echo Executing test "$$dir" ; \ - ( cd "$$dir" && $(MAKE) test > OUTPUT 2>&1 ) ; \ - case $$? in \ - 0 ) echo Test "$$dir" succeeded.; \ - NOK=0$$NOK;\ - ;; \ - * ) echo Test "$$dir" FAILED. See "$$dir"/OUTPUT for details. ; \ - NFAIL=0$$NFAIL; \ - ;; \ - esac; \ - done ; \ - echo Results: ; \ - echo Tests succeeded: `echo @ECHO_N@ "$$NOK@ECHO_C@"|wc -c`; \ - echo Tests FAILED: `echo @ECHO_N@ "$$NFAIL@ECHO_C@"|wc -c` ; \ - test "$$NFAIL" = "" + tableopts.sh + +dist_check_SCRIPTS = \ + options.cn \ + testwrapper-direct.sh \ + testwrapper.sh + +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) + $(AM_V_LEX)$(FLEX) -o $@ $< + +.ll.cc: $(FLEX) + $(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_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) + $(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) + $(AM_V_LEX)POSIXLY_CORRECT=1 $(FLEX) -o $@ $< + +reject_nr.reject.c: reject.l4 $(FLEX) + $(AM_V_LEX)$(FLEX) --unsafe-no-m4-sect3-escape -o $@ $< + +reject_nr.reject$(EXEEXT): reject_nr.reject.$(OBJEXT) + $(AM_V_CCLD)$(LINK) $^ + +reject_r.reject.c: reject.l4 $(FLEX) + $(AM_V_LEX)$(FLEX) --unsafe-no-m4-sect3-escape --reentrant -o $@ $< + +reject_r.reject.$(OBJEXT): reject_r.reject.c + $(AM_V_CC)$(COMPILE) -DTEST_IS_REENTRANT -c -o $@ $< + +reject_r.reject$(EXEEXT): reject_r.reject.$(OBJEXT) + $(AM_V_CCLD)$(LINK) $^ + +reject_ver.table.c: reject.l4 $(FLEX) + $(AM_V_LEX)$(FLEX) --unsafe-no-m4-sect3-escape -o $@ --tables-verify --tables-file=$(basename $@).tables $< + +reject_ver.table.$(OBJEXT): reject_ver.table.c + $(AM_V_CC)$(COMPILE) -DTEST_HAS_TABLES_EXTERNAL -c -o $@ $< + +reject_ver.table$(EXEEXT): reject_ver.table.$(OBJEXT) + $(AM_V_CCLD)$(LINK) $^ + +reject_ser.table.c: reject.l4 $(FLEX) + $(AM_V_LEX)$(FLEX) -o $@ --unsafe-no-m4-sect3-escape --tables-file=$(basename $@).tables $< + +reject_ser.table.$(OBJEXT): reject_ser.table.c + $(AM_V_CC)$(COMPILE) -DTEST_HAS_TABLES_EXTERNAL -c -o $@ $< + +reject_ser.table$(EXEEXT): reject_ser.table.$(OBJEXT) + $(AM_V_CCLD)$(LINK) $^ + +top_main.$(OBJEXT): top.h +top.h: top.c + +# We separate out the tableopts _SOURCES variables and the linking +# rules for those programs because automake has no way to specify such +# things with a loop in a variable (even though make can do such +# things) and the resultant list is both long an unenlightening. And +# it can be / is generated by a shell script, tableopts.sh. + +tableopts.am: tableopts.sh + $(SHELL) $(srcdir)/tableopts.sh > $(srcdir)/tableopts.am + +include $(srcdir)/tableopts.am + +tableopts := -Ca -Ce -Cf -CF -Cm -Cem -Cae -Caef -CaeF -Cam -Caem +tableopts_opt_tests := $(foreach opt,$(tableopts), tableopts_opt_nr$(opt) tableopts_opt_r$(opt)) +tableopts_sertests := $(foreach opt,$(tableopts), tableopts_ser_nr$(opt) tableopts_ser_r$(opt)) +tableopts_vertests := $(foreach opt,$(tableopts), tableopts_ver_nr$(opt) tableopts_ver_r$(opt)) +tableopts_tests := $(tableopts_opttests) $(tableopts_vertests) $(tableopts_sertests) + +tableopts_c := $(addsuffix .c,$(tableopts_tests)) + +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) + $(AM_V_LEX)$(FLEX) --unsafe-no-m4-sect3-escape -P $(subst -,_,$(basename $(*F))) $* -o $@ $< + +tableopts_opt_nr%.$(OBJEXT): tableopts_opt_nr%.c + $(AM_V_CC)$(COMPILE) -c -o $@ $< + +tableopts_opt_r%.c: tableopts.l4 $(FLEX) + $(AM_V_LEX)$(FLEX) --unsafe-no-m4-sect3-escape -P $(subst -,_,$(basename $(*F))) --reentrant $* -o $@ $< + +tableopts_opt_r%.$(OBJEXT): tableopts_opt_r%.c + $(AM_V_CC)$(COMPILE) -DTEST_IS_REENTRANT -c -o $@ $< + +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) + $(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 + $(AM_V_CC)$(COMPILE) -DTEST_HAS_TABLES_EXTERNAL -c -o $@ $< + +tableopts_ser_r%.c: tableopts.l4 $(FLEX) + $(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 + $(AM_V_CC)$(COMPILE) -DTEST_HAS_TABLES_EXTERNAL -DTEST_IS_REENTRANT -c -o $@ $< + +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) + $(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 + $(AM_V_CC)$(COMPILE) -DTEST_HAS_TABLES_EXTERNAL -c -o $@ $< + +tableopts_ver_nr%.ver$(EXEEXT): tableopts_ver_nr%.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $^ + +tableopts_ver_r%.c: tableopts.l4 $(FLEX) + $(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 + $(AM_V_CC)$(COMPILE) -DTEST_HAS_TABLES_EXTERNAL -DTEST_IS_REENTRANT -c -o $@ $< diff --git a/tests/README b/tests/README index f948eaf..f1b9ba0 100644 --- a/tests/README +++ b/tests/README @@ -8,14 +8,14 @@ this directory and its contents. * STRUCTURE OF THE TEST SUITE -The test suite consists of several directories, each containing a -scanner known to work with the most recent version of flex. In +The testsuite consists of several tests. Each test is centered around +a scanner known to work with the most recent version of flex. In general, after you modify your copy of the flex distribution, you -should re-run the test suite. Some of the tests may require certain tools -to be available (e.g., bison, diff). If any test returns an error or -generates an error message, then your modifications *may* have broken -a feature of flex. At a minimum, you'll want to investigate the -failure and determine if it's truly significant. +should re-run the test suite. Some of the tests may require certain +tools to be available (e.g., bison, diff). If any test returns an +error or generates an error message, then your modifications *may* +have broken a feature of flex. At a minimum, you'll want to +investigate the failure and determine if it's truly significant. * HOW TO RUN THE TEST SUITE @@ -26,52 +26,33 @@ To build and execute all tests from the top level of the flex source tree: To build and execute a single test: $ cd tests/ # from the top level of the flex tree. - $ cd test-pthread-nr # for example - $ make test + $ make testname.log -* HOW TO ADD A NEW TEST TO THE TEST SUITE + where "testname" is the name of the test. This is an automake-ism + that will create (or re-create, if need be), a log of the particular + test run that you're working on. -**- RUN the script `create-test` found in this directory with a single -argument of the name of the test you want to create. If it fails with -a message about a non-existent file `config.status', then run the -configure script in the top-level directory and everything will be -fine. If it fails to work for you other than this, report it as a -bug. +* HOW TO ADD A NEW TEST TO THE TEST SUITE -** Modify the files in the newly created directory so that they test -whatever feature of flex you are interested in. +** List your test in the TESTS variable in Makefile.am in this + directory. Note that due to the large number of tests, we use + variables to group similar tests together. This also helps with + handling the automake test suite requirements. Hopefully your test + can be listed in SIMPLE_TESTS. You'll need to add the appropriate + automake _SOURCES variable as well. If you're unsure, then consult + the automake manual, paying attention to the parallel test harness + section. ** On success, your test should return zero. ** On error, your test should return 1 (one) and print a message to -stderr, which will have been redirected to the file named, "OUTPUT", -in your test's directory. +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). See "test-bison-nr/Makefile.am" for - an example. - -** You must modify the last few lines of the top-level configure.in by - adding the Makefile for your test directory. (This step is - done automatically by `create-test`.) - -** You must add the name of your test to the SUBDIRS variable in - tests/Makefile.am. (This is also done automatically for you by `create-test'.) - -** Add a description of your new test to the end of the file - `descriptions'. Remember to keep the description as brief as - possible, preferably to one line. - -** You will have to run the autogen.sh script in the top-level - directory as well as run the configure script in that - directory. (Note that running config.status may prove easier or - quicker.) - -** The easiest way for you to submit your new test to the flex - maintainers is by generating a patch. The flex maintainers only - need to have the Makefile.am, the flex input file, the test input - file (if there is one) and any other files necessary to compile the - test. You do not need to submit files generated by autoconf, - automake, configure etc. It would be helpful to include the file - .cvsignore which you will find in your test directory if you used - the `create-test' script. + 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 + suitable means. diff --git a/tests/TEMPLATE/.gitignore b/tests/TEMPLATE/.gitignore deleted file mode 100644 index 699370b..0000000 --- a/tests/TEMPLATE/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -Makefile -Makefile.in -parser.c -parser.h -scanner.c -TEMPLATE -OUTPUT -.deps diff --git a/tests/TEMPLATE/Makefile.am b/tests/TEMPLATE/Makefile.am deleted file mode 100644 index 531d931..0000000 --- a/tests/TEMPLATE/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - -FLEX = $(top_builddir)/flex - -builddir = @builddir@ - -EXTRA_DIST = scanner.l parser.y test.input -CLEANFILES = scanner.c scanner.h parser.c parser.h $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o # parser.o - -AM_CPPFLAGS = -I$(srcdir) -I$(builddir) -I$(top_srcdir) -I$(top_builddir) -#LDFLAGS = $(top_srcdir)/libfl.a -#LFLAGS = --header="scanner.h" -#YFLAGS = --defines --output=parser.c - -testname = TEMPLATE - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $(LFLAGS) $< - -parser.c: $(srcdir)/parser.y - $(BISON) $(YFLAGS) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname)$(EXEEXT) < $(srcdir)/test.input - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< diff --git a/tests/TEMPLATE/cvsignore b/tests/TEMPLATE/cvsignore deleted file mode 100644 index 5726ff9..0000000 --- a/tests/TEMPLATE/cvsignore +++ /dev/null @@ -1,4 +0,0 @@ -Makefile -parser.c -parser.h -scanner.c diff --git a/tests/TEMPLATE/parser.y b/tests/TEMPLATE/parser.y deleted file mode 100644 index 54c428b..0000000 --- a/tests/TEMPLATE/parser.y +++ /dev/null @@ -1,61 +0,0 @@ -/* - * This file is part of flex. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE. - */ - -/* A dummy template parser to build "parser.c" and "parser.h". - How to compile: - bison --defines --output-file="parser.c" --name-prefix="test" parser.y - */ -%{ -#include <stdio.h> -#include <stdlib.h> -#include "config.h" - -#define YYERROR_VERBOSE 1 /* For debugging. */ -/* #define YYPARSE_PARAM scanner */ /* For pure bison parser. */ -/* #define YYLEX_PARAM scanner */ /* For reentrant flex. */ - - -int yyerror(char* msg); -extern int testlex(); - -%} - -%% - -rule: ; - -%% - -int yyerror(char* msg) { - fprintf(stderr,"%s\n",msg); - return 0; -} - -/* -int -main ( int argc, char** argv ) -{ - yyparse (); - return 0; -} -*/ diff --git a/tests/test-alloc-extra/scanner.l b/tests/alloc_extra.l index bedd43b..c974777 100644 --- a/tests/test-alloc-extra/scanner.l +++ b/tests/alloc_extra.l @@ -43,13 +43,10 @@ struct Check { /* Save char into junk array at next position. */ static void check_extra ( yyscan_t scanner ); -/* Special yyalloc */ -void *yyalloc ( size_t size, yyscan_t scanner ); - %} -%option 8bit outfile="scanner.c" prefix="test" -%option nounput nomain noyywrap nodefault +%option 8bit prefix="test" +%option nounput nomain noyywrap nodefault noinput %option warn %option extra-type="struct Check *" %option reentrant @@ -65,7 +62,7 @@ void *yyalloc ( size_t size, yyscan_t scanner ); int main(void); int -main () +main (void) { yyscan_t scanner; struct Check check; @@ -78,8 +75,8 @@ main () testset_in(stdin, scanner); testset_out(stdout, scanner); - /* Test to confirm that yyalloc was called from - * yylex_init_extra with the yyextra argument. + /* Test to confirm that testalloc was called from + * testlex_init_extra with the testextra argument. */ check_extra(scanner); @@ -89,7 +86,7 @@ main () return 0; } -void *yyalloc(size_t size, yyscan_t scanner) +void *testalloc(size_t size, yyscan_t scanner) { struct Check *check; check = testget_extra(scanner); diff --git a/tests/test-alloc-extra/test.input b/tests/alloc_extra.txt index 243df29..243df29 100644 --- a/tests/test-alloc-extra/test.input +++ b/tests/alloc_extra.txt diff --git a/tests/test-array-nr/scanner.l b/tests/array_nr.l index 068c674..f4f0f1b 100644 --- a/tests/test-array-nr/scanner.l +++ b/tests/array_nr.l @@ -30,8 +30,8 @@ %} -%option 8bit outfile="scanner.c" prefix="test" -%option nounput nomain noyywrap +%option 8bit prefix="test" +%option nounput nomain noyywrap noinput %option warn array @@ -45,7 +45,7 @@ int main (void); int -main () +main (void) { yyin = stdin; yyout = stdout; diff --git a/tests/TEMPLATE/test.input b/tests/array_nr.txt index 7288a40..7288a40 100644 --- a/tests/TEMPLATE/test.input +++ b/tests/array_nr.txt diff --git a/tests/test-array-r/scanner.l b/tests/array_r.l index 2d4c1b1..68a6299 100644 --- a/tests/test-array-r/scanner.l +++ b/tests/array_r.l @@ -30,8 +30,8 @@ %} -%option 8bit outfile="scanner.c" prefix="test" -%option nounput nomain noyywrap +%option 8bit prefix="test" +%option nounput nomain noyywrap noinput %option warn array reentrant @@ -45,7 +45,7 @@ int main(void); int -main () +main (void) { yyscan_t lexer; diff --git a/tests/test-array-nr/test.input b/tests/array_r.txt index 7288a40..7288a40 100644 --- a/tests/test-array-nr/test.input +++ b/tests/array_r.txt diff --git a/tests/test-basic-nr/scanner.l b/tests/basic_nr.l index c284884..bbe87c4 100644 --- a/tests/test-basic-nr/scanner.l +++ b/tests/basic_nr.l @@ -23,7 +23,6 @@ /* TEST scanner. Basic non-reentrant scanner. - Compile with: flex scanner.l Sample Input: # this is a comment @@ -35,8 +34,8 @@ #include "config.h" %} -%option prefix="test" outfile="scanner.c" -%option nounput noyywrap noyylineno warn nodefault +%option prefix="test" +%option nounput noyywrap noyylineno warn nodefault noinput IDENT [[:alnum:]_-] WS [[:blank:]] @@ -53,7 +52,7 @@ WS [[:blank:]] int main(void); -int main () +int main (void) { yyin = stdin; yyout = stdout; @@ -63,4 +62,3 @@ int main () printf("TEST RETURNING OK.\n"); return 0; } - diff --git a/tests/test-basic-nr/test.input b/tests/basic_nr.txt index 642e0fb..642e0fb 100644 --- a/tests/test-basic-nr/test.input +++ b/tests/basic_nr.txt diff --git a/tests/test-basic-r/scanner.l b/tests/basic_r.l index 6e3510f..43d3a88 100644 --- a/tests/test-basic-r/scanner.l +++ b/tests/basic_r.l @@ -33,8 +33,8 @@ #include "config.h" %} -%option prefix="test" outfile="scanner.c" -%option nounput noyywrap noyylineno warn nodefault +%option prefix="test" +%option nounput noyywrap noyylineno warn nodefault noinput %option reentrant IDENT [[:alnum:]_-] @@ -52,16 +52,16 @@ WS [[:blank:]] int main(void); -int main () +int main (void) { yyscan_t lexer; - yylex_init( &lexer ); - yyset_out ( stdout,lexer); - yyset_in ( stdin, lexer); - while( yylex(lexer) ) + testlex_init( &lexer ); + testset_out ( stdout,lexer); + testset_in ( stdin, lexer); + while( testlex(lexer) ) { } - yylex_destroy( lexer ); + testlex_destroy( lexer ); printf("TEST RETURNING OK.\n"); return 0; } diff --git a/tests/test-basic-r/test.input b/tests/basic_r.txt index 2160628..2160628 100644 --- a/tests/test-basic-r/test.input +++ b/tests/basic_r.txt diff --git a/tests/test-bison-nr/test.input b/tests/bison_nr.txt index 94adcb2..94adcb2 100644 --- a/tests/test-bison-nr/test.input +++ b/tests/bison_nr.txt diff --git a/tests/test-bison-nr/main.c b/tests/bison_nr_main.c index 49dde7c..dfd6749 100644 --- a/tests/test-bison-nr/main.c +++ b/tests/bison_nr_main.c @@ -21,13 +21,15 @@ * PURPOSE. */ -#include "parser.h" -#include "scanner.h" +#include "bison_nr_parser.h" +#include "bison_nr_scanner.h" -extern int testparse(void); int main ( int argc, char** argv ) { + (void)argc; + (void)argv; + /*yydebug =1;*/ testin = stdin; testparse ( ); diff --git a/tests/test-bison-nr/parser.y b/tests/bison_nr_parser.y index 2cbf9aa..b981f7e 100644 --- a/tests/test-bison-nr/parser.y +++ b/tests/bison_nr_parser.y @@ -30,17 +30,18 @@ #include <stdlib.h> #include <string.h> #include "config.h" +#include "bison_nr_parser.h" +#include "bison_nr_scanner.h" #define YYERROR_VERBOSE 1 /* #define YYPARSE_PARAM scanner */ /* #define YYLEX_PARAM scanner */ -int yyerror(char* msg); -extern int testget_lineno(void); +int yyerror(const char* msg); /* A dummy function. A check against seg-faults in yylval->str. */ -int process_text(char* s) { +static int process_text(char* s) { int total =0; while(*s) { total += (int) *s; @@ -52,7 +53,7 @@ int process_text(char* s) { %} -%pure_parser +%pure-parser %union { int lineno; @@ -89,7 +90,7 @@ line: %% -int yyerror(char* msg) { +int yyerror(const char* msg) { fprintf(stderr,"%s\n",msg); return 0; } diff --git a/tests/test-bison-nr/scanner.l b/tests/bison_nr_scanner.l index 2510de6..0bd871c 100644 --- a/tests/test-bison-nr/scanner.l +++ b/tests/bison_nr_scanner.l @@ -25,16 +25,16 @@ /* The scanner expects to link to bison yylval . */ #include <stdio.h> #include <stdlib.h> -#include "parser.h" +#include "bison_nr_parser.h" #include "config.h" static char* STRDUP(char* s1); #define YY_EXTRA_TYPE int %} -%option 8bit outfile="scanner.c" prefix="test" +%option 8bit prefix="test" %option bison-locations yylineno -%option nomain nounput noyy_top_state noyywrap nodefault warn -%option prefix="test" header="scanner.h" yylineno +%option prefix="test" header="bison_nr_scanner.h" yylineno +%option nomain nounput noyy_top_state noyywrap nodefault noinput warn %% @@ -56,7 +56,7 @@ static char* STRDUP(char* s1); static char* STRDUP(char* s1) { - char* s2 = (char*)malloc(strlen(s1)+1); + char* s2 = malloc(strlen(s1)+1); sprintf(s2,"%s",s1); return s2; } diff --git a/tests/test-bison-yylloc/test.input b/tests/bison_yylloc.txt index 94adcb2..94adcb2 100644 --- a/tests/test-bison-yylloc/test.input +++ b/tests/bison_yylloc.txt diff --git a/tests/test-bison-yylval/main.c b/tests/bison_yylloc_main.c index 30c4314..0274d39 100644 --- a/tests/test-bison-yylval/main.c +++ b/tests/bison_yylloc_main.c @@ -21,12 +21,16 @@ * PURPOSE. */ -#include "parser.h" -#include "scanner.h" +#include "bison_yylloc_parser.h" +#include "bison_yylloc_scanner.h" int main ( int argc, char** argv ) { yyscan_t scanner; + + (void)argc; + (void)argv; + /*yydebug =1;*/ testlex_init ( &scanner ); testset_in(stdin,scanner); @@ -36,4 +40,5 @@ int main ( int argc, char** argv ) } + /* vim:set tabstop=8 softtabstop=4 shiftwidth=4: */ diff --git a/tests/test-bison-yylloc/parser.y b/tests/bison_yylloc_parser.y index e8f4e56..93c63c0 100644 --- a/tests/test-bison-yylloc/parser.y +++ b/tests/bison_yylloc_parser.y @@ -22,25 +22,27 @@ */ %parse-param { void* scanner } +%lex-param { void* scanner } /* How to compile: - bison --defines --output-file="parser.c" --name-prefix="test" parser.y + bison --defines --output-file="bison_yylloc_parser.c" --name-prefix="test" parser.y */ %{ #include <stdio.h> #include <stdlib.h> #include <string.h> #include "config.h" +#include "bison_yylloc_parser.h" +#include "bison_yylloc_scanner.h" -#define YYERROR_VERBOSE 1 -#define YYLEX_PARAM scanner +int yyerror(YYLTYPE *location, void* scanner, const char* msg); -extern int testget_lineno(void*); +#define YYERROR_VERBOSE 1 /* A dummy function. A check against seg-faults in yylval->str. */ -int process_text(char* s) { +static int process_text(char* s) { int total =0; while(*s) { total += (int) *s; @@ -52,7 +54,7 @@ int process_text(char* s) { %} -%pure_parser +%pure-parser %union { int lineno; @@ -78,7 +80,7 @@ line: /* Check lineno. */ if( $1 != @1.first_line || $1 != testget_lineno(scanner)) { - yyerror("Parse failed: Line numbers do not match."); + yyerror(0, 0, "Parse failed: Line numbers do not match."); YYABORT; } @@ -89,7 +91,9 @@ line: %% -int yyerror(void* scanner, char* msg) { +int yyerror(YYLTYPE *location, void* scanner, const char* msg) { + (void)location; + (void)scanner; fprintf(stderr,"%s\n",msg); return 0; } diff --git a/tests/test-bison-yylloc/scanner.l b/tests/bison_yylloc_scanner.l index aaf6fd7..eab898c 100644 --- a/tests/test-bison-yylloc/scanner.l +++ b/tests/bison_yylloc_scanner.l @@ -25,16 +25,16 @@ /* The scanner expects to link to bison yylval . */ #include <stdio.h> #include <stdlib.h> -#include "parser.h" +#include "bison_yylloc_parser.h" #include "config.h" static char* STRDUP(char* s1); #define YY_EXTRA_TYPE int %} -%option 8bit outfile="scanner.c" prefix="test" +%option 8bit prefix="test" %option reentrant bison-bridge bison-locations yylineno -%option nomain nounput noyy_top_state noyywrap nodefault warn -%option prefix="test" header="scanner.h" +%option header="bison_yylloc_scanner.h" +%option nomain nounput noyy_top_state noyywrap nodefault noinput warn %% @@ -59,7 +59,7 @@ static char* STRDUP(char* s1); static char* STRDUP(char* s1) { - char* s2 = (char*)malloc(strlen(s1)+1); + char* s2 = malloc(strlen(s1)+1); sprintf(s2,"%s",s1); return s2; } diff --git a/tests/test-bison-yylval/test.input b/tests/bison_yylval.txt index 846f206..846f206 100644 --- a/tests/test-bison-yylval/test.input +++ b/tests/bison_yylval.txt diff --git a/tests/test-bison-yylloc/main.c b/tests/bison_yylval_main.c index 24568a9..fb04538 100644 --- a/tests/test-bison-yylloc/main.c +++ b/tests/bison_yylval_main.c @@ -21,12 +21,16 @@ * PURPOSE. */ -#include "parser.h" -#include "scanner.h" +#include "bison_yylval_parser.h" +#include "bison_yylval_scanner.h" int main ( int argc, char** argv ) { yyscan_t scanner; + + (void)argc; + (void)argv; + /*yydebug =1;*/ testlex_init ( &scanner ); testset_in(stdin,scanner); @@ -36,5 +40,4 @@ int main ( int argc, char** argv ) } - /* vim:set tabstop=8 softtabstop=4 shiftwidth=4: */ diff --git a/tests/test-bison-yylval/parser.y b/tests/bison_yylval_parser.y index 0ffdb89..3fc9c58 100644 --- a/tests/test-bison-yylval/parser.y +++ b/tests/bison_yylval_parser.y @@ -26,18 +26,21 @@ bison --defines --output-file="parser.c" --name-prefix="test" parser.y */ %parse-param { void* scanner } +%lex-param { void* scanner } %{ #include <stdio.h> #include <stdlib.h> #include <string.h> #include "config.h" +#include "bison_yylval_parser.h" +#include "bison_yylval_scanner.h" #define YYERROR_VERBOSE 1 -#define YYLEX_PARAM scanner +int yyerror(void* scanner, const char* msg); /* A dummy function. A check against seg-faults in yylval->str. */ -int process_text(char* s) { +static int process_text(char* s) { int total =0; while(*s) { total += (int) *s; @@ -49,7 +52,7 @@ int process_text(char* s) { %} -%pure_parser +%pure-parser %union { long unused; @@ -74,7 +77,8 @@ starttag: LT TAGNAME GT { process_text($2); free($2);} ; endtag: LTSLASH TAGNAME GT { process_text($2);free($2);} ; %% -int yyerror(void* scanner, char* msg) { +int yyerror(void* scanner, const char* msg) { + (void)scanner; fprintf(stderr,"%s\n",msg); return 0; } diff --git a/tests/test-bison-yylval/scanner.l b/tests/bison_yylval_scanner.l index 7e902f7..3aa7ea9 100644 --- a/tests/test-bison-yylval/scanner.l +++ b/tests/bison_yylval_scanner.l @@ -25,7 +25,7 @@ /* The scanner expects to link to bison yylval . */ #include <stdio.h> #include <stdlib.h> -#include "parser.h" +#include "bison_yylval_parser.h" #include "config.h" static char* STRDUP(char* s1); @@ -33,10 +33,10 @@ enum yesno_t { no=0, yes=1 }; #define YY_EXTRA_TYPE enum yesno_t %} -%option 8bit outfile="scanner.c" prefix="test" +%option 8bit prefix="test" %option reentrant bison-bridge -%option noyywrap nomain nounput noyy_top_state noyywrap nodefault warn -%option prefix="test" header="scanner.h" +%option header="bison_yylval_scanner.h" +%option noyywrap nomain nounput noyy_top_state noyywrap nodefault noinput warn %option stack @@ -52,7 +52,7 @@ enum yesno_t { no=0, yes=1 }; "</" { NEED_TAG_NAME= yes; yy_push_state( IN_TAG, yyscanner); return LTSLASH;} "<"[^[:alpha:]] { yy_push_state(DISCARD_THRU_GT,yyscanner); } "<" { NEED_TAG_NAME= yes; yy_push_state( IN_TAG, yyscanner); return LT; } -[^<]{1,512} { yyget_lval(yyscanner)->str = STRDUP(yytext); return TEXT;} +[^<]{1,512} { testget_lval(yyscanner)->str = STRDUP(yytext); return TEXT;} } <IN_TAG>{ ">" { yy_pop_state( yyscanner ); return GT; } @@ -75,7 +75,7 @@ enum yesno_t { no=0, yes=1 }; static char* STRDUP(char* s1) { - char* s2 = (char*)malloc(strlen(s1)+1); + char* s2 = malloc(strlen(s1)+1); sprintf(s2,"%s",s1); return s2; } diff --git a/tests/test-c-cpp-nr/scanner.l b/tests/c_cxx_nr.lll index e184008..24a73d7 100644 --- a/tests/test-c-cpp-nr/scanner.l +++ b/tests/c_cxx_nr.lll @@ -32,7 +32,7 @@ %} -%option 8bit outfile="scanner.cpp" prefix="test" +%option 8bit prefix="test" %option nounput nomain noyywrap %option warn @@ -48,10 +48,10 @@ int main(void); int main () { - yyin = stdin; - yyout = stdout; - yylex(); - yylex_destroy(); + testin = stdin; + testout = stdout; + testlex(); + testlex_destroy(); printf("TEST RETURNING OK.\n"); return 0; } diff --git a/tests/test-array-r/test.input b/tests/c_cxx_nr.txt index 7288a40..7288a40 100644 --- a/tests/test-array-r/test.input +++ b/tests/c_cxx_nr.txt diff --git a/tests/test-c-cpp-r/scanner.l b/tests/c_cxx_r.lll index 3182d1b..e1fe9da 100644 --- a/tests/test-c-cpp-r/scanner.l +++ b/tests/c_cxx_r.lll @@ -32,7 +32,7 @@ %} -%option 8bit outfile="scanner.cpp" prefix="test" +%option 8bit prefix="test" %option nounput nomain noyywrap %option warn reentrant @@ -49,13 +49,13 @@ int main () { yyscan_t lexer; - yylex_init( &lexer ); - yyset_out ( stdout,lexer); - yyset_in ( stdin, lexer); - while( yylex(lexer) ) + testlex_init( &lexer ); + testset_out ( stdout,lexer); + testset_in ( stdin, lexer); + while( testlex(lexer) ) { } - yylex_destroy( lexer ); + testlex_destroy( lexer ); printf("TEST RETURNING OK.\n"); return 0; } diff --git a/tests/test-c++-basic/test.input b/tests/c_cxx_r.txt index 7288a40..7288a40 100644 --- a/tests/test-c++-basic/test.input +++ b/tests/c_cxx_r.txt diff --git a/tests/test-ccl/scanner.l b/tests/ccl.l index 330278a..9511604 100644 --- a/tests/test-ccl/scanner.l +++ b/tests/ccl.l @@ -32,8 +32,8 @@ #define a_ok() do{printf("OK: flex line %d. input line %d.\n", __LINE__, yylineno); return 1;}while(0) %} -%option 8bit outfile="scanner.c" prefix="test" -%option nounput nomain noyywrap +%option 8bit prefix="test" +%option nounput nomain noyywrap noinput %option warn @@ -84,7 +84,7 @@ int main(void); int -main () +main (void) { yyin = stdin; yyout = stdout; diff --git a/tests/test-ccl/test.input b/tests/ccl.txt index b318fe6..b318fe6 100644 --- a/tests/test-ccl/test.input +++ b/tests/ccl.txt diff --git a/tests/create-test b/tests/create-test deleted file mode 100755 index 05e6864..0000000 --- a/tests/create-test +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -TESTFILES="Makefile.am scanner.l parser.y .cvsignore test.input" - -if [ ! $# -eq 1 ] ; then - echo 1>&2 Usage: $0 test-name - exit 1 -fi - -if test -e "$1" ; then - echo 1>&2 "$1 exists already" - exit 1 -fi - -mkdir $1 -if test "$?" -ne 0 ; then - echo 1>&2 "mkdir $1 failed" - exit 1 -fi - -for i in $TESTFILES ; do - cp TEMPLATE/$i $1/$i -done - -echo "$1" >> "$1"/.cvsignore - -sed -i '/--new-test-here--/i\ -tests/'"$1"'/Makefile' ../configure.in - -sed -i '/^\(DIST_\)\?SUBDIRS/a\ - '"$1"' \\' Makefile.am - -sed -i "s:TEMPLATE:$1:g" "$1"/Makefile.am diff --git a/tests/test-c++-basic/scanner.l b/tests/cxx_basic.ll index 48baf00..6ffa39c 100644 --- a/tests/test-c++-basic/scanner.l +++ b/tests/cxx_basic.ll @@ -27,10 +27,9 @@ %} -%option 8bit outfile="scanner.cpp" prefix="test" -%option nounput nomain noyywrap +%option 8bit prefix="test" %option warn c++ - +%option nounput nomain noinput noyywrap %% diff --git a/tests/test-c++-yywrap/test.input b/tests/cxx_basic.txt index 7288a40..7288a40 100644 --- a/tests/test-c++-yywrap/test.input +++ b/tests/cxx_basic.txt diff --git a/tests/test-c++-multiple-scanners/test.input b/tests/cxx_multiple_scanners.txt index 08498fa..08498fa 100644 --- a/tests/test-c++-multiple-scanners/test.input +++ b/tests/cxx_multiple_scanners.txt diff --git a/tests/test-c++-multiple-scanners/scanner-1.l b/tests/cxx_multiple_scanners_1.ll index 38cc5d7..f4adb9d 100644 --- a/tests/test-c++-multiple-scanners/scanner-1.l +++ b/tests/cxx_multiple_scanners_1.ll @@ -24,7 +24,7 @@ %} -%option 8bit outfile="scanner-1.cpp" prefix="S1_" +%option 8bit prefix="S1_" %option nounput nomain noyywrap %option warn stack noyy_top_state diff --git a/tests/test-c++-multiple-scanners/scanner-2.l b/tests/cxx_multiple_scanners_2.ll index 15faf26..d84c530 100644 --- a/tests/test-c++-multiple-scanners/scanner-2.l +++ b/tests/cxx_multiple_scanners_2.ll @@ -24,7 +24,7 @@ %} -%option 8bit outfile="scanner-2.cpp" prefix="S2_" +%option 8bit prefix="S2_" %option nounput nomain %option warn stack noyy_top_state diff --git a/tests/test-c++-multiple-scanners/main.cpp b/tests/cxx_multiple_scanners_main.cc index 08fe2c1..08fe2c1 100644 --- a/tests/test-c++-multiple-scanners/main.cpp +++ b/tests/cxx_multiple_scanners_main.cc diff --git a/tests/TEMPLATE/scanner.l b/tests/cxx_restart.ll index c41a778..0ba6be1 100644 --- a/tests/TEMPLATE/scanner.l +++ b/tests/cxx_restart.ll @@ -22,18 +22,14 @@ */ %{ -/* A template scanner file to build "scanner.c". */ -#include <stdio.h> -#include <stdlib.h> + #include "config.h" -/*#include "parser.h" */ %} -%option 8bit outfile="scanner.c" prefix="test" -%option nounput nomain noyywrap -%option warn - +%option 8bit prefix="test" +%option warn c++ +%option nounput nomain noinput noyywrap %% @@ -44,11 +40,12 @@ int main(void); int -main () +main (void) { - yyin = stdin; - yyout = stdout; - yylex(); - printf("TEST RETURNING OK.\n"); + yyFlexLexer f; + f.switch_streams(&std::cin, &std::cout); + f.yylex(); + f.yyrestart(NULL); + std::cout << "TEST RETURNING OK." << std::endl; return 0; } diff --git a/tests/test-c-cpp-nr/test.input b/tests/cxx_restart.txt index 7288a40..7288a40 100644 --- a/tests/test-c-cpp-nr/test.input +++ b/tests/cxx_restart.txt diff --git a/tests/test-c++-yywrap/scanner.l b/tests/cxx_yywrap.ll index 433ad08..0947cec 100644 --- a/tests/test-c++-yywrap/scanner.l +++ b/tests/cxx_yywrap.ll @@ -28,7 +28,7 @@ %} -%option 8bit outfile="scanner.cpp" prefix="test" +%option 8bit prefix="test" %option nounput nomain %option warn c++ diff --git a/tests/test-c-cpp-r/test.input b/tests/cxx_yywrap.txt index 7288a40..7288a40 100644 --- a/tests/test-c-cpp-r/test.input +++ b/tests/cxx_yywrap.txt diff --git a/tests/test-debug-nr/scanner.l b/tests/debug_nr.l index 13d11d6..8110ab4 100644 --- a/tests/test-debug-nr/scanner.l +++ b/tests/debug_nr.l @@ -29,8 +29,8 @@ %} -%option 8bit outfile="scanner.c" prefix="test" -%option nounput nomain noyywrap +%option 8bit prefix="test" +%option nounput nomain noyywrap noinput %option warn debug %% @@ -41,7 +41,7 @@ int main(void); int -main () +main (void) { yyin = stdin; yyout = stdout; diff --git a/tests/test-debug-nr/test.input b/tests/debug_nr.txt index 8d6476c..8d6476c 100644 --- a/tests/test-debug-nr/test.input +++ b/tests/debug_nr.txt diff --git a/tests/test-debug-r/scanner.l b/tests/debug_r.l index 14a335e..8c2d7a5 100644 --- a/tests/test-debug-r/scanner.l +++ b/tests/debug_r.l @@ -29,8 +29,8 @@ %} -%option 8bit outfile="scanner.c" prefix="test" -%option nounput nomain noyywrap +%option 8bit prefix="test" +%option nounput nomain noyywrap noinput %option warn debug reentrant %% @@ -40,20 +40,20 @@ int main(void); -int main () +int main (void) { yyscan_t lexer; - yylex_init( &lexer ); - yyset_out ( stdout,lexer); - yyset_in ( stdin, lexer); + testlex_init( &lexer ); + testset_out ( stdout,lexer); + testset_in ( stdin, lexer); /* Just see if the next line compiles. */ testset_debug (testget_debug(lexer), lexer); - while( yylex(lexer) ) + while( testlex(lexer) ) { } - yylex_destroy( lexer ); + testlex_destroy( lexer ); printf("TEST RETURNING OK.\n"); return 0; } diff --git a/tests/test-debug-r/test.input b/tests/debug_r.txt index 8d6476c..8d6476c 100644 --- a/tests/test-debug-r/test.input +++ b/tests/debug_r.txt diff --git a/tests/descriptions b/tests/descriptions deleted file mode 100644 index 57b4885..0000000 --- a/tests/descriptions +++ /dev/null @@ -1,49 +0,0 @@ -DESCRIPTION OF TESTS - -TEMPLATE - A NO-OP skeleton scanner. -array-nr - Use %option array, non-reentrant. -array-r - Use %option array, reentrant. -basic-nr - Simple scanner, non-reentrant. -basic-r - Simple scanner, reentrant. -bison-nr - Ordinary bison-bridge. -bison-yylloc - Reentrant scanner + pure parser. Requires bison. -bison-yylval - Reentrant scanner + pure parser. Requires bison. -ccl - Character classes. -c-cpp-nr - Compile a C scanner with C++ compiler, nonreentrant. -c-cpp-r - Compile a C scanner with C++ compiler, reentrant. -c++-basic - The C++ scanner. -c++-multiple-scanners - Multiple C++ scanners. -debug-nr - Use yy_flex_debug, non-reentrant. -debug-r - Use debugging functions, reentrant. -extended - Extended pattern syntax. -header-nr - Test generated header file, non-reentrant. -header-r - Test generated header file, reentrant. -include-by-buffer - YY_BUFFER_STATE, yy_push_state, etc. -include-by-push - yypush_buffer_state, yypop_buffer_state -include-by-reentrant - Nested scanners. -linedir-r - Check #line directives. -lineno-nr - Use %option yylineno, non-reentrant. -lineno-r - Use %option yylineno, reentrant. -mem-nr - Override memory api, non-reentrant. -mem-r - Override memory api, reentrant. -multiple-scanners-nr - #include and run two separate scanners, non-reentrant. -multiple-scanners-r - #include and run two separate scanners, reentrant. -noansi-nr - test %option noansi-*, non-reentrant. -noansi-r - test %option noansi-*, reentrant. -posix - Test %option posix-compat. -posixly-correct - Test POSIXLY_CORRECT variable. -prefix-nr - Verify prefixes are working, nonreentrant. -prefix-r - Verify prefixes are working, reentrant. -pthread - Pthreads test. A NO-OP if libpthread not found. -quotes - Verify user code is not mangled by m4. -reject - Check REJECT code. -rescan-nr - Reuse same scanner several times, nonreentrant. -rescan-r - Reuse same scanner several times, reentrant. -string-nr - Scan strings, non-reentrant. -string-r - Scan strings, reentrant. -table-opts - Try every table compression option. -top - Test %top directive. -yyextra - Test yyextra. -alloc-extra - Test yy_init_extra and providing your own yyalloc. -c++-yywrap - test yywrap in c++ scanner -concatenated-options - test parsing of multiple concatenated short options diff --git a/tests/test-extended/scanner.l b/tests/extended.l index 222c7dd..9691307 100644 --- a/tests/test-extended/scanner.l +++ b/tests/extended.l @@ -30,8 +30,8 @@ %} -%option 8bit outfile="scanner.c" prefix="test" -%option nounput nomain noyywrap +%option 8bit prefix="test" +%option nounput nomain noyywrap noinput %option warn @@ -63,7 +63,7 @@ A(?x: B int main(void); int -main () +main (void) { yyin = stdin; yyout = stdout; diff --git a/tests/test-extended/test.input b/tests/extended.txt index 829e23d..829e23d 100644 --- a/tests/test-extended/test.input +++ b/tests/extended.txt diff --git a/tests/test-header-nr/test.input b/tests/header_nr.txt index 2ce5001..2ce5001 100644 --- a/tests/test-header-nr/test.input +++ b/tests/header_nr.txt diff --git a/tests/test-header-nr/main.c b/tests/header_nr_main.c index b03fe30..bb14749 100644 --- a/tests/test-header-nr/main.c +++ b/tests/header_nr_main.c @@ -21,11 +21,14 @@ * PURPOSE. */ -#include "scanner.h" +#include "header_nr_scanner.h" int main ( int argc, char** argv ) { + (void)argc; + (void)argv; + testin = stdin; testout = stdout; testlex(); diff --git a/tests/test-header-nr/scanner.l b/tests/header_nr_scanner.l index a768f72..b429a6c 100644 --- a/tests/test-header-nr/scanner.l +++ b/tests/header_nr_scanner.l @@ -29,8 +29,8 @@ %} -%option 8bit outfile="scanner.c" prefix="test" header="scanner.h" -%option nounput nomain noyywrap +%option 8bit prefix="test" header="header_nr_scanner.h" +%option nounput nomain noyywrap noinput %option warn diff --git a/tests/test-header-r/test.input b/tests/header_r.txt index 2ce5001..2ce5001 100644 --- a/tests/test-header-r/test.input +++ b/tests/header_r.txt diff --git a/tests/test-top/main.c b/tests/header_r_main.c index 353a63e..22b397d 100644 --- a/tests/test-top/main.c +++ b/tests/header_r_main.c @@ -21,7 +21,9 @@ * PURPOSE. */ -#include "scanner.h" +#include <assert.h> + +#include "header_r_scanner.h" /* The scanner itself is not important here. * We simply try to use all the functions that are exported in the @@ -30,6 +32,9 @@ int main ( int argc, char** argv ) { + (void)argc; + (void)argv; + yyscan_t scanner; FILE *fp; char * extra = "EXTRA"; @@ -40,7 +45,9 @@ main ( int argc, char** argv ) testset_extra(extra,scanner); fp = testget_in(scanner); + assert(fp == stdin); fp = testget_out(scanner); + assert(fp == stdout); while(testlex(scanner)) { char * text; @@ -58,6 +65,3 @@ main ( int argc, char** argv ) printf("TEST RETURNING OK.\n"); return 0; } - - -/* vim:set tabstop=8 softtabstop=4 shiftwidth=4: */ diff --git a/tests/test-header-r/scanner.l b/tests/header_r_scanner.l index 9f565c9..bfad8ba 100644 --- a/tests/test-header-r/scanner.l +++ b/tests/header_r_scanner.l @@ -33,8 +33,8 @@ %} %option reentrant -%option 8bit outfile="scanner.c" prefix="test" -%option nounput nomain noyywrap +%option 8bit prefix="test" header="header_r_scanner.h" +%option nounput nomain noyywrap noinput %option warn diff --git a/tests/test-include-by-buffer/scanner.l b/tests/include_by_buffer.direct.l index 3224543..79ff01c 100644 --- a/tests/test-include-by-buffer/scanner.l +++ b/tests/include_by_buffer.direct.l @@ -3,7 +3,7 @@ * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions - * are met: +f * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. @@ -29,10 +29,12 @@ #include <stdio.h> #include <stdlib.h> #include "config.h" + +int error = 0; %} -%option 8bit outfile="scanner.c" prefix="test" -%option nounput nomain noyywrap +%option 8bit prefix="test" +%option nounput nomain noyywrap noinput %option warn %x GET_FILENAME @@ -56,6 +58,7 @@ int include_stack_ptr = 0; include_stack[include_stack_ptr++] = YY_CURRENT_BUFFER; if((yyin=fopen(yytext,"r"))==NULL) { fprintf(stderr,"*** Error: Could not open include file \"%s\".\n",yytext); + error = 1; yyterminate(); } yy_switch_to_buffer( yy_create_buffer( yyin, YY_BUF_SIZE )); @@ -63,6 +66,7 @@ int include_stack_ptr = 0; } .|\n { fprintf(stderr,"Invalid input \"%s\".\n", yytext); + error = 1; yyterminate(); } } @@ -87,7 +91,7 @@ main ( int argc, char** argv ) { FILE * fp; if( argc != 2 ) { - fprintf(stderr,"*** Error: Must specifiy one filename.\n"); + fprintf(stderr,"*** Error: Must specify one filename.\n"); exit(-1); } if((fp=fopen(argv[1],"r"))==NULL) { @@ -97,6 +101,9 @@ main ( int argc, char** argv ) yyin = fp; yyout = stdout; yylex(); - printf("TEST RETURNING OK.\n"); + if (!error) + printf("TEST RETURNING OK.\n"); + else + exit(-1); return 0; } diff --git a/tests/include_by_buffer.direct.txt b/tests/include_by_buffer.direct.txt new file mode 100644 index 0000000..56f1ed2 --- /dev/null +++ b/tests/include_by_buffer.direct.txt @@ -0,0 +1,3 @@ +Beginning of "include_by_buffer.direct.txt" +#include <include_by_buffer.direct_2.txt> +End of "include_by_buffer.direct.txt" diff --git a/tests/include_by_buffer.direct_2.txt b/tests/include_by_buffer.direct_2.txt new file mode 100644 index 0000000..52e61ea --- /dev/null +++ b/tests/include_by_buffer.direct_2.txt @@ -0,0 +1,3 @@ +Beginning of "include_by_buffer.direct_2.txt" +#include <include_by_buffer.direct_3.txt> +End of "include_by_buffer.direct_2.txt" diff --git a/tests/include_by_buffer.direct_3.txt b/tests/include_by_buffer.direct_3.txt new file mode 100644 index 0000000..3cfdd0f --- /dev/null +++ b/tests/include_by_buffer.direct_3.txt @@ -0,0 +1,2 @@ +Beginning of "include_by_buffer.direct_3.txt" +End of "include_by_buffer.direct_3.txt" diff --git a/tests/test-include-by-push/scanner.l b/tests/include_by_push.direct.l index 8556152..8aaea69 100644 --- a/tests/test-include-by-push/scanner.l +++ b/tests/include_by_push.direct.l @@ -29,10 +29,12 @@ #include <stdio.h> #include <stdlib.h> #include "config.h" + +int error = 0; %} -%option 8bit outfile="scanner.c" prefix="test" -%option nounput nomain noyywrap +%option 8bit prefix="test" +%option nounput nomain noyywrap noinput %option warn %x GET_FILENAME @@ -50,20 +52,22 @@ yytext[yyleng-1]='\0'; if((yyin=fopen(yytext,"r"))==NULL) { fprintf(stderr,"*** Error: Could not open include file \"%s\".\n",yytext); + error = 1; yyterminate(); } - yypush_buffer_state( yy_create_buffer( yyin, YY_BUF_SIZE )); + testpush_buffer_state( yy_create_buffer( yyin, YY_BUF_SIZE )); BEGIN(0); } .|\n { fprintf(stderr,"Invalid input \"%s\".\n", yytext); + error = 1; yyterminate(); } } <<EOF>> { fclose(yyin); - yypop_buffer_state(); + testpop_buffer_state(); if(!YY_CURRENT_BUFFER) yyterminate(); } @@ -77,7 +81,7 @@ main ( int argc, char** argv ) { FILE * fp; if( argc != 2 ) { - fprintf(stderr,"*** Error: Must specifiy one filename.\n"); + fprintf(stderr,"*** Error: Must specify one filename.\n"); exit(-1); } if((fp=fopen(argv[1],"r"))==NULL) { @@ -87,6 +91,9 @@ main ( int argc, char** argv ) yyin = fp; yyout = stdout; yylex(); - printf("TEST RETURNING OK.\n"); + if (!error) + printf("TEST RETURNING OK.\n"); + else + exit(-1); return 0; } diff --git a/tests/include_by_push.direct.txt b/tests/include_by_push.direct.txt new file mode 100644 index 0000000..93136f6 --- /dev/null +++ b/tests/include_by_push.direct.txt @@ -0,0 +1,3 @@ +Beginning of "include_by_push.direct.txt" +#include <include_by_push.direct_2.txt> +End of "include_by_push.direct.txt" diff --git a/tests/include_by_push.direct_2.txt b/tests/include_by_push.direct_2.txt new file mode 100644 index 0000000..8b378e8 --- /dev/null +++ b/tests/include_by_push.direct_2.txt @@ -0,0 +1,3 @@ +Beginning of "include_by_push.direct_2.txt" +#include <include_by_push.direct_3.txt> +End of "include_by_push.direct_2.txt" diff --git a/tests/include_by_push.direct_3.txt b/tests/include_by_push.direct_3.txt new file mode 100644 index 0000000..8b8f9a5 --- /dev/null +++ b/tests/include_by_push.direct_3.txt @@ -0,0 +1,2 @@ +Beginning of "include_by_push.direct_3.txt" +End of "include_by_push.direct_3.txt" diff --git a/tests/test-include-by-reentrant/scanner.l b/tests/include_by_reentrant.direct.l index 8d23681..7dbad72 100644 --- a/tests/test-include-by-reentrant/scanner.l +++ b/tests/include_by_reentrant.direct.l @@ -29,10 +29,12 @@ #include <stdio.h> #include <stdlib.h> #include "config.h" + +int error = 0; %} -%option 8bit outfile="scanner.c" prefix="test" -%option nounput nomain noyywrap +%option 8bit prefix="test" +%option nounput nomain noyywrap noinput %option reentrant %option warn @@ -54,18 +56,20 @@ if((fp=fopen(yytext,"r"))==NULL) { fprintf(stderr,"*** Error: Could not open include file \"%s\".\n", yytext); + error = 1; yyterminate(); } - yylex_init(&scanner); - yyset_in( fp, scanner); - yyset_out( stdout, scanner); - yylex(scanner); - yylex_destroy(scanner); + testlex_init(&scanner); + testset_in( fp, scanner); + testset_out( stdout, scanner); + testlex(scanner); + testlex_destroy(scanner); BEGIN(0); } .|\n { fprintf(stderr,"Invalid input \"%s\".\n", yytext); + error = 1; yyterminate(); } } @@ -77,25 +81,26 @@ int main (int argc, char** argv); int -main ( argc, argv ) - int argc; - char ** argv; +main ( int argc, char **argv ) { FILE * fp; yyscan_t scanner; if( argc != 2 ) { - fprintf(stderr,"*** Error: Must specifiy one filename.\n"); + fprintf(stderr,"*** Error: Must specify one filename.\n"); exit(-1); } if((fp=fopen(argv[1],"r"))==NULL) { fprintf(stderr,"*** Error: fopen(%s) failed.\n",argv[1]); exit(-1); } - yylex_init(&scanner); - yyset_in( fp, scanner); - yyset_out( stdout, scanner); - yylex(scanner); - yylex_destroy(scanner); - printf("TEST RETURNING OK.\n"); + testlex_init(&scanner); + testset_in( fp, scanner); + testset_out( stdout, scanner); + testlex(scanner); + testlex_destroy(scanner); + if (!error) + printf("TEST RETURNING OK.\n"); + else + exit(-1); return 0; } diff --git a/tests/include_by_reentrant.direct.txt b/tests/include_by_reentrant.direct.txt new file mode 100644 index 0000000..190a600 --- /dev/null +++ b/tests/include_by_reentrant.direct.txt @@ -0,0 +1,3 @@ +Beginning of "include_by_reentrant.direct.txt". +#include <include_by_reentrant.direct_2.txt> +End of "include_by_reentrant.direct.txt". diff --git a/tests/include_by_reentrant.direct_2.txt b/tests/include_by_reentrant.direct_2.txt new file mode 100644 index 0000000..84a647b --- /dev/null +++ b/tests/include_by_reentrant.direct_2.txt @@ -0,0 +1,3 @@ +Beginning of "include_by_reentrant.direct_2.txt". +#include <include_by_reentrant.direct_3.txt> +End of "include_by_reentrant.direct_2.txt". diff --git a/tests/include_by_reentrant.direct_3.txt b/tests/include_by_reentrant.direct_3.txt new file mode 100644 index 0000000..b0fba64 --- /dev/null +++ b/tests/include_by_reentrant.direct_3.txt @@ -0,0 +1,2 @@ +Beginning of "include_by_reentrant.direct_3.txt". +End of "include_by_reentrant.direct_3.txt". diff --git a/tests/test-lineno-nr/scanner.l b/tests/lineno_nr.l index 4341335..dbe6b2d 100644 --- a/tests/test-lineno-nr/scanner.l +++ b/tests/lineno_nr.l @@ -34,8 +34,8 @@ %} -%option 8bit outfile="scanner.c" prefix="test" -%option nounput nomain noyywrap yylineno +%option 8bit prefix="test" +%option nounput nomain noyywrap noinput yylineno %option warn WORD [[:alpha:]]+ @@ -78,10 +78,10 @@ count_newlines (FILE* in) int main ( int, char**); int -main ( argc, argv ) - int argc; - char** argv; +main ( int argc, char **argv ) { + (void)argv; + if( argc > 1 ) printf("%d\n", count_newlines(stdin)); diff --git a/tests/test-lineno-nr/test.input b/tests/lineno_nr.one.txt index c1eb961..c1eb961 100644 --- a/tests/test-lineno-nr/test.input +++ b/tests/lineno_nr.one.txt diff --git a/tests/test-lineno-r/scanner.l b/tests/lineno_r.l index 8933f5f..d7230d7 100644 --- a/tests/test-lineno-r/scanner.l +++ b/tests/lineno_r.l @@ -34,8 +34,8 @@ %} -%option 8bit outfile="scanner.c" prefix="test" -%option nounput nomain noyywrap yylineno reentrant +%option 8bit prefix="test" +%option nounput nomain noyywrap noinput yylineno reentrant %option warn WORD [[:alpha:]]+ @@ -78,20 +78,20 @@ count_newlines (FILE* in) int main ( int argc, char** argv ); int -main (argc, argv) - int argc; - char ** argv; +main (int argc, char **argv) { + (void)argv; + if( argc > 1 ) printf("%d\n", count_newlines(stdin)); else{ yyscan_t s; - yylex_init(&s); - yyset_in(stdin,s); - yyset_out(stdout,s); - yylex(s); - yylex_destroy(s); + testlex_init(&s); + testset_in(stdin,s); + testset_out(stdout,s); + testlex(s); + testlex_destroy(s); } return 0; } diff --git a/tests/test-lineno-r/test.input b/tests/lineno_r.one.txt index c1eb961..c1eb961 100644 --- a/tests/test-lineno-r/test.input +++ b/tests/lineno_r.one.txt diff --git a/tests/test-lineno-trailing/scanner.l b/tests/lineno_trailing.l index 20d3c8a..cceaa23 100644 --- a/tests/test-lineno-trailing/scanner.l +++ b/tests/lineno_trailing.l @@ -34,8 +34,8 @@ %} -%option 8bit outfile="scanner.c" prefix="test" -%option nounput nomain noyywrap yylineno +%option 8bit prefix="test" +%option nounput nomain noyywrap noinput yylineno %option warn WORD [[:alpha:]]+ @@ -71,10 +71,10 @@ count_newlines (FILE* in) int main ( int, char**); int -main ( argc, argv ) - int argc; - char** argv; +main ( int argc, char **argv ) { + (void)argv; + if( argc > 1 ) printf("%d\n", count_newlines(stdin)); diff --git a/tests/test-lineno-trailing/test.input b/tests/lineno_trailing.one.txt index 201164d..201164d 100644 --- a/tests/test-lineno-trailing/test.input +++ b/tests/lineno_trailing.one.txt diff --git a/tests/test-mem-nr/scanner.l b/tests/mem_nr.l index d03996a..b7cf343 100644 --- a/tests/test-mem-nr/scanner.l +++ b/tests/mem_nr.l @@ -39,8 +39,8 @@ %} -%option 8bit outfile="scanner.c" prefix="test" -%option nounput nomain noyywrap +%option 8bit prefix="test" +%option nounput nomain noyywrap noinput noyy_top_state %option warn stack nodefault %option noyyalloc noyyrealloc noyyfree @@ -91,12 +91,12 @@ void * yyalloc(yy_size_t n) int i; total_mem += n; - p = (void*)malloc(n); + p = malloc(n); if( nptrs >= arrsz){ /* increase array size by 1 */ arrsz++; - ptrs = (struct memsz*)realloc( ptrs, arrsz * sizeof(struct memsz)); + ptrs = realloc(ptrs, (size_t) arrsz * sizeof(struct memsz)); ptrs[nptrs].p = 0; ptrs[nptrs].sz = 0; } @@ -121,7 +121,7 @@ void * yyrealloc(void* p, yy_size_t n) if ( ptrs[i].p == p){ total_mem -= ptrs[i].sz; total_mem += n; - ptrs[i].p = (void*)realloc(p,n); + ptrs[i].p = realloc(p,n); ptrs[i].sz = n; printf("yyflex_realloc(%#10lx,%8ld) total=%8ld return=%8lx\n", @@ -158,16 +158,16 @@ void yyfree(void* p) int main(void); int -main () +main (void) { arrsz = 1; - ptrs = (struct memsz*)calloc(1,sizeof(struct memsz)); + ptrs = calloc(1, sizeof(struct memsz)); nptrs = 0; yyin = stdin; yyout = stdout; - yylex(); - yylex_destroy(); + testlex(); + testlex_destroy(); free(ptrs); if ( nptrs > 0 || total_mem > 0){ diff --git a/tests/test-mem-nr/test.input b/tests/mem_nr.txt index 79aa16a..79aa16a 100644 --- a/tests/test-mem-nr/test.input +++ b/tests/mem_nr.txt diff --git a/tests/test-mem-r/scanner.l b/tests/mem_r.l index ba6e0b5..06ae2e7 100644 --- a/tests/test-mem-r/scanner.l +++ b/tests/mem_r.l @@ -39,8 +39,8 @@ %} -%option 8bit outfile="scanner.c" prefix="test" -%option nounput nomain noyywrap +%option 8bit prefix="test" +%option nounput nomain noyywrap noinput noyy_top_state %option warn stack nodefault reentrant %option noyyalloc noyyrealloc noyyfree @@ -85,18 +85,20 @@ static void dump_mem(FILE* fp){ fprintf(fp,"}\n"); } -void * yyalloc(yy_size_t n , void* yyscanner) +void * testalloc(yy_size_t n , void* yyscanner) { + (void)yyscanner; + void * p; int i; total_mem += n; - p = (void*)malloc(n); + p = malloc(n); if( nptrs >= arrsz){ /* increase array size by 1 */ arrsz++; - ptrs = (struct memsz*)realloc( ptrs, arrsz * sizeof(struct memsz)); + ptrs = realloc(ptrs, (size_t) arrsz * sizeof(struct memsz)); ptrs[nptrs].p = 0; ptrs[nptrs].sz = 0; } @@ -114,14 +116,16 @@ void * yyalloc(yy_size_t n , void* yyscanner) return p; } -void * yyrealloc(void* p, yy_size_t n , void* yyscanner) +void * testrealloc(void* p, yy_size_t n , void* yyscanner) { + (void)yyscanner; + int i; for (i=0; i < arrsz; i++) if ( ptrs[i].p == p){ total_mem -= ptrs[i].sz; total_mem += n; - ptrs[i].p = (void*)realloc(p,n); + ptrs[i].p = realloc(p, n); ptrs[i].sz = n; printf("yyflex_realloc(%#10lx,%8ld) total=%8ld return=%8lx\n", @@ -135,8 +139,10 @@ void * yyrealloc(void* p, yy_size_t n , void* yyscanner) exit(1); } -void yyfree(void* p , void* yyscanner) +void testfree(void* p , void* yyscanner) { + (void)yyscanner; + int i; for (i=0; i < arrsz; i++) if ( ptrs[i].p == p){ @@ -158,18 +164,18 @@ void yyfree(void* p , void* yyscanner) int main(void); int -main () +main (void) { yyscan_t scanner; arrsz = 1; - ptrs = (struct memsz*)calloc(1,sizeof(struct memsz)); + ptrs = calloc(1, sizeof(struct memsz)); nptrs = 0; - yylex_init(&scanner); - yyset_in(stdin,scanner); - yyset_out(stdout,scanner); - yylex(scanner); - yylex_destroy(scanner); + testlex_init(&scanner); + testset_in(stdin,scanner); + testset_out(stdout,scanner); + testlex(scanner); + testlex_destroy(scanner); free(ptrs); if ( nptrs > 0 || total_mem > 0){ diff --git a/tests/test-mem-r/test.input b/tests/mem_r.txt index 79aa16a..79aa16a 100644 --- a/tests/test-mem-r/test.input +++ b/tests/mem_r.txt diff --git a/tests/test-multiple-scanners-nr/scanner-1.l b/tests/multiple_scanners_nr_1.l index 0d520b1..fcba194 100644 --- a/tests/test-multiple-scanners-nr/scanner-1.l +++ b/tests/multiple_scanners_nr_1.l @@ -29,9 +29,9 @@ %} -%option header="scanner-1.h" -%option 8bit outfile="scanner-1.c" prefix="S1_" -%option nounput nomain noyywrap +%option header="multiple_scanners_nr_1.h" +%option 8bit prefix="S1_" +%option nounput nomain noyywrap noinput %option warn stack noyy_top_state %x ON diff --git a/tests/test-multiple-scanners-nr/scanner-2.l b/tests/multiple_scanners_nr_2.l index 88bd799..fff2e88 100644 --- a/tests/test-multiple-scanners-nr/scanner-2.l +++ b/tests/multiple_scanners_nr_2.l @@ -29,9 +29,9 @@ %} -%option header="scanner-2.h" -%option 8bit outfile="scanner-2.c" prefix="S2_" -%option nounput nomain noyywrap +%option header="multiple_scanners_nr_2.h" +%option 8bit prefix="S2_" +%option nounput nomain noyywrap noinput %option warn stack noyy_top_state %x OFF diff --git a/tests/test-multiple-scanners-nr/main.c b/tests/multiple_scanners_nr_main.c index a83bec6..497bd9f 100644 --- a/tests/test-multiple-scanners-nr/main.c +++ b/tests/multiple_scanners_nr_main.c @@ -21,12 +21,15 @@ * PURPOSE. */ -#include "scanner-1.h" -#include "scanner-2.h" +#include "multiple_scanners_nr_1.h" +#include "multiple_scanners_nr_2.h" int main ( int argc, char** argv ) { + (void)argc; + (void)argv; + int S1_ok=1, S2_ok=1; YY_BUFFER_STATE buff1, buff2; S1_out = S2_out = stdout; @@ -46,6 +49,3 @@ main ( int argc, char** argv ) printf("TEST RETURNING OK.\n"); return 0; } - - -/* vim:set tabstop=8 softtabstop=4 shiftwidth=4: */ diff --git a/tests/test-multiple-scanners-r/scanner-1.l b/tests/multiple_scanners_r_1.l index 84f8719..75ef179 100644 --- a/tests/test-multiple-scanners-r/scanner-1.l +++ b/tests/multiple_scanners_r_1.l @@ -29,11 +29,10 @@ %} -%option header="scanner-1.h" -%option 8bit outfile="scanner-1.c" prefix="S1_" -%option nounput nomain noyywrap noyy_top_state +%option header="multiple_scanners_r_1.h" +%option 8bit prefix="S1_" +%option nounput nomain noyywrap noinput noyy_top_state %option warn stack reentrant -%option tables-file="scanner-1.tables" %x ON %x OFF diff --git a/tests/test-multiple-scanners-r/scanner-2.l b/tests/multiple_scanners_r_2.l index f0d5c2d..a10d63d 100644 --- a/tests/test-multiple-scanners-r/scanner-2.l +++ b/tests/multiple_scanners_r_2.l @@ -29,11 +29,10 @@ %} -%option header="scanner-2.h" -%option 8bit outfile="scanner-2.c" prefix="S2_" -%option nounput nomain noyywrap +%option header="multiple_scanners_r_2.h" +%option 8bit prefix="S2_" +%option nounput nomain noyywrap noinput %option warn stack reentrant noyy_top_state -%option tables-file="scanner-2.tables" %x OFF %x ON diff --git a/tests/test-multiple-scanners-r/main.c b/tests/multiple_scanners_r_main.c index 3c07266..9c3fa8d 100644 --- a/tests/test-multiple-scanners-r/main.c +++ b/tests/multiple_scanners_r_main.c @@ -21,40 +21,22 @@ * PURPOSE. */ -#include "scanner-1.h" -#include "scanner-2.h" +#include "multiple_scanners_r_1.h" +#include "multiple_scanners_r_2.h" int main ( int argc, char** argv ) { + (void)argc; + (void)argv; + int S1_ok=1, S2_ok=1; - FILE * fp; YY_BUFFER_STATE buff1, buff2; yyscan_t scan1, scan2; S1_lex_init(&scan1); S2_lex_init(&scan2); - if((fp = fopen("scanner-1.tables","r")) == 0){ - fprintf(stderr,"Could not open scanner-1.tables.\n"); - exit(1); - } - if(S1_tables_fload(fp,scan1) != 0){ - fprintf(stderr,"Could not load scanner-1.tables.\n"); - exit(1); - } - fclose(fp); - - if((fp = fopen("scanner-2.tables","r")) == 0){ - fprintf(stderr,"Could not open scanner-2.tables.\n"); - exit(1); - } - if(S2_tables_fload(fp,scan2) != 0){ - fprintf(stderr,"Could not load scanner-2.tables.\n"); - exit(1); - } - fclose(fp); - S1_set_out(stdout,scan1); S2_set_out(S1_get_out(scan1),scan2); @@ -72,9 +54,6 @@ main ( int argc, char** argv ) S1__delete_buffer(buff1, scan1); S2__delete_buffer(buff2, scan2); - S1_tables_destroy(scan1); - S2_tables_destroy(scan2); - S1_lex_destroy(scan1); S2_lex_destroy(scan2); printf("TEST RETURNING OK.\n"); diff --git a/tests/no_bison_stub.c b/tests/no_bison_stub.c new file mode 100644 index 0000000..5fb3a9d --- /dev/null +++ b/tests/no_bison_stub.c @@ -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: */ diff --git a/tests/options.cn b/tests/options.cn new file mode 100755 index 0000000..5af60ea --- /dev/null +++ b/tests/options.cn @@ -0,0 +1,5 @@ +#!/bin/sh + +# Test that flex handles the grouped noop options -c and -n properly. + +echo %% | $1 -cn -o /dev/null diff --git a/tests/test-posix/scanner.l b/tests/posix.l index c6c0b51..f1851d8 100644 --- a/tests/test-posix/scanner.l +++ b/tests/posix.l @@ -40,8 +40,8 @@ int tests_ok[NUM_TESTS] = { 0 }; %} -%option 8bit outfile="scanner.c" prefix="test" -%option nounput nomain noyywrap +%option 8bit prefix="test" +%option nounput nomain noyywrap noinput %option warn posix-compat @@ -53,7 +53,7 @@ ab{3} tests_ok[0] = 1; return 0; %% -int main () +int main (void) { YY_BUFFER_STATE state; int i; @@ -63,9 +63,9 @@ int main () /* Run the tests */ for (i=0; i < NUM_TESTS; i++){ - printf("Testing: yy_scan_string(%s): ", tests[i]); - state = yy_scan_string(tests[i]); - yylex(); + printf("Testing: test_scan_string(%s): ", tests[i]); + state = test_scan_string(tests[i]); + testlex(); yy_delete_buffer(state); printf("... %s\n", tests_ok[i] ? "OK" : "FAILED"); } diff --git a/tests/test-posixly-correct/scanner.l b/tests/posixly_correct.l index 20912df..715bb27 100644 --- a/tests/test-posixly-correct/scanner.l +++ b/tests/posixly_correct.l @@ -40,8 +40,8 @@ int tests_ok[NUM_TESTS] = { 0 }; %} -%option 8bit outfile="scanner.c" prefix="test" -%option nounput nomain noyywrap +%option 8bit prefix="test" +%option nounput nomain noyywrap noinput %option warn @@ -53,7 +53,7 @@ ab{3} tests_ok[0] = 1; return 0; %% -int main () +int main (void) { YY_BUFFER_STATE state; int i; @@ -63,9 +63,9 @@ int main () /* Run the tests */ for (i=0; i < NUM_TESTS; i++){ - printf("Testing: yy_scan_string(%s): ", tests[i]); - state = yy_scan_string(tests[i]); - yylex(); + printf("Testing: test_scan_string(%s): ", tests[i]); + state = test_scan_string(tests[i]); + testlex(); yy_delete_buffer(state); printf("... %s\n", tests_ok[i] ? "OK" : "FAILED"); } diff --git a/tests/test-prefix-nr/scanner.l b/tests/prefix_nr.l index 4497aa1..2208ae0 100644 --- a/tests/test-prefix-nr/scanner.l +++ b/tests/prefix_nr.l @@ -30,8 +30,8 @@ %} -%option 8bit outfile="scanner.c" prefix="FOO" -%option nounput nomain noyywrap +%option 8bit prefix="FOO" +%option nounput nomain noyywrap noinput %option warn @@ -64,7 +64,7 @@ int main(void); int -main () +main (void) { yyin = stdin; yyout = stdout; diff --git a/tests/test-prefix-nr/test.input b/tests/prefix_nr.txt index 0e6c88f..0e6c88f 100644 --- a/tests/test-prefix-nr/test.input +++ b/tests/prefix_nr.txt diff --git a/tests/test-prefix-r/scanner.l b/tests/prefix_r.l index 4c25982..210a4de 100644 --- a/tests/test-prefix-r/scanner.l +++ b/tests/prefix_r.l @@ -30,8 +30,8 @@ %} %option reentrant -%option 8bit outfile="scanner.c" prefix="FOO" -%option nounput nomain noyywrap +%option 8bit prefix="FOO" +%option nounput nomain noyywrap noinput %option warn @@ -71,7 +71,7 @@ int main(void); int -main () +main (void) { yyscan_t scanner; FOOlex_init( &scanner); diff --git a/tests/test-prefix-r/test.input b/tests/prefix_r.txt index 0e6c88f..0e6c88f 100644 --- a/tests/test-prefix-r/test.input +++ b/tests/prefix_r.txt diff --git a/tests/test-pthread/scanner.l b/tests/pthread.l index 8603873..eb99778 100644 --- a/tests/test-pthread/scanner.l +++ b/tests/pthread.l @@ -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 @@ -46,8 +46,8 @@ static int process_text(char* s, yyscan_t scanner); %} -%option 8bit outfile="scanner.c" prefix="test" -%option nounput nomain nodefault +%option 8bit prefix="test" +%option nounput nomain nodefault noinput %option yywrap %option reentrant %option warn @@ -78,26 +78,30 @@ static int process_text(char* s, yyscan_t scanner); <INITIAL,STATE_1,STATE_2>[[:space:]\r\n]+ { } %% -int yywrap( yyscan_t scanner) { return 1; } +int testwrap( yyscan_t scanner) { + (void)scanner; + return 1; +} static int process_text(char* s, yyscan_t scanner) { - return (int)(*s) + (int) *(s + yyget_leng(scanner)-1); + (void)scanner; + return (int)(*s) + (int) *(s + testget_leng(scanner)-1); } 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. */ @@ -110,18 +114,18 @@ static pthread_mutex_t *file_locks; static char **filenames; -void * thread_func ( void* arg ) +static void * thread_func ( void* arg ) { int i; + (void)arg; + /* Wait for go-ahead. */ pthread_mutex_lock( &go_ahead); pthread_mutex_unlock(&go_ahead); for( i =0 ; i < N_SCANS ; i++ ) { - int main(int ARGC, char *ARGV[]); - int next; yyscan_t scanner; FILE * fp; @@ -132,19 +136,19 @@ void * thread_func ( void* arg ) pthread_mutex_lock ( &file_locks[ next ] ); - yylex_init( &scanner ); + testlex_init( &scanner ); /*printf("Scanning file %s #%d\n",filenames[next],i); fflush(stdout); */ if((fp = fopen(filenames[next],"r"))==NULL) { perror("fopen"); return NULL; } - yyset_in(fp,scanner); + testset_in(fp,scanner); - while( yylex( scanner) != 0) + while( testlex( scanner) != 0) { } fclose(fp); - yylex_destroy(scanner); + testlex_destroy(scanner); pthread_mutex_unlock ( &file_locks[ next ] ); } return NULL; @@ -161,7 +165,7 @@ int main (int ARGC, char *ARGV[]) } /* Allocate and initialize the locks. One for each filename in ARGV. */ - file_locks = (pthread_mutex_t*)malloc( (ARGC-1) * sizeof(pthread_mutex_t)); + file_locks = malloc((size_t) (ARGC-1) * sizeof(pthread_mutex_t)); for( i = 0; i < ARGC-1; i++) pthread_mutex_init( &file_locks[i], NULL ); @@ -200,5 +204,5 @@ int main (int ARGC, char *ARGV[]) return 0; } -#endif /* HAVE_LIBPTHREAD */ +#endif /* HAVE_PTHREAD_H */ diff --git a/tests/test-pthread/test-1.input b/tests/pthread_1.txt index 234774b..234774b 100644 --- a/tests/test-pthread/test-1.input +++ b/tests/pthread_1.txt diff --git a/tests/test-pthread/test-2.input b/tests/pthread_2.txt index 234774b..234774b 100644 --- a/tests/test-pthread/test-2.input +++ b/tests/pthread_2.txt diff --git a/tests/test-pthread/test-3.input b/tests/pthread_3.txt index 234774b..234774b 100644 --- a/tests/test-pthread/test-3.input +++ b/tests/pthread_3.txt diff --git a/tests/test-pthread/test-4.input b/tests/pthread_4.txt index 234774b..234774b 100644 --- a/tests/test-pthread/test-4.input +++ b/tests/pthread_4.txt diff --git a/tests/test-pthread/test-5.input b/tests/pthread_5.txt index 234774b..234774b 100644 --- a/tests/test-pthread/test-5.input +++ b/tests/pthread_5.txt diff --git a/tests/quote_in_comment.l b/tests/quote_in_comment.l new file mode 100644 index 0000000..a5743c2 --- /dev/null +++ b/tests/quote_in_comment.l @@ -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; +} diff --git a/tests/quote_in_comment.txt b/tests/quote_in_comment.txt new file mode 100644 index 0000000..9daeafb --- /dev/null +++ b/tests/quote_in_comment.txt @@ -0,0 +1 @@ +test diff --git a/tests/test-quotes/scanner.l b/tests/quotes.l index 0c7c482..d1b97eb 100644 --- a/tests/test-quotes/scanner.l +++ b/tests/quotes.l @@ -38,6 +38,7 @@ #include <stdio.h> #include <stdlib.h> #include "config.h" +#include <assert.h> /*#include "parser.h" */ /* sect 1 block [ 1 ] TEST_XXX */ @@ -55,12 +56,23 @@ static int foo (int i){ } %} -%option 8bit outfile="scanner.c" prefix="test" -%option nounput nomain noyywrap +%option 8bit prefix="test" +%option nounput nomain noyywrap noinput %option warn %% + /* indented code [ 1 ] */ + /* indented code [[ 2 ]] */ + /* 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 ]] */ ; @@ -68,13 +80,27 @@ 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 */ - return 1+foo(a[b[c[0]]]); // TEST_XXX + 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 */ } %% @@ -88,13 +114,17 @@ static int bar (int i){ } int main(void); +#define CONCAT_IDENTS(a, b) a##b int -main () +main (void) { - yyin = stdin; + /* m4_m4exit(100) */ + FILE *M4_YY_NOT_IN_HEADER = stdin; + yyin = CONCAT_IDENTS(M4_, YY_NOT_IN_HEADER); yyout = stdout; while (yylex()) ; + assert(!strcmp("YY_G( alpha)", "Y""Y_G( alpha)")); printf("TEST RETURNING OK.\n"); return bar(0); } diff --git a/tests/test-quotes/test.input b/tests/quotes.txt index 7288a40..7288a40 100644 --- a/tests/test-quotes/test.input +++ b/tests/quotes.txt diff --git a/tests/test-reject/scanner.l b/tests/reject.l4 index 5e5208e..9bcde22 100644 --- a/tests/test-reject/scanner.l +++ b/tests/reject.l4 @@ -29,7 +29,7 @@ %} %option 8bit prefix="test" -%option nounput nomain noyywrap +%option nounput nomain noyywrap noinput %option warn reject @@ -47,11 +47,13 @@ int main ( int argc, char** argv ) M4_YY_DECL_GUTS_VAR(); #ifdef TEST_IS_REENTRANT - yylex_init(&yyscanner); + testlex_init(&yyscanner); +#else + (void)yyscanner; #endif #ifdef TEST_HAS_TABLES_EXTERNAL - if((fp = fopen(argv[1],"r"))== NULL) + if((fp = fopen(argv[1],"rb"))== NULL) YY_FATAL_ERROR("could not open tables file for reading"); if(yytables_fload(fp M4_YY_CALL_LAST_ARG) < 0) @@ -65,13 +67,13 @@ int main ( int argc, char** argv ) YY_FATAL_ERROR("could not open input file for reading"); yyin = fp; } - while(yylex(M4_YY_CALL_ONLY_ARG) != 0) + while(testlex(M4_YY_CALL_ONLY_ARG) != 0) ; #ifdef TEST_HAS_TABLES_EXTERNAL - yytables_destroy(M4_YY_CALL_ONLY_ARG); + testtables_destroy(M4_YY_CALL_ONLY_ARG); #endif - yylex_destroy(M4_YY_CALL_ONLY_ARG); + testlex_destroy(M4_YY_CALL_ONLY_ARG); if(argc < 0) /* silence the compiler */ yyscanner = (void*)fp; diff --git a/tests/test-reject/test.input b/tests/reject.txt index 7288a40..7288a40 100644 --- a/tests/test-reject/test.input +++ b/tests/reject.txt diff --git a/tests/test-rescan-nr/scanner.l b/tests/rescan_nr.direct.l index a4ac521..536ba78 100644 --- a/tests/test-rescan-nr/scanner.l +++ b/tests/rescan_nr.direct.l @@ -27,8 +27,8 @@ #include <stdlib.h> %} -%option 8bit outfile="scanner.c" prefix="test" -%option nounput nomain noyywrap +%option 8bit prefix="test" +%option nounput nomain noyywrap noinput %option warn stack never-interactive %x STATE_1 @@ -51,19 +51,21 @@ main (int argc, char* const argv[]) FILE* fp; int i; + (void)argc; + if ((fp = fopen(argv[1],"r")) == NULL){ perror("Failed to open input file."); return 1; } - yyset_out ( stdout); + testset_out ( stdout); for (i=0; i < 4; ++i){ rewind(fp); - yyset_in ( fp); - while( yylex() ) + testset_in ( fp); + while( testlex() ) ; - yylex_destroy(); + testlex_destroy(); } printf("TEST RETURNING OK.\n"); return 0; diff --git a/tests/test-rescan-nr/test.input b/tests/rescan_nr.direct.txt index 7288a40..7288a40 100644 --- a/tests/test-rescan-nr/test.input +++ b/tests/rescan_nr.direct.txt diff --git a/tests/test-rescan-r/scanner.l b/tests/rescan_r.direct.l index 3357ce8..ceebc40 100644 --- a/tests/test-rescan-r/scanner.l +++ b/tests/rescan_r.direct.l @@ -27,8 +27,8 @@ #include <stdlib.h> %} -%option 8bit outfile="scanner.c" prefix="test" -%option nounput nomain noyywrap reentrant +%option 8bit prefix="test" +%option nounput nomain noyywrap noinput reentrant %option warn stack never-interactive %x STATE_1 @@ -52,24 +52,26 @@ main (int argc, char* const argv[]) int i; yyscan_t yyscanner; + (void)argc; + if ((fp = fopen(argv[1],"r")) == NULL){ perror("Failed to open input file."); return 1; } printf("Test 1: Reusing same scanner.\n"); - yylex_init( &yyscanner ); - yyset_out ( stdout, yyscanner); + testlex_init( &yyscanner ); + testset_out ( stdout, yyscanner); for (i=0; i < 4; ++i){ rewind(fp); - yyset_in ( fp, yyscanner); + testset_in ( fp, yyscanner); - while( yylex(yyscanner) ) + while( testlex(yyscanner) ) ; } - yylex_destroy( yyscanner ); + testlex_destroy( yyscanner ); printf("Test 1 OK\n\n"); printf("Test 2: Rescanning with new scanner each time.\n"); @@ -78,14 +80,14 @@ main (int argc, char* const argv[]) for (i=0; i < 4; ++i){ yyscan_t s; - yylex_init( &s ); - yyset_out ( stdout, s); + testlex_init( &s ); + testset_out ( stdout, s); rewind(fp); - yyset_in ( fp, s); + testset_in ( fp, s); - while( yylex(s) ) + while( testlex(s) ) ; - yylex_destroy( s ); + testlex_destroy( s ); } printf("Test 2 OK\n\n"); diff --git a/tests/test-rescan-r/test.input b/tests/rescan_r.direct.txt index 7288a40..7288a40 100644 --- a/tests/test-rescan-r/test.input +++ b/tests/rescan_r.direct.txt diff --git a/tests/test-string-nr/scanner.l b/tests/string_nr.l index 6ab5b54..8352b09 100644 --- a/tests/test-string-nr/scanner.l +++ b/tests/string_nr.l @@ -32,8 +32,8 @@ %} -%option 8bit outfile="scanner.c" prefix="test" -%option nounput nomain nodefault noyywrap +%option 8bit prefix="test" +%option nounput nomain nodefault noyywrap noinput %option warn @@ -59,37 +59,37 @@ int main(void); int -main () +main (void) { char * buf; - int len; + size_t len; YY_BUFFER_STATE state; /* Scan a good string. */ - printf("Testing: yy_scan_string(%s): ",INPUT_STRING_1); fflush(stdout); - state = yy_scan_string ( INPUT_STRING_1 ); - yylex(); + printf("Testing: test_scan_string(%s): ",INPUT_STRING_1); fflush(stdout); + state = test_scan_string ( INPUT_STRING_1 ); + testlex(); yy_delete_buffer(state); /* Scan only the first 12 chars of a string. */ - printf("Testing: yy_scan_bytes(%s): ",INPUT_STRING_2); fflush(stdout); - state = yy_scan_bytes ( INPUT_STRING_2, 12 ); - yylex(); - yy_delete_buffer(state); + printf("Testing: test_scan_bytes(%s): ",INPUT_STRING_2); fflush(stdout); + state = test_scan_bytes ( INPUT_STRING_2, 12 ); + testlex(); + test_delete_buffer(state); /* Scan directly from a buffer. We make a copy, since the buffer will be modified by flex.*/ - printf("Testing: yy_scan_buffer(%s): ",INPUT_STRING_1); fflush(stdout); + printf("Testing: test_scan_buffer(%s): ",INPUT_STRING_1); fflush(stdout); len = strlen(INPUT_STRING_1) + 2; - buf = (char*)malloc( len ); + buf = malloc(len); strcpy( buf, INPUT_STRING_1); buf[ len -2 ] = 0; /* Flex requires two NUL bytes at end of buffer. */ buf[ len -1 ] =0; - state = yy_scan_buffer( buf, len ); - yylex(); - yy_delete_buffer(state); + state = test_scan_buffer( buf, len ); + testlex(); + test_delete_buffer(state); printf("TEST RETURNING OK.\n"); return 0; diff --git a/tests/test-string-r/scanner.l b/tests/string_r.l index 6b594d7..174eb6c 100644 --- a/tests/test-string-r/scanner.l +++ b/tests/string_r.l @@ -32,8 +32,8 @@ %} -%option 8bit outfile="scanner.c" prefix="test" -%option nounput nomain nodefault noyywrap +%option 8bit prefix="test" +%option nounput nomain nodefault noyywrap noinput %option warn reentrant @@ -59,44 +59,44 @@ int main(void); int -main () +main (void) { char * buf; - int len; + size_t len; YY_BUFFER_STATE state; yyscan_t scanner=NULL; /* Scan a good string. */ - printf("Testing: yy_scan_string(%s): ",INPUT_STRING_1); fflush(stdout); - yylex_init(&scanner); - state = yy_scan_string ( INPUT_STRING_1 ,scanner); - yylex(scanner); - yy_delete_buffer(state, scanner); - yylex_destroy(scanner); + printf("Testing: test_scan_string(%s): ",INPUT_STRING_1); fflush(stdout); + testlex_init(&scanner); + state = test_scan_string ( INPUT_STRING_1 ,scanner); + testlex(scanner); + test_delete_buffer(state, scanner); + testlex_destroy(scanner); /* Scan only the first 12 chars of a string. */ - printf("Testing: yy_scan_bytes(%s): ",INPUT_STRING_2); fflush(stdout); - yylex_init(&scanner); - state = yy_scan_bytes ( INPUT_STRING_2, 12 ,scanner); - yylex(scanner); - yy_delete_buffer(state,scanner); - yylex_destroy(scanner); + printf("Testing: test_scan_bytes(%s): ",INPUT_STRING_2); fflush(stdout); + testlex_init(&scanner); + state = test_scan_bytes ( INPUT_STRING_2, 12 ,scanner); + testlex(scanner); + test_delete_buffer(state,scanner); + testlex_destroy(scanner); /* Scan directly from a buffer. We make a copy, since the buffer will be modified by flex.*/ - printf("Testing: yy_scan_buffer(%s): ",INPUT_STRING_1); fflush(stdout); + printf("Testing: test_scan_buffer(%s): ",INPUT_STRING_1); fflush(stdout); len = strlen(INPUT_STRING_1) + 2; - buf = (char*)malloc( len ); + buf = malloc(len); strcpy( buf, INPUT_STRING_1); buf[ len -2 ] = 0; /* Flex requires two NUL bytes at end of buffer. */ buf[ len -1 ] =0; - yylex_init(&scanner); - state = yy_scan_buffer( buf, len ,scanner); - yylex(scanner); - yy_delete_buffer(state,scanner); - yylex_destroy(scanner); + testlex_init(&scanner); + state = test_scan_buffer( buf, len ,scanner); + testlex(scanner); + test_delete_buffer(state,scanner); + testlex_destroy(scanner); printf("TEST RETURNING OK.\n"); return 0; diff --git a/tests/tableopts.am b/tests/tableopts.am new file mode 100644 index 0000000..099870b --- /dev/null +++ b/tests/tableopts.am @@ -0,0 +1,333 @@ +tableopts_opt_nr_Ca_opt_SOURCES = tableopts.l4 + +tableopts_opt_nr-Ca.opt$(EXEEXT): tableopts_opt_nr-Ca.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_opt_nr_Ce_opt_SOURCES = tableopts.l4 + +tableopts_opt_nr-Ce.opt$(EXEEXT): tableopts_opt_nr-Ce.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_opt_nr_Cf_opt_SOURCES = tableopts.l4 + +tableopts_opt_nr-Cf.opt$(EXEEXT): tableopts_opt_nr-Cf.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_opt_nr_CF_opt_SOURCES = tableopts.l4 + +tableopts_opt_nr-CF.opt$(EXEEXT): tableopts_opt_nr-CF.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_opt_nr_Cm_opt_SOURCES = tableopts.l4 + +tableopts_opt_nr-Cm.opt$(EXEEXT): tableopts_opt_nr-Cm.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_opt_nr_Cem_opt_SOURCES = tableopts.l4 + +tableopts_opt_nr-Cem.opt$(EXEEXT): tableopts_opt_nr-Cem.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_opt_nr_Cae_opt_SOURCES = tableopts.l4 + +tableopts_opt_nr-Cae.opt$(EXEEXT): tableopts_opt_nr-Cae.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_opt_nr_Caef_opt_SOURCES = tableopts.l4 + +tableopts_opt_nr-Caef.opt$(EXEEXT): tableopts_opt_nr-Caef.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_opt_nr_CaeF_opt_SOURCES = tableopts.l4 + +tableopts_opt_nr-CaeF.opt$(EXEEXT): tableopts_opt_nr-CaeF.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_opt_nr_Cam_opt_SOURCES = tableopts.l4 + +tableopts_opt_nr-Cam.opt$(EXEEXT): tableopts_opt_nr-Cam.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_opt_nr_Caem_opt_SOURCES = tableopts.l4 + +tableopts_opt_nr-Caem.opt$(EXEEXT): tableopts_opt_nr-Caem.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_opt_r_Ca_opt_SOURCES = tableopts.l4 + +tableopts_opt_r-Ca.opt$(EXEEXT): tableopts_opt_r-Ca.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_opt_r_Ce_opt_SOURCES = tableopts.l4 + +tableopts_opt_r-Ce.opt$(EXEEXT): tableopts_opt_r-Ce.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_opt_r_Cf_opt_SOURCES = tableopts.l4 + +tableopts_opt_r-Cf.opt$(EXEEXT): tableopts_opt_r-Cf.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_opt_r_CF_opt_SOURCES = tableopts.l4 + +tableopts_opt_r-CF.opt$(EXEEXT): tableopts_opt_r-CF.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_opt_r_Cm_opt_SOURCES = tableopts.l4 + +tableopts_opt_r-Cm.opt$(EXEEXT): tableopts_opt_r-Cm.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_opt_r_Cem_opt_SOURCES = tableopts.l4 + +tableopts_opt_r-Cem.opt$(EXEEXT): tableopts_opt_r-Cem.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_opt_r_Cae_opt_SOURCES = tableopts.l4 + +tableopts_opt_r-Cae.opt$(EXEEXT): tableopts_opt_r-Cae.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_opt_r_Caef_opt_SOURCES = tableopts.l4 + +tableopts_opt_r-Caef.opt$(EXEEXT): tableopts_opt_r-Caef.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_opt_r_CaeF_opt_SOURCES = tableopts.l4 + +tableopts_opt_r-CaeF.opt$(EXEEXT): tableopts_opt_r-CaeF.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_opt_r_Cam_opt_SOURCES = tableopts.l4 + +tableopts_opt_r-Cam.opt$(EXEEXT): tableopts_opt_r-Cam.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_opt_r_Caem_opt_SOURCES = tableopts.l4 + +tableopts_opt_r-Caem.opt$(EXEEXT): tableopts_opt_r-Caem.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ser_nr_Ca_ser_SOURCES = tableopts.l4 + +tableopts_ser_nr-Ca.ser$(EXEEXT): tableopts_ser_nr-Ca.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ser_nr_Ce_ser_SOURCES = tableopts.l4 + +tableopts_ser_nr-Ce.ser$(EXEEXT): tableopts_ser_nr-Ce.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ser_nr_Cf_ser_SOURCES = tableopts.l4 + +tableopts_ser_nr-Cf.ser$(EXEEXT): tableopts_ser_nr-Cf.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ser_nr_CF_ser_SOURCES = tableopts.l4 + +tableopts_ser_nr-CF.ser$(EXEEXT): tableopts_ser_nr-CF.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ser_nr_Cm_ser_SOURCES = tableopts.l4 + +tableopts_ser_nr-Cm.ser$(EXEEXT): tableopts_ser_nr-Cm.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ser_nr_Cem_ser_SOURCES = tableopts.l4 + +tableopts_ser_nr-Cem.ser$(EXEEXT): tableopts_ser_nr-Cem.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ser_nr_Cae_ser_SOURCES = tableopts.l4 + +tableopts_ser_nr-Cae.ser$(EXEEXT): tableopts_ser_nr-Cae.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ser_nr_Caef_ser_SOURCES = tableopts.l4 + +tableopts_ser_nr-Caef.ser$(EXEEXT): tableopts_ser_nr-Caef.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ser_nr_CaeF_ser_SOURCES = tableopts.l4 + +tableopts_ser_nr-CaeF.ser$(EXEEXT): tableopts_ser_nr-CaeF.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ser_nr_Cam_ser_SOURCES = tableopts.l4 + +tableopts_ser_nr-Cam.ser$(EXEEXT): tableopts_ser_nr-Cam.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ser_nr_Caem_ser_SOURCES = tableopts.l4 + +tableopts_ser_nr-Caem.ser$(EXEEXT): tableopts_ser_nr-Caem.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ser_r_Ca_ser_SOURCES = tableopts.l4 + +tableopts_ser_r-Ca.ser$(EXEEXT): tableopts_ser_r-Ca.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ser_r_Ce_ser_SOURCES = tableopts.l4 + +tableopts_ser_r-Ce.ser$(EXEEXT): tableopts_ser_r-Ce.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ser_r_Cf_ser_SOURCES = tableopts.l4 + +tableopts_ser_r-Cf.ser$(EXEEXT): tableopts_ser_r-Cf.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ser_r_CF_ser_SOURCES = tableopts.l4 + +tableopts_ser_r-CF.ser$(EXEEXT): tableopts_ser_r-CF.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ser_r_Cm_ser_SOURCES = tableopts.l4 + +tableopts_ser_r-Cm.ser$(EXEEXT): tableopts_ser_r-Cm.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ser_r_Cem_ser_SOURCES = tableopts.l4 + +tableopts_ser_r-Cem.ser$(EXEEXT): tableopts_ser_r-Cem.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ser_r_Cae_ser_SOURCES = tableopts.l4 + +tableopts_ser_r-Cae.ser$(EXEEXT): tableopts_ser_r-Cae.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ser_r_Caef_ser_SOURCES = tableopts.l4 + +tableopts_ser_r-Caef.ser$(EXEEXT): tableopts_ser_r-Caef.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ser_r_CaeF_ser_SOURCES = tableopts.l4 + +tableopts_ser_r-CaeF.ser$(EXEEXT): tableopts_ser_r-CaeF.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ser_r_Cam_ser_SOURCES = tableopts.l4 + +tableopts_ser_r-Cam.ser$(EXEEXT): tableopts_ser_r-Cam.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ser_r_Caem_ser_SOURCES = tableopts.l4 + +tableopts_ser_r-Caem.ser$(EXEEXT): tableopts_ser_r-Caem.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ver_nr_Ca_ver_SOURCES = tableopts.l4 + +tableopts_ver_nr-Ca.ver$(EXEEXT): tableopts_ver_nr-Ca.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ver_nr_Ce_ver_SOURCES = tableopts.l4 + +tableopts_ver_nr-Ce.ver$(EXEEXT): tableopts_ver_nr-Ce.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ver_nr_Cf_ver_SOURCES = tableopts.l4 + +tableopts_ver_nr-Cf.ver$(EXEEXT): tableopts_ver_nr-Cf.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ver_nr_CF_ver_SOURCES = tableopts.l4 + +tableopts_ver_nr-CF.ver$(EXEEXT): tableopts_ver_nr-CF.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ver_nr_Cm_ver_SOURCES = tableopts.l4 + +tableopts_ver_nr-Cm.ver$(EXEEXT): tableopts_ver_nr-Cm.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ver_nr_Cem_ver_SOURCES = tableopts.l4 + +tableopts_ver_nr-Cem.ver$(EXEEXT): tableopts_ver_nr-Cem.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ver_nr_Cae_ver_SOURCES = tableopts.l4 + +tableopts_ver_nr-Cae.ver$(EXEEXT): tableopts_ver_nr-Cae.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ver_nr_Caef_ver_SOURCES = tableopts.l4 + +tableopts_ver_nr-Caef.ver$(EXEEXT): tableopts_ver_nr-Caef.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ver_nr_CaeF_ver_SOURCES = tableopts.l4 + +tableopts_ver_nr-CaeF.ver$(EXEEXT): tableopts_ver_nr-CaeF.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ver_nr_Cam_ver_SOURCES = tableopts.l4 + +tableopts_ver_nr-Cam.ver$(EXEEXT): tableopts_ver_nr-Cam.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ver_nr_Caem_ver_SOURCES = tableopts.l4 + +tableopts_ver_nr-Caem.ver$(EXEEXT): tableopts_ver_nr-Caem.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ver_r_Ca_ver_SOURCES = tableopts.l4 + +tableopts_ver_r-Ca.ver$(EXEEXT): tableopts_ver_r-Ca.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ver_r_Ce_ver_SOURCES = tableopts.l4 + +tableopts_ver_r-Ce.ver$(EXEEXT): tableopts_ver_r-Ce.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ver_r_Cf_ver_SOURCES = tableopts.l4 + +tableopts_ver_r-Cf.ver$(EXEEXT): tableopts_ver_r-Cf.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ver_r_CF_ver_SOURCES = tableopts.l4 + +tableopts_ver_r-CF.ver$(EXEEXT): tableopts_ver_r-CF.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ver_r_Cm_ver_SOURCES = tableopts.l4 + +tableopts_ver_r-Cm.ver$(EXEEXT): tableopts_ver_r-Cm.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ver_r_Cem_ver_SOURCES = tableopts.l4 + +tableopts_ver_r-Cem.ver$(EXEEXT): tableopts_ver_r-Cem.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ver_r_Cae_ver_SOURCES = tableopts.l4 + +tableopts_ver_r-Cae.ver$(EXEEXT): tableopts_ver_r-Cae.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ver_r_Caef_ver_SOURCES = tableopts.l4 + +tableopts_ver_r-Caef.ver$(EXEEXT): tableopts_ver_r-Caef.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ver_r_CaeF_ver_SOURCES = tableopts.l4 + +tableopts_ver_r-CaeF.ver$(EXEEXT): tableopts_ver_r-CaeF.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ver_r_Cam_ver_SOURCES = tableopts.l4 + +tableopts_ver_r-Cam.ver$(EXEEXT): tableopts_ver_r-Cam.$(OBJEXT) + $(AM_V_CCLD)$(LINK) -o $@ $< + +tableopts_ver_r_Caem_ver_SOURCES = tableopts.l4 + +tableopts_ver_r-Caem.ver$(EXEEXT): tableopts_ver_r-Caem.$(OBJEXT) + $(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 + +tableopts_tables = tableopts_ser_nr-Ca.ser.tables tableopts_ser_nr-Ce.ser.tables tableopts_ser_nr-Cf.ser.tables tableopts_ser_nr-CF.ser.tables tableopts_ser_nr-Cm.ser.tables tableopts_ser_nr-Cem.ser.tables tableopts_ser_nr-Cae.ser.tables tableopts_ser_nr-Caef.ser.tables tableopts_ser_nr-CaeF.ser.tables tableopts_ser_nr-Cam.ser.tables tableopts_ser_nr-Caem.ser.tables tableopts_ser_r-Ca.ser.tables tableopts_ser_r-Ce.ser.tables tableopts_ser_r-Cf.ser.tables tableopts_ser_r-CF.ser.tables tableopts_ser_r-Cm.ser.tables tableopts_ser_r-Cem.ser.tables tableopts_ser_r-Cae.ser.tables tableopts_ser_r-Caef.ser.tables tableopts_ser_r-CaeF.ser.tables tableopts_ser_r-Cam.ser.tables tableopts_ser_r-Caem.ser.tables tableopts_ver_nr-Ca.ver.tables tableopts_ver_nr-Ce.ver.tables tableopts_ver_nr-Cf.ver.tables tableopts_ver_nr-CF.ver.tables tableopts_ver_nr-Cm.ver.tables tableopts_ver_nr-Cem.ver.tables tableopts_ver_nr-Cae.ver.tables tableopts_ver_nr-Caef.ver.tables tableopts_ver_nr-CaeF.ver.tables tableopts_ver_nr-Cam.ver.tables tableopts_ver_nr-Caem.ver.tables tableopts_ver_r-Ca.ver.tables tableopts_ver_r-Ce.ver.tables tableopts_ver_r-Cf.ver.tables tableopts_ver_r-CF.ver.tables tableopts_ver_r-Cm.ver.tables tableopts_ver_r-Cem.ver.tables tableopts_ver_r-Cae.ver.tables tableopts_ver_r-Caef.ver.tables tableopts_ver_r-CaeF.ver.tables tableopts_ver_r-Cam.ver.tables tableopts_ver_r-Caem.ver.tables diff --git a/tests/test-table-opts/scanner.l b/tests/tableopts.l4 index 3ad6199..ac85c29 100644 --- a/tests/test-table-opts/scanner.l +++ b/tests/tableopts.l4 @@ -29,7 +29,7 @@ %} %option 8bit -%option nounput nomain noyywrap +%option nounput nomain noyywrap noinput %option warn yylineno @@ -50,10 +50,12 @@ int main ( int argc, char** argv ) #ifdef TEST_IS_REENTRANT yylex_init(&yyscanner); +#else + (void)yyscanner; #endif #ifdef TEST_HAS_TABLES_EXTERNAL - if((fp = fopen(argv[1],"r"))== NULL) + if((fp = fopen(argv[1],"rb"))== NULL) YY_FATAL_ERROR("could not open tables file for reading"); if(yytables_fload(fp M4_YY_CALL_LAST_ARG) < 0) diff --git a/tests/tableopts.sh b/tests/tableopts.sh new file mode 100755 index 0000000..c1ac19e --- /dev/null +++ b/tests/tableopts.sh @@ -0,0 +1,47 @@ +#!/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. + +TABLEOPTS_TESTS="" +tableopts_tables="" + +for kind in opt ser ver ; do + for threading in nr r ; do + for opt in -Ca -Ce -Cf -CF -Cm -Cem -Cae -Caef -CaeF -Cam -Caem ; do + testname=tableopts_${kind}_${threading}${opt}.${kind} + if [ "${TABLEOPTS_TESTS}" = "" ] ;then + TABLEOPTS_TESTS=${testname} + if [ "$kind" = "ser" ] || [ "$kind" = "ver" ] ; then + tableopts_tables=${testname}.tables + fi + else + TABLEOPTS_TESTS="${TABLEOPTS_TESTS} ${testname}" + if [ "$kind" = "ser" ] || [ "$kind" = "ver" ] ; then + tableopts_tables="${tableopts_tables} ${testname}.tables" + fi + fi + + bare_opt=${opt#-} + cat << EOF +tableopts_${kind}_${threading}_${bare_opt}_${kind}_SOURCES = tableopts.l4 + +${testname}\$(EXEEXT): tableopts_${kind}_${threading}${opt}.\$(OBJEXT) + \$(AM_V_CCLD)\$(LINK) -o \$@ \$< + +EOF + done + done +done + +echo TABLEOPTS_TESTS = ${TABLEOPTS_TESTS} +echo +echo tableopts_tables = ${tableopts_tables} diff --git a/tests/test-table-opts/test.input b/tests/tableopts.txt index aec9276..aec9276 100644 --- a/tests/test-table-opts/test.input +++ b/tests/tableopts.txt diff --git a/tests/test-alloc-extra/.gitignore b/tests/test-alloc-extra/.gitignore deleted file mode 100644 index 371f7e7..0000000 --- a/tests/test-alloc-extra/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -.cvsignore -Makefile -Makefile.in -scanner.c -test-alloc-extra -OUTPUT diff --git a/tests/test-alloc-extra/Makefile.am b/tests/test-alloc-extra/Makefile.am deleted file mode 100644 index 04509b6..0000000 --- a/tests/test-alloc-extra/Makefile.am +++ /dev/null @@ -1,49 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -EXTRA_DIST = scanner.l test.input -CLEANFILES = scanner.c scanner.h parser.c parser.h $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o # parser.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -#LDFLAGS = $(top_srcdir)/libfl.a -#LFLAGS = --header="scanner.h" -#YFLAGS = --defines --output=parser.c - -testname = test-alloc-extra - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $(LFLAGS) $< - -parser.c: $(srcdir)/parser.y - $(BISON) $(YFLAGS) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname)$(EXEEXT) < $(srcdir)/test.input - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< diff --git a/tests/test-array-nr/.gitignore b/tests/test-array-nr/.gitignore deleted file mode 100644 index f613be9..0000000 --- a/tests/test-array-nr/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -Makefile -parser.c -parser.h -scanner.c -test-array-nr -OUTPUT -Makefile.in diff --git a/tests/test-array-nr/Makefile.am b/tests/test-array-nr/Makefile.am deleted file mode 100644 index a54e3fc..0000000 --- a/tests/test-array-nr/Makefile.am +++ /dev/null @@ -1,48 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -EXTRA_DIST = scanner.l test.input -CLEANFILES = scanner.c parser.c parser.h $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o # parser.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -#LDFLAGS = $(top_srcdir)/libfl.a -#YFLAGS = --defines --output=parser.c - -testname = test-array-nr - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $< - -parser.c: $(srcdir)/parser.y - $(BISON) $(YFLAGS) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname)$(EXEEXT) < $(srcdir)/test.input - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< diff --git a/tests/test-array-r/.gitignore b/tests/test-array-r/.gitignore deleted file mode 100644 index 267397d..0000000 --- a/tests/test-array-r/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -Makefile -parser.c -parser.h -scanner.c -test-array-r -OUTPUT -Makefile.in diff --git a/tests/test-array-r/Makefile.am b/tests/test-array-r/Makefile.am deleted file mode 100644 index b60c917..0000000 --- a/tests/test-array-r/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -EXTRA_DIST = scanner.l test.input -CLEANFILES = scanner.c $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -#LDFLAGS = $(top_srcdir)/libfl.a -#YFLAGS = --defines --output=parser.c - -testname = test-array-r - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname)$(EXEEXT) < $(srcdir)/test.input - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< diff --git a/tests/test-basic-nr/.gitignore b/tests/test-basic-nr/.gitignore deleted file mode 100644 index 30d0295..0000000 --- a/tests/test-basic-nr/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -Makefile -parser.c -parser.h -scanner.c -test-basic-nr -OUTPUT -Makefile.in diff --git a/tests/test-basic-nr/Makefile.am b/tests/test-basic-nr/Makefile.am deleted file mode 100644 index 956b068..0000000 --- a/tests/test-basic-nr/Makefile.am +++ /dev/null @@ -1,48 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -EXTRA_DIST = scanner.l test.input -CLEANFILES = scanner.c parser.c parser.h $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o # parser.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -#LDFLAGS = $(top_srcdir)/libfl.a -#YFLAGS = --defines --output=parser.c - -testname = test-basic-nr - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $< - -parser.c: $(srcdir)/parser.y - $(BISON) $(YFLAGS) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname)$(EXEEXT) < $(srcdir)/test.input - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< diff --git a/tests/test-basic-r/.gitignore b/tests/test-basic-r/.gitignore deleted file mode 100644 index 3f89269..0000000 --- a/tests/test-basic-r/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -Makefile -parser.c -parser.h -scanner.c -test-basic-r -OUTPUT -Makefile.in diff --git a/tests/test-basic-r/Makefile.am b/tests/test-basic-r/Makefile.am deleted file mode 100644 index beca2e7..0000000 --- a/tests/test-basic-r/Makefile.am +++ /dev/null @@ -1,48 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -EXTRA_DIST = scanner.l test.input -CLEANFILES = scanner.c parser.c parser.h $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o # parser.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -#LDFLAGS = $(top_srcdir)/libfl.a -#YFLAGS = --defines --output=parser.c - -testname = test-basic-r - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $< - -parser.c: $(srcdir)/parser.y - $(BISON) $(YFLAGS) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname)$(EXEEXT) < $(srcdir)/test.input - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< diff --git a/tests/test-bison-nr/.gitignore b/tests/test-bison-nr/.gitignore deleted file mode 100644 index 6208bd5..0000000 --- a/tests/test-bison-nr/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -Makefile -Makefile.in -parser.c -parser.h -scanner.c -TEMPLATE -OUTPUT -.deps -test-bison-nr -scanner.h diff --git a/tests/test-bison-nr/Makefile.am b/tests/test-bison-nr/Makefile.am deleted file mode 100644 index 9bc8af3..0000000 --- a/tests/test-bison-nr/Makefile.am +++ /dev/null @@ -1,55 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -builddir = @builddir@ - -EXTRA_DIST = scanner.l parser.y test.input main.c -CLEANFILES = scanner.c scanner.h parser.c parser.h $(testname)$(EXEEXT) $(OBJS) OUTPUT -OBJS = scanner.o parser.o main.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -I$(builddir) -#LDFLAGS = $(top_srcdir)/libfl.a -YFLAGS = --defines --output=parser.c --name-prefix="test" - -testname = test-bison-nr - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $< -scanner.h: scanner.c -scanner.o: parser.h - -parser.c: $(srcdir)/parser.y - $(BISON) $(YFLAGS) $< -parser.h: parser.c - -main.o: scanner.h parser.h - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname)$(EXEEXT) < $(srcdir)/test.input - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< diff --git a/tests/test-bison-yylloc/.gitignore b/tests/test-bison-yylloc/.gitignore deleted file mode 100644 index 690e860..0000000 --- a/tests/test-bison-yylloc/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -Makefile -Makefile.in -parser.c -parser.h -scanner.c -scanner.h -yyheader.h -test-bison-yylloc - -OUTPUT diff --git a/tests/test-bison-yylloc/Makefile.am b/tests/test-bison-yylloc/Makefile.am deleted file mode 100644 index dc41b0f..0000000 --- a/tests/test-bison-yylloc/Makefile.am +++ /dev/null @@ -1,55 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -builddir = @builddir@ - -EXTRA_DIST = scanner.l parser.y test.input main.c -CLEANFILES = scanner.c scanner.h parser.c parser.h $(testname)$(EXEEXT) $(OBJS) OUTPUT -OBJS = scanner.o parser.o main.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -I$(builddir) -#LDFLAGS = $(top_srcdir)/libfl.a -YFLAGS = --defines --output=parser.c --name-prefix="test" - -testname = test-bison-yylloc - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $< -scanner.h: scanner.c -scanner.o: parser.h - -parser.c: $(srcdir)/parser.y - $(BISON) $(YFLAGS) $< -parser.h: parser.c - -main.o: scanner.h parser.h - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname)$(EXEEXT) < $(srcdir)/test.input - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< diff --git a/tests/test-bison-yylval/.gitignore b/tests/test-bison-yylval/.gitignore deleted file mode 100644 index 2e52525..0000000 --- a/tests/test-bison-yylval/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -Makefile -parser.c -parser.h -scanner.c -scanner.h -yyheader.h -test-bison-yylval - -OUTPUT -Makefile.in diff --git a/tests/test-bison-yylval/Makefile.am b/tests/test-bison-yylval/Makefile.am deleted file mode 100644 index d8e27f7..0000000 --- a/tests/test-bison-yylval/Makefile.am +++ /dev/null @@ -1,55 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -builddir = @builddir@ - -EXTRA_DIST = scanner.l parser.y test.input main.c -CLEANFILES = scanner.c scanner.h parser.c parser.h $(testname)$(EXEEXT) $(OBJS) OUTPUT -OBJS = parser.o scanner.o main.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -I$(builddir) -#LDFLAGS = $(top_srcdir)/libfl.a -YFLAGS = --defines --output=parser.c --name-prefix="test" - -testname = test-bison-yylval - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $< -scanner.h: scanner.c -scanner.o: parser.h - -parser.c: $(srcdir)/parser.y - $(BISON) $(YFLAGS) $< -parser.h: parser.c - -main.o: scanner.h parser.h - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname)$(EXEEXT) < $(srcdir)/test.input - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< diff --git a/tests/test-c++-basic/.gitignore b/tests/test-c++-basic/.gitignore deleted file mode 100644 index aa90b44..0000000 --- a/tests/test-c++-basic/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -Makefile -Makefile.in -scanner.cpp -OUTPUT -.deps -test-c++-basic diff --git a/tests/test-c++-basic/Makefile.am b/tests/test-c++-basic/Makefile.am deleted file mode 100644 index ccfc884..0000000 --- a/tests/test-c++-basic/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -EXTRA_DIST = scanner.l test.input -CLEANFILES = scanner.cpp scanner.h $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -LFLAGS = -+ -#LDFLAGS = - -testname = test-c++-basic - -scanner.cpp: $(srcdir)/scanner.l - $(FLEX) $(LFLAGS) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CXX) $(CXXFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname)$(EXEEXT) < $(srcdir)/test.input - -.cpp.o: - $(CXX) $(CXXFLAGS) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $< diff --git a/tests/test-c++-multiple-scanners/.gitignore b/tests/test-c++-multiple-scanners/.gitignore deleted file mode 100644 index ed9376c..0000000 --- a/tests/test-c++-multiple-scanners/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -Makefile -Makefile.in -scanner-1.cpp -scanner-2.cpp -OUTPUT -.deps -test-c++-multiple-scanners diff --git a/tests/test-c++-multiple-scanners/Makefile.am b/tests/test-c++-multiple-scanners/Makefile.am deleted file mode 100644 index 9bcc9f8..0000000 --- a/tests/test-c++-multiple-scanners/Makefile.am +++ /dev/null @@ -1,53 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex -builddir = @builddir@ - -EXTRA_DIST = scanner-1.l scanner-2.l main.cpp test.input -CLEANFILES = scanner-1.cpp $(testname)$(EXEEXT) OUTPUT $(OBJS) scanner-2.cpp -OBJS = scanner-1.o scanner-2.o main.o - -AM_CXXFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -#LDFLAGS = $(top_srcdir)/libfl.a -#YFLAGS = --defines --output=parser.c - -testname = test-c++-multiple-scanners - -scanner-1.cpp: $(srcdir)/scanner-1.l - $(FLEX) -+ $(LFLAGS) $< - -scanner-2.cpp: $(srcdir)/scanner-2.l - $(FLEX) -+ $(LFLAGS) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CXX) $(CXXFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - $(builddir)/$(testname)$(EXEEXT) < $(srcdir)/test.input - -.cpp.o: - $(CXX) -c -o $@ $(AM_CXXFLAGS) $(CPPFLAGS) $(CXXFLAGS) $< - -main.o: scanner-1.h scanner-2.h -scanner-1.h: scanner-1.cpp -scanner-2.h: scanner-2.cpp diff --git a/tests/test-c++-yywrap/.gitignore b/tests/test-c++-yywrap/.gitignore deleted file mode 100644 index 31ef089..0000000 --- a/tests/test-c++-yywrap/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -Makefile -Makefile.in -scanner.cpp -OUTPUT -.deps -test-c++-yywrap diff --git a/tests/test-c++-yywrap/Makefile.am b/tests/test-c++-yywrap/Makefile.am deleted file mode 100644 index 014452b..0000000 --- a/tests/test-c++-yywrap/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -EXTRA_DIST = scanner.l test.input -CLEANFILES = scanner.cpp scanner.h $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -LFLAGS = -+ -#LDFLAGS = - -testname = test-c++-yywrap - -scanner.cpp: $(srcdir)/scanner.l - $(FLEX) $(LFLAGS) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CXX) $(CXXFLAGS) -o $@ $(LDFLAGS) $(OBJS) - -test: $(testname)$(EXEEXT) - ./$(testname)$(EXEEXT) $(srcdir)/test.input $(srcdir)/test.input $(srcdir)/test.input - -.cpp.o: - $(CXX) $(CXXFLAGS) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $< diff --git a/tests/test-c-cpp-nr/.gitignore b/tests/test-c-cpp-nr/.gitignore deleted file mode 100644 index 94f62d4..0000000 --- a/tests/test-c-cpp-nr/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -Makefile -scanner.cpp -test-c-cpp-nr -OUTPUT -Makefile.in diff --git a/tests/test-c-cpp-nr/Makefile.am b/tests/test-c-cpp-nr/Makefile.am deleted file mode 100644 index 9aec3b2..0000000 --- a/tests/test-c-cpp-nr/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -EXTRA_DIST = scanner.l test.input -CLEANFILES = scanner.cpp $(testname)$(EXEEXT) $(OBJS) OUTPUT -OBJS = scanner.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -#LDFLAGS = $(top_srcdir)/libfl.a -#YFLAGS = --defines --output=parser.c - -testname = test-c-cpp-nr - -scanner.cpp: $(srcdir)/scanner.l - $(FLEX) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CXX) $(CXXFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname)$(EXEEXT) < $(srcdir)/test.input - -.cpp.o: - $(CXX) $(CXXFLAGS) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $< diff --git a/tests/test-c-cpp-r/.gitignore b/tests/test-c-cpp-r/.gitignore deleted file mode 100644 index 40be8ce..0000000 --- a/tests/test-c-cpp-r/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -Makefile -scanner.cpp -test-c-cpp-r -OUTPUT -Makefile.in diff --git a/tests/test-c-cpp-r/Makefile.am b/tests/test-c-cpp-r/Makefile.am deleted file mode 100644 index 1c9c23e..0000000 --- a/tests/test-c-cpp-r/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -EXTRA_DIST = scanner.l test.input -CLEANFILES = scanner.cpp $(testname)$(EXEEXT) $(OBJS) OUTPUT -OBJS = scanner.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -#LDFLAGS = $(top_srcdir)/libfl.a -#YFLAGS = --defines --output=parser.c - -testname = test-c-cpp-r - -scanner.cpp: $(srcdir)/scanner.l - $(FLEX) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CXX) $(CXXFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname)$(EXEEXT) < $(srcdir)/test.input - -.cpp.o: - $(CXX) $(CXXFLAGS) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $< diff --git a/tests/test-ccl/.gitignore b/tests/test-ccl/.gitignore deleted file mode 100644 index 2f65350..0000000 --- a/tests/test-ccl/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -Makefile -Makefile.in -parser.c -parser.h -scanner.c -TEMPLATE -OUTPUT -.deps -test-ccl diff --git a/tests/test-ccl/Makefile.am b/tests/test-ccl/Makefile.am deleted file mode 100644 index 0a92bb2..0000000 --- a/tests/test-ccl/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - -FLEX = $(top_builddir)/flex - -builddir = @builddir@ - -EXTRA_DIST = scanner.l test.input -CLEANFILES = scanner.c scanner.h $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o - -AM_CPPFLAGS = -I$(srcdir) -I$(builddir) -I$(top_srcdir) -I$(top_builddir) - -testname = test-ccl - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $(LFLAGS) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname)$(EXEEXT) < $(srcdir)/test.input - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< diff --git a/tests/test-concatenated-options/.gitignore b/tests/test-concatenated-options/.gitignore deleted file mode 100644 index a2189c7..0000000 --- a/tests/test-concatenated-options/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -Makefile -Makefile.in -OUTPUT diff --git a/tests/test-concatenated-options/Makefile.am b/tests/test-concatenated-options/Makefile.am deleted file mode 100644 index e392073..0000000 --- a/tests/test-concatenated-options/Makefile.am +++ /dev/null @@ -1,33 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - -FLEX = $(top_builddir)/flex$(EXEEXT) - -CLEANFILES = OUTPUT - -# The test below just wants to know if flex can process multiple -# concatenated options. The -c and -n options both do nothing, so we -# group them together to see if flex will still function. We write the -# output to /dev/null since we don't really care what flex produces, -# just that it runs successfully. - -test: - echo %% | $(FLEX) -cn -o /dev/null diff --git a/tests/test-debug-nr/.gitignore b/tests/test-debug-nr/.gitignore deleted file mode 100644 index 689066f..0000000 --- a/tests/test-debug-nr/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -Makefile -Makefile.in -parser.c -parser.h -scanner.c -TEMPLATE -OUTPUT -.deps -test-debug-nr diff --git a/tests/test-debug-nr/Makefile.am b/tests/test-debug-nr/Makefile.am deleted file mode 100644 index 8e4ae82..0000000 --- a/tests/test-debug-nr/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -EXTRA_DIST = scanner.l test.input -CLEANFILES = scanner.c scanner.h $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -#LDFLAGS = $(top_srcdir)/libfl.a - -testname = test-debug-nr - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $(LFLAGS) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname)$(EXEEXT) < $(srcdir)/test.input - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< diff --git a/tests/test-debug-r/.gitignore b/tests/test-debug-r/.gitignore deleted file mode 100644 index d2b0c7c..0000000 --- a/tests/test-debug-r/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -Makefile -Makefile.in -parser.c -parser.h -scanner.c -TEMPLATE -OUTPUT -.deps -test-debug-r diff --git a/tests/test-debug-r/Makefile.am b/tests/test-debug-r/Makefile.am deleted file mode 100644 index 6496892..0000000 --- a/tests/test-debug-r/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -EXTRA_DIST = scanner.l test.input -CLEANFILES = scanner.c $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -#LDFLAGS = $(top_srcdir)/libfl.a - -testname = test-debug-r - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $(LFLAGS) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname)$(EXEEXT) < $(srcdir)/test.input - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< diff --git a/tests/test-extended/.gitignore b/tests/test-extended/.gitignore deleted file mode 100644 index 325d9be..0000000 --- a/tests/test-extended/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -Makefile -Makefile.in -parser.c -parser.h -scanner.c -TEMPLATE -OUTPUT -.deps -test-extended diff --git a/tests/test-extended/Makefile.am b/tests/test-extended/Makefile.am deleted file mode 100644 index 190e95e..0000000 --- a/tests/test-extended/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - -FLEX = $(top_builddir)/flex - -builddir = @builddir@ - -EXTRA_DIST = scanner.l test.input -CLEANFILES = scanner.c scanner.h $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o - -AM_CPPFLAGS = -I$(srcdir) -I$(builddir) -I$(top_srcdir) -I$(top_builddir) - -testname = test-extended - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $(LFLAGS) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname)$(EXEEXT) < $(srcdir)/test.input | cmp -s $(srcdir)/test.input - - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< diff --git a/tests/test-header-nr/.gitignore b/tests/test-header-nr/.gitignore deleted file mode 100644 index 9ef03b1..0000000 --- a/tests/test-header-nr/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -Makefile -Makefile.in -scanner.c -scanner.h -test-header-nr - -OUTPUT diff --git a/tests/test-header-nr/Makefile.am b/tests/test-header-nr/Makefile.am deleted file mode 100644 index 11b6ff4..0000000 --- a/tests/test-header-nr/Makefile.am +++ /dev/null @@ -1,53 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -builddir = @builddir@ - -EXTRA_DIST = scanner.l test.input main.c -CLEANFILES = scanner.c scanner.h $(testname)$(EXEEXT) $(OBJS) OUTPUT -OBJS = scanner.o main.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -I$(builddir) -#LDFLAGS = $(top_srcdir)/libfl.a -#YFLAGS = --defines --output=parser.c - -testname = test-header-nr - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $< - -parser.c: $(srcdir)/parser.y - $(BISON) $(YFLAGS) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname)$(EXEEXT) < $(srcdir)/test.input - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< - -scanner.h: scanner.c -main.o: scanner.h diff --git a/tests/test-header-r/.gitignore b/tests/test-header-r/.gitignore deleted file mode 100644 index a448111..0000000 --- a/tests/test-header-r/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -Makefile -Makefile.in -scanner.c -scanner.h -test-header-r -OUTPUT diff --git a/tests/test-header-r/Makefile.am b/tests/test-header-r/Makefile.am deleted file mode 100644 index abd22a2..0000000 --- a/tests/test-header-r/Makefile.am +++ /dev/null @@ -1,54 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -builddir = @builddir@ - -EXTRA_DIST = scanner.l test.input main.c -CLEANFILES = scanner.c scanner.h $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o main.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -I$(builddir) -#LDFLAGS = $(top_srcdir)/libfl.a -LFLAGS = --header="scanner.h" -#YFLAGS = --defines --output=parser.c - -testname = test-header-r - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $(LFLAGS) $< - -parser.c: $(srcdir)/parser.y - $(BISON) $(YFLAGS) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname)$(EXEEXT) < $(srcdir)/test.input - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< - -scanner.h: scanner.c -main.o: scanner.h diff --git a/tests/test-include-by-buffer/.gitignore b/tests/test-include-by-buffer/.gitignore deleted file mode 100644 index 90467e8..0000000 --- a/tests/test-include-by-buffer/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -Makefile -Makefile.in -parser.c -parser.h -scanner.c -test-include-by-buffer -OUTPUT diff --git a/tests/test-include-by-buffer/Makefile.am b/tests/test-include-by-buffer/Makefile.am deleted file mode 100644 index 78e43af..0000000 --- a/tests/test-include-by-buffer/Makefile.am +++ /dev/null @@ -1,49 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -EXTRA_DIST = scanner.l test-1.input test-2.input test-3.input -CLEANFILES = scanner.c scanner.h parser.c parser.h $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o # parser.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -#LDFLAGS = $(top_srcdir)/libfl.a -#LFLAGS = --header="scanner.h" -#YFLAGS = --defines --output=parser.c - -testname = test-include-by-buffer - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $< - -parser.c: $(srcdir)/parser.y - $(BISON) $(YFLAGS) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname)$(EXEEXT) $(srcdir)/test-1.input - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< diff --git a/tests/test-include-by-buffer/test-1.input b/tests/test-include-by-buffer/test-1.input deleted file mode 100644 index 355beaa..0000000 --- a/tests/test-include-by-buffer/test-1.input +++ /dev/null @@ -1,3 +0,0 @@ -Beginning of "test-1.input". -#include <test-2.input> -End of "test-1.input". diff --git a/tests/test-include-by-buffer/test-2.input b/tests/test-include-by-buffer/test-2.input deleted file mode 100644 index 45f11f9..0000000 --- a/tests/test-include-by-buffer/test-2.input +++ /dev/null @@ -1,3 +0,0 @@ -Beginning of "test-2.input". -#include <test-3.input> -End of "test-2.input". diff --git a/tests/test-include-by-buffer/test-3.input b/tests/test-include-by-buffer/test-3.input deleted file mode 100644 index 6a2d055..0000000 --- a/tests/test-include-by-buffer/test-3.input +++ /dev/null @@ -1,2 +0,0 @@ -Beginning of "test-3.input". -End of "test-3.input". diff --git a/tests/test-include-by-push/.gitignore b/tests/test-include-by-push/.gitignore deleted file mode 100644 index 7a7c74b..0000000 --- a/tests/test-include-by-push/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -Makefile -Makefile.in -parser.c -parser.h -scanner.c -test-include-by-push -OUTPUT diff --git a/tests/test-include-by-push/Makefile.am b/tests/test-include-by-push/Makefile.am deleted file mode 100644 index fac4a0e..0000000 --- a/tests/test-include-by-push/Makefile.am +++ /dev/null @@ -1,49 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -EXTRA_DIST = scanner.l test-1.input test-2.input test-3.input -CLEANFILES = scanner.c scanner.h parser.c parser.h $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o # parser.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -#LDFLAGS = $(top_srcdir)/libfl.a -#LFLAGS = --header="scanner.h" -#YFLAGS = --defines --output=parser.c - -testname = test-include-by-push - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $< - -parser.c: $(srcdir)/parser.y - $(BISON) $(YFLAGS) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname)$(EXEEXT) $(srcdir)/test-1.input - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< diff --git a/tests/test-include-by-push/test-1.input b/tests/test-include-by-push/test-1.input deleted file mode 100644 index 355beaa..0000000 --- a/tests/test-include-by-push/test-1.input +++ /dev/null @@ -1,3 +0,0 @@ -Beginning of "test-1.input". -#include <test-2.input> -End of "test-1.input". diff --git a/tests/test-include-by-push/test-2.input b/tests/test-include-by-push/test-2.input deleted file mode 100644 index 45f11f9..0000000 --- a/tests/test-include-by-push/test-2.input +++ /dev/null @@ -1,3 +0,0 @@ -Beginning of "test-2.input". -#include <test-3.input> -End of "test-2.input". diff --git a/tests/test-include-by-push/test-3.input b/tests/test-include-by-push/test-3.input deleted file mode 100644 index 6a2d055..0000000 --- a/tests/test-include-by-push/test-3.input +++ /dev/null @@ -1,2 +0,0 @@ -Beginning of "test-3.input". -End of "test-3.input". diff --git a/tests/test-include-by-reentrant/.gitignore b/tests/test-include-by-reentrant/.gitignore deleted file mode 100644 index a824aa3..0000000 --- a/tests/test-include-by-reentrant/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -Makefile -Makefile.in -parser.c -parser.h -scanner.c -test-include-by-reentrant -OUTPUT diff --git a/tests/test-include-by-reentrant/Makefile.am b/tests/test-include-by-reentrant/Makefile.am deleted file mode 100644 index 3f4d1d5..0000000 --- a/tests/test-include-by-reentrant/Makefile.am +++ /dev/null @@ -1,49 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -EXTRA_DIST = scanner.l test-1.input test-2.input test-3.input -CLEANFILES = scanner.c scanner.h parser.c parser.h $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o # parser.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -#LDFLAGS = $(top_srcdir)/libfl.a -#LFLAGS = --header="scanner.h" -#YFLAGS = --defines --output=parser.c - -testname = test-include-by-reentrant - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $(LFLAGS) $< - -parser.c: $(srcdir)/parser.y - $(BISON) $(YFLAGS) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname) $(srcdir)/test-1.input - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< diff --git a/tests/test-include-by-reentrant/test-1.input b/tests/test-include-by-reentrant/test-1.input deleted file mode 100644 index 355beaa..0000000 --- a/tests/test-include-by-reentrant/test-1.input +++ /dev/null @@ -1,3 +0,0 @@ -Beginning of "test-1.input". -#include <test-2.input> -End of "test-1.input". diff --git a/tests/test-include-by-reentrant/test-2.input b/tests/test-include-by-reentrant/test-2.input deleted file mode 100644 index 45f11f9..0000000 --- a/tests/test-include-by-reentrant/test-2.input +++ /dev/null @@ -1,3 +0,0 @@ -Beginning of "test-2.input". -#include <test-3.input> -End of "test-2.input". diff --git a/tests/test-include-by-reentrant/test-3.input b/tests/test-include-by-reentrant/test-3.input deleted file mode 100644 index 6a2d055..0000000 --- a/tests/test-include-by-reentrant/test-3.input +++ /dev/null @@ -1,2 +0,0 @@ -Beginning of "test-3.input". -End of "test-3.input". diff --git a/tests/test-linedir-r/.gitignore b/tests/test-linedir-r/.gitignore deleted file mode 100644 index 8642445..0000000 --- a/tests/test-linedir-r/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -Makefile -Makefile.in -scanner.c -scanner.h -test-linedir-r -OUTPUT diff --git a/tests/test-linedir-r/Makefile.am b/tests/test-linedir-r/Makefile.am deleted file mode 100644 index d7f3bf7..0000000 --- a/tests/test-linedir-r/Makefile.am +++ /dev/null @@ -1,56 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -builddir = @builddir@ - -EXTRA_DIST = scanner.l test.input main.c check-lines.awk -CLEANFILES = scanner.c scanner.h $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o main.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -I$(builddir) -#LDFLAGS = $(top_srcdir)/libfl.a -LFLAGS = --header="scanner.h" -#YFLAGS = --defines --output=parser.c - -testname = test-linedir-r - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $(LFLAGS) $< - -parser.c: $(srcdir)/parser.y - $(BISON) $(YFLAGS) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname)$(EXEEXT) < $(srcdir)/test.input - cat -n scanner.c | grep '#line' | grep scanner.c | $(AWK) -f $(srcdir)/check-lines.awk - cat -n scanner.h | grep '#line' | grep scanner.h | $(AWK) -f $(srcdir)/check-lines.awk - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< - -scanner.h: scanner.c -main.o: scanner.h diff --git a/tests/test-linedir-r/check-lines.awk b/tests/test-linedir-r/check-lines.awk deleted file mode 100644 index 6a1e5ec..0000000 --- a/tests/test-linedir-r/check-lines.awk +++ /dev/null @@ -1,7 +0,0 @@ -{ - if( /#line/ && $1 != ($3 - 1)) { - printf "Line directive mismatch at line %d: %s\n", NR, $0; - exit 1; - } -} - diff --git a/tests/test-linedir-r/main.c b/tests/test-linedir-r/main.c deleted file mode 100644 index 6ba9808..0000000 --- a/tests/test-linedir-r/main.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * This file is part of flex. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE. - */ - -#include "scanner.h" - -int -main ( int argc, char** argv ) -{ - yyscan_t scanner; - FILE *fp; - char * extra = "EXTRA"; - - testlex_init(&scanner); - testset_in(stdin,scanner); - testset_out(stdout,scanner); - testset_extra(extra,scanner); - - fp = testget_in(scanner); - fp = testget_out(scanner); - - while(testlex(scanner)) { - char * text; - int line; - line = testget_lineno(scanner); - text = testget_text(scanner); - - if( (char*)testget_extra(scanner) != extra) - break; - - if ( !text || line < 0) - continue; - } - testlex_destroy(scanner); - return 0; -} - - -/* vim:set tabstop=8 softtabstop=4 shiftwidth=4: */ diff --git a/tests/test-linedir-r/scanner.l b/tests/test-linedir-r/scanner.l deleted file mode 100644 index e87cc60..0000000 --- a/tests/test-linedir-r/scanner.l +++ /dev/null @@ -1,45 +0,0 @@ -/* - * This file is part of flex. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE. - */ - -%{ -/* Build "scanner.c". - The scanner is not important. - This test is really about getting the line directives correct. -*/ -#include <stdio.h> -#include <stdlib.h> -#include "config.h" - -%} - -%option reentrant -%option 8bit outfile="scanner.c" prefix="test" -%option nounput nomain noyywrap -%option warn - -%% - -.|\n { } - -%% - diff --git a/tests/test-lineno-nr/.gitignore b/tests/test-lineno-nr/.gitignore deleted file mode 100644 index 19d329e..0000000 --- a/tests/test-lineno-nr/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -Makefile -Makefile.in -parser.c -parser.h -scanner.c -test-lineno-nr -OUTPUT -.deps diff --git a/tests/test-lineno-nr/Makefile.am b/tests/test-lineno-nr/Makefile.am deleted file mode 100644 index 2db8e64..0000000 --- a/tests/test-lineno-nr/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -EXTRA_DIST = scanner.l test.input -CLEANFILES = scanner.c $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) - -testname = test-lineno-nr - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $(LFLAGS) $< - - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - test `./$(testname)$(EXEEXT) < $(srcdir)/test.input` -eq \ - `./$(testname)$(EXEEXT) 1 < $(srcdir)/test.input` || exit 1 - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< diff --git a/tests/test-lineno-r/.gitignore b/tests/test-lineno-r/.gitignore deleted file mode 100644 index 9c9f4d0..0000000 --- a/tests/test-lineno-r/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -Makefile -Makefile.in -parser.c -parser.h -scanner.c -test-lineno-r -OUTPUT -.deps diff --git a/tests/test-lineno-r/Makefile.am b/tests/test-lineno-r/Makefile.am deleted file mode 100644 index 8ded4b3..0000000 --- a/tests/test-lineno-r/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -EXTRA_DIST = scanner.l test.input -CLEANFILES = scanner.c $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) - -testname = test-lineno-r - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $(LFLAGS) $< - - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - test `./$(testname)$(EXEEXT) < $(srcdir)/test.input` -eq \ - `./$(testname)$(EXEEXT) 1 < $(srcdir)/test.input` || exit 1 - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< diff --git a/tests/test-lineno-trailing/.gitignore b/tests/test-lineno-trailing/.gitignore deleted file mode 100644 index 84b3fa9..0000000 --- a/tests/test-lineno-trailing/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -Makefile -Makefile.in -parser.c -parser.h -scanner.c -test-lineno-trailing -OUTPUT -.deps diff --git a/tests/test-lineno-trailing/Makefile.am b/tests/test-lineno-trailing/Makefile.am deleted file mode 100644 index bb303c3..0000000 --- a/tests/test-lineno-trailing/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -EXTRA_DIST = scanner.l test.input -CLEANFILES = scanner.c $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) - -testname = test-lineno-trailing - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $(LFLAGS) $< - - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - test `./$(testname)$(EXEEXT) < $(srcdir)/test.input` -eq \ - `./$(testname)$(EXEEXT) 1 < $(srcdir)/test.input` || exit 1 - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< diff --git a/tests/test-mem-nr/.gitignore b/tests/test-mem-nr/.gitignore deleted file mode 100644 index 7b73f56..0000000 --- a/tests/test-mem-nr/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -Makefile -Makefile.in -parser.c -parser.h -scanner.c -TEMPLATE -OUTPUT -.deps -test-mem-nr diff --git a/tests/test-mem-nr/Makefile.am b/tests/test-mem-nr/Makefile.am deleted file mode 100644 index 4ad450d..0000000 --- a/tests/test-mem-nr/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -EXTRA_DIST = scanner.l test.input -CLEANFILES = scanner.c scanner.h $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -#LDFLAGS = $(top_srcdir)/libfl.a - -testname = test-mem-nr - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $(LFLAGS) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname)$(EXEEXT) < $(srcdir)/test.input - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< diff --git a/tests/test-mem-r/.gitignore b/tests/test-mem-r/.gitignore deleted file mode 100644 index a21d062..0000000 --- a/tests/test-mem-r/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -Makefile -Makefile.in -parser.c -parser.h -scanner.c -TEMPLATE -OUTPUT -.deps -test-mem-r diff --git a/tests/test-mem-r/Makefile.am b/tests/test-mem-r/Makefile.am deleted file mode 100644 index ae06bd2..0000000 --- a/tests/test-mem-r/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -EXTRA_DIST = scanner.l test.input -CLEANFILES = scanner.c scanner.h $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -#LDFLAGS = $(top_srcdir)/libfl.a - -testname = test-mem-r - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $(LFLAGS) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname)$(EXEEXT) < $(srcdir)/test.input - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< diff --git a/tests/test-multiple-scanners-nr/.gitignore b/tests/test-multiple-scanners-nr/.gitignore deleted file mode 100644 index dfd4b07..0000000 --- a/tests/test-multiple-scanners-nr/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -Makefile -Makefile.in -scanner-1.c -scanner-1.h -scanner-2.c -scanner-2.h -test-multiple-scanners-nr -OUTPUT diff --git a/tests/test-multiple-scanners-nr/Makefile.am b/tests/test-multiple-scanners-nr/Makefile.am deleted file mode 100644 index 950dd23..0000000 --- a/tests/test-multiple-scanners-nr/Makefile.am +++ /dev/null @@ -1,54 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -builddir = @builddir@ - -EXTRA_DIST = scanner-1.l scanner-2.l main.c -CLEANFILES = scanner-1.c scanner-1.h $(testname)$(EXEEXT) OUTPUT $(OBJS) scanner-2.c scanner-2.h -OBJS = scanner-1.o scanner-2.o main.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -I$(builddir) -#LDFLAGS = $(top_srcdir)/libfl.a -#YFLAGS = --defines --output=parser.c - -testname = test-multiple-scanners-nr - -scanner-1.c: $(srcdir)/scanner-1.l - $(FLEX) $(LFLAGS) --header=scanner-1.h $< - -scanner-2.c: $(srcdir)/scanner-2.l - $(FLEX) $(LFLAGS) --header=scanner-2.h $< - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname)$(EXEEXT) - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< - -main.o: scanner-1.h scanner-2.h -scanner-1.h: scanner-1.c -scanner-2.h: scanner-2.c diff --git a/tests/test-multiple-scanners-r/.gitignore b/tests/test-multiple-scanners-r/.gitignore deleted file mode 100644 index 552f931..0000000 --- a/tests/test-multiple-scanners-r/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -Makefile -Makefile.in -scanner-1.c -scanner-1.h -scanner-2.c -scanner-2.h -test-multiple-scanners-r -OUTPUT -scanner-1.tables -scanner-2.tables diff --git a/tests/test-multiple-scanners-r/Makefile.am b/tests/test-multiple-scanners-r/Makefile.am deleted file mode 100644 index 5f0df8c..0000000 --- a/tests/test-multiple-scanners-r/Makefile.am +++ /dev/null @@ -1,56 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -builddir = @builddir@ - -EXTRA_DIST = scanner-1.l scanner-2.l main.c -CLEANFILES = scanner-1.c scanner-1.h $(testname)$(EXEEXT) OUTPUT\ - $(OBJS) scanner-2.c scanner-2.h scanner-1.tables \ - scanner-2.tables -OBJS = scanner-1.o scanner-2.o main.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -I$(builddir) -#LDFLAGS = $(top_srcdir)/libfl.a -#YFLAGS = --defines --output=parser.c - -testname = test-multiple-scanners-r - -scanner-1.c: $(srcdir)/scanner-1.l - $(FLEX) $(LFLAGS) --header=scanner-1.h $< - -scanner-2.c: $(srcdir)/scanner-2.l - $(FLEX) $(LFLAGS) --header=scanner-2.h $< - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname)$(EXEEXT) - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< - -main.o: scanner-1.h scanner-2.h -scanner-1.h: scanner-1.c -scanner-2.h: scanner-2.c diff --git a/tests/test-noansi-nr/.gitignore b/tests/test-noansi-nr/.gitignore deleted file mode 100644 index 1b47d0a..0000000 --- a/tests/test-noansi-nr/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -Makefile -parser.c -parser.h -scanner.c -test-noansi-nr -OUTPUT -Makefile.in diff --git a/tests/test-noansi-nr/Makefile.am b/tests/test-noansi-nr/Makefile.am deleted file mode 100644 index a2a327e..0000000 --- a/tests/test-noansi-nr/Makefile.am +++ /dev/null @@ -1,48 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -EXTRA_DIST = scanner.l test.input -CLEANFILES = scanner.c parser.c parser.h $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o # parser.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -#LDFLAGS = $(top_srcdir)/libfl.a -#YFLAGS = --defines --output=parser.c - -testname = test-noansi-nr - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $< - -parser.c: $(srcdir)/parser.y - $(BISON) $(YFLAGS) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname)$(EXEEXT) < $(srcdir)/test.input - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< diff --git a/tests/test-noansi-nr/scanner.l b/tests/test-noansi-nr/scanner.l deleted file mode 100644 index 4afc8c2..0000000 --- a/tests/test-noansi-nr/scanner.l +++ /dev/null @@ -1,67 +0,0 @@ -/* - * This file is part of flex. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE. - */ - -/* TEST scanner. - Basic non-reentrant scanner, but with non-ansi function defs. - Compile with: flex scanner.l - - Sample Input: - # this is a comment - foo = true - bar = "string value" - integer = 43 -*/ -%{ -#include "config.h" -%} - -%option prefix="test" outfile="scanner.c" -%option nounput noyywrap noyylineno warn nodefault -%option noansi-prototypes noansi-definitions - -IDENT [[:alnum:]_-] -WS [[:blank:]] -%% - -^{IDENT}+{WS}*={WS}*(true|false){WS}*\r?\n { return 100;} -^{IDENT}+{WS}*={WS}*\"[^\"\n\r]*\"{WS}*\r?\n { return 101;} -^{IDENT}+{WS}*={WS}*[[:digit:]]+{WS}*\r?\n { return 102;} -^{WS}*#.*\r?\n { } -^{WS}*\r?\n { } -.|\n { fprintf(stderr,"Invalid line.\n"); exit(-1);} - -%% - -int main(void); - -int main () -{ - yyin = stdin; - yyout = stdout; - while( yylex() ) - { - } - printf("TEST RETURNING OK.\n"); - return 0; -} - diff --git a/tests/test-noansi-nr/test.input b/tests/test-noansi-nr/test.input deleted file mode 100644 index 642e0fb..0000000 --- a/tests/test-noansi-nr/test.input +++ /dev/null @@ -1,5 +0,0 @@ -# this is a comment -foo = "bar" -num = 43 -setting = false - diff --git a/tests/test-noansi-r/.gitignore b/tests/test-noansi-r/.gitignore deleted file mode 100644 index 40ede49..0000000 --- a/tests/test-noansi-r/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -Makefile -parser.c -parser.h -scanner.c -test-noansi-r -OUTPUT -Makefile.in diff --git a/tests/test-noansi-r/Makefile.am b/tests/test-noansi-r/Makefile.am deleted file mode 100644 index ec123fe..0000000 --- a/tests/test-noansi-r/Makefile.am +++ /dev/null @@ -1,48 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -EXTRA_DIST = scanner.l test.input -CLEANFILES = scanner.c parser.c parser.h $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o # parser.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -#LDFLAGS = $(top_srcdir)/libfl.a -#YFLAGS = --defines --output=parser.c - -testname = test-noansi-r - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $< - -parser.c: $(srcdir)/parser.y - $(BISON) $(YFLAGS) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname)$(EXEEXT) < $(srcdir)/test.input - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< diff --git a/tests/test-noansi-r/scanner.l b/tests/test-noansi-r/scanner.l deleted file mode 100644 index e0b3ffb..0000000 --- a/tests/test-noansi-r/scanner.l +++ /dev/null @@ -1,69 +0,0 @@ -/* - * This file is part of flex. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE. - */ - -/* A reentrant scanner. - This file will not compile under flex version <= 2.5.4. - Sample Input: - # this is a comment - foo = true - bar = "string value" - integer = 43 -*/ -%{ -#include "config.h" -%} - -%option prefix="test" outfile="scanner.c" -%option nounput noyywrap noyylineno warn nodefault -%option reentrant -%option noansi-definitions noansi-prototypes - -IDENT [[:alnum:]_-] -WS [[:blank:]] -%% - -^{IDENT}+{WS}*={WS}*(true|false){WS}*\r?\n { return 100;} -^{IDENT}+{WS}*={WS}*\"[^\"\n\r]*\"{WS}*\r?\n { return 101;} -^{IDENT}+{WS}*={WS}*[[:digit:]]+{WS}*\r?\n { return 102;} -^{WS}*#.*\r?\n { } -^{WS}*\r?\n { } -.|\n { fprintf(stderr,"Invalid line.\n"); exit(-1);} - -%% - -int main(void); - -int main () -{ - yyscan_t lexer; - yylex_init( &lexer ); - yyset_out ( stdout,lexer); - yyset_in ( stdin, lexer); - while( yylex(lexer) ) - { - } - yylex_destroy( lexer ); - printf("TEST RETURNING OK.\n"); - return 0; -} - diff --git a/tests/test-noansi-r/test.input b/tests/test-noansi-r/test.input deleted file mode 100644 index 2160628..0000000 --- a/tests/test-noansi-r/test.input +++ /dev/null @@ -1,4 +0,0 @@ -# this is a comment -foo = "bar" -num = 43 -setting = false diff --git a/tests/test-posix/.gitignore b/tests/test-posix/.gitignore deleted file mode 100644 index a36ae35..0000000 --- a/tests/test-posix/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -Makefile -Makefile.in -parser.c -parser.h -scanner.c -TEMPLATE -OUTPUT -.deps -test-posix diff --git a/tests/test-posix/Makefile.am b/tests/test-posix/Makefile.am deleted file mode 100644 index 2fd3271..0000000 --- a/tests/test-posix/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -EXTRA_DIST = scanner.l -CLEANFILES = scanner.c scanner.h $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -#LDFLAGS = $(top_srcdir)/libfl.a -#LFLAGS = --header="scanner.h" - -testname = test-posix - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $(LFLAGS) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname)$(EXEEXT) - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< diff --git a/tests/test-posixly-correct/.gitignore b/tests/test-posixly-correct/.gitignore deleted file mode 100644 index d28d3cb..0000000 --- a/tests/test-posixly-correct/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -Makefile -Makefile.in -parser.c -parser.h -scanner.c -TEMPLATE -OUTPUT -.deps -test-posixly-correct diff --git a/tests/test-posixly-correct/Makefile.am b/tests/test-posixly-correct/Makefile.am deleted file mode 100644 index 6821cf7..0000000 --- a/tests/test-posixly-correct/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -EXTRA_DIST = scanner.l -CLEANFILES = scanner.c scanner.h $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -#LDFLAGS = $(top_srcdir)/libfl.a -#LFLAGS = --header="scanner.h" - -testname = test-posixly-correct - -scanner.c: $(srcdir)/scanner.l - POSIXLY_CORRECT=1 $(FLEX) $(LFLAGS) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname)$(EXEEXT) - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< diff --git a/tests/test-prefix-nr/.gitignore b/tests/test-prefix-nr/.gitignore deleted file mode 100644 index 278d011..0000000 --- a/tests/test-prefix-nr/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -Makefile -Makefile.in -parser.c -parser.h -scanner.c -test-prefix-nr -OUTPUT diff --git a/tests/test-prefix-nr/Makefile.am b/tests/test-prefix-nr/Makefile.am deleted file mode 100644 index 712ce3f..0000000 --- a/tests/test-prefix-nr/Makefile.am +++ /dev/null @@ -1,49 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -EXTRA_DIST = scanner.l test.input -CLEANFILES = scanner.c scanner.h parser.c parser.h $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o # parser.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -#LDFLAGS = $(top_srcdir)/libfl.a -#LFLAGS = --header="scanner.h" -#YFLAGS = --defines --output=parser.c - -testname = test-prefix-nr - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $(LFLAGS) $< - -parser.c: $(srcdir)/parser.y - $(BISON) $(YFLAGS) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname)$(EXEEXT) < $(srcdir)/test.input - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< diff --git a/tests/test-prefix-nr/README b/tests/test-prefix-nr/README deleted file mode 100644 index 91f75c9..0000000 --- a/tests/test-prefix-nr/README +++ /dev/null @@ -1,2 +0,0 @@ -This check is to make sure the prefix "yy" is substituted where it should be. - diff --git a/tests/test-prefix-r/.gitignore b/tests/test-prefix-r/.gitignore deleted file mode 100644 index eb782b4..0000000 --- a/tests/test-prefix-r/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -Makefile -Makefile.in -parser.c -parser.h -scanner.c -test-prefix-r -OUTPUT diff --git a/tests/test-prefix-r/Makefile.am b/tests/test-prefix-r/Makefile.am deleted file mode 100644 index 1021029..0000000 --- a/tests/test-prefix-r/Makefile.am +++ /dev/null @@ -1,49 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -EXTRA_DIST = scanner.l test.input -CLEANFILES = scanner.c scanner.h parser.c parser.h $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o # parser.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -#LDFLAGS = $(top_srcdir)/libfl.a -#LFLAGS = --header="scanner.h" -#YFLAGS = --defines --output=parser.c - -testname = test-prefix-r - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $(LFLAGS) $< - -parser.c: $(srcdir)/parser.y - $(BISON) $(YFLAGS) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname)$(EXEEXT) < $(srcdir)/test.input - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< diff --git a/tests/test-prefix-r/README b/tests/test-prefix-r/README deleted file mode 100644 index 91f75c9..0000000 --- a/tests/test-prefix-r/README +++ /dev/null @@ -1,2 +0,0 @@ -This check is to make sure the prefix "yy" is substituted where it should be. - diff --git a/tests/test-pthread/.gitignore b/tests/test-pthread/.gitignore deleted file mode 100644 index f60ad66..0000000 --- a/tests/test-pthread/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -Makefile -Makefile.in -parser.c -parser.h -scanner.c -test-pthread -OUTPUT diff --git a/tests/test-pthread/Makefile.am b/tests/test-pthread/Makefile.am deleted file mode 100644 index fe5d545..0000000 --- a/tests/test-pthread/Makefile.am +++ /dev/null @@ -1,46 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -EXTRA_DIST = scanner.l test-1.input test-2.input test-3.input test-4.input test-5.input -CLEANFILES = scanner.c scanner.h parser.c parser.h $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o # parser.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -LIBS = -lpthread -#LFLAGS = --header="scanner.h" -#YFLAGS = --defines --output=parser.c - -testname = test-pthread - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $(LFLAGS) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LIBS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname) $(srcdir)/test-*.input - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< diff --git a/tests/test-quotes/.gitignore b/tests/test-quotes/.gitignore deleted file mode 100644 index f235582..0000000 --- a/tests/test-quotes/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -Makefile -Makefile.in -parser.c -parser.h -scanner.c -TEMPLATE -OUTPUT -.deps -test-quotes -l.out -c.out diff --git a/tests/test-quotes/Makefile.am b/tests/test-quotes/Makefile.am deleted file mode 100644 index 70676ef..0000000 --- a/tests/test-quotes/Makefile.am +++ /dev/null @@ -1,47 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - -FLEX = $(top_builddir)/flex - -builddir = @builddir@ - -EXTRA_DIST = scanner.l test.input -CLEANFILES = l.out c.out scanner.c scanner.h $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o - -AM_CPPFLAGS = -I$(srcdir) -I$(builddir) -I$(top_srcdir) -I$(top_builddir) - -testname = test-quotes - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $(LFLAGS) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - grep TEST_XXX < $(srcdir)/scanner.l | sed 's/^ *//' > l.out - grep TEST_XXX < scanner.c | sed 's/^ *//' > c.out - cmp -s l.out c.out - ./$(testname)$(EXEEXT) < $(srcdir)/test.input - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< diff --git a/tests/test-reject/.gitignore b/tests/test-reject/.gitignore deleted file mode 100644 index 6c2de30..0000000 --- a/tests/test-reject/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -Makefile -Makefile.in -parser.c -parser.h -scanner.c -TEMPLATE -OUTPUT -.deps -test-reject-* diff --git a/tests/test-reject/Makefile.am b/tests/test-reject/Makefile.am deleted file mode 100644 index 902d7be..0000000 --- a/tests/test-reject/Makefile.am +++ /dev/null @@ -1,80 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -EXTRA_DIST = scanner.l test.input -CLEANFILES = scanner.c $(testname)$(EXEEXT)-* OUTPUT $(OBJS) -OBJS = test-reject-nr.o test-reject-r.o test-reject-ver.o \ - test-reject-ser.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) - -tests = test-reject-nr$(EXEEXT) test-reject-r$(EXEEXT) \ - test-reject-ser$(EXEEXT) test-reject-ver$(EXEEXT) -testname = test-reject - -test-reject-nr.c: $(srcdir)/scanner.l - $(FLEX) -o $@ $(LFLAGS) $< - -test-reject-ver.c: $(srcdir)/scanner.l - $(FLEX) -o $@ --tables-verify --tables-file=`basename $@ .c`.tables $(LFLAGS) $< - -test-reject-ser.c: $(srcdir)/scanner.l - $(FLEX) -o $@ --tables-file=`basename $@ .c`.tables $(LFLAGS) $< - -test-reject-r.c: $(srcdir)/scanner.l - $(FLEX) --reentrant -o $@ $(LFLAGS) $< - -test-reject-nr$(EXEEXT): test-reject-nr.o - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $< $(LOADLIBES) - -test-reject-ver$(EXEEXT): test-reject-ver.o - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $< $(LOADLIBES) - -test-reject-ser$(EXEEXT): test-reject-ser.o - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $< $(LOADLIBES) - -test-reject-r$(EXEEXT): test-reject-r.o - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $< $(LOADLIBES) - -$(testname)$(EXEEXT): $(OBJS) - -test: $(tests) - ./$(testname)-nr$(EXEEXT) < $(srcdir)/test.input - ./$(testname)-r$(EXEEXT) < $(srcdir)/test.input - ./$(testname)-ver$(EXEEXT) $(testname)-ver.tables < $(srcdir)/test.input - ./$(testname)-ser$(EXEEXT) $(testname)-ser.tables < $(srcdir)/test.input - -test-reject-nr.o: test-reject-nr.c - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< - -test-reject-ver.o: test-reject-ver.c - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) -DTEST_HAS_TABLES_EXTERNAL $(CFLAGS) $< - -test-reject-ser.o: test-reject-ser.c - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) -DTEST_HAS_TABLES_EXTERNAL $(CFLAGS) $< - -test-reject-r.o: test-reject-r.c - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) -DTEST_IS_REENTRANT $(CFLAGS) $< - - diff --git a/tests/test-rescan-nr/.gitignore b/tests/test-rescan-nr/.gitignore deleted file mode 100644 index eb11008..0000000 --- a/tests/test-rescan-nr/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -Makefile -Makefile.in -parser.c -parser.h -scanner.c -TEMPLATE -OUTPUT -.deps -test-rescan-nr diff --git a/tests/test-rescan-nr/Makefile.am b/tests/test-rescan-nr/Makefile.am deleted file mode 100644 index 3d23a55..0000000 --- a/tests/test-rescan-nr/Makefile.am +++ /dev/null @@ -1,47 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - -FLEX = $(top_builddir)/flex - -builddir = @builddir@ - -EXTRA_DIST = scanner.l test.input -CLEANFILES = scanner.c scanner.h $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o - -AM_CPPFLAGS = -I$(srcdir) -I$(builddir) -I$(top_srcdir) -I$(top_builddir) -#LDFLAGS = $(top_srcdir)/libfl.a -#LFLAGS = --header="scanner.h" -#YFLAGS = --defines --output=parser.c - -testname = test-rescan-nr - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $(LFLAGS) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname)$(EXEEXT) $(srcdir)/test.input - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< diff --git a/tests/test-rescan-r/.gitignore b/tests/test-rescan-r/.gitignore deleted file mode 100644 index bf052c2..0000000 --- a/tests/test-rescan-r/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -Makefile -Makefile.in -parser.c -parser.h -scanner.c -TEMPLATE -OUTPUT -.deps -test-rescan-r diff --git a/tests/test-rescan-r/Makefile.am b/tests/test-rescan-r/Makefile.am deleted file mode 100644 index b24a152..0000000 --- a/tests/test-rescan-r/Makefile.am +++ /dev/null @@ -1,47 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - -FLEX = $(top_builddir)/flex - -builddir = @builddir@ - -EXTRA_DIST = scanner.l test.input -CLEANFILES = scanner.c scanner.h $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o # parser.o - -AM_CPPFLAGS = -I$(srcdir) -I$(builddir) -I$(top_srcdir) -I$(top_builddir) -#LDFLAGS = $(top_srcdir)/libfl.a -#LFLAGS = --header="scanner.h" -#YFLAGS = --defines --output=parser.c - -testname = test-rescan-r - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $(LFLAGS) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname)$(EXEEXT) $(srcdir)/test.input - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< diff --git a/tests/test-string-nr/.gitignore b/tests/test-string-nr/.gitignore deleted file mode 100644 index 05599dd..0000000 --- a/tests/test-string-nr/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -Makefile -Makefile.in -parser.c -parser.h -scanner.c -test-string-nr -OUTPUT diff --git a/tests/test-string-nr/Makefile.am b/tests/test-string-nr/Makefile.am deleted file mode 100644 index 1b06765..0000000 --- a/tests/test-string-nr/Makefile.am +++ /dev/null @@ -1,46 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -EXTRA_DIST = scanner.l -CLEANFILES = scanner.c scanner.h parser.c parser.h $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o # parser.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -#LDFLAGS = $(top_srcdir)/libfl.a -#LFLAGS = --header="scanner.h" -#YFLAGS = --defines --output=parser.c - -testname = test-string-nr - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $(LFLAGS) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname)$(EXEEXT) - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< diff --git a/tests/test-string-r/.gitignore b/tests/test-string-r/.gitignore deleted file mode 100644 index 6dbb225..0000000 --- a/tests/test-string-r/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -Makefile -Makefile.in -parser.c -parser.h -scanner.c -test-string-r -OUTPUT diff --git a/tests/test-string-r/Makefile.am b/tests/test-string-r/Makefile.am deleted file mode 100644 index ec3d4da..0000000 --- a/tests/test-string-r/Makefile.am +++ /dev/null @@ -1,46 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -EXTRA_DIST = scanner.l -CLEANFILES = scanner.c scanner.h parser.c parser.h $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o # parser.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -#LDFLAGS = $(top_srcdir)/libfl.a -#LFLAGS = --header="scanner.h" -#YFLAGS = --defines --output=parser.c - -testname = test-string-r - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $(LFLAGS) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname)$(EXEEXT) - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< diff --git a/tests/test-table-opts/.gitignore b/tests/test-table-opts/.gitignore deleted file mode 100644 index a332ff1..0000000 --- a/tests/test-table-opts/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -Makefile -Makefile.in -parser.c -parser.h -TEMPLATE -OUTPUT -.deps -test-opt-* -test-ser-* -test-ver-* -*.tables diff --git a/tests/test-table-opts/Makefile.am b/tests/test-table-opts/Makefile.am deleted file mode 100644 index 235e6c8..0000000 --- a/tests/test-table-opts/Makefile.am +++ /dev/null @@ -1,132 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - -# ------------------------------------------------ -# This test is really a set of tests, one for -# each compression flag. -Ca, -Cem, etc.. -# 'test-opt' builds non-serialized scanners with various table options. -# 'test-ver' verifies that the serialized tables match the in-code tables. -# 'test-ser' deserializes the tables at runtime. -# 'test-mul' checks that we can store multiple tables in a single file. -# ------------------------------------------------ - -FLEX = $(top_builddir)/flex - -testname := test-table-opts -allopts := -Ca -Ce -Cf -CF -Cm -Cem -Cae -Caef -CaeF -Cam -Caem - -# the test names themselves -opttests := $(foreach opt,$(allopts), test-opt-nr$(opt) test-opt-r$(opt)) -sertests := $(foreach opt,$(allopts), test-ser-nr$(opt) test-ser-r$(opt)) -vertests := $(foreach opt,$(allopts), test-ver-nr$(opt) test-ver-r$(opt)) -alltests := $(opttests) $(vertests) $(sertests) test-mul - -# the executables to build -optexe := $(addsuffix $(EXEEXT),$(opttests)) -verexe := $(addsuffix $(EXEEXT),$(vertests)) -serexe := $(addsuffix $(EXEEXT),$(sertests)) -allexe := $(optexe) $(verexe) $(serexe) - -# the .c files -optsrc := $(addsuffix .c,$(opttests)) -versrc := $(addsuffix .c,$(vertests)) -sersrc := $(addsuffix .c,$(sertests)) -allsrc := $(optsrc) $(versrc) $(sersrc) - -# the .o files -optobj := $(addsuffix .o,$(opttests)) -verobj := $(addsuffix .o,$(vertests)) -serobj := $(addsuffix .o,$(sertests)) -allobj := $(optobj) $(verobj) $(serobj) - -# the .tables files -sertables := $(addsuffix .tables,$(sertests)) -alltables := $(addsuffix .tables,$(alltests)) - -EXTRA_DIST = scanner.l test.input -CLEANFILES = scanner.c OUTPUT $(allobj) $(allsrc) $(alltables) \ - all-ser.tables $(allexe) -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) - -test: test-opt test-ser test-ver test-mul - -test-opt-r%.c: $(srcdir)/scanner.l - $(FLEX) -L -P $(subst -,_,$(basename $(@F))) --reentrant $* -o $@ $< - -test-opt-nr%.c: $(srcdir)/scanner.l - $(FLEX) -L -P $(subst -,_,$(basename $(@F))) $* -o $@ $< - -test-ser-r%.c: $(srcdir)/scanner.l - $(FLEX) -L -P $(subst -,_,$(basename $(@F))) -R --tables-file="test-ser-r$*.tables" $* -o $@ $< - -test-ser-nr%.c: $(srcdir)/scanner.l - $(FLEX) -L -P $(subst -,_,$(basename $(@F))) --tables-file="test-ser-nr$*.tables" $* -o $@ $< - -test-ver-r%.c: $(srcdir)/scanner.l - $(FLEX) -L -P $(subst -,_,$(basename $(@F))) -R --tables-file="test-ver-r$*.tables" --tables-verify $* -o $@ $< - -test-ver-nr%.c: $(srcdir)/scanner.l - $(FLEX) -L -P $(subst -,_,$(basename $(@F))) --tables-file="test-ver-nr$*.tables" --tables-verify $* -o $@ $< - -test-opt%$(EXEEXT): test-opt%.o - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $< $(LOADLIBES) - -test-ser%$(EXEEXT): test-ser%.o - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $< $(LOADLIBES) - -test-ver%$(EXEEXT): test-ver%.o - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $< $(LOADLIBES) - -test-opt: $(optexe) - for t in $(optexe) ; do \ - ./$$t `basename $$t $(EXEEXT)`.tables < $(srcdir)/test.input \ - || { echo $t FAILED ; exit 1 ; } ; \ - done - -test-ver: $(verexe) - for t in $(verexe) ; do \ - ./$$t `basename $$t $(EXEEXT)`.tables < $(srcdir)/test.input \ - || { echo $t FAILED ; exit 1 ; } ; \ - done - -test-ser: $(serexe) - for t in $(serexe) ; do \ - ./$$t `basename $$t $(EXEEXT)`.tables < $(srcdir)/test.input \ - || { echo $t FAILED ; exit 1 ; } ; \ - done - -test-mul: $(serexe) - $(RM) all-ser.tables - cat $(sertables) > all-ser.tables - for t in $(serexe) ; do \ - ./$$t all-ser.tables < $(srcdir)/test.input || { echo $$t FAILED; exit 1; } ; \ - done - -test-opt-nr-%.o: test-opt-nr-%.c ; $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< -test-ser-nr-%.o: test-ser-nr-%.c ; $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) -DTEST_HAS_TABLES_EXTERNAL $(CFLAGS) $< -test-ver-nr-%.o: test-ver-nr-%.c ; $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) -DTEST_HAS_TABLES_EXTERNAL $(CFLAGS) $< - -test-opt-r-%.o: test-opt-r-%.c ; $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) -DTEST_IS_REENTRANT $(CFLAGS) $< -test-ser-r-%.o: test-ser-r-%.c ; $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) -DTEST_HAS_TABLES_EXTERNAL -DTEST_IS_REENTRANT $(CFLAGS) $< -test-ver-r-%.o: test-ver-r-%.c ; $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) -DTEST_HAS_TABLES_EXTERNAL -DTEST_IS_REENTRANT $(CFLAGS) $< - -.PHONY: test test-opt test-ser test-ver test-mul -.SECONDARY: $(allobj) $(allsrc) diff --git a/tests/test-top/.gitignore b/tests/test-top/.gitignore deleted file mode 100644 index b095dd2..0000000 --- a/tests/test-top/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -Makefile -Makefile.in -scanner.c -scanner.h -test-top -OUTPUT diff --git a/tests/test-top/Makefile.am b/tests/test-top/Makefile.am deleted file mode 100644 index 681cadb..0000000 --- a/tests/test-top/Makefile.am +++ /dev/null @@ -1,54 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -builddir = @builddir@ - -EXTRA_DIST = scanner.l test.input main.c -CLEANFILES = scanner.c scanner.h $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o main.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -I$(builddir) -#LDFLAGS = $(top_srcdir)/libfl.a -LFLAGS = --header="scanner.h" -#YFLAGS = --defines --output=parser.c - -testname = test-top - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $(LFLAGS) $< - -parser.c: $(srcdir)/parser.y - $(BISON) $(YFLAGS) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname)$(EXEEXT) < $(srcdir)/test.input - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< - -scanner.h: scanner.c -main.o: scanner.h diff --git a/tests/test-top/test.input b/tests/test-top/test.input deleted file mode 100644 index 2ce5001..0000000 --- a/tests/test-top/test.input +++ /dev/null @@ -1,3 +0,0 @@ -Any input is ok for this scanner. -We only care if it links. - diff --git a/tests/test-yyextra/.gitignore b/tests/test-yyextra/.gitignore deleted file mode 100644 index 7e4b915..0000000 --- a/tests/test-yyextra/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -Makefile -Makefile.in -parser.c -parser.h -scanner.c -test-yyextra -OUTPUT diff --git a/tests/test-yyextra/Makefile.am b/tests/test-yyextra/Makefile.am deleted file mode 100644 index d55f74e..0000000 --- a/tests/test-yyextra/Makefile.am +++ /dev/null @@ -1,49 +0,0 @@ -# This file is part of flex. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. - -# Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE. - - -FLEX = $(top_builddir)/flex - -EXTRA_DIST = scanner.l test.input -CLEANFILES = scanner.c scanner.h parser.c parser.h $(testname)$(EXEEXT) OUTPUT $(OBJS) -OBJS = scanner.o # parser.o - -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -#LDFLAGS = $(top_srcdir)/libfl.a -#LFLAGS = --header="scanner.h" -#YFLAGS = --defines --output=parser.c - -testname = test-yyextra - -scanner.c: $(srcdir)/scanner.l - $(FLEX) $(LFLAGS) $< - -parser.c: $(srcdir)/parser.y - $(BISON) $(YFLAGS) $< - -$(testname)$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES) - -test: $(testname)$(EXEEXT) - ./$(testname)$(EXEEXT) < $(srcdir)/test.input - -.c.o: - $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< diff --git a/tests/testwrapper-direct.sh b/tests/testwrapper-direct.sh new file mode 100755 index 0000000..589ad33 --- /dev/null +++ b/tests/testwrapper-direct.sh @@ -0,0 +1,20 @@ +#!/bin/sh +set -vx +set -euvx + +# 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 ;; + s) SOURCE_DIR=$OPTARG ;; + esac + done + +shift $(($OPTIND-1)) +TESTNAME=$1 + +INPUT_NAME=`basename "${TESTNAME%.exe}"`.txt + +cd ${SOURCE_DIR} && ${BINARY_DIR}/${TESTNAME} ${INPUT_NAME} diff --git a/tests/testwrapper.sh b/tests/testwrapper.sh new file mode 100755 index 0000000..6a7e666 --- /dev/null +++ b/tests/testwrapper.sh @@ -0,0 +1,58 @@ +#!/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. + +INPUT_DIRECTORY="" +INPUT_NAME="" +INPUT_COUNT=0 +USE_REDIRECT=0 +DO_COMPARISON=0 + +while getopts :d:i:rt1 OPTION ; do + case $OPTION in + d) INPUT_DIRECTORY=$OPTARG ;; + i) + if [ "$INPUT_NAME" = "" ] ; then + INPUT_NAME="$OPTARG" + else + INPUT_NAME="$INPUT_NAME $OPTARG" + fi + INPUT_COUNT=$(($INPUT_COUNT+1)) + ;; + r) USE_REDIRECT=1 ;; + t) USE_TABLES=1 ;; + 1) DO_COMPARISON=1 ;; + esac +done + +shift $(($OPTIND-1)) +TESTNAME=$1 + +INPUT_NAME=${INPUT_NAME:-$INPUT_DIRECTORY/`basename "${TESTNAME%.exe}"`.txt} + +if [ $DO_COMPARISON = 1 ] ; then + TEST_OUTPUT=`$TESTNAME < $INPUT_NAME` + REF_OUTPUT=`$TESTNAME 1 < $INPUT_NAME` + test "$TEST_OUTPUT" -eq "$REF_OUTPUT" + exit $? +fi + +if [ $INPUT_COUNT -gt 1 ] ; then + $TESTNAME ${USE_TABLES:+${INPUT_DIRECTORY}/${TESTNAME%.exe}.tables} ${INPUT_NAME} + exit $? +fi + +if [ -f ${INPUT_NAME} ] ; 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 + fi +else + $TESTNAME +fi diff --git a/tests/test-top/scanner.l b/tests/top.l index be329b0..25f4773 100644 --- a/tests/test-top/scanner.l +++ b/tests/top.l @@ -40,8 +40,8 @@ } %option reentrant -%option 8bit outfile="scanner.c" prefix="test" -%option nounput nomain noyywrap +%option 8bit header="top.h" prefix="test" +%option nounput nomain noyywrap noinput %option warn diff --git a/tests/test-linedir-r/test.input b/tests/top.txt index 2ce5001..2ce5001 100644 --- a/tests/test-linedir-r/test.input +++ b/tests/top.txt diff --git a/tests/test-header-r/main.c b/tests/top_main.c index 353a63e..b273214 100644 --- a/tests/test-header-r/main.c +++ b/tests/top_main.c @@ -21,7 +21,9 @@ * PURPOSE. */ -#include "scanner.h" +#include <assert.h> + +#include "top.h" /* The scanner itself is not important here. * We simply try to use all the functions that are exported in the @@ -30,6 +32,9 @@ int main ( int argc, char** argv ) { + (void)argc; + (void)argv; + yyscan_t scanner; FILE *fp; char * extra = "EXTRA"; @@ -40,7 +45,9 @@ main ( int argc, char** argv ) testset_extra(extra,scanner); fp = testget_in(scanner); + assert(fp == stdin); fp = testget_out(scanner); + assert(fp == stdout); while(testlex(scanner)) { char * text; @@ -58,6 +65,3 @@ main ( int argc, char** argv ) printf("TEST RETURNING OK.\n"); return 0; } - - -/* vim:set tabstop=8 softtabstop=4 shiftwidth=4: */ diff --git a/tests/test-yyextra/scanner.l b/tests/yyextra.l index baba52b..bf2a6eb 100644 --- a/tests/test-yyextra/scanner.l +++ b/tests/yyextra.l @@ -47,8 +47,8 @@ static void append_char (char c, yyscan_t scanner ); %} -%option 8bit outfile="scanner.c" prefix="test" -%option nounput nomain noyywrap nodefault +%option 8bit prefix="test" +%option nounput nomain noyywrap nodefault noinput %option warn %option reentrant @@ -62,17 +62,17 @@ static void append_char (char c, yyscan_t scanner ); int main(void); int -main () +main (void) { yyscan_t scanner; struct Buffer * buf; int i; - buf = (struct Buffer*) malloc(sizeof(struct Buffer)); + buf = malloc(sizeof(struct Buffer)); buf->curr_len =0; buf->max_len = 4; buf->grow_len = 100; - buf->data = (char*)malloc(buf->max_len); + buf->data = malloc((size_t) buf->max_len); testlex_init(&scanner); testset_in( stdin, scanner); @@ -100,10 +100,10 @@ static void append_char (char c, yyscan_t scanner ) if( buf->curr_len >= buf->max_len ) { - new_buf = (struct Buffer*) malloc(sizeof(struct Buffer)); + new_buf = malloc(sizeof(struct Buffer)); new_buf->max_len = buf->max_len + buf->grow_len; new_buf->grow_len = buf->grow_len; - new_buf->data = (char*)malloc(new_buf->max_len); + new_buf->data = malloc((size_t) new_buf->max_len); for( new_buf->curr_len = 0; new_buf->curr_len < buf->curr_len; new_buf->curr_len++ ) diff --git a/tests/test-yyextra/test.input b/tests/yyextra.txt index 243df29..243df29 100644 --- a/tests/test-yyextra/test.input +++ b/tests/yyextra.txt diff --git a/to.do/README b/to.do/README deleted file mode 100644 index 7123c30..0000000 --- a/to.do/README +++ /dev/null @@ -1,46 +0,0 @@ -The contents of this directory are: - - Wilhelms.todo - This guy Gerhard Wilhelms did an exhaustive line-by-line - study of flex, finding a large number of glitches; it's - not clear how significant they are (some have subseuqently - been fixed). - - Wish-List - A long list of cryptic one-line descriptions of various - features people have asked for, or I've thought would be - handy. If you have questions about particular ones, let - me know. - - reentrant - A set of mods contributed by John Bossom for adding - an option to flex to make reentrant scanners. - - rflex-2.5.4-diffs - A set of mods contributed by Chris Appleton for - the same purpose. - - streams - email from David Madden about coping with non-blocking - I/O. - - unicode - patches to support Unicode scanners, contributed - by James A. Lauth. - - -Of these, the ones that people frequently ask about are support for reentrant -scanners and support for Unicode. I haven't played with the reentrant stuff -so don't know how solid / well designed it is. I've sent out the Unicode -stuff to numerous people and haven't received any complaints, so I imagine -it works well. - -Another thing people ask for fairly often is removing the limit on size -of the scanners. There's some mail in the faqs/ directory about ways to -do this by cranking some #define's in flexdef.h, though of course the best -solution would be dynamic memory/resizing. - -By the way, I have translated the core flex algorithms into a C++ regular -expression class (but one that doesn't support the uglier stuff like -yymore()/yyless(), trailing context, etc.). If you ever wind up wanting -it, just let me know. diff --git a/to.do/Wilhelms.todo b/to.do/Wilhelms.todo deleted file mode 100644 index f64a335..0000000 --- a/to.do/Wilhelms.todo +++ /dev/null @@ -1,711 +0,0 @@ -PARSE.Y 344: ('rule'-rule " | re '$' ": There are some errors concerning - trailing context. First of all the rule " re '$' " implies that this is - no variable_trail_rule because the tail of it ( '$' ) has a fixed length - of 1. The only possible reason for making this rule variable is when - 'previous_continued_action' is true. In this case 'variable_trail_rule' - must be set and the beginning of the trailing part must be marked. - However the variables 'varlength' and 'headcnt' have not the same meaning - as in the rule " re2 re ". Here ( in the rule " re '$' " ) 'varlength' - is true if the head ( 're' ) of the rule has variable length, and - 'headcnt' is still 0 because it isn't set during reduction of 're'. - Therefore the test for a variable trailing rule - " if ( ! varlength || headcnt != 0 ) " - is wrong and should be removed. - Also it is not necessary to set 'varlength' or 'headcnt' if you set - " trailcnt = 1; ". If this rule is made variable then 'variable_trail_rule' - is set and neither 'headcnt' nor 'trailcnt' are used in 'finish_rule()'. - And if this rule is normal then the head may be variable or not, but in - 'finish_rule()' code is generated to reduce 'yy_cp' by 1. - Finally I found no reason to create an epsilon-state and insert it in - front of mkstate( '\n' ) instead of adding it behind. This epsilon-state - should be marked as STATE_TRAILING_CONTEXT. Otherwise you get no warning - of dangerous trailing context if you have a rule " x\n*$ " which was made - variable with '|'.) - - | re '$' - { - /* if ( trlcontxt ) - { - synerr( "trailing context used twice" ); - $$ = mkstate( SYM_EPSILON ); - } - - else */ if ( previous_continued_action ) - { - /* see the comment in the rule for "re2 re" - * above - */ - /* if ( ! varlength || headcnt != 0 ) */ - { - fprintf( stderr, - "%s: warning - trailing context rule at line %d made variable because\n", - program_name, linenum ); - fprintf( stderr, - " of preceding '|' action\n" ); - } - - /* mark as variable */ - /* varlength = true; - headcnt = 0; */ - - add_accept( $1, num_rules | YY_TRAILING_HEAD_MASK ) -; - variable_trail_rule = true; - } - - /* trlcontxt = true; - - if ( ! varlength ) - headcnt = rulelen; - - ++rulelen; */ - trailcnt = 1; - - current_state_type = STATE_TRAILING_CONTEXT; - eps = mkstate( SYM_EPSILON ); - current_state_type = STATE_NORMAL; - - $$ = link_machines( $1, - link_machines( mkstate( '\n' ), eps ) ); - } - -DFA.C 618: (ntod(): The arrays 'targstate[]' and 'targfreq[]' can be - maintained in a better way. Up to now it is possible that states are added - to 'targstate[]' more than once, because the state 'newds' from the call - to snstods() creates a new entry in 'targstate[]'. But 'newds' may already - exist in 'targstate[]' ! - Another point is that 'targfreq[]' is not updated if "caseins && ! useecs" - is true. - My algorithm should solve these problems. However it could be simplified - by replacing 'newds' by 'targ' and removing the statement "targ = newds;". - Remark to the second point: I decremented the targfreq-counter if 'sym' - was an uppercase letter and incremented it if 'sym' was a lowercase - letter. The index 'i' of 'targfreq[i]' points to the correct position in - 'targstate[]' even if a new state was added.) - - for ( sym = 1; sym <= numecs; ++sym ) - { - if ( symlist[sym] ) - { - symlist[sym] = 0; - - if ( duplist[sym] == NIL ) - { /* symbol has unique out-transitions */ - numstates = symfollowset( dset, dsize, sym, nset ); - nset = epsclosure( nset, &numstates, accset, - &nacc, &hashval ); - - if ( snstods( nset, numstates, accset, - nacc, hashval, &newds ) ) - { - totnst = totnst + numstates; - ++todo_next; - numas += nacc; - - if ( variable_trailing_context_rules && nacc > 0 ) - check_trailing_context( nset, numstates, - accset, nacc ); - } - - targ = newds; - } - - else - { - /* sym's equivalence class has the same transitions - * as duplist(sym)'s equivalence class - */ - targ = state[duplist[sym]]; - } - - state[sym] = targ; - - if ( trace ) - fprintf( stderr, "\t%d\t%d\n", sym, targ ); - - /* update frequency count for destination state */ - - for ( i = 1; i <= targptr; ++i ) - if ( targstate[i] == targ ) - break; - - if ( i <= targptr ) - { - ++targfreq[i]; - ++numdup; - } - else - { - targfreq[++targptr] = 1; - targstate[targptr] = targ; - ++numuniq; - } - - if ( caseins && ! useecs ) - { - if ( sym >= 'A' && sym <= 'Z' ) - { - --targfreq[i]; - --totaltrans; - } - else if ( sym >= 'a' && sym <= 'z' ) - { - ++targfreq[i]; - ++totaltrans; - } - } - - ++totaltrans; - duplist[sym] = NIL; - } - } - - -GEN.C 438: (gen_next_compressed_state(): I have rewritten the function - 'yy_try_NUL_trans()' so it really just tries to find out whether a - transition on the NUL character goes to the jamstate or not. ( That means - I removed each creation of backtracking information and the saving of the - new state on the 'yy_state_buf[]'. ) - Therefore I removed the call for 'gen_backtracking()' here, because the - function 'gen_next_compressed_state()' is also used in 'gen_NUL_trans()'.) - -/* gen_backtracking(); */ - -GEN.C 587ff: (gen_next_state(): Since the backtracking information is not - created in 'gen_next_compressed_state()' any more, it is done here - before the next state is computed ( for "compressed" tables ). This - removes the bug that the backtracking information is created twice if - 'nultrans' is not NULL and 'gen_next_compressed_state()' is called. - Finally I had to insert the creation of a "{" and a "}", because there - is a local variable created in 'gen_next_compressed_state()'. ( These are - needed only when backtracking information is really created.) ) - - if ( ! fulltbl && ! fullspd ) - gen_backtracking(); - - if ( worry_about_NULs && nultrans ) - { - indent_puts( "if ( *yy_cp )" ); - indent_up(); - indent_puts( "{" ); - } - else if ( ! fulltbl && ! fullspd && ! reject && num_backtracking > 0 ) - indent_puts( "{" ); - - if ( fulltbl ) - indent_put2s( "yy_current_state = yy_nxt[yy_current_state][%s];", - char_map ); - - else if ( fullspd ) - indent_put2s( "yy_current_state += yy_current_state[%s].yy_nxt;", - char_map ); - - else - gen_next_compressed_state( char_map ); - - if ( worry_about_NULs && nultrans ) - { - indent_puts( "}" ); - indent_down(); - indent_puts( "else" ); - indent_up(); - - indent_puts( "yy_current_state = yy_NUL_trans[yy_current_state];" ); - indent_down(); - } - else if ( ! fulltbl && ! fullspd && ! reject && num_backtracking > 0 ) - indent_puts( "}" ); - - if ( fullspd || fulltbl ) - gen_backtracking(); - - if ( reject ) - indent_puts( "*yy_state_ptr++ = yy_current_state;" ); - } - -GEN.C 553: (gen_next_match(): There is a problem if 'interactive' is true. In - this case the scanner jams if the next state is the jamstate ( i.e. - yy_base[yy_current_state] == jambase ). However the scanner reaches also - the jamstate if the transition character is the NUL-character or if the - end of the buffer is reached. Then in the EOB-action is decided whether - this was really a NUL character or the end-of-buffer. ( If it was a NUL, - scanning will be resumed. If it was the end-of-buffer, the buffer will be - filled first, before scanning will be resumed. ) - These actions are not done if you use an 'interactive' scanner, because - the EOB-action is not executed. Therefore you have to continue scanning, - if you have just matched a NUL character ( i.e. *yy_cp == '\0' and - yy_cp < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) and if you are not - already in the yamstate ( i.e. yy_current_state != jamstate ). - Note that the '<' in " yy_cp < &yy_current_buffer->yy_ch_buf[yy_n_chars] " - implies that the EOB action is *not* executed if the last match before the - end-of-buffer was maximal. - The following change in the algorithm results in a minor performance - penalty because the additional conditions are tested only if you have - reached the end of the match or if you are using NUL characters in your - patterns.) - - if ( interactive ) - { - printf( "while ( yy_base[yy_current_state] != %d\n", jambase ); - set_indent( 4 ); - indent_puts( "|| ( *yy_cp == '\\0'" ); - indent_up(); - indent_puts( - " && yy_cp < &yy_current_buffer->yy_ch_buf[yy_n_chars]" ); - do_indent(); - printf( " && yy_current_state != %d ) );\n", jamstate ); - set_indent( 2 ); - } - else - printf( "while ( yy_current_state != %d );\n", jamstate ); - -GEN.C 341: (gen_find_action(): Question: The variables 'yy_full_match', - 'yy_full_state' and 'yy_full_lp' are used only in the REJECT macro. Why - do you not also test here on 'real_reject' before you create code to set - these variables ( like you did in line 327ff for the action of the case - " ( yy_act & YY_TRAILING_MASK ) " ) ?) - - New code beginning at line 338 to show the context: - indent_puts( "else" ); - indent_up(); - indent_puts( "{" ); - - if ( real_reject ) - { - /* remember matched text in case we back up due to REJECT */ - indent_puts( "yy_full_match = yy_cp;" ); - indent_puts( "yy_full_state = yy_state_ptr;" ); - indent_puts( "yy_full_lp = yy_lp;" ); - } - - indent_puts( "break;" ); - indent_puts( "}" ); - indent_down(); - - indent_puts( "++yy_lp;" ); - indent_puts( "goto find_rule;" ); - } - - -FLEX.SKEL 364,379: (YY_END_OF_BUFFER action: If it was really a NUL character - which started this action, then 'yy_bp' points still at the beginning of - the current run and 'yy_c_buf_p' points behind the NUL character. - Contrast this with the situation after the call of 'yy_get_next_buffer()'! - Therefore I removed the statement " yy_bp = yytext + YY_MORE_ADJ; " - ( line 379 ) and replaced the statement - " yy_c_buf_p = yytext + yy_amount_of_matched_text; " ( line 364 ) by the - easier one " yy_c_buf_p = --yy_cp; ". Here 'yy_cp' is also adjusted. - This guarantees that both 'yy_c_buf_p' and 'yy_cp' point at the NUL - character. Therefore 'yy_cp' will have the correct value when it is needed - after the call to 'yy_try_NUL_trans()' ( when we know whether we make a - transition or not ). - - line 364: - yy_c_buf_p = --yy_cp; - - line 379: - /* yy_bp = yytext + YY_MORE_ADJ; */ - -GEN.C 632: (gen_NUL_trans(): I have rewritten 'yy_try_NUL_trans()'. The new - version just finds out whether a transition on the NUL character goes to - the jamstate or not. See also my remarks to 'gen_next_compressed_state()'. - Note that the test " yy_is_jam = (yy_current_state == jamstate); " is - also used, if 'interactive' is true. Otherwise 'yy_try_NUL_trans()' would - return 0, if the NUL character was the last character of a pattern - ( e.g. "x\0" ), and we therefore would not reach the last state. - Remark: Change also the comment in FLEX.SKEL for this function.) - - FLEX.SKEL, line 583: -%% code to find the next state goes here - - GEN.C, line 632ff: -/* int need_backtracking = (num_backtracking > 0 && ! reject); - - if ( need_backtracking ) - / * we'll need yy_cp lying around for the gen_backtracking() * / - indent_puts( "register YY_CHAR *yy_cp = yy_c_buf_p;" ); */ - - GEN.C, line 674ff: -/* if ( reject ) - indent_puts( "*yy_state_ptr++ = yy_current_state;" ); */ - - do_indent(); - -/* if ( interactive ) - printf( "yy_is_jam = (yy_base[yy_current_state] == %d);\n", - jambase ); - else */ - printf( "yy_is_jam = (yy_current_state == %d);\n", jamstate ); - } - - /* if we've entered an accepting state, backtrack; note that - * compressed tables have *already* done such backtracking, so - * we needn't bother with it again - */ -/* if ( need_backtracking && (fullspd || fulltbl) ) - { - putchar( '\n' ); - indent_puts( "if ( ! yy_is_jam )" ); - indent_up(); - indent_puts( "{" ); - gen_backtracking(); - indent_puts( "}" ); - indent_down(); - } */ - } - -GEN.C 1293: (make_tables(): The changed functionality of 'yy_try_NUL_trans()' - implies changes in the EOB action. If the next state 'yy_next_state' is 0 - ( i.e. the jamstate ), you can immediately jump to 'yy_find_action'. - Remember that 'yy_cp' was already adjusted to point at the NUL ! - Also you must not use the backtracking information because the actual - state 'yy_current_state' may be an accepting state. - If 'yy_next_state' is not the jamstate, we make a transition on the NUL. - This requires the following actions: - - Create backtracking information for compressed tables *before* we make - the transition on NUL. - - Now increment 'yy_cp' and set 'yy_current_state' to 'yy_next_state'. - ( Note that 'yy_cp' points at the NUL up to now. ) - - Save the new state on the stack 'yy_state_buf[]' if 'reject' is true. - - Create backtracking information *after* the transition, if 'fulltbl' - or 'fullspd' is true. - - Finally decide, if 'interactive' is true, whether scanning should be - resumed at 'yy_match' or whether we have reached a final state and - should jump to 'yy_find_action'. (Condition like in 'gen_next_match()'.) - If 'interactive' is false, just resume scanning.) - - Corresponding code in FLEX.SKEL beginning at line 381: - if ( yy_next_state ) - { - /* consume the NUL */ -%% code to do backtracking for compressed tables and set up yy_cp goes here - } - else - goto yy_find_action; - - Code in GEN.C beginning at line 1293: - /* first, deal with backtracking and setting up yy_cp if the scanner - * finds that it should JAM on the NUL - */ - skelout(); - set_indent( 6 ); - - if ( ! fulltbl && ! fullspd ) - gen_backtracking(); - - indent_puts( "++yy_cp;" ); - indent_puts( "yy_current_state = yy_next_state;" ); - - if ( reject ) - indent_puts( "*yy_state_ptr++ = yy_current_state;" ); - - if ( fulltbl || fullspd ) - gen_backtracking(); - - if ( interactive ) - { - do_indent(); - printf( "if ( yy_base[yy_current_state] != %d\n", jambase ); - indent_up(); - indent_puts( "|| ( *yy_cp == '\\0'" ); - indent_puts( "&& yy_cp < &yy_current_buffer->yy_ch_buf[yy_n_chars]" ); - do_indent(); - printf( "&& yy_current_state != %d ) )\n", jamstate ); - indent_puts( "goto yy_match;" ); - indent_down(); - indent_puts( "else" ); - indent_up(); - indent_puts( "goto yy_find_action;" ); - indent_down(); - } - else - indent_puts( "goto yy_match;" ); - -/* if ( fullspd || fulltbl ) - indent_puts( "yy_cp = yy_c_buf_p;" ); - - else - { / * compressed table * / - if ( ! reject && ! interactive ) - { - / * do the guaranteed-needed backtrack to figure out the match * / - indent_puts( "yy_cp = yy_last_accepting_cpos;" ); - indent_puts( "yy_current_state = yy_last_accepting_state;" ); - } - } */ - -FLEX.SKEL 513: (yy_get_next_buffer(): Here is an error if 'yymore()' is active - in the last match (i.e. yy_doing_yy_more == 1 and yy_more_len > 0). Then - 'number_to_move' will be (1 + yy_more_len), i.e. the previous character - plus the additional characters for using 'yymore()'.) - - if ( number_to_move == 1 + YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yy_current_buffer->yy_eof_status = EOF_DONE; - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_eof_status = EOF_PENDING; - } - } - -GEN.C 1317: (make_tables(): In the generation of 'yy_get_previous_state()' the - variable 'yy_bp' must be set to 'yytext + YY_MORE_ADJ' if 'bol_needed' is - true. Otherwise 'yy_bp' points eventually at the beginning of the - yymore-prefix instead of the current run.) - - if ( bol_needed ) - indent_puts( "register YY_CHAR *yy_bp = yytext + YY_MORE_ADJ;\n" ); - -FLEX.SKEL 589ff: (yyunput(): The function 'yyunput()' should be rewritten. - First of all the example for 'unput()' in file flexdoc doesn't work: - { - int i; - unput( ')' ); - for ( i = yyleng - 1; i >= 0; --i ) - unput( yytext[i] ); - unput( '(' ); - } - The actual version of 'yyunput()' modifies 'yyleng'. Therefore 'yyleng' is - decremented by " unput( ')' ) " and the pattern to be pushed back has lost - its last character. To avoid this just copy the 'yytext'-string and - 'yyleng' before you call 'unput()'. - Another point is that 'yytext' and 'yyleng' could be maintained in a - better way. ( Up to now 'yyleng' can become negative ! ) - I think it's better to say that the pushed back pattern should fulfill - the beginning-of-line-condition if and only if the old pattern does - ( excluding a possibly existing 'yymore'-prefix ! ). - Up to now you have problems if there is a 'yymore'-prefix, because - 'yytext' will be corrupted by YY_DO_BEFORE_ACTION. ( This macro sets - 'yytext' to 'yy_bp - yy_more_len', but our 'yy_bp' points already at the - beginning of the 'yymore'-prefix. ) - - My version of 'yyunput()' reduces the 'yytext'-string by 1 for every - pushed back character and decrements 'yyleng' until 'yytext' is the empty - string. The beginning-of-line-condition is preserved when 'bol_needed' is - true. ( Then the character before the current run is copied in front of - the pushed back character. ) If there is a 'yymore'-prefix, 'yy_more_len' - will be decremented if 'yy_cp' reaches the beginning of the current run. - - Remark: The parameter 'yytext' in " yyunput( c, yytext ) " is not really - necessary since 'yytext' is a global variable. You could also set - " register YY_CHAR *yy_bp = yytext; " at the beginning of 'yyunput()'.) - - Replace lines 622 - 623 in FLEX.SKEL: - - if ( yy_cp > yy_bp && yy_cp[-1] == '\n' ) - yy_cp[-2] = '\n'; - - by - -%% code to adjust yy_bp and yy_more_len goes here - - Add in GEN.C a function 'gen_yyunput()': -/* generate code to adjust yy_bp and yy_more_len in yyunput - */ - -void gen_yyunput() - - { - if ( yymore_used ) - indent_puts( "yy_bp += YY_MORE_ADJ;\n" ); - - if ( bol_needed ) - indent_puts( "yy_cp[-2] = yy_bp[-1];\n" ); - - if ( yymore_used ) - { - indent_puts( "if ( (yy_cp == yy_bp) && YY_MORE_ADJ )" ); - indent_up(); - indent_puts( "--yy_more_len;" ); - indent_down(); - indent_puts( "else" ); - indent_up(); - indent_puts( "--yy_bp;" ); - indent_down(); - } - else - indent_puts( "--yy_bp;" ); - } - - Finally add in the function 'make_tables()' behind the call of - 'gen_NUL_trans()' in line 1328: - - skelout(); - gen_yyunput(); - -FLEX.SKEL 642,658: (input(): There is an error in 'input()' if the end of - 'yy_current_buffer' is reached and 'yymore' is active. Then - 'yy_get_next_buffer()' is called which function assumes that 'yytext' - points at the beginning of the 'yymore'-prefix. This function can't - recognize the end of the input stream correctly and therefore returns - EOB_ACT_LAST_MATCH instead of EOB_ACT_END_OF_FILE. Also if the end of - the input file isn't reached yet (EOB_ACT_CONTINUE_SCAN) at least one - character will be lost. - To avoid this error just turn off 'yy_doing_yy_more'. Then you need - not to adjust with YY_MORE_ADJ in lines 667 and 682. However you have to - use a function 'gen_input()', because 'yy_doing_yy_more' does not exist - if 'yymore_used' is false. - - ( Another solution is to adjust 'yytext': - " yytext = yy_c_buf_p - YY_MORE_ADJ; ", line 658. ) - - I think the trick with "yy_did_buffer_switch_on_eof" should be done here - the same way as in the YY_END_OF_BUFFER action. - Finally I removed the variable 'yy_cp' and used 'yy_c_buf_p' instead.) - -#ifdef __cplusplus -static int yyinput() -#else -static int input() -#endif - - { - int c; - - *yy_c_buf_p = yy_hold_char; /* yy_cp not needed */ - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - /* this was really a NUL */ - *yy_c_buf_p = '\0'; - - else - { /* need more input */ -%% code to turn off yy_doing_yy_more and yy_more_len goes here - yytext = yy_c_buf_p; - ++yy_c_buf_p; - - switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; - - if ( yywrap() ) - { - yy_c_buf_p = yytext; /* + YY_MORE_ADJ not needed */ - return ( EOF ); - } - else - { - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - -#ifdef __cplusplus - return ( yyinput() ); -#else - return ( input() ); -#endif - } - break; - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext; /* + YY_MORE_ADJ not needed */ - break; - - case EOB_ACT_LAST_MATCH: -#ifdef __cplusplus - YY_FATAL_ERROR( "unexpected last match in yyinput()" ); -#else - YY_FATAL_ERROR( "unexpected last match in input()" ); -#endif - } - } - } - - c = *yy_c_buf_p; - yy_hold_char = *++yy_c_buf_p; - - return ( c ); - } - - Add in GEN.C a function 'gen_input()': -/* generate code to turn off yy_doing_yy_more and yy_more_len in input - */ - -void gen_input() - - { - if ( yymore_used ) - indent_puts( "yy_doing_yy_more = yy_more_len = 0;" ); - } - - Finally add in the function 'make_tables()' behind the call of - 'gen_yyunput()': - - set_indent( 3 ); - skelout(); - gen_input(); - -PARSE.Y 54: ( 'goal'-rule: If there is no rule in the input file, the end of - the prolog is not marked yet, because 'flexscan()' is still in the start - condition <SECT2PROLOG> and the rule <SECT2PROLOG><<EOF>> is not done up - to now. Therefore mark the end of prolog here, before you add the default - rule. I test here on " num_rules == 1 ", because the 'initforrule'-rule - increments 'num_rules' before this action is executed.) - - if ( num_rules == 1 ) - fprintf( temp_action_file, "%%%% end of prolog\n" ) -; - -SCAN.L 255: ( '<SECT2PROLOG><<EOF>>'-rule: If there are no rules at all in - the input file, then this rule will be executed at the end of - 'make_tables()'. At this point 'temp_action_file' was closed for writing - and has been reopened for reading. The macro MARK_END_OF_PROLOG will - therefore lead to a write-error. - To avoid this error add the condition " if ( num_rules == 0 ) ". If this - rule is executed at the end of 'make_tables()' there will be at least the - default rule, i.e. 'num_rules' will be greater than 0. - Remark: This correction together with the one before will allow an input - file which just consists of "%%". ( Copy 'stdin' to 'stdout'. )) - -<SECT2PROLOG><<EOF>> { - if ( num_rules == 0 ) - MARK_END_OF_PROLOG; - yyterminate(); - } - -MISC.C 376: ( flexfatal(): The call of 'flexend( 1 )' will lead to an - infinite loop if 'flexfatal()' is called from 'flexend()'. I therefore - introduced the flag 'doing_flexend' to prevent 'flexend()' to be called - more than once.) - - Replace the function call 'flexend( 1 );' in GEN.C, line 376, by - if ( ! doing_flexend ) - flexend( 1 ); - - Set 'doing_flexend' at the beginning of 'flexend()' in MAIN.C, line 195: - doing_flexend = true; - - Add in FLEXDEF.H, line 381, the declaration of 'doing_flexend': -extern int yymore_used, reject, real_reject, continued_action, doing_flexend; - - Add in FLEXDEF.H, line 376, a comment for this variable: - * doing_flexend - true if flexend() has been started - - Initialize 'doing_flexend' in 'flexinit()' in MAIN.C, line 401: - yymore_used = continued_action = reject = doing_flexend = false; - -FLEX.SKEL 94: ( 'YY_INPUT()'-macro: I have problems with 'fileno()' and - 'read()'. - I used the C Compiler of the BORLAND C++ Compiler and compiled the created - scanner with the option 'ANSI keywords'. - In this compiler the prototype of the function 'read(...)' is declared in - the header file 'io.h' and not in 'stdio.h'. Therefore I get a warning. - Real trouble caused 'fileno' which is defined as macro in 'stdio.h': - #define fileno(f) ((f)->fd) - However this macro does not belong to the 'ANSI keywords' because it is - define'd under the condition " #if !__STDC__ ". Therefore I get a warning - and a linker error that the function 'fileno()' does not exist. - (I can avoid this problem by adding the above define-macro in the *.l file - or by replacing the option 'ANSI keywords' by 'Borland C++ keywords'.)) diff --git a/to.do/Wish-List b/to.do/Wish-List deleted file mode 100644 index 2ef20e0..0000000 --- a/to.do/Wish-List +++ /dev/null @@ -1,277 +0,0 @@ -// Good idea. It might be easier to auto-prefix them instead. -start conditions given own name space by making them structure fields - #define BEGIN(x) yy_start_state = yy_states->x - -// Easy. -yylineno maintained per input buffer - -// Done. -use yyconst instead of const, to fix __STDC__ == 0 problem - -// We rely on %option unput instead. -scan input for unput() - -// Not worth the effort. --CF/-Cf support interactive scanners - -// What does this mean? -reject_really_used -> maintain_backup_tables - -// Would be easier to rewrite it. -full library encapsulation: flex'ing on the fly - -// Currently, max=32k states. Is this an unreasonable limit? -fix MAX_MNS/MARKER_DIFFERENCE to not be a hard limit - -// Not doable, especially for the regex operator precedence case. -Two flags to warn when something is seen that lex or posix might interpret - differently; this should be quite doable as -l already exists. Proposed - names: -Wl, -Wp. - -// Done. -reentrant C scanners - -// Why not use fseek/lseek ? -yy_fseek() for positioning in input file - -// What does this mean? -set-able "at beginning of line" , no more unput() trashes yytext? - -// Doable. -yy_unput_string(); unput() shifts yytext to preserve it, grows buffer as needed - -// Bleh. -yy_malloc_type as void* so can be easily switched to char* for poor - hopeless bastards running SunSoft stuff? - -// Done. -public "TODO" file, requesting help? - -// Done. -test -P to make sure it's not broken now due to e.g. yy_scan_string - -// What does this mean? -hook for treating input interactively even if not isatty() - -// Easy. -document yy_fill_buffer - -// Are these tools even updated anymore? -lint, gcc-lint - -// Obsolete. --lfl removed from flex.1 - -// What does this mean? -merge 2.4.6, e.g., NEWS - -// Is it bothering anyone? -'|' action copies action instead of omitting break - -// Doable. -if yy_current_buffer defined on entry to yylex(), don't promote nil yyin - to stdin, etc. - -// Inevitable, but a daunting task. -multibyte character flex - -// Done ("traditional") -ANSI only - -// Obsolete. -multiple inclusion of <stdlib.h>? - -// Put on back burner. -[=...=] POSIX stuff - -// Done. -yylineno, yycol by checking for whether rules can match embedded newlines, - only trailing newlines, always trailing newlines, or no newlines - -// Bleh. -compute transition path to each DFA state, to aid in backtracking - for each state, store pointer to predecessor, character for xtion - -// Obsolete. -merge flex.1, flexdoc.1? - -// In the works. -bison++ interface - -// What is this supposed to do? -YYLEXER_NAME - -// Moot. C++ will get an overhaul eventually. -out-line FlexLexer destructors - -// What does this mean? -GNU readline contrib? - -// Done. -isatty() decl? - -// I think this is obsolete. -#ifdef chud for unput() etc. not being used? - "../scan.l", line 207: warning: ::yy_did_buffer_switch_on_eof defined but not used - cc -c -g scan.c - "scan.cc", line 1752: warning: statement not reached - -// Done. -alloca.c removed from Makefile - -// Doable. -// comments - -// Done. (%% lines in skel) -output partitioning for e.g., scanning tables, actions, etc. - -// Done. -texinfo version of manual - -// What does this mean? -example of "error" backtracking rules as opposed to "catch-all" - -// What does this mean? -get rid of get_previous_state via accepting #'s tied to previous state #'s - -// Doable. --p tells something about backtracking - -// Done. -easy way to scan strings instead of files - -// Useful, but tricky. -input() across buffer boundaries, buffer overflow; unput() fix - -// Done. -start state stack - -// I guess this is handled by the set_bol() stuff. -NLSTATE - sets "in newline" state; also mechanism to clear "in newline" state - -// Unreachable rules are flagged. Is this what is meant? -checks for bogus backtrack rules ... - rule shadowing - -// Done. -document incompatibility with lex when unput()'ing a newline - after a newline has been read - -// Incorrect. They are allowed. -document that comments are not allowed on definition lines - foo bar /* the "foo" definition ... */ - -// What does this mean? -perhaps indented code in section 2 leads to warnings? - -// Easy. -#line directives for code at beginning of scanner routine - -// Done. -nuke %used etc. - -// Done. -hooks for direct access to the buffer, e.g. for flushing it - -// Done. -options in .l file as well as on command line; particularly the rename-prefix - option - -// Done. -clarify "eat up * not followed by /" in <comment> example; move it to - performance, offer simpler version for start states - -// Doable. -hook for finding out how much text can be safely pushed back - -// What does this mean? -the .backtrack code knows how to identify characters that cause transitions - (you wanted this for some clearer error messages for the - "default rule can be matched") - -// Obsolete. -yy_switch_to_buffer sets yy_init to 0? - -// Excellent idea. -handy library routines, such as yy_C_comment(), yy_C_string(), - -// Done. -obey #line directives in input; first, get rid of # comments ... - -// Done. -flex.h header for declarations of e.g., yymore(), yytext? - but what about %array making the yytext definition out of date? - -// What does this mean? -merge w/ okeeffe code - -// Easy. -rearrange the Performance Considerations section so that the easy - fixes come first - -// Done. -copyright notice in manuals? - -// Doable. -input() updates yytext and yyleng; perhaps unput too???; - right now it trashes them (doesn't restore '\0') - -// No. yyleng should not be modifable. -document that yyleng can now be modified - except if yymore() used? - -// Icky. -anchoring allowed inside ()'s - (^abc|def$) - -// -unput() propagates non-newline state too? - -// Not doable. Anchors chars are only special at ends of RE. -complain about invalid anchoring - foo(^abc), (^abc)+ - -// Not likely. -library in its own directory - -// Done. -yylineno - -// Why? -example in flexdoc on YY_INPUT reading from input() - -// Not currently doable. -redesign for retargetability (i.e., use w/ other languages ...) - -// ??? -clean up escape expansion - -// In progress. -bison @N - -// Done. -example for doc. on scanning strings w/ escapes in them: - -// Done. -POSIX/ - -// Done. -get rid of duplicated code between "re2 re" rule and "re '$'" rule - -// Obsolete. -preformatted man pages for VMS sites, possibly using col -b to get rid - of backspaces ... - -// Interesting. -slurp entire input file into mega-buffer; allows pointers to in-place - identifiers - -// Done. -lex compatibility flag - -// Done. -update flags in docs - -// Done. It's still there. --n removed from POSIX? - -// Obsolete. -"MAKE = ..." shouldn't be commented out, or else bigtest can fail -BSD man macros diff --git a/to.do/flex.rmail b/to.do/flex.rmail deleted file mode 100644 index 6c7f445..0000000 --- a/to.do/flex.rmail +++ /dev/null @@ -1,4520 +0,0 @@ -BABYL OPTIONS: -*- rmail -*- -Version: 5 -Labels: -Note: This is the header of an rmail file. -Note: If you are seeing it in rmail, -Note: it means the file has no messages in it. - -1,, -X-Coding-System: nil -Mail-from: From vern@daffy.ee.lbl.gov Wed Mar 14 04:01:40 2001 -Return-Path: <vern@daffy.ee.lbl.gov> -Received: from localhost (localhost [127.0.0.1]) - by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id EAA09959 - for <wlestes@localhost>; Wed, 14 Mar 2001 04:01:40 -0500 -Received: from imap.uncg.edu - by localhost with IMAP (fetchmail-5.1.0) - for wlestes@localhost (single-drop); Wed, 14 Mar 2001 04:01:40 -0500 (EST) -Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70]) - by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f2E8pme19617 - for <wlestes@hermes.email.uncg.edu>; Wed, 14 Mar 2001 03:51:48 -0500 (EST) -Received: from daffy.ee.lbl.gov (daffy.ee.lbl.gov [131.243.1.31]) - by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id DAA20394 - for <wlestes@uncg.edu>; Wed, 14 Mar 2001 03:51:47 -0500 (EST) -Received: (from vern@localhost) - by daffy.ee.lbl.gov (8.10.0/8.10.0) id f2E8pkM07870; - Wed, 14 Mar 2001 00:51:46 -0800 (PST) -Message-Id: <200103140851.f2E8pkM07870@daffy.ee.lbl.gov> -To: "W. L. Estes" <wlestes@uncg.edu> -Subject: Re: possibly taking over maintenance of flex -In-reply-to: Your message of Tue, 13 Mar 2001 09:00:58 EST. -Date: Wed, 14 Mar 2001 00:51:46 PST -From: Vern Paxson <vern@ee.lbl.gov> - -*** EOOH *** -To: "W. L. Estes" <wlestes@uncg.edu> -Subject: Re: possibly taking over maintenance of flex -In-reply-to: Your message of Tue, 13 Mar 2001 09:00:58 EST. -Date: Wed, 14 Mar 2001 00:51:46 PST -From: Vern Paxson <vern@ee.lbl.gov> - -> probably best to have a trial period up front as you suggest. - -Okay, you can get a copy of the master sources from - - ftp://ftp.ee.lbl.gov/.vp-flex-sources.tar.gz - -The TODO/ subdirectory has the general wish list plus a number of contributed -patches. The faqs/ subdirectory has a bunch of email messages (in MH -folder format, i.e., one message per file, files numbered sequentially) -for commonly asked questions - worth taking a look through to see what -sorts of things people frequently ask about. - -Next messages are various stuff I sent to Dick King. - -Thanks for giving it a try - naturally, by all means let me know when you -have questions ... - - Vern - - -1,, -X-Coding-System: nil -Mail-from: From vern@daffy.ee.lbl.gov Wed Mar 14 04:01:40 2001 -Return-Path: <vern@daffy.ee.lbl.gov> -Received: from localhost (localhost [127.0.0.1]) - by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id EAA09961 - for <wlestes@localhost>; Wed, 14 Mar 2001 04:01:40 -0500 -Received: from imap.uncg.edu - by localhost with IMAP (fetchmail-5.1.0) - for wlestes@localhost (single-drop); Wed, 14 Mar 2001 04:01:40 -0500 (EST) -Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70]) - by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f2E8ppe19633 - for <wlestes@hermes.email.uncg.edu>; Wed, 14 Mar 2001 03:51:51 -0500 (EST) -Received: from daffy.ee.lbl.gov (daffy.ee.lbl.gov [131.243.1.31]) - by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id DAA20402 - for <wlestes@uncg.edu>; Wed, 14 Mar 2001 03:51:50 -0500 (EST) -Received: (from vern@localhost) - by daffy.ee.lbl.gov (8.10.0/8.10.0) id f2E8poV07877; - Wed, 14 Mar 2001 00:51:50 -0800 (PST) -Message-Id: <200103140851.f2E8poV07877@daffy.ee.lbl.gov> -To: wlestes@uncg.edu -Subject: messages sent to Dick King (1 of 2) -Date: Wed, 14 Mar 2001 00:51:49 PST -From: Vern Paxson <vern@ee.lbl.gov> - -*** EOOH *** -To: wlestes@uncg.edu -Subject: messages sent to Dick King (1 of 2) -Date: Wed, 14 Mar 2001 00:51:49 PST -From: Vern Paxson <vern@ee.lbl.gov> - - -------- Forwarded Messages - -Date: Mon, 21 Aug 2000 23:03:54 PDT -From: Vern Paxson <vern> -Subject: Re: Some new Flex maintainer volunteers -To: Dick King <king@reasoning.com> -Cc: bkuhn@ebb.org -In-reply-to: Your message of Tue, 15 Aug 2000 14:03:58 PDT. - -> Vern, i'm ready when you are. - -Okay, I've put the master sources in - - ftp://ftp.ee.lbl.gov/.vp-flex-sources.tar.gz - -The TODO/ subdirectory has a the general wish list plus a number of -contributed patches (per the mail I'll be cc'ing you on regarding reentrant -scanners). The faqs/ subdirectory has a bunch of email messages (in MH -folder format, i.e., one message per file, files numbered sequentially) for -commonly asked questions - worth taking a look through to see what sorts of -things people frequently ask about. - -I very much appreciate your taking over maintaining/developing flex, and -apologize for how long it's taken me to bundle stuff up to give to you (all -too symptomatic of why I'm no longer able to work on flex :-( ). By all -means, let me know when you have questions ... - - Vern - -------- Message 2 - -Date: Mon, 21 Aug 2000 23:38:00 PDT -From: Vern Paxson <vern> -Subject: Re: I volunteer to modify flex to generate reentrant C code. -To: "John W. Millaway" <jmillawa@nimbus.ocis.temple.edu> -Cc: help-flex@gnu.org, king@reasoning.com -In-reply-to: Your message of Mon, 21 Aug 2000 16:23:18 PDT. - -> I'm requesting this feature and at the same time volunteering to implement -> it: - -John Bossom contributed patches a while ago for adding reentrant scanners. -I never managed to try them out or integrate them (note that I'm no longer -the flex maintainer/developer, having just transferred the honors to Dick -King, whom I've cc'd), but I've made them available from: - - ftp://ftp.ee.lbl.gov/.vp-flex-reentrant.tar.gz - -I imagine Dick will be interested in hearing of problems/improvements/etc. - - Vern - -------- Message 3 - -Date: Wed, 30 Aug 2000 07:23:07 PDT -From: Vern Paxson <vern> -Subject: Re: bug in flex 2.5.4? -To: Keith McGuigan <keith.mcguigan@ecora.com> -Cc: king@reasoning.com -In-reply-to: Your message of Tue, 29 Aug 2000 12:21:02 EDT. - -This does indeed sound like a bug. Dick King (cc'd) recently took over -development & maintenance for flex; I've sent him a copy of your message. - - Vern - -------- Message 4 - -Date: Thu, 31 Aug 2000 15:41:00 PDT -From: Vern Paxson <vern> -Subject: Re: Flex -To: "Skifstrom, Eric" <SKIFSTRE@Mattel.com> -Cc: king@reasoning.com -In-reply-to: Your message of Wed, 30 Aug 2000 09:35:58 PDT. - -> Thanks for all the work on Flex. It is appreciated. How do I get a copy of -> flex for Windows 98 platform. - -I've only directly support flex for Unix, and have always distributed it -in source-code form only. So I don't know where you get a copy, though -I bet with some web surfing you can find one. - -Also, please note, Dick King (cc'd) has taken over flex development -and maintenance. - - Vern - -------- Message 5 - -Date: Thu, 31 Aug 2000 15:43:40 -0700 (PDT) -From: Dick King <king@reasoning.com> -Subject: Re: Flex -To: vern@ee.lbl.gov -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit -In-Reply-To: <200008312241.e7VMf0G14335@daffy.ee.lbl.gov> -References: <200008312241.e7VMf0G14335@daffy.ee.lbl.gov> -X-Mailer: VM 6.61 under 19.14 XEmacs Lucid - -Vern Paxson writes: - >> Thanks for all the work on Flex. It is appreciated. How do I get a copy of - >> flex for Windows 98 platform. - > - >I've only directly support flex for Unix, and have always distributed it - >in source-code form only. So I don't know where you get a copy, though - >I bet with some web surfing you can find one. - > - >Also, please note, Dick King (cc'd) has taken over flex development - >and maintenance. - > - > Vern - > - -I have a couple of how-to-be-a-gnu-product-maintainer questions. - -First, how do i get to the wish list? I assume people mail the stuff and it -accumulates somewhere. - -Second, if i decide i have a fix for a group of problems what do i do to get it -distributed? - -- -dk - -------- Message 6 - -Date: Sun, 03 Sep 2000 12:22:48 PDT -From: Vern Paxson <vern> -Subject: Re: Flex -To: Dick King <king@reasoning.com> -In-reply-to: Your message of Thu, 31 Aug 2000 15:43:40 PDT. - -> First, how do i get to the wish list? I assume people mail the stuff and it -> accumulates somewhere. - -There's a honed-down copy in the distribution I put together. I also have -several hundred email messages, which will be rather tedious to wade through, -but I can put together for you if you wish (this is non-trivial, though, -since there's some personal mail intermixed in it which I'll have to locate -and remove). - -> Second, if i decide i have a fix for a group of problems what do i do to get it -> distributed? - -Put together a new release distribution (either a minor version change or -a major one, depennding on the scope of the changes). Make sure it works -with "make bigcheck", and make sure you can copy the distribution to a -virgin machine, unpack it & successfully build it (including "make bigcheck"). - -Next, make it available somewhere for anonymous ftp and/or Web access. -(If this is a problem, I can still host the distribution at ftp.ee.lbl.gov.) - -Finally, send mail like the appended example. For your first message, -you should explain that you've taken over development of flex from me. -It would probably be good to cc me, in case a thread develops from the -note that it would be helpful to have me contribute to. No need to cc -me on later notes (though I don't mind, either). - -I used to send the note to compilers@iecc.com (the USENET comp.compilers -group) and info-gnu@prep.ai.mit.edu. I don't know if the former is still -the correct address - you could find out from the USENET group's archives, -presumably. The latter has likely changed to info-gnu@gnu.org. - - Vern - - -Date: Tue, 28 Mar 95 11:58:04 PST -From: Vern Paxson <vern> -Subject: flex release 2.5.1 now available -To: compilers@iecc.com, info-gnu@prep.ai.mit.edu - -Release 2.5.1 of flex, a POSIX-compliant "lex" scanner generator, is now -available for anonymous ftp to ftp.ee.lbl.gov. Retrieve flex-2.5.1.tar.Z -or flex-2.5.1.tar.gz. flex-2.5.1.tar.gz should be showing up shortly at -the usual GNU mirror sites. - -The main changes between 2.5 and 2.4 are: - - - A new concept of "start condition" scope lets you group together - rules sharing the same start conditions into a syntactic unit. - - Flex now includes a general mechanism for specifying scanner options. - - Routines have been added for scanning strings instead of files. - - Routines have been added for manipulating stacks of start conditions. - - Fledgling support for POSIX character class expressions. - - Enhanced portability to MS-DOS, VMS, NT, Macintosh, Amiga. - - A number of bugs have been fixed. - - input() no longer trashes yytext. - - Interactive scanners now run significantly faster. - - C++ scanner objects now work with the -P option. - - The promised rewrite of the C++ FlexLexer class has not been done, - but is still planned. - -See the "NEWS" file for more details. - -Please report bugs to: vern@ee.lbl.gov or bug-gnu-utils@prep.ai.mit.edu - - Vern - -Vern Paxson -Lawrence Berkeley Laboratory -vern@ee.lbl.gov - -------- Message 7 - -Date: Wed, 13 Sep 2000 00:59:33 PDT -From: Vern Paxson <vern> -Subject: Re: Does the FSF maintain Flex? -To: "Leanard Lin" <leanard@syntest.com.tw> -Cc: king@reasoning.com -In-reply-to: Your message of Wed, 13 Sep 2000 00:55:38 PDT. - -> Dear Vern, -> -> I have a problem about flex of linux version. -> If comment is very long, flex will not re-malloc -> for it. -> It will display a error message and exit program. -> -> Thanks, -> -> Leanard - -Well, clearly if a comment is larger than the available memory, then flex -can't realloc to accommodate it. But presumably that's not what's going on -or you wouldn't have bothered writing; so I don't know what the problem -might be. - -Flex is now developed & maintained by Dick King, king@reasoning.com, whom -I've cc'd. - - Vern - -------- Message 8 - -Date: Wed, 04 Oct 2000 23:36:59 PDT -From: Vern Paxson <vern> -Subject: Re: Flex 2.5.4.1 Bugs -To: Hans Aberg <haberg@matematik.su.se> -Cc: king@reasoning.com -In-reply-to: Your message of Sun, 01 Oct 2000 20:32:48 PDT. - -> I made a Metrowerks MacOS CW Pro 5 plugin out of the Flex 2.5.4.1. Here are -> some bugs: -> -> -- flexerror() calls flexend() which becomes an infinite loop in the case -> of an error in flexend(). So, flexerror(), replace flexend() by exit(). -> -> -- If there is no output file error, flexend() fails to close the output -> file. This causes a problem as a plugin, because the file remains locked -> the next time the compiler runs, and the file cannot be reopened. -> -> This bug also occurs if, one first has created the .c file, then runs it -> with a -S option for a skeleton filet Flex cannot find, in which case -> flexend() fails to close the output file. - -Please note, Dick King (king@reasoning.com) has taken over flex maintenance -and development. I've cc'd him. - - Vern - -------- Message 9 - -Date: Wed, 04 Oct 2000 23:38:07 PDT -From: Vern Paxson <vern> -Subject: Re: flex -+ option and ISO C++ IOStreams -To: Harri Pasanen <harri.pasanen@trema.com> -Cc: king@reasoning.com -In-reply-to: Your message of Mon, 02 Oct 2000 10:15:59 PDT. - -> You probably already know this: -> -> flex version 2.5.4 generates with -+ flag a forward declaration of class -> istream. -> Problem is that it is incompatible with the new ANSI IOStreams. This -> becomes apparent if I try to use KAI C++ (http://www.kai.com/) to -> compile the generated scanner. -> -> Lexing Scanner.l... -> Compiling Scanner.o... -> "/usr/local/KAI/KCC.pu-4.0b-1/KCC_BASE/include/istream.h", line 12: -> error #101: -> "istream" has already been declared in the current scope -> using std::istream; -> -> I wonder if an updated version of flex is in the works? In the time -> being I can compile my own... - -Dick King (king@reasoning.com) has recently taken over flex maintenance and -development (I've cc'd him). Since there will be a fair amount of getting -up to speed for him, I think building your own version for now is the -best course. - - Vern - -------- Message 10 - -Date: Thu, 05 Oct 2000 00:27:15 PDT -From: Vern Paxson <vern> -Subject: Re: Flex Feature Idea -To: Davy Durham <david.durham@wcom.com> -Cc: king@reasoning.com -In-reply-to: Your message of Thu, 28 Sep 2000 11:28:52 EDT. - -> First I just want to say how much flex has been helpful to me in -> writing my parser, and that I really appreciate the free use of the -> program... - -You're welcome! - -Please note, though, that Dick King (cc'd) has taken over flex maintenance -and development. - -> I can't re-write YY_INPUT which could detect and remove the '\' and -> \n and go ahead and return the _next_ char, because I'm keeping up -> with the line-number and column-number in YY_USER_ACTION for each -> token... Since flex buffer's the data retrieved from YY_INPUT, _my_ -> YY_INPUT would need to increment the line-number, but it would happen -> possibly too soon... Plus I'm using yy_switch_buffer to do macro -> replacements quite a bit which I think would complicate things even -> more.... - -Well, that's how you have to do it, I'm afraid. I can't see any practical -way to add this as a feature to flex at a later stage in the input analysis, -since the semantics really are "pretend this slash and this newline don't -exist (mod line numbers)". What you can probably do for line numbers is -the following: create a data structure that maps byte offsets in the current -input stream to line numbers. YY_INPUT would fill this in as it returns -new (possibly munged) lines, and your actions would consult it in order to -generate correct location information for error messages. (To deal with -multiple input buffers, you maintain one data structure per buffer.) - - Vern - -------- Message 11 - -Date: Thu, 05 Oct 2000 01:03:01 PDT -From: Vern Paxson <vern> -Subject: Re: [minor] obscure error messages if YY_DECL ends in semicolon -To: "Eric R. Buddington" <ebuddington@mail.wesleyan.edu> -Cc: king@reasoning.com -In-reply-to: Your message of Thu, 14 Sep 2000 13:39:52 EDT. - -> Your address was listed in the flex info pages, so I send this to you; if -> you aren't the currnet maintainer, please let me know. - -I'm not longer the maintainer - Dick King (cc'd) has taken over. - -> First, I would like to add an '%option reentrant", such that the flex code -> would have the lexer function as its only global symbol. Would you -> consider such a patch for inclusion in the official flex? - -Someone has already contributed patches for this - you can get them -from ftp://ftp.ee.lbl.gov/.vp-flex-reentrant.tar.gz . - -> Secondly, an erroneous input that might give better error messages: -> -> If YY_DECL ends with a semicolon, the generated error messages refer to -> wrong (nonexistant in this case) line numbers in the source file. The -> user error is only clear after turning off #line directives and looking at -> the generated .c file. -> -> It would be good to have this error (a fairly easy one to make) reported -> clearly, if that can be done elegantly. This I what I get now: -> -> flex -t -Pcap_string_ cap_string.flex > cap_string.c -> cc -Wall -c -o cap_string.o cap_string.c -> cap_string.flex:163: parse error before `{' -> cap_string.flex:165: register name not specified for `yy_cp' -> cap_string.flex:165: register name not specified for `yy_bp' -> cap_string.flex:166: register name not specified for `yy_act' -> cap_string.flex:39: parse error before `if' -> ... - -I don't offhand see an easy way to fix this, other than scanning the source -for a YY_DECL definition and looking for a semi-colon (urgh, what a hack). -Dick will have to toss it onto the to-do list. - - Vern - -------- Message 12 - -Date: Thu, 5 Oct 2000 10:51:53 +0200 -From: Hans Aberg <haberg@matematik.su.se> -Subject: Re: Flex 2.5.4.1 Bugs -To: Vern Paxson <vern@ee.lbl.gov> -Cc: king@reasoning.com -X-Sender: haberg@pop.matematik.su.se (Unverified) -In-Reply-To: <200010050636.e956axT12828@daffy.ee.lbl.gov> -References: Your message of Sun, 01 Oct 2000 20:32:48 PDT. -Mime-Version: 1.0 -Content-Type: text/plain; charset="us-ascii" -Status: U - -At 23.36 -0700 0-10-04, Vern Paxson wrote: ->Please note, Dick King (king@reasoning.com) has taken over flex maintenance ->and development. I've cc'd him. - -OK. - -To: Dick King -Bison seems to under revision right now (I'm working hard with the Bison -development team just these days on pinpointing some bugs). -- Perhaps Flex -& Bison development should somehow be synchronized. - -I have labelled Flex as BSD. Is that correct? - - Hans Aberg - - - -------- Message 13 - -Date: Fri, 06 Oct 2000 02:04:11 PDT -From: Vern Paxson <vern> -Subject: Re: C++, flex under cygwin and Visual C++ -To: "Simon J. Julier" <sjulier@erols.com> -Cc: king@reasoning.com -In-reply-to: Your message of Thu, 05 Oct 2000 07:15:17 PDT. - -> Many apologies if either (a) it's a stupid question or (b) if I'm emailing -> the wrong person. - -It's (b) :-). Dick King (king@reasoning.com) has taken over flex -maintenance and development. I've cc'd him. - -> I have been using flex (v. impressive) to write a parser -> for a C++ program. The program is being compiled using a Windows -> 2000/Windows NT machine using the cygwin tool set and the Microsoft Visual -> C++ compiler. Because the cygwin distribution does not include FlexLexer.h, -> I took the advice from the man page and simply renamed lex.yy.c as -> lex.yy.cxx and compiled this as a C++ program. This almost works except for -> the fact that, in C++ compile mode, there is a dependency on unistd.h due -> to the following code snippet: -> -> #ifdef __cplusplus -> -> #include <stdlib.h> -> #include <unistd.h> -> -> ... (other stuff) ... -> -> Since the Visual C++ compiler does not come with the header file unistd.h, -> I manually modified the code to: -> -> #ifdef __cplusplus -> -> #include <stdlib.h> -> #ifndef _WIN32 -> #include <unistd.h> -> #endif /* ! _WIN32 */ -> -> Is this the "right way" to solve the problem? - -I imagine it is. This problem has come up a bunch of times, and, -much as I hate adding #ifdef's to the skeleton, I haven't thought of -any other way to do it. - -> If so, would it be possible -> to consider making the appropriate changes to flex.skl? - -Sounds okay to me, but this is now Dick's call. - - Vern - -------- Message 14 - -Date: Fri, 6 Oct 2000 09:31:08 -0700 (PDT) -From: Dick King <king@reasoning.com> -Subject: Re: C++, flex under cygwin and Visual C++ -To: vern@ee.lbl.gov -Cc: sjulier@erols.com -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit -In-Reply-To: <200010060904.e9694BU17584@daffy.ee.lbl.gov> -References: <200010060904.e9694BU17584@daffy.ee.lbl.gov> -X-Mailer: VM 6.61 under 19.14 XEmacs Lucid - - - -I'm getting my flex support operations organized, finally. - -I've established a new eddress, flex@2xtreme.net . - -I'll start looking at the small bug fixes flex has been asked for in a week or -so. Then i will get to meaty changes. - -One meaty change i've been asked for which i would like to do [i did it for my -current company's lexer product so i think i understand the issues] is a -character level prefilter infrastructure, that would allow you to integrate a -cpp-style preprocessor [rather than making it a separate pass as is the norm] -or to write a flex lexer for a language like FORTRAN or COBOL or that language -i've heard about whose name escapes me where indentation is syntactically -significant. - -Vern Paxson writes: - >> Many apologies if either (a) it's a stupid question or (b) if I'm emailing - >> the wrong person. - > - >It's (b) :-). Dick King (king@reasoning.com) has taken over flex - >maintenance and development. I've cc'd him. - > - >> I have been using flex (v. impressive) to write a parser - >> for a C++ program. The program is being compiled using a Windows - >> 2000/Windows NT machine using the cygwin tool set and the Microsoft Visual - >> C++ compiler. Because the cygwin distribution does not include FlexLexer.h, - >> I took the advice from the man page and simply renamed lex.yy.c as - >> lex.yy.cxx and compiled this as a C++ program. This almost works except for - >> the fact that, in C++ compile mode, there is a dependency on unistd.h due - >> to the following code snippet: - >> - >> #ifdef __cplusplus - >> - >> #include <stdlib.h> - >> #include <unistd.h> - >> - >> ... (other stuff) ... - >> - >> Since the Visual C++ compiler does not come with the header file unistd.h, - >> I manually modified the code to: - >> - >> #ifdef __cplusplus - >> - >> #include <stdlib.h> - >> #ifndef _WIN32 - >> #include <unistd.h> - >> #endif /* ! _WIN32 */ - >> - >> Is this the "right way" to solve the problem? - > - >I imagine it is. This problem has come up a bunch of times, and, - >much as I hate adding #ifdef's to the skeleton, I haven't thought of - >any other way to do it. - > - >> If so, would it be possible - >> to consider making the appropriate changes to flex.skl? - > - >Sounds okay to me, but this is now Dick's call. - > - > Vern - > - -------- Message 15 - -Date: Sun, 08 Oct 2000 01:19:08 PDT -From: Vern Paxson <vern> -Subject: Re: C++, flex under cygwin and Visual C++ -To: Dick King <king@reasoning.com> -In-reply-to: Your message of Fri, 06 Oct 2000 09:31:08 PDT. - -> One meaty change i've been asked for which i would like to do [i did it for my -> current company's lexer product so i think i understand the issues] is a -> character level prefilter infrastructure, that would allow you to integrate a -> cpp-style preprocessor [rather than making it a separate pass as is the norm] -> or to write a flex lexer for a language like FORTRAN or COBOL or that language -> i've heard about whose name escapes me where indentation is syntactically -> significant. - -That would be really nice to have! - - Vern - -------- Message 16 - -Date: Mon, 9 Oct 2000 12:27:13 -0400 (EDT) -From: Andrew Droffner <adroffne@versus.dmz.advance.net> -Subject: Re: Flex & Multiple Threads -To: Vern Paxson <vern@ee.lbl.gov> -Cc: help-flex@gnu.org, king@reasoning.com -In-Reply-To: <200010050752.e957qGq13639@daffy.ee.lbl.gov> -MIME-Version: 1.0 -Content-Type: TEXT/PLAIN; charset=US-ASCII - -I'm unable to compile the scan.l LEX specification using the bootstrap -scanner, initscan.c. I have tried it on the latest flex source from GNU, -and the tarball from your page at ee.lbl.gov. - -If I drop the "%option reentrant" from scan.l, then it all compiles. I -doubt it works right then. What else do I need here, a new initscan.c? - -Thanks for the help. - -On Thu, 5 Oct 2000, Vern Paxson wrote: - -> > I'm interested in building a multi-threaded server using YACC & Lex. -> > The server & client parse the data they pass to each other. -> > -> > The Bison dialect of YACC uses a "%pure_parser" option to force re-entrant -> > code. I would like a Flex equivalent; is there one already? -> -> There are patches to flex to support reentrant scanners, which I've -> put in ftp://ftp.ee.lbl.gov/.vp-flex-reentrant.tar.gz . -> -> Also, please note, flex maintenance has been taken over by Dick King -> <king@reasoning.com>. -> -> Vern -> - -- -- -[ Andrew Droffner -[ Advance Publications Internet -[ -[ adroffne@advance.net - - -------- Message 17 - -Date: Tue, 10 Oct 2000 22:40:12 PDT -From: Vern Paxson <vern> -Subject: Re: Flex & Multiple Threads -To: Andrew Droffner <adroffne@versus.dmz.advance.net> -Cc: help-flex@gnu.org, king@reasoning.com -In-reply-to: Your message of Mon, 09 Oct 2000 12:27:13 PDT. - -> I'm unable to compile the scan.l LEX specification using the bootstrap -> scanner, initscan.c. I have tried it on the latest flex source from GNU, -> and the tarball from your page at ee.lbl.gov. -> -> If I drop the "%option reentrant" from scan.l, then it all compiles. I -> doubt it works right then. What else do I need here, a new initscan.c? - -I don't have any firsthand experience with those patches, unfortunately, -so all I can offer is to try building without the %option reentrant; -then run flex on scan.l to build a new scan.c; recompile using that; -run "make check" to make sure it's working okay; then try putting the -%option reentrant back in. Because I believe the modified scan.l doesn't -actually need %option reentrant, it's just there to exercise the scanning -during "make check". - - Vern - -------- Message 18 - -Date: Wed, 11 Oct 2000 11:42:35 PDT -From: Vern Paxson <vern> -Subject: Re: Flex & Multiple Threads -To: Dick King <king@reasoning.com> -In-reply-to: Your message of Wed, 11 Oct 2000 11:29:49 PDT. - -> How do i read help-flex@gnu.org? - -Try sending mail to help-flex-request@gnu.org with a message body of -"subscribe". Let me know if that doesn't work. - - Ven - -------- End of Forwarded Messages - - -1,, -X-Coding-System: nil -Mail-from: From vern@daffy.ee.lbl.gov Wed Mar 14 04:01:40 2001 -Return-Path: <vern@daffy.ee.lbl.gov> -Received: from localhost (localhost [127.0.0.1]) - by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id EAA09964 - for <wlestes@localhost>; Wed, 14 Mar 2001 04:01:40 -0500 -Received: from imap.uncg.edu - by localhost with IMAP (fetchmail-5.1.0) - for wlestes@localhost (single-drop); Wed, 14 Mar 2001 04:01:40 -0500 (EST) -Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70]) - by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f2E8pse19643 - for <wlestes@hermes.email.uncg.edu>; Wed, 14 Mar 2001 03:51:54 -0500 (EST) -Received: from daffy.ee.lbl.gov (daffy.ee.lbl.gov [131.243.1.31]) - by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id DAA20408 - for <wlestes@uncg.edu>; Wed, 14 Mar 2001 03:51:53 -0500 (EST) -Received: (from vern@localhost) - by daffy.ee.lbl.gov (8.10.0/8.10.0) id f2E8pqR07884; - Wed, 14 Mar 2001 00:51:52 -0800 (PST) -Message-Id: <200103140851.f2E8pqR07884@daffy.ee.lbl.gov> -To: wlestes@uncg.edu -Subject: messages sent to Dick King (2 of 2) -Date: Wed, 14 Mar 2001 00:51:52 PST -From: Vern Paxson <vern@ee.lbl.gov> - -*** EOOH *** -To: wlestes@uncg.edu -Subject: messages sent to Dick King (2 of 2) -Date: Wed, 14 Mar 2001 00:51:52 PST -From: Vern Paxson <vern@ee.lbl.gov> - - -------- Forwarded Messages - -Date: Sat, 07 Oct 2000 10:31:22 -0700 -From: "Dick King, flex maintainer" <flex@2xtreme.net> -Subject: Re: the source tree -To: vern@ee.lbl.gov -Cc: flex@2xtreme.net -In-reply-to: <14814.15467.441052.399457@fiddle.mtview.reasoning.com> -Reply-to: flex@2xtreme.net -MIME-version: 1.0 -X-Mailer: Forte Agent 1.8/32.548 -Content-type: text/plain; charset=us-ascii -Content-transfer-encoding: 7bit -References: <14814.15467.441052.399457@fiddle.mtview.reasoning.com> - -On Fri, 6 Oct 2000 13:56:11 -0700 (PDT), you wrote: - -> > I think i'm prepared to give this a try. -> -> Cool!, thanks. Here's a snapshot of the current source tree. I'm about -> to leave for two week's vacation, not reading email, but upon my return -> I'll put together the stuff-to-do email archive, etc. -> -> Vern -> - -What is the current release? - -You sent me 2.5.4a to my office computer on June 20, but i found 2.5.5a on -June 20 and downloaded it to my home computer. - -- -dk - -PS: when anyone writes to you, tell them about my new eddress -[flex@2xtreme.net]? Thanks. - -- -dk - - -------- Message 2 - -Date: Sun, 08 Oct 2000 01:26:26 PDT -From: Vern Paxson <vern> -Subject: Re: a sort of flex-related question :-) -To: Alan Donovan <alan.donovan@arm.com> -Cc: flex@2xtreme.net -In-reply-to: Your message of Thu, 05 Oct 2000 18:49:51 PDT. - -> Vern, sorry to write out of the blue like this but I figure that as the -> maintainer of flex, you could probably answer my question in a second. - -I'm actually no longer the maintainer. Dick King has taken over. He's set -up the address flex@2xtreme.net for flex correspondence. I've cc'd him. - -> I'm writing a tool somewhere between flex and yacc, in which you specify -> a set of rules and actions (as in yacc) but the language is that of -> regular expressions not context-free grammars. -> -> Each rule may include literals, operators, and simpler (i.e. previously -> declared) rules as components, and have an action. e.g. -> -> foo :[0-9]+ { func1(); } -> -> bar :"x"foo { func2(); } -> |"y"foo { func3(); } -> -> So the NDFA for "bar" actually contains two copies of the NDFA for -> "foo". My problem arises when trying to determine where in the DFA -> (generated by subset construction) to invoke the actions associated with -> each rule. All my DFA states are annotated as to which rules (if any) -> they start and which rules (if any) they accept. However this is not -> enough to correctly invoke the actions. -> -> Consider: -> -> foo: ab -> bar: a -> -> in the context of some larger expression zip:(foo|bar)"c". -> -> The DFA for "zip" looks like: -> -> a b c -> P ---> Q ---> R ---> T -> | -> +----> S -> c -> -> P starts rules "foo", "bar" and "zip". Q accepts "bar" and R accepts -> rule "foo". S and T accept zip. -> -> On input "abc", how do you know _not_ to invoke the action for rule -> "bar" when you reach state Q (or more correctly, when you receive the -> "b" and move to state R)? -> -> So the question is: do you think what I am trying to do is possible? - -What you are doing looks like a parse, and you can only parse LR(0) -languages with DFAs (if I recall correctly), i.e., those without -lookahead. The above example requires lookahead to differentiate -matching foo from bar. So I think you're out of luck here, if -I understand the example correctly. - - Vern - -------- Message 3 - -Date: Sun, 08 Oct 2000 07:47:01 -0700 -From: "Dick King, flex maintainer" <flex@2xtreme.net> -Subject: Re: a sort of flex-related question :-) -To: Vern Paxson <vern@ee.lbl.gov> -Cc: Alan Donovan <alan.donovan@arm.com> -In-reply-to: <200010080826.e988QQC23650@daffy.ee.lbl.gov> -Reply-to: flex@2xtreme.net -MIME-version: 1.0 -X-Mailer: Forte Agent 1.8/32.548 -Content-type: text/plain; charset=us-ascii -Content-transfer-encoding: 7bit -References: <200010080826.e988QQC23650@daffy.ee.lbl.gov> -Status: U - -On Sun, 08 Oct 2000 01:26:26 PDT, you wrote: - -> > Vern, sorry to write out of the blue like this but I figure that as the -> > maintainer of flex, you could probably answer my question in a second. -> -> I'm actually no longer the maintainer. Dick King has taken over. He's set -> up the address flex@2xtreme.net for flex correspondence. I've cc'd him. -> -> > I'm writing a tool somewhere between flex and yacc, in which you specify -> > a set of rules and actions (as in yacc) but the language is that of -> > regular expressions not context-free grammars. -> > -> > Each rule may include literals, operators, and simpler (i.e. previously -> > declared) rules as components, and have an action. e.g. -> > -> > foo :[0-9]+ { func1(); } -> > -> > bar :"x"foo { func2(); } -> > |"y"foo { func3(); } -> > -> > So the NDFA for "bar" actually contains two copies of the NDFA for -> > "foo". My problem arises when trying to determine where in the DFA -> > (generated by subset construction) to invoke the actions associated with -> > each rule. All my DFA states are annotated as to which rules (if any) -> > they start and which rules (if any) they accept. However this is not -> > enough to correctly invoke the actions. -> > -> > Consider: -> > -> > foo: ab -> > bar: a -> > -> > in the context of some larger expression zip:(foo|bar)"c". -> > -> > The DFA for "zip" looks like: -> > -> > a b c -> > P ---> Q ---> R ---> T -> > | -> > +----> S -> > c -> > -> > P starts rules "foo", "bar" and "zip". Q accepts "bar" and R accepts -> > rule "foo". S and T accept zip. -> > -> > On input "abc", how do you know _not_ to invoke the action for rule -> > "bar" when you reach state Q (or more correctly, when you receive the -> > "b" and move to state R)? -> > -> > So the question is: do you think what I am trying to do is possible? -> -> What you are doing looks like a parse, and you can only parse LR(0) -> languages with DFAs (if I recall correctly), i.e., those without -> lookahead. The above example requires lookahead to differentiate -> matching foo from bar. So I think you're out of luck here, if -> I understand the example correctly. -> -> Vern - -Vern is mostly correct. Small extensions can give you a single token -[character, here] lookahead but that is not enough to deliver the -functionality you want. Consider - -foo: a { foo_fn(); } -bar: ab { bar_fn(); } - -mumble: foo bcde.....yZ { any } - | bar cde.....yW { any } - -- -dk - - -------- Message 4 - -Date: Tue, 10 Oct 2000 02:36:57 PDT -From: Vern Paxson <vern> -Subject: Re: Bison's semantic parsers -To: Akim Demaille <akim@epita.fr> -Cc: Hans Aberg <haberg@matematik.su.se>, - Davy Durham <david.durham@wcom.com>, Bison Help <help-bison@gnu.org>, - flex@2xtreme.net -In-reply-to: Your message of 10 Oct 2000 11:43:07 PDT. - -> Nope, indeed Vern seems also to say he won't work on Flex again. - -Unfortunately, yes. - -> Vern, could we imagine that Flex be put on the CVS server of the FSF, -> subversions.gnu.org? - -Thank you very much for the offer, I certainly appreciate it. However, -Dick King has already volunteered to take over maitenance and development. -I've cc'd the address he's using for flex-related mail, flex@2xtreme.net. - - Vern - -------- Message 5 - -Date: Tue, 10 Oct 2000 13:30:02 +0200 -From: Hans Aberg <haberg@matematik.su.se> -Subject: Re: Bison's semantic parsers -To: Vern Paxson <vern@ee.lbl.gov> -Cc: Akim Demaille <akim@epita.fr>, Davy Durham <david.durham@wcom.com>, - Bison Help <help-bison@gnu.org>, flex@2xtreme.net -X-Sender: haberg@pop.matematik.su.se -In-Reply-To: <200010100936.e9A9avg01250@daffy.ee.lbl.gov> -References: Your message of 10 Oct 2000 11:43:07 PDT. -Mime-Version: 1.0 -Content-Type: text/plain; charset="us-ascii" -Status: U - -At 02.36 -0700 0-10-10, Vern Paxson wrote: ->> Vern, could we imagine that Flex be put on the CVS server of the FSF, ->> subversions.gnu.org? -> ->Thank you very much for the offer, I certainly appreciate it. However, ->Dick King has already volunteered to take over maitenance and development. ->I've cc'd the address he's using for flex-related mail, flex@2xtreme.net. - -At 11.43 +0200 0-10-10, Akim Demaille wrote: ->Hans> Perhaps Bison and Flex should be bundled, or tuned up together. -> ->It's a good but bad idea. For instance you could also argue that ->Autoconf, Automake and Libtool be merged, but if you just observe that ->they have totally different evolutions, it becomes infeasible. While ->definitely a seducing idea, it wouldn't work IMHO. - -My experimenting with C++ though suggests that Bison and Flex needs some -synchronizing if one should take full advantage of that language: - -- -- One thing that come to my mind is that instead of letting the Bison -output .cc file include the Flex .cc file, they communicate the information -via header files. - -- -- When experimenting C++ manipulator style I mentioned before - Parser parser; - parser_value val; - ifstream ifs("...", ios_base::in | ios_base::binary); - ofstream ofs("..."); - if (ifs) try { for (;;) { - ifs >> parser >> val; - cout << val << endl; - } -I experience problems with how Flex resets its state, and how streams and -such are initialized. - -For example, if I try to gobble up UNIX, MacOS & DOS line separators in Flex by - \n|\r|\r\n { return '\n'; } -then, when Flex sees a \r it must first look ahead to verify the next -character isn't a \n. However, if a successful value "val" is produced, -then the next time one ends up at the line ifs >> parser >> val, Flex is -reset, and as a consequence, the extra character needed to the \n check is -gobbled up. - -One can get around this by not allowing this ifs >> parser >> val -construct, then the advantage of freer, and therefore easier user syntaxes -are lost. - -- -- I think that there might be some other issues, such as how to properly -localize all data that Bison and Flex uses, and how they should communicate -that. These are more questions of hand-shaking than bundling them together -as a single program. - -As for the comparisons of Bison and Flex versus other types of -compiler-compilers, I think the main disadvantage with them (the former) is -that they are extremely difficult to debug. It's rather hopeless trying to -debug the C/C++ files they produce as output. If one could hook up an -debugger though, so that one could step throw the .l/.y source files, just -as in the case of visual debugging of a C/C++ file, then this would change, -and it would not make any difference of what method is used, as long as it -is efficient and does the job. - - Hans Aberg - - - -------- Message 6 - -Date: 10 Oct 2000 13:51:33 +0200 -From: Akim Demaille <akim@epita.fr> -Subject: Re: Bison's semantic parsers -To: Vern Paxson <vern@ee.lbl.gov> -Cc: Hans Aberg <haberg@matematik.su.se>, Davy Durham <david.durham@wcom.com>, - Bison Help <help-bison@gnu.org>, flex@2xtreme.net, - Didier Verna <didier@epita.fr> -References: <200010100936.e9A9avg01250@daffy.ee.lbl.gov> -In-Reply-To: Vern Paxson's message of "Tue, 10 Oct 2000 02:36:57 PDT" -Lines: 27 -User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands) -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Status: U - ->>>>> "Vern" == Vern Paxson <vern@ee.lbl.gov> writes: - ->> Nope, indeed Vern seems also to say he won't work on Flex again. - -Vern> Unfortunately, yes. - -Just by curiosity: you're no longer interested, or you don't have time -enough? - ->> Vern, could we imagine that Flex be put on the CVS server of the ->> FSF, subversions.gnu.org? - -Vern> Thank you very much for the offer, I certainly appreciate it. - -I'm also quite pleased to see my offer pleased you so much :) - -Vern> However, Dick King has already volunteered to take over -Vern> maitenance and development. I've cc'd the address he's using -Vern> for flex-related mail, flex@2xtreme.net. - -Thanks! - -Then, I shall restate my question for flex@2xtreme: is there a CVS -server or something which would make it possible to participate the -development of Flex? - - Akim - -------- Message 7 - -Date: Tue, 10 Oct 2000 14:15:53 PDT -From: Vern Paxson <vern> -Subject: Re: Bison's semantic parsers -To: Akim Demaille <akim@epita.fr> -Cc: Hans Aberg <haberg@matematik.su.se>, - Davy Durham <david.durham@wcom.com>, Bison Help <help-bison@gnu.org>, - flex@2xtreme.net, Didier Verna <didier@epita.fr> -In-reply-to: Your message of 10 Oct 2000 13:51:33 PDT. - -> Just by curiosity: you're no longer interested, or you don't have time -> enough? - -No time ... - - Vern - -------- Message 8 - -Date: Thu, 12 Oct 2000 20:07:57 PDT -From: Vern Paxson <vern> -Subject: Re: Flex 2.5.4 Bug -To: Cliff Sarginson <csarginson@descartes.com> -Cc: flex@2xtreme.net -In-reply-to: Your message of Thu, 12 Oct 2000 13:52:06 +0200. - -> I dont know if you still receive bug reports about flex .. - -I'm not, Dick King (cc'd) has taken over maintenance & development. - -> but here is one.. ! -> -> In a scanner we have .. -> -> %start this that msg another -> -> The field "msg" gets turned into a -> -> #define msg 3 -> -> We do not define a xxx_YY_FATAL_ERROR -> -> So flex supplies one, as a macro, with a definition: -> -> xxx_yy_fatal_error (const msg []) -> -> The "C" pre-processor merrily turns this into -> -> xx_yy_fatal_error ( const 3 [] ) -> -> Are we really the first to come across this ? Flex should maybe -> be a bit more creative with it's paramater naming for macro's -> or do some other name space checking maybe ? - -Yep, this is a known problem. The difficulty is that when lex was -originally designed, it allowed you to switch start states using -"BEGIN msg" rather than "BEGIN(msg)". This means that either you -do a major analysis of the source to only patch up true BEGIN's -(rather than, say, one that occurs inside a string literal); or you -use a gross hack in defining BEGIN, like flex does: - - #define BEGIN yy_start = 1 + 2 * - -With this sort of definition, there's no way to modify the namespace -consumed by start states. If instead you could require the ()'s, then -you could use - - #define BEGIN(state) yy_start = 1 + 2 * (YY_STATE_ ## state) - -and all would be happy ... - - Vern - -------- Message 9 - -Date: Thu, 12 Oct 2000 20:08:03 PDT -From: Vern Paxson <vern> -Subject: Re: a sort of flex-related question :-) -To: Alan.Donovan@arm.com -Cc: flex@2xtreme.net -In-reply-to: Your message of Thu, 12 Oct 2000 15:36:38 BST. - -> Thank you both for your help. I can probably rearrange my grammars to be -> LR(0). Can you give me a reference for the algorithm for LR(0) parsing with -> a DFA? - -Dunno off hand, but I imagine it must be in the Dragon Book. - - Vern - -------- Message 10 - -Date: Thu, 02 Nov 2000 11:56:35 PST -From: Vern Paxson <vern> -Subject: Re: flex documentation enhancement request -To: Tracy Camp <campt@thalvors.miralink.com> -Cc: flex@2xtreme.net -In-reply-to: Your message of Thu, 02 Nov 2000 10:17:17 PST. - -Yes, a lot of people get bitten by this, unfortunately. - -Note, Dick King has taken over flex maintenance and development, and has -set up the address flex@2xtreme.net for flex correspondence. I've cc'd him. - - Vern - - -> As a new user to flex I found the following situation quite confusing and -> think a breif caviate note in the manual would have helped out (or at -> least an emphisis if there was one) :) -> -> when using external variables when patching a pattern such as: -> -> %x buffer_dev -> %{ -> extern struct mystruct astruct; /* struct containing member buffer_dev */ -> %} -> %% -> buffer_dev= BEGIN(buffer_dev); -> -> <buffer_dev>.*$ { -> strncpy(astruct.buffer_dev,yytext,255); -> } -> %% -> -> this causes all sorts of problems because 'buffer_dev' is defined by flex -> at some point and I used buffer_dev as a member of an external structure -> that I'm trying to fill in with flex. This causes all sorts of compile -> problems. Renaming my 'buffer_dev' condition to something else works -> around this, but it was not immediately obvious what the problem was from -> the compile error. For all else I found your manual to be of GREAT help - -> thanks! -> -> t. -> -> Tracy Camp -> Product Development -> Miralink Corp.PDX -> Portland OR -> 503-223-3140 -> - -------- Message 11 - -Date: Thu, 09 Nov 2000 23:03:38 PST -From: Vern Paxson <vern> -Subject: Re: Standard C++ compatibility for flex++ -To: Volker Simonis <simonis@informatik.uni-tuebingen.de> -Cc: help-flex@gnu.org, flex@2xtreme.net -In-reply-to: Your message of Wed, 08 Nov 2000 15:50:36 +0100. - -> Is there any chance for a new release of flex? Is there a maintainer right now? -> Is it possible to submit some bug-fixes or to contribute in some way? - -Dick King has taken over flex development and maintenance. You can -reach him at flex@2xtreme.net (cc'd). - - Vern - -------- Message 12 - -Date: Wed, 14 Feb 2001 12:57:37 PST -From: Vern Paxson <vern> -Subject: Re: Bug#84780: Fix for info documentation (fwd) -To: Santiago Vila <sanvila@unex.es> -Cc: Gordon Sadler <gbsadler1@lcisp.com>, flex@2xtreme.net -In-reply-to: Your message of Wed, 14 Feb 2001 15:40:30 PST. - -Please note, Dick King has taken over flex maintenance and development, -and has set up the address flex@2xtreme.net for flex correspondence. - - Vern - - -> Hello. -> -> I received this from the Debian Bug System. -> -> ---------- Forwarded message ---------- -> Date: Sun, 4 Feb 2001 02:41:30 -0600 -> From: Gordon Sadler <gbsadler1@lcisp.com> -> To: Debian Bug Tracking System <submit@bugs.debian.org> -> Subject: #84780: Fix for info documentation -> -> Package: flex -> Version: 2.5.4a-9 -> Severity: wishlist -> -> Attached find a diff to MISC/texinfo/flex.texi -> I noticed during the texi2html run it complains of first section not -> being toplevel. I opened the texi file and changed the toplevel -> sections to chapters. While I was there noticed the comment about -> fixing all of the See... to make them @xref, so I did. -> -> Looks like upstream is pretty much done ... but you seem to be in -> touch, last changelog mentions manpage patch from author? -> -> If you use this texi to regen the info the x-refs make it a little more -> useable. Maybe I'll add the index in next -) -> -> Gordon Sadler -> ------------------------------------------------------------------------ -> This is the patch in unified format: -> -> diff -r -u flex-2.5.4.orig/MISC/texinfo/flex.texi flex-2.5.4/MISC/texinfo/flex.texi -> --- flex-2.5.4.orig/MISC/texinfo/flex.texi Sun Jul 27 04:47:21 1997 -> +++ flex-2.5.4/MISC/texinfo/flex.texi Wed Feb 14 15:34:49 2001 -> @@ -151,12 +151,12 @@ -> @end ifinfo -> -> @node Name, Synopsis, Top, Top -> -@section Name -> +@chapter Name -> -> flex - fast lexical analyzer generator -> -> @node Synopsis, Overview, Name, Top -> -@section Synopsis -> +@chapter Synopsis -> -> @example -> flex [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -ooutput -Pprefix -Sskeleton] -> @@ -164,7 +164,7 @@ -> @end example -> -> @node Overview, Description, Synopsis, Top -> -@section Overview -> +@chapter Overview -> -> This manual describes @code{flex}, a tool for generating programs -> that perform pattern-matching on text. The manual -> @@ -244,7 +244,7 @@ -> @end table -> -> @node Description, Examples, Overview, Top -> -@section Description -> +@chapter Description -> -> @code{flex} is a tool for generating @dfn{scanners}: programs which -> recognized lexical patterns in text. @code{flex} reads the given -> @@ -260,7 +260,7 @@ -> corresponding C code. -> -> @node Examples, Format, Description, Top -> -@section Some simple examples -> +@chapter Some simple examples -> -> First some simple examples to get the flavor of how one -> uses @code{flex}. The following @code{flex} input specifies a scanner -> @@ -371,7 +371,7 @@ -> following sections. -> -> @node Format, Patterns, Examples, Top -> -@section Format of the input file -> +@chapter Format of the input file -> -> The @code{flex} input file consists of three sections, separated -> by a line with just @samp{%%} in it: -> @@ -439,7 +439,7 @@ -> where the pattern must be unindented and the action must -> begin on the same line. -> -> -See below for a further description of patterns and -> +@xref{Patterns}, for a further description of patterns and -> actions. -> -> Finally, the user code section is simply copied to -> @@ -468,7 +468,7 @@ -> is also copied verbatim to the output up to the next "*/". -> -> @node Patterns, Matching, Format, Top -> -@section Patterns -> +@chapter Patterns -> -> The patterns in the input are written using an extended -> set of regular expressions. These are: -> @@ -697,7 +697,7 @@ -> @end itemize -> -> @node Matching, Actions, Patterns, Top -> -@section How the input is matched -> +@chapter How the input is matched -> -> When the generated scanner is run, it analyzes its input -> looking for strings which match any of its patterns. If -> @@ -773,7 +773,7 @@ -> classes (the @code{c++} option; see below). -> -> @node Actions, Generated scanner, Matching, Top -> -@section Actions -> +@chapter Actions -> -> Each pattern in a rule has a corresponding action, which -> can be any arbitrary C statement. The pattern ends at the -> @@ -1035,7 +1035,7 @@ -> @end itemize -> -> @node Generated scanner, Start conditions, Actions, Top -> -@section The generated scanner -> +@chapter The generated scanner -> -> The output of @code{flex} is the file @file{lex.yy.c}, which contains -> the scanning routine @samp{yylex()}, a number of tables used by -> @@ -1136,15 +1136,15 @@ -> -> Three routines are available for scanning from in-memory -> buffers rather than files: @samp{yy_scan_string()}, -> -@samp{yy_scan_bytes()}, and @samp{yy_scan_buffer()}. See the discussion -> -of them below in the section Multiple Input Buffers. -> +@samp{yy_scan_bytes()}, and @samp{yy_scan_buffer()}. -> +@xref{Multiple buffers, ,Multiple Input Buffers}. -> -> The scanner writes its @samp{ECHO} output to the @code{yyout} global -> (default, stdout), which may be redefined by the user -> simply by assigning it to some other @code{FILE} pointer. -> -> @node Start conditions, Multiple buffers, Generated scanner, Top -> -@section Start conditions -> +@chapter Start conditions -> -> @code{flex} provides a mechanism for conditionally activating -> rules. Any rule whose pattern is prefixed with "<sc>" -> @@ -1500,7 +1500,7 @@ -> @samp{%option stack} directive (see Options below). -> -> @node Multiple buffers, End-of-file rules, Start conditions, Top -> -@section Multiple input buffers -> +@chapter Multiple input buffers -> -> Some scanners (such as those which support "include" -> files) require reading from several input streams. As -> @@ -1675,7 +1675,7 @@ -> @end table -> -> @node End-of-file rules, Miscellaneous, Multiple buffers, Top -> -@section End-of-file rules -> +@chapter End-of-file rules -> -> The special rule "<<EOF>>" indicates actions which are to -> be taken when an end-of-file is encountered and yywrap() -> @@ -1735,7 +1735,7 @@ -> @end example -> -> @node Miscellaneous, User variables, End-of-file rules, Top -> -@section Miscellaneous macros -> +@chapter Miscellaneous macros -> -> The macro @code{YY_USER_ACTION} can be defined to provide an -> action which is always executed prior to the matched -> @@ -1800,7 +1800,7 @@ -> the @code{YY_BREAK} is inaccessible. -> -> @node User variables, YACC interface, Miscellaneous, Top -> -@section Values available to the user -> +@chapter Values available to the user -> -> This section summarizes the various values available to -> the user in the rule actions. -> @@ -1865,7 +1865,7 @@ -> @end itemize -> -> @node YACC interface, Options, User variables, Top -> -@section Interfacing with @code{yacc} -> +@chapter Interfacing with @code{yacc} -> -> One of the main uses of @code{flex} is as a companion to the @code{yacc} -> parser-generator. @code{yacc} parsers expect to call a routine -> @@ -1890,7 +1890,7 @@ -> @end example -> -> @node Options, Performance, YACC interface, Top -> -@section Options -> +@chapter Options -> @code{flex} has the following options: -> -> @table @samp -> @@ -1903,8 +1903,8 @@ -> and @samp{-Cf} or @samp{-CF} is used, the generated scanner will -> run faster (see the @samp{-p} flag). Only users who wish -> to squeeze every last cycle out of their scanners -> -need worry about this option. (See the section on -> -Performance Considerations below.) -> +need worry about this option. (@pxref{Performance, , -> +Performance Considerations}) -> -> @item -c -> is a do-nothing, deprecated option included for -> @@ -2138,8 +2138,7 @@ -> -> @item -+ -> specifies that you want flex to generate a C++ -> -scanner class. See the section on Generating C++ -> -Scanners below for details. -> +scanner class. @xref{C++, ,Generating C++ Scanners}. -> -> @item -C[aefFmr] -> controls the degree of table compression and, more -> @@ -2419,8 +2418,7 @@ -> function @samp{foo::yylex()} instead of @samp{yyFlexLexer::yylex()}. -> It also generates a @samp{yyFlexLexer::yylex()} member function that -> emits a run-time error (by invoking @samp{yyFlexLexer::LexerError()}) -> -if called. See Generating C++ Scanners, below, for additional -> -information. -> +if called. @xref{C++, ,Generating C++ Scanners}. -> -> A number of options are available for lint purists who -> want to suppress the appearance of unneeded routines in -> @@ -2439,7 +2437,7 @@ -> unless you use @samp{%option stack}). -> -> @node Performance, C++, Options, Top -> -@section Performance considerations -> +@chapter Performance considerations -> -> The main design goal of @code{flex} is that it generate -> high-performance scanners. It has been optimized for dealing -> @@ -2756,7 +2754,7 @@ -> the two is at about 8K characters/token. -> -> @node C++, Incompatibilities, Performance, Top -> -@section Generating C++ scanners -> +@chapter Generating C++ scanners -> -> @code{flex} provides two different ways to generate scanners for -> use with C++. The first way is to simply compile a -> @@ -2975,7 +2973,7 @@ -> releases. -> -> @node Incompatibilities, Diagnostics, C++, Top -> -@section Incompatibilities with @code{lex} and POSIX -> +@chapter Incompatibilities with @code{lex} and POSIX -> -> @code{flex} is a rewrite of the AT&T Unix @code{lex} tool (the two -> implementations do not share any code, though), with some -> @@ -3051,8 +3049,8 @@ -> -> Also note that flex C++ scanner classes @emph{are} -> reentrant, so if using C++ is an option for you, you -> -should use them instead. See "Generating C++ -> -Scanners" above for details. -> +should use them instead. @xref{C++, ,Generating C++ -> +Scanners}. -> -> @item -> @samp{output()} is not supported. Output from the @samp{ECHO} -> @@ -3198,7 +3196,7 @@ -> line. -> -> @node Diagnostics, Files, Incompatibilities, Top -> -@section Diagnostics -> +@chapter Diagnostics -> -> @table @samp -> @item warning, rule cannot be matched -> @@ -3251,8 +3249,7 @@ -> scanner specification includes recognizing the 8-bit -> character @var{x} and you did not specify the -8 flag, and your -> scanner defaulted to 7-bit because you used the @samp{-Cf} or @samp{-CF} -> -table compression options. See the discussion of the @samp{-7} -> -flag for details. -> +table compression options. @xref{Options, ,@samp{-7}flag}. -> -> @item flex scanner push-back overflow -> you used @samp{unput()} to push -> @@ -3285,7 +3282,7 @@ -> @end table -> -> @node Files, Deficiencies, Diagnostics, Top -> -@section Files -> +@chapter Files -> -> @table @file -> @item -lfl -> @@ -3311,7 +3308,7 @@ -> @end table -> -> @node Deficiencies, See also, Files, Top -> -@section Deficiencies / Bugs -> +@chapter Deficiencies / Bugs -> -> Some trailing context patterns cannot be properly matched -> and generate warning messages ("dangerous trailing -> @@ -3365,7 +3362,7 @@ -> The @code{flex} internal algorithms need documentation. -> -> @node See also, Author, Deficiencies, Top -> -@section See also -> +@chapter See also -> -> @code{lex}(1), @code{yacc}(1), @code{sed}(1), @code{awk}(1). -> -> @@ -3380,7 +3377,7 @@ -> (deterministic finite automata). -> -> @node Author, , See also, Top -> -@section Author -> +@chapter Author -> -> Vern Paxson, with the help of many ideas and much inspiration from -> Van Jacobson. Original version by Jef Poskanzer. The fast table -> - -------- End of Forwarded Messages - - -1, answered,, -X-Coding-System: nil -Mail-from: From vern@daffy.ee.lbl.gov Mon Mar 26 18:48:05 2001 -Return-Path: <vern@daffy.ee.lbl.gov> -Received: from localhost (localhost [127.0.0.1]) - by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id SAA00754 - for <wlestes@localhost>; Mon, 26 Mar 2001 18:48:05 -0500 -Received: from imap.uncg.edu - by localhost with IMAP (fetchmail-5.1.0) - for wlestes@localhost (single-drop); Mon, 26 Mar 2001 18:48:05 -0500 (EST) -Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70]) - by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f2QNVUe03862 - for <wlestes@hermes.email.uncg.edu>; Mon, 26 Mar 2001 18:31:30 -0500 (EST) -Received: from daffy.ee.lbl.gov (daffy.ee.lbl.gov [131.243.1.31]) - by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id SAA18856 - for <wlestes@uncg.edu>; Mon, 26 Mar 2001 18:31:28 -0500 (EST) -Received: (from vern@localhost) - by daffy.ee.lbl.gov (8.10.0/8.10.0) id f2QNVPc23647; - Mon, 26 Mar 2001 15:31:25 -0800 (PST) -Message-Id: <200103262331.f2QNVPc23647@daffy.ee.lbl.gov> -To: wlestes@uncg.edu -Subject: Fwd: release 2.5 of flex... -Date: Mon, 26 Mar 2001 15:31:25 PST -From: Vern Paxson <vern@ee.lbl.gov> - -*** EOOH *** -To: wlestes@uncg.edu -Subject: Fwd: release 2.5 of flex... -Date: Mon, 26 Mar 2001 15:31:25 PST -From: Vern Paxson <vern@ee.lbl.gov> - -(Any luck finding some flex cycles?) - -------- Forwarded Message - -Date: Mon, 26 Mar 2001 00:06:31 +0200 -From: Kai Hennig <khennig@pobox.com> -Subject: release 2.5 of flex... -To: vern@ee.lbl.gov -X-Spam-Filter: check_local@studserv.stud.uni-hannover.de by digitalanswers.org -Reply-To: khennig@pobox.com -Organization: TRI Systems -X-Mailer: Mozilla 4.76 (Macintosh; U; PPC) -X-Accept-Language: en -MIME-Version: 1.0 -Content-Type: text/plain; charset=iso-8859-1 -Content-Transfer-Encoding: 8bit - -> Extract from file 'INSTALL' from flex-2.5.4 -> -> ... -> If you need to do unusual things to compile the package, we encourage -> you to figure out how `configure' could check whether to do them, and -> mail diffs or instructions to the address given in the README so we -> can include them in the next release. -> ... - -Hi Vern, - -I'm using your flex package 2.5.4 on a Macintosh with Apple's Macintosh -Programmers Workshop 3.5 (MPW). There is a description comming along -with your package for the THINK C version 6.0 from Scott Hofmann -(23-JUL-94) which is not helpfull for using the package with MPW. I -enclosed a brief instruction for using the flex package with MPW which -might be more helpfull since Think C is no longer officially available -(as far as I know). - -greetings, -Kai - - - - -Notes on the MPW 3.5 version of Flex 2.5.4 -Kai Hennig 25-Mar-2001 -Internet: khennig@pobox.com - -To compile and run Flex 2.5.4 as an MPW Tool no changes to any file have -to be done. Instead add a file called 'config.h' to the files listed in -the command lines given below with the content listed below the -commands. To compile and link all necessary files execute the following -commands in the MPW shell: - -MrC -noMapCR -alloca -ansi strict main.c -MrC -noMapCR -alloca -ansi strict ccl.c -MrC -noMapCR -alloca -ansi strict dfa.c -MrC -noMapCR -alloca -ansi strict ecs.c -MrC -noMapCR -alloca -ansi strict gen.c -MrC -noMapCR -alloca -ansi strict misc.c -MrC -noMapCR -alloca -ansi strict nfa.c -MrC -noMapCR -alloca -ansi strict -w off parse.c -MrC -noMapCR -alloca -ansi strict initscan.c -MrC -noMapCR -alloca -ansi strict tblcmp.c -MrC -noMapCR -alloca -ansi strict sym.c -MrC -noMapCR -alloca -ansi strict skel.c -MrC -noMapCR -alloca -ansi strict yylex.c -PPCLink -t 'MPST' -c 'MPS ' -o flex * -main.c.o * -ccl.c.o * -dfa.c.o * -ecs.c.o * -gen.c.o * -misc.c.o * -nfa.c.o * -parse.c.o * -initscan.c.o * -tblcmp.c.o * -sym.c.o * -skel.c.o * -yylex.c.o * -"{SharedLibraries}InterfaceLib" * -"{SharedLibraries}StdCLib" * -"{SharedLibraries}MathLib" * -"{PPCLibraries}StdCRuntime.o" * -"{PPCLibraries}PPCCRuntime.o" * -"{PPCLibraries}MrCIOStreams.o" * -"{PPCLibraries}PPCToolLibs.o" - - -/* File 'config.h' */ -/* Define to `unsigned' if <sys/types.h> doesn't define. */ -#undef size_t - -/* Define if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Define if you have the <string.h> header file. */ -#define HAVE_STRING_H 1 - -/* Define if you have <alloca.h> and it should be used (not on -Ultrix). */ -#define HAVE_ALLOCA_H 1 - -/* Define if you use FAT file system, leave undefined for NTFS */ -#undef SHORT_FILE_NAMES - -/* Never do interactive input */ -#define YY_NEVER_INTERACTIVE 1 -/* EOF File 'config.h' */ - -------- End of Forwarded Message - - -1,, -X-Coding-System: nil -Mail-from: From vern@daffy.ee.lbl.gov Wed Mar 28 04:07:49 2001 -Return-Path: <vern@daffy.ee.lbl.gov> -Received: from localhost (localhost [127.0.0.1]) - by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id EAA02765 - for <wlestes@localhost>; Wed, 28 Mar 2001 04:07:49 -0500 -Received: from imap.uncg.edu - by localhost with IMAP (fetchmail-5.1.0) - for wlestes@localhost (single-drop); Wed, 28 Mar 2001 04:07:49 -0500 (EST) -Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70]) - by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f2S8o2e15934 - for <wlestes@hermes.email.uncg.edu>; Wed, 28 Mar 2001 03:50:02 -0500 (EST) -Received: from daffy.ee.lbl.gov (daffy.ee.lbl.gov [131.243.1.31]) - by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id DAA23213 - for <wlestes@uncg.edu>; Wed, 28 Mar 2001 03:50:00 -0500 (EST) -Received: (from vern@localhost) - by daffy.ee.lbl.gov (8.10.0/8.10.0) id f2S8nr529885; - Wed, 28 Mar 2001 00:49:53 -0800 (PST) -Message-Id: <200103280849.f2S8nr529885@daffy.ee.lbl.gov> -To: "John W. Millaway" <johnmillaway@yahoo.com> -Cc: help-flex@gnu.org, wlestes@uncg.edu -Subject: Re: reentrant C scanner -In-reply-to: Your message of Tue, 27 Mar 2001 12:49:46 PST. -Date: Wed, 28 Mar 2001 00:49:53 PST -From: Vern Paxson <vern@ee.lbl.gov> - -*** EOOH *** -To: "John W. Millaway" <johnmillaway@yahoo.com> -Cc: help-flex@gnu.org, wlestes@uncg.edu -Subject: Re: reentrant C scanner -In-reply-to: Your message of Tue, 27 Mar 2001 12:49:46 PST. -Date: Wed, 28 Mar 2001 00:49:53 PST -From: Vern Paxson <vern@ee.lbl.gov> - -> I contacted you (or someone there at flex H.Q.) about modifying flex to generate a -> reentrant scanner. I found some time recently, and the modifications are nearly -> complete. It wasn't as bad as I had originally thought it would be. -> -> I have two questions for you: -> -> 1. What is the procedure for regression testing? -> 2. What is the procedure for merging my modifications with the current -> distribution? - -Both of these are not well defined at the moment. Will Estes (cc'd) has -volunteered to give taking over flex maintenance/development a try, and -we're right now in a preliminary period during which he's gauging whether -he'll indeed have the cycles for doing so. - - Vern - - -1,, -X-Coding-System: nil -Mail-from: From vern@daffy.ee.lbl.gov Thu Mar 29 18:05:46 2001 -Return-Path: <vern@daffy.ee.lbl.gov> -Received: from localhost (localhost [127.0.0.1]) - by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id SAA02631 - for <wlestes@localhost>; Thu, 29 Mar 2001 18:05:46 -0500 -Received: from imap.uncg.edu - by localhost with IMAP (fetchmail-5.1.0) - for wlestes@localhost (single-drop); Thu, 29 Mar 2001 18:05:46 -0500 (EST) -Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70]) - by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f2TMmHe28250 - for <wlestes@hermes.email.uncg.edu>; Thu, 29 Mar 2001 17:48:17 -0500 (EST) -Received: from daffy.ee.lbl.gov (daffy.ee.lbl.gov [131.243.1.31]) - by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id RAA02561 - for <wlestes@uncg.edu>; Thu, 29 Mar 2001 17:48:16 -0500 (EST) -Received: (from vern@localhost) - by daffy.ee.lbl.gov (8.10.0/8.10.0) id f2TMmCD10050; - Thu, 29 Mar 2001 14:48:12 -0800 (PST) -Message-Id: <200103292248.f2TMmCD10050@daffy.ee.lbl.gov> -To: John Tupper <john_tupper@tenornetworks.com> -Subject: Re: flex bug -Cc: wlestes@uncg.edu -In-reply-to: Your message of Thu, 29 Mar 2001 13:52:38 PST. -Date: Thu, 29 Mar 2001 14:48:12 PST -From: Vern Paxson <vern@ee.lbl.gov> - -*** EOOH *** -To: John Tupper <john_tupper@tenornetworks.com> -Subject: Re: flex bug -Cc: wlestes@uncg.edu -In-reply-to: Your message of Thu, 29 Mar 2001 13:52:38 PST. -Date: Thu, 29 Mar 2001 14:48:12 PST -From: Vern Paxson <vern@ee.lbl.gov> - -Argh, yes, you're right. This is (mis)feature interaction between -%option yylineno and trailing context. - -I've cc'd Will Estes, who is trying out taking over flex maintenance / -development. Will, I think the place to fix this is in finish_rule() in -nfa.c, making it generate extra code to loop through the characters being -put back and decrement yylineno accordingly. - - Vern - - -> -> --------------DC4CBAA5BA86BA0906373DD6 -> Content-Type: text/plain; charset=us-ascii -> Content-Transfer-Encoding: 7bit -> -> Vern, -> Are you the right person to send this to? It's a groaner. . . -> -> If you define a rule with a trailing context and the trailing context -> matches a newline, the newline gets counted twice (in yylineno), once in -> the trailing context and once when its matched for real. -> -> Sample grammer: -> -> \/\* { begin(Comment); } -> <Comment>\*/[^/] { ; /* this rule is problematic */ } -> <Comment>[^\*]+ { ; } -> <Comment>\*\/ { begin(0); } -> -> The above grammer strips out C style comments. If a comment contains a -> star at the end of a line, yylineno gets incremented twice. -> -> We used the obvious work around by adding a seperate rule to explicitly -> match *\n without any trailing context, so we're not waiting for a fix. -> -> Oh yeah, we're using version 2.5.4. -> -> Thanks, -> John Tupper -> (john_tupper@tenornetworks.com) -> -> -> --------------DC4CBAA5BA86BA0906373DD6 -> Content-Type: text/html; charset=us-ascii -> Content-Transfer-Encoding: 7bit -> -> <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> -> <html> -> Vern, -> <br> Are you the right person to send this to? It's a groaner. -> . . -> <p>If you define a rule with a trailing context and the trailing context -> matches a newline, the newline gets counted twice (in yylineno), once in -> the trailing context and once when its matched for real. -> <p>Sample grammer: -> <p><tt>\/\* -> { begin(Comment); }</tt> -> <br><tt><Comment>\*/[^/] { ; /* this rule is problematic -> */ }</tt> -> <br><tt><Comment>[^\*]+ { ; }</tt> -> <br><tt><Comment>\*\/ { begin(0); }</tt> -> <p>The above grammer strips out C style comments. If a comment contains -> a star at the end of a line, yylineno gets incremented twice. -> <p>We used the obvious work around by adding a seperate rule to explicitly -> match *\n without any trailing context, so we're not waiting for a fix. -> <p>Oh yeah, we're using version 2.5.4. -> <p>Thanks, -> <br>John Tupper -> <br>(john_tupper@tenornetworks.com) -> <br> </html> -> -> --------------DC4CBAA5BA86BA0906373DD6-- -> - - -1, answered,, -X-Coding-System: nil -Mail-from: From johnmillaway@yahoo.com Sun Apr 8 18:10:46 2001 -Return-Path: <johnmillaway@yahoo.com> -Received: from localhost (localhost [127.0.0.1]) - by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id SAA06099 - for <wlestes@localhost>; Sun, 8 Apr 2001 18:10:46 -0400 -Received: from imap.uncg.edu - by localhost with IMAP (fetchmail-5.1.0) - for wlestes@localhost (single-drop); Sun, 08 Apr 2001 18:10:46 -0400 (EDT) -Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70]) - by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f38Lr7e10030 - for <wlestes@hermes.email.uncg.edu>; Sun, 8 Apr 2001 17:53:07 -0400 (EDT) -Received: from web9407.mail.yahoo.com (web9407.mail.yahoo.com [216.136.129.23]) - by external-gw.uncg.edu (8.9.3/8.9.3) with SMTP id RAA28292 - for <wlestes@uncg.edu>; Sun, 8 Apr 2001 17:53:05 -0400 (EDT) -Message-ID: <20010408215303.56462.qmail@web9407.mail.yahoo.com> -Received: from [216.254.82.102] by web9407.mail.yahoo.com; Sun, 08 Apr 2001 14:53:03 PDT -Date: Sun, 8 Apr 2001 14:53:03 -0700 (PDT) -From: "John W. Millaway" <johnmillaway@yahoo.com> -Subject: Re: reentrant C scanner -To: "W. L. Estes" <wlestes@uncg.edu> -In-Reply-To: <200104082000.QAA05847@michael.uncg.edu> -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii - -*** EOOH *** -Date: Sun, 8 Apr 2001 14:53:03 -0700 (PDT) -From: "John W. Millaway" <johnmillaway@yahoo.com> -Subject: Re: reentrant C scanner -To: "W. L. Estes" <wlestes@uncg.edu> -In-Reply-To: <200104082000.QAA05847@michael.uncg.edu> - -Hi, - -(Sorry it took a while, my DSL went down again.) - -Here is a link to the diff, because my browser (Opera) doesn't do file-uploads -properly. - -http://astro.temple.edu/~john43/flex_r.diff.gz - -I did not include a diff of skel.c, because it is built from flex.skl. I did a GNU -diff, instead of CVS diff, because I had already modified flex before importing it -into CVS... which means `cvs diff' won't work without some massaging. I'm no CVS -expert, let me know if you have a solution. - -This all works, but is not finished. I want to test it with as many scanners as I -can dig up. At some point, I'll submit a test directory and a "README.reenrant" as -well as a modification of the texinfo docs. - -Briefly, the changes are these: - -1. Added option "reentrant" (-R). -2. Added preprocessor directive: YY_REENTRANT. (and a few more related to this). -3. Added internal "struct yy_globals_t"; user-visible as "void*". -4. All global variables are conditionally eliminated and placed in the struct. -5. Nearly all functions conditionally take an additional argument. -6. yylex() is now yylex_r(void*) -7. All access to globals must be wrapped in YY_G() macro. -8. User may attach arbitrary data (void*) to the scanner, to maintain state. -9. New functions for using scanner: yy_init_r, yy_free_r; -10. Accessor functions to extract values from struct or globals. -11. Frequently accessed variables (yytext, yyleng, etc..) have macro shortcuts, -(yytext_r, yyleng_r, etc.) which hide the internals from users building reentrant -scanners. - --John Millaway - - -__________________________________________________ -Do You Yahoo!? -Get email at your own domain with Yahoo! Mail. -http://personal.mail.yahoo.com/ - - -1,, -X-Coding-System: nil -Mail-from: From johnmillaway@yahoo.com Sun Apr 8 19:16:58 2001 -Return-Path: <johnmillaway@yahoo.com> -Received: from localhost (localhost [127.0.0.1]) - by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id TAA06140 - for <wlestes@localhost>; Sun, 8 Apr 2001 19:16:58 -0400 -Received: from imap.uncg.edu - by localhost with IMAP (fetchmail-5.1.0) - for wlestes@localhost (single-drop); Sun, 08 Apr 2001 19:16:58 -0400 (EDT) -Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70]) - by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f38MwXe18411 - for <wlestes@hermes.email.uncg.edu>; Sun, 8 Apr 2001 18:58:33 -0400 (EDT) -Received: from web9402.mail.yahoo.com (web9402.mail.yahoo.com [216.136.129.108]) - by external-gw.uncg.edu (8.9.3/8.9.3) with SMTP id SAA01092 - for <wlestes@uncg.edu>; Sun, 8 Apr 2001 18:58:32 -0400 (EDT) -Message-ID: <20010408225832.81903.qmail@web9402.mail.yahoo.com> -Received: from [216.254.82.102] by web9402.mail.yahoo.com; Sun, 08 Apr 2001 15:58:32 PDT -Date: Sun, 8 Apr 2001 15:58:32 -0700 (PDT) -From: "John W. Millaway" <johnmillaway@yahoo.com> -Subject: Re: reentrant C scanner -To: "W. L. Estes" <wlestes@uncg.edu> -In-Reply-To: <200104082224.SAA06112@michael.uncg.edu> -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii - -*** EOOH *** -Date: Sun, 8 Apr 2001 15:58:32 -0700 (PDT) -From: "John W. Millaway" <johnmillaway@yahoo.com> -Subject: Re: reentrant C scanner -To: "W. L. Estes" <wlestes@uncg.edu> -In-Reply-To: <200104082224.SAA06112@michael.uncg.edu> - -> have downloaded this and will set aside time to read your patch this -> week. -Please download again, I fixed another bug. - -> > I did not include a diff of skel.c, because it is built from flex.skl. I did a -> GNU> -> ok. will remember this... - -Just do `./mkskel.sh <flex.skl >skel.c` to rebuild it. - -> tag your current sources. -> import the standard sources and give them another tag/branch name. -> do a cvs diff explicitly between the two above. - -Will do. - - -> that's the gut reaction. let me know if that works or if you have -> troubles. But I need to prepare a publicly readable cvs archive anyway. - -Have you thought about sourceforge? - -> the scanner stuff is finished, yes? (sure, there will be bugs and -> things to work out, but i am asking if the reentrant stuff is in place.) -Yes, finished. But the changes were so widespread and there are so many options and -directives that I'm sure something will break very soon. That's why a -regression-test directory would be nice. - -> Go ahead and write the README. This is a good exercise--and usually -> fairly easy to knock off. It can serve as a guide later on down the -> road. -OK. - -> To clarify, reentrant should probably not be a default behavior for -> now. -It is not. In fact, yacc/bison parsers won't call yylex_r()... something I'll work -on later. - - -> If it's ok with you, I'm going to forward your post on to -> help-flex@gnu.org so the "community" can dig in too. - -Great. Please include my email address. - -Also, the community should really decide on the new API. I am wide open to -suggestions. Currently, the new API allows a lexer to be backwards compatible, so -that a working reentrant scanner should be able to be recompiled as a non-reentrant -scanner, and everything will work just dandy on the inside. However, the syntax is -not so pretty for the user. On the other hand, a reentrant scanner that is not -meant to be backwards compatible has a cleaner API (fewer oddball macros). - -An example to illustrate: - -%option reentrant -%s FOOBAR - -%% - - /* The line in each pair below do the same thing. - But second of each pair is backwards-compatible. */ - -"call-func" { yy_push_state ( FOOBAR , yy_globals ); } -"call-func" { yy_push_state ( FOOBAR YYCALL_LAST_ARG ); } - -"user-data" { printf( (char*) yyusr_r );} -"user-data" { printf( (char*) yy_get_usr(YYCALL_ONLY_ARG));} - -"yyleng" { printf( "%s %d" , yy_text_r, yyleng_r ); } -"yyleng" { printf( "%s %d" , YY_G(yy_text), YY_G(yyleng)); } - -%% -main() -{ - char* stuff = "user specific data."; - void * mylexer; - - yy_init_r ( & mylexer ); /* Create the scanner. */ - yy_set_usr( stuff, mylexer ); /* set user-defined stuff. */ - - while( 1 ) - yylex_r ( lexer ); - - yy_free_r ( lexer ); -} - --John Millaway - - -__________________________________________________ -Do You Yahoo!? -Get email at your own domain with Yahoo! Mail. -http://personal.mail.yahoo.com/ - - -1,, -X-Coding-System: nil -Mail-from: From johnmillaway@yahoo.com Sun Apr 8 20:12:39 2001 -Return-Path: <johnmillaway@yahoo.com> -Received: from localhost (localhost [127.0.0.1]) - by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id UAA06162 - for <wlestes@localhost>; Sun, 8 Apr 2001 20:12:39 -0400 -Received: from imap.uncg.edu - by localhost with IMAP (fetchmail-5.1.0) - for wlestes@localhost (single-drop); Sun, 08 Apr 2001 20:12:39 -0400 (EDT) -Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70]) - by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f38NsQe25613 - for <wlestes@hermes.email.uncg.edu>; Sun, 8 Apr 2001 19:54:26 -0400 (EDT) -Received: from web9406.mail.yahoo.com (web9406.mail.yahoo.com [216.136.129.22]) - by external-gw.uncg.edu (8.9.3/8.9.3) with SMTP id TAA03391 - for <wlestes@uncg.edu>; Sun, 8 Apr 2001 19:54:24 -0400 (EDT) -Message-ID: <20010408235423.12509.qmail@web9406.mail.yahoo.com> -Received: from [216.254.82.102] by web9406.mail.yahoo.com; Sun, 08 Apr 2001 16:54:23 PDT -Date: Sun, 8 Apr 2001 16:54:23 -0700 (PDT) -From: "John W. Millaway" <johnmillaway@yahoo.com> -Subject: Re: reentrant C scanner -To: "W. L. Estes" <wlestes@uncg.edu> -In-Reply-To: <200104082224.SAA06112@michael.uncg.edu> -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii - -*** EOOH *** -Date: Sun, 8 Apr 2001 16:54:23 -0700 (PDT) -From: "John W. Millaway" <johnmillaway@yahoo.com> -Subject: Re: reentrant C scanner -To: "W. L. Estes" <wlestes@uncg.edu> -In-Reply-To: <200104082224.SAA06112@michael.uncg.edu> - -I'm sure you haven't had time to look at it yet, but there are two other points I -wanted to mention: - -1. Once the reentrant scanner is working, there is no need for the non-reentrant -scanner. The non-reentrant API can be built as a wrapper around the reentrant -scanner. Much, much less code maintenance. I will happily do the conversion. - -2. The reentrancy can be verified, in part, by running `nm -A -l' on a compiled -scanner. `nm` is part of binutils and shows, among other things, the global -variables. In the reentrant scanner, there should be none. - --John Millaway - -PS - What is the mailing list? I guess I should subscribe! The gnu site says that -there is currently no list for flex: -http://www.gnu.org/software/flex/flex.html#lists - - -__________________________________________________ -Do You Yahoo!? -Get email at your own domain with Yahoo! Mail. -http://personal.mail.yahoo.com/ - - -1, answered,, -X-Coding-System: nil -Mail-from: From vern@daffy.ee.lbl.gov Tue Apr 17 04:00:22 2001 -Return-Path: <vern@daffy.ee.lbl.gov> -Received: from localhost (localhost [127.0.0.1]) - by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id EAA31012 - for <wlestes@localhost>; Tue, 17 Apr 2001 04:00:21 -0400 -Received: from imap.uncg.edu - by localhost with IMAP (fetchmail-5.1.0) - for wlestes@localhost (single-drop); Tue, 17 Apr 2001 04:00:21 -0400 (EDT) -Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70]) - by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f3H7eqe08321 - for <wlestes@hermes.email.uncg.edu>; Tue, 17 Apr 2001 03:40:52 -0400 (EDT) -Received: from daffy.ee.lbl.gov (daffy.ee.lbl.gov [131.243.1.31]) - by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id DAA08895 - for <wlestes@uncg.edu>; Tue, 17 Apr 2001 03:40:50 -0400 (EDT) -Received: (from vern@localhost) - by daffy.ee.lbl.gov (8.10.0/8.10.0) id f3H7eoW18946; - Tue, 17 Apr 2001 00:40:50 -0700 (PDT) -Message-Id: <200104170740.f3H7eoW18946@daffy.ee.lbl.gov> -To: "Yuri Victorovich" <yurivict@hotmail.com> -Subject: Re: Flex comments -Cc: wlestes@uncg.edu -In-reply-to: Your message of Sun, 15 Apr 2001 22:47:37 PDT. -Date: Tue, 17 Apr 2001 00:40:50 PDT -From: Vern Paxson <vern@ee.lbl.gov> - -*** EOOH *** -To: "Yuri Victorovich" <yurivict@hotmail.com> -Subject: Re: Flex comments -Cc: wlestes@uncg.edu -In-reply-to: Your message of Sun, 15 Apr 2001 22:47:37 PDT. -Date: Tue, 17 Apr 2001 00:40:50 PDT -From: Vern Paxson <vern@ee.lbl.gov> - -> One problem: how to eliminate the static variables without making it C++ -> scanner with option -+? I do not want to introduce any of C++ into my -> project and at the same time I use pthreads on FreeBSD. -> -> That would be a nice feature to have such an option. - -I agree it would be nice. I've cc'd Will Estes, who is trying out taking -over flex maintenance / development. - - Vern - - -1, answered,, -X-Coding-System: nil -Mail-from: From yurivict@hotmail.com Tue Apr 17 10:42:56 2001 -Return-Path: <yurivict@hotmail.com> -Received: from localhost (localhost [127.0.0.1]) - by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id KAA01266 - for <wlestes@localhost>; Tue, 17 Apr 2001 10:42:56 -0400 -Received: from imap.uncg.edu - by localhost with IMAP (fetchmail-5.1.0) - for wlestes@localhost (single-drop); Tue, 17 Apr 2001 10:42:56 -0400 (EDT) -Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70]) - by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f3HENMe01358 - for <wlestes@hermes.email.uncg.edu>; Tue, 17 Apr 2001 10:23:22 -0400 (EDT) -Received: from hotmail.com (f210.law12.hotmail.com [64.4.19.210]) - by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id KAA06325 - for <wlestes@uncg.edu>; Tue, 17 Apr 2001 10:23:21 -0400 (EDT) -Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; - Tue, 17 Apr 2001 07:22:51 -0700 -Received: from 194.158.212.99 by lw12fd.law12.hotmail.msn.com with HTTP; Tue, 17 Apr 2001 14:22:51 GMT -X-Originating-IP: [194.158.212.99] -From: "Yuri Victorovich" <yurivict@hotmail.com> -To: wlestes@uncg.edu -Subject: Re: Flex comments -Date: Tue, 17 Apr 2001 07:22:51 -0700 -Mime-Version: 1.0 -Content-Type: text/plain; format=flowed -Message-ID: <F210b98KtdhQYZkxOjm00009556@hotmail.com> -X-OriginalArrivalTime: 17 Apr 2001 14:22:51.0694 (UTC) FILETIME=[E2BCD4E0:01C0C749] - -*** EOOH *** -From: "Yuri Victorovich" <yurivict@hotmail.com> -To: wlestes@uncg.edu -Subject: Re: Flex comments -Date: Tue, 17 Apr 2001 07:22:51 -0700 - -Will, Thank you for reply! - -I spent the whole day yesterday writing awk script to -convert normal flex output to thread-safe form. - -If you do not have time or will need help with this -work on flex -- I can do anything from research, programming -to testing. Just let me know -- I digged into it to some -extent already and will have some time in the coming weeks. - -Kind Regards, -Yuri. - - - - - ->From: "W. L. Estes" <wlestes@uncg.edu> ->To: vern@ee.lbl.gov ->CC: yurivict@hotmail.com ->Subject: Re: Flex comments ->Date: Tue, 17 Apr 2001 08:33:35 -0400 -> -> > > One problem: how to eliminate the static variables without making it ->C++ -> > > scanner with option -+? I do not want to introduce any of C++ into my -> > > project and at the same time I use pthreads on FreeBSD. -> > > -> > > That would be a nice feature to have such an option. -> > -> > I agree it would be nice. I've cc'd Will Estes, who is trying out ->taking -> > over flex maintenance / development. -> ->Thanks for the suggestion. I'll look into what it will take to do ->this. -> ->--Will - -_________________________________________________________________ -Get your FREE download of MSN Explorer at http://explorer.msn.com - - -1, answered,, -X-Coding-System: nil -Mail-from: From vern@daffy.ee.lbl.gov Tue Apr 17 12:34:26 2001 -Return-Path: <vern@daffy.ee.lbl.gov> -Received: from localhost (localhost [127.0.0.1]) - by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id MAA01409 - for <wlestes@localhost>; Tue, 17 Apr 2001 12:34:26 -0400 -Received: from imap.uncg.edu - by localhost with IMAP (fetchmail-5.1.0) - for wlestes@localhost (single-drop); Tue, 17 Apr 2001 12:34:26 -0400 (EDT) -Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70]) - by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f3HGFpe27457 - for <wlestes@hermes.email.uncg.edu>; Tue, 17 Apr 2001 12:15:51 -0400 (EDT) -Received: from daffy.ee.lbl.gov (daffy.ee.lbl.gov [131.243.1.31]) - by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id MAA20041 - for <wlestes@uncg.edu>; Tue, 17 Apr 2001 12:15:49 -0400 (EDT) -Received: (from vern@localhost) - by daffy.ee.lbl.gov (8.10.0/8.10.0) id f3HGFoP19785; - Tue, 17 Apr 2001 09:15:50 -0700 (PDT) -Message-Id: <200104171615.f3HGFoP19785@daffy.ee.lbl.gov> -To: "W. L. Estes" <wlestes@uncg.edu> -Subject: Re: Flex comments -In-reply-to: Your message of Tue, 17 Apr 2001 08:57:41 PDT. -Date: Tue, 17 Apr 2001 09:15:50 PDT -From: Vern Paxson <vern@ee.lbl.gov> - -*** EOOH *** -To: "W. L. Estes" <wlestes@uncg.edu> -Subject: Re: Flex comments -In-reply-to: Your message of Tue, 17 Apr 2001 08:57:41 PDT. -Date: Tue, 17 Apr 2001 09:15:50 PDT -From: Vern Paxson <vern@ee.lbl.gov> - -> If there is more detail in the original message, could you forward it -> to me? - -That was the whole message. The basic problem that people run into -is they want reentrant scanners, so no statics or global variables. -The general strategy for this is to have a new yylex() interface in -which the caller passes in a struct that has all of the otherwise-global -variables. This is a bit tricky to do cleanly because you can't switch -to that as *the* interface, of course, because it would break the -existing API; which means you have to be able to generate two forms of -the skeleton file, one for the existing API with the statics/globals, -and one without them and the struct definition instead. - -There's probably some more discussion on this in the mail tarball I sent -you - search for "reentrant". - - Vern - - -1,, -X-Coding-System: nil -Mail-from: From help-flex-admin@gnu.org Wed Apr 25 00:20:40 2001 -Return-Path: <help-flex-admin@gnu.org> -Received: from localhost (localhost [127.0.0.1]) - by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id AAA22703 - for <wlestes@localhost>; Wed, 25 Apr 2001 00:20:40 -0400 -Received: from imap.uncg.edu - by localhost with IMAP (fetchmail-5.1.0) - for wlestes@localhost (single-drop); Wed, 25 Apr 2001 00:20:40 -0400 (EDT) -Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70]) - by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f3P403e01034 - for <wlestes@hermes.email.uncg.edu>; Wed, 25 Apr 2001 00:00:03 -0400 (EDT) -Received: from fencepost.gnu.org (we-refuse-to-spy-on-our-users@fencepost.gnu.org [199.232.76.164]) - by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id AAA05202 - for <wlestes@uncg.edu>; Wed, 25 Apr 2001 00:00:02 -0400 (EDT) -Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) - by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian)) - id 14sGTC-0006Tm-00 - for <wlestes@uncg.edu>; Wed, 25 Apr 2001 00:00:02 -0400 -Received: from [203.199.199.50] (helo=banyannetworks.com) - by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian)) - id 14sGRt-0006Sr-00 - for <help-flex@gnu.org>; Tue, 24 Apr 2001 23:58:44 -0400 -Received: from localhost (arasi@localhost) by banyannetworks.com (8.9.3/8.8.3) with ESMTP id JAA03208 for <help-flex@gnu.org>; Wed, 25 Apr 2001 09:25:36 +0530 -From: Avai Arasi <arasi@banyanNetworks.com> -To: help-flex@gnu.org -Subject: Clarification Regarding Porting Flex and Bison to RTOS -Message-ID: <Pine.LNX.4.10.10104250920140.3092-100000@banyannetworks.com> -MIME-Version: 1.0 -Content-Type: TEXT/PLAIN; charset=US-ASCII -Sender: help-flex-admin@gnu.org -Errors-To: help-flex-admin@gnu.org -X-BeenThere: help-flex@gnu.org -X-Mailman-Version: 2.0.3 -Precedence: bulk -List-Help: <mailto:help-flex-request@gnu.org?subject=help> -List-Post: <mailto:help-flex@gnu.org> -List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=subscribe> -List-Id: Users list for Flex, - the GNU lexical analyser generator <help-flex.gnu.org> -List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=unsubscribe> -List-Archive: <http://mail.gnu.org/pipermail/help-flex/> -Date: Wed, 25 Apr 2001 09:25:36 +0530 (IST) - -*** EOOH *** -From: Avai Arasi <arasi@banyanNetworks.com> -To: help-flex@gnu.org -Subject: Clarification Regarding Porting Flex and Bison to RTOS -Sender: help-flex-admin@gnu.org -Precedence: bulk -List-Help: <mailto:help-flex-request@gnu.org?subject=help> -List-Post: <mailto:help-flex@gnu.org> -List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=subscribe> -List-Id: Users list for Flex, - the GNU lexical analyser generator <help-flex.gnu.org> -List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=unsubscribe> -List-Archive: <http://mail.gnu.org/pipermail/help-flex/> -Date: Wed, 25 Apr 2001 09:25:36 +0530 (IST) - -Hello, - - I am trying to port both Flex and Bison to a Real Time OS. I don't have -the device options like the file which the Flex expects as input. In the -place of the file i have a character pointer. How should I proceed with -the parsing ? - - Is there any standard procedure for this porting ? If somebody has -already done such a work can i have some hints please. - -Thank You. - -Regards, -Avaiarasi -Senior Engineer R & D -Banyan Networks Pvt. Ltd. -Chennai. - - -_______________________________________________ -Help-flex mailing list -Help-flex@gnu.org -http://mail.gnu.org/mailman/listinfo/help-flex - - -1,, -X-Coding-System: nil -Mail-from: From help-flex-admin@gnu.org Wed Apr 25 13:17:31 2001 -Return-Path: <help-flex-admin@gnu.org> -Received: from localhost (localhost [127.0.0.1]) - by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id NAA23790 - for <wlestes@localhost>; Wed, 25 Apr 2001 13:17:31 -0400 -Received: from imap.uncg.edu - by localhost with IMAP (fetchmail-5.1.0) - for wlestes@localhost (single-drop); Wed, 25 Apr 2001 13:17:31 -0400 (EDT) -Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70]) - by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f3PGv2e04258 - for <wlestes@hermes.email.uncg.edu>; Wed, 25 Apr 2001 12:57:02 -0400 (EDT) -Received: from fencepost.gnu.org (fencepost.gnu.org [199.232.76.164]) - by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id MAA11157 - for <wlestes@uncg.edu>; Wed, 25 Apr 2001 12:57:01 -0400 (EDT) -Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) - by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian)) - id 14sSb8-00056g-00 - for <wlestes@uncg.edu>; Wed, 25 Apr 2001 12:57:02 -0400 -Received: from web9403.mail.yahoo.com ([216.136.129.109]) - by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian)) - id 14sSYq-00053W-00 - for <help-flex@gnu.org>; Wed, 25 Apr 2001 12:54:41 -0400 -Message-ID: <20010425165439.64856.qmail@web9403.mail.yahoo.com> -Received: from [216.254.82.102] by web9403.mail.yahoo.com; Wed, 25 Apr 2001 09:54:39 PDT -From: "John W. Millaway" <johnmillaway@yahoo.com> -Subject: Bug: %option main overrides %option yywrap -To: help-flex@gnu.org -In-Reply-To: <200104251228.IAA23213@michael.uncg.edu> -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Sender: help-flex-admin@gnu.org -Errors-To: help-flex-admin@gnu.org -X-BeenThere: help-flex@gnu.org -X-Mailman-Version: 2.0.3 -Precedence: bulk -List-Help: <mailto:help-flex-request@gnu.org?subject=help> -List-Post: <mailto:help-flex@gnu.org> -List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=subscribe> -List-Id: Users list for Flex, - the GNU lexical analyser generator <help-flex.gnu.org> -List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=unsubscribe> -List-Archive: <http://mail.gnu.org/pipermail/help-flex/> -Date: Wed, 25 Apr 2001 09:54:39 -0700 (PDT) - -*** EOOH *** -From: "John W. Millaway" <johnmillaway@yahoo.com> -Subject: Bug: %option main overrides %option yywrap -To: help-flex@gnu.org -In-Reply-To: <200104251228.IAA23213@michael.uncg.edu> -Sender: help-flex-admin@gnu.org -Precedence: bulk -List-Help: <mailto:help-flex-request@gnu.org?subject=help> -List-Post: <mailto:help-flex@gnu.org> -List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=subscribe> -List-Id: Users list for Flex, - the GNU lexical analyser generator <help-flex.gnu.org> -List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=unsubscribe> -List-Archive: <http://mail.gnu.org/pipermail/help-flex/> -Date: Wed, 25 Apr 2001 09:54:39 -0700 (PDT) - -Hello, - -There is a "bug" in the current version of flex (2.5.4) in which the %option -[no]main unconditionally sets the %option [no]yywrap. I use the term "bug" -hesitantly, because this behavior appears to be intentional. However, I can't think -of any use for it other than to cause unexpected link errors when yywrap() is not -found. - -Example: - - %option noyywrap /* Disable option yywrap. */ - %option nomain /* Option yywrap is now enabled! */ - -One workaround is to always specify %option yywrap AFTER %option main. In general, -if the user explicitly sets an option, then flex should either honor that setting, -or report a conflict. - -The bug is in "scan.l" at line 247, and is undocumented. - -244: lex-compat lex_compat = option_sense; -245: main { -246: action_define( "YY_MAIN", option_sense ); -247: do_yywrap = ! option_sense; -248: } -249: meta-ecs usemecs = option_sense; - --John Millaway - - -__________________________________________________ -Do You Yahoo!? -Yahoo! Auctions - buy the things you want at great prices -http://auctions.yahoo.com/ - -_______________________________________________ -Help-flex mailing list -Help-flex@gnu.org -http://mail.gnu.org/mailman/listinfo/help-flex - - -1,, -X-Coding-System: nil -Mail-from: From help-flex-admin@gnu.org Wed Apr 25 14:11:45 2001 -Return-Path: <help-flex-admin@gnu.org> -Received: from localhost (localhost [127.0.0.1]) - by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id OAA23826 - for <wlestes@localhost>; Wed, 25 Apr 2001 14:11:44 -0400 -Received: from imap.uncg.edu - by localhost with IMAP (fetchmail-5.1.0) - for wlestes@localhost (single-drop); Wed, 25 Apr 2001 14:11:44 -0400 (EDT) -Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70]) - by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f3PHp7e27019 - for <wlestes@hermes.email.uncg.edu>; Wed, 25 Apr 2001 13:51:07 -0400 (EDT) -Received: from fencepost.gnu.org (fencepost.gnu.org [199.232.76.164]) - by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id NAA17880 - for <wlestes@uncg.edu>; Wed, 25 Apr 2001 13:51:08 -0400 (EDT) -Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) - by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian)) - id 14sTRT-0003QA-00 - for <wlestes@uncg.edu>; Wed, 25 Apr 2001 13:51:07 -0400 -Received: from web9404.mail.yahoo.com ([216.136.129.110]) - by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian)) - id 14sTQy-0003Pm-00 - for <help-flex@gnu.org>; Wed, 25 Apr 2001 13:50:36 -0400 -Message-ID: <20010425175036.43329.qmail@web9404.mail.yahoo.com> -Received: from [216.254.82.102] by web9404.mail.yahoo.com; Wed, 25 Apr 2001 10:50:36 PDT -From: "John W. Millaway" <johnmillaway@yahoo.com> -Subject: Re: scaning from memory -To: "alexandre.gouraud" <alexandre.gouraud@laposte.net>, help-flex@gnu.org -In-Reply-To: <GCCZ8R$IiFF_2Id0FNAO2kAXNPACqX5slPk_GQyEsHVyKKjYXVpqFi3j4Ntc@laposte.net> -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Sender: help-flex-admin@gnu.org -Errors-To: help-flex-admin@gnu.org -X-BeenThere: help-flex@gnu.org -X-Mailman-Version: 2.0.3 -Precedence: bulk -List-Help: <mailto:help-flex-request@gnu.org?subject=help> -List-Post: <mailto:help-flex@gnu.org> -List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=subscribe> -List-Id: Users list for Flex, - the GNU lexical analyser generator <help-flex.gnu.org> -List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=unsubscribe> -List-Archive: <http://mail.gnu.org/pipermail/help-flex/> -Date: Wed, 25 Apr 2001 10:50:36 -0700 (PDT) - -*** EOOH *** -From: "John W. Millaway" <johnmillaway@yahoo.com> -Subject: Re: scaning from memory -To: "alexandre.gouraud" <alexandre.gouraud@laposte.net>, help-flex@gnu.org -In-Reply-To: <GCCZ8R$IiFF_2Id0FNAO2kAXNPACqX5slPk_GQyEsHVyKKjYXVpqFi3j4Ntc@laposte.net> -Sender: help-flex-admin@gnu.org -Precedence: bulk -List-Help: <mailto:help-flex-request@gnu.org?subject=help> -List-Post: <mailto:help-flex@gnu.org> -List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=subscribe> -List-Id: Users list for Flex, - the GNU lexical analyser generator <help-flex.gnu.org> -List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=unsubscribe> -List-Archive: <http://mail.gnu.org/pipermail/help-flex/> -Date: Wed, 25 Apr 2001 10:50:36 -0700 (PDT) - -> I am trying to write a parser with flex/bison scaning strings -> in memory, but I can't make it work. I am pretty sure it's a -> common way of using flex, but I didn't find any example on the -> web. (I have read the manual, of course). I have found several -> times this question, but no answer. -> I don't know where to put the yy_scan_string() statement. I -> use the <<EOF>> rule as last rule. And I have also modified -> the prototype of the yylex function with -> #define YY_DECL int yylex(YYSTYPE *lvalp,char *name) -> where name is the string I want to parse. - -You should call yy_scan_string before calling yylex. Here are two examples: - -1. In general: - - YY_BUFFER_STATE buf_state = yy_scan_string( str ); - while( yylex() != 0 ) - ; - yy_delete_buffer(buf_state); - - -2. Your particular scanner: - -%{ -#define YY_USER_INIT buf_state = yy_scan_string( name ); -%} -%% - static YY_BUFFER_STATE buf_state; - -<<EOF>> { yy_buffer_delete( buf_state ); yyterminate(); } -%% - --John - - -__________________________________________________ -Do You Yahoo!? -Yahoo! Auctions - buy the things you want at great prices -http://auctions.yahoo.com/ - -_______________________________________________ -Help-flex mailing list -Help-flex@gnu.org -http://mail.gnu.org/mailman/listinfo/help-flex - - -1,, -X-Coding-System: nil -Mail-from: From help-flex-admin@gnu.org Wed Apr 25 14:41:58 2001 -Return-Path: <help-flex-admin@gnu.org> -Received: from localhost (localhost [127.0.0.1]) - by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id OAA23852 - for <wlestes@localhost>; Wed, 25 Apr 2001 14:41:58 -0400 -Received: from imap.uncg.edu - by localhost with IMAP (fetchmail-5.1.0) - for wlestes@localhost (single-drop); Wed, 25 Apr 2001 14:41:58 -0400 (EDT) -Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70]) - by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f3PILLe10211 - for <wlestes@hermes.email.uncg.edu>; Wed, 25 Apr 2001 14:21:21 -0400 (EDT) -Received: from fencepost.gnu.org (fencepost.gnu.org [199.232.76.164]) - by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id OAA21692 - for <wlestes@uncg.edu>; Wed, 25 Apr 2001 14:21:21 -0400 (EDT) -Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) - by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian)) - id 14sTuj-0007Yw-00 - for <wlestes@uncg.edu>; Wed, 25 Apr 2001 14:21:21 -0400 -Received: from daffy.ee.lbl.gov ([131.243.1.31]) - by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian)) - id 14sTtm-0007Xg-00 - for <help-flex@gnu.org>; Wed, 25 Apr 2001 14:20:22 -0400 -Received: (from vern@localhost) - by daffy.ee.lbl.gov (8.10.0/8.10.0) id f3PIKJa19998; - Wed, 25 Apr 2001 11:20:19 -0700 (PDT) -Message-Id: <200104251820.f3PIKJa19998@daffy.ee.lbl.gov> -To: "John W. Millaway" <johnmillaway@yahoo.com> -Cc: help-flex@gnu.org -Subject: Re: Bug: %option main overrides %option yywrap -In-reply-to: Your message of Wed, 25 Apr 2001 09:54:39 PDT. -From: Vern Paxson <vern@ee.lbl.gov> -Sender: help-flex-admin@gnu.org -Errors-To: help-flex-admin@gnu.org -X-BeenThere: help-flex@gnu.org -X-Mailman-Version: 2.0.3 -Precedence: bulk -List-Help: <mailto:help-flex-request@gnu.org?subject=help> -List-Post: <mailto:help-flex@gnu.org> -List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=subscribe> -List-Id: Users list for Flex, - the GNU lexical analyser generator <help-flex.gnu.org> -List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=unsubscribe> -List-Archive: <http://mail.gnu.org/pipermail/help-flex/> -Date: Wed, 25 Apr 2001 11:20:19 PDT - -*** EOOH *** -To: "John W. Millaway" <johnmillaway@yahoo.com> -Cc: help-flex@gnu.org -Subject: Re: Bug: %option main overrides %option yywrap -In-reply-to: Your message of Wed, 25 Apr 2001 09:54:39 PDT. -From: Vern Paxson <vern@ee.lbl.gov> -Sender: help-flex-admin@gnu.org -Precedence: bulk -List-Help: <mailto:help-flex-request@gnu.org?subject=help> -List-Post: <mailto:help-flex@gnu.org> -List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=subscribe> -List-Id: Users list for Flex, - the GNU lexical analyser generator <help-flex.gnu.org> -List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=unsubscribe> -List-Archive: <http://mail.gnu.org/pipermail/help-flex/> -Date: Wed, 25 Apr 2001 11:20:19 PDT - -> 245: main { -> 246: action_define( "YY_MAIN", option_sense ); -> 247: do_yywrap = ! option_sense; -> 248: } - -I think I did that (which is documented in the manual, by the way) so that -"%option main" would be a quick way to specify you want a bare-bones -program for which you don't have to define any additional routines. -I'd be disinclined to change it (though it's Will's call) because it's -so easy to work around - just don't use "%option main", which is only -saving you a few lines of code anyway. - - Vern - -_______________________________________________ -Help-flex mailing list -Help-flex@gnu.org -http://mail.gnu.org/mailman/listinfo/help-flex - - -1,, -X-Coding-System: nil -Mail-from: From help-flex-admin@gnu.org Wed Apr 25 16:28:59 2001 -Return-Path: <help-flex-admin@gnu.org> -Received: from localhost (localhost [127.0.0.1]) - by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id QAA23955 - for <wlestes@localhost>; Wed, 25 Apr 2001 16:28:59 -0400 -Received: from imap.uncg.edu - by localhost with IMAP (fetchmail-5.1.0) - for wlestes@localhost (single-drop); Wed, 25 Apr 2001 16:28:59 -0400 (EDT) -Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70]) - by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f3PK99e25951 - for <wlestes@hermes.email.uncg.edu>; Wed, 25 Apr 2001 16:09:09 -0400 (EDT) -Received: from fencepost.gnu.org (fencepost.gnu.org [199.232.76.164]) - by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id QAA05277 - for <wlestes@uncg.edu>; Wed, 25 Apr 2001 16:09:08 -0400 (EDT) -Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) - by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian)) - id 14sVb1-0005jV-00 - for <wlestes@uncg.edu>; Wed, 25 Apr 2001 16:09:07 -0400 -Received: from michael.uncg.edu ([152.13.5.20]) - by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian)) - id 14sVaJ-0005iu-00 - for <help-flex@gnu.org>; Wed, 25 Apr 2001 16:08:23 -0400 -Received: (from wlestes@localhost) - by michael.uncg.edu (8.9.3/8.9.3) id QAA23947; - Wed, 25 Apr 2001 16:27:46 -0400 -Message-Id: <200104252027.QAA23947@michael.uncg.edu> -X-Authentication-Warning: michael.uncg.edu: wlestes set sender to wlestes@michael.uncg.edu using -f -From: "W. L. Estes" <wlestes@uncg.edu> -To: vern@ee.lbl.gov -CC: johnmillaway@yahoo.com, help-flex@gnu.org -In-reply-to: <200104251820.f3PIKJa19998@daffy.ee.lbl.gov> (message from Vern - Paxson on Wed, 25 Apr 2001 11:20:19 PDT) -Subject: Re: Bug: %option main overrides %option yywrap -References: <200104251820.f3PIKJa19998@daffy.ee.lbl.gov> -Sender: help-flex-admin@gnu.org -Errors-To: help-flex-admin@gnu.org -X-BeenThere: help-flex@gnu.org -X-Mailman-Version: 2.0.3 -Precedence: bulk -List-Help: <mailto:help-flex-request@gnu.org?subject=help> -List-Post: <mailto:help-flex@gnu.org> -List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=subscribe> -List-Id: Users list for Flex, - the GNU lexical analyser generator <help-flex.gnu.org> -List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=unsubscribe> -List-Archive: <http://mail.gnu.org/pipermail/help-flex/> -Date: Wed, 25 Apr 2001 16:27:46 -0400 - -*** EOOH *** -From: "W. L. Estes" <wlestes@uncg.edu> -To: vern@ee.lbl.gov -CC: johnmillaway@yahoo.com, help-flex@gnu.org -In-reply-to: <200104251820.f3PIKJa19998@daffy.ee.lbl.gov> (message from Vern - Paxson on Wed, 25 Apr 2001 11:20:19 PDT) -Subject: Re: Bug: %option main overrides %option yywrap -Sender: help-flex-admin@gnu.org -Precedence: bulk -List-Help: <mailto:help-flex-request@gnu.org?subject=help> -List-Post: <mailto:help-flex@gnu.org> -List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=subscribe> -List-Id: Users list for Flex, - the GNU lexical analyser generator <help-flex.gnu.org> -List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=unsubscribe> -List-Archive: <http://mail.gnu.org/pipermail/help-flex/> -Date: Wed, 25 Apr 2001 16:27:46 -0400 - -> I think I did that (which is documented in the manual, by the way) so that -> "%option main" would be a quick way to specify you want a bare-bones -> program for which you don't have to define any additional routines. -> I'd be disinclined to change it (though it's Will's call) because it's -> so easy to work around - just don't use "%option main", which is only -> saving you a few lines of code anyway. - -Additionally, flex.1 says the following: - - main directs flex to provide a default main() program - for the scanner, which simply calls yylex(). This - option implies noyywrap (see below). - -My sense is that Vern is correct: The right thing to do is to not use -%option main if you want yywrap() to be under your control. - -Thanks, - ---Will - -_______________________________________________ -Help-flex mailing list -Help-flex@gnu.org -http://mail.gnu.org/mailman/listinfo/help-flex - - -1,, -X-Coding-System: nil -Mail-from: From help-flex-admin@gnu.org Thu Apr 26 12:11:23 2001 -Return-Path: <help-flex-admin@gnu.org> -Received: from localhost (localhost [127.0.0.1]) - by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id MAA25162 - for <wlestes@localhost>; Thu, 26 Apr 2001 12:11:22 -0400 -Received: from imap.uncg.edu - by localhost with IMAP (fetchmail-5.1.0) - for wlestes@localhost (single-drop); Thu, 26 Apr 2001 12:11:22 -0400 (EDT) -Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70]) - by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f3QFp6e21203 - for <wlestes@hermes.email.uncg.edu>; Thu, 26 Apr 2001 11:51:06 -0400 (EDT) -Received: from fencepost.gnu.org (fencepost.gnu.org [199.232.76.164]) - by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id LAA21348 - for <wlestes@uncg.edu>; Thu, 26 Apr 2001 11:51:05 -0400 (EDT) -Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) - by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian)) - id 14so2r-00043k-00 - for <wlestes@uncg.edu>; Thu, 26 Apr 2001 11:51:05 -0400 -Received: from [208.155.173.144] (helo=symbology.com) - by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian)) - id 14so2e-0003Dl-00 - for <help-flex@gnu.org>; Thu, 26 Apr 2001 11:50:53 -0400 -Received: from Spooler by symbology.com (Mercury/32 v3.21c) ID MO003737; - 26 Apr 01 10:52:43 -0500 -Received: from spooler by symbology.com (Mercury/32 v3.21c); 26 Apr 01 10:52:29 -0500 -Received: from grommit (10.0.0.74) by Symbology (Mercury/32 v3.21c) ID MG003736; - 26 Apr 01 10:52:22 -0500 -From: "Dave Dutcher" <ddutcher@symbology.com> -To: <help-flex@gnu.org> -Subject: Suppress copying characters to yytext? -Message-ID: <002501c0ce68$99b3ec40$4a00000a@symbology.com> -MIME-Version: 1.0 -Content-Type: text/plain; - charset="iso-8859-1" -Content-Transfer-Encoding: 7bit -X-Priority: 3 (Normal) -X-MSMail-Priority: Normal -X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2910.0) -X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 -Importance: Normal -Sender: help-flex-admin@gnu.org -Errors-To: help-flex-admin@gnu.org -X-BeenThere: help-flex@gnu.org -X-Mailman-Version: 2.0.3 -Precedence: bulk -List-Help: <mailto:help-flex-request@gnu.org?subject=help> -List-Post: <mailto:help-flex@gnu.org> -List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=subscribe> -List-Id: Users list for Flex, - the GNU lexical analyser generator <help-flex.gnu.org> -List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=unsubscribe> -List-Archive: <http://mail.gnu.org/pipermail/help-flex/> -Date: Thu, 26 Apr 2001 10:50:20 -0500 - -*** EOOH *** -From: "Dave Dutcher" <ddutcher@symbology.com> -To: <help-flex@gnu.org> -Subject: Suppress copying characters to yytext? -Importance: Normal -Sender: help-flex-admin@gnu.org -Precedence: bulk -List-Help: <mailto:help-flex-request@gnu.org?subject=help> -List-Post: <mailto:help-flex@gnu.org> -List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=subscribe> -List-Id: Users list for Flex, - the GNU lexical analyser generator <help-flex.gnu.org> -List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=unsubscribe> -List-Archive: <http://mail.gnu.org/pipermail/help-flex/> -Date: Thu, 26 Apr 2001 10:50:20 -0500 - -Hi, - -First off I was wondering if there is an official web site for Flex? - -Second, I would like to be able to have Flex use certain characters in a -regular expression to match the expression but suppress copying the -characters to yytext. A simple example would be if I was trying to match -text surrounded by quotes, but I don't want to use the quotes. i.e. - -\"[^\n]\" { yylval = strdup(yytext); //This gives me the text and quotes. } - -or - -\"[^\n]\" { yylval = strdup(yytext+1); yylval[strlen(yylval)-1] = '\0'; -//Now I've removed the quotes. } - -But since I'm lazy ;) I would like to be able to tell Flex not to copy the -quotes. What I would like is an operator that would tell flex to match an -expression but to not copy it to yytext. Off the top of my head maybe the # -symbol could work for such an operator, so I could then do: - -\"#[^\n]\"# { yylval = strdup(yytext); //This would give me the text without -the quotes. } - -Does anyone know if such a feature or something similar exists? If this -doesn't exists would it be practical? - -Thanks, - -Dave Dutcher -Software Engineer -Symbology, Inc. -Minneapolis, MN - - -_______________________________________________ -Help-flex mailing list -Help-flex@gnu.org -http://mail.gnu.org/mailman/listinfo/help-flex - - -1,, -X-Coding-System: nil -Mail-from: From help-flex-admin@gnu.org Thu Apr 26 12:26:26 2001 -Return-Path: <help-flex-admin@gnu.org> -Received: from localhost (localhost [127.0.0.1]) - by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id MAA25203 - for <wlestes@localhost>; Thu, 26 Apr 2001 12:26:26 -0400 -Received: from imap.uncg.edu - by localhost with IMAP (fetchmail-5.1.0) - for wlestes@localhost (single-drop); Thu, 26 Apr 2001 12:26:26 -0400 (EDT) -Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70]) - by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f3QG63e27511 - for <wlestes@hermes.email.uncg.edu>; Thu, 26 Apr 2001 12:06:03 -0400 (EDT) -Received: from fencepost.gnu.org (fencepost.gnu.org [199.232.76.164]) - by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id MAA23192 - for <wlestes@uncg.edu>; Thu, 26 Apr 2001 12:06:02 -0400 (EDT) -Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) - by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian)) - id 14soHK-0004gM-00 - for <wlestes@uncg.edu>; Thu, 26 Apr 2001 12:06:02 -0400 -Received: from acp3bf.physik.rwth-aachen.de ([137.226.32.75]) - by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian)) - id 14soFe-0004cw-00 - for <help-flex@gnu.org>; Thu, 26 Apr 2001 12:04:18 -0400 -Received: from localhost (broeker@localhost) by acp3bf.physik.rwth-aachen.de (8.7.5/v3.2) with ESMTP id SAA00797; Thu, 26 Apr 2001 18:04:09 +0200 -X-Authentication-Warning: acp3bf.physik.rwth-aachen.de: broeker owned process doing -bs -From: Hans-Bernhard Broeker <broeker@physik.rwth-aachen.de> -X-Sender: broeker@acp3bf -To: Dave Dutcher <ddutcher@symbology.com> -cc: help-flex@gnu.org -Subject: Re: Suppress copying characters to yytext? -In-Reply-To: <002501c0ce68$99b3ec40$4a00000a@symbology.com> -Message-ID: <Pine.LNX.4.10.10104261759540.592-100000@acp3bf> -MIME-Version: 1.0 -Content-Type: TEXT/PLAIN; charset=US-ASCII -Sender: help-flex-admin@gnu.org -Errors-To: help-flex-admin@gnu.org -X-BeenThere: help-flex@gnu.org -X-Mailman-Version: 2.0.3 -Precedence: bulk -List-Help: <mailto:help-flex-request@gnu.org?subject=help> -List-Post: <mailto:help-flex@gnu.org> -List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=subscribe> -List-Id: Users list for Flex, - the GNU lexical analyser generator <help-flex.gnu.org> -List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=unsubscribe> -List-Archive: <http://mail.gnu.org/pipermail/help-flex/> -Date: Thu, 26 Apr 2001 18:04:06 +0200 (MET DST) - -*** EOOH *** -From: Hans-Bernhard Broeker <broeker@physik.rwth-aachen.de> -To: Dave Dutcher <ddutcher@symbology.com> -cc: help-flex@gnu.org -Subject: Re: Suppress copying characters to yytext? -In-Reply-To: <002501c0ce68$99b3ec40$4a00000a@symbology.com> -Sender: help-flex-admin@gnu.org -Precedence: bulk -List-Help: <mailto:help-flex-request@gnu.org?subject=help> -List-Post: <mailto:help-flex@gnu.org> -List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=subscribe> -List-Id: Users list for Flex, - the GNU lexical analyser generator <help-flex.gnu.org> -List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=unsubscribe> -List-Archive: <http://mail.gnu.org/pipermail/help-flex/> -Date: Thu, 26 Apr 2001 18:04:06 +0200 (MET DST) - -On Thu, 26 Apr 2001, Dave Dutcher wrote: - -> Second, I would like to be able to have Flex use certain characters in a -> regular expression to match the expression but suppress copying the -> characters to yytext. - -You can do that with a start condition and trailing context rules. I.e. -roughly like this: - -<INITIAL>\" BEGIN(IN_STRING) - -<IN_STRING>[^\n]*/\" { - /* yytext is the interior of the string, now */ - BEGIN(INITIAL) - } - --- -Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de) -Even if all the snow were burnt, ashes would remain. - - -_______________________________________________ -Help-flex mailing list -Help-flex@gnu.org -http://mail.gnu.org/mailman/listinfo/help-flex - - -1, answered,, -X-Coding-System: nil -Mail-from: From johnmillaway@yahoo.com Wed Apr 25 18:52:08 2001 -Return-Path: <johnmillaway@yahoo.com> -Received: from localhost (localhost [127.0.0.1]) - by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id SAA24103 - for <wlestes@localhost>; Wed, 25 Apr 2001 18:52:08 -0400 -Received: from imap.uncg.edu - by localhost with IMAP (fetchmail-5.1.0) - for wlestes@localhost (single-drop); Wed, 25 Apr 2001 18:52:08 -0400 (EDT) -Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70]) - by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f3PMWQe07299 - for <wlestes@hermes.email.uncg.edu>; Wed, 25 Apr 2001 18:32:26 -0400 (EDT) -Received: from web9404.mail.yahoo.com (web9404.mail.yahoo.com [216.136.129.110]) - by external-gw.uncg.edu (8.9.3/8.9.3) with SMTP id SAA23019 - for <wlestes@uncg.edu>; Wed, 25 Apr 2001 18:32:24 -0400 (EDT) -Message-ID: <20010425223059.65780.qmail@web9404.mail.yahoo.com> -Received: from [216.254.82.102] by web9404.mail.yahoo.com; Wed, 25 Apr 2001 15:30:59 PDT -Date: Wed, 25 Apr 2001 15:30:59 -0700 (PDT) -From: "John W. Millaway" <johnmillaway@yahoo.com> -Subject: Re: Bug: %option main overrides %option yywrap -To: "W. L. Estes" <wlestes@uncg.edu>, vern@ee.lbl.gov -Cc: help-flex@gnu.org -In-Reply-To: <200104252027.QAA23947@michael.uncg.edu> -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii - -*** EOOH *** -Date: Wed, 25 Apr 2001 15:30:59 -0700 (PDT) -From: "John W. Millaway" <johnmillaway@yahoo.com> -Subject: Re: Bug: %option main overrides %option yywrap -To: "W. L. Estes" <wlestes@uncg.edu>, vern@ee.lbl.gov -Cc: help-flex@gnu.org -In-Reply-To: <200104252027.QAA23947@michael.uncg.edu> - -> Additionally, flex.1 says the following: -> -> main directs flex to provide a default main() program -> for the scanner, which simply calls yylex(). This -> option implies noyywrap (see below). - -I understand, and it makes sense. Just be aware that the inverse of this rule is -also true -- %option nomain implies yywrap -- which makes much less sense. - -Of course, I only complain because it had me on one heck of a bug hunt. I had -specified %option noyywrap and %option nomain, yet the linker complained that it -couldn't find yywrap. I thought I had broken something! :) - --John - - -__________________________________________________ -Do You Yahoo!? -Yahoo! Auctions - buy the things you want at great prices -http://auctions.yahoo.com/ - - -1, answered,, -X-Coding-System: nil -Mail-from: From johnmillaway@yahoo.com Thu May 3 14:16:31 2001 -Return-Path: <johnmillaway@yahoo.com> -Received: from localhost (localhost [127.0.0.1]) - by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id OAA09489 - for <wlestes@localhost>; Thu, 3 May 2001 14:16:31 -0400 -Received: from imap.uncg.edu - by localhost with IMAP (fetchmail-5.1.0) - for wlestes@localhost (single-drop); Thu, 03 May 2001 14:16:31 -0400 (EDT) -Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70]) - by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f43Hv6q26933 - for <wlestes@hermes.email.uncg.edu>; Thu, 3 May 2001 13:57:06 -0400 (EDT) -Received: from web9406.mail.yahoo.com (web9406.mail.yahoo.com [216.136.129.22]) - by external-gw.uncg.edu (8.9.3/8.9.3) with SMTP id NAA14179 - for <wlestes@uncg.edu>; Thu, 3 May 2001 13:57:04 -0400 (EDT) -Message-ID: <20010503175704.85520.qmail@web9406.mail.yahoo.com> -Received: from [155.247.207.90] by web9406.mail.yahoo.com; Thu, 03 May 2001 10:57:04 PDT -Date: Thu, 3 May 2001 10:57:04 -0700 (PDT) -From: "John W. Millaway" <johnmillaway@yahoo.com> -Subject: Reentrant flex - progress update. -To: "W. L. Estes" <wlestes@uncg.edu> -In-Reply-To: <200105011710.NAA02531@michael.uncg.edu> -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii - -*** EOOH *** -Date: Thu, 3 May 2001 10:57:04 -0700 (PDT) -From: "John W. Millaway" <johnmillaway@yahoo.com> -Subject: Reentrant flex - progress update. -To: "W. L. Estes" <wlestes@uncg.edu> -In-Reply-To: <200105011710.NAA02531@michael.uncg.edu> - -Will, -Progress update: This week is finals week. I'll send the tarballs soon. - -I made another, very minor, adjustment a few days ago: The integer yylineno will -always be present in reentrant scanners, but only modified by flex if %option -yylineno is enabled. Many scanners I have seen and built will disable %option -yylineno, then declare an integer "lineno" to keep a line count anyway, (because -the man page warns about the performance penalty of %option yylineno.) This way, -reentrant flex provides support for users who wish to maintain their own linecount. - - /* just like 'wc -l' */ - %option reentrant noyylineno main - %% - yylineno_r = 1; - - \n yylineno_r++; - . { } - <<EOF>> printf( "%7d", yylineno_r); - -Another important note: As far as I know, none of my modifications should have any -effect on NON-reentrant scanners. In fact, I believe compiled scanners generated -with the previous version should be binary equivalent to non-reentrant scanners -generated with the new version. I have not verified this, but if they are not, then -I may have made an oversight. - --John Millaway - - -__________________________________________________ -Do You Yahoo!? -Yahoo! Auctions - buy the things you want at great prices -http://auctions.yahoo.com/ - - -1,, -X-Coding-System: nil -Mail-from: From help-flex-admin@gnu.org Fri May 4 14:36:27 2001 -Return-Path: <help-flex-admin@gnu.org> -Received: from localhost (localhost [127.0.0.1]) - by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id OAA13535 - for <wlestes@localhost>; Fri, 4 May 2001 14:36:27 -0400 -Received: from imap.uncg.edu - by localhost with IMAP (fetchmail-5.1.0) - for wlestes@localhost (single-drop); Fri, 04 May 2001 14:36:27 -0400 (EDT) -Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70]) - by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f44II5q04369 - for <wlestes@hermes.email.uncg.edu>; Fri, 4 May 2001 14:18:05 -0400 (EDT) -Received: from fencepost.gnu.org (fencepost.gnu.org [199.232.76.164]) - by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id OAA14696 - for <wlestes@uncg.edu>; Fri, 4 May 2001 14:18:04 -0400 (EDT) -Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) - by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian)) - id 14vk9T-00065Q-00 - for <wlestes@uncg.edu>; Fri, 04 May 2001 14:18:03 -0400 -Received: from web9401.mail.yahoo.com ([216.136.129.107]) - by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian)) - id 14vk7I-0005Hj-00 - for <help-flex@gnu.org>; Fri, 04 May 2001 14:15:48 -0400 -Message-ID: <20010504181547.55844.qmail@web9401.mail.yahoo.com> -Received: from [155.247.207.90] by web9401.mail.yahoo.com; Fri, 04 May 2001 11:15:47 PDT -From: "John W. Millaway" <johnmillaway@yahoo.com> -Subject: Why is YY_BUF_SIZE not override-able? -To: help-flex@gnu.org -In-Reply-To: <20010430181855.46942.qmail@web9407.mail.yahoo.com> -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Sender: help-flex-admin@gnu.org -Errors-To: help-flex-admin@gnu.org -X-BeenThere: help-flex@gnu.org -X-Mailman-Version: 2.0.3 -Precedence: bulk -List-Help: <mailto:help-flex-request@gnu.org?subject=help> -List-Post: <mailto:help-flex@gnu.org> -List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=subscribe> -List-Id: Users list for Flex, - the GNU lexical analyser generator <help-flex.gnu.org> -List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=unsubscribe> -List-Archive: <http://mail.gnu.org/pipermail/help-flex/> -Date: Fri, 4 May 2001 11:15:47 -0700 (PDT) - -*** EOOH *** -From: "John W. Millaway" <johnmillaway@yahoo.com> -Subject: Why is YY_BUF_SIZE not override-able? -To: help-flex@gnu.org -In-Reply-To: <20010430181855.46942.qmail@web9407.mail.yahoo.com> -Sender: help-flex-admin@gnu.org -Precedence: bulk -List-Help: <mailto:help-flex-request@gnu.org?subject=help> -List-Post: <mailto:help-flex@gnu.org> -List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=subscribe> -List-Id: Users list for Flex, - the GNU lexical analyser generator <help-flex.gnu.org> -List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=unsubscribe> -List-Archive: <http://mail.gnu.org/pipermail/help-flex/> -Date: Fri, 4 May 2001 11:15:47 -0700 (PDT) - -Hi, - -Most everything can be overridden by the user. However the size of the input -buffer, YY_BUF_SIZE, is fixed. Is there a reason why YY_BUF_SIZE can't be -overridden? - -Let's say I knew that all my tokens will match under 80 characters plus newlines, -plus nulls, plus flex-flags... I might decide to set YY_BUF_SIZE to 100. - --John - - -__________________________________________________ -Do You Yahoo!? -Yahoo! Auctions - buy the things you want at great prices -http://auctions.yahoo.com/ - -_______________________________________________ -Help-flex mailing list -Help-flex@gnu.org -http://mail.gnu.org/mailman/listinfo/help-flex - - -1, answered,, -X-Coding-System: nil -Mail-from: From johnmillaway@yahoo.com Fri May 4 15:44:19 2001 -Return-Path: <johnmillaway@yahoo.com> -Received: from localhost (localhost [127.0.0.1]) - by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id PAA13788 - for <wlestes@localhost>; Fri, 4 May 2001 15:44:19 -0400 -Received: from imap.uncg.edu - by localhost with IMAP (fetchmail-5.1.0) - for wlestes@localhost (single-drop); Fri, 04 May 2001 15:44:19 -0400 (EDT) -Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70]) - by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f44JPXq26400 - for <wlestes@hermes.email.uncg.edu>; Fri, 4 May 2001 15:25:33 -0400 (EDT) -Received: from web9407.mail.yahoo.com (web9407.mail.yahoo.com [216.136.129.23]) - by external-gw.uncg.edu (8.9.3/8.9.3) with SMTP id PAA21302 - for <wlestes@uncg.edu>; Fri, 4 May 2001 15:25:31 -0400 (EDT) -Message-ID: <20010504192531.73966.qmail@web9407.mail.yahoo.com> -Received: from [155.247.207.90] by web9407.mail.yahoo.com; Fri, 04 May 2001 12:25:31 PDT -Date: Fri, 4 May 2001 12:25:31 -0700 (PDT) -From: "John W. Millaway" <johnmillaway@yahoo.com> -Subject: Reentrant flex - test results. -To: "W. L. Estes" <wlestes@uncg.edu> -In-Reply-To: <200105031914.PAA09683@michael.uncg.edu> -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii - -*** EOOH *** -Date: Fri, 4 May 2001 12:25:31 -0700 (PDT) -From: "John W. Millaway" <johnmillaway@yahoo.com> -Subject: Reentrant flex - test results. -To: "W. L. Estes" <wlestes@uncg.edu> -In-Reply-To: <200105031914.PAA09683@michael.uncg.edu> - -My concerns are this: -1. The build relies on bison or yacc. Is this intentional? Why not include the -parse.c and parse.h in the dist? - -2. The TESTS/ "make check" stops at the first error. I'm thinking it may not be -what we want. The change is simple: Omit the "|| exit -1" part from the commands in -TESTS/Makefile.in. - -3. Since I'm not the autoconf guru, I couldn't find a cleaner way to do all the -tests. So I just used a /bin/sh loop in the TESTS/Makefile.in. - - - -__________________________________________________ -Do You Yahoo!? -Yahoo! Auctions - buy the things you want at great prices -http://auctions.yahoo.com/ - - -1,, -X-Coding-System: nil -Mail-from: From johnmillaway@yahoo.com Fri May 4 15:56:22 2001 -Return-Path: <johnmillaway@yahoo.com> -Received: from localhost (localhost [127.0.0.1]) - by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id PAA13813 - for <wlestes@localhost>; Fri, 4 May 2001 15:56:22 -0400 -Received: from imap.uncg.edu - by localhost with IMAP (fetchmail-5.1.0) - for wlestes@localhost (single-drop); Fri, 04 May 2001 15:56:22 -0400 (EDT) -Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70]) - by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f44JbZq00252 - for <wlestes@hermes.email.uncg.edu>; Fri, 4 May 2001 15:37:35 -0400 (EDT) -Received: from web9406.mail.yahoo.com (web9406.mail.yahoo.com [216.136.129.22]) - by external-gw.uncg.edu (8.9.3/8.9.3) with SMTP id PAA22444 - for <wlestes@uncg.edu>; Fri, 4 May 2001 15:37:33 -0400 (EDT) -Message-ID: <20010504193731.93040.qmail@web9406.mail.yahoo.com> -Received: from [155.247.207.90] by web9406.mail.yahoo.com; Fri, 04 May 2001 12:37:31 PDT -Date: Fri, 4 May 2001 12:37:31 -0700 (PDT) -From: "John W. Millaway" <johnmillaway@yahoo.com> -Subject: Re: Reentrant flex - progress update. -To: "W. L. Estes" <wlestes@uncg.edu> -In-Reply-To: <200105041912.PAA13694@michael.uncg.edu> -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii - -*** EOOH *** -Date: Fri, 4 May 2001 12:37:31 -0700 (PDT) -From: "John W. Millaway" <johnmillaway@yahoo.com> -Subject: Re: Reentrant flex - progress update. -To: "W. L. Estes" <wlestes@uncg.edu> -In-Reply-To: <200105041912.PAA13694@michael.uncg.edu> - -> Do you think your test suite is complete? or is it just reasonably -> thorough? (i.e. if someone thinks a feature isn't tested, should that -> be a bug?) - -No, it is by no means complete. Yes, missing feature tests are bugs of a sort. The -test suite was designed to cope with all the possible build configurations of a -generated scanner, while developing flex itself. I didn't want to modify or add one -feature, but break another. The breakage would easily go unnoticed. - ->From the top of my head, I didn't test %array, REJECT, and yy_set_bol, because I -plain forgot about them. I didn't test the C++ option because it is broken AFAIK. -All of the tests came in handy at one point or another during the past month, -though. - - -__________________________________________________ -Do You Yahoo!? -Yahoo! Auctions - buy the things you want at great prices -http://auctions.yahoo.com/ - - -1, answered,, -X-Coding-System: nil -Mail-from: From help-flex-admin@gnu.org Sat May 5 03:45:30 2001 -Return-Path: <help-flex-admin@gnu.org> -Received: from localhost (localhost [127.0.0.1]) - by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id DAA14343 - for <wlestes@localhost>; Sat, 5 May 2001 03:45:30 -0400 -Received: from imap.uncg.edu - by localhost with IMAP (fetchmail-5.1.0) - for wlestes@localhost (single-drop); Sat, 05 May 2001 03:45:30 -0400 (EDT) -Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70]) - by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f457R2q28664 - for <wlestes@hermes.email.uncg.edu>; Sat, 5 May 2001 03:27:02 -0400 (EDT) -Received: from fencepost.gnu.org (we-refuse-to-spy-on-our-users@fencepost.gnu.org [199.232.76.164]) - by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id DAA13852 - for <wlestes@uncg.edu>; Sat, 5 May 2001 03:27:02 -0400 (EDT) -Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) - by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian)) - id 14vwT0-0007qN-00 - for <wlestes@uncg.edu>; Sat, 05 May 2001 03:27:02 -0400 -Received: from daffy.ee.lbl.gov ([131.243.1.31]) - by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian)) - id 14vwQr-0007nj-00 - for <help-flex@gnu.org>; Sat, 05 May 2001 03:24:49 -0400 -Received: (from vern@localhost) - by daffy.ee.lbl.gov (8.10.0/8.10.0) id f457Ol523882; - Sat, 5 May 2001 00:24:47 -0700 (PDT) -Message-Id: <200105050724.f457Ol523882@daffy.ee.lbl.gov> -To: "John W. Millaway" <johnmillaway@yahoo.com> -Cc: help-flex@gnu.org -Subject: Re: Why is YY_BUF_SIZE not override-able? -In-reply-to: Your message of Fri, 04 May 2001 11:15:47 PDT. -From: Vern Paxson <vern@ee.lbl.gov> -Sender: help-flex-admin@gnu.org -Errors-To: help-flex-admin@gnu.org -X-BeenThere: help-flex@gnu.org -X-Mailman-Version: 2.0.3 -Precedence: bulk -List-Help: <mailto:help-flex-request@gnu.org?subject=help> -List-Post: <mailto:help-flex@gnu.org> -List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=subscribe> -List-Id: Users list for Flex, - the GNU lexical analyser generator <help-flex.gnu.org> -List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=unsubscribe> -List-Archive: <http://mail.gnu.org/pipermail/help-flex/> -Date: Sat, 05 May 2001 00:24:46 PDT - -*** EOOH *** -To: "John W. Millaway" <johnmillaway@yahoo.com> -Cc: help-flex@gnu.org -Subject: Re: Why is YY_BUF_SIZE not override-able? -In-reply-to: Your message of Fri, 04 May 2001 11:15:47 PDT. -From: Vern Paxson <vern@ee.lbl.gov> -Sender: help-flex-admin@gnu.org -Precedence: bulk -List-Help: <mailto:help-flex-request@gnu.org?subject=help> -List-Post: <mailto:help-flex@gnu.org> -List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=subscribe> -List-Id: Users list for Flex, - the GNU lexical analyser generator <help-flex.gnu.org> -List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=unsubscribe> -List-Archive: <http://mail.gnu.org/pipermail/help-flex/> -Date: Sat, 05 May 2001 00:24:46 PDT - -> Most everything can be overridden by the user. However the size of the input -> buffer, YY_BUF_SIZE, is fixed. Is there a reason why YY_BUF_SIZE can't be -> overridden? - -I don't remember offhand why I didn't make it redefinable, but note that -you can effect smaller buffer sizes using yy_create_buffer(). - - Vern - -_______________________________________________ -Help-flex mailing list -Help-flex@gnu.org -http://mail.gnu.org/mailman/listinfo/help-flex - - -1,, -X-Coding-System: nil -Mail-from: From help-flex-admin@gnu.org Mon May 21 05:59:38 2001 -Return-Path: <help-flex-admin@gnu.org> -Received: from localhost (localhost [127.0.0.1]) - by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id FAA13870 - for <wlestes@localhost>; Mon, 21 May 2001 05:59:38 -0400 -Received: from imap.uncg.edu - by localhost with IMAP (fetchmail-5.1.0) - for wlestes@localhost (single-drop); Mon, 21 May 2001 05:59:38 -0400 (EDT) -Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70]) - by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f4L9d5q15741 - for <wlestes@hermes.email.uncg.edu>; Mon, 21 May 2001 05:39:05 -0400 (EDT) -Received: from fencepost.gnu.org (we-refuse-to-spy-on-our-users@fencepost.gnu.org [199.232.76.164]) - by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id FAA22405 - for <wlestes@uncg.edu>; Mon, 21 May 2001 05:39:06 -0400 (EDT) -Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) - by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian)) - id 151m9W-000616-00 - for <wlestes@uncg.edu>; Mon, 21 May 2001 05:39:02 -0400 -Received: from [202.54.26.202] (helo=hindon.hss.co.in) - by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian)) - id 151m7z-0005xX-00 - for <help-flex@gnu.org>; Mon, 21 May 2001 05:37:27 -0400 -Received: from hsssun01.hss.hns.com (localhost [127.0.0.1]) - by hindon.hss.co.in (8.10.0/8.10.0) with ESMTP id f4L9cb501756 - for <help-flex@gnu.org>; Mon, 21 May 2001 15:08:38 +0530 (IST) -Received: from sampark.hss.hns.com (sampark [139.85.229.22]) - by hsssun01.hss.hns.com (8.10.0/8.10.0) with SMTP id f4L9kWY10057 - for <help-flex@gnu.org>; Mon, 21 May 2001 15:16:45 +0530 (IST) -Received: by sampark.hss.hns.com(Lotus SMTP MTA Internal build v4.6.2 (651.2 6-10-1998)) id 65256A53.0034A297 ; Mon, 21 May 2001 15:04:54 +0530 -X-Lotus-FromDomain: HSSBLR -From: kbinu@hss.hns.com -To: help-flex@gnu.org -cc: crajasri@hss.hns.com -Message-ID: <65256A53.0034A096.00@sampark.hss.hns.com> -Subject: Enhancements in flex for error handling -Mime-Version: 1.0 -Content-type: text/plain; charset=us-ascii -Content-Disposition: inline -Sender: help-flex-admin@gnu.org -Errors-To: help-flex-admin@gnu.org -X-BeenThere: help-flex@gnu.org -X-Mailman-Version: 2.0.3 -Precedence: bulk -List-Help: <mailto:help-flex-request@gnu.org?subject=help> -List-Post: <mailto:help-flex@gnu.org> -List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=subscribe> -List-Id: Users list for Flex, - the GNU lexical analyser generator <help-flex.gnu.org> -List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=unsubscribe> -List-Archive: <http://mail.gnu.org/pipermail/help-flex/> -Date: Mon, 21 May 2001 14:55:56 +0530 - -*** EOOH *** -From: kbinu@hss.hns.com -To: help-flex@gnu.org -cc: crajasri@hss.hns.com -Subject: Enhancements in flex for error handling -Sender: help-flex-admin@gnu.org -Precedence: bulk -List-Help: <mailto:help-flex-request@gnu.org?subject=help> -List-Post: <mailto:help-flex@gnu.org> -List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=subscribe> -List-Id: Users list for Flex, - the GNU lexical analyser generator <help-flex.gnu.org> -List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=unsubscribe> -List-Archive: <http://mail.gnu.org/pipermail/help-flex/> -Date: Mon, 21 May 2001 14:55:56 +0530 - - - - -Hi - We have been using flex generated scanners for a project. In our -application, we need to ensure that the application does not exit on system -errors including memory allocation failures. For errors that might occur -while the scanner allocates memory, we thought we would re-define -YY_FATAL_ERROR to something like -#define YY_FATAL_ERROR(x) return (error_indication=x, 0) -where error_indication is a global that I would check after the lexer -returns. This however is not feasible since YY_FATAL_ERROR is used in -functions called within yylex. Some of these do not return values. Also -yylex doesn't check if the called function encountered errors. -Is there any plan to enhance flex to return cleanly from yylex instead of -using exit() ? If not, any references on how to go about modifying the -skeleton scanner for this feature ? - --Binu - - - -_______________________________________________ -Help-flex mailing list -Help-flex@gnu.org -http://mail.gnu.org/mailman/listinfo/help-flex - - -1,, -X-Coding-System: nil -Mail-from: From help-flex-admin@gnu.org Mon May 21 12:35:41 2001 -Return-Path: <help-flex-admin@gnu.org> -Received: from localhost (localhost [127.0.0.1]) - by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id MAA14455 - for <wlestes@localhost>; Mon, 21 May 2001 12:35:41 -0400 -Received: from imap.uncg.edu - by localhost with IMAP (fetchmail-5.1.0) - for wlestes@localhost (single-drop); Mon, 21 May 2001 12:35:41 -0400 (EDT) -Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70]) - by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f4LGF4q14830 - for <wlestes@hermes.email.uncg.edu>; Mon, 21 May 2001 12:15:05 -0400 (EDT) -Received: from fencepost.gnu.org (we-refuse-to-spy-on-our-users@fencepost.gnu.org [199.232.76.164]) - by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id MAA05855 - for <wlestes@uncg.edu>; Mon, 21 May 2001 12:15:04 -0400 (EDT) -Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) - by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian)) - id 151sKm-0003HU-00 - for <wlestes@uncg.edu>; Mon, 21 May 2001 12:15:04 -0400 -Received: from web9407.mail.yahoo.com ([216.136.129.23]) - by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian)) - id 151sIL-0003CL-00 - for <help-flex@gnu.org>; Mon, 21 May 2001 12:12:33 -0400 -Message-ID: <20010521161232.55864.qmail@web9407.mail.yahoo.com> -Received: from [216.254.82.102] by web9407.mail.yahoo.com; Mon, 21 May 2001 09:12:32 PDT -From: "John W. Millaway" <johnmillaway@yahoo.com> -Subject: Re: Enhancements in flex for error handling -To: kbinu@hss.hns.com, help-flex@gnu.org -Cc: crajasri@hss.hns.com -In-Reply-To: <65256A53.0034A096.00@sampark.hss.hns.com> -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Sender: help-flex-admin@gnu.org -Errors-To: help-flex-admin@gnu.org -X-BeenThere: help-flex@gnu.org -X-Mailman-Version: 2.0.3 -Precedence: bulk -List-Help: <mailto:help-flex-request@gnu.org?subject=help> -List-Post: <mailto:help-flex@gnu.org> -List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=subscribe> -List-Id: Users list for Flex, - the GNU lexical analyser generator <help-flex.gnu.org> -List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=unsubscribe> -List-Archive: <http://mail.gnu.org/pipermail/help-flex/> -Date: Mon, 21 May 2001 09:12:32 -0700 (PDT) - -*** EOOH *** -From: "John W. Millaway" <johnmillaway@yahoo.com> -Subject: Re: Enhancements in flex for error handling -To: kbinu@hss.hns.com, help-flex@gnu.org -Cc: crajasri@hss.hns.com -In-Reply-To: <65256A53.0034A096.00@sampark.hss.hns.com> -Sender: help-flex-admin@gnu.org -Precedence: bulk -List-Help: <mailto:help-flex-request@gnu.org?subject=help> -List-Post: <mailto:help-flex@gnu.org> -List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=subscribe> -List-Id: Users list for Flex, - the GNU lexical analyser generator <help-flex.gnu.org> -List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=unsubscribe> -List-Archive: <http://mail.gnu.org/pipermail/help-flex/> -Date: Mon, 21 May 2001 09:12:32 -0700 (PDT) - -> using exit() ? If not, any references on how to go about modifying the -> skeleton scanner for this feature ? - -You might get away with something like this (without having to modify the skeleton -code): yyerror sets a flag, then resets the scanner, pointing the input to -/dev/null. -The parser will have to check the error flag, of course. - --John - - - - -__________________________________________________ -Do You Yahoo!? -Yahoo! Auctions - buy the things you want at great prices -http://auctions.yahoo.com/ - -_______________________________________________ -Help-flex mailing list -Help-flex@gnu.org -http://mail.gnu.org/mailman/listinfo/help-flex - - -1,, -X-Coding-System: nil -Mail-from: From help-flex-admin@gnu.org Mon Jun 4 11:26:56 2001 -Return-Path: <help-flex-admin@gnu.org> -Received: from localhost (localhost [127.0.0.1]) - by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id LAA07669 - for <wlestes@localhost>; Mon, 4 Jun 2001 11:26:55 -0400 -Received: from imap.uncg.edu - by localhost with IMAP (fetchmail-5.1.0) - for wlestes@localhost (single-drop); Mon, 04 Jun 2001 11:26:55 -0400 (EDT) -Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70]) - by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f54F63q16735 - for <wlestes@hermes.email.uncg.edu>; Mon, 4 Jun 2001 11:06:03 -0400 (EDT) -Received: from fencepost.gnu.org (we-refuse-to-spy-on-our-users@fencepost.gnu.org [199.232.76.164]) - by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id LAA00743 - for <wlestes@uncg.edu>; Mon, 4 Jun 2001 11:06:02 -0400 (EDT) -Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) - by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian)) - id 156vve-0003bF-00 - for <wlestes@uncg.edu>; Mon, 04 Jun 2001 11:06:02 -0400 -Received: from mx1.thebiz.net ([216.238.0.20]) - by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian)) - id 156vtP-0003Xd-00 - for <help-flex@gnu.org>; Mon, 04 Jun 2001 11:03:43 -0400 -Received: (qmail 14188 invoked from network); 4 Jun 2001 11:03:40 -0400 -Received: from mail2.backend.thebiz.net (HELO mail2.thebiz.net) (172.16.0.129) - by mx1.backend.thebiz.net with SMTP; 4 Jun 2001 11:03:40 -0400 -Received: (qmail 26039 invoked by uid 0); 4 Jun 2001 11:03:39 -0400 -Received: from unknown (HELO abit) (216.238.78.51) - by mail.ulster.net with SMTP; 4 Jun 2001 11:03:39 -0400 -Message-ID: <006701c0ed07$fcefc5a0$0400a8c0@abit> -From: "Bill Fenlason" <BillFen@Ulster.Net> -To: <help-flex@gnu.org> -Subject: FLEX <<EOF>> with yymore() token -MIME-Version: 1.0 -Content-Type: text/plain; - charset="iso-8859-1" -Content-Transfer-Encoding: 7bit -X-Priority: 3 -X-MSMail-Priority: Normal -X-Mailer: Microsoft Outlook Express 5.00.3018.1300 -X-MimeOLE: Produced By Microsoft MimeOLE V5.00.3018.1300 -Sender: help-flex-admin@gnu.org -Errors-To: help-flex-admin@gnu.org -X-BeenThere: help-flex@gnu.org -X-Mailman-Version: 2.0.3 -Precedence: bulk -List-Help: <mailto:help-flex-request@gnu.org?subject=help> -List-Post: <mailto:help-flex@gnu.org> -List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=subscribe> -List-Id: Users list for Flex, - the GNU lexical analyser generator <help-flex.gnu.org> -List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=unsubscribe> -List-Archive: <http://mail.gnu.org/pipermail/help-flex/> -Date: Mon, 4 Jun 2001 11:06:52 -0400 - -*** EOOH *** -From: "Bill Fenlason" <BillFen@Ulster.Net> -To: <help-flex@gnu.org> -Subject: FLEX <<EOF>> with yymore() token -Sender: help-flex-admin@gnu.org -Precedence: bulk -List-Help: <mailto:help-flex-request@gnu.org?subject=help> -List-Post: <mailto:help-flex@gnu.org> -List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=subscribe> -List-Id: Users list for Flex, - the GNU lexical analyser generator <help-flex.gnu.org> -List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=unsubscribe> -List-Archive: <http://mail.gnu.org/pipermail/help-flex/> -Date: Mon, 4 Jun 2001 11:06:52 -0400 - -I posted part of this question to comp.compilers, and John Millaway pointed -me here. Thanks John. I've read the archives but did not see this topic -discussed. - -In FLEX, the current buffer is flushed immediately when EOF is encountered, -even if it contains a token pushed by yymore(). That means that something -like: - <start_cond><<EOF>>{If (yyleng > 0) return(A_TOKEN) .... } -fails, because yyleng may be non-zero but yytext is null. The token is -copied to the start of the buffer but is then overwritten by the buffer -flush (via yyrestart). - -I modified the skeleton to check this out. If the call to yyrestart is -bypassed (OK in my case), the problem partly goes away. Is this a bug or an -unintended byproduct? - -The core issue relates to <<EOF>> and what actions after <<EOF>> are -allowed. <<EOF>> is logically a state rather than a token, and the null -return (after yywrap) makes perfect sense to me. The comment in the code -about a repeated call returning null again also makes sense, but it seems to -me that allowing the return of a residual token (pushed by yymore) would be -appropriate. I realize the difficulty in trying to allow <<EOF>> as right -context in a pattern, and I had hoped to accomplish the same thing via the -<<EOF>> rules. - -Currently at <<EOF>> yyleng is set to 1 plus the yymore length, and I would -propose that it should be set to the yymore length only (usually 0). The -scan has to rely on the trailing null in the buffer to identify the <<EOF>> -state, but should it be treated as an actual token? (In the case above I -needed to use --yyleng.) - -I understand the need to reset the buffer in case the user has changed yyin. - -The man page specifies that repeated calls after EOF are undefined. Would -defining them such that zero additional characters are matched and that null -is returned be an improvement? Should the calculation of yyleng at <<EOF>> -be changed? Should there be a change regarding the buffer flush to allow -the residual token to be returned? - -My case involves recognizing identifiers which may contain extralingual -characters defined at runtime. - -Thank you. - -Bill Fenlason - - - - -_______________________________________________ -Help-flex mailing list -Help-flex@gnu.org -http://mail.gnu.org/mailman/listinfo/help-flex - - -1, answered,, -X-Coding-System: nil -Mail-from: From BillFen@Ulster.Net Sun Jun 10 13:20:00 2001 -Return-Path: <BillFen@Ulster.Net> -Received: from localhost (localhost [127.0.0.1]) - by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id NAA02104 - for <wlestes@localhost>; Sun, 10 Jun 2001 13:20:00 -0400 -Received: from imap.uncg.edu - by localhost with IMAP (fetchmail-5.1.0) - for wlestes@localhost (single-drop); Sun, 10 Jun 2001 13:20:00 -0400 (EDT) -Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70]) - by hermes.uncg.edu (8.11.0/8.11.0) with ESMTP id f5AHIPs03250 - for <wlestes@hermes.email.uncg.edu>; Sun, 10 Jun 2001 13:18:25 -0400 (EDT) -Received: from mx1.thebiz.net (mx1.thebiz.net [216.238.0.20]) - by external-gw.uncg.edu (8.9.3/8.9.3) with SMTP id NAA27551 - for <wlestes@uncg.edu>; Sun, 10 Jun 2001 13:18:24 -0400 (EDT) -Received: (qmail 24543 invoked from network); 10 Jun 2001 13:18:24 -0400 -Received: from unknown (HELO mail2.thebiz.net) (172.16.0.129) - by mx1.backend.thebiz.net with SMTP; 10 Jun 2001 13:18:24 -0400 -Received: (qmail 29926 invoked by uid 0); 10 Jun 2001 13:18:23 -0400 -Received: from unknown (HELO abit) (216.238.78.51) - by mail.ulster.net with SMTP; 10 Jun 2001 13:18:23 -0400 -Message-ID: <00f301c0f1d1$bb1ef140$0400a8c0@abit> -From: "Bill Fenlason" <BillFen@Ulster.Net> -To: <wlestes@uncg.edu> -Subject: FLEX modifications -Date: Sun, 10 Jun 2001 13:21:02 -0400 -MIME-Version: 1.0 -Content-Type: text/plain; - charset="iso-8859-1" -Content-Transfer-Encoding: 7bit -X-Priority: 3 -X-MSMail-Priority: Normal -X-Mailer: Microsoft Outlook Express 5.00.3018.1300 -X-MimeOLE: Produced By Microsoft MimeOLE V5.00.3018.1300 - -*** EOOH *** -From: "Bill Fenlason" <BillFen@Ulster.Net> -To: <wlestes@uncg.edu> -Subject: FLEX modifications -Date: Sun, 10 Jun 2001 13:21:02 -0400 - -Hello Will, - -Are you currently the one responsible for FLEX development and maint? I saw -you pointed to in the FLEX help archives. - -Since no one has commented on my recent message regarding yymore() and -<<EOF>>, I though I would send you a note directly. - -Are you interested in a patch and documentation changes? I'll be happy to -develop them and send them to you. It will be some work for me since I -would want to be sure that everything is bulletproof. But I don't want to -spend the time on it if there is no agreement that the change is both needed -and wanted. - -The reason I'm implementing this is that the parser interface routine I'm -developing builds a token chain that includes tokens for missing ending -delimiters (comment ends, quotes, parens, etc, as well as include file end -identifiers. It is convenient to keep generating zero length tokens at -<<EOF>> to handle this, with the final YY_NULL being delayed until nothing -is outstanding or pushed with yymore(). Leaving repeated calls after EOF as -undefined and undocumented seems to me to be a loose end that might well be -clarified. I think that my approach makes sense in general, and had hoped -that others more experienced with FLEX would point out some pros and cons. - -I have some other topics to ask about along with some suggestions, and it -will be helpful to know if you are interested in this or other changes and -additions to FLEX. - -I'll be using a modified skeleton in any event so I'm not dependent (or -asking for) any "official" changes. But FLEX is a wonderful tool, and I -wouldn't mind contributing something to it if I am able to. - -Thanks. - -Bill Fenlason - -ps I assume that Vern is a very busy guy so I have not written to him. But -feel free to forward this to him if you think it appropriate. - - - - - -1, answered,, -Summary-line: 10-Jun BillFen@Ulster.Net [121] #Re: FLEX modifications -X-Coding-System: nil -Mail-from: From BillFen@Ulster.Net Sun Jun 10 20:30:13 2001 -Return-Path: <BillFen@Ulster.Net> -Received: from localhost (localhost [127.0.0.1]) - by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id UAA02667 - for <wlestes@localhost>; Sun, 10 Jun 2001 20:30:13 -0400 -Received: from imap.uncg.edu - by localhost with IMAP (fetchmail-5.1.0) - for wlestes@localhost (single-drop); Sun, 10 Jun 2001 20:30:13 -0400 (EDT) -Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70]) - by hermes.uncg.edu (8.11.0/8.11.0) with ESMTP id f5B0SGs07342 - for <wlestes@hermes.email.uncg.edu>; Sun, 10 Jun 2001 20:28:16 -0400 (EDT) -Received: from mx1.thebiz.net (mx1.thebiz.net [216.238.0.20]) - by external-gw.uncg.edu (8.9.3/8.9.3) with SMTP id UAA12568 - for <wlestes@uncg.edu>; Sun, 10 Jun 2001 20:28:17 -0400 (EDT) -Received: (qmail 24345 invoked from network); 10 Jun 2001 20:28:15 -0400 -Received: from unknown (HELO mail2.thebiz.net) (172.16.0.129) - by mx1.backend.thebiz.net with SMTP; 10 Jun 2001 20:28:15 -0400 -Received: (qmail 3989 invoked by uid 0); 10 Jun 2001 20:28:13 -0400 -Received: from unknown (HELO abit) (216.238.78.51) - by mail.ulster.net with SMTP; 10 Jun 2001 20:28:13 -0400 -Message-ID: <001201c0f20d$eb553360$0400a8c0@abit> -From: "Bill Fenlason" <BillFen@Ulster.Net> -To: "W. L. Estes" <wlestes@uncg.edu> -References: <00f301c0f1d1$bb1ef140$0400a8c0@abit> <200106101934.PAA02280@michael.uncg.edu> -Subject: Re: FLEX modifications -Date: Sun, 10 Jun 2001 20:31:55 -0400 -MIME-Version: 1.0 -Content-Type: text/plain; - charset="Windows-1252" -Content-Transfer-Encoding: 7bit -X-Priority: 3 -X-MSMail-Priority: Normal -X-Mailer: Microsoft Outlook Express 5.00.3018.1300 -X-MimeOLE: Produced By Microsoft MimeOLE V5.00.3018.1300 - -*** EOOH *** -From: "Bill Fenlason" <BillFen@Ulster.Net> -To: "W. L. Estes" <wlestes@uncg.edu> -Subject: Re: FLEX modifications -Date: Sun, 10 Jun 2001 20:31:55 -0400 - -Will, - -Thanks for responding, and for pointing out that I could keep track of the -paired delimiter state in the calling program - certainly a reasonable -question. - -I decided against that approach primarily because I didn't want to -complicate the calling program unnecessarily. I found that treating this as -a scanning function allowed the overall coding to be smaller and more -reasonable. For example, I handle nested comments, and the scanner needs to -use separate start conditions. The nesting level needs to be maintained for -that any way, so using additional calls after eof makes it really simple - I -just return the zero length "missing delimeter" tokens and decrease the -nesting level. When it reaches zero I go back to the base state and YY_NULL -is returned. All in all, trying to keep track in both places is a -duplication. - -But that does not explain the yymore() issue. The language I'm scanning -(PL/I) allows identifier name characters to be specified at runtime. The -feature is to support foreign language keyboards etc. So the problem is how -to scan them? I don't want to force the calling program to paste parts of a -word together, and I have to test any non conventional character (i.e. -128-255) to determine if it is a name character or not. My solution is to -yymore() each word, and either append a valid extralingual character or -return the word. Works great, except at EOF. I don't want to depend on a -trailing NL character, although it would be present almost all of the time. -(After 35 years of programming, I've learned the value of making things -bulletproof 8:-). - -Finally, the actions at eof I'm proposing just "feel right". I hope after -some reflection you come to the same conclusion. I'll be glad to go into -lots more detail in case you have any fine points to consider. - -The next few issues I have relate to providing assistance for unlimied -include file nesting, and how to assist with token location information -(yylineno and offset) without having the performance robbing rescan for NL. -Also I'd like to kick around some ideas related to gen.c and skeletons. - -Would you rather that I discuss these things with you directly, or should I -use the list? I don't know the balance between knowledgeable programmers -and developers, and users in the list membership. I would like a healthy -discussion on these ideas and questions but I wouldn't want to add -inappropriate things to the list. - -Thanks again - hope this is not taking too much of your time. - -Bill Fenlason - -ps. a snapshot would be great! - ------ Original Message ----- -From: W. L. Estes -To: BillFen@Ulster.Net -Sent: Sunday, June 10, 2001 3:34 PM -Subject: Re: FLEX modifications - - -> Are you currently the one responsible for FLEX development and maint? I -saw -> you pointed to in the FLEX help archives. - -yes. :) - -> Since no one has commented on my recent message regarding yymore() and -> <<EOF>>, I though I would send you a note directly. -> -> Are you interested in a patch and documentation changes? I'll be happy to -> develop them and send them to you. It will be some work for me since I -> would want to be sure that everything is bulletproof. But I don't want to -> spend the time on it if there is no agreement that the change is both -needed -> and wanted. - -On first reading of your message, I thought that I needed to think -about what you were asking. Unfortunately, you got put way down in the -queue. - -> The reason I'm implementing this is that the parser interface routine I'm -> developing builds a token chain that includes tokens for missing ending -> delimiters (comment ends, quotes, parens, etc, as well as include file end -> identifiers. It is convenient to keep generating zero length tokens at -> <<EOF>> to handle this, with the final YY_NULL being delayed until nothing -> is outstanding or pushed with yymore(). Leaving repeated calls after EOF -as -> undefined and undocumented seems to me to be a loose end that might well -be -> clarified. I think that my approach makes sense in general, and had hoped - -> that others more experienced with FLEX would point out some pros and cons. - -devil's advocate question: why not just keep track of your state and -compare: e.g. if (eof && !closed_delim_state)... - -> I have some other topics to ask about along with some suggestions, and it -> will be helpful to know if you are interested in this or other changes and -> additions to FLEX. - -I'm always interested in suggestions, patches etc. please note: i'm -not saying no to your idea above, i'm just asking you to explain it to -me better--because i'm not quite getting what you're saying. - -> I'll be using a modified skeleton in any event so I'm not dependent (or -> asking for) any "official" changes. But FLEX is a wonderful tool, and I -> wouldn't mind contributing something to it if I am able to. - -Certainly. If you'd like my current sources (which have migrated quite -a bit since Vern's last 2.5.4 release), let me know. you can have a -copy of the cvs repository or a snapshot of the current tree. - -and what is your need for a modified skeleton? (i.e. is that something -which might be of use to the general flex user?) - -> Thanks. - ---Will - - -1, answered,, -Summary-line: 15-Jun BillFen@Ulster.Net [66] #Re: FLEX modifications -X-Coding-System: nil -Mail-from: From BillFen@Ulster.Net Fri Jun 15 15:22:34 2001 -Return-Path: <BillFen@Ulster.Net> -Received: from localhost (localhost [127.0.0.1]) - by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id PAA05265 - for <wlestes@localhost>; Fri, 15 Jun 2001 15:22:33 -0400 -Received: from imap.uncg.edu - by localhost with IMAP (fetchmail-5.1.0) - for wlestes@localhost (single-drop); Fri, 15 Jun 2001 15:22:33 -0400 (EDT) -Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70]) - by hermes.uncg.edu (8.11.0/8.11.0) with ESMTP id f5FJKjs04809 - for <wlestes@hermes.email.uncg.edu>; Fri, 15 Jun 2001 15:20:45 -0400 (EDT) -Received: from mx3.thebiz.net (mx3.thebiz.net [216.238.0.22]) - by external-gw.uncg.edu (8.9.3/8.9.3) with SMTP id PAA05329 - for <wlestes@uncg.edu>; Fri, 15 Jun 2001 15:20:45 -0400 (EDT) -Received: (qmail 34351 invoked from network); 15 Jun 2001 15:19:39 -0400 -Received: from unknown (172.16.0.72) - by mx3.backend.thebiz.net with QMQP; 15 Jun 2001 15:19:39 -0400 -Received: from unknown (HELO abit) (216.238.78.36) - by mail.ulster.net with SMTP; 15 Jun 2001 15:19:39 -0400 -Message-ID: <001901c0f5d0$a7080fe0$0400a8c0@abit> -From: "Bill Fenlason" <BillFen@Ulster.Net> -To: "W. L. Estes" <wlestes@uncg.edu> -References: <00f301c0f1d1$bb1ef140$0400a8c0@abit> <200106101934.PAA02280@michael.uncg.edu> -Subject: Re: FLEX modifications -Date: Fri, 15 Jun 2001 15:23:25 -0400 -MIME-Version: 1.0 -Content-Type: text/plain; - charset="Windows-1252" -Content-Transfer-Encoding: 7bit -X-Priority: 3 -X-MSMail-Priority: Normal -X-Mailer: Microsoft Outlook Express 5.00.3018.1300 -X-MimeOLE: Produced By Microsoft MimeOLE V5.00.3018.1300 - -*** EOOH *** -From: "Bill Fenlason" <BillFen@Ulster.Net> -To: "W. L. Estes" <wlestes@uncg.edu> -Subject: Re: FLEX modifications -Date: Fri, 15 Jun 2001 15:23:25 -0400 - -Hello Will, - -I assume that you have not had time to get to my last note, or perhaps it is -just too far down in the queue. This one will keep it company 8-). - -There are two lines of code that I've added to the skeleton which seem to -solve the problem of repeated calls at end of file and the yymore() -situation. I'll briefly describe them so you can decide if you would like -to consider including them. - -This is below the yywrap() test, near: - case EOB_ACT_END_OF_FILE: - - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; - - yyleng = YY_MORE_ADJ; /* <== Added Line */ - -As the related comment described, yytext was carefully set up. This line -sets up yyleng as for a normal token. The value will be the length of any -yymore() token (normally zero), which is the difference between the -current buffer pointer and the current text pointer. The code after the -match -is made sets he length to one greater because of the double null EOB -marker. --yyleng will work as well. - -The second change is in the yy_get_next_buffer routine: - - ret_val = EOB_ACT_END_OF_FILE; - - /* <== Inserted if condition ==> */ - if ( yyin != yy_current_buffer->yy_input_file - || yy_current_buffer-> yy_buffer_status == YY_BUFFER_NEW) - - yyrestart( yyin ); - -It makes the restart conditional on a change of the yyin address or a newly -created buffer. It is not exactly the way I would like it, but it is not -unreasonable. - -I can understand the desire to allow the user to just reassign yyin within -an <<EOF>> rule, but I think the earlier version approach of requiring the -user to issue YY_NEW_FILE is more orderly. The philosophical issue is -if EOF is a persistent state or if a recall after it should automatically -imply that a new file is being provided. Both sides of the argument can -have -advantages for the user and I had hoped for some discussion of the point -in case there is something that I don't understand about it. - -I'm still testing and researching the code and will let you know if I find -anything else necessary - I need to more fully check the input() routine. I -spent a while checking both the skeleton logic and the various alternatives -generated within gen.c. Hopefully I didn't miss anything. . - -Bill Fenlason - - - - - - - - -1, answered,, -X-Coding-System: nil -Mail-from: From vern@daffy.ee.lbl.gov Sun Jun 17 03:08:59 2001 -Return-Path: <vern@daffy.ee.lbl.gov> -Received: from localhost (localhost [127.0.0.1]) - by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id DAA06939 - for <wlestes@localhost>; Sun, 17 Jun 2001 03:08:58 -0400 -Received: from imap.uncg.edu - by localhost with IMAP (fetchmail-5.1.0) - for wlestes@localhost (single-drop); Sun, 17 Jun 2001 03:08:58 -0400 (EDT) -Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70]) - by hermes.uncg.edu (8.11.0/8.11.0) with ESMTP id f5H76cs21638 - for <wlestes@hermes.email.uncg.edu>; Sun, 17 Jun 2001 03:06:38 -0400 (EDT) -Received: from daffy.ee.lbl.gov (daffy.ee.lbl.gov [131.243.1.31]) - by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id DAA19164 - for <wlestes@uncg.edu>; Sun, 17 Jun 2001 03:06:38 -0400 (EDT) -Received: (from vern@localhost) - by daffy.ee.lbl.gov (8.10.0/8.10.0) id f5H76So24900; - Sun, 17 Jun 2001 00:06:28 -0700 (PDT) -Message-Id: <200106170706.f5H76So24900@daffy.ee.lbl.gov> -To: Theo de Raadt <deraadt@cvs.openbsd.org> -Subject: Re: lex license -Cc: wlestes@uncg.edu -In-reply-to: Your message of Sat, 02 Jun 2001 13:15:37 PDT. -Date: Sun, 17 Jun 2001 00:06:28 PDT -From: Vern Paxson <vern@ee.lbl.gov> - -*** EOOH *** -To: Theo de Raadt <deraadt@cvs.openbsd.org> -Subject: Re: lex license -Cc: wlestes@uncg.edu -In-reply-to: Your message of Sat, 02 Jun 2001 13:15:37 PDT. -Date: Sun, 17 Jun 2001 00:06:28 PDT -From: Vern Paxson <vern@ee.lbl.gov> - -> Specifically, this license does not grant modification -> rights -- which must be explicitly granted under copyright law. - -Yes, this came up a while ago, and I put together a flex release with -a modified copyright that begins: - - Redistribution and use in source and binary forms, with or - without modification, are permitted provided that: - -However, that version didn't get fully integrated into the sources I sent -to Will. It's in the COPYING file but not in the individual source files, -just because I hadn't gotten around to it. - -Will, feel free to update the copyrights in each of the files with the -one in COPYING. - - Vern - - -1,, -X-Coding-System: nil -Mail-from: From help-flex-admin@gnu.org Sun Jun 17 13:08:17 2001 -Return-Path: <help-flex-admin@gnu.org> -Received: from localhost (localhost [127.0.0.1]) - by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id NAA08097 - for <wlestes@localhost>; Sun, 17 Jun 2001 13:08:17 -0400 -Received: from imap.uncg.edu - by localhost with IMAP (fetchmail-5.1.0) - for wlestes@localhost (single-drop); Sun, 17 Jun 2001 13:08:17 -0400 (EDT) -Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70]) - by hermes.uncg.edu (8.11.0/8.11.0) with ESMTP id f5HH62s28053 - for <wlestes@hermes.email.uncg.edu>; Sun, 17 Jun 2001 13:06:02 -0400 (EDT) -Received: from fencepost.gnu.org (we-refuse-to-spy-on-our-users@fencepost.gnu.org [199.232.76.164]) - by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id NAA09353 - for <wlestes@uncg.edu>; Sun, 17 Jun 2001 13:06:02 -0400 (EDT) -Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) - by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian)) - id 15Bfzu-0005ly-00 - for <wlestes@uncg.edu>; Sun, 17 Jun 2001 13:06:02 -0400 -Received: from web9406.mail.yahoo.com ([216.136.129.22]) - by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian)) - id 15BfxJ-0005iZ-00 - for <help-flex@gnu.org>; Sun, 17 Jun 2001 13:03:21 -0400 -Message-ID: <20010617170320.76960.qmail@web9406.mail.yahoo.com> -Received: from [205.197.108.252] by web9406.mail.yahoo.com; Sun, 17 Jun 2001 10:03:20 PDT -From: "John W. Millaway" <johnmillaway@yahoo.com> -Subject: Re: yylineno -To: Bill Fenlason <BillFen@Ulster.Net> -Cc: help-flex@gnu.org -In-Reply-To: <001601c0f6ce$b174eda0$0400a8c0@abit> -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Sender: help-flex-admin@gnu.org -Errors-To: help-flex-admin@gnu.org -X-BeenThere: help-flex@gnu.org -X-Mailman-Version: 2.0.5 -Precedence: bulk -List-Help: <mailto:help-flex-request@gnu.org?subject=help> -List-Post: <mailto:help-flex@gnu.org> -List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=subscribe> -List-Id: Users list for Flex, - the GNU lexical analyser generator <help-flex.gnu.org> -List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=unsubscribe> -List-Archive: <http://mail.gnu.org/pipermail/help-flex/> -Date: Sun, 17 Jun 2001 10:03:20 -0700 (PDT) - -*** EOOH *** -From: "John W. Millaway" <johnmillaway@yahoo.com> -Subject: Re: yylineno -To: Bill Fenlason <BillFen@Ulster.Net> -Cc: help-flex@gnu.org -In-Reply-To: <001601c0f6ce$b174eda0$0400a8c0@abit> -Sender: help-flex-admin@gnu.org -Precedence: bulk -List-Help: <mailto:help-flex-request@gnu.org?subject=help> -List-Post: <mailto:help-flex@gnu.org> -List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=subscribe> -List-Id: Users list for Flex, - the GNU lexical analyser generator <help-flex.gnu.org> -List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>, - <mailto:help-flex-request@gnu.org?subject=unsubscribe> -List-Archive: <http://mail.gnu.org/pipermail/help-flex/> -Date: Sun, 17 Jun 2001 10:03:20 -0700 (PDT) - -> How do you (or would you) keep track of the token offset within the line? -> - -By this, do you mean the "column"? If your tokens do not span lines, -then you can use yyleng. If the tokens do span lines, -then you have to rescan the token. Yuk! - -%% - /* This is untested code. But in the right spirit ! */ - static int yycol=0, next_col=0; - char* _p; - - /* Update yycol for tokens that do not contain '\n' */ - #define COL() yycol=next_col; next_col += yyleng - - /* Update yycol for tokens that may possibly contain '\n' */ - #define COLN() do{ \ - yycol=next_col; \ - for(_p=yytext; *_p; _p++,next_col++) \ - if( *_p == '\n' ) \ - next_col = -1; \ - }while(0) - - #define NEWL() yycol = next_col= 0 - -foo|bar { COL(); printf("%d: %s\n" , yycol, yytext); } -\n { NEWL(); printf("%d: NEWL\n", yycol); } -foo\nbar { COLN(); printf("%d: %s\n" , yycol, yytext); } - -%% - --John - - - -__________________________________________________ -Do You Yahoo!? -Spot the hottest trends in music, movies, and more. -http://buzz.yahoo.com/ - -_______________________________________________ -Help-flex mailing list -Help-flex@gnu.org -http://mail.gnu.org/mailman/listinfo/help-flex - - -1, answered,, -X-Coding-System: nil -Mail-from: From avn@any.ru Sun Jun 24 03:10:57 2001 -Return-Path: <avn@any.ru> -Received: from localhost (localhost [127.0.0.1]) - by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id DAA10135 - for <wlestes@localhost>; Sun, 24 Jun 2001 03:10:57 -0400 -Received: from imap.uncg.edu - by localhost with IMAP (fetchmail-5.1.0) - for wlestes@localhost (single-drop); Sun, 24 Jun 2001 03:10:57 -0400 (EDT) -Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70]) - by hermes.uncg.edu (8.11.0/8.11.0) with ESMTP id f5O78ts09193 - for <wlestes@hermes.email.uncg.edu>; Sun, 24 Jun 2001 03:08:55 -0400 (EDT) -Received: from ajax2.sovam.com (ajax2.sovam.com [194.67.1.173]) - by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id DAA15567 - for <wlestes@uncg.edu>; Sun, 24 Jun 2001 03:08:54 -0400 (EDT) -Received: from ts11-a1.dial.sovam.com ([195.239.68.1]:2044 "EHLO srv2.any" - ident: "TIMEDOUT" whoson: "-unregistered-" smtp-auth: <none> TLS-CIPHER: - <none> TLS-PEER: <none>) by ajax2.sovam.com with ESMTP - id <S426173AbRFXHIs>; Sun, 24 Jun 2001 11:08:48 +0400 -Received: from localhost (avn@localhost) - by srv2.any (8.11.3/8.11.3) with ESMTP id f5O7Adg89096 - for <wlestes@uncg.edu>; Sun, 24 Jun 2001 11:10:39 +0400 (MSD) - (envelope-from avn@any.ru) -Date: Sun, 24 Jun 2001 11:10:39 +0400 (MSD) -From: "Alexey V. Neyman" <avn@any.ru> -X-X-Sender: <avn@srv2.any> -To: <wlestes@uncg.edu> -Subject: lex generates files that give warnings with gcc -Message-ID: <20010624111019.R89058-100000@srv2.any> -MIME-Version: 1.0 -Content-Type: TEXT/PLAIN; charset=US-ASCII - -*** EOOH *** -Date: Sun, 24 Jun 2001 11:10:39 +0400 (MSD) -From: "Alexey V. Neyman" <avn@any.ru> -To: <wlestes@uncg.edu> -Subject: lex generates files that give warnings with gcc - -Hello! - -I compiled lex-produced files with 'gcc -Wconversion', and it gives -warnings about passing arguments to fread/fwrite as unsigned due to -function prototypes. This produces warnings when program is compiled -under suggested 'strict warnings' in FreeBSD, ${BDECFLAGS}. More, these -warnings point to .l file that was fed to lex. - -You can see detailed problem report, samples of failing code and a -proposed fix at: - -http://www.freebsd.org/cgi/query-pr.cgi?pr=28364 - -Regards, Alexey. -PS. Waiting for fix and for FreeBSD to import fixed :) - --- --------------------------------------------------+--------------------------- - We chose to leave when there was | Regards, Alexey V. Neyman - no longer a reason to stay. | mailto: avn@any.ru ----------------------------------( Arilou, SC2 )-+--------------------------- - - - - -1, answered,, -X-Coding-System: nil -Mail-from: From ashalper@usgs.gov Mon Jul 23 20:31:28 2001 -Return-Path: <ashalper@usgs.gov> -Received: from localhost (localhost [127.0.0.1]) - by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id UAA31191 - for <wlestes@localhost>; Mon, 23 Jul 2001 20:31:28 -0400 -Received: from imap.uncg.edu - by localhost with IMAP (fetchmail-5.1.0) - for wlestes@localhost (single-drop); Mon, 23 Jul 2001 20:31:28 -0400 (EDT) -Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70]) - by hermes.uncg.edu (8.11.0/8.11.0) with ESMTP id f6O0QmW26609 - for <wlestes@hermes.email.uncg.edu>; Mon, 23 Jul 2001 20:26:48 -0400 (EDT) -Received: from gsazflgm01.wr.usgs.gov (gsazflgm01.wr.usgs.gov [130.118.164.152]) - by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id UAA17843 - for <wlestes@uncg.edu>; Mon, 23 Jul 2001 20:26:47 -0400 (EDT) -Subject: Re: shared object libfl? -To: wlestes@uncg.edu -X-Mailer: Lotus Notes Release 5.0.1b September 30, 1999 -Message-ID: <OF7BEDABA3.AFD35C13-ON07256A92.00837F9F@wr.usgs.gov> -From: "Andrew S Halper" <ashalper@usgs.gov> -Date: Mon, 23 Jul 2001 16:56:52 -0700 -X-MIMETrack: Serialize by Router on gsazflgm01/SERVER/USGS/DOI(Release 5.0.7 |March 21, 2001) at - 07/23/2001 05:26:49 PM -MIME-Version: 1.0 -Content-type: text/plain; charset=us-ascii - -*** EOOH *** -Subject: Re: shared object libfl? -To: wlestes@uncg.edu -From: "Andrew S Halper" <ashalper@usgs.gov> -Date: Mon, 23 Jul 2001 16:56:52 -0700 - - ------ Forwarded by Andrew S Halper/WRD/USGS/DOI on 07/23/01 04:56 PM ----- - - Vern Paxson - <vern@ee.lbl. To: "Andrew S Halper" <ashalper@usgs.gov> - gov> cc: - Subject: Re: shared object libfl? - 07/23/01 - 05:15 PM - - - - - -> Is there any special reason a shared object library is not built by the -> flex source? Is there a 'configure' option to make one? - -Please send this to Will Estes (wlestes@uncg.edu), who has now taken over -flex maintenance and development. - - Thanks, - - Vern - - - - -1,, -X-Coding-System: nil -Mail-from: From johnmillaway@yahoo.com Thu Aug 16 11:11:13 2001 -Return-Path: <johnmillaway@yahoo.com> -Received: from localhost (localhost [127.0.0.1]) - by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id LAA22070 - for <wlestes@localhost>; Thu, 16 Aug 2001 11:11:13 -0400 -Received: from imap.uncg.edu - by localhost with IMAP (fetchmail-5.1.0) - for wlestes@localhost (single-drop); Thu, 16 Aug 2001 11:11:13 -0400 (EDT) -Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70]) - by hermes.uncg.edu (8.11.0/8.11.0) with ESMTP id f7GF5xW19868 - for <wlestes@hermes.email.uncg.edu>; Thu, 16 Aug 2001 11:05:59 -0400 (EDT) -Received: from web9405.mail.yahoo.com (web9405.mail.yahoo.com [216.136.129.111]) - by external-gw.uncg.edu (8.9.3/8.9.3) with SMTP id LAA07077 - for <wlestes@uncg.edu>; Thu, 16 Aug 2001 11:05:57 -0400 (EDT) -Message-ID: <20010816150558.37014.qmail@web9405.mail.yahoo.com> -Received: from [216.254.82.102] by web9405.mail.yahoo.com; Thu, 16 Aug 2001 08:05:58 PDT -Date: Thu, 16 Aug 2001 08:05:58 -0700 (PDT) -From: "John W. Millaway" <johnmillaway@yahoo.com> -Subject: Re: comments in lexical definitions -To: Tobias Ostgathe <ostgathe@tesionmail.de> -Cc: help-flex@gnu.org, Hans-Bernhard Broeker <broeker@physik.rwth-aachen.de>, - "W. L. Estes" <wlestes@uncg.edu> -In-Reply-To: <003301c1264e$0677bea0$2465e2c3@wuschtbix> -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii - -*** EOOH *** -Date: Thu, 16 Aug 2001 08:05:58 -0700 (PDT) -From: "John W. Millaway" <johnmillaway@yahoo.com> -Subject: Re: comments in lexical definitions -To: Tobias Ostgathe <ostgathe@tesionmail.de> -Cc: help-flex@gnu.org, Hans-Bernhard Broeker <broeker@physik.rwth-aachen.de>, - "W. L. Estes" <wlestes@uncg.edu> -In-Reply-To: <003301c1264e$0677bea0$2465e2c3@wuschtbix> - -> > > I'm missing the possibility to include comments in lexical definition - -Flex does allow comments everywhere you could possibly need them. This -discussion suggests a failure in the flex docs to make the syntax clear. What's -the trick, then? - -1. Use traditional C comments, not '//' comments. -2. INDENT THE COMMENT. - --John -(Exhaustive example follows) - -%{ - /* 1 */ -%} - /* 2 */ -%option reentrant -%x STATE_X - -%% - /* 3 */ -ruleA /* 4 */ { /* 5 */} -ruleB /* 6 */ ECHO; /* 7 */ - /* 8 */ -<STATE_X>{ -ruleC ECHO; - /* 9 */ -ruleD ECHO; -} - -%% -/* 10 */ - - - -__________________________________________________ -Do You Yahoo!? -Make international calls for as low as $.04/minute with Yahoo! Messenger -http://phonecard.yahoo.com/ - -
\ No newline at end of file diff --git a/to.do/streams.mail b/to.do/streams.mail deleted file mode 100644 index 0e6a093..0000000 --- a/to.do/streams.mail +++ /dev/null @@ -1,194 +0,0 @@ -Received: from 204.33.249.66 by ee.lbl.gov for <vern@ee.lbl.gov> (8.8.2/1.43r) - id SAA22776; Sun, 17 Nov 1996 18:18:35 -0800 (PST) -Received: by paradigm.webvision.com (940816.SGI.8.6.9/940406.SGI) - id SAA10316; Sun, 17 Nov 1996 18:18:10 -0800 -Date: Sun, 17 Nov 1996 18:18:10 -0800 -Message-Id: <199611180218.SAA10316@paradigm.webvision.com> -From: dave madden <dhm@paradigm.webvision.com> -To: vern@ee.lbl.gov -CC: jebossom@cognos.com -In-reply-to: <199611130423.UAA10645@daffy.ee.lbl.gov> (message from Vern - Paxson on Tue, 12 Nov 1996 20:23:35 PST) -Subject: Re: flex-2.5.3: wedging streams -Status: U - - =>Date: Tue, 12 Nov 1996 20:23:35 PST - =>From: Vern Paxson <vern@ee.lbl.gov> - => -[=>>from dhm@webvision.com] - =>> After poking around in the generated scanner, it looks like I need to - =>> be able to return a new code from yy_get_next_buffer (say - =>> EOB_ACT_TRY_AGAIN) that'll cause yylex() to remember where it is - =>> and return to its caller with a "no-token-available" indication. The - =>> next call of yylex( ) should recover the saved state and consequently - =>> retry yy_get_next_buffer( ) immediately. - => - =>This would be a nice feature to have. No one is working on it as far - =>as I know. John Bossom (jebossom@Cognos.COM) is working on reentrant - =>scanners, though, which have the entire scanning state encapsulated in - =>a single struct. - =>... - =>The trick of - =>course is in getting the state reset correctly. This is already done for - =>EOB_ACT_CONTINUE_SCAN (which then also advances the state machine using - =>yy_get_previous_state()), so you should be able to follow what it does. - -Well, I got it working. I added a flag and some state in the -yy_buffer_state structure to hold yy_bp and start_state, and some code -in gen.c and flex.skl to test the flag and do [what I hope is] the -right thing. The patches are appended. I wish I had time to do a -cleaner job of it (and thoroughly test it -- I dunno if it'll work -right when faced with strange buffer switching) but I'm in a bit of a -hurry... I did try it with both C and C++, though. If you're -interested, I'll clean up my test progs and send them as well. - -To use it, just define YY_WEDGE to be the token you want returned if -the input stream blocks, and (optionally) YY_IS_WEDGED( ) to be a -function returning a boolean. If you don't define YY_IS_WEDGED, the -default is to do "(errno==EWOULDBLOCK)". Then, if YY_INPUT returns 0 -and YY_IS_WEDGED( ) is true, yylex( ) will return YY_WEDGE. If -YY_WEDGE is not defined, almost all my code gets #ifdef'd out and you -get a regular parser. - -Regards, -d. - -diff -c flex-2.5.4.orig/flex.skl flex-2.5.4/flex.skl -*** flex-2.5.4.orig/flex.skl Tue Sep 10 16:58:54 1996 ---- flex-2.5.4/flex.skl Sun Nov 17 17:44:12 1996 -*************** -*** 111,116 **** ---- 111,117 ---- - #define EOB_ACT_CONTINUE_SCAN 0 - #define EOB_ACT_END_OF_FILE 1 - #define EOB_ACT_LAST_MATCH 2 -+ #define EOB_ACT_INPUT_BLOCKED 3 - - /* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This -*************** -*** 182,187 **** ---- 183,199 ---- - */ - int yy_is_interactive; - -+ /* -+ * Whether this input source returned EWOULDBLOCK on the last -+ * read, indicating that it's not finished, but that there are no -+ * data available now. (If this is set, the scanner will load its -+ * state from the yy_b_buf_p and yy_state rather than from -+ * its normal sources) -+ */ -+ int yy_blocked; -+ char *yy_b_buf_p; -+ void *yy_continue_state; -+ - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. -*************** -*** 634,639 **** ---- 646,660 ---- - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; -+ #ifdef YY_WEDGE -+ case EOB_ACT_INPUT_BLOCKED: -+ yy_current_buffer->yy_blocked = 1; -+ yy_current_buffer->yy_continue_state = (void *)(yy_start); -+ yy_current_buffer->yy_b_buf_p = yytext_ptr + YY_MORE_ADJ; -+ yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; -+ yy_hold_char = *yy_c_buf_p; -+ return YY_WEDGE; -+ #endif /* defined(YY_WEDGE) */ - } - break; - } -*************** -*** 735,740 **** ---- 756,762 ---- - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file -+ * EOB_ACT_INPUT_BLOCKED - YY_INPUT returned 0 and errno == EWOULDBLOCK - */ - - %- -*************** -*** 844,849 **** ---- 866,880 ---- - - if ( yy_n_chars == 0 ) - { -+ #ifdef YY_WEDGE -+ #ifndef YY_IS_WEDGED -+ #include <sys/errno.h> -+ #define YY_IS_WEDGED() (errno == EWOULDBLOCK) -+ #endif /* !defined(YY_IS_WEDGED) */ -+ if (YY_IS_WEDGED( )) { -+ ret_val = EOB_ACT_INPUT_BLOCKED; -+ } else -+ #endif /* defined(YY_WEDGE) */ - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; -*************** -*** 881,886 **** ---- 912,918 ---- - { - register yy_state_type yy_current_state; - register char *yy_cp; -+ char *yy_bp; - - %% code to get the start state into yy_current_state goes here - -*************** -*** 1215,1220 **** ---- 1247,1253 ---- - %+ - b->yy_is_interactive = 0; - %* -+ b->yy_blocked = 0; - } - - -diff -c flex-2.5.4.orig/gen.c flex-2.5.4/gen.c -*** flex-2.5.4.orig/gen.c Sat May 25 20:43:44 1996 ---- flex-2.5.4/gen.c Sun Nov 17 17:40:55 1996 -*************** -*** 750,755 **** ---- 750,770 ---- - - void gen_start_state() - { -+ outn( "#ifdef YY_WEDGE" ); -+ indent_puts( "if (yy_current_buffer->yy_blocked)" ); -+ indent_up( ); -+ indent_puts( "{" ); -+ indent_puts( "yy_current_buffer->yy_blocked = 0;" ); -+ indent_puts( -+ "yy_current_state = (yy_state_type)(yy_current_buffer->yy_continue_state);" ); -+ indent_puts( "yy_bp = yy_current_buffer->yy_b_buf_p;" ); -+ indent_puts( "}" ); -+ indent_down( ); -+ indent_puts( "else" ); -+ indent_up( ); -+ indent_puts( "{" ); -+ outn( "#endif /* defined(YY_WEDGE) */" ); -+ - if ( fullspd ) - { - if ( bol_needed ) -*************** -*** 776,781 **** ---- 791,800 ---- - indent_puts( "*yy_state_ptr++ = yy_current_state;" ); - } - } -+ outn( "#ifdef YY_WEDGE" ); -+ indent_puts( "}" ); -+ indent_down( ); -+ outn( "#endif /* defined(YY_WEDGE) */" ); - } - - diff --git a/to.do/unicode/FlexLexer.h b/to.do/unicode/FlexLexer.h deleted file mode 100644 index 1764112..0000000 --- a/to.do/unicode/FlexLexer.h +++ /dev/null @@ -1,195 +0,0 @@ -// $Header$ - -// FlexLexer.h -- define interfaces for lexical analyzer classes generated -// by flex - -// Copyright (c) 1993 The Regents of the University of California. -// All rights reserved. -// -// This code is derived from software contributed to Berkeley by -// Kent Williams and Tom Epperly. -// -// Redistribution and use in source and binary forms are permitted provided -// that: (1) source distributions retain this entire copyright notice and -// comment, and (2) distributions including binaries display the following -// acknowledgement: ``This product includes software developed by the -// University of California, Berkeley and its contributors'' in the -// documentation or other materials provided with the distribution and in -// all advertising materials mentioning features or use of this software. -// 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. - -// This file defines FlexLexer, an abstract class which specifies the -// external interface provided to flex C++ lexer objects, and yyFlexLexer, -// which defines a particular lexer class. -// -// If you want to create multiple lexer classes, you use the -P flag -// to rename each yyFlexLexer to some other xxFlexLexer. You then -// include <FlexLexer.h> in your other sources once per lexer class: -// -// #undef yyFlexLexer -// #define yyFlexLexer xxFlexLexer -// #include <FlexLexer.h> -// -// #undef yyFlexLexer -// #define yyFlexLexer zzFlexLexer -// #include <FlexLexer.h> -// ... -// -// Since this header is generic for all sizes of flex scanners, you must -// define the type YY_CHAR before including it: -// -// typedef xxx YY_CHAR; -// #include <FlexLexer.h> -// ... -// -// where xxx = char for 7-bit scanners, unsigned char for 8-bit, and -// wchar_t for 16-bit. - -#ifndef __FLEX_LEXER_H -// Never included before - need to define base class. -#define __FLEX_LEXER_H -#include <iostream.h> - -extern "C++" { - -struct yy_buffer_state; -typedef int yy_state_type; - -class FlexLexer { -public: - virtual ~FlexLexer() { } - - const YY_CHAR* YYText() { return yytext; } - int YYLeng() { return yyleng; } - - virtual void - yy_switch_to_buffer( struct yy_buffer_state* new_buffer ) = 0; - virtual struct yy_buffer_state* - yy_create_buffer( istream* s, int size ) = 0; - virtual void yy_delete_buffer( struct yy_buffer_state* b ) = 0; - virtual void yyrestart( istream* s ) = 0; - - virtual int yylex() = 0; - - // Call yylex with new input/output sources. - int yylex( istream* new_in, ostream* new_out = 0 ) - { - switch_streams( new_in, new_out ); - return yylex(); - } - - // Switch to new input/output streams. A nil stream pointer - // indicates "keep the current one". - virtual void switch_streams( istream* new_in = 0, - ostream* new_out = 0 ) = 0; - - int lineno() const { return yylineno; } - - int debug() const { return yy_flex_debug; } - void set_debug( int flag ) { yy_flex_debug = flag; } - -protected: - YY_CHAR* yytext; - int yyleng; - int yylineno; // only maintained if you use %option yylineno - int yy_flex_debug; // only has effect with -d or "%option debug" -}; - -} -#endif - -#if defined(yyFlexLexer) || ! defined(yyFlexLexerOnce) -// Either this is the first time through (yyFlexLexerOnce not defined), -// or this is a repeated include to define a different flavor of -// yyFlexLexer, as discussed in the flex man page. -#define yyFlexLexerOnce - -class yyFlexLexer : public FlexLexer { -public: - // arg_yyin and arg_yyout default to the cin and cout, but we - // only make that assignment when initializing in yylex(). - yyFlexLexer( istream* arg_yyin = 0, ostream* arg_yyout = 0 ); - - virtual ~yyFlexLexer(); - - void yy_switch_to_buffer( struct yy_buffer_state* new_buffer ); - struct yy_buffer_state* yy_create_buffer( istream* s, int size ); - void yy_delete_buffer( struct yy_buffer_state* b ); - void yyrestart( istream* s ); - - virtual int yylex(); - virtual void switch_streams( istream* new_in, ostream* new_out ); - -protected: - virtual int LexerInput( YY_CHAR* buf, int max_size ); - virtual void LexerOutput( const YY_CHAR* buf, int size ); - virtual void LexerError( const char* msg ); - - void yyunput( int c, YY_CHAR* buf_ptr ); - int yyinput(); - - void yy_load_buffer_state(); - void yy_init_buffer( struct yy_buffer_state* b, istream* s ); - void yy_flush_buffer( struct yy_buffer_state* b ); - - int yy_start_stack_ptr; - int yy_start_stack_depth; - int* yy_start_stack; - - void yy_push_state( int new_state ); - void yy_pop_state(); - int yy_top_state(); - - yy_state_type yy_get_previous_state(); - yy_state_type yy_try_NUL_trans( yy_state_type current_state ); - int yy_get_next_buffer(); - - istream* yyin; // input source for default LexerInput - ostream* yyout; // output sink for default LexerOutput - - struct yy_buffer_state* yy_current_buffer; - - // yy_hold_char holds the character lost when yytext is formed. - YY_CHAR yy_hold_char; - - // Number of characters read into yy_ch_buf. - int yy_n_chars; - - // Points to current character in buffer. - YY_CHAR* yy_c_buf_p; - - int yy_init; // whether we need to initialize - int yy_start; // start state number - - // Flag which is used to allow yywrap()'s to do buffer switches - // instead of setting up a fresh yyin. A bit of a hack ... - int yy_did_buffer_switch_on_eof; - - // The following are not always needed, but may be depending - // on use of certain flex features (like REJECT or yymore()). - - yy_state_type yy_last_accepting_state; - YY_CHAR* yy_last_accepting_cpos; - - yy_state_type* yy_state_buf; - yy_state_type* yy_state_ptr; - - YY_CHAR* yy_full_match; - int* yy_full_state; - int yy_full_lp; - - int yy_lp; - int yy_looking_for_trail_begin; - - int yy_more_flag; - int yy_more_len; - int yy_more_offset; - int yy_prev_more_offset; -}; - -#endif diff --git a/to.do/unicode/ccl.c b/to.do/unicode/ccl.c deleted file mode 100644 index 1bfc1d5..0000000 --- a/to.do/unicode/ccl.c +++ /dev/null @@ -1,149 +0,0 @@ -/* ccl - routines for character classes */ - -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Vern Paxson. - * - * The United States Government has rights in this work pursuant - * to contract no. DE-AC03-76SF00098 between the United States - * Department of Energy and the University of California. - * - * Redistribution and use in source and binary forms are permitted provided - * that: (1) source distributions retain this entire copyright notice and - * comment, and (2) distributions including binaries display the following - * acknowledgement: ``This product includes software developed by the - * University of California, Berkeley and its contributors'' in the - * documentation or other materials provided with the distribution and in - * all advertising materials mentioning features or use of this software. - * 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. - */ - -/* $Header$ */ - -#include "flexdef.h" - -/* ccladd - add a single character to a ccl */ - -void ccladd( cclp, ch ) -int cclp; -int ch; - { - int ind, len, newpos, i; - - check_char( ch ); - - len = ccllen[cclp]; - ind = cclmap[cclp]; - - /* check to see if the character is already in the ccl */ - - for ( i = 0; i < len; ++i ) - if ( ccltbl[ind + i] == ch ) - return; - - newpos = ind + len; - - if ( newpos >= current_max_ccl_tbl_size ) - { - current_max_ccl_tbl_size += MAX_CCL_TBL_SIZE_INCREMENT; - - ++num_reallocs; - - ccltbl = reallocate_wchar_array( ccltbl, - current_max_ccl_tbl_size ); - } - - ccllen[cclp] = len + 1; - ccltbl[newpos] = ch; - } - - -/* cclinit - return an empty ccl */ - -int cclinit() - { - if ( ++lastccl >= current_maxccls ) - { - current_maxccls += MAX_CCLS_INCREMENT; - - ++num_reallocs; - - cclmap = reallocate_integer_array( cclmap, current_maxccls ); - ccllen = reallocate_integer_array( ccllen, current_maxccls ); - cclng = reallocate_integer_array( cclng, current_maxccls ); - } - - if ( lastccl == 1 ) - /* we're making the first ccl */ - cclmap[lastccl] = 0; - - else - /* The new pointer is just past the end of the last ccl. - * Since the cclmap points to the \first/ character of a - * ccl, adding the length of the ccl to the cclmap pointer - * will produce a cursor to the first free space. - */ - cclmap[lastccl] = cclmap[lastccl - 1] + ccllen[lastccl - 1]; - - ccllen[lastccl] = 0; - cclng[lastccl] = 0; /* ccl's start out life un-negated */ - - return lastccl; - } - - -/* cclnegate - negate the given ccl */ - -void cclnegate( cclp ) -int cclp; - { - cclng[cclp] = 1; - } - - -/* list_character_set - list the members of a set of characters in CCL form - * - * Writes to the given file a character-class representation of those - * characters present in the given CCL. A character is present if it - * has a non-zero value in the cset array. - */ - -void list_character_set( file, cset ) -FILE *file; -int cset[]; - { - register int i; - - putc( '[', file ); - - for ( i = 0; i < csize; ++i ) - { - if ( cset[i] ) - { - register int start_char = i; - - putc( ' ', file ); - - fputs( readable_form( i ), file ); - - while ( ++i < csize && cset[i] ) - ; - - if ( i - 1 > start_char ) - /* this was a run */ - fprintf( file, "-%s", readable_form( i - 1 ) ); - - putc( ' ', file ); - } - } - - putc( ']', file ); - } diff --git a/to.do/unicode/changes.txt b/to.do/unicode/changes.txt deleted file mode 100644 index 4d8ab37..0000000 --- a/to.do/unicode/changes.txt +++ /dev/null @@ -1,102 +0,0 @@ -Summary of changes for flex Unicode support - -- ccl.c - - ccladd() - - changed call to reallocate_Character_array to reallocate_wchar_array - -- ecs.c - - mkeccl() - - changed type of ccls from Char to wchar_t - -- flex.1 - - added description of -U option - - added extra qualifier to -Ca option regarding usage with -U - - modified -C, -Cf, and -CF options regarding usage with -U - -- flex.skl - - changed all references of char (except error messages) to YY_CHAR - - added new insertion point for defining YY_CHAR and YY_SC_TO_UI() - - yy_scan_bytes() - - renamed to yy_scan_chars to avoid confusion with 2-byte chars - - renamed param bytes to chars - - ECHO - - redefined C version as fwrite(yytext, sizeof(YY_CHAR), yyleng, yyout) - - YY_INPUT - - removed char* cast on param buf of C++ version - - yyFlexLexer::LexerInput() - - changed get() call to read((unsigned char *) buf, sizeof(YY_CHAR)) - - changed read() call to read((unsigned char *) buf, max_size * - sizeof(YY_CHAR)) - - changed gcount() call to gcount() / sizeof(YY_CHAR) - - yyFlexLexer::LexerOutput() - - changed write() call to write((unsigned char *) buf, size * - sizeof(YY_CHAR)) - - yy_get_next_buffer() - - yy_flex_realloc() call - - changed param b->yy_buf_size + 2 to - (b->yy_buf_size + 2) * sizeof(YY_CHAR) - - input() and yyFlexLexer::yyinput() - - changed line c = *(unsigned char *) yy_c_buf_p; to - c = YY_SC_TO_UI(*yy_c_buf_p); - -- flexdef.h - - defined CSIZE as 65536 - - changed myesc() proto to return int - - changed type of ccltbl from Char * to wchar_t * - - added allocate_wchar_array() and reallocate_wchar_array() macros - - changed mkeccl() proto's first param to wchar_t[] - - changed cshell() proto's first param to wchar_t[] - - -- FlexLexer.h - - changed all references of char (except error messages) to YY_CHAR - - added description about typedef'ing YY_CHAR before inclusion - -- gen.c - - changed appropriate references of char in output strings to YY_CHAR - - added C_uchar_decl and C_ushort_decl for 16-bit yy_ec type bump-down - - genecs() - - added code for 16-bit yy_ec type bump; -Ca bumps type to long - - make_tables() - - YY_INPUT - - read redefined as read(..., max_size * sizeof(YY_CHAR)) - - added code to use getwc() and WEOF for 16-bit interactive - - fread redefined as fread(buf, sizeof(YY_CHAR), max_size, yyin) - -- main.c - - changed type of ccltbl from Char * to wchar_t * - - check_options() - - changed default csize from CSIZE to 256 due to redef of CSIZE - - added code to check for options incompatible with -U - - added code to ouput typedef of YY_CHAR to skeleton, plus extra call to - skelout() to get down to original insertion point - - flexend() - - added code to print "U" when printing stats - - flexinit() - - added code set csize for option -U - - changed assignment of csize in option -8 from CSIZE to 256 due to redef - of CSIZE - - readin() - - changed appropriate references of char in output strings to YY_CHAR - - removed output of YY_CHAR typedef; now located in check_options() - - usage() - - added fprintf for -U usage - -- misc.c - - check_char() - - added code to distinguish chars needing -8 and -U flags - - cshell() - - changed type of v from Char to wchar_t - - changed type of k from Char to wchar_t - - myesc() - - now returns an int to handle 16-bit escape sequences - - changed esc_char from Char to unsigned int as per htoi() and otoi() - -- scan.l - - changed ESCSEQ to accept 6 digit octal escapes and 4 digit hex escapes - - removed myesc() and ndlookup() protos - - added option "16bit" - -- tblcmp.c - - mktemplate - - changed type of transset from Char to wchar_t diff --git a/to.do/unicode/ecs.c b/to.do/unicode/ecs.c deleted file mode 100644 index 5c70191..0000000 --- a/to.do/unicode/ecs.c +++ /dev/null @@ -1,225 +0,0 @@ -/* ecs - equivalence class routines */ - -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Vern Paxson. - * - * The United States Government has rights in this work pursuant - * to contract no. DE-AC03-76SF00098 between the United States - * Department of Energy and the University of California. - * - * Redistribution and use in source and binary forms are permitted provided - * that: (1) source distributions retain this entire copyright notice and - * comment, and (2) distributions including binaries display the following - * acknowledgement: ``This product includes software developed by the - * University of California, Berkeley and its contributors'' in the - * documentation or other materials provided with the distribution and in - * all advertising materials mentioning features or use of this software. - * 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. - */ - -/* $Header$ */ - -#include "flexdef.h" - -/* ccl2ecl - convert character classes to set of equivalence classes */ - -void ccl2ecl() - { - int i, ich, newlen, cclp, ccls, cclmec; - - for ( i = 1; i <= lastccl; ++i ) - { - /* We loop through each character class, and for each character - * in the class, add the character's equivalence class to the - * new "character" class we are creating. Thus when we are all - * done, character classes will really consist of collections - * of equivalence classes - */ - - newlen = 0; - cclp = cclmap[i]; - - for ( ccls = 0; ccls < ccllen[i]; ++ccls ) - { - ich = ccltbl[cclp + ccls]; - cclmec = ecgroup[ich]; - - if ( cclmec > 0 ) - { - ccltbl[cclp + newlen] = cclmec; - ++newlen; - } - } - - ccllen[i] = newlen; - } - } - - -/* cre8ecs - associate equivalence class numbers with class members - * - * fwd is the forward linked-list of equivalence class members. bck - * is the backward linked-list, and num is the number of class members. - * - * Returned is the number of classes. - */ - -int cre8ecs( fwd, bck, num ) -int fwd[], bck[], num; - { - int i, j, numcl; - - numcl = 0; - - /* Create equivalence class numbers. From now on, ABS( bck(x) ) - * is the equivalence class number for object x. If bck(x) - * is positive, then x is the representative of its equivalence - * class. - */ - for ( i = 1; i <= num; ++i ) - if ( bck[i] == NIL ) - { - bck[i] = ++numcl; - for ( j = fwd[i]; j != NIL; j = fwd[j] ) - bck[j] = -numcl; - } - - return numcl; - } - - -/* mkeccl - update equivalence classes based on character class xtions - * - * synopsis - * Char ccls[]; - * int lenccl, fwd[llsiz], bck[llsiz], llsiz, NUL_mapping; - * void mkeccl( Char ccls[], int lenccl, int fwd[llsiz], int bck[llsiz], - * int llsiz, int NUL_mapping ); - * - * ccls contains the elements of the character class, lenccl is the - * number of elements in the ccl, fwd is the forward link-list of equivalent - * characters, bck is the backward link-list, and llsiz size of the link-list. - * - * NUL_mapping is the value which NUL (0) should be mapped to. - */ - -void mkeccl( ccls, lenccl, fwd, bck, llsiz, NUL_mapping ) -wchar_t ccls[]; -int lenccl, fwd[], bck[], llsiz, NUL_mapping; - { - int cclp, oldec, newec; - int cclm, i, j; - static unsigned char cclflags[CSIZE]; /* initialized to all '\0' */ - - /* Note that it doesn't matter whether or not the character class is - * negated. The same results will be obtained in either case. - */ - - cclp = 0; - - while ( cclp < lenccl ) - { - cclm = ccls[cclp]; - - if ( NUL_mapping && cclm == 0 ) - cclm = NUL_mapping; - - oldec = bck[cclm]; - newec = cclm; - - j = cclp + 1; - - for ( i = fwd[cclm]; i != NIL && i <= llsiz; i = fwd[i] ) - { /* look for the symbol in the character class */ - for ( ; j < lenccl; ++j ) - { - register int ccl_char; - - if ( NUL_mapping && ccls[j] == 0 ) - ccl_char = NUL_mapping; - else - ccl_char = ccls[j]; - - if ( ccl_char > i ) - break; - - if ( ccl_char == i && ! cclflags[j] ) - { - /* We found an old companion of cclm - * in the ccl. Link it into the new - * equivalence class and flag it as - * having been processed. - */ - - bck[i] = newec; - fwd[newec] = i; - newec = i; - /* Set flag so we don't reprocess. */ - cclflags[j] = 1; - - /* Get next equivalence class member. */ - /* continue 2 */ - goto next_pt; - } - } - - /* Symbol isn't in character class. Put it in the old - * equivalence class. - */ - - bck[i] = oldec; - - if ( oldec != NIL ) - fwd[oldec] = i; - - oldec = i; - - next_pt: ; - } - - if ( bck[cclm] != NIL || oldec != bck[cclm] ) - { - bck[cclm] = NIL; - fwd[oldec] = NIL; - } - - fwd[newec] = NIL; - - /* Find next ccl member to process. */ - - for ( ++cclp; cclflags[cclp] && cclp < lenccl; ++cclp ) - { - /* Reset "doesn't need processing" flag. */ - cclflags[cclp] = 0; - } - } - } - - -/* mkechar - create equivalence class for single character */ - -void mkechar( tch, fwd, bck ) -int tch, fwd[], bck[]; - { - /* If until now the character has been a proper subset of - * an equivalence class, break it away to create a new ec - */ - - if ( fwd[tch] != NIL ) - bck[fwd[tch]] = bck[tch]; - - if ( bck[tch] != NIL ) - fwd[bck[tch]] = fwd[tch]; - - fwd[tch] = NIL; - bck[tch] = NIL; - } diff --git a/to.do/unicode/flex.1 b/to.do/unicode/flex.1 deleted file mode 100644 index 545c58f..0000000 --- a/to.do/unicode/flex.1 +++ /dev/null @@ -1,4099 +0,0 @@ -.TH FLEX 1 "April 1995" "Version 2.5" -.SH NAME -flex \- fast lexical analyzer generator -.SH SYNOPSIS -.B flex -.B [\-bcdfhilnpstvwBFILTV78+? \-C[aefFmr] \-ooutput \-Pprefix \-Sskeleton] -.B [\-\-help \-\-version] -.I [filename ...] -.SH OVERVIEW -This manual describes -.I flex, -a tool for generating programs that perform pattern-matching on text. The -manual includes both tutorial and reference sections: -.nf - - Description - a brief overview of the tool - - Some Simple Examples - - Format Of The Input File - - Patterns - the extended regular expressions used by flex - - How The Input Is Matched - the rules for determining what has been matched - - Actions - how to specify what to do when a pattern is matched - - The Generated Scanner - details regarding the scanner that flex produces; - how to control the input source - - Start Conditions - introducing context into your scanners, and - managing "mini-scanners" - - Multiple Input Buffers - how to manipulate multiple input sources; how to - scan from strings instead of files - - End-of-file Rules - special rules for matching the end of the input - - Miscellaneous Macros - a summary of macros available to the actions - - Values Available To The User - a summary of values available to the actions - - Interfacing With Yacc - connecting flex scanners together with yacc parsers - - Options - flex command-line options, and the "%option" - directive - - Performance Considerations - how to make your scanner go as fast as possible - - Generating C++ Scanners - the (experimental) facility for generating C++ - scanner classes - - Incompatibilities With Lex And POSIX - how flex differs from AT&T lex and the POSIX lex - standard - - Diagnostics - those error messages produced by flex (or scanners - it generates) whose meanings might not be apparent - - Files - files used by flex - - Deficiencies / Bugs - known problems with flex - - See Also - other documentation, related tools - - Author - includes contact information - -.fi -.SH DESCRIPTION -.I flex -is a tool for generating -.I scanners: -programs which recognized lexical patterns in text. -.I flex -reads -the given input files, or its standard input if no file names are given, -for a description of a scanner to generate. The description is in -the form of pairs -of regular expressions and C code, called -.I rules. flex -generates as output a C source file, -.B lex.yy.c, -which defines a routine -.B yylex(). -This file is compiled and linked with the -.B \-lfl -library to produce an executable. When the executable is run, -it analyzes its input for occurrences -of the regular expressions. Whenever it finds one, it executes -the corresponding C code. -.SH SOME SIMPLE EXAMPLES -.PP -First some simple examples to get the flavor of how one uses -.I flex. -The following -.I flex -input specifies a scanner which whenever it encounters the string -"username" will replace it with the user's login name: -.nf - - %% - username printf( "%s", getlogin() ); - -.fi -By default, any text not matched by a -.I flex -scanner -is copied to the output, so the net effect of this scanner is -to copy its input file to its output with each occurrence -of "username" expanded. -In this input, there is just one rule. "username" is the -.I pattern -and the "printf" is the -.I action. -The "%%" marks the beginning of the rules. -.PP -Here's another simple example: -.nf - - int num_lines = 0, num_chars = 0; - - %% - \\n ++num_lines; ++num_chars; - . ++num_chars; - - %% - main() - { - yylex(); - printf( "# of lines = %d, # of chars = %d\\n", - num_lines, num_chars ); - } - -.fi -This scanner counts the number of characters and the number -of lines in its input (it produces no output other than the -final report on the counts). The first line -declares two globals, "num_lines" and "num_chars", which are accessible -both inside -.B yylex() -and in the -.B main() -routine declared after the second "%%". There are two rules, one -which matches a newline ("\\n") and increments both the line count and -the character count, and one which matches any character other than -a newline (indicated by the "." regular expression). -.PP -A somewhat more complicated example: -.nf - - /* scanner for a toy Pascal-like language */ - - %{ - /* need this for the call to atof() below */ - #include <math.h> - %} - - DIGIT [0-9] - ID [a-z][a-z0-9]* - - %% - - {DIGIT}+ { - printf( "An integer: %s (%d)\\n", yytext, - atoi( yytext ) ); - } - - {DIGIT}+"."{DIGIT}* { - printf( "A float: %s (%g)\\n", yytext, - atof( yytext ) ); - } - - if|then|begin|end|procedure|function { - printf( "A keyword: %s\\n", yytext ); - } - - {ID} printf( "An identifier: %s\\n", yytext ); - - "+"|"-"|"*"|"/" printf( "An operator: %s\\n", yytext ); - - "{"[^}\\n]*"}" /* eat up one-line comments */ - - [ \\t\\n]+ /* eat up whitespace */ - - . printf( "Unrecognized character: %s\\n", yytext ); - - %% - - main( argc, argv ) - int argc; - char **argv; - { - ++argv, --argc; /* skip over program name */ - if ( argc > 0 ) - yyin = fopen( argv[0], "r" ); - else - yyin = stdin; - - yylex(); - } - -.fi -This is the beginnings of a simple scanner for a language like -Pascal. It identifies different types of -.I tokens -and reports on what it has seen. -.PP -The details of this example will be explained in the following -sections. -.SH FORMAT OF THE INPUT FILE -The -.I flex -input file consists of three sections, separated by a line with just -.B %% -in it: -.nf - - definitions - %% - rules - %% - user code - -.fi -The -.I definitions -section contains declarations of simple -.I name -definitions to simplify the scanner specification, and declarations of -.I start conditions, -which are explained in a later section. -.PP -Name definitions have the form: -.nf - - name definition - -.fi -The "name" is a word beginning with a letter or an underscore ('_') -followed by zero or more letters, digits, '_', or '-' (dash). -The definition is taken to begin at the first non-white-space character -following the name and continuing to the end of the line. -The definition can subsequently be referred to using "{name}", which -will expand to "(definition)". For example, -.nf - - DIGIT [0-9] - ID [a-z][a-z0-9]* - -.fi -defines "DIGIT" to be a regular expression which matches a -single digit, and -"ID" to be a regular expression which matches a letter -followed by zero-or-more letters-or-digits. -A subsequent reference to -.nf - - {DIGIT}+"."{DIGIT}* - -.fi -is identical to -.nf - - ([0-9])+"."([0-9])* - -.fi -and matches one-or-more digits followed by a '.' followed -by zero-or-more digits. -.PP -The -.I rules -section of the -.I flex -input contains a series of rules of the form: -.nf - - pattern action - -.fi -where the pattern must be unindented and the action must begin -on the same line. -.PP -See below for a further description of patterns and actions. -.PP -Finally, the user code section is simply copied to -.B lex.yy.c -verbatim. -It is used for companion routines which call or are called -by the scanner. The presence of this section is optional; -if it is missing, the second -.B %% -in the input file may be skipped, too. -.PP -In the definitions and rules sections, any -.I indented -text or text enclosed in -.B %{ -and -.B %} -is copied verbatim to the output (with the %{}'s removed). -The %{}'s must appear unindented on lines by themselves. -.PP -In the rules section, -any indented or %{} text appearing before the -first rule may be used to declare variables -which are local to the scanning routine and (after the declarations) -code which is to be executed whenever the scanning routine is entered. -Other indented or %{} text in the rule section is still copied to the output, -but its meaning is not well-defined and it may well cause compile-time -errors (this feature is present for -.I POSIX -compliance; see below for other such features). -.PP -In the definitions section (but not in the rules section), -an unindented comment (i.e., a line -beginning with "/*") is also copied verbatim to the output up -to the next "*/". -.SH PATTERNS -The patterns in the input are written using an extended set of regular -expressions. These are: -.nf - - x match the character 'x' - . any character (byte) except newline - [xyz] a "character class"; in this case, the pattern - matches either an 'x', a 'y', or a 'z' - [abj-oZ] a "character class" with a range in it; matches - an 'a', a 'b', any letter from 'j' through 'o', - or a 'Z' - [^A-Z] a "negated character class", i.e., any character - but those in the class. In this case, any - character EXCEPT an uppercase letter. - [^A-Z\\n] any character EXCEPT an uppercase letter or - a newline - r* zero or more r's, where r is any regular expression - r+ one or more r's - r? zero or one r's (that is, "an optional r") - r{2,5} anywhere from two to five r's - r{2,} two or more r's - r{4} exactly 4 r's - {name} the expansion of the "name" definition - (see above) - "[xyz]\\"foo" - the literal string: [xyz]"foo - \\X if X is an 'a', 'b', 'f', 'n', 'r', 't', or 'v', - then the ANSI-C interpretation of \\x. - Otherwise, a literal 'X' (used to escape - operators such as '*') - \\0 a NUL character (ASCII code 0) - \\123 the character with octal value 123 - \\x2a the character with hexadecimal value 2a - (r) match an r; parentheses are used to override - precedence (see below) - - - rs the regular expression r followed by the - regular expression s; called "concatenation" - - - r|s either an r or an s - - - r/s an r but only if it is followed by an s. The - text matched by s is included when determining - whether this rule is the "longest match", - but is then returned to the input before - the action is executed. So the action only - sees the text matched by r. This type - of pattern is called trailing context". - (There are some combinations of r/s that flex - cannot match correctly; see notes in the - Deficiencies / Bugs section below regarding - "dangerous trailing context".) - ^r an r, but only at the beginning of a line (i.e., - which just starting to scan, or right after a - newline has been scanned). - r$ an r, but only at the end of a line (i.e., just - before a newline). Equivalent to "r/\\n". - - Note that flex's notion of "newline" is exactly - whatever the C compiler used to compile flex - interprets '\\n' as; in particular, on some DOS - systems you must either filter out \\r's in the - input yourself, or explicitly use r/\\r\\n for "r$". - - - <s>r an r, but only in start condition s (see - below for discussion of start conditions) - <s1,s2,s3>r - same, but in any of start conditions s1, - s2, or s3 - <*>r an r in any start condition, even an exclusive one. - - - <<EOF>> an end-of-file - <s1,s2><<EOF>> - an end-of-file when in start condition s1 or s2 - -.fi -Note that inside of a character class, all regular expression operators -lose their special meaning except escape ('\\') and the character class -operators, '-', ']', and, at the beginning of the class, '^'. -.PP -The regular expressions listed above are grouped according to -precedence, from highest precedence at the top to lowest at the bottom. -Those grouped together have equal precedence. For example, -.nf - - foo|bar* - -.fi -is the same as -.nf - - (foo)|(ba(r*)) - -.fi -since the '*' operator has higher precedence than concatenation, -and concatenation higher than alternation ('|'). This pattern -therefore matches -.I either -the string "foo" -.I or -the string "ba" followed by zero-or-more r's. -To match "foo" or zero-or-more "bar"'s, use: -.nf - - foo|(bar)* - -.fi -and to match zero-or-more "foo"'s-or-"bar"'s: -.nf - - (foo|bar)* - -.fi -.PP -In addition to characters and ranges of characters, character classes -can also contain character class -.I expressions. -These are expressions enclosed inside -.B [: -and -.B :] -delimiters (which themselves must appear between the '[' and ']' of the -character class; other elements may occur inside the character class, too). -The valid expressions are: -.nf - - [:alnum:] [:alpha:] [:blank:] - [:cntrl:] [:digit:] [:graph:] - [:lower:] [:print:] [:punct:] - [:space:] [:upper:] [:xdigit:] - -.fi -These expressions all designate a set of characters equivalent to -the corresponding standard C -.B isXXX -function. For example, -.B [:alnum:] -designates those characters for which -.B isalnum() -returns true - i.e., any alphabetic or numeric. -Some systems don't provide -.B isblank(), -so flex defines -.B [:blank:] -as a blank or a tab. -.PP -For example, the following character classes are all equivalent: -.nf - - [[:alnum:]] - [[:alpha:][:digit:] - [[:alpha:]0-9] - [a-zA-Z0-9] - -.fi -If your scanner is case-insensitive (the -.B \-i -flag), then -.B [:upper:] -and -.B [:lower:] -are equivalent to -.B [:alpha:]. -.PP -Some notes on patterns: -.IP - -A negated character class such as the example "[^A-Z]" -above -.I will match a newline -unless "\\n" (or an equivalent escape sequence) is one of the -characters explicitly present in the negated character class -(e.g., "[^A-Z\\n]"). This is unlike how many other regular -expression tools treat negated character classes, but unfortunately -the inconsistency is historically entrenched. -Matching newlines means that a pattern like [^"]* can match the entire -input unless there's another quote in the input. -.IP - -A rule can have at most one instance of trailing context (the '/' operator -or the '$' operator). The start condition, '^', and "<<EOF>>" patterns -can only occur at the beginning of a pattern, and, as well as with '/' and '$', -cannot be grouped inside parentheses. A '^' which does not occur at -the beginning of a rule or a '$' which does not occur at the end of -a rule loses its special properties and is treated as a normal character. -.IP -The following are illegal: -.nf - - foo/bar$ - <sc1>foo<sc2>bar - -.fi -Note that the first of these, can be written "foo/bar\\n". -.IP -The following will result in '$' or '^' being treated as a normal character: -.nf - - foo|(bar$) - foo|^bar - -.fi -If what's wanted is a "foo" or a bar-followed-by-a-newline, the following -could be used (the special '|' action is explained below): -.nf - - foo | - bar$ /* action goes here */ - -.fi -A similar trick will work for matching a foo or a -bar-at-the-beginning-of-a-line. -.SH HOW THE INPUT IS MATCHED -When the generated scanner is run, it analyzes its input looking -for strings which match any of its patterns. If it finds more than -one match, it takes the one matching the most text (for trailing -context rules, this includes the length of the trailing part, even -though it will then be returned to the input). If it finds two -or more matches of the same length, the -rule listed first in the -.I flex -input file is chosen. -.PP -Once the match is determined, the text corresponding to the match -(called the -.I token) -is made available in the global character pointer -.B yytext, -and its length in the global integer -.B yyleng. -The -.I action -corresponding to the matched pattern is then executed (a more -detailed description of actions follows), and then the remaining -input is scanned for another match. -.PP -If no match is found, then the -.I default rule -is executed: the next character in the input is considered matched and -copied to the standard output. Thus, the simplest legal -.I flex -input is: -.nf - - %% - -.fi -which generates a scanner that simply copies its input (one character -at a time) to its output. -.PP -Note that -.B yytext -can be defined in two different ways: either as a character -.I pointer -or as a character -.I array. -You can control which definition -.I flex -uses by including one of the special directives -.B %pointer -or -.B %array -in the first (definitions) section of your flex input. The default is -.B %pointer, -unless you use the -.B -l -lex compatibility option, in which case -.B yytext -will be an array. -The advantage of using -.B %pointer -is substantially faster scanning and no buffer overflow when matching -very large tokens (unless you run out of dynamic memory). The disadvantage -is that you are restricted in how your actions can modify -.B yytext -(see the next section), and calls to the -.B unput() -function destroys the present contents of -.B yytext, -which can be a considerable porting headache when moving between different -.I lex -versions. -.PP -The advantage of -.B %array -is that you can then modify -.B yytext -to your heart's content, and calls to -.B unput() -do not destroy -.B yytext -(see below). Furthermore, existing -.I lex -programs sometimes access -.B yytext -externally using declarations of the form: -.nf - extern char yytext[]; -.fi -This definition is erroneous when used with -.B %pointer, -but correct for -.B %array. -.PP -.B %array -defines -.B yytext -to be an array of -.B YYLMAX -characters, which defaults to a fairly large value. You can change -the size by simply #define'ing -.B YYLMAX -to a different value in the first section of your -.I flex -input. As mentioned above, with -.B %pointer -yytext grows dynamically to accommodate large tokens. While this means your -.B %pointer -scanner can accommodate very large tokens (such as matching entire blocks -of comments), bear in mind that each time the scanner must resize -.B yytext -it also must rescan the entire token from the beginning, so matching such -tokens can prove slow. -.B yytext -presently does -.I not -dynamically grow if a call to -.B unput() -results in too much text being pushed back; instead, a run-time error results. -.PP -Also note that you cannot use -.B %array -with C++ scanner classes -(the -.B c++ -option; see below). -.SH ACTIONS -Each pattern in a rule has a corresponding action, which can be any -arbitrary C statement. The pattern ends at the first non-escaped -whitespace character; the remainder of the line is its action. If the -action is empty, then when the pattern is matched the input token -is simply discarded. For example, here is the specification for a program -which deletes all occurrences of "zap me" from its input: -.nf - - %% - "zap me" - -.fi -(It will copy all other characters in the input to the output since -they will be matched by the default rule.) -.PP -Here is a program which compresses multiple blanks and tabs down to -a single blank, and throws away whitespace found at the end of a line: -.nf - - %% - [ \\t]+ putchar( ' ' ); - [ \\t]+$ /* ignore this token */ - -.fi -.PP -If the action contains a '{', then the action spans till the balancing '}' -is found, and the action may cross multiple lines. -.I flex -knows about C strings and comments and won't be fooled by braces found -within them, but also allows actions to begin with -.B %{ -and will consider the action to be all the text up to the next -.B %} -(regardless of ordinary braces inside the action). -.PP -An action consisting solely of a vertical bar ('|') means "same as -the action for the next rule." See below for an illustration. -.PP -Actions can include arbitrary C code, including -.B return -statements to return a value to whatever routine called -.B yylex(). -Each time -.B yylex() -is called it continues processing tokens from where it last left -off until it either reaches -the end of the file or executes a return. -.PP -Actions are free to modify -.B yytext -except for lengthening it (adding -characters to its end--these will overwrite later characters in the -input stream). This however does not apply when using -.B %array -(see above); in that case, -.B yytext -may be freely modified in any way. -.PP -Actions are free to modify -.B yyleng -except they should not do so if the action also includes use of -.B yymore() -(see below). -.PP -There are a number of special directives which can be included within -an action: -.IP - -.B ECHO -copies yytext to the scanner's output. -.IP - -.B BEGIN -followed by the name of a start condition places the scanner in the -corresponding start condition (see below). -.IP - -.B REJECT -directs the scanner to proceed on to the "second best" rule which matched the -input (or a prefix of the input). The rule is chosen as described -above in "How the Input is Matched", and -.B yytext -and -.B yyleng -set up appropriately. -It may either be one which matched as much text -as the originally chosen rule but came later in the -.I flex -input file, or one which matched less text. -For example, the following will both count the -words in the input and call the routine special() whenever "frob" is seen: -.nf - - int word_count = 0; - %% - - frob special(); REJECT; - [^ \\t\\n]+ ++word_count; - -.fi -Without the -.B REJECT, -any "frob"'s in the input would not be counted as words, since the -scanner normally executes only one action per token. -Multiple -.B REJECT's -are allowed, each one finding the next best choice to the currently -active rule. For example, when the following scanner scans the token -"abcd", it will write "abcdabcaba" to the output: -.nf - - %% - a | - ab | - abc | - abcd ECHO; REJECT; - .|\\n /* eat up any unmatched character */ - -.fi -(The first three rules share the fourth's action since they use -the special '|' action.) -.B REJECT -is a particularly expensive feature in terms of scanner performance; -if it is used in -.I any -of the scanner's actions it will slow down -.I all -of the scanner's matching. Furthermore, -.B REJECT -cannot be used with the -.I -Cf -or -.I -CF -options (see below). -.IP -Note also that unlike the other special actions, -.B REJECT -is a -.I branch; -code immediately following it in the action will -.I not -be executed. -.IP - -.B yymore() -tells the scanner that the next time it matches a rule, the corresponding -token should be -.I appended -onto the current value of -.B yytext -rather than replacing it. For example, given the input "mega-kludge" -the following will write "mega-mega-kludge" to the output: -.nf - - %% - mega- ECHO; yymore(); - kludge ECHO; - -.fi -First "mega-" is matched and echoed to the output. Then "kludge" -is matched, but the previous "mega-" is still hanging around at the -beginning of -.B yytext -so the -.B ECHO -for the "kludge" rule will actually write "mega-kludge". -.PP -Two notes regarding use of -.B yymore(). -First, -.B yymore() -depends on the value of -.I yyleng -correctly reflecting the size of the current token, so you must not -modify -.I yyleng -if you are using -.B yymore(). -Second, the presence of -.B yymore() -in the scanner's action entails a minor performance penalty in the -scanner's matching speed. -.IP - -.B yyless(n) -returns all but the first -.I n -characters of the current token back to the input stream, where they -will be rescanned when the scanner looks for the next match. -.B yytext -and -.B yyleng -are adjusted appropriately (e.g., -.B yyleng -will now be equal to -.I n -). For example, on the input "foobar" the following will write out -"foobarbar": -.nf - - %% - foobar ECHO; yyless(3); - [a-z]+ ECHO; - -.fi -An argument of 0 to -.B yyless -will cause the entire current input string to be scanned again. Unless you've -changed how the scanner will subsequently process its input (using -.B BEGIN, -for example), this will result in an endless loop. -.PP -Note that -.B yyless -is a macro and can only be used in the flex input file, not from -other source files. -.IP - -.B unput(c) -puts the character -.I c -back onto the input stream. It will be the next character scanned. -The following action will take the current token and cause it -to be rescanned enclosed in parentheses. -.nf - - { - int i; - /* Copy yytext because unput() trashes yytext */ - char *yycopy = strdup( yytext ); - unput( ')' ); - for ( i = yyleng - 1; i >= 0; --i ) - unput( yycopy[i] ); - unput( '(' ); - free( yycopy ); - } - -.fi -Note that since each -.B unput() -puts the given character back at the -.I beginning -of the input stream, pushing back strings must be done back-to-front. -.PP -An important potential problem when using -.B unput() -is that if you are using -.B %pointer -(the default), a call to -.B unput() -.I destroys -the contents of -.I yytext, -starting with its rightmost character and devouring one character to -the left with each call. If you need the value of yytext preserved -after a call to -.B unput() -(as in the above example), -you must either first copy it elsewhere, or build your scanner using -.B %array -instead (see How The Input Is Matched). -.PP -Finally, note that you cannot put back -.B EOF -to attempt to mark the input stream with an end-of-file. -.IP - -.B input() -reads the next character from the input stream. For example, -the following is one way to eat up C comments: -.nf - - %% - "/*" { - register int c; - - for ( ; ; ) - { - while ( (c = input()) != '*' && - c != EOF ) - ; /* eat up text of comment */ - - if ( c == '*' ) - { - while ( (c = input()) == '*' ) - ; - if ( c == '/' ) - break; /* found the end */ - } - - if ( c == EOF ) - { - error( "EOF in comment" ); - break; - } - } - } - -.fi -(Note that if the scanner is compiled using -.B C++, -then -.B input() -is instead referred to as -.B yyinput(), -in order to avoid a name clash with the -.B C++ -stream by the name of -.I input.) -.IP - -.B YY_FLUSH_BUFFER -flushes the scanner's internal buffer -so that the next time the scanner attempts to match a token, it will -first refill the buffer using -.B YY_INPUT -(see The Generated Scanner, below). This action is a special case -of the more general -.B yy_flush_buffer() -function, described below in the section Multiple Input Buffers. -.IP - -.B yyterminate() -can be used in lieu of a return statement in an action. It terminates -the scanner and returns a 0 to the scanner's caller, indicating "all done". -By default, -.B yyterminate() -is also called when an end-of-file is encountered. It is a macro and -may be redefined. -.SH THE GENERATED SCANNER -The output of -.I flex -is the file -.B lex.yy.c, -which contains the scanning routine -.B yylex(), -a number of tables used by it for matching tokens, and a number -of auxiliary routines and macros. By default, -.B yylex() -is declared as follows: -.nf - - int yylex() - { - ... various definitions and the actions in here ... - } - -.fi -(If your environment supports function prototypes, then it will -be "int yylex( void )".) This definition may be changed by defining -the "YY_DECL" macro. For example, you could use: -.nf - - #define YY_DECL float lexscan( a, b ) float a, b; - -.fi -to give the scanning routine the name -.I lexscan, -returning a float, and taking two floats as arguments. Note that -if you give arguments to the scanning routine using a -K&R-style/non-prototyped function declaration, you must terminate -the definition with a semi-colon (;). -.PP -Whenever -.B yylex() -is called, it scans tokens from the global input file -.I yyin -(which defaults to stdin). It continues until it either reaches -an end-of-file (at which point it returns the value 0) or -one of its actions executes a -.I return -statement. -.PP -If the scanner reaches an end-of-file, subsequent calls are undefined -unless either -.I yyin -is pointed at a new input file (in which case scanning continues from -that file), or -.B yyrestart() -is called. -.B yyrestart() -takes one argument, a -.B FILE * -pointer (which can be nil, if you've set up -.B YY_INPUT -to scan from a source other than -.I yyin), -and initializes -.I yyin -for scanning from that file. Essentially there is no difference between -just assigning -.I yyin -to a new input file or using -.B yyrestart() -to do so; the latter is available for compatibility with previous versions -of -.I flex, -and because it can be used to switch input files in the middle of scanning. -It can also be used to throw away the current input buffer, by calling -it with an argument of -.I yyin; -but better is to use -.B YY_FLUSH_BUFFER -(see above). -Note that -.B yyrestart() -does -.I not -reset the start condition to -.B INITIAL -(see Start Conditions, below). -.PP -If -.B yylex() -stops scanning due to executing a -.I return -statement in one of the actions, the scanner may then be called again and it -will resume scanning where it left off. -.PP -By default (and for purposes of efficiency), the scanner uses -block-reads rather than simple -.I getc() -calls to read characters from -.I yyin. -The nature of how it gets its input can be controlled by defining the -.B YY_INPUT -macro. -YY_INPUT's calling sequence is "YY_INPUT(buf,result,max_size)". Its -action is to place up to -.I max_size -characters in the character array -.I buf -and return in the integer variable -.I result -either the -number of characters read or the constant YY_NULL (0 on Unix systems) -to indicate EOF. The default YY_INPUT reads from the -global file-pointer "yyin". -.PP -A sample definition of YY_INPUT (in the definitions -section of the input file): -.nf - - %{ - #define YY_INPUT(buf,result,max_size) \\ - { \\ - int c = getchar(); \\ - result = (c == EOF) ? YY_NULL : (buf[0] = c, 1); \\ - } - %} - -.fi -This definition will change the input processing to occur -one character at a time. -.PP -When the scanner receives an end-of-file indication from YY_INPUT, -it then checks the -.B yywrap() -function. If -.B yywrap() -returns false (zero), then it is assumed that the -function has gone ahead and set up -.I yyin -to point to another input file, and scanning continues. If it returns -true (non-zero), then the scanner terminates, returning 0 to its -caller. Note that in either case, the start condition remains unchanged; -it does -.I not -revert to -.B INITIAL. -.PP -If you do not supply your own version of -.B yywrap(), -then you must either use -.B %option noyywrap -(in which case the scanner behaves as though -.B yywrap() -returned 1), or you must link with -.B \-lfl -to obtain the default version of the routine, which always returns 1. -.PP -Three routines are available for scanning from in-memory buffers rather -than files: -.B yy_scan_string(), yy_scan_bytes(), -and -.B yy_scan_buffer(). -See the discussion of them below in the section Multiple Input Buffers. -.PP -The scanner writes its -.B ECHO -output to the -.I yyout -global (default, stdout), which may be redefined by the user simply -by assigning it to some other -.B FILE -pointer. -.SH START CONDITIONS -.I flex -provides a mechanism for conditionally activating rules. Any rule -whose pattern is prefixed with "<sc>" will only be active when -the scanner is in the start condition named "sc". For example, -.nf - - <STRING>[^"]* { /* eat up the string body ... */ - ... - } - -.fi -will be active only when the scanner is in the "STRING" start -condition, and -.nf - - <INITIAL,STRING,QUOTE>\\. { /* handle an escape ... */ - ... - } - -.fi -will be active only when the current start condition is -either "INITIAL", "STRING", or "QUOTE". -.PP -Start conditions -are declared in the definitions (first) section of the input -using unindented lines beginning with either -.B %s -or -.B %x -followed by a list of names. -The former declares -.I inclusive -start conditions, the latter -.I exclusive -start conditions. A start condition is activated using the -.B BEGIN -action. Until the next -.B BEGIN -action is executed, rules with the given start -condition will be active and -rules with other start conditions will be inactive. -If the start condition is -.I inclusive, -then rules with no start conditions at all will also be active. -If it is -.I exclusive, -then -.I only -rules qualified with the start condition will be active. -A set of rules contingent on the same exclusive start condition -describe a scanner which is independent of any of the other rules in the -.I flex -input. Because of this, -exclusive start conditions make it easy to specify "mini-scanners" -which scan portions of the input that are syntactically different -from the rest (e.g., comments). -.PP -If the distinction between inclusive and exclusive start conditions -is still a little vague, here's a simple example illustrating the -connection between the two. The set of rules: -.nf - - %s example - %% - - <example>foo do_something(); - - bar something_else(); - -.fi -is equivalent to -.nf - - %x example - %% - - <example>foo do_something(); - - <INITIAL,example>bar something_else(); - -.fi -Without the -.B <INITIAL,example> -qualifier, the -.I bar -pattern in the second example wouldn't be active (i.e., couldn't match) -when in start condition -.B example. -If we just used -.B <example> -to qualify -.I bar, -though, then it would only be active in -.B example -and not in -.B INITIAL, -while in the first example it's active in both, because in the first -example the -.B example -startion condition is an -.I inclusive -.B (%s) -start condition. -.PP -Also note that the special start-condition specifier -.B <*> -matches every start condition. Thus, the above example could also -have been written; -.nf - - %x example - %% - - <example>foo do_something(); - - <*>bar something_else(); - -.fi -.PP -The default rule (to -.B ECHO -any unmatched character) remains active in start conditions. It -is equivalent to: -.nf - - <*>.|\\n ECHO; - -.fi -.PP -.B BEGIN(0) -returns to the original state where only the rules with -no start conditions are active. This state can also be -referred to as the start-condition "INITIAL", so -.B BEGIN(INITIAL) -is equivalent to -.B BEGIN(0). -(The parentheses around the start condition name are not required but -are considered good style.) -.PP -.B BEGIN -actions can also be given as indented code at the beginning -of the rules section. For example, the following will cause -the scanner to enter the "SPECIAL" start condition whenever -.B yylex() -is called and the global variable -.I enter_special -is true: -.nf - - int enter_special; - - %x SPECIAL - %% - if ( enter_special ) - BEGIN(SPECIAL); - - <SPECIAL>blahblahblah - ...more rules follow... - -.fi -.PP -To illustrate the uses of start conditions, -here is a scanner which provides two different interpretations -of a string like "123.456". By default it will treat it as -three tokens, the integer "123", a dot ('.'), and the integer "456". -But if the string is preceded earlier in the line by the string -"expect-floats" -it will treat it as a single token, the floating-point number -123.456: -.nf - - %{ - #include <math.h> - %} - %s expect - - %% - expect-floats BEGIN(expect); - - <expect>[0-9]+"."[0-9]+ { - printf( "found a float, = %f\\n", - atof( yytext ) ); - } - <expect>\\n { - /* that's the end of the line, so - * we need another "expect-number" - * before we'll recognize any more - * numbers - */ - BEGIN(INITIAL); - } - - [0-9]+ { - printf( "found an integer, = %d\\n", - atoi( yytext ) ); - } - - "." printf( "found a dot\\n" ); - -.fi -Here is a scanner which recognizes (and discards) C comments while -maintaining a count of the current input line. -.nf - - %x comment - %% - int line_num = 1; - - "/*" BEGIN(comment); - - <comment>[^*\\n]* /* eat anything that's not a '*' */ - <comment>"*"+[^*/\\n]* /* eat up '*'s not followed by '/'s */ - <comment>\\n ++line_num; - <comment>"*"+"/" BEGIN(INITIAL); - -.fi -This scanner goes to a bit of trouble to match as much -text as possible with each rule. In general, when attempting to write -a high-speed scanner try to match as much possible in each rule, as -it's a big win. -.PP -Note that start-conditions names are really integer values and -can be stored as such. Thus, the above could be extended in the -following fashion: -.nf - - %x comment foo - %% - int line_num = 1; - int comment_caller; - - "/*" { - comment_caller = INITIAL; - BEGIN(comment); - } - - ... - - <foo>"/*" { - comment_caller = foo; - BEGIN(comment); - } - - <comment>[^*\\n]* /* eat anything that's not a '*' */ - <comment>"*"+[^*/\\n]* /* eat up '*'s not followed by '/'s */ - <comment>\\n ++line_num; - <comment>"*"+"/" BEGIN(comment_caller); - -.fi -Furthermore, you can access the current start condition using -the integer-valued -.B YY_START -macro. For example, the above assignments to -.I comment_caller -could instead be written -.nf - - comment_caller = YY_START; - -.fi -Flex provides -.B YYSTATE -as an alias for -.B YY_START -(since that is what's used by AT&T -.I lex). -.PP -Note that start conditions do not have their own name-space; %s's and %x's -declare names in the same fashion as #define's. -.PP -Finally, here's an example of how to match C-style quoted strings using -exclusive start conditions, including expanded escape sequences (but -not including checking for a string that's too long): -.nf - - %x str - - %% - char string_buf[MAX_STR_CONST]; - char *string_buf_ptr; - - - \\" string_buf_ptr = string_buf; BEGIN(str); - - <str>\\" { /* saw closing quote - all done */ - BEGIN(INITIAL); - *string_buf_ptr = '\\0'; - /* return string constant token type and - * value to parser - */ - } - - <str>\\n { - /* error - unterminated string constant */ - /* generate error message */ - } - - <str>\\\\[0-7]{1,3} { - /* octal escape sequence */ - int result; - - (void) sscanf( yytext + 1, "%o", &result ); - - if ( result > 0xff ) - /* error, constant is out-of-bounds */ - - *string_buf_ptr++ = result; - } - - <str>\\\\[0-9]+ { - /* generate error - bad escape sequence; something - * like '\\48' or '\\0777777' - */ - } - - <str>\\\\n *string_buf_ptr++ = '\\n'; - <str>\\\\t *string_buf_ptr++ = '\\t'; - <str>\\\\r *string_buf_ptr++ = '\\r'; - <str>\\\\b *string_buf_ptr++ = '\\b'; - <str>\\\\f *string_buf_ptr++ = '\\f'; - - <str>\\\\(.|\\n) *string_buf_ptr++ = yytext[1]; - - <str>[^\\\\\\n\\"]+ { - char *yptr = yytext; - - while ( *yptr ) - *string_buf_ptr++ = *yptr++; - } - -.fi -.PP -Often, such as in some of the examples above, you wind up writing a -whole bunch of rules all preceded by the same start condition(s). Flex -makes this a little easier and cleaner by introducing a notion of -start condition -.I scope. -A start condition scope is begun with: -.nf - - <SCs>{ - -.fi -where -.I SCs -is a list of one or more start conditions. Inside the start condition -scope, every rule automatically has the prefix -.I <SCs> -applied to it, until a -.I '}' -which matches the initial -.I '{'. -So, for example, -.nf - - <ESC>{ - "\\\\n" return '\\n'; - "\\\\r" return '\\r'; - "\\\\f" return '\\f'; - "\\\\0" return '\\0'; - } - -.fi -is equivalent to: -.nf - - <ESC>"\\\\n" return '\\n'; - <ESC>"\\\\r" return '\\r'; - <ESC>"\\\\f" return '\\f'; - <ESC>"\\\\0" return '\\0'; - -.fi -Start condition scopes may be nested. -.PP -Three routines are available for manipulating stacks of start conditions: -.TP -.B void yy_push_state(int new_state) -pushes the current start condition onto the top of the start condition -stack and switches to -.I new_state -as though you had used -.B BEGIN new_state -(recall that start condition names are also integers). -.TP -.B void yy_pop_state() -pops the top of the stack and switches to it via -.B BEGIN. -.TP -.B int yy_top_state() -returns the top of the stack without altering the stack's contents. -.PP -The start condition stack grows dynamically and so has no built-in -size limitation. If memory is exhausted, program execution aborts. -.PP -To use start condition stacks, your scanner must include a -.B %option stack -directive (see Options below). -.SH MULTIPLE INPUT BUFFERS -Some scanners (such as those which support "include" files) -require reading from several input streams. As -.I flex -scanners do a large amount of buffering, one cannot control -where the next input will be read from by simply writing a -.B YY_INPUT -which is sensitive to the scanning context. -.B YY_INPUT -is only called when the scanner reaches the end of its buffer, which -may be a long time after scanning a statement such as an "include" -which requires switching the input source. -.PP -To negotiate these sorts of problems, -.I flex -provides a mechanism for creating and switching between multiple -input buffers. An input buffer is created by using: -.nf - - YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) - -.fi -which takes a -.I FILE -pointer and a size and creates a buffer associated with the given -file and large enough to hold -.I size -characters (when in doubt, use -.B YY_BUF_SIZE -for the size). It returns a -.B YY_BUFFER_STATE -handle, which may then be passed to other routines (see below). The -.B YY_BUFFER_STATE -type is a pointer to an opaque -.B struct yy_buffer_state -structure, so you may safely initialize YY_BUFFER_STATE variables to -.B ((YY_BUFFER_STATE) 0) -if you wish, and also refer to the opaque structure in order to -correctly declare input buffers in source files other than that -of your scanner. Note that the -.I FILE -pointer in the call to -.B yy_create_buffer -is only used as the value of -.I yyin -seen by -.B YY_INPUT; -if you redefine -.B YY_INPUT -so it no longer uses -.I yyin, -then you can safely pass a nil -.I FILE -pointer to -.B yy_create_buffer. -You select a particular buffer to scan from using: -.nf - - void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) - -.fi -switches the scanner's input buffer so subsequent tokens will -come from -.I new_buffer. -Note that -.B yy_switch_to_buffer() -may be used by yywrap() to set things up for continued scanning, instead -of opening a new file and pointing -.I yyin -at it. Note also that switching input sources via either -.B yy_switch_to_buffer() -or -.B yywrap() -does -.I not -change the start condition. -.nf - - void yy_delete_buffer( YY_BUFFER_STATE buffer ) - -.fi -is used to reclaim the storage associated with a buffer. ( -.B buffer -can be nil, in which case the routine does nothing.) -You can also clear the current contents of a buffer using: -.nf - - void yy_flush_buffer( YY_BUFFER_STATE buffer ) - -.fi -This function discards the buffer's contents, -so the next time the scanner attempts to match a token from the -buffer, it will first fill the buffer anew using -.B YY_INPUT. -.PP -.B yy_new_buffer() -is an alias for -.B yy_create_buffer(), -provided for compatibility with the C++ use of -.I new -and -.I delete -for creating and destroying dynamic objects. -.PP -Finally, the -.B YY_CURRENT_BUFFER -macro returns a -.B YY_BUFFER_STATE -handle to the current buffer. -.PP -Here is an example of using these features for writing a scanner -which expands include files (the -.B <<EOF>> -feature is discussed below): -.nf - - /* the "incl" state is used for picking up the name - * of an include file - */ - %x incl - - %{ - #define MAX_INCLUDE_DEPTH 10 - YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH]; - int include_stack_ptr = 0; - %} - - %% - include BEGIN(incl); - - [a-z]+ ECHO; - [^a-z\\n]*\\n? ECHO; - - <incl>[ \\t]* /* eat the whitespace */ - <incl>[^ \\t\\n]+ { /* got the include file name */ - if ( include_stack_ptr >= MAX_INCLUDE_DEPTH ) - { - fprintf( stderr, "Includes nested too deeply" ); - exit( 1 ); - } - - include_stack[include_stack_ptr++] = - YY_CURRENT_BUFFER; - - yyin = fopen( yytext, "r" ); - - if ( ! yyin ) - error( ... ); - - yy_switch_to_buffer( - yy_create_buffer( yyin, YY_BUF_SIZE ) ); - - BEGIN(INITIAL); - } - - <<EOF>> { - if ( --include_stack_ptr < 0 ) - { - yyterminate(); - } - - else - { - yy_delete_buffer( YY_CURRENT_BUFFER ); - yy_switch_to_buffer( - include_stack[include_stack_ptr] ); - } - } - -.fi -Three routines are available for setting up input buffers for -scanning in-memory strings instead of files. All of them create -a new input buffer for scanning the string, and return a corresponding -.B YY_BUFFER_STATE -handle (which you should delete with -.B yy_delete_buffer() -when done with it). They also switch to the new buffer using -.B yy_switch_to_buffer(), -so the next call to -.B yylex() -will start scanning the string. -.TP -.B yy_scan_string(const char *str) -scans a NUL-terminated string. -.TP -.B yy_scan_bytes(const char *bytes, int len) -scans -.I len -bytes (including possibly NUL's) -starting at location -.I bytes. -.PP -Note that both of these functions create and scan a -.I copy -of the string or bytes. (This may be desirable, since -.B yylex() -modifies the contents of the buffer it is scanning.) You can avoid the -copy by using: -.TP -.B yy_scan_buffer(char *base, yy_size_t size) -which scans in place the buffer starting at -.I base, -consisting of -.I size -bytes, the last two bytes of which -.I must -be -.B YY_END_OF_BUFFER_CHAR -(ASCII NUL). -These last two bytes are not scanned; thus, scanning -consists of -.B base[0] -through -.B base[size-2], -inclusive. -.IP -If you fail to set up -.I base -in this manner (i.e., forget the final two -.B YY_END_OF_BUFFER_CHAR -bytes), then -.B yy_scan_buffer() -returns a nil pointer instead of creating a new input buffer. -.IP -The type -.B yy_size_t -is an integral type to which you can cast an integer expression -reflecting the size of the buffer. -.SH END-OF-FILE RULES -The special rule "<<EOF>>" indicates -actions which are to be taken when an end-of-file is -encountered and yywrap() returns non-zero (i.e., indicates -no further files to process). The action must finish -by doing one of four things: -.IP - -assigning -.I yyin -to a new input file (in previous versions of flex, after doing the -assignment you had to call the special action -.B YY_NEW_FILE; -this is no longer necessary); -.IP - -executing a -.I return -statement; -.IP - -executing the special -.B yyterminate() -action; -.IP - -or, switching to a new buffer using -.B yy_switch_to_buffer() -as shown in the example above. -.PP -<<EOF>> rules may not be used with other -patterns; they may only be qualified with a list of start -conditions. If an unqualified <<EOF>> rule is given, it -applies to -.I all -start conditions which do not already have <<EOF>> actions. To -specify an <<EOF>> rule for only the initial start condition, use -.nf - - <INITIAL><<EOF>> - -.fi -.PP -These rules are useful for catching things like unclosed comments. -An example: -.nf - - %x quote - %% - - ...other rules for dealing with quotes... - - <quote><<EOF>> { - error( "unterminated quote" ); - yyterminate(); - } - <<EOF>> { - if ( *++filelist ) - yyin = fopen( *filelist, "r" ); - else - yyterminate(); - } - -.fi -.SH MISCELLANEOUS MACROS -The macro -.B YY_USER_ACTION -can be defined to provide an action -which is always executed prior to the matched rule's action. For example, -it could be #define'd to call a routine to convert yytext to lower-case. -When -.B YY_USER_ACTION -is invoked, the variable -.I yy_act -gives the number of the matched rule (rules are numbered starting with 1). -Suppose you want to profile how often each of your rules is matched. The -following would do the trick: -.nf - - #define YY_USER_ACTION ++ctr[yy_act] - -.fi -where -.I ctr -is an array to hold the counts for the different rules. Note that -the macro -.B YY_NUM_RULES -gives the total number of rules (including the default rule, even if -you use -.B \-s), -so a correct declaration for -.I ctr -is: -.nf - - int ctr[YY_NUM_RULES]; - -.fi -.PP -The macro -.B YY_USER_INIT -may be defined to provide an action which is always executed before -the first scan (and before the scanner's internal initializations are done). -For example, it could be used to call a routine to read -in a data table or open a logging file. -.PP -The macro -.B yy_set_interactive(is_interactive) -can be used to control whether the current buffer is considered -.I interactive. -An interactive buffer is processed more slowly, -but must be used when the scanner's input source is indeed -interactive to avoid problems due to waiting to fill buffers -(see the discussion of the -.B \-I -flag below). A non-zero value -in the macro invocation marks the buffer as interactive, a zero -value as non-interactive. Note that use of this macro overrides -.B %option always-interactive -or -.B %option never-interactive -(see Options below). -.B yy_set_interactive() -must be invoked prior to beginning to scan the buffer that is -(or is not) to be considered interactive. -.PP -The macro -.B yy_set_bol(at_bol) -can be used to control whether the current buffer's scanning -context for the next token match is done as though at the -beginning of a line. A non-zero macro argument makes rules anchored with -'^' active, while a zero argument makes '^' rules inactive. -.PP -The macro -.B YY_AT_BOL() -returns true if the next token scanned from the current buffer -will have '^' rules active, false otherwise. -.PP -In the generated scanner, the actions are all gathered in one large -switch statement and separated using -.B YY_BREAK, -which may be redefined. By default, it is simply a "break", to separate -each rule's action from the following rule's. -Redefining -.B YY_BREAK -allows, for example, C++ users to -#define YY_BREAK to do nothing (while being very careful that every -rule ends with a "break" or a "return"!) to avoid suffering from -unreachable statement warnings where because a rule's action ends with -"return", the -.B YY_BREAK -is inaccessible. -.SH VALUES AVAILABLE TO THE USER -This section summarizes the various values available to the user -in the rule actions. -.IP - -.B char *yytext -holds the text of the current token. It may be modified but not lengthened -(you cannot append characters to the end). -.IP -If the special directive -.B %array -appears in the first section of the scanner description, then -.B yytext -is instead declared -.B char yytext[YYLMAX], -where -.B YYLMAX -is a macro definition that you can redefine in the first section -if you don't like the default value (generally 8KB). Using -.B %array -results in somewhat slower scanners, but the value of -.B yytext -becomes immune to calls to -.I input() -and -.I unput(), -which potentially destroy its value when -.B yytext -is a character pointer. The opposite of -.B %array -is -.B %pointer, -which is the default. -.IP -You cannot use -.B %array -when generating C++ scanner classes -(the -.B \-+ -flag). -.IP - -.B int yyleng -holds the length of the current token. -.IP - -.B FILE *yyin -is the file which by default -.I flex -reads from. It may be redefined but doing so only makes sense before -scanning begins or after an EOF has been encountered. Changing it in -the midst of scanning will have unexpected results since -.I flex -buffers its input; use -.B yyrestart() -instead. -Once scanning terminates because an end-of-file -has been seen, you can assign -.I yyin -at the new input file and then call the scanner again to continue scanning. -.IP - -.B void yyrestart( FILE *new_file ) -may be called to point -.I yyin -at the new input file. The switch-over to the new file is immediate -(any previously buffered-up input is lost). Note that calling -.B yyrestart() -with -.I yyin -as an argument thus throws away the current input buffer and continues -scanning the same input file. -.IP - -.B FILE *yyout -is the file to which -.B ECHO -actions are done. It can be reassigned by the user. -.IP - -.B YY_CURRENT_BUFFER -returns a -.B YY_BUFFER_STATE -handle to the current buffer. -.IP - -.B YY_START -returns an integer value corresponding to the current start -condition. You can subsequently use this value with -.B BEGIN -to return to that start condition. -.SH INTERFACING WITH YACC -One of the main uses of -.I flex -is as a companion to the -.I yacc -parser-generator. -.I yacc -parsers expect to call a routine named -.B yylex() -to find the next input token. The routine is supposed to -return the type of the next token as well as putting any associated -value in the global -.B yylval. -To use -.I flex -with -.I yacc, -one specifies the -.B \-d -option to -.I yacc -to instruct it to generate the file -.B y.tab.h -containing definitions of all the -.B %tokens -appearing in the -.I yacc -input. This file is then included in the -.I flex -scanner. For example, if one of the tokens is "TOK_NUMBER", -part of the scanner might look like: -.nf - - %{ - #include "y.tab.h" - %} - - %% - - [0-9]+ yylval = atoi( yytext ); return TOK_NUMBER; - -.fi -.SH OPTIONS -.I flex -has the following options: -.TP -.B \-b -Generate backing-up information to -.I lex.backup. -This is a list of scanner states which require backing up -and the input characters on which they do so. By adding rules one -can remove backing-up states. If -.I all -backing-up states are eliminated and -.B \-Cf -or -.B \-CF -is used, the generated scanner will run faster (see the -.B \-p -flag). Only users who wish to squeeze every last cycle out of their -scanners need worry about this option. (See the section on Performance -Considerations below.) -.TP -.B \-c -is a do-nothing, deprecated option included for POSIX compliance. -.TP -.B \-d -makes the generated scanner run in -.I debug -mode. Whenever a pattern is recognized and the global -.B yy_flex_debug -is non-zero (which is the default), -the scanner will write to -.I stderr -a line of the form: -.nf - - --accepting rule at line 53 ("the matched text") - -.fi -The line number refers to the location of the rule in the file -defining the scanner (i.e., the file that was fed to flex). Messages -are also generated when the scanner backs up, accepts the -default rule, reaches the end of its input buffer (or encounters -a NUL; at this point, the two look the same as far as the scanner's concerned), -or reaches an end-of-file. -.TP -.B \-f -specifies -.I fast scanner. -No table compression is done and stdio is bypassed. -The result is large but fast. This option is equivalent to -.B \-Cfr -(see below). -.TP -.B \-h -generates a "help" summary of -.I flex's -options to -.I stdout -and then exits. -.B \-? -and -.B \-\-help -are synonyms for -.B \-h. -.TP -.B \-i -instructs -.I flex -to generate a -.I case-insensitive -scanner. The case of letters given in the -.I flex -input patterns will -be ignored, and tokens in the input will be matched regardless of case. The -matched text given in -.I yytext -will have the preserved case (i.e., it will not be folded). -.TP -.B \-l -turns on maximum compatibility with the original AT&T -.I lex -implementation. Note that this does not mean -.I full -compatibility. Use of this option costs a considerable amount of -performance, and it cannot be used with the -.B \-+, -f, -F, -Cf, -or -.B -CF -options. For details on the compatibilities it provides, see the section -"Incompatibilities With Lex And POSIX" below. This option also results -in the name -.B YY_FLEX_LEX_COMPAT -being #define'd in the generated scanner. -.TP -.B \-n -is another do-nothing, deprecated option included only for -POSIX compliance. -.TP -.B \-p -generates a performance report to stderr. The report -consists of comments regarding features of the -.I flex -input file which will cause a serious loss of performance in the resulting -scanner. If you give the flag twice, you will also get comments regarding -features that lead to minor performance losses. -.IP -Note that the use of -.B REJECT, -.B %option yylineno, -and variable trailing context (see the Deficiencies / Bugs section below) -entails a substantial performance penalty; use of -.I yymore(), -the -.B ^ -operator, -and the -.B \-I -flag entail minor performance penalties. -.TP -.B \-s -causes the -.I default rule -(that unmatched scanner input is echoed to -.I stdout) -to be suppressed. If the scanner encounters input that does not -match any of its rules, it aborts with an error. This option is -useful for finding holes in a scanner's rule set. -.TP -.B \-t -instructs -.I flex -to write the scanner it generates to standard output instead -of -.B lex.yy.c. -.TP -.B \-v -specifies that -.I flex -should write to -.I stderr -a summary of statistics regarding the scanner it generates. -Most of the statistics are meaningless to the casual -.I flex -user, but the first line identifies the version of -.I flex -(same as reported by -.B \-V), -and the next line the flags used when generating the scanner, including -those that are on by default. -.TP -.B \-w -suppresses warning messages. -.TP -.B \-B -instructs -.I flex -to generate a -.I batch -scanner, the opposite of -.I interactive -scanners generated by -.B \-I -(see below). In general, you use -.B \-B -when you are -.I certain -that your scanner will never be used interactively, and you want to -squeeze a -.I little -more performance out of it. If your goal is instead to squeeze out a -.I lot -more performance, you should be using the -.B \-Cf -or -.B \-CF -options (discussed below), which turn on -.B \-B -automatically anyway. -.TP -.B \-F -specifies that the -.ul -fast -scanner table representation should be used (and stdio -bypassed). This representation is -about as fast as the full table representation -.B (-f), -and for some sets of patterns will be considerably smaller (and for -others, larger). In general, if the pattern set contains both "keywords" -and a catch-all, "identifier" rule, such as in the set: -.nf - - "case" return TOK_CASE; - "switch" return TOK_SWITCH; - ... - "default" return TOK_DEFAULT; - [a-z]+ return TOK_ID; - -.fi -then you're better off using the full table representation. If only -the "identifier" rule is present and you then use a hash table or some such -to detect the keywords, you're better off using -.B -F. -.IP -This option is equivalent to -.B \-CFr -(see below). It cannot be used with -.B \-+. -.TP -.B \-I -instructs -.I flex -to generate an -.I interactive -scanner. An interactive scanner is one that only looks ahead to decide -what token has been matched if it absolutely must. It turns out that -always looking one extra character ahead, even if the scanner has already -seen enough text to disambiguate the current token, is a bit faster than -only looking ahead when necessary. But scanners that always look ahead -give dreadful interactive performance; for example, when a user types -a newline, it is not recognized as a newline token until they enter -.I another -token, which often means typing in another whole line. -.IP -.I Flex -scanners default to -.I interactive -unless you use the -.B \-Cf -or -.B \-CF -table-compression options (see below). That's because if you're looking -for high-performance you should be using one of these options, so if you -didn't, -.I flex -assumes you'd rather trade off a bit of run-time performance for intuitive -interactive behavior. Note also that you -.I cannot -use -.B \-I -in conjunction with -.B \-Cf -or -.B \-CF. -Thus, this option is not really needed; it is on by default for all those -cases in which it is allowed. -.IP -You can force a scanner to -.I not -be interactive by using -.B \-B -(see above). -.TP -.B \-L -instructs -.I flex -not to generate -.B #line -directives. Without this option, -.I flex -peppers the generated scanner -with #line directives so error messages in the actions will be correctly -located with respect to either the original -.I flex -input file (if the errors are due to code in the input file), or -.B lex.yy.c -(if the errors are -.I flex's -fault -- you should report these sorts of errors to the email address -given below). -.TP -.B \-T -makes -.I flex -run in -.I trace -mode. It will generate a lot of messages to -.I stderr -concerning -the form of the input and the resultant non-deterministic and deterministic -finite automata. This option is mostly for use in maintaining -.I flex. -.TP -.B \-V -prints the version number to -.I stdout -and exits. -.B \-\-version -is a synonym for -.B \-V. -.TP -.B \-7 -instructs -.I flex -to generate a 7-bit scanner, i.e., one which can only recognized 7-bit -characters in its input. The advantage of using -.B \-7 -is that the scanner's tables can be up to half the size of those generated -using the -.B \-8 -option (see below). The disadvantage is that such scanners often hang -or crash if their input contains an 8-bit character. -.IP -Note, however, that unless you generate your scanner using the -.B \-Cf -or -.B \-CF -table compression options, use of -.B \-7 -will save only a small amount of table space, and make your scanner -considerably less portable. -.I Flex's -default behavior is to generate an 8-bit scanner unless you use the -.B \-Cf -or -.B \-CF, -in which case -.I flex -defaults to generating 7-bit scanners unless your site was always -configured to generate 8-bit scanners (as will often be the case -with non-USA sites). You can tell whether flex generated a 7-bit -or an 8-bit scanner by inspecting the flag summary in the -.B \-v -output as described above. -.IP -Note that if you use -.B \-Cfe -or -.B \-CFe -(those table compression options, but also using equivalence classes as -discussed see below), flex still defaults to generating an 8-bit -scanner, since usually with these compression options full 8-bit tables -are not much more expensive than 7-bit tables. -.TP -.B \-8 -instructs -.I flex -to generate an 8-bit scanner, i.e., one which can recognize 8-bit -characters. This flag is only needed for scanners generated using -.B \-Cf -or -.B \-CF, -as otherwise flex defaults to generating an 8-bit scanner anyway. -.IP -See the discussion of -.B \-7 -above for flex's default behavior and the tradeoffs between 7-bit -and 8-bit scanners. -.TP -.B \-U -instructs -.I flex -to generate a 16-bit scanner, i.e., one which can recognize Unicode -characters. The tables of a scanner generated with -.B \-U -are always substantially larger than those of a 7- or 8-bit scanner, but there -are three significant benefits if you need to scan Unicode. First, a 16-bit -Unicode scanner is much faster than an equivalent 8-bit because it does not -have to match NULs. Second, the generated scanner is portable - 8-bit Unicode -scanners are non-portable because their patterns reflect the endianness of the -platform on which they were written. Third, 16-bit patterns use the standard -syntax of regular expressions with one small addition: escape sequences can -specify 16-bit characters. For example, the patterns \177377 and \xFEFF both -match the Unicode byte-order mark. Note the following related issues: -.IP -If your operating system distinguishes between text and binary file I/O, -.I yyin -and -.I yyout -should be opened in binary mode. -.IP -C++ support of Unicode varies. This currently limits 16-bit C++ -scanners to file I/O. -.IP -The -.B \-C, -Cf, -and -.B \-CF -table compression options are not available with -.B \-U -in order to keep table sizes within reason. -.TP -.B \-+ -specifies that you want flex to generate a C++ -scanner class. See the section on Generating C++ Scanners below for -details. -.TP -.B \-C[aefFmr] -controls the degree of table compression and, more generally, trade-offs -between small scanners and fast scanners. -.IP -.B \-Ca -("align") instructs flex to trade off larger tables in the -generated scanner for faster performance because the elements of -the tables are better aligned for memory access and computation. On some -RISC architectures, fetching and manipulating longwords is more efficient -than with smaller-sized units such as shortwords. This option can -double the size of the tables used by a 7- or 8-bit scanner, and can -quadruple those of a 16-bit scanner. -.IP -.B \-Ce -directs -.I flex -to construct -.I equivalence classes, -i.e., sets of characters -which have identical lexical properties (for example, if the only -appearance of digits in the -.I flex -input is in the character class -"[0-9]" then the digits '0', '1', ..., '9' will all be put -in the same equivalence class). Equivalence classes usually give -dramatic reductions in the final table/object file sizes (typically -a factor of 2-5) and are pretty cheap performance-wise (one array -look-up per character scanned). -.IP -.B \-Cf -specifies that the -.I full -scanner tables should be generated - -.I flex -should not compress the -tables by taking advantages of similar transition functions for -different states. This option cannot be used with -.B \-U. -.IP -.B \-CF -specifies that the alternate fast scanner representation (described -above under the -.B \-F -flag) -should be used. This option cannot be used with -.B \-+ -or -.B \-U. -.IP -.B \-Cm -directs -.I flex -to construct -.I meta-equivalence classes, -which are sets of equivalence classes (or characters, if equivalence -classes are not being used) that are commonly used together. Meta-equivalence -classes are often a big win when using compressed tables, but they -have a moderate performance impact (one or two "if" tests and one -array look-up per character scanned). -.IP -.B \-Cr -causes the generated scanner to -.I bypass -use of the standard I/O library (stdio) for input. Instead of calling -.B fread() -or -.B getc(), -the scanner will use the -.B read() -system call, resulting in a performance gain which varies from system -to system, but in general is probably negligible unless you are also using -.B \-Cf -or -.B \-CF. -Using -.B \-Cr -can cause strange behavior if, for example, you read from -.I yyin -using stdio prior to calling the scanner (because the scanner will miss -whatever text your previous reads left in the stdio input buffer). -.IP -.B \-Cr -has no effect if you define -.B YY_INPUT -(see The Generated Scanner above). -.IP -A lone -.B \-C -specifies that the scanner tables should be compressed but neither -equivalence classes nor meta-equivalence classes should be used. -This option cannot be used with -.B \-U. -.IP -The options -.B \-Cf -or -.B \-CF -and -.B \-Cm -do not make sense together - there is no opportunity for meta-equivalence -classes if the table is not being compressed. Otherwise the options -may be freely mixed, and are cumulative. -.IP -The default setting is -.B \-Cem, -which specifies that -.I flex -should generate equivalence classes -and meta-equivalence classes. This setting provides the highest -degree of table compression. You can trade off -faster-executing scanners at the cost of larger tables with -the following generally being true: -.nf - - slowest & smallest - -Cem - -Cm - -Ce - -C - -C{f,F}e - -C{f,F} - -C{f,F}a - fastest & largest - -.fi -Note that scanners with the smallest tables are usually generated and -compiled the quickest, so -during development you will usually want to use the default, maximal -compression. -.IP -.B \-Cfe -is often a good compromise between speed and size for production -scanners. -.TP -.B \-ooutput -directs flex to write the scanner to the file -.B output -instead of -.B lex.yy.c. -If you combine -.B \-o -with the -.B \-t -option, then the scanner is written to -.I stdout -but its -.B #line -directives (see the -.B \\-L -option above) refer to the file -.B output. -.TP -.B \-Pprefix -changes the default -.I "yy" -prefix used by -.I flex -for all globally-visible variable and function names to instead be -.I prefix. -For example, -.B \-Pfoo -changes the name of -.B yytext -to -.B footext. -It also changes the name of the default output file from -.B lex.yy.c -to -.B lex.foo.c. -Here are all of the names affected: -.nf - - yy_create_buffer - yy_delete_buffer - yy_flex_debug - yy_init_buffer - yy_flush_buffer - yy_load_buffer_state - yy_switch_to_buffer - yyin - yyleng - yylex - yylineno - yyout - yyrestart - yytext - yywrap - -.fi -(If you are using a C++ scanner, then only -.B yywrap -and -.B yyFlexLexer -are affected.) -Within your scanner itself, you can still refer to the global variables -and functions using either version of their name; but externally, they -have the modified name. -.IP -This option lets you easily link together multiple -.I flex -programs into the same executable. Note, though, that using this -option also renames -.B yywrap(), -so you now -.I must -either -provide your own (appropriately-named) version of the routine for your -scanner, or use -.B %option noyywrap, -as linking with -.B \-lfl -no longer provides one for you by default. -.TP -.B \-Sskeleton_file -overrides the default skeleton file from which -.I flex -constructs its scanners. You'll never need this option unless you are doing -.I flex -maintenance or development. -.PP -.I flex -also provides a mechanism for controlling options within the -scanner specification itself, rather than from the flex command-line. -This is done by including -.B %option -directives in the first section of the scanner specification. -You can specify multiple options with a single -.B %option -directive, and multiple directives in the first section of your flex input -file. -.PP -Most options are given simply as names, optionally preceded by the -word "no" (with no intervening whitespace) to negate their meaning. -A number are equivalent to flex flags or their negation: -.nf - - 7bit -7 option - 8bit -8 option - align -Ca option - backup -b option - batch -B option - c++ -+ option - - caseful or - case-sensitive opposite of -i (default) - - case-insensitive or - caseless -i option - - debug -d option - default opposite of -s option - ecs -Ce option - fast -F option - full -f option - interactive -I option - lex-compat -l option - meta-ecs -Cm option - perf-report -p option - read -Cr option - stdout -t option - verbose -v option - warn opposite of -w option - (use "%option nowarn" for -w) - - array equivalent to "%array" - pointer equivalent to "%pointer" (default) - -.fi -Some -.B %option's -provide features otherwise not available: -.TP -.B always-interactive -instructs flex to generate a scanner which always considers its input -"interactive". Normally, on each new input file the scanner calls -.B isatty() -in an attempt to determine whether -the scanner's input source is interactive and thus should be read a -character at a time. When this option is used, however, then no -such call is made. -.TP -.B main -directs flex to provide a default -.B main() -program for the scanner, which simply calls -.B yylex(). -This option implies -.B noyywrap -(see below). -.TP -.B never-interactive -instructs flex to generate a scanner which never considers its input -"interactive" (again, no call made to -.B isatty()). -This is the opposite of -.B always-interactive. -.TP -.B stack -enables the use of start condition stacks (see Start Conditions above). -.TP -.B stdinit -if set (i.e., -.B %option stdinit) -initializes -.I yyin -and -.I yyout -to -.I stdin -and -.I stdout, -instead of the default of -.I nil. -Some existing -.I lex -programs depend on this behavior, even though it is not compliant with -ANSI C, which does not require -.I stdin -and -.I stdout -to be compile-time constant. -.TP -.B yylineno -directs -.I flex -to generate a scanner that maintains the number of the current line -read from its input in the global variable -.B yylineno. -This option is implied by -.B %option lex-compat. -.TP -.B yywrap -if unset (i.e., -.B %option noyywrap), -makes the scanner not call -.B yywrap() -upon an end-of-file, but simply assume that there are no more -files to scan (until the user points -.I yyin -at a new file and calls -.B yylex() -again). -.PP -.I flex -scans your rule actions to determine whether you use the -.B REJECT -or -.B yymore() -features. The -.B reject -and -.B yymore -options are available to override its decision as to whether you use the -options, either by setting them (e.g., -.B %option reject) -to indicate the feature is indeed used, or -unsetting them to indicate it actually is not used -(e.g., -.B %option noyymore). -.PP -Three options take string-delimited values, offset with '=': -.nf - - %option outfile="ABC" - -.fi -is equivalent to -.B -oABC, -and -.nf - - %option prefix="XYZ" - -.fi -is equivalent to -.B -PXYZ. -Finally, -.nf - - %option yyclass="foo" - -.fi -only applies when generating a C++ scanner ( -.B \-+ -option). It informs -.I flex -that you have derived -.B foo -as a subclass of -.B yyFlexLexer, -so -.I flex -will place your actions in the member function -.B foo::yylex() -instead of -.B yyFlexLexer::yylex(). -It also generates a -.B yyFlexLexer::yylex() -member function that emits a run-time error (by invoking -.B yyFlexLexer::LexerError()) -if called. -See Generating C++ Scanners, below, for additional information. -.PP -A number of options are available for lint purists who want to suppress -the appearance of unneeded routines in the generated scanner. Each of the -following, if unset -(e.g., -.B %option nounput -), results in the corresponding routine not appearing in -the generated scanner: -.nf - - input, unput - yy_push_state, yy_pop_state, yy_top_state - yy_scan_buffer, yy_scan_bytes, yy_scan_string - -.fi -(though -.B yy_push_state() -and friends won't appear anyway unless you use -.B %option stack). -.SH PERFORMANCE CONSIDERATIONS -The main design goal of -.I flex -is that it generate high-performance scanners. It has been optimized -for dealing well with large sets of rules. Aside from the effects on -scanner speed of the table compression -.B \-C -options outlined above, -there are a number of options/actions which degrade performance. These -are, from most expensive to least: -.nf - - REJECT - %option yylineno - arbitrary trailing context - - pattern sets that require backing up - %array - %option interactive - %option always-interactive - - '^' beginning-of-line operator - yymore() - -.fi -with the first three all being quite expensive and the last two -being quite cheap. Note also that -.B unput() -is implemented as a routine call that potentially does quite a bit of -work, while -.B yyless() -is a quite-cheap macro; so if just putting back some excess text you -scanned, use -.B yyless(). -.PP -.B REJECT -should be avoided at all costs when performance is important. -It is a particularly expensive option. -.PP -Getting rid of backing up is messy and often may be an enormous -amount of work for a complicated scanner. In principal, one begins -by using the -.B \-b -flag to generate a -.I lex.backup -file. For example, on the input -.nf - - %% - foo return TOK_KEYWORD; - foobar return TOK_KEYWORD; - -.fi -the file looks like: -.nf - - State #6 is non-accepting - - associated rule line numbers: - 2 3 - out-transitions: [ o ] - jam-transitions: EOF [ \\001-n p-\\177 ] - - State #8 is non-accepting - - associated rule line numbers: - 3 - out-transitions: [ a ] - jam-transitions: EOF [ \\001-` b-\\177 ] - - State #9 is non-accepting - - associated rule line numbers: - 3 - out-transitions: [ r ] - jam-transitions: EOF [ \\001-q s-\\177 ] - - Compressed tables always back up. - -.fi -The first few lines tell us that there's a scanner state in -which it can make a transition on an 'o' but not on any other -character, and that in that state the currently scanned text does not match -any rule. The state occurs when trying to match the rules found -at lines 2 and 3 in the input file. -If the scanner is in that state and then reads -something other than an 'o', it will have to back up to find -a rule which is matched. With -a bit of headscratching one can see that this must be the -state it's in when it has seen "fo". When this has happened, -if anything other than another 'o' is seen, the scanner will -have to back up to simply match the 'f' (by the default rule). -.PP -The comment regarding State #8 indicates there's a problem -when "foob" has been scanned. Indeed, on any character other -than an 'a', the scanner will have to back up to accept "foo". -Similarly, the comment for State #9 concerns when "fooba" has -been scanned and an 'r' does not follow. -.PP -The final comment reminds us that there's no point going to -all the trouble of removing backing up from the rules unless -we're using -.B \-Cf -or -.B \-CF, -since there's no performance gain doing so with compressed scanners. -.PP -The way to remove the backing up is to add "error" rules: -.nf - - %% - foo return TOK_KEYWORD; - foobar return TOK_KEYWORD; - - fooba | - foob | - fo { - /* false alarm, not really a keyword */ - return TOK_ID; - } - -.fi -.PP -Eliminating backing up among a list of keywords can also be -done using a "catch-all" rule: -.nf - - %% - foo return TOK_KEYWORD; - foobar return TOK_KEYWORD; - - [a-z]+ return TOK_ID; - -.fi -This is usually the best solution when appropriate. -.PP -Backing up messages tend to cascade. -With a complicated set of rules it's not uncommon to get hundreds -of messages. If one can decipher them, though, it often -only takes a dozen or so rules to eliminate the backing up (though -it's easy to make a mistake and have an error rule accidentally match -a valid token. A possible future -.I flex -feature will be to automatically add rules to eliminate backing up). -.PP -It's important to keep in mind that you gain the benefits of eliminating -backing up only if you eliminate -.I every -instance of backing up. Leaving just one means you gain nothing. -.PP -.I Variable -trailing context (where both the leading and trailing parts do not have -a fixed length) entails almost the same performance loss as -.B REJECT -(i.e., substantial). So when possible a rule like: -.nf - - %% - mouse|rat/(cat|dog) run(); - -.fi -is better written: -.nf - - %% - mouse/cat|dog run(); - rat/cat|dog run(); - -.fi -or as -.nf - - %% - mouse|rat/cat run(); - mouse|rat/dog run(); - -.fi -Note that here the special '|' action does -.I not -provide any savings, and can even make things worse (see -Deficiencies / Bugs below). -.LP -Another area where the user can increase a scanner's performance -(and one that's easier to implement) arises from the fact that -the longer the tokens matched, the faster the scanner will run. -This is because with long tokens the processing of most input -characters takes place in the (short) inner scanning loop, and -does not often have to go through the additional work of setting up -the scanning environment (e.g., -.B yytext) -for the action. Recall the scanner for C comments: -.nf - - %x comment - %% - int line_num = 1; - - "/*" BEGIN(comment); - - <comment>[^*\\n]* - <comment>"*"+[^*/\\n]* - <comment>\\n ++line_num; - <comment>"*"+"/" BEGIN(INITIAL); - -.fi -This could be sped up by writing it as: -.nf - - %x comment - %% - int line_num = 1; - - "/*" BEGIN(comment); - - <comment>[^*\\n]* - <comment>[^*\\n]*\\n ++line_num; - <comment>"*"+[^*/\\n]* - <comment>"*"+[^*/\\n]*\\n ++line_num; - <comment>"*"+"/" BEGIN(INITIAL); - -.fi -Now instead of each newline requiring the processing of another -action, recognizing the newlines is "distributed" over the other rules -to keep the matched text as long as possible. Note that -.I adding -rules does -.I not -slow down the scanner! The speed of the scanner is independent -of the number of rules or (modulo the considerations given at the -beginning of this section) how complicated the rules are with -regard to operators such as '*' and '|'. -.PP -A final example in speeding up a scanner: suppose you want to scan -through a file containing identifiers and keywords, one per line -and with no other extraneous characters, and recognize all the -keywords. A natural first approach is: -.nf - - %% - asm | - auto | - break | - ... etc ... - volatile | - while /* it's a keyword */ - - .|\\n /* it's not a keyword */ - -.fi -To eliminate the back-tracking, introduce a catch-all rule: -.nf - - %% - asm | - auto | - break | - ... etc ... - volatile | - while /* it's a keyword */ - - [a-z]+ | - .|\\n /* it's not a keyword */ - -.fi -Now, if it's guaranteed that there's exactly one word per line, -then we can reduce the total number of matches by a half by -merging in the recognition of newlines with that of the other -tokens: -.nf - - %% - asm\\n | - auto\\n | - break\\n | - ... etc ... - volatile\\n | - while\\n /* it's a keyword */ - - [a-z]+\\n | - .|\\n /* it's not a keyword */ - -.fi -One has to be careful here, as we have now reintroduced backing up -into the scanner. In particular, while -.I we -know that there will never be any characters in the input stream -other than letters or newlines, -.I flex -can't figure this out, and it will plan for possibly needing to back up -when it has scanned a token like "auto" and then the next character -is something other than a newline or a letter. Previously it would -then just match the "auto" rule and be done, but now it has no "auto" -rule, only a "auto\\n" rule. To eliminate the possibility of backing up, -we could either duplicate all rules but without final newlines, or, -since we never expect to encounter such an input and therefore don't -how it's classified, we can introduce one more catch-all rule, this -one which doesn't include a newline: -.nf - - %% - asm\\n | - auto\\n | - break\\n | - ... etc ... - volatile\\n | - while\\n /* it's a keyword */ - - [a-z]+\\n | - [a-z]+ | - .|\\n /* it's not a keyword */ - -.fi -Compiled with -.B \-Cf, -this is about as fast as one can get a -.I flex -scanner to go for this particular problem. -.PP -A final note: -.I flex -is slow when matching NUL's, particularly when a token contains -multiple NUL's. -It's best to write rules which match -.I short -amounts of text if it's anticipated that the text will often include NUL's. -.PP -Another final note regarding performance: as mentioned above in the section -How the Input is Matched, dynamically resizing -.B yytext -to accommodate huge tokens is a slow process because it presently requires that -the (huge) token be rescanned from the beginning. Thus if performance is -vital, you should attempt to match "large" quantities of text but not -"huge" quantities, where the cutoff between the two is at about 8K -characters/token. -.SH GENERATING C++ SCANNERS -.I flex -provides two different ways to generate scanners for use with C++. The -first way is to simply compile a scanner generated by -.I flex -using a C++ compiler instead of a C compiler. You should not encounter -any compilations errors (please report any you find to the email address -given in the Author section below). You can then use C++ code in your -rule actions instead of C code. Note that the default input source for -your scanner remains -.I yyin, -and default echoing is still done to -.I yyout. -Both of these remain -.I FILE * -variables and not C++ -.I streams. -.PP -You can also use -.I flex -to generate a C++ scanner class, using the -.B \-+ -option (or, equivalently, -.B %option c++), -which is automatically specified if the name of the flex -executable ends in a '+', such as -.I flex++. -When using this option, flex defaults to generating the scanner to the file -.B lex.yy.cc -instead of -.B lex.yy.c. -The generated scanner includes the header file -.I FlexLexer.h, -which defines the interface to two C++ classes. -.PP -The first class, -.B FlexLexer, -provides an abstract base class defining the general scanner class -interface. It provides the following member functions: -.TP -.B const char* YYText() -returns the text of the most recently matched token, the equivalent of -.B yytext. -.TP -.B int YYLeng() -returns the length of the most recently matched token, the equivalent of -.B yyleng. -.TP -.B int lineno() const -returns the current input line number -(see -.B %option yylineno), -or -.B 1 -if -.B %option yylineno -was not used. -.TP -.B void set_debug( int flag ) -sets the debugging flag for the scanner, equivalent to assigning to -.B yy_flex_debug -(see the Options section above). Note that you must build the scanner -using -.B %option debug -to include debugging information in it. -.TP -.B int debug() const -returns the current setting of the debugging flag. -.PP -Also provided are member functions equivalent to -.B yy_switch_to_buffer(), -.B yy_create_buffer() -(though the first argument is an -.B istream* -object pointer and not a -.B FILE*), -.B yy_flush_buffer(), -.B yy_delete_buffer(), -and -.B yyrestart() -(again, the first argument is a -.B istream* -object pointer). -.PP -The second class defined in -.I FlexLexer.h -is -.B yyFlexLexer, -which is derived from -.B FlexLexer. -It defines the following additional member functions: -.TP -.B -yyFlexLexer( istream* arg_yyin = 0, ostream* arg_yyout = 0 ) -constructs a -.B yyFlexLexer -object using the given streams for input and output. If not specified, -the streams default to -.B cin -and -.B cout, -respectively. -.TP -.B virtual int yylex() -performs the same role is -.B yylex() -does for ordinary flex scanners: it scans the input stream, consuming -tokens, until a rule's action returns a value. If you derive a subclass -.B S -from -.B yyFlexLexer -and want to access the member functions and variables of -.B S -inside -.B yylex(), -then you need to use -.B %option yyclass="S" -to inform -.I flex -that you will be using that subclass instead of -.B yyFlexLexer. -In this case, rather than generating -.B yyFlexLexer::yylex(), -.I flex -generates -.B S::yylex() -(and also generates a dummy -.B yyFlexLexer::yylex() -that calls -.B yyFlexLexer::LexerError() -if called). -.TP -.B -virtual void switch_streams(istream* new_in = 0, -.B -ostream* new_out = 0) -reassigns -.B yyin -to -.B new_in -(if non-nil) -and -.B yyout -to -.B new_out -(ditto), deleting the previous input buffer if -.B yyin -is reassigned. -.TP -.B -int yylex( istream* new_in, ostream* new_out = 0 ) -first switches the input streams via -.B switch_streams( new_in, new_out ) -and then returns the value of -.B yylex(). -.PP -In addition, -.B yyFlexLexer -defines the following protected virtual functions which you can redefine -in derived classes to tailor the scanner: -.TP -.B -virtual int LexerInput( char* buf, int max_size ) -reads up to -.B max_size -characters into -.B buf -and returns the number of characters read. To indicate end-of-input, -return 0 characters. Note that "interactive" scanners (see the -.B \-B -and -.B \-I -flags) define the macro -.B YY_INTERACTIVE. -If you redefine -.B LexerInput() -and need to take different actions depending on whether or not -the scanner might be scanning an interactive input source, you can -test for the presence of this name via -.B #ifdef. -.TP -.B -virtual void LexerOutput( const char* buf, int size ) -writes out -.B size -characters from the buffer -.B buf, -which, while NUL-terminated, may also contain "internal" NUL's if -the scanner's rules can match text with NUL's in them. -.TP -.B -virtual void LexerError( const char* msg ) -reports a fatal error message. The default version of this function -writes the message to the stream -.B cerr -and exits. -.PP -Note that a -.B yyFlexLexer -object contains its -.I entire -scanning state. Thus you can use such objects to create reentrant -scanners. You can instantiate multiple instances of the same -.B yyFlexLexer -class, and you can also combine multiple C++ scanner classes together -in the same program using the -.B \-P -option discussed above. -.PP -Finally, note that the -.B %array -feature is not available to C++ scanner classes; you must use -.B %pointer -(the default). -.PP -Here is an example of a simple C++ scanner: -.nf - - // An example of using the flex C++ scanner class. - - %{ - int mylineno = 0; - %} - - string \\"[^\\n"]+\\" - - ws [ \\t]+ - - alpha [A-Za-z] - dig [0-9] - name ({alpha}|{dig}|\\$)({alpha}|{dig}|[_.\\-/$])* - num1 [-+]?{dig}+\\.?([eE][-+]?{dig}+)? - num2 [-+]?{dig}*\\.{dig}+([eE][-+]?{dig}+)? - number {num1}|{num2} - - %% - - {ws} /* skip blanks and tabs */ - - "/*" { - int c; - - while((c = yyinput()) != 0) - { - if(c == '\\n') - ++mylineno; - - else if(c == '*') - { - if((c = yyinput()) == '/') - break; - else - unput(c); - } - } - } - - {number} cout << "number " << YYText() << '\\n'; - - \\n mylineno++; - - {name} cout << "name " << YYText() << '\\n'; - - {string} cout << "string " << YYText() << '\\n'; - - %% - - int main( int /* argc */, char** /* argv */ ) - { - FlexLexer* lexer = new yyFlexLexer; - while(lexer->yylex() != 0) - ; - return 0; - } -.fi -If you want to create multiple (different) lexer classes, you use the -.B \-P -flag (or the -.B prefix= -option) to rename each -.B yyFlexLexer -to some other -.B xxFlexLexer. -You then can include -.B <FlexLexer.h> -in your other sources once per lexer class, first renaming -.B yyFlexLexer -as follows: -.nf - - #undef yyFlexLexer - #define yyFlexLexer xxFlexLexer - #include <FlexLexer.h> - - #undef yyFlexLexer - #define yyFlexLexer zzFlexLexer - #include <FlexLexer.h> - -.fi -if, for example, you used -.B %option prefix="xx" -for one of your scanners and -.B %option prefix="zz" -for the other. -.PP -IMPORTANT: the present form of the scanning class is -.I experimental -and may change considerably between major releases. -.SH INCOMPATIBILITIES WITH LEX AND POSIX -.I flex -is a rewrite of the AT&T Unix -.I lex -tool (the two implementations do not share any code, though), -with some extensions and incompatibilities, both of which -are of concern to those who wish to write scanners acceptable -to either implementation. Flex is fully compliant with the POSIX -.I lex -specification, except that when using -.B %pointer -(the default), a call to -.B unput() -destroys the contents of -.B yytext, -which is counter to the POSIX specification. -.PP -In this section we discuss all of the known areas of incompatibility -between flex, AT&T lex, and the POSIX specification. -.PP -.I flex's -.B \-l -option turns on maximum compatibility with the original AT&T -.I lex -implementation, at the cost of a major loss in the generated scanner's -performance. We note below which incompatibilities can be overcome -using the -.B \-l -option. -.PP -.I flex -is fully compatible with -.I lex -with the following exceptions: -.IP - -The undocumented -.I lex -scanner internal variable -.B yylineno -is not supported unless -.B \-l -or -.B %option yylineno -is used. -.IP -.B yylineno -should be maintained on a per-buffer basis, rather than a per-scanner -(single global variable) basis. -.IP -.B yylineno -is not part of the POSIX specification. -.IP - -The -.B input() -routine is not redefinable, though it may be called to read characters -following whatever has been matched by a rule. If -.B input() -encounters an end-of-file the normal -.B yywrap() -processing is done. A ``real'' end-of-file is returned by -.B input() -as -.I EOF. -.IP -Input is instead controlled by defining the -.B YY_INPUT -macro. -.IP -The -.I flex -restriction that -.B input() -cannot be redefined is in accordance with the POSIX specification, -which simply does not specify any way of controlling the -scanner's input other than by making an initial assignment to -.I yyin. -.IP - -The -.B unput() -routine is not redefinable. This restriction is in accordance with POSIX. -.IP - -.I flex -scanners are not as reentrant as -.I lex -scanners. In particular, if you have an interactive scanner and -an interrupt handler which long-jumps out of the scanner, and -the scanner is subsequently called again, you may get the following -message: -.nf - - fatal flex scanner internal error--end of buffer missed - -.fi -To reenter the scanner, first use -.nf - - yyrestart( yyin ); - -.fi -Note that this call will throw away any buffered input; usually this -isn't a problem with an interactive scanner. -.IP -Also note that flex C++ scanner classes -.I are -reentrant, so if using C++ is an option for you, you should use -them instead. See "Generating C++ Scanners" above for details. -.IP - -.B output() -is not supported. -Output from the -.B ECHO -macro is done to the file-pointer -.I yyout -(default -.I stdout). -.IP -.B output() -is not part of the POSIX specification. -.IP - -.I lex -does not support exclusive start conditions (%x), though they -are in the POSIX specification. -.IP - -When definitions are expanded, -.I flex -encloses them in parentheses. -With lex, the following: -.nf - - NAME [A-Z][A-Z0-9]* - %% - foo{NAME}? printf( "Found it\\n" ); - %% - -.fi -will not match the string "foo" because when the macro -is expanded the rule is equivalent to "foo[A-Z][A-Z0-9]*?" -and the precedence is such that the '?' is associated with -"[A-Z0-9]*". With -.I flex, -the rule will be expanded to -"foo([A-Z][A-Z0-9]*)?" and so the string "foo" will match. -.IP -Note that if the definition begins with -.B ^ -or ends with -.B $ -then it is -.I not -expanded with parentheses, to allow these operators to appear in -definitions without losing their special meanings. But the -.B <s>, /, -and -.B <<EOF>> -operators cannot be used in a -.I flex -definition. -.IP -Using -.B \-l -results in the -.I lex -behavior of no parentheses around the definition. -.IP -The POSIX specification is that the definition be enclosed in parentheses. -.IP - -Some implementations of -.I lex -allow a rule's action to begin on a separate line, if the rule's pattern -has trailing whitespace: -.nf - - %% - foo|bar<space here> - { foobar_action(); } - -.fi -.I flex -does not support this feature. -.IP - -The -.I lex -.B %r -(generate a Ratfor scanner) option is not supported. It is not part -of the POSIX specification. -.IP - -After a call to -.B unput(), -.I yytext -is undefined until the next token is matched, unless the scanner -was built using -.B %array. -This is not the case with -.I lex -or the POSIX specification. The -.B \-l -option does away with this incompatibility. -.IP - -The precedence of the -.B {} -(numeric range) operator is different. -.I lex -interprets "abc{1,3}" as "match one, two, or -three occurrences of 'abc'", whereas -.I flex -interprets it as "match 'ab' -followed by one, two, or three occurrences of 'c'". The latter is -in agreement with the POSIX specification. -.IP - -The precedence of the -.B ^ -operator is different. -.I lex -interprets "^foo|bar" as "match either 'foo' at the beginning of a line, -or 'bar' anywhere", whereas -.I flex -interprets it as "match either 'foo' or 'bar' if they come at the beginning -of a line". The latter is in agreement with the POSIX specification. -.IP - -The special table-size declarations such as -.B %a -supported by -.I lex -are not required by -.I flex -scanners; -.I flex -ignores them. -.IP - -The name -.B -FLEX_SCANNER -is #define'd so scanners may be written for use with either -.I flex -or -.I lex. -Scanners also include -.B YY_FLEX_MAJOR_VERSION -and -.B YY_FLEX_MINOR_VERSION -indicating which version of -.I flex -generated the scanner -(for example, for the 2.5 release, these defines would be 2 and 5 -respectively). -.PP -The following -.I flex -features are not included in -.I lex -or the POSIX specification: -.nf - - C++ scanners - %option - start condition scopes - start condition stacks - interactive/non-interactive scanners - yy_scan_string() and friends - yyterminate() - yy_set_interactive() - yy_set_bol() - YY_AT_BOL() - <<EOF>> - <*> - YY_DECL - YY_START - YY_USER_ACTION - YY_USER_INIT - #line directives - %{}'s around actions - multiple actions on a line - -.fi -plus almost all of the flex flags. -The last feature in the list refers to the fact that with -.I flex -you can put multiple actions on the same line, separated with -semi-colons, while with -.I lex, -the following -.nf - - foo handle_foo(); ++num_foos_seen; - -.fi -is (rather surprisingly) truncated to -.nf - - foo handle_foo(); - -.fi -.I flex -does not truncate the action. Actions that are not enclosed in -braces are simply terminated at the end of the line. -.SH DIAGNOSTICS -.PP -.I warning, rule cannot be matched -indicates that the given rule -cannot be matched because it follows other rules that will -always match the same text as it. For -example, in the following "foo" cannot be matched because it comes after -an identifier "catch-all" rule: -.nf - - [a-z]+ got_identifier(); - foo got_foo(); - -.fi -Using -.B REJECT -in a scanner suppresses this warning. -.PP -.I warning, -.B \-s -.I -option given but default rule can be matched -means that it is possible (perhaps only in a particular start condition) -that the default rule (match any single character) is the only one -that will match a particular input. Since -.B \-s -was given, presumably this is not intended. -.PP -.I reject_used_but_not_detected undefined -or -.I yymore_used_but_not_detected undefined - -These errors can occur at compile time. They indicate that the -scanner uses -.B REJECT -or -.B yymore() -but that -.I flex -failed to notice the fact, meaning that -.I flex -scanned the first two sections looking for occurrences of these actions -and failed to find any, but somehow you snuck some in (via a #include -file, for example). Use -.B %option reject -or -.B %option yymore -to indicate to flex that you really do use these features. -.PP -.I flex scanner jammed - -a scanner compiled with -.B \-s -has encountered an input string which wasn't matched by -any of its rules. This error can also occur due to internal problems. -.PP -.I token too large, exceeds YYLMAX - -your scanner uses -.B %array -and one of its rules matched a string longer than the -.B YYLMAX -constant (8K bytes by default). You can increase the value by -#define'ing -.B YYLMAX -in the definitions section of your -.I flex -input. -.PP -.I scanner requires \-8 flag to -.I use the character 'x' - -Your scanner specification includes recognizing the 8-bit character -.I 'x' -and you did not specify the \-8 flag, and your scanner defaulted to 7-bit -because you used the -.B \-Cf -or -.B \-CF -table compression options. See the discussion of the -.B \-7 -flag for details. -.PP -.I flex scanner push-back overflow - -you used -.B unput() -to push back so much text that the scanner's buffer could not hold -both the pushed-back text and the current token in -.B yytext. -Ideally the scanner should dynamically resize the buffer in this case, but at -present it does not. -.PP -.I -input buffer overflow, can't enlarge buffer because scanner uses REJECT - -the scanner was working on matching an extremely large token and needed -to expand the input buffer. This doesn't work with scanners that use -.B -REJECT. -.PP -.I -fatal flex scanner internal error--end of buffer missed - -This can occur in an scanner which is reentered after a long-jump -has jumped out (or over) the scanner's activation frame. Before -reentering the scanner, use: -.nf - - yyrestart( yyin ); - -.fi -or, as noted above, switch to using the C++ scanner class. -.PP -.I too many start conditions in <> construct! - -you listed more start conditions in a <> construct than exist (so -you must have listed at least one of them twice). -.SH FILES -.TP -.B \-lfl -library with which scanners must be linked. -.TP -.I lex.yy.c -generated scanner (called -.I lexyy.c -on some systems). -.TP -.I lex.yy.cc -generated C++ scanner class, when using -.B -+. -.TP -.I <FlexLexer.h> -header file defining the C++ scanner base class, -.B FlexLexer, -and its derived class, -.B yyFlexLexer. -.TP -.I flex.skl -skeleton scanner. This file is only used when building flex, not when -flex executes. -.TP -.I lex.backup -backing-up information for -.B \-b -flag (called -.I lex.bck -on some systems). -.SH DEFICIENCIES / BUGS -.PP -Some trailing context -patterns cannot be properly matched and generate -warning messages ("dangerous trailing context"). These are -patterns where the ending of the -first part of the rule matches the beginning of the second -part, such as "zx*/xy*", where the 'x*' matches the 'x' at -the beginning of the trailing context. (Note that the POSIX draft -states that the text matched by such patterns is undefined.) -.PP -For some trailing context rules, parts which are actually fixed-length are -not recognized as such, leading to the abovementioned performance loss. -In particular, parts using '|' or {n} (such as "foo{3}") are always -considered variable-length. -.PP -Combining trailing context with the special '|' action can result in -.I fixed -trailing context being turned into the more expensive -.I variable -trailing context. For example, in the following: -.nf - - %% - abc | - xyz/def - -.fi -.PP -Use of -.B unput() -invalidates yytext and yyleng, unless the -.B %array -directive -or the -.B \-l -option has been used. -.PP -Pattern-matching of NUL's is substantially slower than matching other -characters. -.PP -Dynamic resizing of the input buffer is slow, as it entails rescanning -all the text matched so far by the current (generally huge) token. -.PP -Due to both buffering of input and read-ahead, you cannot intermix -calls to <stdio.h> routines, such as, for example, -.B getchar(), -with -.I flex -rules and expect it to work. Call -.B input() -instead. -.PP -The total table entries listed by the -.B \-v -flag excludes the number of table entries needed to determine -what rule has been matched. The number of entries is equal -to the number of DFA states if the scanner does not use -.B REJECT, -and somewhat greater than the number of states if it does. -.PP -.B REJECT -cannot be used with the -.B \-f -or -.B \-F -options. -.PP -The -.I flex -internal algorithms need documentation. -.SH SEE ALSO -.PP -lex(1), yacc(1), sed(1), awk(1). -.PP -John Levine, Tony Mason, and Doug Brown, -.I Lex & Yacc, -O'Reilly and Associates. Be sure to get the 2nd edition. -.PP -M. E. Lesk and E. Schmidt, -.I LEX \- Lexical Analyzer Generator -.PP -Alfred Aho, Ravi Sethi and Jeffrey Ullman, -.I Compilers: Principles, Techniques and Tools, -Addison-Wesley (1986). Describes the pattern-matching techniques used by -.I flex -(deterministic finite automata). -.SH AUTHOR -Vern Paxson, with the help of many ideas and much inspiration from -Van Jacobson. Original version by Jef Poskanzer. The fast table -representation is a partial implementation of a design done by Van -Jacobson. The implementation was done by Kevin Gong and Vern Paxson. -.PP -Thanks to the many -.I flex -beta-testers, feedbackers, and contributors, especially Francois Pinard, -Casey Leedom, -Robert Abramovitz, -Stan Adermann, Terry Allen, David Barker-Plummer, John Basrai, -Neal Becker, Nelson H.F. Beebe, benson@odi.com, -Karl Berry, Peter A. Bigot, Simon Blanchard, -Keith Bostic, Frederic Brehm, Ian Brockbank, Kin Cho, Nick Christopher, -Brian Clapper, J.T. Conklin, -Jason Coughlin, Bill Cox, Nick Cropper, Dave Curtis, Scott David -Daniels, Chris G. Demetriou, Theo Deraadt, -Mike Donahue, Chuck Doucette, Tom Epperly, Leo Eskin, -Chris Faylor, Chris Flatters, Jon Forrest, Jeffrey Friedl, -Joe Gayda, Kaveh R. Ghazi, Wolfgang Glunz, -Eric Goldman, Christopher M. Gould, Ulrich Grepel, Peer Griebel, -Jan Hajic, Charles Hemphill, NORO Hideo, -Jarkko Hietaniemi, Scott Hofmann, -Jeff Honig, Dana Hudes, Eric Hughes, John Interrante, -Ceriel Jacobs, Michal Jaegermann, Sakari Jalovaara, Jeffrey R. Jones, -Henry Juengst, Klaus Kaempf, Jonathan I. Kamens, Terrence O Kane, -Amir Katz, ken@ken.hilco.com, Kevin B. Kenny, -Steve Kirsch, Winfried Koenig, Marq Kole, Ronald Lamprecht, -Greg Lee, Rohan Lenard, Craig Leres, John Levine, Steve Liddle, -David Loffredo, Mike Long, -Mohamed el Lozy, Brian Madsen, Malte, Joe Marshall, -Bengt Martensson, Chris Metcalf, -Luke Mewburn, Jim Meyering, R. Alexander Milowski, Erik Naggum, -G.T. Nicol, Landon Noll, James Nordby, Marc Nozell, -Richard Ohnemus, Karsten Pahnke, -Sven Panne, Roland Pesch, Walter Pelissero, Gaumond -Pierre, Esmond Pitt, Jef Poskanzer, Joe Rahmeh, Jarmo Raiha, -Frederic Raimbault, Pat Rankin, Rick Richardson, -Kevin Rodgers, Kai Uwe Rommel, Jim Roskind, Alberto Santini, -Andreas Scherer, Darrell Schiebel, Raf Schietekat, -Doug Schmidt, Philippe Schnoebelen, Andreas Schwab, -Larry Schwimmer, Alex Siegel, Eckehard Stolz, Jan-Erik Strvmquist, -Mike Stump, Paul Stuart, Dave Tallman, Ian Lance Taylor, -Chris Thewalt, Richard M. Timoney, Jodi Tsai, -Paul Tuinenga, Gary Weik, Frank Whaley, Gerhard Wilhelms, Kent Williams, Ken -Yap, Ron Zellar, Nathan Zelle, David Zuhn, -and those whose names have slipped my marginal -mail-archiving skills but whose contributions are appreciated all the -same. -.PP -Thanks to Keith Bostic, Jon Forrest, Noah Friedman, -John Gilmore, Craig Leres, John Levine, Bob Mulcahy, G.T. -Nicol, Francois Pinard, Rich Salz, and Richard Stallman for help with various -distribution headaches. -.PP -Thanks to Esmond Pitt and Earle Horton for 8-bit character support; to -Benson Margulies and Fred Burke for C++ support; to Kent Williams and Tom -Epperly for C++ class support; to Ove Ewerlid for support of NUL's; and to -Eric Hughes for support of multiple buffers. -.PP -This work was primarily done when I was with the Real Time Systems Group -at the Lawrence Berkeley Laboratory in Berkeley, CA. Many thanks to all there -for the support I received. -.PP -Send comments to vern@ee.lbl.gov. diff --git a/to.do/unicode/flex.skl b/to.do/unicode/flex.skl deleted file mode 100644 index 9b527ec..0000000 --- a/to.do/unicode/flex.skl +++ /dev/null @@ -1,1542 +0,0 @@ -/* A lexical scanner generated by flex */ - -/* Scanner skeleton version: - * $Header$ - */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 - -%- -#include <stdio.h> -%* - - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - - -#ifdef __cplusplus - -#include <stdlib.h> -%+ -class istream; -%* -#include <unistd.h> - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_PROTOS -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include <io.h> -#include <stdlib.h> -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#endif - -%% YY_CHAR and YY_SC_TO_UI() go here - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#define YY_BUF_SIZE 16384 - -typedef struct yy_buffer_state *YY_BUFFER_STATE; - -extern int yyleng; -%- -extern FILE *yyin, *yyout; -%* - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - *yy_cp = yy_hold_char; \ - YY_RESTORE_YY_MORE_OFFSET \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, yytext_ptr ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - - -struct yy_buffer_state - { -%- - FILE *yy_input_file; -%+ - istream* yy_input_file; -%* - - YY_CHAR *yy_ch_buf; /* input buffer */ - YY_CHAR *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - }; - -%- Standard (non-C++) definition -static YY_BUFFER_STATE yy_current_buffer = 0; -%* - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - - -%- Standard (non-C++) definition -/* yy_hold_char holds the character lost when yytext is formed. */ -static YY_CHAR yy_hold_char; - -static int yy_n_chars; /* number of characters read into yy_ch_buf */ - - -int yyleng; - -/* Points to current character in buffer. */ -static YY_CHAR *yy_c_buf_p = (YY_CHAR *) 0; -static int yy_init = 1; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void yyrestart YY_PROTO(( FILE *input_file )); - -void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void yy_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); -void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) - -YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( YY_CHAR *base, yy_size_t size )); -YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst YY_CHAR *yy_str )); - -/* This is the old yy_scan_bytes function - renamed to avoid - * confusion since a character may now be 1 or 2 bytes. - */ -YY_BUFFER_STATE yy_scan_chars YY_PROTO(( yyconst YY_CHAR *chars, int len )); -%* - -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); -static void yy_flex_free YY_PROTO(( void * )); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - -%% yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here - -%- Standard (non-C++) definition -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); -%* - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - yytext_ptr = yy_bp; \ -%% code to fiddle yytext and yyleng for yymore() goes here - yy_hold_char = *yy_cp; \ - *yy_cp = (YY_CHAR) '\0'; \ -%% code to copy yytext_ptr to yytext[] goes here, if %array - yy_c_buf_p = yy_cp; - -%% data tables for the DFA and the user's section 1 definitions go here - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap YY_PROTO(( void )); -#else -extern int yywrap YY_PROTO(( void )); -#endif -#endif - -%- -#ifndef YY_NO_UNPUT -static void yyunput YY_PROTO(( int c, YY_CHAR *buf_ptr )); -#endif -%* - -#ifndef yytext_ptr -static void yy_flex_strncpy YY_PROTO(( YY_CHAR *, yyconst YY_CHAR *, int )); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen YY_PROTO(( yyconst YY_CHAR * )); -#endif - -#ifndef YY_NO_INPUT -%- Standard (non-C++) definition -#ifdef __cplusplus -static int yyinput YY_PROTO(( void )); -#else -static int input YY_PROTO(( void )); -#endif -%* -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include <stdlib.h> -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -#ifndef ECHO -%- Standard (non-C++) definition -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void) fwrite( yytext, sizeof( YY_CHAR ), yyleng, yyout ) -%+ C++ definition -#define ECHO LexerOutput( yytext, yyleng ) -%* -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ -%% fread()/read() definition of YY_INPUT goes here unless we're doing C++ -%+ C++ definition - if ( (result = LexerInput( buf, max_size )) < 0 ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); -%* -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -%- -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -%+ -#define YY_FATAL_ERROR(msg) LexerError( msg ) -%* -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -%- Standard (non-C++) definition -#define YY_DECL int yylex YY_PROTO(( void )) -%+ C++ definition -#define YY_DECL int yyFlexLexer::yylex() -%* -#endif - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -%% YY_RULE_SETUP definition goes here - -YY_DECL - { - register yy_state_type yy_current_state; - register YY_CHAR *yy_cp, *yy_bp; - register int yy_act; - -%% user's declarations go here - - if ( yy_init ) - { - yy_init = 0; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yy_start ) - yy_start = 1; /* first start state */ - - if ( ! yyin ) -%- - yyin = stdin; -%+ - yyin = &cin; -%* - - if ( ! yyout ) -%- - yyout = stdout; -%+ - yyout = &cout; -%* - - if ( ! yy_current_buffer ) - yy_current_buffer = - yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_load_buffer_state(); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { -%% yymore()-related code goes here - yy_cp = yy_c_buf_p; - - /* Support of yytext. */ - *yy_cp = yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - -%% code to set up and find next match goes here - -yy_find_action: -%% code to find the action number goes here - - YY_DO_BEFORE_ACTION; - -%% code for yylineno update goes here - -do_action: /* This label is used only to access EOF actions. */ - -%% debug code goes here - - switch ( yy_act ) - { /* beginning of action switch */ -%% actions go here - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between yy_current_buffer and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = yyin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = yytext_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { -%% code to do back-up for compressed tables and set up yy_cp goes here - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; - - if ( yywrap() ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of yylex */ - -%+ -yyFlexLexer::yyFlexLexer( istream* arg_yyin, ostream* arg_yyout ) - { - yyin = arg_yyin; - yyout = arg_yyout; - yy_c_buf_p = 0; - yy_init = 1; - yy_start = 0; - yy_flex_debug = 0; - yylineno = 1; // this will only get updated if %option yylineno - - yy_did_buffer_switch_on_eof = 0; - - yy_looking_for_trail_begin = 0; - yy_more_flag = 0; - yy_more_len = 0; - yy_more_offset = yy_prev_more_offset = 0; - - yy_start_stack_ptr = yy_start_stack_depth = 0; - yy_start_stack = 0; - - yy_current_buffer = 0; - -#ifdef YY_USES_REJECT - yy_state_buf = new yy_state_type[YY_BUF_SIZE + 2]; -#else - yy_state_buf = 0; -#endif - } - -yyFlexLexer::~yyFlexLexer() - { - delete yy_state_buf; - yy_delete_buffer( yy_current_buffer ); - } - -void yyFlexLexer::switch_streams( istream* new_in, ostream* new_out ) - { - if ( new_in ) - { - yy_delete_buffer( yy_current_buffer ); - yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE ) ); - } - - if ( new_out ) - yyout = new_out; - } - -#ifdef YY_INTERACTIVE -int yyFlexLexer::LexerInput( YY_CHAR* buf, int /* max_size */ ) -#else -int yyFlexLexer::LexerInput( YY_CHAR* buf, int max_size ) -#endif - { - if ( yyin->eof() || yyin->fail() ) - return 0; - -#ifdef YY_INTERACTIVE - (void) yyin->read((unsigned char *) buf, sizeof( YY_CHAR ) ); - - if ( yyin->eof() ) - return 0; - - if ( yyin->bad() ) - return -1; - - return 1; - -#else - (void) yyin->read((unsigned char *) buf, max_size * sizeof( YY_CHAR ) ); - - if ( yyin->bad() ) - return -1; - else - return ( yyin->gcount() / sizeof( YY_CHAR ) ); -#endif - } - -void yyFlexLexer::LexerOutput( const YY_CHAR* buf, int size ) - { - (void) yyout->write((unsigned char *) buf, size * sizeof( YY_CHAR ) ); - } -%* - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - -%- -static int yy_get_next_buffer() -%+ -int yyFlexLexer::yy_get_next_buffer() -%* - { - register YY_CHAR *dest = yy_current_buffer->yy_ch_buf; - register YY_CHAR *source = yytext_ptr; - register int number_to_move, i; - int ret_val; - - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( yy_current_buffer->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_current_buffer->yy_n_chars = yy_n_chars = 0; - - else - { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; - - int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (YY_CHAR *) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - ( b->yy_buf_size + 2 ) * - sizeof( YY_CHAR ) ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = yy_current_buffer->yy_buf_size - - number_to_move - 1; -#endif - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); - - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - if ( yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; - } - - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -%- -static yy_state_type yy_get_previous_state() -%+ -yy_state_type yyFlexLexer::yy_get_previous_state() -%* - { - register yy_state_type yy_current_state; - register YY_CHAR *yy_cp; - -%% code to get the start state into yy_current_state goes here - - for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) - { -%% code to find the next state goes here - } - - return yy_current_state; - } - - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - -%- -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif -%+ -yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state ) -%* - { - register int yy_is_jam; -%% code to find the next state, and perhaps do backing up, goes here - - return yy_is_jam ? 0 : yy_current_state; - } - - -%- -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void yyunput( int c, register YY_CHAR *yy_bp ) -#else -static void yyunput( c, yy_bp ) -int c; -register YY_CHAR *yy_bp; -#endif -%+ -void yyFlexLexer::yyunput( int c, register YY_CHAR* yy_bp ) -%* - { - register YY_CHAR *yy_cp = yy_c_buf_p; - - /* undo effects of setting up yytext */ - *yy_cp = yy_hold_char; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register YY_CHAR *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; - register YY_CHAR *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; - - while ( source > yy_current_buffer->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - yy_current_buffer->yy_n_chars = - yy_n_chars = yy_current_buffer->yy_buf_size; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (YY_CHAR) c; - -%% update yylineno here - - yytext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -%- -#endif /* ifndef YY_NO_UNPUT */ -%* - - -%- -#ifdef __cplusplus -static int yyinput() -#else -static int input() -#endif -%+ -int yyFlexLexer::yyinput() -%* - { - int c; - - *yy_c_buf_p = yy_hold_char; - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - /* This was really a NUL. */ - *yy_c_buf_p = (YY_CHAR) '\0'; - - else - { /* need more input */ - int offset = yy_c_buf_p - yytext_ptr; - ++yy_c_buf_p; - - switch ( yy_get_next_buffer() ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); - - /* fall through */ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap() ) - return EOF; - - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + offset; - break; - } - } - } - - c = YY_SC_TO_UI(*yy_c_buf_p); - *yy_c_buf_p = (YY_CHAR) '\0'; /* preserve yytext */ - yy_hold_char = *++yy_c_buf_p; - -%% update BOL and yylineno - - return c; - } - - -%- -#ifdef YY_USE_PROTOS -void yyrestart( FILE *input_file ) -#else -void yyrestart( input_file ) -FILE *input_file; -#endif -%+ -void yyFlexLexer::yyrestart( istream* input_file ) -%* - { - if ( ! yy_current_buffer ) - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_init_buffer( yy_current_buffer, input_file ); - yy_load_buffer_state(); - } - - -%- -#ifdef YY_USE_PROTOS -void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void yy_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif -%+ -void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -%* - { - if ( yy_current_buffer == new_buffer ) - return; - - if ( yy_current_buffer ) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - yy_current_buffer = new_buffer; - yy_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - yy_did_buffer_switch_on_eof = 1; - } - - -%- -#ifdef YY_USE_PROTOS -void yy_load_buffer_state( void ) -#else -void yy_load_buffer_state() -#endif -%+ -void yyFlexLexer::yy_load_buffer_state() -%* - { - yy_n_chars = yy_current_buffer->yy_n_chars; - yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - yyin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } - - -%- -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE yy_create_buffer( file, size ) -FILE *file; -int size; -#endif -%+ -YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( istream* file, int size ) -%* - { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (YY_CHAR *) yy_flex_alloc( - ( b->yy_buf_size + 2 ) * sizeof( YY_CHAR ) ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer( b, file ); - - return b; - } - - -%- -#ifdef YY_USE_PROTOS -void yy_delete_buffer( YY_BUFFER_STATE b ) -#else -void yy_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif -%+ -void yyFlexLexer::yy_delete_buffer( YY_BUFFER_STATE b ) -%* - { - if ( ! b ) - return; - - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); - - yy_flex_free( (void *) b ); - } - - -%- -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO(( int )); -#endif -#endif - -#ifdef YY_USE_PROTOS -void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void yy_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif - -%+ -extern "C" int isatty YY_PROTO(( int )); -void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, istream* file ) -%* - - { - yy_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - -%- -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif -%+ - b->yy_is_interactive = 0; -%* - } - - -%- -#ifdef YY_USE_PROTOS -void yy_flush_buffer( YY_BUFFER_STATE b ) -#else -void yy_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif - -%+ -void yyFlexLexer::yy_flush_buffer( YY_BUFFER_STATE b ) -%* - { - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == yy_current_buffer ) - yy_load_buffer_state(); - } -%* - - -#ifndef YY_NO_SCAN_BUFFER -%- -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_buffer( YY_CHAR *base, yy_size_t size ) -#else -YY_BUFFER_STATE yy_scan_buffer( base, size ) -YY_CHAR *base; -yy_size_t size; -#endif - { - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer( b ); - - return b; - } -%* -#endif - - -#ifndef YY_NO_SCAN_STRING -%- -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_string( yyconst YY_CHAR *yy_str ) -#else -YY_BUFFER_STATE yy_scan_string( yy_str ) -yyconst YY_CHAR *yy_str; -#endif - { - int len; - for ( len = 0; yy_str[len]; ++len ) - ; - - return yy_scan_chars( yy_str, len ); - } -%* -#endif - - -#ifndef YY_NO_SCAN_BYTES -%- -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_chars( yyconst YY_CHAR *chars, int len ) -#else -YY_BUFFER_STATE yy_scan_chars( chars, len ) -yyconst YY_CHAR *chars; -int len; -#endif - { - YY_BUFFER_STATE b; - YY_CHAR *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (YY_CHAR *) yy_flex_alloc( n * sizeof( YY_CHAR ) ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_chars()" ); - - for ( i = 0; i < len; ++i ) - buf[i] = chars[i]; - - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_chars()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; - } -%* -#endif - - -#ifndef YY_NO_PUSH_STATE -%- -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static void yy_push_state( new_state ) -int new_state; -#endif -%+ -void yyFlexLexer::yy_push_state( int new_state ) -%* - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); - - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); - - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); - - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); - } -#endif - - -#ifndef YY_NO_POP_STATE -%- -static void yy_pop_state() -%+ -void yyFlexLexer::yy_pop_state() -%* - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif - - -#ifndef YY_NO_TOP_STATE -%- -static int yy_top_state() -%+ -int yyFlexLexer::yy_top_state() -%* - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -%- -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -YY_CHAR msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); - } - -%+ - -void yyFlexLexer::LexerError( yyconst char msg[] ) - { - cerr << msg << '\n'; - exit( YY_EXIT_FAILURE ); - } -%* - - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = (YY_CHAR) '\0'; \ - yyleng = n; \ - } \ - while ( 0 ) - - -/* Internal utility routines. */ - -#ifndef yytext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( YY_CHAR *s1, yyconst YY_CHAR *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -YY_CHAR *s1; -yyconst YY_CHAR *s2; -int n; -#endif - { - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; - } -#endif - -#ifdef YY_NEED_STRLEN -#ifdef YY_USE_PROTOS -static int yy_flex_strlen( yyconst YY_CHAR *s ) -#else -static int yy_flex_strlen( s ) -yyconst YY_CHAR *s; -#endif - { - register int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; - } -#endif - - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { - return (void *) malloc( size ); - } - -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); - } - -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } - -#if YY_MAIN -int main() - { - yylex(); - return 0; - } -#endif diff --git a/to.do/unicode/flexdef.h b/to.do/unicode/flexdef.h deleted file mode 100644 index 4fd3f7e..0000000 --- a/to.do/unicode/flexdef.h +++ /dev/null @@ -1,1062 +0,0 @@ -/* flexdef - definitions file for flex */ - -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Vern Paxson. - * - * The United States Government has rights in this work pursuant - * to contract no. DE-AC03-76SF00098 between the United States - * Department of Energy and the University of California. - * - * Redistribution and use in source and binary forms are permitted provided - * that: (1) source distributions retain this entire copyright notice and - * comment, and (2) distributions including binaries display the following - * acknowledgement: ``This product includes software developed by the - * University of California, Berkeley and its contributors'' in the - * documentation or other materials provided with the distribution and in - * all advertising materials mentioning features or use of this software. - * 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. - */ - -/* @(#) $Header$ (LBL) */ - -#include <stdio.h> -#include <ctype.h> - -#include "config.h" - -#ifdef __TURBOC__ -#define HAVE_STRING_H 1 -#define MS_DOS 1 -#ifndef __STDC__ -#define __STDC__ 1 -#endif - #pragma warn -pro - #pragma warn -rch - #pragma warn -use - #pragma warn -aus - #pragma warn -par - #pragma warn -pia -#endif - -#ifdef HAVE_STRING_H -#include <string.h> -#else -#include <strings.h> -#endif - -#ifdef HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif - -#ifdef HAVE_MALLOC_H -#include <malloc.h> -#endif - -#ifdef STDC_HEADERS -#include <stdlib.h> -#endif - -/* As an aid for the internationalization patch to flex, which - * is maintained outside this distribution for copyright reasons. - */ -#define _(String) (String) - -/* Always be prepared to generate an 16-bit scanner. */ -#define CSIZE 65536 -#define Char unsigned char - -/* Size of input alphabet - should be size of ASCII set. */ -#ifndef DEFAULT_CSIZE -#define DEFAULT_CSIZE 128 -#endif - -#ifndef PROTO -#if __STDC__ -#define PROTO(proto) proto -#else -#define PROTO(proto) () -#endif -#endif - -#ifdef VMS -#ifndef __VMS_POSIX -#define unlink remove -#define SHORT_FILE_NAMES -#endif -#endif - -#ifdef MS_DOS -#define SHORT_FILE_NAMES -#endif - -#ifdef _WIN32 -#if __STDC__ -#define unlink _unlink -#define isatty _isatty -#define fileno _fileno -#endif -#endif - - -/* Maximum line length we'll have to deal with. */ -#define MAXLINE 2048 - -#ifndef MIN -#define MIN(x,y) ((x) < (y) ? (x) : (y)) -#endif -#ifndef MAX -#define MAX(x,y) ((x) > (y) ? (x) : (y)) -#endif -#ifndef ABS -#define ABS(x) ((x) < 0 ? -(x) : (x)) -#endif - - -/* ANSI C does not guarantee that isascii() is defined */ -#ifndef isascii -#define isascii(c) ((c) <= 0177) -#endif - - -#define true 1 -#define false 0 -#define unspecified -1 - - -/* Special chk[] values marking the slots taking by end-of-buffer and action - * numbers. - */ -#define EOB_POSITION -1 -#define ACTION_POSITION -2 - -/* Number of data items per line for -f output. */ -#define NUMDATAITEMS 10 - -/* Number of lines of data in -f output before inserting a blank line for - * readability. - */ -#define NUMDATALINES 10 - -/* transition_struct_out() definitions. */ -#define TRANS_STRUCT_PRINT_LENGTH 14 - -/* Returns true if an nfa state has an epsilon out-transition slot - * that can be used. This definition is currently not used. - */ -#define FREE_EPSILON(state) \ - (transchar[state] == SYM_EPSILON && \ - trans2[state] == NO_TRANSITION && \ - finalst[state] != state) - -/* Returns true if an nfa state has an epsilon out-transition character - * and both slots are free - */ -#define SUPER_FREE_EPSILON(state) \ - (transchar[state] == SYM_EPSILON && \ - trans1[state] == NO_TRANSITION) \ - -/* Maximum number of NFA states that can comprise a DFA state. It's real - * big because if there's a lot of rules, the initial state will have a - * huge epsilon closure. - */ -#define INITIAL_MAX_DFA_SIZE 750 -#define MAX_DFA_SIZE_INCREMENT 750 - - -/* A note on the following masks. They are used to mark accepting numbers - * as being special. As such, they implicitly limit the number of accepting - * numbers (i.e., rules) because if there are too many rules the rule numbers - * will overload the mask bits. Fortunately, this limit is \large/ (0x2000 == - * 8192) so unlikely to actually cause any problems. A check is made in - * new_rule() to ensure that this limit is not reached. - */ - -/* Mask to mark a trailing context accepting number. */ -#define YY_TRAILING_MASK 0x2000 - -/* Mask to mark the accepting number of the "head" of a trailing context - * rule. - */ -#define YY_TRAILING_HEAD_MASK 0x4000 - -/* Maximum number of rules, as outlined in the above note. */ -#define MAX_RULE (YY_TRAILING_MASK - 1) - - -/* NIL must be 0. If not, its special meaning when making equivalence classes - * (it marks the representative of a given e.c.) will be unidentifiable. - */ -#define NIL 0 - -#define JAM -1 /* to mark a missing DFA transition */ -#define NO_TRANSITION NIL -#define UNIQUE -1 /* marks a symbol as an e.c. representative */ -#define INFINITY -1 /* for x{5,} constructions */ - -#define INITIAL_MAX_CCLS 100 /* max number of unique character classes */ -#define MAX_CCLS_INCREMENT 100 - -/* Size of table holding members of character classes. */ -#define INITIAL_MAX_CCL_TBL_SIZE 500 -#define MAX_CCL_TBL_SIZE_INCREMENT 250 - -#define INITIAL_MAX_RULES 100 /* default maximum number of rules */ -#define MAX_RULES_INCREMENT 100 - -#define INITIAL_MNS 2000 /* default maximum number of nfa states */ -#define MNS_INCREMENT 1000 /* amount to bump above by if it's not enough */ - -#define INITIAL_MAX_DFAS 1000 /* default maximum number of dfa states */ -#define MAX_DFAS_INCREMENT 1000 - -#define JAMSTATE -32766 /* marks a reference to the state that always jams */ - -/* Maximum number of NFA states. */ -#define MAXIMUM_MNS 31999 - -/* Enough so that if it's subtracted from an NFA state number, the result - * is guaranteed to be negative. - */ -#define MARKER_DIFFERENCE (MAXIMUM_MNS+2) - -/* Maximum number of nxt/chk pairs for non-templates. */ -#define INITIAL_MAX_XPAIRS 2000 -#define MAX_XPAIRS_INCREMENT 2000 - -/* Maximum number of nxt/chk pairs needed for templates. */ -#define INITIAL_MAX_TEMPLATE_XPAIRS 2500 -#define MAX_TEMPLATE_XPAIRS_INCREMENT 2500 - -#define SYM_EPSILON (CSIZE + 1) /* to mark transitions on the symbol epsilon */ - -#define INITIAL_MAX_SCS 40 /* maximum number of start conditions */ -#define MAX_SCS_INCREMENT 40 /* amount to bump by if it's not enough */ - -#define ONE_STACK_SIZE 500 /* stack of states with only one out-transition */ -#define SAME_TRANS -1 /* transition is the same as "default" entry for state */ - -/* The following percentages are used to tune table compression: - - * The percentage the number of out-transitions a state must be of the - * number of equivalence classes in order to be considered for table - * compaction by using protos. - */ -#define PROTO_SIZE_PERCENTAGE 15 - -/* The percentage the number of homogeneous out-transitions of a state - * must be of the number of total out-transitions of the state in order - * that the state's transition table is first compared with a potential - * template of the most common out-transition instead of with the first - * proto in the proto queue. - */ -#define CHECK_COM_PERCENTAGE 50 - -/* The percentage the number of differences between a state's transition - * table and the proto it was first compared with must be of the total - * number of out-transitions of the state in order to keep the first - * proto as a good match and not search any further. - */ -#define FIRST_MATCH_DIFF_PERCENTAGE 10 - -/* The percentage the number of differences between a state's transition - * table and the most similar proto must be of the state's total number - * of out-transitions to use the proto as an acceptable close match. - */ -#define ACCEPTABLE_DIFF_PERCENTAGE 50 - -/* The percentage the number of homogeneous out-transitions of a state - * must be of the number of total out-transitions of the state in order - * to consider making a template from the state. - */ -#define TEMPLATE_SAME_PERCENTAGE 60 - -/* The percentage the number of differences between a state's transition - * table and the most similar proto must be of the state's total number - * of out-transitions to create a new proto from the state. - */ -#define NEW_PROTO_DIFF_PERCENTAGE 20 - -/* The percentage the total number of out-transitions of a state must be - * of the number of equivalence classes in order to consider trying to - * fit the transition table into "holes" inside the nxt/chk table. - */ -#define INTERIOR_FIT_PERCENTAGE 15 - -/* Size of region set aside to cache the complete transition table of - * protos on the proto queue to enable quick comparisons. - */ -#define PROT_SAVE_SIZE 2000 - -#define MSP 50 /* maximum number of saved protos (protos on the proto queue) */ - -/* Maximum number of out-transitions a state can have that we'll rummage - * around through the interior of the internal fast table looking for a - * spot for it. - */ -#define MAX_XTIONS_FULL_INTERIOR_FIT 4 - -/* Maximum number of rules which will be reported as being associated - * with a DFA state. - */ -#define MAX_ASSOC_RULES 100 - -/* Number that, if used to subscript an array, has a good chance of producing - * an error; should be small enough to fit into a short. - */ -#define BAD_SUBSCRIPT -32767 - -/* Absolute value of largest number that can be stored in a short, with a - * bit of slop thrown in for general paranoia. - */ -#define MAX_SHORT 32700 - - -/* Declarations for global variables. */ - -/* Variables for symbol tables: - * sctbl - start-condition symbol table - * ndtbl - name-definition symbol table - * ccltab - character class text symbol table - */ - -struct hash_entry - { - struct hash_entry *prev, *next; - char *name; - char *str_val; - int int_val; - } ; - -typedef struct hash_entry **hash_table; - -#define NAME_TABLE_HASH_SIZE 101 -#define START_COND_HASH_SIZE 101 -#define CCL_HASH_SIZE 101 - -extern struct hash_entry *ndtbl[NAME_TABLE_HASH_SIZE]; -extern struct hash_entry *sctbl[START_COND_HASH_SIZE]; -extern struct hash_entry *ccltab[CCL_HASH_SIZE]; - - -/* Variables for flags: - * printstats - if true (-v), dump statistics - * syntaxerror - true if a syntax error has been found - * eofseen - true if we've seen an eof in the input file - * ddebug - if true (-d), make a "debug" scanner - * trace - if true (-T), trace processing - * nowarn - if true (-w), do not generate warnings - * spprdflt - if true (-s), suppress the default rule - * interactive - if true (-I), generate an interactive scanner - * caseins - if true (-i), generate a case-insensitive scanner - * lex_compat - if true (-l), maximize compatibility with AT&T lex - * do_yylineno - if true, generate code to maintain yylineno - * useecs - if true (-Ce flag), use equivalence classes - * fulltbl - if true (-Cf flag), don't compress the DFA state table - * usemecs - if true (-Cm flag), use meta-equivalence classes - * fullspd - if true (-F flag), use Jacobson method of table representation - * gen_line_dirs - if true (i.e., no -L flag), generate #line directives - * performance_report - if > 0 (i.e., -p flag), generate a report relating - * to scanner performance; if > 1 (-p -p), report on minor performance - * problems, too - * backing_up_report - if true (i.e., -b flag), generate "lex.backup" file - * listing backing-up states - * C_plus_plus - if true (i.e., -+ flag), generate a C++ scanner class; - * otherwise, a standard C scanner - * long_align - if true (-Ca flag), favor long-word alignment. - * use_read - if true (-f, -F, or -Cr) then use read() for scanner input; - * otherwise, use fread(). - * yytext_is_array - if true (i.e., %array directive), then declare - * yytext as a array instead of a character pointer. Nice and inefficient. - * do_yywrap - do yywrap() processing on EOF. If false, EOF treated as - * "no more files". - * csize - size of character set for the scanner we're generating; - * 128 for 7-bit chars and 256 for 8-bit - * yymore_used - if true, yymore() is used in input rules - * reject - if true, generate back-up tables for REJECT macro - * real_reject - if true, scanner really uses REJECT (as opposed to just - * having "reject" set for variable trailing context) - * continued_action - true if this rule's action is to "fall through" to - * the next rule's action (i.e., the '|' action) - * in_rule - true if we're inside an individual rule, false if not. - * yymore_really_used - whether to treat yymore() as really used, regardless - * of what we think based on references to it in the user's actions. - * reject_really_used - same for REJECT - */ - -extern int printstats, syntaxerror, eofseen, ddebug, trace, nowarn, spprdflt; -extern int interactive, caseins, lex_compat, do_yylineno; -extern int useecs, fulltbl, usemecs, fullspd; -extern int gen_line_dirs, performance_report, backing_up_report; -extern int C_plus_plus, long_align, use_read, yytext_is_array, do_yywrap; -extern int csize; -extern int yymore_used, reject, real_reject, continued_action, in_rule; - -extern int yymore_really_used, reject_really_used; - - -/* Variables used in the flex input routines: - * datapos - characters on current output line - * dataline - number of contiguous lines of data in current data - * statement. Used to generate readable -f output - * linenum - current input line number - * out_linenum - current output line number - * skelfile - the skeleton file - * skel - compiled-in skeleton array - * skel_ind - index into "skel" array, if skelfile is nil - * yyin - input file - * backing_up_file - file to summarize backing-up states to - * infilename - name of input file - * outfilename - name of output file - * did_outfilename - whether outfilename was explicitly set - * prefix - the prefix used for externally visible names ("yy" by default) - * yyclass - yyFlexLexer subclass to use for YY_DECL - * do_stdinit - whether to initialize yyin/yyout to stdin/stdout - * use_stdout - the -t flag - * input_files - array holding names of input files - * num_input_files - size of input_files array - * program_name - name with which program was invoked - * - * action_array - array to hold the rule actions - * action_size - size of action_array - * defs1_offset - index where the user's section 1 definitions start - * in action_array - * prolog_offset - index where the prolog starts in action_array - * action_offset - index where the non-prolog starts in action_array - * action_index - index where the next action should go, with respect - * to "action_array" - */ - -extern int datapos, dataline, linenum, out_linenum; -extern FILE *skelfile, *yyin, *backing_up_file; -extern const char *skel[]; -extern int skel_ind; -extern char *infilename, *outfilename; -extern int did_outfilename; -extern char *prefix, *yyclass; -extern int do_stdinit, use_stdout; -extern char **input_files; -extern int num_input_files; -extern char *program_name; - -extern char *action_array; -extern int action_size; -extern int defs1_offset, prolog_offset, action_offset, action_index; - - -/* Variables for stack of states having only one out-transition: - * onestate - state number - * onesym - transition symbol - * onenext - target state - * onedef - default base entry - * onesp - stack pointer - */ - -extern int onestate[ONE_STACK_SIZE], onesym[ONE_STACK_SIZE]; -extern int onenext[ONE_STACK_SIZE], onedef[ONE_STACK_SIZE], onesp; - - -/* Variables for nfa machine data: - * current_mns - current maximum on number of NFA states - * num_rules - number of the last accepting state; also is number of - * rules created so far - * num_eof_rules - number of <<EOF>> rules - * default_rule - number of the default rule - * current_max_rules - current maximum number of rules - * lastnfa - last nfa state number created - * firstst - physically the first state of a fragment - * lastst - last physical state of fragment - * finalst - last logical state of fragment - * transchar - transition character - * trans1 - transition state - * trans2 - 2nd transition state for epsilons - * accptnum - accepting number - * assoc_rule - rule associated with this NFA state (or 0 if none) - * state_type - a STATE_xxx type identifying whether the state is part - * of a normal rule, the leading state in a trailing context - * rule (i.e., the state which marks the transition from - * recognizing the text-to-be-matched to the beginning of - * the trailing context), or a subsequent state in a trailing - * context rule - * rule_type - a RULE_xxx type identifying whether this a ho-hum - * normal rule or one which has variable head & trailing - * context - * rule_linenum - line number associated with rule - * rule_useful - true if we've determined that the rule can be matched - */ - -extern int current_mns, current_max_rules; -extern int num_rules, num_eof_rules, default_rule, lastnfa; -extern int *firstst, *lastst, *finalst, *transchar, *trans1, *trans2; -extern int *accptnum, *assoc_rule, *state_type; -extern int *rule_type, *rule_linenum, *rule_useful; - -/* Different types of states; values are useful as masks, as well, for - * routines like check_trailing_context(). - */ -#define STATE_NORMAL 0x1 -#define STATE_TRAILING_CONTEXT 0x2 - -/* Global holding current type of state we're making. */ - -extern int current_state_type; - -/* Different types of rules. */ -#define RULE_NORMAL 0 -#define RULE_VARIABLE 1 - -/* True if the input rules include a rule with both variable-length head - * and trailing context, false otherwise. - */ -extern int variable_trailing_context_rules; - - -/* Variables for protos: - * numtemps - number of templates created - * numprots - number of protos created - * protprev - backlink to a more-recently used proto - * protnext - forward link to a less-recently used proto - * prottbl - base/def table entry for proto - * protcomst - common state of proto - * firstprot - number of the most recently used proto - * lastprot - number of the least recently used proto - * protsave contains the entire state array for protos - */ - -extern int numtemps, numprots, protprev[MSP], protnext[MSP], prottbl[MSP]; -extern int protcomst[MSP], firstprot, lastprot, protsave[PROT_SAVE_SIZE]; - - -/* Variables for managing equivalence classes: - * numecs - number of equivalence classes - * nextecm - forward link of Equivalence Class members - * ecgroup - class number or backward link of EC members - * nummecs - number of meta-equivalence classes (used to compress - * templates) - * tecfwd - forward link of meta-equivalence classes members - * tecbck - backward link of MEC's - */ - -/* Reserve enough room in the equivalence class arrays so that we - * can use the CSIZE'th element to hold equivalence class information - * for the NUL character. Later we'll move this information into - * the 0th element. - */ -extern int numecs, nextecm[CSIZE + 1], ecgroup[CSIZE + 1], nummecs; - -/* Meta-equivalence classes are indexed starting at 1, so it's possible - * that they will require positions from 1 .. CSIZE, i.e., CSIZE + 1 - * slots total (since the arrays are 0-based). nextecm[] and ecgroup[] - * don't require the extra position since they're indexed from 1 .. CSIZE - 1. - */ -extern int tecfwd[CSIZE + 1], tecbck[CSIZE + 1]; - - -/* Variables for start conditions: - * lastsc - last start condition created - * current_max_scs - current limit on number of start conditions - * scset - set of rules active in start condition - * scbol - set of rules active only at the beginning of line in a s.c. - * scxclu - true if start condition is exclusive - * sceof - true if start condition has EOF rule - * scname - start condition name - */ - -extern int lastsc, *scset, *scbol, *scxclu, *sceof; -extern int current_max_scs; -extern char **scname; - - -/* Variables for dfa machine data: - * current_max_dfa_size - current maximum number of NFA states in DFA - * current_max_xpairs - current maximum number of non-template xtion pairs - * current_max_template_xpairs - current maximum number of template pairs - * current_max_dfas - current maximum number DFA states - * lastdfa - last dfa state number created - * nxt - state to enter upon reading character - * chk - check value to see if "nxt" applies - * tnxt - internal nxt table for templates - * base - offset into "nxt" for given state - * def - where to go if "chk" disallows "nxt" entry - * nultrans - NUL transition for each state - * NUL_ec - equivalence class of the NUL character - * tblend - last "nxt/chk" table entry being used - * firstfree - first empty entry in "nxt/chk" table - * dss - nfa state set for each dfa - * dfasiz - size of nfa state set for each dfa - * dfaacc - accepting set for each dfa state (if using REJECT), or accepting - * number, if not - * accsiz - size of accepting set for each dfa state - * dhash - dfa state hash value - * numas - number of DFA accepting states created; note that this - * is not necessarily the same value as num_rules, which is the analogous - * value for the NFA - * numsnpairs - number of state/nextstate transition pairs - * jambase - position in base/def where the default jam table starts - * jamstate - state number corresponding to "jam" state - * end_of_buffer_state - end-of-buffer dfa state number - */ - -extern int current_max_dfa_size, current_max_xpairs; -extern int current_max_template_xpairs, current_max_dfas; -extern int lastdfa, *nxt, *chk, *tnxt; -extern int *base, *def, *nultrans, NUL_ec, tblend, firstfree, **dss, *dfasiz; -extern union dfaacc_union - { - int *dfaacc_set; - int dfaacc_state; - } *dfaacc; -extern int *accsiz, *dhash, numas; -extern int numsnpairs, jambase, jamstate; -extern int end_of_buffer_state; - -/* Variables for ccl information: - * lastccl - ccl index of the last created ccl - * current_maxccls - current limit on the maximum number of unique ccl's - * cclmap - maps a ccl index to its set pointer - * ccllen - gives the length of a ccl - * cclng - true for a given ccl if the ccl is negated - * cclreuse - counts how many times a ccl is re-used - * current_max_ccl_tbl_size - current limit on number of characters needed - * to represent the unique ccl's - * ccltbl - holds the characters in each ccl - indexed by cclmap - */ - -extern int lastccl, *cclmap, *ccllen, *cclng, cclreuse; -extern int current_maxccls, current_max_ccl_tbl_size; -extern wchar_t *ccltbl; - - -/* Variables for miscellaneous information: - * nmstr - last NAME scanned by the scanner - * sectnum - section number currently being parsed - * nummt - number of empty nxt/chk table entries - * hshcol - number of hash collisions detected by snstods - * dfaeql - number of times a newly created dfa was equal to an old one - * numeps - number of epsilon NFA states created - * eps2 - number of epsilon states which have 2 out-transitions - * num_reallocs - number of times it was necessary to realloc() a group - * of arrays - * tmpuses - number of DFA states that chain to templates - * totnst - total number of NFA states used to make DFA states - * peakpairs - peak number of transition pairs we had to store internally - * numuniq - number of unique transitions - * numdup - number of duplicate transitions - * hshsave - number of hash collisions saved by checking number of states - * num_backing_up - number of DFA states requiring backing up - * bol_needed - whether scanner needs beginning-of-line recognition - */ - -extern char nmstr[MAXLINE]; -extern int sectnum, nummt, hshcol, dfaeql, numeps, eps2, num_reallocs; -extern int tmpuses, totnst, peakpairs, numuniq, numdup, hshsave; -extern int num_backing_up, bol_needed; - -void *allocate_array PROTO((int, size_t)); -void *reallocate_array PROTO((void*, int, size_t)); - -void *flex_alloc PROTO((size_t)); -void *flex_realloc PROTO((void*, size_t)); -void flex_free PROTO((void*)); - -#define allocate_integer_array(size) \ - (int *) allocate_array( size, sizeof( int ) ) - -#define reallocate_integer_array(array,size) \ - (int *) reallocate_array( (void *) array, size, sizeof( int ) ) - -#define allocate_int_ptr_array(size) \ - (int **) allocate_array( size, sizeof( int * ) ) - -#define allocate_char_ptr_array(size) \ - (char **) allocate_array( size, sizeof( char * ) ) - -#define allocate_dfaacc_union(size) \ - (union dfaacc_union *) \ - allocate_array( size, sizeof( union dfaacc_union ) ) - -#define reallocate_int_ptr_array(array,size) \ - (int **) reallocate_array( (void *) array, size, sizeof( int * ) ) - -#define reallocate_char_ptr_array(array,size) \ - (char **) reallocate_array( (void *) array, size, sizeof( char * ) ) - -#define reallocate_dfaacc_union(array, size) \ - (union dfaacc_union *) \ - reallocate_array( (void *) array, size, sizeof( union dfaacc_union ) ) - -#define allocate_character_array(size) \ - (char *) allocate_array( size, sizeof( char ) ) - -#define reallocate_character_array(array,size) \ - (char *) reallocate_array( (void *) array, size, sizeof( char ) ) - -#define allocate_Character_array(size) \ - (Char *) allocate_array( size, sizeof( Char ) ) - -#define reallocate_Character_array(array,size) \ - (Char *) reallocate_array( (void *) array, size, sizeof( Char ) ) - -#define allocate_wchar_array(size) \ - (wchar_t *) allocate_array( size, sizeof( wchar_t ) ) - -#define reallocate_wchar_array(array,size) \ - (wchar_t *) reallocate_array( (void *) array, size, sizeof( wchar_t ) ) - - -/* Used to communicate between scanner and parser. The type should really - * be YYSTYPE, but we can't easily get our hands on it. - */ -extern int yylval; - - -/* External functions that are cross-referenced among the flex source files. */ - - -/* from file ccl.c */ - -extern void ccladd PROTO((int, int)); /* add a single character to a ccl */ -extern int cclinit PROTO((void)); /* make an empty ccl */ -extern void cclnegate PROTO((int)); /* negate a ccl */ - -/* List the members of a set of characters in CCL form. */ -extern void list_character_set PROTO((FILE*, int[])); - - -/* from file dfa.c */ - -/* Check a DFA state for backing up. */ -extern void check_for_backing_up PROTO((int, int[])); - -/* Check to see if NFA state set constitutes "dangerous" trailing context. */ -extern void check_trailing_context PROTO((int*, int, int*, int)); - -/* Construct the epsilon closure of a set of ndfa states. */ -extern int *epsclosure PROTO((int*, int*, int[], int*, int*)); - -/* Increase the maximum number of dfas. */ -extern void increase_max_dfas PROTO((void)); - -extern void ntod PROTO((void)); /* convert a ndfa to a dfa */ - -/* Converts a set of ndfa states into a dfa state. */ -extern int snstods PROTO((int[], int, int[], int, int, int*)); - - -/* from file ecs.c */ - -/* Convert character classes to set of equivalence classes. */ -extern void ccl2ecl PROTO((void)); - -/* Associate equivalence class numbers with class members. */ -extern int cre8ecs PROTO((int[], int[], int)); - -/* Update equivalence classes based on character class transitions. */ -extern void mkeccl PROTO((wchar_t[], int, int[], int[], int, int)); - -/* Create equivalence class for single character. */ -extern void mkechar PROTO((int, int[], int[])); - - -/* from file gen.c */ - -extern void do_indent PROTO((void)); /* indent to the current level */ - -/* Generate the code to keep backing-up information. */ -extern void gen_backing_up PROTO((void)); - -/* Generate the code to perform the backing up. */ -extern void gen_bu_action PROTO((void)); - -/* Generate full speed compressed transition table. */ -extern void genctbl PROTO((void)); - -/* Generate the code to find the action number. */ -extern void gen_find_action PROTO((void)); - -extern void genftbl PROTO((void)); /* generate full transition table */ - -/* Generate the code to find the next compressed-table state. */ -extern void gen_next_compressed_state PROTO((char*)); - -/* Generate the code to find the next match. */ -extern void gen_next_match PROTO((void)); - -/* Generate the code to find the next state. */ -extern void gen_next_state PROTO((int)); - -/* Generate the code to make a NUL transition. */ -extern void gen_NUL_trans PROTO((void)); - -/* Generate the code to find the start state. */ -extern void gen_start_state PROTO((void)); - -/* Generate data statements for the transition tables. */ -extern void gentabs PROTO((void)); - -/* Write out a formatted string at the current indentation level. */ -extern void indent_put2s PROTO((char[], char[])); - -/* Write out a string + newline at the current indentation level. */ -extern void indent_puts PROTO((char[])); - -extern void make_tables PROTO((void)); /* generate transition tables */ - - -/* from file main.c */ - -extern void check_options PROTO((void)); -extern void flexend PROTO((int)); -extern void usage PROTO((void)); - - -/* from file misc.c */ - -/* Add a #define to the action file. */ -extern void action_define PROTO(( char *defname, int value )); - -/* Add the given text to the stored actions. */ -extern void add_action PROTO(( char *new_text )); - -/* True if a string is all lower case. */ -extern int all_lower PROTO((register char *)); - -/* True if a string is all upper case. */ -extern int all_upper PROTO((register char *)); - -/* Bubble sort an integer array. */ -extern void bubble PROTO((int [], int)); - -/* Check a character to make sure it's in the expected range. */ -extern void check_char PROTO((int c)); - -/* Replace upper-case letter to lower-case. */ -extern Char clower PROTO((int)); - -/* Returns a dynamically allocated copy of a string. */ -extern char *copy_string PROTO((register const char *)); - -/* Returns a dynamically allocated copy of a (potentially) unsigned string. */ -extern Char *copy_unsigned_string PROTO((register Char *)); - -/* Shell sort a character array. */ -extern void cshell PROTO((wchar_t[], int, int)); - -/* Finish up a block of data declarations. */ -extern void dataend PROTO((void)); - -/* Flush generated data statements. */ -extern void dataflush PROTO((void)); - -/* Report an error message and terminate. */ -extern void flexerror PROTO((const char[])); - -/* Report a fatal error message and terminate. */ -extern void flexfatal PROTO((const char[])); - -/* Convert a hexadecimal digit string to an integer value. */ -extern int htoi PROTO((Char[])); - -/* Report an error message formatted with one integer argument. */ -extern void lerrif PROTO((const char[], int)); - -/* Report an error message formatted with one string argument. */ -extern void lerrsf PROTO((const char[], const char[])); - -/* Spit out a "#line" statement. */ -extern void line_directive_out PROTO((FILE*, int)); - -/* Mark the current position in the action array as the end of the section 1 - * user defs. - */ -extern void mark_defs1 PROTO((void)); - -/* Mark the current position in the action array as the end of the prolog. */ -extern void mark_prolog PROTO((void)); - -/* Generate a data statment for a two-dimensional array. */ -extern void mk2data PROTO((int)); - -extern void mkdata PROTO((int)); /* generate a data statement */ - -/* Return the integer represented by a string of digits. */ -extern int myctoi PROTO((char [])); - -/* Return character corresponding to escape sequence. */ -extern int myesc PROTO((Char[])); - -/* Convert an octal digit string to an integer value. */ -extern int otoi PROTO((Char [] )); - -/* Output a (possibly-formatted) string to the generated scanner. */ -extern void out PROTO((const char [])); -extern void out_dec PROTO((const char [], int)); -extern void out_dec2 PROTO((const char [], int, int)); -extern void out_hex PROTO((const char [], unsigned int)); -extern void out_line_count PROTO((const char [])); -extern void out_str PROTO((const char [], const char [])); -extern void out_str3 - PROTO((const char [], const char [], const char [], const char [])); -extern void out_str_dec PROTO((const char [], const char [], int)); -extern void outc PROTO((int)); -extern void outn PROTO((const char [])); - -/* Return a printable version of the given character, which might be - * 8-bit. - */ -extern char *readable_form PROTO((int)); - -/* Write out one section of the skeleton file. */ -extern void skelout PROTO((void)); - -/* Output a yy_trans_info structure. */ -extern void transition_struct_out PROTO((int, int)); - -/* Only needed when using certain broken versions of bison to build parse.c. */ -extern void *yy_flex_xmalloc PROTO(( int )); - -/* Set a region of memory to 0. */ -extern void zero_out PROTO((char *, size_t)); - - -/* from file nfa.c */ - -/* Add an accepting state to a machine. */ -extern void add_accept PROTO((int, int)); - -/* Make a given number of copies of a singleton machine. */ -extern int copysingl PROTO((int, int)); - -/* Debugging routine to write out an nfa. */ -extern void dumpnfa PROTO((int)); - -/* Finish up the processing for a rule. */ -extern void finish_rule PROTO((int, int, int, int)); - -/* Connect two machines together. */ -extern int link_machines PROTO((int, int)); - -/* Mark each "beginning" state in a machine as being a "normal" (i.e., - * not trailing context associated) state. - */ -extern void mark_beginning_as_normal PROTO((register int)); - -/* Make a machine that branches to two machines. */ -extern int mkbranch PROTO((int, int)); - -extern int mkclos PROTO((int)); /* convert a machine into a closure */ -extern int mkopt PROTO((int)); /* make a machine optional */ - -/* Make a machine that matches either one of two machines. */ -extern int mkor PROTO((int, int)); - -/* Convert a machine into a positive closure. */ -extern int mkposcl PROTO((int)); - -extern int mkrep PROTO((int, int, int)); /* make a replicated machine */ - -/* Create a state with a transition on a given symbol. */ -extern int mkstate PROTO((int)); - -extern void new_rule PROTO((void)); /* initialize for a new rule */ - - -/* from file parse.y */ - -/* Build the "<<EOF>>" action for the active start conditions. */ -extern void build_eof_action PROTO((void)); - -/* Write out a message formatted with one string, pinpointing its location. */ -extern void format_pinpoint_message PROTO((char[], char[])); - -/* Write out a message, pinpointing its location. */ -extern void pinpoint_message PROTO((char[])); - -/* Write out a warning, pinpointing it at the given line. */ -extern void line_warning PROTO(( char[], int )); - -/* Write out a message, pinpointing it at the given line. */ -extern void line_pinpoint PROTO(( char[], int )); - -/* Report a formatted syntax error. */ -extern void format_synerr PROTO((char [], char[])); -extern void synerr PROTO((char [])); /* report a syntax error */ -extern void format_warn PROTO((char [], char[])); -extern void warn PROTO((char [])); /* report a warning */ -extern void yyerror PROTO((char [])); /* report a parse error */ -extern int yyparse PROTO((void)); /* the YACC parser */ - - -/* from file scan.l */ - -/* The Flex-generated scanner for flex. */ -extern int flexscan PROTO((void)); - -/* Open the given file (if NULL, stdin) for scanning. */ -extern void set_input_file PROTO((char*)); - -/* Wrapup a file in the lexical analyzer. */ -extern int yywrap PROTO((void)); - - -/* from file sym.c */ - -/* Add symbol and definitions to symbol table. */ -extern int addsym PROTO((register char[], char*, int, hash_table, int)); - -/* Save the text of a character class. */ -extern void cclinstal PROTO ((Char [], int)); - -/* Lookup the number associated with character class. */ -extern int ccllookup PROTO((Char [])); - -/* Find symbol in symbol table. */ -extern struct hash_entry *findsym PROTO((register char[], hash_table, int )); - -extern void ndinstal PROTO((char[], Char[])); /* install a name definition */ -extern Char *ndlookup PROTO((char[])); /* lookup a name definition */ - -/* Increase maximum number of SC's. */ -extern void scextend PROTO((void)); -extern void scinstal PROTO((char[], int)); /* make a start condition */ - -/* Lookup the number associated with a start condition. */ -extern int sclookup PROTO((char[])); - - -/* from file tblcmp.c */ - -/* Build table entries for dfa state. */ -extern void bldtbl PROTO((int[], int, int, int, int)); - -extern void cmptmps PROTO((void)); /* compress template table entries */ -extern void expand_nxt_chk PROTO((void)); /* increase nxt/chk arrays */ -/* Finds a space in the table for a state to be placed. */ -extern int find_table_space PROTO((int*, int)); -extern void inittbl PROTO((void)); /* initialize transition tables */ -/* Make the default, "jam" table entries. */ -extern void mkdeftbl PROTO((void)); - -/* Create table entries for a state (or state fragment) which has - * only one out-transition. - */ -extern void mk1tbl PROTO((int, int, int, int)); - -/* Place a state into full speed transition table. */ -extern void place_state PROTO((int*, int, int)); - -/* Save states with only one out-transition to be processed later. */ -extern void stack1 PROTO((int, int, int, int)); - - -/* from file yylex.c */ - -extern int yylex PROTO((void)); diff --git a/to.do/unicode/gen.c b/to.do/unicode/gen.c deleted file mode 100644 index d9db93a..0000000 --- a/to.do/unicode/gen.c +++ /dev/null @@ -1,1650 +0,0 @@ -/* gen - actual generation (writing) of flex scanners */ - -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Vern Paxson. - * - * The United States Government has rights in this work pursuant - * to contract no. DE-AC03-76SF00098 between the United States - * Department of Energy and the University of California. - * - * Redistribution and use in source and binary forms are permitted provided - * that: (1) source distributions retain this entire copyright notice and - * comment, and (2) distributions including binaries display the following - * acknowledgement: ``This product includes software developed by the - * University of California, Berkeley and its contributors'' in the - * documentation or other materials provided with the distribution and in - * all advertising materials mentioning features or use of this software. - * 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. - */ - -/* $Header$ */ - -#include "flexdef.h" - - -/* declare functions that have forward references */ - -void gen_next_state PROTO((int)); -void genecs PROTO((void)); -void indent_put2s PROTO((char [], char [])); -void indent_puts PROTO((char [])); - - -static int indent_level = 0; /* each level is 8 spaces */ - -#define indent_up() (++indent_level) -#define indent_down() (--indent_level) -#define set_indent(indent_val) indent_level = indent_val - -/* Almost everything is done in terms of arrays starting at 1, so provide - * a null entry for the zero element of all C arrays. (The exception - * to this is that the fast table representation generally uses the - * 0 elements of its arrays, too.) - */ -static char C_int_decl[] = "static yyconst int %s[%d] =\n { 0,\n"; -static char C_short_decl[] = "static yyconst short int %s[%d] =\n { 0,\n"; -static char C_long_decl[] = "static yyconst long int %s[%d] =\n { 0,\n"; -static char C_state_decl[] = - "static yyconst yy_state_type %s[%d] =\n { 0,\n"; -static char C_uchar_decl[] = - "static yyconst unsigned char %s[%d] =\n { 0,\n"; -static char C_ushort_decl[] = - "static yyconst unsigned short %s[%d] =\n { 0,\n"; - - -/* Indent to the current level. */ - -void do_indent() - { - register int i = indent_level * 8; - - while ( i >= 8 ) - { - outc( '\t' ); - i -= 8; - } - - while ( i > 0 ) - { - outc( ' ' ); - --i; - } - } - - -/* Generate the code to keep backing-up information. */ - -void gen_backing_up() - { - if ( reject || num_backing_up == 0 ) - return; - - if ( fullspd ) - indent_puts( "if ( yy_current_state[-1].yy_nxt )" ); - else - indent_puts( "if ( yy_accept[yy_current_state] )" ); - - indent_up(); - indent_puts( "{" ); - indent_puts( "yy_last_accepting_state = yy_current_state;" ); - indent_puts( "yy_last_accepting_cpos = yy_cp;" ); - indent_puts( "}" ); - indent_down(); - } - - -/* Generate the code to perform the backing up. */ - -void gen_bu_action() - { - if ( reject || num_backing_up == 0 ) - return; - - set_indent( 3 ); - - indent_puts( "case 0: /* must back up */" ); - indent_puts( "/* undo the effects of YY_DO_BEFORE_ACTION */" ); - indent_puts( "*yy_cp = yy_hold_char;" ); - - if ( fullspd || fulltbl ) - indent_puts( "yy_cp = yy_last_accepting_cpos + 1;" ); - else - /* Backing-up info for compressed tables is taken \after/ - * yy_cp has been incremented for the next state. - */ - indent_puts( "yy_cp = yy_last_accepting_cpos;" ); - - indent_puts( "yy_current_state = yy_last_accepting_state;" ); - indent_puts( "goto yy_find_action;" ); - outc( '\n' ); - - set_indent( 0 ); - } - - -/* genctbl - generates full speed compressed transition table */ - -void genctbl() - { - register int i; - int end_of_buffer_action = num_rules + 1; - - /* Table of verify for transition and offset to next state. */ - out_dec( "static yyconst struct yy_trans_info yy_transition[%d] =\n", - tblend + numecs + 1 ); - outn( " {" ); - - /* We want the transition to be represented as the offset to the - * next state, not the actual state number, which is what it currently - * is. The offset is base[nxt[i]] - (base of current state)]. That's - * just the difference between the starting points of the two involved - * states (to - from). - * - * First, though, we need to find some way to put in our end-of-buffer - * flags and states. We do this by making a state with absolutely no - * transitions. We put it at the end of the table. - */ - - /* We need to have room in nxt/chk for two more slots: One for the - * action and one for the end-of-buffer transition. We now *assume* - * that we're guaranteed the only character we'll try to index this - * nxt/chk pair with is EOB, i.e., 0, so we don't have to make sure - * there's room for jam entries for other characters. - */ - - while ( tblend + 2 >= current_max_xpairs ) - expand_nxt_chk(); - - while ( lastdfa + 1 >= current_max_dfas ) - increase_max_dfas(); - - base[lastdfa + 1] = tblend + 2; - nxt[tblend + 1] = end_of_buffer_action; - chk[tblend + 1] = numecs + 1; - chk[tblend + 2] = 1; /* anything but EOB */ - - /* So that "make test" won't show arb. differences. */ - nxt[tblend + 2] = 0; - - /* Make sure every state has an end-of-buffer transition and an - * action #. - */ - for ( i = 0; i <= lastdfa; ++i ) - { - int anum = dfaacc[i].dfaacc_state; - int offset = base[i]; - - chk[offset] = EOB_POSITION; - chk[offset - 1] = ACTION_POSITION; - nxt[offset - 1] = anum; /* action number */ - } - - for ( i = 0; i <= tblend; ++i ) - { - if ( chk[i] == EOB_POSITION ) - transition_struct_out( 0, base[lastdfa + 1] - i ); - - else if ( chk[i] == ACTION_POSITION ) - transition_struct_out( 0, nxt[i] ); - - else if ( chk[i] > numecs || chk[i] == 0 ) - transition_struct_out( 0, 0 ); /* unused slot */ - - else /* verify, transition */ - transition_struct_out( chk[i], - base[nxt[i]] - (i - chk[i]) ); - } - - - /* Here's the final, end-of-buffer state. */ - transition_struct_out( chk[tblend + 1], nxt[tblend + 1] ); - transition_struct_out( chk[tblend + 2], nxt[tblend + 2] ); - - outn( " };\n" ); - - /* Table of pointers to start states. */ - out_dec( - "static yyconst struct yy_trans_info *yy_start_state_list[%d] =\n", - lastsc * 2 + 1 ); - outn( " {" ); /* } so vi doesn't get confused */ - - for ( i = 0; i <= lastsc * 2; ++i ) - out_dec( " &yy_transition[%d],\n", base[i] ); - - dataend(); - - if ( useecs ) - genecs(); - } - - -/* Generate equivalence-class tables. */ - -void genecs() - { - register int i, j; - int numrows; - - if ( csize == 65536 && long_align ) - out_str_dec( C_long_decl, "yy_ec", csize ); - else if ( csize == 65536 && numecs < 256 ) - out_str_dec( C_uchar_decl, "yy_ec", csize ); - else if ( csize == 65536 && numecs < 65536 ) - out_str_dec( C_ushort_decl, "yy_ec", csize ); - else - out_str_dec( C_int_decl, "yy_ec", csize ); - - for ( i = 1; i < csize; ++i ) - { - if ( caseins && (i >= 'A') && (i <= 'Z') ) - ecgroup[i] = ecgroup[clower( i )]; - - ecgroup[i] = ABS( ecgroup[i] ); - mkdata( ecgroup[i] ); - } - - dataend(); - - if ( trace ) - { - fputs( _( "\n\nEquivalence Classes:\n\n" ), stderr ); - - numrows = csize / 8; - - for ( j = 0; j < numrows; ++j ) - { - for ( i = j; i < csize; i = i + numrows ) - { - fprintf( stderr, "%4s = %-2d", - readable_form( i ), ecgroup[i] ); - - putc( ' ', stderr ); - } - - putc( '\n', stderr ); - } - } - } - - -/* Generate the code to find the action number. */ - -void gen_find_action() - { - if ( fullspd ) - indent_puts( "yy_act = yy_current_state[-1].yy_nxt;" ); - - else if ( fulltbl ) - indent_puts( "yy_act = yy_accept[yy_current_state];" ); - - else if ( reject ) - { - indent_puts( "yy_current_state = *--yy_state_ptr;" ); - indent_puts( "yy_lp = yy_accept[yy_current_state];" ); - - outn( - "find_rule: /* we branch to this label when backing up */" ); - - indent_puts( - "for ( ; ; ) /* until we find what rule we matched */" ); - - indent_up(); - - indent_puts( "{" ); - - indent_puts( - "if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] )" ); - indent_up(); - indent_puts( "{" ); - indent_puts( "yy_act = yy_acclist[yy_lp];" ); - - if ( variable_trailing_context_rules ) - { - indent_puts( "if ( yy_act & YY_TRAILING_HEAD_MASK ||" ); - indent_puts( " yy_looking_for_trail_begin )" ); - indent_up(); - indent_puts( "{" ); - - indent_puts( - "if ( yy_act == yy_looking_for_trail_begin )" ); - indent_up(); - indent_puts( "{" ); - indent_puts( "yy_looking_for_trail_begin = 0;" ); - indent_puts( "yy_act &= ~YY_TRAILING_HEAD_MASK;" ); - indent_puts( "break;" ); - indent_puts( "}" ); - indent_down(); - - indent_puts( "}" ); - indent_down(); - - indent_puts( "else if ( yy_act & YY_TRAILING_MASK )" ); - indent_up(); - indent_puts( "{" ); - indent_puts( - "yy_looking_for_trail_begin = yy_act & ~YY_TRAILING_MASK;" ); - indent_puts( - "yy_looking_for_trail_begin |= YY_TRAILING_HEAD_MASK;" ); - - if ( real_reject ) - { - /* Remember matched text in case we back up - * due to REJECT. - */ - indent_puts( "yy_full_match = yy_cp;" ); - indent_puts( "yy_full_state = yy_state_ptr;" ); - indent_puts( "yy_full_lp = yy_lp;" ); - } - - indent_puts( "}" ); - indent_down(); - - indent_puts( "else" ); - indent_up(); - indent_puts( "{" ); - indent_puts( "yy_full_match = yy_cp;" ); - indent_puts( "yy_full_state = yy_state_ptr;" ); - indent_puts( "yy_full_lp = yy_lp;" ); - indent_puts( "break;" ); - indent_puts( "}" ); - indent_down(); - - indent_puts( "++yy_lp;" ); - indent_puts( "goto find_rule;" ); - } - - else - { - /* Remember matched text in case we back up due to - * trailing context plus REJECT. - */ - indent_up(); - indent_puts( "{" ); - indent_puts( "yy_full_match = yy_cp;" ); - indent_puts( "break;" ); - indent_puts( "}" ); - indent_down(); - } - - indent_puts( "}" ); - indent_down(); - - indent_puts( "--yy_cp;" ); - - /* We could consolidate the following two lines with those at - * the beginning, but at the cost of complaints that we're - * branching inside a loop. - */ - indent_puts( "yy_current_state = *--yy_state_ptr;" ); - indent_puts( "yy_lp = yy_accept[yy_current_state];" ); - - indent_puts( "}" ); - - indent_down(); - } - - else - { /* compressed */ - indent_puts( "yy_act = yy_accept[yy_current_state];" ); - - if ( interactive && ! reject ) - { - /* Do the guaranteed-needed backing up to figure out - * the match. - */ - indent_puts( "if ( yy_act == 0 )" ); - indent_up(); - indent_puts( "{ /* have to back up */" ); - indent_puts( "yy_cp = yy_last_accepting_cpos;" ); - indent_puts( - "yy_current_state = yy_last_accepting_state;" ); - indent_puts( "yy_act = yy_accept[yy_current_state];" ); - indent_puts( "}" ); - indent_down(); - } - } - } - - -/* genftbl - generate full transition table */ - -void genftbl() - { - register int i; - int end_of_buffer_action = num_rules + 1; - - out_str_dec( long_align ? C_long_decl : C_short_decl, - "yy_accept", lastdfa + 1 ); - - dfaacc[end_of_buffer_state].dfaacc_state = end_of_buffer_action; - - for ( i = 1; i <= lastdfa; ++i ) - { - register int anum = dfaacc[i].dfaacc_state; - - mkdata( anum ); - - if ( trace && anum ) - fprintf( stderr, _( "state # %d accepts: [%d]\n" ), - i, anum ); - } - - dataend(); - - if ( useecs ) - genecs(); - - /* Don't have to dump the actual full table entries - they were - * created on-the-fly. - */ - } - - -/* Generate the code to find the next compressed-table state. */ - -void gen_next_compressed_state( char_map ) -char *char_map; - { - indent_put2s( "register YY_CHAR yy_c = %s;", char_map ); - - /* Save the backing-up info \before/ computing the next state - * because we always compute one more state than needed - we - * always proceed until we reach a jam state - */ - gen_backing_up(); - - indent_puts( -"while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )" ); - indent_up(); - indent_puts( "{" ); - indent_puts( "yy_current_state = (int) yy_def[yy_current_state];" ); - - if ( usemecs ) - { - /* We've arrange it so that templates are never chained - * to one another. This means we can afford to make a - * very simple test to see if we need to convert to - * yy_c's meta-equivalence class without worrying - * about erroneously looking up the meta-equivalence - * class twice - */ - do_indent(); - - /* lastdfa + 2 is the beginning of the templates */ - out_dec( "if ( yy_current_state >= %d )\n", lastdfa + 2 ); - - indent_up(); - indent_puts( "yy_c = yy_meta[(unsigned int) yy_c];" ); - indent_down(); - } - - indent_puts( "}" ); - indent_down(); - - indent_puts( -"yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];" ); - } - - -/* Generate the code to find the next match. */ - -void gen_next_match() - { - /* NOTE - changes in here should be reflected in gen_next_state() and - * gen_NUL_trans(). - */ - char *char_map = useecs ? - "yy_ec[YY_SC_TO_UI(*yy_cp)]" : - "YY_SC_TO_UI(*yy_cp)"; - - char *char_map_2 = useecs ? - "yy_ec[YY_SC_TO_UI(*++yy_cp)]" : - "YY_SC_TO_UI(*++yy_cp)"; - - if ( fulltbl ) - { - indent_put2s( - "while ( (yy_current_state = yy_nxt[yy_current_state][%s]) > 0 )", - char_map ); - - indent_up(); - - if ( num_backing_up > 0 ) - { - indent_puts( "{" ); /* } for vi */ - gen_backing_up(); - outc( '\n' ); - } - - indent_puts( "++yy_cp;" ); - - if ( num_backing_up > 0 ) - /* { for vi */ - indent_puts( "}" ); - - indent_down(); - - outc( '\n' ); - indent_puts( "yy_current_state = -yy_current_state;" ); - } - - else if ( fullspd ) - { - indent_puts( "{" ); /* } for vi */ - indent_puts( - "register yyconst struct yy_trans_info *yy_trans_info;\n" ); - indent_puts( "register YY_CHAR yy_c;\n" ); - indent_put2s( "for ( yy_c = %s;", char_map ); - indent_puts( - " (yy_trans_info = &yy_current_state[(unsigned int) yy_c])->" ); - indent_puts( "yy_verify == yy_c;" ); - indent_put2s( " yy_c = %s )", char_map_2 ); - - indent_up(); - - if ( num_backing_up > 0 ) - indent_puts( "{" ); /* } for vi */ - - indent_puts( "yy_current_state += yy_trans_info->yy_nxt;" ); - - if ( num_backing_up > 0 ) - { - outc( '\n' ); - gen_backing_up(); /* { for vi */ - indent_puts( "}" ); - } - - indent_down(); /* { for vi */ - indent_puts( "}" ); - } - - else - { /* compressed */ - indent_puts( "do" ); - - indent_up(); - indent_puts( "{" ); /* } for vi */ - - gen_next_state( false ); - - indent_puts( "++yy_cp;" ); - - /* { for vi */ - indent_puts( "}" ); - indent_down(); - - do_indent(); - - if ( interactive ) - out_dec( "while ( yy_base[yy_current_state] != %d );\n", - jambase ); - else - out_dec( "while ( yy_current_state != %d );\n", - jamstate ); - - if ( ! reject && ! interactive ) - { - /* Do the guaranteed-needed backing up to figure out - * the match. - */ - indent_puts( "yy_cp = yy_last_accepting_cpos;" ); - indent_puts( - "yy_current_state = yy_last_accepting_state;" ); - } - } - } - - -/* Generate the code to find the next state. */ - -void gen_next_state( worry_about_NULs ) -int worry_about_NULs; - { /* NOTE - changes in here should be reflected in gen_next_match() */ - char char_map[256]; - - if ( worry_about_NULs && ! nultrans ) - { - if ( useecs ) - (void) sprintf( char_map, - "(*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : %d)", - NUL_ec ); - else - (void) sprintf( char_map, - "(*yy_cp ? YY_SC_TO_UI(*yy_cp) : %d)", NUL_ec ); - } - - else - strcpy( char_map, useecs ? - "yy_ec[YY_SC_TO_UI(*yy_cp)]" : "YY_SC_TO_UI(*yy_cp)" ); - - if ( worry_about_NULs && nultrans ) - { - if ( ! fulltbl && ! fullspd ) - /* Compressed tables back up *before* they match. */ - gen_backing_up(); - - indent_puts( "if ( *yy_cp )" ); - indent_up(); - indent_puts( "{" ); /* } for vi */ - } - - if ( fulltbl ) - indent_put2s( - "yy_current_state = yy_nxt[yy_current_state][%s];", - char_map ); - - else if ( fullspd ) - indent_put2s( - "yy_current_state += yy_current_state[%s].yy_nxt;", - char_map ); - - else - gen_next_compressed_state( char_map ); - - if ( worry_about_NULs && nultrans ) - { - /* { for vi */ - indent_puts( "}" ); - indent_down(); - indent_puts( "else" ); - indent_up(); - indent_puts( - "yy_current_state = yy_NUL_trans[yy_current_state];" ); - indent_down(); - } - - if ( fullspd || fulltbl ) - gen_backing_up(); - - if ( reject ) - indent_puts( "*yy_state_ptr++ = yy_current_state;" ); - } - - -/* Generate the code to make a NUL transition. */ - -void gen_NUL_trans() - { /* NOTE - changes in here should be reflected in gen_next_match() */ - /* Only generate a definition for "yy_cp" if we'll generate code - * that uses it. Otherwise lint and the like complain. - */ - int need_backing_up = (num_backing_up > 0 && ! reject); - - if ( need_backing_up && (! nultrans || fullspd || fulltbl) ) - /* We're going to need yy_cp lying around for the call - * below to gen_backing_up(). - */ - indent_puts( "register YY_CHAR *yy_cp = yy_c_buf_p;" ); - - outc( '\n' ); - - if ( nultrans ) - { - indent_puts( - "yy_current_state = yy_NUL_trans[yy_current_state];" ); - indent_puts( "yy_is_jam = (yy_current_state == 0);" ); - } - - else if ( fulltbl ) - { - do_indent(); - out_dec( "yy_current_state = yy_nxt[yy_current_state][%d];\n", - NUL_ec ); - indent_puts( "yy_is_jam = (yy_current_state <= 0);" ); - } - - else if ( fullspd ) - { - do_indent(); - out_dec( "register int yy_c = %d;\n", NUL_ec ); - - indent_puts( - "register yyconst struct yy_trans_info *yy_trans_info;\n" ); - indent_puts( - "yy_trans_info = &yy_current_state[(unsigned int) yy_c];" ); - indent_puts( "yy_current_state += yy_trans_info->yy_nxt;" ); - - indent_puts( - "yy_is_jam = (yy_trans_info->yy_verify != yy_c);" ); - } - - else - { - char NUL_ec_str[20]; - - (void) sprintf( NUL_ec_str, "%d", NUL_ec ); - gen_next_compressed_state( NUL_ec_str ); - - do_indent(); - out_dec( "yy_is_jam = (yy_current_state == %d);\n", jamstate ); - - if ( reject ) - { - /* Only stack this state if it's a transition we - * actually make. If we stack it on a jam, then - * the state stack and yy_c_buf_p get out of sync. - */ - indent_puts( "if ( ! yy_is_jam )" ); - indent_up(); - indent_puts( "*yy_state_ptr++ = yy_current_state;" ); - indent_down(); - } - } - - /* If we've entered an accepting state, back up; note that - * compressed tables have *already* done such backing up, so - * we needn't bother with it again. - */ - if ( need_backing_up && (fullspd || fulltbl) ) - { - outc( '\n' ); - indent_puts( "if ( ! yy_is_jam )" ); - indent_up(); - indent_puts( "{" ); - gen_backing_up(); - indent_puts( "}" ); - indent_down(); - } - } - - -/* Generate the code to find the start state. */ - -void gen_start_state() - { - if ( fullspd ) - { - if ( bol_needed ) - { - indent_puts( - "yy_current_state = yy_start_state_list[yy_start + YY_AT_BOL()];" ); - } - else - indent_puts( - "yy_current_state = yy_start_state_list[yy_start];" ); - } - - else - { - indent_puts( "yy_current_state = yy_start;" ); - - if ( bol_needed ) - indent_puts( "yy_current_state += YY_AT_BOL();" ); - - if ( reject ) - { - /* Set up for storing up states. */ - indent_puts( "yy_state_ptr = yy_state_buf;" ); - indent_puts( "*yy_state_ptr++ = yy_current_state;" ); - } - } - } - - -/* gentabs - generate data statements for the transition tables */ - -void gentabs() - { - int i, j, k, *accset, nacc, *acc_array, total_states; - int end_of_buffer_action = num_rules + 1; - - acc_array = allocate_integer_array( current_max_dfas ); - nummt = 0; - - /* The compressed table format jams by entering the "jam state", - * losing information about the previous state in the process. - * In order to recover the previous state, we effectively need - * to keep backing-up information. - */ - ++num_backing_up; - - if ( reject ) - { - /* Write out accepting list and pointer list. - * - * First we generate the "yy_acclist" array. In the process, - * we compute the indices that will go into the "yy_accept" - * array, and save the indices in the dfaacc array. - */ - int EOB_accepting_list[2]; - - /* Set up accepting structures for the End Of Buffer state. */ - EOB_accepting_list[0] = 0; - EOB_accepting_list[1] = end_of_buffer_action; - accsiz[end_of_buffer_state] = 1; - dfaacc[end_of_buffer_state].dfaacc_set = EOB_accepting_list; - - out_str_dec( long_align ? C_long_decl : C_short_decl, - "yy_acclist", MAX( numas, 1 ) + 1 ); - - j = 1; /* index into "yy_acclist" array */ - - for ( i = 1; i <= lastdfa; ++i ) - { - acc_array[i] = j; - - if ( accsiz[i] != 0 ) - { - accset = dfaacc[i].dfaacc_set; - nacc = accsiz[i]; - - if ( trace ) - fprintf( stderr, - _( "state # %d accepts: " ), - i ); - - for ( k = 1; k <= nacc; ++k ) - { - int accnum = accset[k]; - - ++j; - - if ( variable_trailing_context_rules && - ! (accnum & YY_TRAILING_HEAD_MASK) && - accnum > 0 && accnum <= num_rules && - rule_type[accnum] == RULE_VARIABLE ) - { - /* Special hack to flag - * accepting number as part - * of trailing context rule. - */ - accnum |= YY_TRAILING_MASK; - } - - mkdata( accnum ); - - if ( trace ) - { - fprintf( stderr, "[%d]", - accset[k] ); - - if ( k < nacc ) - fputs( ", ", stderr ); - else - putc( '\n', stderr ); - } - } - } - } - - /* add accepting number for the "jam" state */ - acc_array[i] = j; - - dataend(); - } - - else - { - dfaacc[end_of_buffer_state].dfaacc_state = end_of_buffer_action; - - for ( i = 1; i <= lastdfa; ++i ) - acc_array[i] = dfaacc[i].dfaacc_state; - - /* add accepting number for jam state */ - acc_array[i] = 0; - } - - /* Spit out "yy_accept" array. If we're doing "reject", it'll be - * pointers into the "yy_acclist" array. Otherwise it's actual - * accepting numbers. In either case, we just dump the numbers. - */ - - /* "lastdfa + 2" is the size of "yy_accept"; includes room for C arrays - * beginning at 0 and for "jam" state. - */ - k = lastdfa + 2; - - if ( reject ) - /* We put a "cap" on the table associating lists of accepting - * numbers with state numbers. This is needed because we tell - * where the end of an accepting list is by looking at where - * the list for the next state starts. - */ - ++k; - - out_str_dec( long_align ? C_long_decl : C_short_decl, "yy_accept", k ); - - for ( i = 1; i <= lastdfa; ++i ) - { - mkdata( acc_array[i] ); - - if ( ! reject && trace && acc_array[i] ) - fprintf( stderr, _( "state # %d accepts: [%d]\n" ), - i, acc_array[i] ); - } - - /* Add entry for "jam" state. */ - mkdata( acc_array[i] ); - - if ( reject ) - /* Add "cap" for the list. */ - mkdata( acc_array[i] ); - - dataend(); - - if ( useecs ) - genecs(); - - if ( usemecs ) - { - /* Write out meta-equivalence classes (used to index - * templates with). - */ - - if ( trace ) - fputs( _( "\n\nMeta-Equivalence Classes:\n" ), - stderr ); - - out_str_dec( C_int_decl, "yy_meta", numecs + 1 ); - - for ( i = 1; i <= numecs; ++i ) - { - if ( trace ) - fprintf( stderr, "%d = %d\n", - i, ABS( tecbck[i] ) ); - - mkdata( ABS( tecbck[i] ) ); - } - - dataend(); - } - - total_states = lastdfa + numtemps; - - out_str_dec( (tblend >= MAX_SHORT || long_align) ? - C_long_decl : C_short_decl, - "yy_base", total_states + 1 ); - - for ( i = 1; i <= lastdfa; ++i ) - { - register int d = def[i]; - - if ( base[i] == JAMSTATE ) - base[i] = jambase; - - if ( d == JAMSTATE ) - def[i] = jamstate; - - else if ( d < 0 ) - { - /* Template reference. */ - ++tmpuses; - def[i] = lastdfa - d + 1; - } - - mkdata( base[i] ); - } - - /* Generate jam state's base index. */ - mkdata( base[i] ); - - for ( ++i /* skip jam state */; i <= total_states; ++i ) - { - mkdata( base[i] ); - def[i] = jamstate; - } - - dataend(); - - out_str_dec( (total_states >= MAX_SHORT || long_align) ? - C_long_decl : C_short_decl, - "yy_def", total_states + 1 ); - - for ( i = 1; i <= total_states; ++i ) - mkdata( def[i] ); - - dataend(); - - out_str_dec( (total_states >= MAX_SHORT || long_align) ? - C_long_decl : C_short_decl, - "yy_nxt", tblend + 1 ); - - for ( i = 1; i <= tblend; ++i ) - { - /* Note, the order of the following test is important. - * If chk[i] is 0, then nxt[i] is undefined. - */ - if ( chk[i] == 0 || nxt[i] == 0 ) - nxt[i] = jamstate; /* new state is the JAM state */ - - mkdata( nxt[i] ); - } - - dataend(); - - out_str_dec( (total_states >= MAX_SHORT || long_align) ? - C_long_decl : C_short_decl, - "yy_chk", tblend + 1 ); - - for ( i = 1; i <= tblend; ++i ) - { - if ( chk[i] == 0 ) - ++nummt; - - mkdata( chk[i] ); - } - - dataend(); - } - - -/* Write out a formatted string (with a secondary string argument) at the - * current indentation level, adding a final newline. - */ - -void indent_put2s( fmt, arg ) -char fmt[], arg[]; - { - do_indent(); - out_str( fmt, arg ); - outn( "" ); - } - - -/* Write out a string at the current indentation level, adding a final - * newline. - */ - -void indent_puts( str ) -char str[]; - { - do_indent(); - outn( str ); - } - - -/* make_tables - generate transition tables and finishes generating output file - */ - -void make_tables() - { - register int i; - int did_eof_rule = false; - - skelout(); - - /* First, take care of YY_DO_BEFORE_ACTION depending on yymore - * being used. - */ - set_indent( 1 ); - - if ( yymore_used && ! yytext_is_array ) - { - indent_puts( "yytext_ptr -= yy_more_len; \\" ); - indent_puts( "yyleng = (int) (yy_cp - yytext_ptr); \\" ); - } - - else - indent_puts( "yyleng = (int) (yy_cp - yy_bp); \\" ); - - /* Now also deal with copying yytext_ptr to yytext if needed. */ - skelout(); - if ( yytext_is_array ) - { - if ( yymore_used ) - indent_puts( - "if ( yyleng + yy_more_offset >= YYLMAX ) \\" ); - else - indent_puts( "if ( yyleng >= YYLMAX ) \\" ); - - indent_up(); - indent_puts( - "YY_FATAL_ERROR( \"token too large, exceeds YYLMAX\" ); \\" ); - indent_down(); - - if ( yymore_used ) - { - indent_puts( -"yy_flex_strncpy( &yytext[yy_more_offset], yytext_ptr, yyleng + 1 ); \\" ); - indent_puts( "yyleng += yy_more_offset; \\" ); - indent_puts( - "yy_prev_more_offset = yy_more_offset; \\" ); - indent_puts( "yy_more_offset = 0; \\" ); - } - else - { - indent_puts( - "yy_flex_strncpy( yytext, yytext_ptr, yyleng + 1 ); \\" ); - } - } - - set_indent( 0 ); - - skelout(); - - - out_dec( "#define YY_NUM_RULES %d\n", num_rules ); - out_dec( "#define YY_END_OF_BUFFER %d\n", num_rules + 1 ); - - if ( fullspd ) - { - /* Need to define the transet type as a size large - * enough to hold the biggest offset. - */ - int total_table_size = tblend + numecs + 1; - char *trans_offset_type = - (total_table_size >= MAX_SHORT || long_align) ? - "long" : "short"; - - set_indent( 0 ); - indent_puts( "struct yy_trans_info" ); - indent_up(); - indent_puts( "{" ); /* } for vi */ - - if ( long_align ) - indent_puts( "long yy_verify;" ); - else - indent_puts( "short yy_verify;" ); - - /* In cases where its sister yy_verify *is* a "yes, there is - * a transition", yy_nxt is the offset (in records) to the - * next state. In most cases where there is no transition, - * the value of yy_nxt is irrelevant. If yy_nxt is the -1th - * record of a state, though, then yy_nxt is the action number - * for that state. - */ - - indent_put2s( "%s yy_nxt;", trans_offset_type ); - indent_puts( "};" ); - indent_down(); - } - - if ( fullspd ) - genctbl(); - else if ( fulltbl ) - genftbl(); - else - gentabs(); - - /* Definitions for backing up. We don't need them if REJECT - * is being used because then we use an alternative backin-up - * technique instead. - */ - if ( num_backing_up > 0 && ! reject ) - { - if ( ! C_plus_plus ) - { - indent_puts( - "static yy_state_type yy_last_accepting_state;" ); - indent_puts( - "static YY_CHAR *yy_last_accepting_cpos;\n" ); - } - } - - if ( nultrans ) - { - out_str_dec( C_state_decl, "yy_NUL_trans", lastdfa + 1 ); - - for ( i = 1; i <= lastdfa; ++i ) - { - if ( fullspd ) - out_dec( " &yy_transition[%d],\n", base[i] ); - else - mkdata( nultrans[i] ); - } - - dataend(); - } - - if ( ddebug ) - { /* Spit out table mapping rules to line numbers. */ - if ( ! C_plus_plus ) - { - indent_puts( "extern int yy_flex_debug;" ); - indent_puts( "int yy_flex_debug = 1;\n" ); - } - - out_str_dec( long_align ? C_long_decl : C_short_decl, - "yy_rule_linenum", num_rules ); - for ( i = 1; i < num_rules; ++i ) - mkdata( rule_linenum[i] ); - dataend(); - } - - if ( reject ) - { - /* Declare state buffer variables. */ - if ( ! C_plus_plus ) - { - outn( - "static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;" ); - outn( "static YY_CHAR *yy_full_match;" ); - outn( "static int yy_lp;" ); - } - - if ( variable_trailing_context_rules ) - { - if ( ! C_plus_plus ) - { - outn( - "static int yy_looking_for_trail_begin = 0;" ); - outn( "static int yy_full_lp;" ); - outn( "static int *yy_full_state;" ); - } - - out_hex( "#define YY_TRAILING_MASK 0x%x\n", - (unsigned int) YY_TRAILING_MASK ); - out_hex( "#define YY_TRAILING_HEAD_MASK 0x%x\n", - (unsigned int) YY_TRAILING_HEAD_MASK ); - } - - outn( "#define REJECT \\" ); - outn( "{ \\" ); /* } for vi */ - outn( - "*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \\" ); - outn( - "yy_cp = yy_full_match; /* restore poss. backed-over text */ \\" ); - - if ( variable_trailing_context_rules ) - { - outn( - "yy_lp = yy_full_lp; /* restore orig. accepting pos. */ \\" ); - outn( - "yy_state_ptr = yy_full_state; /* restore orig. state */ \\" ); - outn( - "yy_current_state = *yy_state_ptr; /* restore curr. state */ \\" ); - } - - outn( "++yy_lp; \\" ); - outn( "goto find_rule; \\" ); - /* { for vi */ - outn( "}" ); - } - - else - { - outn( - "/* The intent behind this definition is that it'll catch" ); - outn( " * any uses of REJECT which flex missed." ); - outn( " */" ); - outn( "#define REJECT reject_used_but_not_detected" ); - } - - if ( yymore_used ) - { - if ( ! C_plus_plus ) - { - if ( yytext_is_array ) - { - indent_puts( "static int yy_more_offset = 0;" ); - indent_puts( - "static int yy_prev_more_offset = 0;" ); - } - else - { - indent_puts( "static int yy_more_flag = 0;" ); - indent_puts( "static int yy_more_len = 0;" ); - } - } - - if ( yytext_is_array ) - { - indent_puts( - "#define yymore() (yy_more_offset = yy_flex_strlen( yytext ))" ); - indent_puts( "#define YY_NEED_STRLEN" ); - indent_puts( "#define YY_MORE_ADJ 0" ); - indent_puts( "#define YY_RESTORE_YY_MORE_OFFSET \\" ); - indent_up(); - indent_puts( "{ \\" ); - indent_puts( "yy_more_offset = yy_prev_more_offset; \\" ); - indent_puts( "yyleng -= yy_more_offset; \\" ); - indent_puts( "}" ); - indent_down(); - } - else - { - indent_puts( "#define yymore() (yy_more_flag = 1)" ); - indent_puts( "#define YY_MORE_ADJ yy_more_len" ); - indent_puts( "#define YY_RESTORE_YY_MORE_OFFSET" ); - } - } - - else - { - indent_puts( "#define yymore() yymore_used_but_not_detected" ); - indent_puts( "#define YY_MORE_ADJ 0" ); - indent_puts( "#define YY_RESTORE_YY_MORE_OFFSET" ); - } - - if ( ! C_plus_plus ) - { - if ( yytext_is_array ) - { - outn( "#ifndef YYLMAX" ); - outn( "#define YYLMAX 8192" ); - outn( "#endif\n" ); - outn( "YY_CHAR yytext[YYLMAX];" ); - outn( "YY_CHAR *yytext_ptr;" ); - } - - else - outn( "YY_CHAR *yytext;" ); - } - - out( &action_array[defs1_offset] ); - - line_directive_out( stdout, 0 ); - - skelout(); - - if ( ! C_plus_plus ) - { - if ( use_read ) - { - outn( -"\tif ( (result = read( fileno(yyin), (char *) buf, max_size * sizeof( YY_CHAR ) ) ) < 0 ) \\" ); - outn( - "\t\tYY_FATAL_ERROR( \"input in flex scanner failed\" );" ); - } - - else - { - outn( - "\tif ( yy_current_buffer->yy_is_interactive ) \\" ); - outn( "\t\t{ \\" ); - outn( "\t\tint c = '*', n; \\" ); - outn( "\t\tfor ( n = 0; n < max_size && \\" ); - - if ( csize == 65536 ) - outn( - "\t\t\t (c = getwc( yyin )) != WEOF && c != '\\n'; ++n ) \\" ); - else - outn( - "\t\t\t (c = getc( yyin )) != EOF && c != '\\n'; ++n ) \\" ); - - outn( "\t\t\tbuf[n] = (YY_CHAR) c; \\" ); - outn( "\t\tif ( c == '\\n' ) \\" ); - outn( "\t\t\tbuf[n++] = (YY_CHAR) c; \\" ); - - if ( csize == 65536 ) - outn( - "\t\tif ( c == WEOF && ferror( yyin ) ) \\" ); - else - outn( - "\t\tif ( c == EOF && ferror( yyin ) ) \\" ); - - outn( - "\t\t\tYY_FATAL_ERROR( \"input in flex scanner failed\" ); \\" ); - outn( "\t\tresult = n; \\" ); - outn( "\t\t} \\" ); - outn( -"\telse if ( ((result = fread( buf, sizeof( YY_CHAR ), max_size, yyin )) \\" ); - outn( "\t\t == 0) && ferror( yyin ) ) \\" ); - outn( - "\t\tYY_FATAL_ERROR( \"input in flex scanner failed\" );" ); - } - } - - skelout(); - - indent_puts( "#define YY_RULE_SETUP \\" ); - indent_up(); - if ( bol_needed ) - { - indent_puts( "if ( yyleng > 0 ) \\" ); - indent_up(); - indent_puts( "yy_current_buffer->yy_at_bol = \\" ); - indent_puts( "\t\t(yytext[yyleng - 1] == '\\n'); \\" ); - indent_down(); - } - indent_puts( "YY_USER_ACTION" ); - indent_down(); - - skelout(); - - /* Copy prolog to output file. */ - out( &action_array[prolog_offset] ); - - line_directive_out( stdout, 0 ); - - skelout(); - - set_indent( 2 ); - - if ( yymore_used && ! yytext_is_array ) - { - indent_puts( "yy_more_len = 0;" ); - indent_puts( "if ( yy_more_flag )" ); - indent_up(); - indent_puts( "{" ); - indent_puts( "yy_more_len = yy_c_buf_p - yytext_ptr;" ); - indent_puts( "yy_more_flag = 0;" ); - indent_puts( "}" ); - indent_down(); - } - - skelout(); - - gen_start_state(); - - /* Note, don't use any indentation. */ - outn( "yy_match:" ); - gen_next_match(); - - skelout(); - set_indent( 2 ); - gen_find_action(); - - skelout(); - if ( do_yylineno ) - { - indent_puts( "if ( yy_act != YY_END_OF_BUFFER )" ); - indent_up(); - indent_puts( "{" ); - indent_puts( "int yyl;" ); - indent_puts( "for ( yyl = 0; yyl < yyleng; ++yyl )" ); - indent_up(); - indent_puts( "if ( yytext[yyl] == '\\n' )" ); - indent_up(); - indent_puts( "++yylineno;" ); - indent_down(); - indent_down(); - indent_puts( "}" ); - indent_down(); - } - - skelout(); - if ( ddebug ) - { - indent_puts( "if ( yy_flex_debug )" ); - indent_up(); - - indent_puts( "{" ); - indent_puts( "if ( yy_act == 0 )" ); - indent_up(); - indent_puts( C_plus_plus ? - "cerr << \"--scanner backing up\\n\";" : - "fprintf( stderr, \"--scanner backing up\\n\" );" ); - indent_down(); - - do_indent(); - out_dec( "else if ( yy_act < %d )\n", num_rules ); - indent_up(); - - if ( C_plus_plus ) - { - indent_puts( - "cerr << \"--accepting rule at line \" << yy_rule_linenum[yy_act] <<" ); - indent_puts( - " \"(\\\"\" << yytext << \"\\\")\\n\";" ); - } - else - { - indent_puts( - "fprintf( stderr, \"--accepting rule at line %d (\\\"%s\\\")\\n\"," ); - - indent_puts( - " yy_rule_linenum[yy_act], yytext );" ); - } - - indent_down(); - - do_indent(); - out_dec( "else if ( yy_act == %d )\n", num_rules ); - indent_up(); - - if ( C_plus_plus ) - { - indent_puts( -"cerr << \"--accepting default rule (\\\"\" << yytext << \"\\\")\\n\";" ); - } - else - { - indent_puts( - "fprintf( stderr, \"--accepting default rule (\\\"%s\\\")\\n\"," ); - indent_puts( " yytext );" ); - } - - indent_down(); - - do_indent(); - out_dec( "else if ( yy_act == %d )\n", num_rules + 1 ); - indent_up(); - - indent_puts( C_plus_plus ? - "cerr << \"--(end of buffer or a NUL)\\n\";" : - "fprintf( stderr, \"--(end of buffer or a NUL)\\n\" );" ); - - indent_down(); - - do_indent(); - outn( "else" ); - indent_up(); - - if ( C_plus_plus ) - { - indent_puts( - "cerr << \"--EOF (start condition \" << YY_START << \")\\n\";" ); - } - else - { - indent_puts( - "fprintf( stderr, \"--EOF (start condition %d)\\n\", YY_START );" ); - } - - indent_down(); - - indent_puts( "}" ); - indent_down(); - } - - /* Copy actions to output file. */ - skelout(); - indent_up(); - gen_bu_action(); - out( &action_array[action_offset] ); - - line_directive_out( stdout, 0 ); - - /* generate cases for any missing EOF rules */ - for ( i = 1; i <= lastsc; ++i ) - if ( ! sceof[i] ) - { - do_indent(); - out_str( "case YY_STATE_EOF(%s):\n", scname[i] ); - did_eof_rule = true; - } - - if ( did_eof_rule ) - { - indent_up(); - indent_puts( "yyterminate();" ); - indent_down(); - } - - - /* Generate code for handling NUL's, if needed. */ - - /* First, deal with backing up and setting up yy_cp if the scanner - * finds that it should JAM on the NUL. - */ - skelout(); - set_indent( 4 ); - - if ( fullspd || fulltbl ) - indent_puts( "yy_cp = yy_c_buf_p;" ); - - else - { /* compressed table */ - if ( ! reject && ! interactive ) - { - /* Do the guaranteed-needed backing up to figure - * out the match. - */ - indent_puts( "yy_cp = yy_last_accepting_cpos;" ); - indent_puts( - "yy_current_state = yy_last_accepting_state;" ); - } - - else - /* Still need to initialize yy_cp, though - * yy_current_state was set up by - * yy_get_previous_state(). - */ - indent_puts( "yy_cp = yy_c_buf_p;" ); - } - - - /* Generate code for yy_get_previous_state(). */ - set_indent( 1 ); - skelout(); - - gen_start_state(); - - set_indent( 2 ); - skelout(); - gen_next_state( true ); - - set_indent( 1 ); - skelout(); - gen_NUL_trans(); - - skelout(); - if ( do_yylineno ) - { /* update yylineno inside of unput() */ - indent_puts( "if ( c == '\\n' )" ); - indent_up(); - indent_puts( "--yylineno;" ); - indent_down(); - } - - skelout(); - /* Update BOL and yylineno inside of input(). */ - if ( bol_needed ) - { - indent_puts( "yy_current_buffer->yy_at_bol = (c == '\\n');" ); - if ( do_yylineno ) - { - indent_puts( "if ( yy_current_buffer->yy_at_bol )" ); - indent_up(); - indent_puts( "++yylineno;" ); - indent_down(); - } - } - - else if ( do_yylineno ) - { - indent_puts( "if ( c == '\\n' )" ); - indent_up(); - indent_puts( "++yylineno;" ); - indent_down(); - } - - skelout(); - - /* Copy remainder of input to output. */ - - line_directive_out( stdout, 1 ); - - if ( sectnum == 3 ) - (void) flexscan(); /* copy remainder of input to output */ - } diff --git a/to.do/unicode/main.c b/to.do/unicode/main.c deleted file mode 100644 index eee3c3e..0000000 --- a/to.do/unicode/main.c +++ /dev/null @@ -1,1228 +0,0 @@ -/* flex - tool to generate fast lexical analyzers */ - -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Vern Paxson. - * - * The United States Government has rights in this work pursuant - * to contract no. DE-AC03-76SF00098 between the United States - * Department of Energy and the University of California. - * - * Redistribution and use in source and binary forms are permitted provided - * that: (1) source distributions retain this entire copyright notice and - * comment, and (2) distributions including binaries display the following - * acknowledgement: ``This product includes software developed by the - * University of California, Berkeley and its contributors'' in the - * documentation or other materials provided with the distribution and in - * all advertising materials mentioning features or use of this software. - * 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. - */ - -#ifndef lint -char copyright[] = -"@(#) Copyright (c) 1990 The Regents of the University of California.\n\ - All rights reserved.\n"; -#endif /* not lint */ - -/* $Header$ */ - - -#include "flexdef.h" -#include "version.h" - -static char flex_version[] = FLEX_VERSION; - - -/* declare functions that have forward references */ - -void flexinit PROTO((int, char**)); -void readin PROTO((void)); -void set_up_initial_allocations PROTO((void)); - -#ifdef NEED_ARGV_FIXUP -extern void argv_fixup PROTO((int *, char ***)); -#endif - - -/* these globals are all defined and commented in flexdef.h */ -int printstats, syntaxerror, eofseen, ddebug, trace, nowarn, spprdflt; -int interactive, caseins, lex_compat, do_yylineno, useecs, fulltbl, usemecs; -int fullspd, gen_line_dirs, performance_report, backing_up_report; -int C_plus_plus, long_align, use_read, yytext_is_array, do_yywrap, csize; -int yymore_used, reject, real_reject, continued_action, in_rule; -int yymore_really_used, reject_really_used; -int datapos, dataline, linenum, out_linenum; -FILE *skelfile = NULL; -int skel_ind = 0; -char *action_array; -int action_size, defs1_offset, prolog_offset, action_offset, action_index; -char *infilename = NULL, *outfilename = NULL; -int did_outfilename; -char *prefix, *yyclass; -int do_stdinit, use_stdout; -int onestate[ONE_STACK_SIZE], onesym[ONE_STACK_SIZE]; -int onenext[ONE_STACK_SIZE], onedef[ONE_STACK_SIZE], onesp; -int current_mns, current_max_rules; -int num_rules, num_eof_rules, default_rule, lastnfa; -int *firstst, *lastst, *finalst, *transchar, *trans1, *trans2; -int *accptnum, *assoc_rule, *state_type; -int *rule_type, *rule_linenum, *rule_useful; -int current_state_type; -int variable_trailing_context_rules; -int numtemps, numprots, protprev[MSP], protnext[MSP], prottbl[MSP]; -int protcomst[MSP], firstprot, lastprot, protsave[PROT_SAVE_SIZE]; -int numecs, nextecm[CSIZE + 1], ecgroup[CSIZE + 1], nummecs, tecfwd[CSIZE + 1]; -int tecbck[CSIZE + 1]; -int lastsc, *scset, *scbol, *scxclu, *sceof; -int current_max_scs; -char **scname; -int current_max_dfa_size, current_max_xpairs; -int current_max_template_xpairs, current_max_dfas; -int lastdfa, *nxt, *chk, *tnxt; -int *base, *def, *nultrans, NUL_ec, tblend, firstfree, **dss, *dfasiz; -union dfaacc_union *dfaacc; -int *accsiz, *dhash, numas; -int numsnpairs, jambase, jamstate; -int lastccl, *cclmap, *ccllen, *cclng, cclreuse; -int current_maxccls, current_max_ccl_tbl_size; -wchar_t *ccltbl; -char nmstr[MAXLINE]; -int sectnum, nummt, hshcol, dfaeql, numeps, eps2, num_reallocs; -int tmpuses, totnst, peakpairs, numuniq, numdup, hshsave; -int num_backing_up, bol_needed; -FILE *backing_up_file; -int end_of_buffer_state; -char **input_files; -int num_input_files; - -/* Make sure program_name is initialized so we don't crash if writing - * out an error message before getting the program name from argv[0]. - */ -char *program_name = "flex"; - -#ifndef SHORT_FILE_NAMES -static char *outfile_template = "lex.%s.%s"; -static char *backing_name = "lex.backup"; -#else -static char *outfile_template = "lex%s.%s"; -static char *backing_name = "lex.bck"; -#endif - -#ifdef THINK_C -#include <console.h> -#endif - -#ifdef MS_DOS -extern unsigned _stklen = 16384; -#endif - -static char outfile_path[MAXLINE]; -static int outfile_created = 0; -static char *skelname = NULL; - - -int main( argc, argv ) -int argc; -char **argv; - { - int i; - -#ifdef THINK_C - argc = ccommand( &argv ); -#endif -#ifdef NEED_ARGV_FIXUP - argv_fixup( &argc, &argv ); -#endif - - flexinit( argc, argv ); - - readin(); - - ntod(); - - for ( i = 1; i <= num_rules; ++i ) - if ( ! rule_useful[i] && i != default_rule ) - line_warning( _( "rule cannot be matched" ), - rule_linenum[i] ); - - if ( spprdflt && ! reject && rule_useful[default_rule] ) - line_warning( - _( "-s option given but default rule can be matched" ), - rule_linenum[default_rule] ); - - /* Generate the C state transition tables from the DFA. */ - make_tables(); - - /* Note, flexend does not return. It exits with its argument - * as status. - */ - flexend( 0 ); - - return 0; /* keep compilers/lint happy */ - } - - -/* check_options - check user-specified options */ - -void check_options() - { - int i; - - if ( lex_compat ) - { - if ( C_plus_plus ) - flexerror( _( "Can't use -+ with -l option" ) ); - - if ( fulltbl || fullspd ) - flexerror( _( "Can't use -f or -F with -l option" ) ); - - /* Don't rely on detecting use of yymore() and REJECT, - * just assume they'll be used. - */ - yymore_really_used = reject_really_used = true; - - yytext_is_array = true; - do_yylineno = true; - use_read = false; - } - - if ( do_yylineno ) - /* This should really be "maintain_backup_tables = true" */ - reject_really_used = true; - - if ( csize == unspecified ) - { - if ( (fulltbl || fullspd) && ! useecs ) - csize = DEFAULT_CSIZE; - else - csize = 256; - } - - if ( interactive == unspecified ) - { - if ( fulltbl || fullspd ) - interactive = false; - else - interactive = true; - } - - if ( fulltbl || fullspd ) - { - if ( usemecs ) - flexerror( - _( "-Cf/-CF and -Cm don't make sense together" ) ); - - if ( interactive ) - flexerror( _( "-Cf/-CF and -I are incompatible" ) ); - - if ( lex_compat ) - flexerror( - _( "-Cf/-CF are incompatible with lex-compatibility mode" ) ); - - if ( do_yylineno ) - flexerror( - _( "-Cf/-CF and %option yylineno are incompatible" ) ); - - if ( fulltbl && fullspd ) - flexerror( _( "-Cf and -CF are mutually exclusive" ) ); - } - - if ( C_plus_plus && fullspd ) - flexerror( _( "Can't use -+ with -CF option" ) ); - - if ( C_plus_plus && yytext_is_array ) - { - warn( _( "%array incompatible with -+ option" ) ); - yytext_is_array = false; - } - - if ( csize == 65536 ) - { - if ( fulltbl ) - { - if ( use_read ) - flexerror( _( "Can't use -f with -U" ) ); - else - flexerror( _( "Can't use -Cf with -U" ) ); - } - else if ( fullspd ) - { - if ( use_read ) - flexerror( _( "Can't use -F with -U" ) ); - else - flexerror( _( "Can't use -CF with -U" ) ); - } - else if ( ! useecs && ! usemecs ) - flexerror( _( "Can't use -C with -U" ) ); - } - - if ( useecs ) - { /* Set up doubly-linked equivalence classes. */ - - /* We loop all the way up to csize, since ecgroup[csize] is - * the position used for NUL characters. - */ - ecgroup[1] = NIL; - - for ( i = 2; i <= csize; ++i ) - { - ecgroup[i] = i - 1; - nextecm[i - 1] = i; - } - - nextecm[csize] = NIL; - } - - else - { - /* Put everything in its own equivalence class. */ - for ( i = 1; i <= csize; ++i ) - { - ecgroup[i] = i; - nextecm[i] = BAD_SUBSCRIPT; /* to catch errors */ - } - } - - if ( ! use_stdout ) - { - FILE *prev_stdout; - - if ( ! did_outfilename ) - { - char *suffix; - - if ( C_plus_plus ) - suffix = "cc"; - else - suffix = "c"; - - sprintf( outfile_path, outfile_template, - prefix, suffix ); - - outfilename = outfile_path; - } - - prev_stdout = freopen( outfilename, "w", stdout ); - - if ( prev_stdout == NULL ) - lerrsf( _( "could not create %s" ), outfilename ); - - outfile_created = 1; - } - - if ( skelname && (skelfile = fopen( skelname, "r" )) == NULL ) - lerrsf( _( "can't open skeleton file %s" ), skelname ); - - if ( strcmp( prefix, "yy" ) ) - { -#define GEN_PREFIX(name) out_str3( "#define yy%s %s%s\n", name, prefix, name ) - if ( C_plus_plus ) - GEN_PREFIX( "FlexLexer" ); - else - { - GEN_PREFIX( "_create_buffer" ); - GEN_PREFIX( "_delete_buffer" ); - GEN_PREFIX( "_scan_buffer" ); - GEN_PREFIX( "_scan_string" ); - GEN_PREFIX( "_scan_bytes" ); - GEN_PREFIX( "_flex_debug" ); - GEN_PREFIX( "_init_buffer" ); - GEN_PREFIX( "_flush_buffer" ); - GEN_PREFIX( "_load_buffer_state" ); - GEN_PREFIX( "_switch_to_buffer" ); - GEN_PREFIX( "in" ); - GEN_PREFIX( "leng" ); - GEN_PREFIX( "lex" ); - GEN_PREFIX( "out" ); - GEN_PREFIX( "restart" ); - GEN_PREFIX( "text" ); - - if ( do_yylineno ) - GEN_PREFIX( "lineno" ); - } - - if ( do_yywrap ) - GEN_PREFIX( "wrap" ); - - outn( "" ); - } - - if ( did_outfilename ) - line_directive_out( stdout, 0 ); - - skelout(); - - outn( "/* Define the YY_CHAR type. */" ); - - switch (csize) { - case 65536: - outn( "typedef wchar_t YY_CHAR;" ); - break; - case 256: - outn( "typedef unsigned char YY_CHAR;" ); - break; - default: - outn( "typedef char YY_CHAR;" ); - break; - } - - outn( "\n/* Promotes a YY_CHAR to an unsigned integer for use as an array index. */"); - - switch (csize) { - case 65536: - case 256: - outn( "#define YY_SC_TO_UI(c) ((unsigned int) c)" ); - break; - default: - outn( - "#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)" ); - break; - } - - skelout(); - } - - -/* flexend - terminate flex - * - * note - * This routine does not return. - */ - -void flexend( exit_status ) -int exit_status; - - { - int tblsiz; - int unlink(); - - if ( skelfile != NULL ) - { - if ( ferror( skelfile ) ) - lerrsf( _( "input error reading skeleton file %s" ), - skelname ); - - else if ( fclose( skelfile ) ) - lerrsf( _( "error closing skeleton file %s" ), - skelname ); - } - - if ( exit_status != 0 && outfile_created ) - { - if ( ferror( stdout ) ) - lerrsf( _( "error writing output file %s" ), - outfilename ); - - else if ( fclose( stdout ) ) - lerrsf( _( "error closing output file %s" ), - outfilename ); - - else if ( unlink( outfilename ) ) - lerrsf( _( "error deleting output file %s" ), - outfilename ); - } - - if ( backing_up_report && backing_up_file ) - { - if ( num_backing_up == 0 ) - fprintf( backing_up_file, _( "No backing up.\n" ) ); - else if ( fullspd || fulltbl ) - fprintf( backing_up_file, - _( "%d backing up (non-accepting) states.\n" ), - num_backing_up ); - else - fprintf( backing_up_file, - _( "Compressed tables always back up.\n" ) ); - - if ( ferror( backing_up_file ) ) - lerrsf( _( "error writing backup file %s" ), - backing_name ); - - else if ( fclose( backing_up_file ) ) - lerrsf( _( "error closing backup file %s" ), - backing_name ); - } - - if ( printstats ) - { - fprintf( stderr, _( "%s version %s usage statistics:\n" ), - program_name, flex_version ); - - fprintf( stderr, _( " scanner options: -" ) ); - - if ( C_plus_plus ) - putc( '+', stderr ); - if ( backing_up_report ) - putc( 'b', stderr ); - if ( ddebug ) - putc( 'd', stderr ); - if ( caseins ) - putc( 'i', stderr ); - if ( lex_compat ) - putc( 'l', stderr ); - if ( performance_report > 0 ) - putc( 'p', stderr ); - if ( performance_report > 1 ) - putc( 'p', stderr ); - if ( spprdflt ) - putc( 's', stderr ); - if ( use_stdout ) - putc( 't', stderr ); - if ( printstats ) - putc( 'v', stderr ); /* always true! */ - if ( nowarn ) - putc( 'w', stderr ); - if ( interactive == false ) - putc( 'B', stderr ); - if ( interactive == true ) - putc( 'I', stderr ); - if ( ! gen_line_dirs ) - putc( 'L', stderr ); - if ( trace ) - putc( 'T', stderr ); - - if ( csize == unspecified ) - /* We encountered an error fairly early on, so csize - * never got specified. Define it now, to prevent - * bogus table sizes being written out below. - */ - csize = 256; - - if ( csize == 128 ) - putc( '7', stderr ); - else if ( csize == 256 ) - putc( '8', stderr ); - else - putc( 'U', stderr ); - - fprintf( stderr, " -C" ); - - if ( long_align ) - putc( 'a', stderr ); - if ( fulltbl ) - putc( 'f', stderr ); - if ( fullspd ) - putc( 'F', stderr ); - if ( useecs ) - putc( 'e', stderr ); - if ( usemecs ) - putc( 'm', stderr ); - if ( use_read ) - putc( 'r', stderr ); - - if ( did_outfilename ) - fprintf( stderr, " -o%s", outfilename ); - - if ( skelname ) - fprintf( stderr, " -S%s", skelname ); - - if ( strcmp( prefix, "yy" ) ) - fprintf( stderr, " -P%s", prefix ); - - putc( '\n', stderr ); - - fprintf( stderr, _( " %d/%d NFA states\n" ), - lastnfa, current_mns ); - fprintf( stderr, _( " %d/%d DFA states (%d words)\n" ), - lastdfa, current_max_dfas, totnst ); - fprintf( stderr, _( " %d rules\n" ), - num_rules + num_eof_rules - 1 /* - 1 for def. rule */ ); - - if ( num_backing_up == 0 ) - fprintf( stderr, _( " No backing up\n" ) ); - else if ( fullspd || fulltbl ) - fprintf( stderr, - _( " %d backing-up (non-accepting) states\n" ), - num_backing_up ); - else - fprintf( stderr, - _( " Compressed tables always back-up\n" ) ); - - if ( bol_needed ) - fprintf( stderr, - _( " Beginning-of-line patterns used\n" ) ); - - fprintf( stderr, _( " %d/%d start conditions\n" ), lastsc, - current_max_scs ); - fprintf( stderr, - _( " %d epsilon states, %d double epsilon states\n" ), - numeps, eps2 ); - - if ( lastccl == 0 ) - fprintf( stderr, _( " no character classes\n" ) ); - else - fprintf( stderr, -_( " %d/%d character classes needed %d/%d words of storage, %d reused\n" ), - lastccl, current_maxccls, - cclmap[lastccl] + ccllen[lastccl], - current_max_ccl_tbl_size, cclreuse ); - - fprintf( stderr, _( " %d state/nextstate pairs created\n" ), - numsnpairs ); - fprintf( stderr, _( " %d/%d unique/duplicate transitions\n" ), - numuniq, numdup ); - - if ( fulltbl ) - { - tblsiz = lastdfa * numecs; - fprintf( stderr, _( " %d table entries\n" ), tblsiz ); - } - - else - { - tblsiz = 2 * (lastdfa + numtemps) + 2 * tblend; - - fprintf( stderr, - _( " %d/%d base-def entries created\n" ), - lastdfa + numtemps, current_max_dfas ); - fprintf( stderr, - _( " %d/%d (peak %d) nxt-chk entries created\n" ), - tblend, current_max_xpairs, peakpairs ); - fprintf( stderr, - _( " %d/%d (peak %d) template nxt-chk entries created\n" ), - numtemps * nummecs, - current_max_template_xpairs, - numtemps * numecs ); - fprintf( stderr, _( " %d empty table entries\n" ), - nummt ); - fprintf( stderr, _( " %d protos created\n" ), - numprots ); - fprintf( stderr, - _( " %d templates created, %d uses\n" ), - numtemps, tmpuses ); - } - - if ( useecs ) - { - tblsiz = tblsiz + csize; - fprintf( stderr, - _( " %d/%d equivalence classes created\n" ), - numecs, csize ); - } - - if ( usemecs ) - { - tblsiz = tblsiz + numecs; - fprintf( stderr, - _( " %d/%d meta-equivalence classes created\n" ), - nummecs, csize ); - } - - fprintf( stderr, - _( " %d (%d saved) hash collisions, %d DFAs equal\n" ), - hshcol, hshsave, dfaeql ); - fprintf( stderr, _( " %d sets of reallocations needed\n" ), - num_reallocs ); - fprintf( stderr, _( " %d total table entries needed\n" ), - tblsiz ); - } - - exit( exit_status ); - } - - -/* flexinit - initialize flex */ - -void flexinit( argc, argv ) -int argc; -char **argv; - { - int i, sawcmpflag; - char *arg; - - printstats = syntaxerror = trace = spprdflt = caseins = false; - lex_compat = C_plus_plus = backing_up_report = ddebug = fulltbl = false; - fullspd = long_align = nowarn = yymore_used = continued_action = false; - do_yylineno = yytext_is_array = in_rule = reject = do_stdinit = false; - yymore_really_used = reject_really_used = unspecified; - interactive = csize = unspecified; - do_yywrap = gen_line_dirs = usemecs = useecs = true; - performance_report = 0; - did_outfilename = 0; - prefix = "yy"; - yyclass = 0; - use_read = use_stdout = false; - - sawcmpflag = false; - - /* Initialize dynamic array for holding the rule actions. */ - action_size = 2048; /* default size of action array in bytes */ - action_array = allocate_character_array( action_size ); - defs1_offset = prolog_offset = action_offset = action_index = 0; - action_array[0] = '\0'; - - program_name = argv[0]; - - if ( program_name[0] != '\0' && - program_name[strlen( program_name ) - 1] == '+' ) - C_plus_plus = true; - - /* read flags */ - for ( --argc, ++argv; argc ; --argc, ++argv ) - { - arg = argv[0]; - - if ( arg[0] != '-' || arg[1] == '\0' ) - break; - - if ( arg[1] == '-' ) - { /* --option */ - if ( ! strcmp( arg, "--help" ) ) - arg = "-h"; - - else if ( ! strcmp( arg, "--version" ) ) - arg = "-V"; - - else if ( ! strcmp( arg, "--" ) ) - { /* end of options */ - --argc; - ++argv; - break; - } - } - - for ( i = 1; arg[i] != '\0'; ++i ) - switch ( arg[i] ) - { - case '+': - C_plus_plus = true; - break; - - case 'B': - interactive = false; - break; - - case 'b': - backing_up_report = true; - break; - - case 'c': - break; - - case 'C': - if ( i != 1 ) - flexerror( - _( "-C flag must be given separately" ) ); - - if ( ! sawcmpflag ) - { - useecs = false; - usemecs = false; - fulltbl = false; - sawcmpflag = true; - } - - for ( ++i; arg[i] != '\0'; ++i ) - switch ( arg[i] ) - { - case 'a': - long_align = - true; - break; - - case 'e': - useecs = true; - break; - - case 'F': - fullspd = true; - break; - - case 'f': - fulltbl = true; - break; - - case 'm': - usemecs = true; - break; - - case 'r': - use_read = true; - break; - - default: - lerrif( - _( "unknown -C option '%c'" ), - (int) arg[i] ); - break; - } - - goto get_next_arg; - - case 'd': - ddebug = true; - break; - - case 'f': - useecs = usemecs = false; - use_read = fulltbl = true; - break; - - case 'F': - useecs = usemecs = false; - use_read = fullspd = true; - break; - - case '?': - case 'h': - usage(); - exit( 0 ); - - case 'I': - interactive = true; - break; - - case 'i': - caseins = true; - break; - - case 'l': - lex_compat = true; - break; - - case 'L': - gen_line_dirs = false; - break; - - case 'n': - /* Stupid do-nothing deprecated - * option. - */ - break; - - case 'o': - if ( i != 1 ) - flexerror( - _( "-o flag must be given separately" ) ); - - outfilename = arg + i + 1; - did_outfilename = 1; - goto get_next_arg; - - case 'P': - if ( i != 1 ) - flexerror( - _( "-P flag must be given separately" ) ); - - prefix = arg + i + 1; - goto get_next_arg; - - case 'p': - ++performance_report; - break; - - case 'S': - if ( i != 1 ) - flexerror( - _( "-S flag must be given separately" ) ); - - skelname = arg + i + 1; - goto get_next_arg; - - case 's': - spprdflt = true; - break; - - case 't': - use_stdout = true; - break; - - case 'T': - trace = true; - break; - - case 'U': - csize = 65536; - break; - - case 'v': - printstats = true; - break; - - case 'V': - printf( _( "%s version %s\n" ), - program_name, flex_version ); - exit( 0 ); - - case 'w': - nowarn = true; - break; - - case '7': - csize = 128; - break; - - case '8': - csize = 256; - break; - - default: - fprintf( stderr, - _( "%s: unknown flag '%c'. For usage, try\n\t%s --help\n" ), - program_name, (int) arg[i], - program_name ); - exit( 1 ); - } - - /* Used by -C, -S, -o, and -P flags in lieu of a "continue 2" - * control. - */ - get_next_arg: ; - } - - num_input_files = argc; - input_files = argv; - set_input_file( num_input_files > 0 ? input_files[0] : NULL ); - - lastccl = lastsc = lastdfa = lastnfa = 0; - num_rules = num_eof_rules = default_rule = 0; - numas = numsnpairs = tmpuses = 0; - numecs = numeps = eps2 = num_reallocs = hshcol = dfaeql = totnst = 0; - numuniq = numdup = hshsave = eofseen = datapos = dataline = 0; - num_backing_up = onesp = numprots = 0; - variable_trailing_context_rules = bol_needed = false; - - out_linenum = linenum = sectnum = 1; - firstprot = NIL; - - /* Used in mkprot() so that the first proto goes in slot 1 - * of the proto queue. - */ - lastprot = 1; - - set_up_initial_allocations(); - } - - -/* readin - read in the rules section of the input file(s) */ - -void readin() - { - static char yy_stdinit[] = "FILE *yyin = stdin, *yyout = stdout;"; - static char yy_nostdinit[] = - "FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;"; - - line_directive_out( (FILE *) 0, 1 ); - - if ( yyparse() ) - { - pinpoint_message( _( "fatal parse error" ) ); - flexend( 1 ); - } - - if ( syntaxerror ) - flexend( 1 ); - - if ( backing_up_report ) - { - backing_up_file = fopen( backing_name, "w" ); - if ( backing_up_file == NULL ) - lerrsf( - _( "could not create backing-up info file %s" ), - backing_name ); - } - - else - backing_up_file = NULL; - - if ( yymore_really_used == true ) - yymore_used = true; - else if ( yymore_really_used == false ) - yymore_used = false; - - if ( reject_really_used == true ) - reject = true; - else if ( reject_really_used == false ) - reject = false; - - if ( performance_report > 0 ) - { - if ( lex_compat ) - { - fprintf( stderr, -_( "-l AT&T lex compatibility option entails a large performance penalty\n" ) ); - fprintf( stderr, -_( " and may be the actual source of other reported performance penalties\n" ) ); - } - - else if ( do_yylineno ) - { - fprintf( stderr, - _( "%%option yylineno entails a large performance penalty\n" ) ); - } - - if ( performance_report > 1 ) - { - if ( interactive ) - fprintf( stderr, - _( "-I (interactive) entails a minor performance penalty\n" ) ); - - if ( yymore_used ) - fprintf( stderr, - _( "yymore() entails a minor performance penalty\n" ) ); - } - - if ( reject ) - fprintf( stderr, - _( "REJECT entails a large performance penalty\n" ) ); - - if ( variable_trailing_context_rules ) - fprintf( stderr, -_( "Variable trailing context rules entail a large performance penalty\n" ) ); - } - - if ( reject ) - real_reject = true; - - if ( variable_trailing_context_rules ) - reject = true; - - if ( (fulltbl || fullspd) && reject ) - { - if ( real_reject ) - flexerror( - _( "REJECT cannot be used with -f or -F" ) ); - else if ( do_yylineno ) - flexerror( - _( "%option yylineno cannot be used with -f or -F" ) ); - else - flexerror( - _( "variable trailing context rules cannot be used with -f or -F" ) ); - } - - if ( reject ) - outn( "\n#define YY_USES_REJECT" ); - - if ( ! do_yywrap ) - { - outn( "\n#define yywrap() 1" ); - outn( "#define YY_SKIP_YYWRAP" ); - } - - if ( ddebug ) - outn( "\n#define FLEX_DEBUG" ); - - if ( C_plus_plus ) - { - outn( "#define yytext_ptr yytext" ); - - if ( interactive ) - outn( "#define YY_INTERACTIVE" ); - } - - else - { - if ( do_stdinit ) - { - outn( "#ifdef VMS" ); - outn( "#ifndef __VMS_POSIX" ); - outn( yy_nostdinit ); - outn( "#else" ); - outn( yy_stdinit ); - outn( "#endif" ); - outn( "#else" ); - outn( yy_stdinit ); - outn( "#endif" ); - } - - else - outn( yy_nostdinit ); - } - - if ( fullspd ) - outn( "typedef yyconst struct yy_trans_info *yy_state_type;" ); - else if ( ! C_plus_plus ) - outn( "typedef int yy_state_type;" ); - - if ( ddebug ) - outn( "\n#define FLEX_DEBUG" ); - - if ( lex_compat ) - outn( "#define YY_FLEX_LEX_COMPAT" ); - - if ( do_yylineno && ! C_plus_plus ) - { - outn( "extern int yylineno;" ); - outn( "int yylineno = 1;" ); - } - - if ( C_plus_plus ) - { - outn( "\n#include <FlexLexer.h>" ); - - if ( yyclass ) - { - outn( "int yyFlexLexer::yylex()" ); - outn( "\t{" ); - outn( -"\tLexerError( \"yyFlexLexer::yylex invoked but %option yyclass used\" );" ); - outn( "\treturn 0;" ); - outn( "\t}" ); - - out_str( "\n#define YY_DECL int %s::yylex()\n", - yyclass ); - } - } - - else - { - if ( yytext_is_array ) - outn( "extern YY_CHAR yytext[];\n" ); - - else - { - outn( "extern YY_CHAR *yytext;" ); - outn( "#define yytext_ptr yytext" ); - } - - if ( yyclass ) - flexerror( - _( "%option yyclass only meaningful for C++ scanners" ) ); - } - - if ( useecs ) - numecs = cre8ecs( nextecm, ecgroup, csize ); - else - numecs = csize; - - /* Now map the equivalence class for NUL to its expected place. */ - ecgroup[0] = ecgroup[csize]; - NUL_ec = ABS( ecgroup[0] ); - - if ( useecs ) - ccl2ecl(); - } - - -/* set_up_initial_allocations - allocate memory for internal tables */ - -void set_up_initial_allocations() - { - current_mns = INITIAL_MNS; - firstst = allocate_integer_array( current_mns ); - lastst = allocate_integer_array( current_mns ); - finalst = allocate_integer_array( current_mns ); - transchar = allocate_integer_array( current_mns ); - trans1 = allocate_integer_array( current_mns ); - trans2 = allocate_integer_array( current_mns ); - accptnum = allocate_integer_array( current_mns ); - assoc_rule = allocate_integer_array( current_mns ); - state_type = allocate_integer_array( current_mns ); - - current_max_rules = INITIAL_MAX_RULES; - rule_type = allocate_integer_array( current_max_rules ); - rule_linenum = allocate_integer_array( current_max_rules ); - rule_useful = allocate_integer_array( current_max_rules ); - - current_max_scs = INITIAL_MAX_SCS; - scset = allocate_integer_array( current_max_scs ); - scbol = allocate_integer_array( current_max_scs ); - scxclu = allocate_integer_array( current_max_scs ); - sceof = allocate_integer_array( current_max_scs ); - scname = allocate_char_ptr_array( current_max_scs ); - - current_maxccls = INITIAL_MAX_CCLS; - cclmap = allocate_integer_array( current_maxccls ); - ccllen = allocate_integer_array( current_maxccls ); - cclng = allocate_integer_array( current_maxccls ); - - current_max_ccl_tbl_size = INITIAL_MAX_CCL_TBL_SIZE; - ccltbl = allocate_wchar_array( current_max_ccl_tbl_size ); - - current_max_dfa_size = INITIAL_MAX_DFA_SIZE; - - current_max_xpairs = INITIAL_MAX_XPAIRS; - nxt = allocate_integer_array( current_max_xpairs ); - chk = allocate_integer_array( current_max_xpairs ); - - current_max_template_xpairs = INITIAL_MAX_TEMPLATE_XPAIRS; - tnxt = allocate_integer_array( current_max_template_xpairs ); - - current_max_dfas = INITIAL_MAX_DFAS; - base = allocate_integer_array( current_max_dfas ); - def = allocate_integer_array( current_max_dfas ); - dfasiz = allocate_integer_array( current_max_dfas ); - accsiz = allocate_integer_array( current_max_dfas ); - dhash = allocate_integer_array( current_max_dfas ); - dss = allocate_int_ptr_array( current_max_dfas ); - dfaacc = allocate_dfaacc_union( current_max_dfas ); - - nultrans = (int *) 0; - } - - -void usage() - { - FILE *f = stdout; - - fprintf( f, -_( "%s [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -ooutput -Pprefix -Sskeleton]\n" ), - program_name ); - fprintf( f, _( "\t[--help --version] [file ...]\n" ) ); - - fprintf( f, _( "\t-b generate backing-up information to %s\n" ), - backing_name ); - fprintf( f, _( "\t-c do-nothing POSIX option\n" ) ); - fprintf( f, _( "\t-d turn on debug mode in generated scanner\n" ) ); - fprintf( f, _( "\t-f generate fast, large scanner\n" ) ); - fprintf( f, _( "\t-h produce this help message\n" ) ); - fprintf( f, _( "\t-i generate case-insensitive scanner\n" ) ); - fprintf( f, _( "\t-l maximal compatibility with original lex\n" ) ); - fprintf( f, _( "\t-n do-nothing POSIX option\n" ) ); - fprintf( f, _( "\t-p generate performance report to stderr\n" ) ); - fprintf( f, - _( "\t-s suppress default rule to ECHO unmatched text\n" ) ); - - if ( ! did_outfilename ) - { - sprintf( outfile_path, outfile_template, - prefix, C_plus_plus ? "cc" : "c" ); - outfilename = outfile_path; - } - - fprintf( f, - _( "\t-t write generated scanner on stdout instead of %s\n" ), - outfilename ); - - fprintf( f, - _( "\t-v write summary of scanner statistics to f\n" ) ); - fprintf( f, _( "\t-w do not generate warnings\n" ) ); - fprintf( f, _( "\t-B generate batch scanner (opposite of -I)\n" ) ); - fprintf( f, - _( "\t-F use alternative fast scanner representation\n" ) ); - fprintf( f, - _( "\t-I generate interactive scanner (opposite of -B)\n" ) ); - fprintf( f, _( "\t-L suppress #line directives in scanner\n" ) ); - fprintf( f, _( "\t-T %s should run in trace mode\n" ), program_name ); - fprintf( f, _( "\t-V report %s version\n" ), program_name ); - fprintf( f, _( "\t-7 generate 7-bit scanner\n" ) ); - fprintf( f, _( "\t-8 generate 8-bit scanner\n" ) ); - fprintf( f, _( "\t-U generate 16-bit (Unicode) scanner\n" ) ); - fprintf( f, _( "\t-+ generate C++ scanner class\n" ) ); - fprintf( f, _( "\t-? produce this help message\n" ) ); - fprintf( f, -_( "\t-C specify degree of table compression (default is -Cem):\n" ) ); - fprintf( f, -_( "\t\t-Ca trade off larger tables for better memory alignment\n" ) ); - fprintf( f, _( "\t\t-Ce construct equivalence classes\n" ) ); - fprintf( f, -_( "\t\t-Cf do not compress scanner tables; use -f representation\n" ) ); - fprintf( f, -_( "\t\t-CF do not compress scanner tables; use -F representation\n" ) ); - fprintf( f, _( "\t\t-Cm construct meta-equivalence classes\n" ) ); - fprintf( f, - _( "\t\t-Cr use read() instead of stdio for scanner input\n" ) ); - fprintf( f, _( "\t-o specify output filename\n" ) ); - fprintf( f, _( "\t-P specify scanner prefix other than \"yy\"\n" ) ); - fprintf( f, _( "\t-S specify skeleton file\n" ) ); - fprintf( f, _( "\t--help produce this help message\n" ) ); - fprintf( f, _( "\t--version report %s version\n" ), program_name ); - } diff --git a/to.do/unicode/misc.c b/to.do/unicode/misc.c deleted file mode 100644 index 60d4e44..0000000 --- a/to.do/unicode/misc.c +++ /dev/null @@ -1,894 +0,0 @@ -/* misc - miscellaneous flex routines */ - -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Vern Paxson. - * - * The United States Government has rights in this work pursuant - * to contract no. DE-AC03-76SF00098 between the United States - * Department of Energy and the University of California. - * - * Redistribution and use in source and binary forms are permitted provided - * that: (1) source distributions retain this entire copyright notice and - * comment, and (2) distributions including binaries display the following - * acknowledgement: ``This product includes software developed by the - * University of California, Berkeley and its contributors'' in the - * documentation or other materials provided with the distribution and in - * all advertising materials mentioning features or use of this software. - * 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. - */ - -/* $Header$ */ - -#include "flexdef.h" - - -void action_define( defname, value ) -char *defname; -int value; - { - char buf[MAXLINE]; - - if ( (int) strlen( defname ) > MAXLINE / 2 ) - { - format_pinpoint_message( _( "name \"%s\" ridiculously long" ), - defname ); - return; - } - - sprintf( buf, "#define %s %d\n", defname, value ); - add_action( buf ); - } - - -void add_action( new_text ) -char *new_text; - { - int len = strlen( new_text ); - - while ( len + action_index >= action_size - 10 /* slop */ ) - { - int new_size = action_size * 2; - - if ( new_size <= 0 ) - /* Increase just a little, to try to avoid overflow - * on 16-bit machines. - */ - action_size += action_size / 8; - else - action_size = new_size; - - action_array = - reallocate_character_array( action_array, action_size ); - } - - strcpy( &action_array[action_index], new_text ); - - action_index += len; - } - - -/* allocate_array - allocate memory for an integer array of the given size */ - -void *allocate_array( size, element_size ) -int size; -size_t element_size; - { - register void *mem; - size_t num_bytes = element_size * size; - - mem = flex_alloc( num_bytes ); - if ( ! mem ) - flexfatal( - _( "memory allocation failed in allocate_array()" ) ); - - return mem; - } - - -/* all_lower - true if a string is all lower-case */ - -int all_lower( str ) -register char *str; - { - while ( *str ) - { - if ( ! isascii( (Char) *str ) || ! islower( *str ) ) - return 0; - ++str; - } - - return 1; - } - - -/* all_upper - true if a string is all upper-case */ - -int all_upper( str ) -register char *str; - { - while ( *str ) - { - if ( ! isascii( (Char) *str ) || ! isupper( *str ) ) - return 0; - ++str; - } - - return 1; - } - - -/* bubble - bubble sort an integer array in increasing order - * - * synopsis - * int v[n], n; - * void bubble( v, n ); - * - * description - * sorts the first n elements of array v and replaces them in - * increasing order. - * - * passed - * v - the array to be sorted - * n - the number of elements of 'v' to be sorted - */ - -void bubble( v, n ) -int v[], n; - { - register int i, j, k; - - for ( i = n; i > 1; --i ) - for ( j = 1; j < i; ++j ) - if ( v[j] > v[j + 1] ) /* compare */ - { - k = v[j]; /* exchange */ - v[j] = v[j + 1]; - v[j + 1] = k; - } - } - - -/* check_char - checks a character to make sure it's within the range - * we're expecting. If not, generates fatal error message - * and exits. - */ - -void check_char( c ) -int c; - { - if ( c >= CSIZE ) - lerrsf( _( "bad character '%s' detected in check_char()" ), - readable_form( c ) ); - - if ( c >= csize ) - { - if ( c < 256 ) - lerrsf( - _( "scanner requires -8 flag to use the character %s" ), - readable_form( c ) ); - else - lerrsf( - _( "scanner requires -U flag to use the character %s" ), - readable_form( c ) ); - } - } - - - -/* clower - replace upper-case letter to lower-case */ - -Char clower( c ) -register int c; - { - return (Char) ((isascii( c ) && isupper( c )) ? tolower( c ) : c); - } - - -/* copy_string - returns a dynamically allocated copy of a string */ - -char *copy_string( str ) -register const char *str; - { - register const char *c1; - register char *c2; - char *copy; - unsigned int size; - - /* find length */ - for ( c1 = str; *c1; ++c1 ) - ; - - size = (c1 - str + 1) * sizeof( char ); - copy = (char *) flex_alloc( size ); - - if ( copy == NULL ) - flexfatal( _( "dynamic memory failure in copy_string()" ) ); - - for ( c2 = copy; (*c2++ = *str++) != 0; ) - ; - - return copy; - } - - -/* copy_unsigned_string - - * returns a dynamically allocated copy of a (potentially) unsigned string - */ - -Char *copy_unsigned_string( str ) -register Char *str; - { - register Char *c; - Char *copy; - - /* find length */ - for ( c = str; *c; ++c ) - ; - - copy = allocate_Character_array( c - str + 1 ); - - for ( c = copy; (*c++ = *str++) != 0; ) - ; - - return copy; - } - - -/* cshell - shell sort a character array in increasing order - * - * synopsis - * - * Char v[n]; - * int n, special_case_0; - * cshell( v, n, special_case_0 ); - * - * description - * Does a shell sort of the first n elements of array v. - * If special_case_0 is true, then any element equal to 0 - * is instead assumed to have infinite weight. - * - * passed - * v - array to be sorted - * n - number of elements of v to be sorted - */ - -void cshell( v, n, special_case_0 ) -wchar_t v[]; -int n, special_case_0; - { - int gap, i, j, jg; - wchar_t k; - - for ( gap = n / 2; gap > 0; gap = gap / 2 ) - for ( i = gap; i < n; ++i ) - for ( j = i - gap; j >= 0; j = j - gap ) - { - jg = j + gap; - - if ( special_case_0 ) - { - if ( v[jg] == 0 ) - break; - - else if ( v[j] != 0 && v[j] <= v[jg] ) - break; - } - - else if ( v[j] <= v[jg] ) - break; - - k = v[j]; - v[j] = v[jg]; - v[jg] = k; - } - } - - -/* dataend - finish up a block of data declarations */ - -void dataend() - { - if ( datapos > 0 ) - dataflush(); - - /* add terminator for initialization; { for vi */ - outn( " } ;\n" ); - - dataline = 0; - datapos = 0; - } - - -/* dataflush - flush generated data statements */ - -void dataflush() - { - outc( '\n' ); - - if ( ++dataline >= NUMDATALINES ) - { - /* Put out a blank line so that the table is grouped into - * large blocks that enable the user to find elements easily. - */ - outc( '\n' ); - dataline = 0; - } - - /* Reset the number of characters written on the current line. */ - datapos = 0; - } - - -/* flexerror - report an error message and terminate */ - -void flexerror( msg ) -const char msg[]; - { - fprintf( stderr, "%s: %s\n", program_name, msg ); - flexend( 1 ); - } - - -/* flexfatal - report a fatal error message and terminate */ - -void flexfatal( msg ) -const char msg[]; - { - fprintf( stderr, _( "%s: fatal internal error, %s\n" ), - program_name, msg ); - exit( 1 ); - } - - -/* htoi - convert a hexadecimal digit string to an integer value */ - -int htoi( str ) -Char str[]; - { - unsigned int result; - - (void) sscanf( (char *) str, "%x", &result ); - - return result; - } - - -/* lerrif - report an error message formatted with one integer argument */ - -void lerrif( msg, arg ) -const char msg[]; -int arg; - { - char errmsg[MAXLINE]; - (void) sprintf( errmsg, msg, arg ); - flexerror( errmsg ); - } - - -/* lerrsf - report an error message formatted with one string argument */ - -void lerrsf( msg, arg ) -const char msg[], arg[]; - { - char errmsg[MAXLINE]; - - (void) sprintf( errmsg, msg, arg ); - flexerror( errmsg ); - } - - -/* line_directive_out - spit out a "#line" statement */ - -void line_directive_out( output_file, do_infile ) -FILE *output_file; -int do_infile; - { - char directive[MAXLINE], filename[MAXLINE]; - char *s1, *s2, *s3; - static char line_fmt[] = "#line %d \"%s\"\n"; - - if ( ! gen_line_dirs ) - return; - - if ( (do_infile && ! infilename) || (! do_infile && ! outfilename) ) - /* don't know the filename to use, skip */ - return; - - s1 = do_infile ? infilename : outfilename; - s2 = filename; - s3 = &filename[sizeof( filename ) - 2]; - - while ( s2 < s3 && *s1 ) - { - if ( *s1 == '\\' ) - /* Escape the '\' */ - *s2++ = '\\'; - - *s2++ = *s1++; - } - - *s2 = '\0'; - - if ( do_infile ) - sprintf( directive, line_fmt, linenum, filename ); - else - { - if ( output_file == stdout ) - /* Account for the line directive itself. */ - ++out_linenum; - - sprintf( directive, line_fmt, out_linenum, filename ); - } - - /* If output_file is nil then we should put the directive in - * the accumulated actions. - */ - if ( output_file ) - { - fputs( directive, output_file ); - } - else - add_action( directive ); - } - - -/* mark_defs1 - mark the current position in the action array as - * representing where the user's section 1 definitions end - * and the prolog begins - */ -void mark_defs1() - { - defs1_offset = 0; - action_array[action_index++] = '\0'; - action_offset = prolog_offset = action_index; - action_array[action_index] = '\0'; - } - - -/* mark_prolog - mark the current position in the action array as - * representing the end of the action prolog - */ -void mark_prolog() - { - action_array[action_index++] = '\0'; - action_offset = action_index; - action_array[action_index] = '\0'; - } - - -/* mk2data - generate a data statement for a two-dimensional array - * - * Generates a data statement initializing the current 2-D array to "value". - */ -void mk2data( value ) -int value; - { - if ( datapos >= NUMDATAITEMS ) - { - outc( ',' ); - dataflush(); - } - - if ( datapos == 0 ) - /* Indent. */ - out( " " ); - - else - outc( ',' ); - - ++datapos; - - out_dec( "%5d", value ); - } - - -/* mkdata - generate a data statement - * - * Generates a data statement initializing the current array element to - * "value". - */ -void mkdata( value ) -int value; - { - if ( datapos >= NUMDATAITEMS ) - { - outc( ',' ); - dataflush(); - } - - if ( datapos == 0 ) - /* Indent. */ - out( " " ); - else - outc( ',' ); - - ++datapos; - - out_dec( "%5d", value ); - } - - -/* myctoi - return the integer represented by a string of digits */ - -int myctoi( array ) -char array[]; - { - int val = 0; - - (void) sscanf( array, "%d", &val ); - - return val; - } - - -/* myesc - return character corresponding to escape sequence */ - -int myesc( array ) -Char array[]; - { - Char c; - unsigned int esc_char; - - switch ( array[1] ) - { - case 'b': return '\b'; - case 'f': return '\f'; - case 'n': return '\n'; - case 'r': return '\r'; - case 't': return '\t'; - -#if __STDC__ - case 'a': return '\a'; - case 'v': return '\v'; -#else - case 'a': return '\007'; - case 'v': return '\013'; -#endif - - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - { /* \<octal> */ - int sptr = 1; - - while ( isascii( array[sptr] ) && - isdigit( array[sptr] ) ) - /* Don't increment inside loop control - * because if isdigit() is a macro it might - * expand into multiple increments ... - */ - ++sptr; - - c = array[sptr]; - array[sptr] = '\0'; - - esc_char = otoi( array + 1 ); - - array[sptr] = c; - - return esc_char; - } - - case 'x': - { /* \x<hex> */ - int sptr = 2; - - while ( isascii( array[sptr] ) && - isxdigit( (char) array[sptr] ) ) - /* Don't increment inside loop control - * because if isdigit() is a macro it might - * expand into multiple increments ... - */ - ++sptr; - - c = array[sptr]; - array[sptr] = '\0'; - - esc_char = htoi( array + 2 ); - - array[sptr] = c; - - return esc_char; - } - - default: - return array[1]; - } - } - - -/* otoi - convert an octal digit string to an integer value */ - -int otoi( str ) -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. - */ - -void out( str ) -const char str[]; - { - fputs( str, stdout ); - out_line_count( str ); - } - -void out_dec( fmt, n ) -const char fmt[]; -int n; - { - printf( fmt, n ); - out_line_count( fmt ); - } - -void out_dec2( fmt, n1, n2 ) -const char fmt[]; -int n1, n2; - { - printf( fmt, n1, n2 ); - out_line_count( fmt ); - } - -void out_hex( fmt, x ) -const char fmt[]; -unsigned int x; - { - printf( fmt, x ); - out_line_count( fmt ); - } - -void out_line_count( str ) -const char str[]; - { - register int i; - - for ( i = 0; str[i]; ++i ) - if ( str[i] == '\n' ) - ++out_linenum; - } - -void out_str( fmt, str ) -const char fmt[], str[]; - { - printf( fmt, str ); - out_line_count( fmt ); - out_line_count( str ); - } - -void out_str3( fmt, s1, s2, s3 ) -const char fmt[], s1[], s2[], s3[]; - { - printf( fmt, s1, s2, s3 ); - out_line_count( fmt ); - out_line_count( s1 ); - out_line_count( s2 ); - out_line_count( s3 ); - } - -void out_str_dec( fmt, str, n ) -const char fmt[], str[]; -int n; - { - printf( fmt, str, n ); - out_line_count( fmt ); - out_line_count( str ); - } - -void outc( c ) -int c; - { - putc( c, stdout ); - - if ( c == '\n' ) - ++out_linenum; - } - -void outn( str ) -const char str[]; - { - puts( str ); - out_line_count( str ); - ++out_linenum; - } - - -/* readable_form - return the the human-readable form of a character - * - * The returned string is in static storage. - */ - -char *readable_form( c ) -register int c; - { - static char rform[10]; - - if ( (c >= 0 && c < 32) || c >= 127 ) - { - switch ( c ) - { - case '\b': return "\\b"; - case '\f': return "\\f"; - case '\n': return "\\n"; - case '\r': return "\\r"; - case '\t': return "\\t"; - -#if __STDC__ - case '\a': return "\\a"; - case '\v': return "\\v"; -#endif - - default: - (void) sprintf( rform, "\\%.3o", - (unsigned int) c ); - return rform; - } - } - - else if ( c == ' ' ) - return "' '"; - - else - { - rform[0] = c; - rform[1] = '\0'; - - return rform; - } - } - - -/* reallocate_array - increase the size of a dynamic array */ - -void *reallocate_array( array, size, element_size ) -void *array; -int size; -size_t element_size; - { - register void *new_array; - size_t num_bytes = element_size * size; - - new_array = flex_realloc( array, num_bytes ); - if ( ! new_array ) - flexfatal( _( "attempt to increase array size failed" ) ); - - return new_array; - } - - -/* skelout - write out one section of the skeleton file - * - * Description - * Copies skelfile or skel array to stdout until a line beginning with - * "%%" or EOF is found. - */ -void skelout() - { - char buf_storage[MAXLINE]; - char *buf = buf_storage; - int do_copy = 1; - - /* Loop pulling lines either from the skelfile, if we're using - * one, or from the skel[] array. - */ - while ( skelfile ? - (fgets( buf, MAXLINE, skelfile ) != NULL) : - ((buf = (char *) skel[skel_ind++]) != 0) ) - { /* copy from skel array */ - if ( buf[0] == '%' ) - { /* control line */ - switch ( buf[1] ) - { - case '%': - return; - - case '+': - do_copy = C_plus_plus; - break; - - case '-': - do_copy = ! C_plus_plus; - break; - - case '*': - do_copy = 1; - break; - - default: - flexfatal( - _( "bad line in skeleton file" ) ); - } - } - - else if ( do_copy ) - { - if ( skelfile ) - /* Skeleton file reads include final - * newline, skel[] array does not. - */ - out( buf ); - else - outn( buf ); - } - } - } - - -/* transition_struct_out - output a yy_trans_info structure - * - * outputs the yy_trans_info structure with the two elements, element_v and - * element_n. Formats the output with spaces and carriage returns. - */ - -void transition_struct_out( element_v, element_n ) -int element_v, element_n; - { - out_dec2( " {%4d,%4d },", element_v, element_n ); - - datapos += TRANS_STRUCT_PRINT_LENGTH; - - if ( datapos >= 79 - TRANS_STRUCT_PRINT_LENGTH ) - { - outc( '\n' ); - - if ( ++dataline % 10 == 0 ) - outc( '\n' ); - - datapos = 0; - } - } - - -/* The following is only needed when building flex's parser using certain - * broken versions of bison. - */ -void *yy_flex_xmalloc( size ) -int size; - { - void *result = flex_alloc( (size_t) size ); - - if ( ! result ) - flexfatal( - _( "memory allocation failed in yy_flex_xmalloc()" ) ); - - return result; - } - - -/* zero_out - set a region of memory to 0 - * - * Sets region_ptr[0] through region_ptr[size_in_bytes - 1] to zero. - */ - -void zero_out( region_ptr, size_in_bytes ) -char *region_ptr; -size_t size_in_bytes; - { - register char *rp, *rp_end; - - rp = region_ptr; - rp_end = region_ptr + size_in_bytes; - - while ( rp < rp_end ) - *rp++ = 0; - } diff --git a/to.do/unicode/scan.l b/to.do/unicode/scan.l deleted file mode 100644 index 0864068..0000000 --- a/to.do/unicode/scan.l +++ /dev/null @@ -1,710 +0,0 @@ -/* scan.l - scanner for flex input */ - -%{ -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Vern Paxson. - * - * The United States Government has rights in this work pursuant - * to contract no. DE-AC03-76SF00098 between the United States - * Department of Energy and the University of California. - * - * Redistribution and use in source and binary forms are permitted provided - * that: (1) source distributions retain this entire copyright notice and - * comment, and (2) distributions including binaries display the following - * acknowledgement: ``This product includes software developed by the - * University of California, Berkeley and its contributors'' in the - * documentation or other materials provided with the distribution and in - * all advertising materials mentioning features or use of this software. - * 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. - */ - -/* $Header$ */ - -#include "flexdef.h" -#include "parse.h" - -#define ACTION_ECHO add_action( yytext ) -#define ACTION_IFDEF(def, should_define) \ - { \ - if ( should_define ) \ - action_define( def, 1 ); \ - } - -#define MARK_END_OF_PROLOG mark_prolog(); - -#define YY_DECL \ - int flexscan() - -#define RETURNCHAR \ - yylval = (unsigned char) yytext[0]; \ - return CHAR; - -#define RETURNNAME \ - strcpy( nmstr, yytext ); \ - return NAME; - -#define PUT_BACK_STRING(str, start) \ - for ( i = strlen( str ) - 1; i >= start; --i ) \ - unput((str)[i]) - -#define CHECK_REJECT(str) \ - if ( all_upper( str ) ) \ - reject = true; - -#define CHECK_YYMORE(str) \ - if ( all_lower( str ) ) \ - yymore_used = true; -%} - -%option caseless nodefault outfile="scan.c" stack noyy_top_state -%option nostdinit - -%x SECT2 SECT2PROLOG SECT3 CODEBLOCK PICKUPDEF SC CARETISBOL NUM QUOTE -%x FIRSTCCL CCL ACTION RECOVER COMMENT ACTION_STRING PERCENT_BRACE_ACTION -%x OPTION LINEDIR - -WS [[:blank:]]+ -OPTWS [[:blank:]]* -NOT_WS [^[:blank:]\n] - -NL \r?\n - -NAME ([[:alpha:]_][[:alnum:]_-]*) -NOT_NAME [^[:alpha:]_*\n]+ - -SCNAME {NAME} - -ESCSEQ (\\([^\n]|[0-7]{1,6}|x[[:xdigit:]]{1,4})) - -FIRST_CCL_CHAR ([^\\\n]|{ESCSEQ}) -CCL_CHAR ([^\\\n\]]|{ESCSEQ}) -CCL_EXPR ("[:"[[:alpha:]]+":]") - -LEXOPT [aceknopr] - -%% - static int bracelevel, didadef, indented_code; - static int doing_rule_action = false; - static int option_sense; - - int doing_codeblock = false; - int i; - Char nmdef[MAXLINE]; - - -<INITIAL>{ - ^{WS} indented_code = true; BEGIN(CODEBLOCK); - ^"/*" ACTION_ECHO; yy_push_state( COMMENT ); - ^#{OPTWS}line{WS} yy_push_state( LINEDIR ); - ^"%s"{NAME}? return SCDECL; - ^"%x"{NAME}? return XSCDECL; - ^"%{".*{NL} { - ++linenum; - line_directive_out( (FILE *) 0, 1 ); - indented_code = false; - BEGIN(CODEBLOCK); - } - - {WS} /* discard */ - - ^"%%".* { - sectnum = 2; - bracelevel = 0; - mark_defs1(); - line_directive_out( (FILE *) 0, 1 ); - BEGIN(SECT2PROLOG); - return SECTEND; - } - - ^"%pointer".*{NL} yytext_is_array = false; ++linenum; - ^"%array".*{NL} yytext_is_array = true; ++linenum; - - ^"%option" BEGIN(OPTION); return OPTION_OP; - - ^"%"{LEXOPT}{OPTWS}[[:digit:]]*{OPTWS}{NL} ++linenum; /* ignore */ - ^"%"{LEXOPT}{WS}.*{NL} ++linenum; /* ignore */ - - ^"%"[^sxaceknopr{}].* synerr( _( "unrecognized '%' directive" ) ); - - ^{NAME} { - strcpy( nmstr, yytext ); - didadef = false; - BEGIN(PICKUPDEF); - } - - {SCNAME} RETURNNAME; - ^{OPTWS}{NL} ++linenum; /* allows blank lines in section 1 */ - {OPTWS}{NL} ACTION_ECHO; ++linenum; /* maybe end of comment line */ -} - - -<COMMENT>{ - "*/" ACTION_ECHO; yy_pop_state(); - "*" ACTION_ECHO; - [^*\n]+ ACTION_ECHO; - [^*\n]*{NL} ++linenum; ACTION_ECHO; -} - -<LINEDIR>{ - \n yy_pop_state(); - [[:digit:]]+ linenum = myctoi( yytext ); - - \"[^"\n]*\" { - flex_free( (void *) infilename ); - infilename = copy_string( yytext + 1 ); - infilename[strlen( infilename ) - 1] = '\0'; - } - . /* ignore spurious characters */ -} - -<CODEBLOCK>{ - ^"%}".*{NL} ++linenum; BEGIN(INITIAL); - - {NAME}|{NOT_NAME}|. ACTION_ECHO; - - {NL} { - ++linenum; - ACTION_ECHO; - if ( indented_code ) - BEGIN(INITIAL); - } -} - - -<PICKUPDEF>{ - {WS} /* separates name and definition */ - - {NOT_WS}.* { - strcpy( (char *) nmdef, yytext ); - - /* Skip trailing whitespace. */ - for ( i = strlen( (char *) nmdef ) - 1; - i >= 0 && (nmdef[i] == ' ' || nmdef[i] == '\t'); - --i ) - ; - - nmdef[i + 1] = '\0'; - - ndinstal( nmstr, nmdef ); - didadef = true; - } - - {NL} { - if ( ! didadef ) - synerr( _( "incomplete name definition" ) ); - BEGIN(INITIAL); - ++linenum; - } -} - - -<OPTION>{ - {NL} ++linenum; BEGIN(INITIAL); - {WS} option_sense = true; - - "=" return '='; - - no option_sense = ! option_sense; - - 7bit csize = option_sense ? 128 : 256; - 8bit csize = option_sense ? 256 : 128; - 16bit csize = option_sense ? 65536 : 256; - - align long_align = option_sense; - always-interactive { - action_define( "YY_ALWAYS_INTERACTIVE", option_sense ); - } - array yytext_is_array = option_sense; - backup backing_up_report = option_sense; - batch interactive = ! option_sense; - "c++" C_plus_plus = option_sense; - caseful|case-sensitive caseins = ! option_sense; - caseless|case-insensitive caseins = option_sense; - debug ddebug = option_sense; - default spprdflt = ! option_sense; - ecs useecs = option_sense; - fast { - useecs = usemecs = false; - use_read = fullspd = true; - } - full { - useecs = usemecs = false; - use_read = fulltbl = true; - } - input ACTION_IFDEF("YY_NO_INPUT", ! option_sense); - interactive interactive = option_sense; - lex-compat lex_compat = option_sense; - main { - action_define( "YY_MAIN", option_sense ); - do_yywrap = ! option_sense; - } - meta-ecs usemecs = option_sense; - never-interactive { - action_define( "YY_NEVER_INTERACTIVE", option_sense ); - } - perf-report performance_report += option_sense ? 1 : -1; - pointer yytext_is_array = ! option_sense; - read use_read = option_sense; - reject reject_really_used = option_sense; - stack action_define( "YY_STACK_USED", option_sense ); - stdinit do_stdinit = option_sense; - stdout use_stdout = option_sense; - unput ACTION_IFDEF("YY_NO_UNPUT", ! option_sense); - verbose printstats = option_sense; - warn nowarn = ! option_sense; - yylineno do_yylineno = option_sense; - yymore yymore_really_used = option_sense; - yywrap do_yywrap = option_sense; - - yy_push_state ACTION_IFDEF("YY_NO_PUSH_STATE", ! option_sense); - yy_pop_state ACTION_IFDEF("YY_NO_POP_STATE", ! option_sense); - yy_top_state ACTION_IFDEF("YY_NO_TOP_STATE", ! option_sense); - - yy_scan_buffer ACTION_IFDEF("YY_NO_SCAN_BUFFER", ! option_sense); - yy_scan_bytes ACTION_IFDEF("YY_NO_SCAN_BYTES", ! option_sense); - yy_scan_string ACTION_IFDEF("YY_NO_SCAN_STRING", ! option_sense); - - outfile return OPT_OUTFILE; - prefix return OPT_PREFIX; - yyclass return OPT_YYCLASS; - - \"[^"\n]*\" { - strcpy( nmstr, yytext + 1 ); - nmstr[strlen( nmstr ) - 1] = '\0'; - return NAME; - } - - (([a-mo-z]|n[a-np-z])[[:alpha:]\-+]*)|. { - format_synerr( _( "unrecognized %%option: %s" ), - yytext ); - BEGIN(RECOVER); - } -} - -<RECOVER>.*{NL} ++linenum; BEGIN(INITIAL); - - -<SECT2PROLOG>{ - ^"%{".* ++bracelevel; yyless( 2 ); /* eat only %{ */ - ^"%}".* --bracelevel; yyless( 2 ); /* eat only %} */ - - ^{WS}.* ACTION_ECHO; /* 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; - } - - .* ACTION_ECHO; - {NL} ++linenum; ACTION_ECHO; - - <<EOF>> { - mark_prolog(); - sectnum = 0; - yyterminate(); /* to stop the parser */ - } -} - -<SECT2>{ - ^{OPTWS}{NL} ++linenum; /* allow blank lines in section 2 */ - - ^{OPTWS}"%{" { - indented_code = false; - doing_codeblock = true; - bracelevel = 1; - BEGIN(PERCENT_BRACE_ACTION); - } - - ^{OPTWS}"<" BEGIN(SC); return '<'; - ^{OPTWS}"^" return '^'; - \" BEGIN(QUOTE); return '"'; - "{"/[[:digit:]] BEGIN(NUM); return '{'; - "$"/([[:blank:]]|{NL}) return '$'; - - {WS}"%{" { - bracelevel = 1; - BEGIN(PERCENT_BRACE_ACTION); - - if ( in_rule ) - { - doing_rule_action = true; - in_rule = false; - return '\n'; - } - } - {WS}"|".*{NL} continued_action = true; ++linenum; return '\n'; - - ^{WS}"/*" { - yyless( yyleng - 2 ); /* put back '/', '*' */ - bracelevel = 0; - continued_action = false; - BEGIN(ACTION); - } - - ^{WS} /* allow indented rules */ - - {WS} { - /* This rule is separate from the one below because - * otherwise we get variable trailing context, so - * we can't build the scanner using -{f,F}. - */ - bracelevel = 0; - continued_action = false; - BEGIN(ACTION); - - if ( in_rule ) - { - doing_rule_action = true; - in_rule = false; - return '\n'; - } - } - - {OPTWS}{NL} { - bracelevel = 0; - continued_action = false; - BEGIN(ACTION); - unput( '\n' ); /* so <ACTION> sees it */ - - if ( in_rule ) - { - doing_rule_action = true; - in_rule = false; - return '\n'; - } - } - - ^{OPTWS}"<<EOF>>" | - "<<EOF>>" return EOF_OP; - - ^"%%".* { - sectnum = 3; - BEGIN(SECT3); - yyterminate(); /* to stop the parser */ - } - - "["({FIRST_CCL_CHAR}|{CCL_EXPR})({CCL_CHAR}|{CCL_EXPR})* { - int cclval; - - strcpy( nmstr, yytext ); - - /* Check to see if we've already encountered this - * ccl. - */ - if ( (cclval = ccllookup( (Char *) nmstr )) != 0 ) - { - if ( input() != ']' ) - synerr( _( "bad character class" ) ); - - yylval = cclval; - ++cclreuse; - return PREVCCL; - } - else - { - /* We fudge a bit. We know that this ccl will - * soon be numbered as lastccl + 1 by cclinit. - */ - cclinstal( (Char *) nmstr, lastccl + 1 ); - - /* Push back everything but the leading bracket - * so the ccl can be rescanned. - */ - yyless( 1 ); - - BEGIN(FIRSTCCL); - return '['; - } - } - - "{"{NAME}"}" { - register Char *nmdefptr; - - strcpy( nmstr, yytext + 1 ); - nmstr[yyleng - 2] = '\0'; /* chop trailing brace */ - - if ( (nmdefptr = ndlookup( nmstr )) == 0 ) - format_synerr( - _( "undefined definition {%s}" ), - nmstr ); - - else - { /* push back name surrounded by ()'s */ - int len = strlen( (char *) nmdefptr ); - - if ( lex_compat || nmdefptr[0] == '^' || - (len > 0 && nmdefptr[len - 1] == '$') ) - { /* don't use ()'s after all */ - PUT_BACK_STRING((char *) nmdefptr, 0); - - if ( nmdefptr[0] == '^' ) - BEGIN(CARETISBOL); - } - - else - { - unput(')'); - PUT_BACK_STRING((char *) nmdefptr, 0); - unput('('); - } - } - } - - [/|*+?.(){}] return (unsigned char) yytext[0]; - . RETURNCHAR; -} - - -<SC>{ - [,*] return (unsigned char) yytext[0]; - ">" BEGIN(SECT2); return '>'; - ">"/^ BEGIN(CARETISBOL); return '>'; - {SCNAME} RETURNNAME; - . { - format_synerr( _( "bad <start condition>: %s" ), - yytext ); - } -} - -<CARETISBOL>"^" BEGIN(SECT2); return '^'; - - -<QUOTE>{ - [^"\n] RETURNCHAR; - \" BEGIN(SECT2); return '"'; - - {NL} { - synerr( _( "missing quote" ) ); - BEGIN(SECT2); - ++linenum; - return '"'; - } -} - - -<FIRSTCCL>{ - "^"/[^-\]\n] BEGIN(CCL); return '^'; - "^"/("-"|"]") return '^'; - . BEGIN(CCL); RETURNCHAR; -} - -<CCL>{ - -/[^\]\n] return '-'; - [^\]\n] RETURNCHAR; - "]" BEGIN(SECT2); return ']'; - .|{NL} { - synerr( _( "bad character class" ) ); - BEGIN(SECT2); - return ']'; - } -} - -<FIRSTCCL,CCL>{ - "[:alnum:]" BEGIN(CCL); return CCE_ALNUM; - "[:alpha:]" BEGIN(CCL); return CCE_ALPHA; - "[:blank:]" BEGIN(CCL); return CCE_BLANK; - "[:cntrl:]" BEGIN(CCL); return CCE_CNTRL; - "[:digit:]" BEGIN(CCL); return CCE_DIGIT; - "[:graph:]" BEGIN(CCL); return CCE_GRAPH; - "[:lower:]" BEGIN(CCL); return CCE_LOWER; - "[:print:]" BEGIN(CCL); return CCE_PRINT; - "[:punct:]" BEGIN(CCL); return CCE_PUNCT; - "[:space:]" BEGIN(CCL); return CCE_SPACE; - "[:upper:]" BEGIN(CCL); return CCE_UPPER; - "[:xdigit:]" BEGIN(CCL); return CCE_XDIGIT; - {CCL_EXPR} { - format_synerr( - _( "bad character class expression: %s" ), - yytext ); - BEGIN(CCL); return CCE_ALNUM; - } -} - -<NUM>{ - [[:digit:]]+ { - yylval = myctoi( yytext ); - return NUMBER; - } - - "," return ','; - "}" BEGIN(SECT2); return '}'; - - . { - synerr( _( "bad character inside {}'s" ) ); - BEGIN(SECT2); - return '}'; - } - - {NL} { - synerr( _( "missing }" ) ); - BEGIN(SECT2); - ++linenum; - return '}'; - } -} - - -<PERCENT_BRACE_ACTION>{ - {OPTWS}"%}".* bracelevel = 0; - - <ACTION>"/*" ACTION_ECHO; yy_push_state( COMMENT ); - - <CODEBLOCK,ACTION>{ - "reject" { - ACTION_ECHO; - CHECK_REJECT(yytext); - } - "yymore" { - ACTION_ECHO; - CHECK_YYMORE(yytext); - } - } - - {NAME}|{NOT_NAME}|. 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); - } - } -} - - - /* Reject and YYmore() are checked for above, in PERCENT_BRACE_ACTION */ -<ACTION>{ - "{" ACTION_ECHO; ++bracelevel; - "}" ACTION_ECHO; --bracelevel; - [^[:alpha:]_{}"'/\n]+ ACTION_ECHO; - {NAME} ACTION_ECHO; - "'"([^'\\\n]|\\.)*"'" ACTION_ECHO; /* character constant */ - \" ACTION_ECHO; BEGIN(ACTION_STRING); - {NL} { - ++linenum; - ACTION_ECHO; - if ( bracelevel == 0 ) - { - if ( doing_rule_action ) - add_action( "\tYY_BREAK\n" ); - - doing_rule_action = false; - BEGIN(SECT2); - } - } - . ACTION_ECHO; -} - -<ACTION_STRING>{ - [^"\\\n]+ ACTION_ECHO; - \\. ACTION_ECHO; - {NL} ++linenum; ACTION_ECHO; - \" ACTION_ECHO; BEGIN(ACTION); - . ACTION_ECHO; -} - -<COMMENT,ACTION,ACTION_STRING><<EOF>> { - synerr( _( "EOF encountered inside an action" ) ); - yyterminate(); - } - - -<SECT2,QUOTE,FIRSTCCL,CCL>{ESCSEQ} { - yylval = myesc( (Char *) yytext ); - - if ( YY_START == FIRSTCCL ) - BEGIN(CCL); - - return CHAR; - } - - -<SECT3>{ - .*(\n?) ECHO; - <<EOF>> sectnum = 0; yyterminate(); -} - -<*>.|\n format_synerr( _( "bad character: %s" ), yytext ); - -%% - - -int yywrap() - { - if ( --num_input_files > 0 ) - { - set_input_file( *++input_files ); - return 0; - } - - else - return 1; - } - - -/* set_input_file - open the given file (if NULL, stdin) for scanning */ - -void set_input_file( file ) -char *file; - { - if ( file && strcmp( file, "-" ) ) - { - infilename = copy_string( file ); - yyin = fopen( infilename, "r" ); - - if ( yyin == NULL ) - lerrsf( _( "can't open %s" ), file ); - } - - else - { - yyin = stdin; - infilename = copy_string( "<stdin>" ); - } - - linenum = 1; - } - - -/* Wrapper routines for accessing the scanner's malloc routines. */ - -void *flex_alloc( size ) -size_t size; - { - return (void *) malloc( size ); - } - -void *flex_realloc( ptr, size ) -void *ptr; -size_t size; - { - return (void *) realloc( ptr, size ); - } - -void flex_free( ptr ) -void *ptr; - { - if ( ptr ) - free( ptr ); - } diff --git a/to.do/unicode/tblcmp.c b/to.do/unicode/tblcmp.c deleted file mode 100644 index c21d9be..0000000 --- a/to.do/unicode/tblcmp.c +++ /dev/null @@ -1,887 +0,0 @@ -/* tblcmp - table compression routines */ - -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Vern Paxson. - * - * The United States Government has rights in this work pursuant - * to contract no. DE-AC03-76SF00098 between the United States - * Department of Energy and the University of California. - * - * Redistribution and use in source and binary forms are permitted provided - * that: (1) source distributions retain this entire copyright notice and - * comment, and (2) distributions including binaries display the following - * acknowledgement: ``This product includes software developed by the - * University of California, Berkeley and its contributors'' in the - * documentation or other materials provided with the distribution and in - * all advertising materials mentioning features or use of this software. - * 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. - */ - -/* $Header$ */ - -#include "flexdef.h" - - -/* declarations for functions that have forward references */ - -void mkentry PROTO((register int*, int, int, int, int)); -void mkprot PROTO((int[], int, int)); -void mktemplate PROTO((int[], int, int)); -void mv2front PROTO((int)); -int tbldiff PROTO((int[], int, int[])); - - -/* bldtbl - build table entries for dfa state - * - * synopsis - * int state[numecs], statenum, totaltrans, comstate, comfreq; - * bldtbl( state, statenum, totaltrans, comstate, comfreq ); - * - * State is the statenum'th dfa state. It is indexed by equivalence class and - * gives the number of the state to enter for a given equivalence class. - * totaltrans is the total number of transitions out of the state. Comstate - * is that state which is the destination of the most transitions out of State. - * Comfreq is how many transitions there are out of State to Comstate. - * - * A note on terminology: - * "protos" are transition tables which have a high probability of - * either being redundant (a state processed later will have an identical - * transition table) or nearly redundant (a state processed later will have - * many of the same out-transitions). A "most recently used" queue of - * protos is kept around with the hope that most states will find a proto - * which is similar enough to be usable, and therefore compacting the - * output tables. - * "templates" are a special type of proto. If a transition table is - * homogeneous or nearly homogeneous (all transitions go to the same - * destination) then the odds are good that future states will also go - * to the same destination state on basically the same character set. - * These homogeneous states are so common when dealing with large rule - * sets that they merit special attention. If the transition table were - * simply made into a proto, then (typically) each subsequent, similar - * state will differ from the proto for two out-transitions. One of these - * out-transitions will be that character on which the proto does not go - * to the common destination, and one will be that character on which the - * state does not go to the common destination. Templates, on the other - * hand, go to the common state on EVERY transition character, and therefore - * cost only one difference. - */ - -void bldtbl( state, statenum, totaltrans, comstate, comfreq ) -int state[], statenum, totaltrans, comstate, comfreq; - { - int extptr, extrct[2][CSIZE + 1]; - int mindiff, minprot, i, d; - - /* If extptr is 0 then the first array of extrct holds the result - * of the "best difference" to date, which is those transitions - * which occur in "state" but not in the proto which, to date, - * has the fewest differences between itself and "state". If - * extptr is 1 then the second array of extrct hold the best - * difference. The two arrays are toggled between so that the - * best difference to date can be kept around and also a difference - * just created by checking against a candidate "best" proto. - */ - - extptr = 0; - - /* If the state has too few out-transitions, don't bother trying to - * compact its tables. - */ - - if ( (totaltrans * 100) < (numecs * PROTO_SIZE_PERCENTAGE) ) - mkentry( state, numecs, statenum, JAMSTATE, totaltrans ); - - else - { - /* "checkcom" is true if we should only check "state" against - * protos which have the same "comstate" value. - */ - int checkcom = - comfreq * 100 > totaltrans * CHECK_COM_PERCENTAGE; - - minprot = firstprot; - mindiff = totaltrans; - - if ( checkcom ) - { - /* Find first proto which has the same "comstate". */ - for ( i = firstprot; i != NIL; i = protnext[i] ) - if ( protcomst[i] == comstate ) - { - minprot = i; - mindiff = tbldiff( state, minprot, - extrct[extptr] ); - break; - } - } - - else - { - /* Since we've decided that the most common destination - * out of "state" does not occur with a high enough - * frequency, we set the "comstate" to zero, assuring - * that if this state is entered into the proto list, - * it will not be considered a template. - */ - comstate = 0; - - if ( firstprot != NIL ) - { - minprot = firstprot; - mindiff = tbldiff( state, minprot, - extrct[extptr] ); - } - } - - /* We now have the first interesting proto in "minprot". If - * it matches within the tolerances set for the first proto, - * we don't want to bother scanning the rest of the proto list - * to see if we have any other reasonable matches. - */ - - if ( mindiff * 100 > totaltrans * FIRST_MATCH_DIFF_PERCENTAGE ) - { - /* Not a good enough match. Scan the rest of the - * protos. - */ - for ( i = minprot; i != NIL; i = protnext[i] ) - { - d = tbldiff( state, i, extrct[1 - extptr] ); - if ( d < mindiff ) - { - extptr = 1 - extptr; - mindiff = d; - minprot = i; - } - } - } - - /* Check if the proto we've decided on as our best bet is close - * enough to the state we want to match to be usable. - */ - - if ( mindiff * 100 > totaltrans * ACCEPTABLE_DIFF_PERCENTAGE ) - { - /* No good. If the state is homogeneous enough, - * we make a template out of it. Otherwise, we - * make a proto. - */ - - if ( comfreq * 100 >= - totaltrans * TEMPLATE_SAME_PERCENTAGE ) - mktemplate( state, statenum, comstate ); - - else - { - mkprot( state, statenum, comstate ); - mkentry( state, numecs, statenum, - JAMSTATE, totaltrans ); - } - } - - else - { /* use the proto */ - mkentry( extrct[extptr], numecs, statenum, - prottbl[minprot], mindiff ); - - /* If this state was sufficiently different from the - * proto we built it from, make it, too, a proto. - */ - - if ( mindiff * 100 >= - totaltrans * NEW_PROTO_DIFF_PERCENTAGE ) - mkprot( state, statenum, comstate ); - - /* Since mkprot added a new proto to the proto queue, - * it's possible that "minprot" is no longer on the - * proto queue (if it happened to have been the last - * entry, it would have been bumped off). If it's - * not there, then the new proto took its physical - * place (though logically the new proto is at the - * beginning of the queue), so in that case the - * following call will do nothing. - */ - - mv2front( minprot ); - } - } - } - - -/* cmptmps - compress template table entries - * - * Template tables are compressed by using the 'template equivalence - * classes', which are collections of transition character equivalence - * classes which always appear together in templates - really meta-equivalence - * classes. - */ - -void cmptmps() - { - int tmpstorage[CSIZE + 1]; - register int *tmp = tmpstorage, i, j; - int totaltrans, trans; - - peakpairs = numtemps * numecs + tblend; - - if ( usemecs ) - { - /* Create equivalence classes based on data gathered on - * template transitions. - */ - nummecs = cre8ecs( tecfwd, tecbck, numecs ); - } - - else - nummecs = numecs; - - while ( lastdfa + numtemps + 1 >= current_max_dfas ) - increase_max_dfas(); - - /* Loop through each template. */ - - for ( i = 1; i <= numtemps; ++i ) - { - /* Number of non-jam transitions out of this template. */ - totaltrans = 0; - - for ( j = 1; j <= numecs; ++j ) - { - trans = tnxt[numecs * i + j]; - - if ( usemecs ) - { - /* The absolute value of tecbck is the - * meta-equivalence class of a given - * equivalence class, as set up by cre8ecs(). - */ - if ( tecbck[j] > 0 ) - { - tmp[tecbck[j]] = trans; - - if ( trans > 0 ) - ++totaltrans; - } - } - - else - { - tmp[j] = trans; - - if ( trans > 0 ) - ++totaltrans; - } - } - - /* It is assumed (in a rather subtle way) in the skeleton - * that if we're using meta-equivalence classes, the def[] - * entry for all templates is the jam template, i.e., - * templates never default to other non-jam table entries - * (e.g., another template) - */ - - /* Leave room for the jam-state after the last real state. */ - mkentry( tmp, nummecs, lastdfa + i + 1, JAMSTATE, totaltrans ); - } - } - - - -/* expand_nxt_chk - expand the next check arrays */ - -void expand_nxt_chk() - { - register int old_max = current_max_xpairs; - - current_max_xpairs += MAX_XPAIRS_INCREMENT; - - ++num_reallocs; - - nxt = reallocate_integer_array( nxt, current_max_xpairs ); - chk = reallocate_integer_array( chk, current_max_xpairs ); - - zero_out( (char *) (chk + old_max), - (size_t) (MAX_XPAIRS_INCREMENT * sizeof( int )) ); - } - - -/* find_table_space - finds a space in the table for a state to be placed - * - * synopsis - * int *state, numtrans, block_start; - * int find_table_space(); - * - * block_start = find_table_space( state, numtrans ); - * - * State is the state to be added to the full speed transition table. - * Numtrans is the number of out-transitions for the state. - * - * find_table_space() returns the position of the start of the first block (in - * chk) able to accommodate the state - * - * In determining if a state will or will not fit, find_table_space() must take - * into account the fact that an end-of-buffer state will be added at [0], - * and an action number will be added in [-1]. - */ - -int find_table_space( state, numtrans ) -int *state, numtrans; - { - /* Firstfree is the position of the first possible occurrence of two - * consecutive unused records in the chk and nxt arrays. - */ - register int i; - register int *state_ptr, *chk_ptr; - register int *ptr_to_last_entry_in_state; - - /* If there are too many out-transitions, put the state at the end of - * nxt and chk. - */ - if ( numtrans > MAX_XTIONS_FULL_INTERIOR_FIT ) - { - /* If table is empty, return the first available spot in - * chk/nxt, which should be 1. - */ - if ( tblend < 2 ) - return 1; - - /* Start searching for table space near the end of - * chk/nxt arrays. - */ - i = tblend - numecs; - } - - else - /* Start searching for table space from the beginning - * (skipping only the elements which will definitely not - * hold the new state). - */ - i = firstfree; - - while ( 1 ) /* loops until a space is found */ - { - while ( i + numecs >= current_max_xpairs ) - expand_nxt_chk(); - - /* Loops until space for end-of-buffer and action number - * are found. - */ - while ( 1 ) - { - /* Check for action number space. */ - if ( chk[i - 1] == 0 ) - { - /* Check for end-of-buffer space. */ - if ( chk[i] == 0 ) - break; - - else - /* Since i != 0, there is no use - * checking to see if (++i) - 1 == 0, - * because that's the same as i == 0, - * so we skip a space. - */ - i += 2; - } - - else - ++i; - - while ( i + numecs >= current_max_xpairs ) - expand_nxt_chk(); - } - - /* If we started search from the beginning, store the new - * firstfree for the next call of find_table_space(). - */ - if ( numtrans <= MAX_XTIONS_FULL_INTERIOR_FIT ) - firstfree = i + 1; - - /* Check to see if all elements in chk (and therefore nxt) - * that are needed for the new state have not yet been taken. - */ - - state_ptr = &state[1]; - ptr_to_last_entry_in_state = &chk[i + numecs + 1]; - - for ( chk_ptr = &chk[i + 1]; - chk_ptr != ptr_to_last_entry_in_state; ++chk_ptr ) - if ( *(state_ptr++) != 0 && *chk_ptr != 0 ) - break; - - if ( chk_ptr == ptr_to_last_entry_in_state ) - return i; - - else - ++i; - } - } - - -/* inittbl - initialize transition tables - * - * Initializes "firstfree" to be one beyond the end of the table. Initializes - * all "chk" entries to be zero. - */ -void inittbl() - { - register int i; - - zero_out( (char *) chk, (size_t) (current_max_xpairs * sizeof( int )) ); - - tblend = 0; - firstfree = tblend + 1; - numtemps = 0; - - if ( usemecs ) - { - /* Set up doubly-linked meta-equivalence classes; these - * are sets of equivalence classes which all have identical - * transitions out of TEMPLATES. - */ - - tecbck[1] = NIL; - - for ( i = 2; i <= numecs; ++i ) - { - tecbck[i] = i - 1; - tecfwd[i - 1] = i; - } - - tecfwd[numecs] = NIL; - } - } - - -/* mkdeftbl - make the default, "jam" table entries */ - -void mkdeftbl() - { - int i; - - jamstate = lastdfa + 1; - - ++tblend; /* room for transition on end-of-buffer character */ - - while ( tblend + numecs >= current_max_xpairs ) - expand_nxt_chk(); - - /* Add in default end-of-buffer transition. */ - nxt[tblend] = end_of_buffer_state; - chk[tblend] = jamstate; - - for ( i = 1; i <= numecs; ++i ) - { - nxt[tblend + i] = 0; - chk[tblend + i] = jamstate; - } - - jambase = tblend; - - base[jamstate] = jambase; - def[jamstate] = 0; - - tblend += numecs; - ++numtemps; - } - - -/* mkentry - create base/def and nxt/chk entries for transition array - * - * synopsis - * int state[numchars + 1], numchars, statenum, deflink, totaltrans; - * mkentry( state, numchars, statenum, deflink, totaltrans ); - * - * "state" is a transition array "numchars" characters in size, "statenum" - * is the offset to be used into the base/def tables, and "deflink" is the - * entry to put in the "def" table entry. If "deflink" is equal to - * "JAMSTATE", then no attempt will be made to fit zero entries of "state" - * (i.e., jam entries) into the table. It is assumed that by linking to - * "JAMSTATE" they will be taken care of. In any case, entries in "state" - * marking transitions to "SAME_TRANS" are treated as though they will be - * taken care of by whereever "deflink" points. "totaltrans" is the total - * number of transitions out of the state. If it is below a certain threshold, - * the tables are searched for an interior spot that will accommodate the - * state array. - */ - -void mkentry( state, numchars, statenum, deflink, totaltrans ) -register int *state; -int numchars, statenum, deflink, totaltrans; - { - register int minec, maxec, i, baseaddr; - int tblbase, tbllast; - - if ( totaltrans == 0 ) - { /* there are no out-transitions */ - if ( deflink == JAMSTATE ) - base[statenum] = JAMSTATE; - else - base[statenum] = 0; - - def[statenum] = deflink; - return; - } - - for ( minec = 1; minec <= numchars; ++minec ) - { - if ( state[minec] != SAME_TRANS ) - if ( state[minec] != 0 || deflink != JAMSTATE ) - break; - } - - if ( totaltrans == 1 ) - { - /* There's only one out-transition. Save it for later to fill - * in holes in the tables. - */ - stack1( statenum, minec, state[minec], deflink ); - return; - } - - for ( maxec = numchars; maxec > 0; --maxec ) - { - if ( state[maxec] != SAME_TRANS ) - if ( state[maxec] != 0 || deflink != JAMSTATE ) - break; - } - - /* Whether we try to fit the state table in the middle of the table - * entries we have already generated, or if we just take the state - * table at the end of the nxt/chk tables, we must make sure that we - * have a valid base address (i.e., non-negative). Note that - * negative base addresses dangerous at run-time (because indexing - * the nxt array with one and a low-valued character will access - * memory before the start of the array. - */ - - /* Find the first transition of state that we need to worry about. */ - if ( totaltrans * 100 <= numchars * INTERIOR_FIT_PERCENTAGE ) - { - /* Attempt to squeeze it into the middle of the tables. */ - baseaddr = firstfree; - - while ( baseaddr < minec ) - { - /* Using baseaddr would result in a negative base - * address below; find the next free slot. - */ - for ( ++baseaddr; chk[baseaddr] != 0; ++baseaddr ) - ; - } - - while ( baseaddr + maxec - minec + 1 >= current_max_xpairs ) - expand_nxt_chk(); - - for ( i = minec; i <= maxec; ++i ) - if ( state[i] != SAME_TRANS && - (state[i] != 0 || deflink != JAMSTATE) && - chk[baseaddr + i - minec] != 0 ) - { /* baseaddr unsuitable - find another */ - for ( ++baseaddr; - baseaddr < current_max_xpairs && - chk[baseaddr] != 0; ++baseaddr ) - ; - - while ( baseaddr + maxec - minec + 1 >= - current_max_xpairs ) - expand_nxt_chk(); - - /* Reset the loop counter so we'll start all - * over again next time it's incremented. - */ - - i = minec - 1; - } - } - - else - { - /* Ensure that the base address we eventually generate is - * non-negative. - */ - baseaddr = MAX( tblend + 1, minec ); - } - - tblbase = baseaddr - minec; - tbllast = tblbase + maxec; - - while ( tbllast + 1 >= current_max_xpairs ) - expand_nxt_chk(); - - base[statenum] = tblbase; - def[statenum] = deflink; - - for ( i = minec; i <= maxec; ++i ) - if ( state[i] != SAME_TRANS ) - if ( state[i] != 0 || deflink != JAMSTATE ) - { - nxt[tblbase + i] = state[i]; - chk[tblbase + i] = statenum; - } - - if ( baseaddr == firstfree ) - /* Find next free slot in tables. */ - for ( ++firstfree; chk[firstfree] != 0; ++firstfree ) - ; - - tblend = MAX( tblend, tbllast ); - } - - -/* mk1tbl - create table entries for a state (or state fragment) which - * has only one out-transition - */ - -void mk1tbl( state, sym, onenxt, onedef ) -int state, sym, onenxt, onedef; - { - if ( firstfree < sym ) - firstfree = sym; - - while ( chk[firstfree] != 0 ) - if ( ++firstfree >= current_max_xpairs ) - expand_nxt_chk(); - - base[state] = firstfree - sym; - def[state] = onedef; - chk[firstfree] = state; - nxt[firstfree] = onenxt; - - if ( firstfree > tblend ) - { - tblend = firstfree++; - - if ( firstfree >= current_max_xpairs ) - expand_nxt_chk(); - } - } - - -/* mkprot - create new proto entry */ - -void mkprot( state, statenum, comstate ) -int state[], statenum, comstate; - { - int i, slot, tblbase; - - if ( ++numprots >= MSP || numecs * numprots >= PROT_SAVE_SIZE ) - { - /* Gotta make room for the new proto by dropping last entry in - * the queue. - */ - slot = lastprot; - lastprot = protprev[lastprot]; - protnext[lastprot] = NIL; - } - - else - slot = numprots; - - protnext[slot] = firstprot; - - if ( firstprot != NIL ) - protprev[firstprot] = slot; - - firstprot = slot; - prottbl[slot] = statenum; - protcomst[slot] = comstate; - - /* Copy state into save area so it can be compared with rapidly. */ - tblbase = numecs * (slot - 1); - - for ( i = 1; i <= numecs; ++i ) - protsave[tblbase + i] = state[i]; - } - - -/* mktemplate - create a template entry based on a state, and connect the state - * to it - */ - -void mktemplate( state, statenum, comstate ) -int state[], statenum, comstate; - { - int i, numdiff, tmpbase, tmp[CSIZE + 1]; - wchar_t transset[CSIZE + 1]; - int tsptr; - - ++numtemps; - - tsptr = 0; - - /* Calculate where we will temporarily store the transition table - * of the template in the tnxt[] array. The final transition table - * gets created by cmptmps(). - */ - - tmpbase = numtemps * numecs; - - if ( tmpbase + numecs >= current_max_template_xpairs ) - { - current_max_template_xpairs += MAX_TEMPLATE_XPAIRS_INCREMENT; - - ++num_reallocs; - - tnxt = reallocate_integer_array( tnxt, - current_max_template_xpairs ); - } - - for ( i = 1; i <= numecs; ++i ) - if ( state[i] == 0 ) - tnxt[tmpbase + i] = 0; - else - { - transset[tsptr++] = i; - tnxt[tmpbase + i] = comstate; - } - - if ( usemecs ) - mkeccl( transset, tsptr, tecfwd, tecbck, numecs, 0 ); - - mkprot( tnxt + tmpbase, -numtemps, comstate ); - - /* We rely on the fact that mkprot adds things to the beginning - * of the proto queue. - */ - - numdiff = tbldiff( state, firstprot, tmp ); - mkentry( tmp, numecs, statenum, -numtemps, numdiff ); - } - - -/* mv2front - move proto queue element to front of queue */ - -void mv2front( qelm ) -int qelm; - { - if ( firstprot != qelm ) - { - if ( qelm == lastprot ) - lastprot = protprev[lastprot]; - - protnext[protprev[qelm]] = protnext[qelm]; - - if ( protnext[qelm] != NIL ) - protprev[protnext[qelm]] = protprev[qelm]; - - protprev[qelm] = NIL; - protnext[qelm] = firstprot; - protprev[firstprot] = qelm; - firstprot = qelm; - } - } - - -/* place_state - place a state into full speed transition table - * - * State is the statenum'th state. It is indexed by equivalence class and - * gives the number of the state to enter for a given equivalence class. - * Transnum is the number of out-transitions for the state. - */ - -void place_state( state, statenum, transnum ) -int *state, statenum, transnum; - { - register int i; - register int *state_ptr; - int position = find_table_space( state, transnum ); - - /* "base" is the table of start positions. */ - base[statenum] = position; - - /* Put in action number marker; this non-zero number makes sure that - * find_table_space() knows that this position in chk/nxt is taken - * and should not be used for another accepting number in another - * state. - */ - chk[position - 1] = 1; - - /* Put in end-of-buffer marker; this is for the same purposes as - * above. - */ - chk[position] = 1; - - /* Place the state into chk and nxt. */ - state_ptr = &state[1]; - - for ( i = 1; i <= numecs; ++i, ++state_ptr ) - if ( *state_ptr != 0 ) - { - chk[position + i] = i; - nxt[position + i] = *state_ptr; - } - - if ( position + numecs > tblend ) - tblend = position + numecs; - } - - -/* stack1 - save states with only one out-transition to be processed later - * - * If there's room for another state on the "one-transition" stack, the - * state is pushed onto it, to be processed later by mk1tbl. If there's - * no room, we process the sucker right now. - */ - -void stack1( statenum, sym, nextstate, deflink ) -int statenum, sym, nextstate, deflink; - { - if ( onesp >= ONE_STACK_SIZE - 1 ) - mk1tbl( statenum, sym, nextstate, deflink ); - - else - { - ++onesp; - onestate[onesp] = statenum; - onesym[onesp] = sym; - onenext[onesp] = nextstate; - onedef[onesp] = deflink; - } - } - - -/* tbldiff - compute differences between two state tables - * - * "state" is the state array which is to be extracted from the pr'th - * proto. "pr" is both the number of the proto we are extracting from - * and an index into the save area where we can find the proto's complete - * state table. Each entry in "state" which differs from the corresponding - * entry of "pr" will appear in "ext". - * - * Entries which are the same in both "state" and "pr" will be marked - * as transitions to "SAME_TRANS" in "ext". The total number of differences - * between "state" and "pr" is returned as function value. Note that this - * number is "numecs" minus the number of "SAME_TRANS" entries in "ext". - */ - -int tbldiff( state, pr, ext ) -int state[], pr, ext[]; - { - register int i, *sp = state, *ep = ext, *protp; - register int numdiff = 0; - - protp = &protsave[numecs * (pr - 1)]; - - for ( i = numecs; i > 0; --i ) - { - if ( *++protp == *++sp ) - *++ep = SAME_TRANS; - else - { - *++ep = *sp; - ++numdiff; - } - } - - return numdiff; - } diff --git a/tools/Makefile.am b/tools/Makefile.am new file mode 100644 index 0000000..46743a6 --- /dev/null +++ b/tools/Makefile.am @@ -0,0 +1,2 @@ +EXTRA_DIST = \ + git2cl |