Import NetBSD flex
This commit is contained in:
2
external/bsd/Makefile
vendored
2
external/bsd/Makefile
vendored
@@ -1,3 +1,3 @@
|
||||
.include <bsd.own.mk>
|
||||
SUBDIR=byacc file mdocml
|
||||
SUBDIR=byacc file flex mdocml
|
||||
.include <bsd.subdir.mk>
|
||||
|
||||
6
external/bsd/flex/Makefile
vendored
Normal file
6
external/bsd/flex/Makefile
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
# $NetBSD: Makefile,v 1.2 2009/10/27 17:51:19 he Exp $
|
||||
|
||||
# No man on Minix due to lack of tex
|
||||
SUBDIR= lib bin #man
|
||||
|
||||
.include <bsd.subdir.mk>
|
||||
15
external/bsd/flex/Makefile.inc
vendored
Normal file
15
external/bsd/flex/Makefile.inc
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
# $NetBSD: Makefile.inc,v 1.2 2009/10/26 11:17:16 christos Exp $
|
||||
|
||||
WARNS?= 1
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
VERSION=2.5.35
|
||||
BINDIR?= /usr/bin
|
||||
|
||||
IDIST= ${NETBSDSRCDIR}/external/bsd/flex/dist
|
||||
|
||||
CPPFLAGS+= -DHAVE_CONFIG_H -I${.CURDIR}/../include -I${IDIST} \
|
||||
-DLOCALEDIR=\"/usr/share/locale\"
|
||||
|
||||
.PATH: ${IDIST}
|
||||
72
external/bsd/flex/bin/Makefile
vendored
Normal file
72
external/bsd/flex/bin/Makefile
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
# from: @(#)Makefile 5.4 (Berkeley) 6/24/90
|
||||
# $NetBSD: Makefile,v 1.9 2011/03/08 19:25:32 plunky Exp $
|
||||
#
|
||||
# By default, flex will be configured to generate 8-bit scanners only if the
|
||||
# -8 flag is given. If you want it to always generate 8-bit scanners, add
|
||||
# "-DDEFAULT_CSIZE=256" to CPPFLAGS. Note that doing so will double the size
|
||||
# of all uncompressed scanners.
|
||||
#
|
||||
# If on your system you have trouble building flex due to 8-bit character
|
||||
# problems, remove the -8 from FLEX_FLAGS and the "#define FLEX_8_BIT_CHARS"
|
||||
# from the beginning of flexdef.h.
|
||||
#
|
||||
# To bootstrap lex, cp initscan.c to scan.c and run make.
|
||||
|
||||
PROG= lex
|
||||
CPPFLAGS+=-I. -I${.CURDIR}
|
||||
SRCS= \
|
||||
buf.c \
|
||||
ccl.c \
|
||||
dfa.c \
|
||||
ecs.c \
|
||||
filter.c \
|
||||
gen.c \
|
||||
main.c \
|
||||
misc.c \
|
||||
nfa.c \
|
||||
options.c \
|
||||
parse.y \
|
||||
regex.c \
|
||||
scan.l \
|
||||
scanflags.c \
|
||||
scanopt.c \
|
||||
skel.c \
|
||||
sym.c \
|
||||
tables.c \
|
||||
tables_shared.c \
|
||||
tblcmp.c \
|
||||
yylex.c
|
||||
|
||||
YHEADER=1
|
||||
CLEANFILES+=skel.c
|
||||
INCS =FlexLexer.h
|
||||
INCSDIR=/usr/include/g++
|
||||
LDADD+=-lm
|
||||
.ifndef HOSTPROG
|
||||
DPADD+=${LIBM}
|
||||
.endif
|
||||
|
||||
MAN = flex.1
|
||||
|
||||
LINKS= ${BINDIR}/lex ${BINDIR}/flex \
|
||||
${BINDIR}/lex ${BINDIR}/flex++
|
||||
MLINKS= flex.1 lex.1
|
||||
|
||||
skel.c: flex.skl mkskel.sh flexint.h tables_shared.h
|
||||
${TOOL_SED} -e 's/m4_/m4postproc_/g' -e 's/m4preproc_/m4_/g' \
|
||||
${IDIST}/flex.skl | ${TOOL_M4} -I${IDIST} -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 .` | \
|
||||
${TOOL_SED} -e 's/m4postproc_/m4_/g' | \
|
||||
${HOST_SH} ${IDIST}/mkskel.sh > ${.TARGET}
|
||||
|
||||
.ifndef HOSTPROG
|
||||
scan.c: scan.l
|
||||
${_MKTARGET_LEX}
|
||||
${LEX} -t -p ${.ALLSRC} >${.TARGET}
|
||||
.endif
|
||||
|
||||
scan.o yylex.o: parse.h
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
4292
external/bsd/flex/bin/flex.1
vendored
Normal file
4292
external/bsd/flex/bin/flex.1
vendored
Normal file
File diff suppressed because it is too large
Load Diff
625
external/bsd/flex/dist/ABOUT-NLS
vendored
Normal file
625
external/bsd/flex/dist/ABOUT-NLS
vendored
Normal file
@@ -0,0 +1,625 @@
|
||||
Notes on the Free Translation Project
|
||||
*************************************
|
||||
|
||||
Free software is going international! The Free Translation Project
|
||||
is a way to get maintainers of free software, translators, and users all
|
||||
together, so that will gradually become able to speak many languages.
|
||||
A few packages already provide translations for their messages.
|
||||
|
||||
If you found this `ABOUT-NLS' file inside a distribution, you may
|
||||
assume that the distributed package does use GNU `gettext' internally,
|
||||
itself available at your nearest GNU archive site. But you do _not_
|
||||
need to install GNU `gettext' prior to configuring, installing or using
|
||||
this package with messages translated.
|
||||
|
||||
Installers will find here some useful hints. These notes also
|
||||
explain how users should proceed for getting the programs to use the
|
||||
available translations. They tell how people wanting to contribute and
|
||||
work at translations should contact the appropriate team.
|
||||
|
||||
When reporting bugs in the `intl/' directory or bugs which may be
|
||||
related to internationalization, you should tell about the version of
|
||||
`gettext' which is used. The information can be found in the
|
||||
`intl/VERSION' file, in internationalized packages.
|
||||
|
||||
Quick configuration advice
|
||||
==========================
|
||||
|
||||
If you want to exploit the full power of internationalization, you
|
||||
should configure it using
|
||||
|
||||
./configure --with-included-gettext
|
||||
|
||||
to force usage of internationalizing routines provided within this
|
||||
package, despite the existence of internationalizing capabilities in the
|
||||
operating system where this package is being installed. So far, only
|
||||
the `gettext' implementation in the GNU C library version 2 provides as
|
||||
many features (such as locale alias, message inheritance, automatic
|
||||
charset conversion or plural form handling) as the implementation here.
|
||||
It is also not possible to offer this additional functionality on top
|
||||
of a `catgets' implementation. Future versions of GNU `gettext' will
|
||||
very likely convey even more functionality. So it might be a good idea
|
||||
to change to GNU `gettext' as soon as possible.
|
||||
|
||||
So you need _not_ provide this option if you are using GNU libc 2 or
|
||||
you have installed a recent copy of the GNU gettext package with the
|
||||
included `libintl'.
|
||||
|
||||
INSTALL Matters
|
||||
===============
|
||||
|
||||
Some packages are "localizable" when properly installed; the
|
||||
programs they contain can be made to speak your own native language.
|
||||
Most such packages use GNU `gettext'. Other packages have their own
|
||||
ways to internationalization, predating GNU `gettext'.
|
||||
|
||||
By default, this package will be installed to allow translation of
|
||||
messages. It will automatically detect whether the system already
|
||||
provides the GNU `gettext' functions. If not, the GNU `gettext' own
|
||||
library will be used. This library is wholly contained within this
|
||||
package, usually in the `intl/' subdirectory, so prior installation of
|
||||
the GNU `gettext' package is _not_ required. Installers may use
|
||||
special options at configuration time for changing the default
|
||||
behaviour. The commands:
|
||||
|
||||
./configure --with-included-gettext
|
||||
./configure --disable-nls
|
||||
|
||||
will respectively bypass any pre-existing `gettext' to use the
|
||||
internationalizing routines provided within this package, or else,
|
||||
_totally_ disable translation of messages.
|
||||
|
||||
When you already have GNU `gettext' installed on your system and run
|
||||
configure without an option for your new package, `configure' will
|
||||
probably detect the previously built and installed `libintl.a' file and
|
||||
will decide to use this. This might be not what is desirable. You
|
||||
should use the more recent version of the GNU `gettext' library. I.e.
|
||||
if the file `intl/VERSION' shows that the library which comes with this
|
||||
package is more recent, you should use
|
||||
|
||||
./configure --with-included-gettext
|
||||
|
||||
to prevent auto-detection.
|
||||
|
||||
The configuration process will not test for the `catgets' function
|
||||
and therefore it will not be used. The reason is that even an
|
||||
emulation of `gettext' on top of `catgets' could not provide all the
|
||||
extensions of the GNU `gettext' library.
|
||||
|
||||
Internationalized packages have usually many `po/LL.po' files, where
|
||||
LL gives an ISO 639 two-letter code identifying the language. Unless
|
||||
translations have been forbidden at `configure' time by using the
|
||||
`--disable-nls' switch, all available translations are installed
|
||||
together with the package. However, the environment variable `LINGUAS'
|
||||
may be set, prior to configuration, to limit the installed set.
|
||||
`LINGUAS' should then contain a space separated list of two-letter
|
||||
codes, stating which languages are allowed.
|
||||
|
||||
Using This Package
|
||||
==================
|
||||
|
||||
As a user, if your language has been installed for this package, you
|
||||
only have to set the `LANG' environment variable to the appropriate
|
||||
`LL_CC' combination. Here `LL' is an ISO 639 two-letter language code,
|
||||
and `CC' is an ISO 3166 two-letter country code. For example, let's
|
||||
suppose that you speak German and live in Germany. At the shell
|
||||
prompt, merely execute `setenv LANG de_DE' (in `csh'),
|
||||
`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash').
|
||||
This can be done from your `.login' or `.profile' file, once and for
|
||||
all.
|
||||
|
||||
You might think that the country code specification is redundant.
|
||||
But in fact, some languages have dialects in different countries. For
|
||||
example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The
|
||||
country code serves to distinguish the dialects.
|
||||
|
||||
The locale naming convention of `LL_CC', with `LL' denoting the
|
||||
language and `CC' denoting the country, is the one use on systems based
|
||||
on GNU libc. On other systems, some variations of this scheme are
|
||||
used, such as `LL' or `LL_CC.ENCODING'. You can get the list of
|
||||
locales supported by your system for your country by running the command
|
||||
`locale -a | grep '^LL''.
|
||||
|
||||
Not all programs have translations for all languages. By default, an
|
||||
English message is shown in place of a nonexistent translation. If you
|
||||
understand other languages, you can set up a priority list of languages.
|
||||
This is done through a different environment variable, called
|
||||
`LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG'
|
||||
for the purpose of message handling, but you still need to have `LANG'
|
||||
set to the primary language; this is required by other parts of the
|
||||
system libraries. For example, some Swedish users who would rather
|
||||
read translations in German than English for when Swedish is not
|
||||
available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'.
|
||||
|
||||
In the `LANGUAGE' environment variable, but not in the `LANG'
|
||||
environment variable, `LL_CC' combinations can be abbreviated as `LL'
|
||||
to denote the language's main dialect. For example, `de' is equivalent
|
||||
to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT'
|
||||
(Portuguese as spoken in Portugal) in this context.
|
||||
|
||||
Translating Teams
|
||||
=================
|
||||
|
||||
For the Free Translation Project to be a success, we need interested
|
||||
people who like their own language and write it well, and who are also
|
||||
able to synergize with other translators speaking the same language.
|
||||
Each translation team has its own mailing list. The up-to-date list of
|
||||
teams can be found at the Free Translation Project's homepage,
|
||||
`http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams"
|
||||
area.
|
||||
|
||||
If you'd like to volunteer to _work_ at translating messages, you
|
||||
should become a member of the translating team for your own language.
|
||||
The subscribing address is _not_ the same as the list itself, it has
|
||||
`-request' appended. For example, speakers of Swedish can send a
|
||||
message to `sv-request@li.org', having this message body:
|
||||
|
||||
subscribe
|
||||
|
||||
Keep in mind that team members are expected to participate
|
||||
_actively_ in translations, or at solving translational difficulties,
|
||||
rather than merely lurking around. If your team does not exist yet and
|
||||
you want to start one, or if you are unsure about what to do or how to
|
||||
get started, please write to `translation@iro.umontreal.ca' to reach the
|
||||
coordinator for all translator teams.
|
||||
|
||||
The English team is special. It works at improving and uniformizing
|
||||
the terminology in use. Proven linguistic skill are praised more than
|
||||
programming skill, here.
|
||||
|
||||
Available Packages
|
||||
==================
|
||||
|
||||
Languages are not equally supported in all packages. The following
|
||||
matrix shows the current state of internationalization, as of May 2003.
|
||||
The matrix shows, in regard of each package, for which languages PO
|
||||
files have been submitted to translation coordination, with a
|
||||
translation percentage of at least 50%.
|
||||
|
||||
Ready PO files am az be bg ca cs da de el en en_GB eo es
|
||||
+-------------------------------------------+
|
||||
a2ps | [] [] [] [] |
|
||||
aegis | () |
|
||||
anubis | |
|
||||
ap-utils | |
|
||||
bash | [] [] [] |
|
||||
batchelor | |
|
||||
bfd | [] [] |
|
||||
binutils | [] [] |
|
||||
bison | [] [] [] |
|
||||
bluez-pin | [] [] |
|
||||
clisp | |
|
||||
clisp | [] [] [] |
|
||||
coreutils | [] [] [] [] |
|
||||
cpio | [] [] [] |
|
||||
darkstat | () [] |
|
||||
diffutils | [] [] [] [] [] [] [] |
|
||||
e2fsprogs | [] [] |
|
||||
enscript | [] [] [] [] |
|
||||
error | [] [] [] [] [] |
|
||||
fetchmail | [] () [] [] [] [] |
|
||||
fileutils | [] [] [] |
|
||||
findutils | [] [] [] [] [] [] |
|
||||
flex | [] [] [] [] |
|
||||
gas | [] |
|
||||
gawk | [] [] [] [] |
|
||||
gcal | [] |
|
||||
gcc | [] [] |
|
||||
gettext | [] [] [] [] [] |
|
||||
gettext-runtime | [] [] [] [] [] |
|
||||
gettext-tools | [] [] |
|
||||
gimp-print | [] [] [] [] [] |
|
||||
gliv | |
|
||||
glunarclock | [] [] [] |
|
||||
gnucash | () [] |
|
||||
gnucash-glossary | [] () [] |
|
||||
gnupg | [] () [] [] [] [] |
|
||||
gpe-calendar | [] |
|
||||
gpe-conf | [] |
|
||||
gpe-contacts | [] |
|
||||
gpe-edit | |
|
||||
gpe-login | [] |
|
||||
gpe-ownerinfo | [] |
|
||||
gpe-sketchbook | [] |
|
||||
gpe-timesheet | |
|
||||
gpe-today | [] |
|
||||
gpe-todo | [] |
|
||||
gphoto2 | [] [] [] [] |
|
||||
gprof | [] [] |
|
||||
gpsdrive | () () () |
|
||||
grep | [] [] [] [] [] |
|
||||
gretl | [] |
|
||||
hello | [] [] [] [] [] [] |
|
||||
id-utils | [] [] |
|
||||
indent | [] [] [] [] |
|
||||
jpilot | [] [] [] [] |
|
||||
jwhois | [] |
|
||||
kbd | [] [] [] [] [] |
|
||||
ld | [] [] |
|
||||
libc | [] [] [] [] [] [] |
|
||||
libgpewidget | [] |
|
||||
libiconv | [] [] [] [] [] |
|
||||
lifelines | [] () |
|
||||
lilypond | [] |
|
||||
lingoteach | |
|
||||
lingoteach_lessons | () () |
|
||||
lynx | [] [] [] [] |
|
||||
m4 | [] [] [] [] |
|
||||
mailutils | [] [] |
|
||||
make | [] [] [] |
|
||||
man-db | [] () [] [] () |
|
||||
mysecretdiary | [] [] [] |
|
||||
nano | [] () [] [] [] |
|
||||
nano_1_0 | [] () [] [] [] |
|
||||
opcodes | [] [] |
|
||||
parted | [] [] [] [] [] |
|
||||
ptx | [] [] [] [] [] |
|
||||
python | |
|
||||
radius | |
|
||||
recode | [] [] [] [] [] [] |
|
||||
screem | |
|
||||
sed | [] [] [] [] [] |
|
||||
sh-utils | [] [] [] |
|
||||
sharutils | [] [] [] [] [] [] |
|
||||
sketch | [] () [] |
|
||||
soundtracker | [] [] [] |
|
||||
sp | [] |
|
||||
tar | [] [] [] [] |
|
||||
texinfo | [] [] [] [] |
|
||||
textutils | [] [] [] [] |
|
||||
tin | () () |
|
||||
util-linux | [] [] [] [] [] |
|
||||
vorbis-tools | [] [] [] |
|
||||
wastesedge | () |
|
||||
wdiff | [] [] [] [] |
|
||||
wget | [] [] [] [] [] [] [] |
|
||||
xchat | [] [] [] |
|
||||
xpad | |
|
||||
+-------------------------------------------+
|
||||
am az be bg ca cs da de el en en_GB eo es
|
||||
0 1 4 2 31 17 54 60 14 1 4 12 56
|
||||
|
||||
et fa fi fr ga gl he hr hu id it ja ko
|
||||
+----------------------------------------+
|
||||
a2ps | [] [] [] () () |
|
||||
aegis | |
|
||||
anubis | [] |
|
||||
ap-utils | [] |
|
||||
bash | [] [] |
|
||||
batchelor | [] |
|
||||
bfd | [] [] |
|
||||
binutils | [] [] |
|
||||
bison | [] [] [] [] |
|
||||
bluez-pin | [] [] [] [] |
|
||||
clisp | |
|
||||
clisp | [] |
|
||||
coreutils | [] [] [] [] |
|
||||
cpio | [] [] [] [] |
|
||||
darkstat | () [] [] [] |
|
||||
diffutils | [] [] [] [] [] [] [] |
|
||||
e2fsprogs | |
|
||||
enscript | [] [] |
|
||||
error | [] [] [] [] |
|
||||
fetchmail | [] |
|
||||
fileutils | [] [] [] [] [] |
|
||||
findutils | [] [] [] [] [] [] [] [] [] [] [] |
|
||||
flex | [] [] |
|
||||
gas | [] |
|
||||
gawk | [] [] |
|
||||
gcal | [] |
|
||||
gcc | [] |
|
||||
gettext | [] [] [] |
|
||||
gettext-runtime | [] [] [] [] |
|
||||
gettext-tools | [] |
|
||||
gimp-print | [] [] |
|
||||
gliv | () |
|
||||
glunarclock | [] [] [] [] |
|
||||
gnucash | [] |
|
||||
gnucash-glossary | [] |
|
||||
gnupg | [] [] [] [] [] [] [] |
|
||||
gpe-calendar | [] |
|
||||
gpe-conf | |
|
||||
gpe-contacts | [] |
|
||||
gpe-edit | [] [] |
|
||||
gpe-login | [] |
|
||||
gpe-ownerinfo | [] [] [] |
|
||||
gpe-sketchbook | [] |
|
||||
gpe-timesheet | [] [] [] |
|
||||
gpe-today | [] [] |
|
||||
gpe-todo | [] [] |
|
||||
gphoto2 | [] [] [] |
|
||||
gprof | [] [] |
|
||||
gpsdrive | () [] () () |
|
||||
grep | [] [] [] [] [] [] [] [] [] [] [] |
|
||||
gretl | [] |
|
||||
hello | [] [] [] [] [] [] [] [] [] [] [] [] [] |
|
||||
id-utils | [] [] [] |
|
||||
indent | [] [] [] [] [] [] [] [] |
|
||||
jpilot | [] () |
|
||||
jwhois | [] [] [] [] |
|
||||
kbd | [] |
|
||||
ld | [] |
|
||||
libc | [] [] [] [] [] [] |
|
||||
libgpewidget | [] [] [] |
|
||||
libiconv | [] [] [] [] [] [] [] [] |
|
||||
lifelines | () |
|
||||
lilypond | [] |
|
||||
lingoteach | [] [] |
|
||||
lingoteach_lessons | |
|
||||
lynx | [] [] [] [] |
|
||||
m4 | [] [] [] [] |
|
||||
mailutils | |
|
||||
make | [] [] [] [] [] [] |
|
||||
man-db | [] () () |
|
||||
mysecretdiary | [] [] |
|
||||
nano | [] [] [] [] |
|
||||
nano_1_0 | [] [] [] [] |
|
||||
opcodes | [] [] |
|
||||
parted | [] [] [] |
|
||||
ptx | [] [] [] [] [] [] [] |
|
||||
python | |
|
||||
radius | |
|
||||
recode | [] [] [] [] [] [] |
|
||||
screem | |
|
||||
sed | [] [] [] [] [] [] [] [] |
|
||||
sh-utils | [] [] [] [] [] [] |
|
||||
sharutils | [] [] [] [] [] |
|
||||
sketch | [] |
|
||||
soundtracker | [] [] [] |
|
||||
sp | [] () |
|
||||
tar | [] [] [] [] [] [] [] [] [] |
|
||||
texinfo | [] [] [] [] |
|
||||
textutils | [] [] [] [] [] |
|
||||
tin | [] () |
|
||||
util-linux | [] [] [] [] () [] |
|
||||
vorbis-tools | [] |
|
||||
wastesedge | () |
|
||||
wdiff | [] [] [] [] [] |
|
||||
wget | [] [] [] [] [] [] [] [] |
|
||||
xchat | [] [] [] |
|
||||
xpad | |
|
||||
+----------------------------------------+
|
||||
et fa fi fr ga gl he hr hu id it ja ko
|
||||
20 1 15 73 14 24 8 10 30 31 19 31 9
|
||||
|
||||
lg lt lv ms nb nl nn no pl pt pt_BR ro
|
||||
+----------------------------------------+
|
||||
a2ps | [] [] () () () [] [] |
|
||||
aegis | () |
|
||||
anubis | [] [] |
|
||||
ap-utils | () |
|
||||
bash | [] |
|
||||
batchelor | |
|
||||
bfd | |
|
||||
binutils | |
|
||||
bison | [] [] [] [] |
|
||||
bluez-pin | [] |
|
||||
clisp | |
|
||||
clisp | [] |
|
||||
coreutils | [] |
|
||||
cpio | [] [] [] |
|
||||
darkstat | [] [] [] [] |
|
||||
diffutils | [] [] [] |
|
||||
e2fsprogs | |
|
||||
enscript | [] [] |
|
||||
error | [] [] |
|
||||
fetchmail | () () |
|
||||
fileutils | [] |
|
||||
findutils | [] [] [] [] |
|
||||
flex | [] |
|
||||
gas | |
|
||||
gawk | [] |
|
||||
gcal | |
|
||||
gcc | |
|
||||
gettext | [] |
|
||||
gettext-runtime | [] |
|
||||
gettext-tools | |
|
||||
gimp-print | [] |
|
||||
gliv | [] |
|
||||
glunarclock | [] |
|
||||
gnucash | |
|
||||
gnucash-glossary | [] [] |
|
||||
gnupg | |
|
||||
gpe-calendar | [] [] |
|
||||
gpe-conf | [] [] |
|
||||
gpe-contacts | [] |
|
||||
gpe-edit | [] [] |
|
||||
gpe-login | [] [] |
|
||||
gpe-ownerinfo | [] [] |
|
||||
gpe-sketchbook | [] [] |
|
||||
gpe-timesheet | [] [] |
|
||||
gpe-today | [] [] |
|
||||
gpe-todo | [] [] |
|
||||
gphoto2 | |
|
||||
gprof | [] |
|
||||
gpsdrive | () () () |
|
||||
grep | [] [] [] [] |
|
||||
gretl | |
|
||||
hello | [] [] [] [] [] [] [] [] [] |
|
||||
id-utils | [] [] [] |
|
||||
indent | [] [] [] |
|
||||
jpilot | () () |
|
||||
jwhois | [] [] [] |
|
||||
kbd | |
|
||||
ld | |
|
||||
libc | [] [] [] [] |
|
||||
libgpewidget | [] [] |
|
||||
libiconv | [] [] |
|
||||
lifelines | |
|
||||
lilypond | [] |
|
||||
lingoteach | |
|
||||
lingoteach_lessons | |
|
||||
lynx | [] [] |
|
||||
m4 | [] [] [] [] |
|
||||
mailutils | |
|
||||
make | [] [] |
|
||||
man-db | [] |
|
||||
mysecretdiary | [] |
|
||||
nano | [] [] [] [] |
|
||||
nano_1_0 | [] [] [] [] |
|
||||
opcodes | [] [] [] |
|
||||
parted | [] [] [] |
|
||||
ptx | [] [] [] [] [] [] [] |
|
||||
python | |
|
||||
radius | |
|
||||
recode | [] [] [] |
|
||||
screem | |
|
||||
sed | [] [] |
|
||||
sh-utils | [] |
|
||||
sharutils | [] |
|
||||
sketch | [] |
|
||||
soundtracker | |
|
||||
sp | |
|
||||
tar | [] [] [] [] [] [] |
|
||||
texinfo | [] |
|
||||
textutils | [] |
|
||||
tin | |
|
||||
util-linux | [] [] |
|
||||
vorbis-tools | [] [] |
|
||||
wastesedge | |
|
||||
wdiff | [] [] [] [] |
|
||||
wget | [] [] [] |
|
||||
xchat | [] [] |
|
||||
xpad | [] |
|
||||
+----------------------------------------+
|
||||
lg lt lv ms nb nl nn no pl pt pt_BR ro
|
||||
0 0 2 11 7 26 3 4 18 15 34 34
|
||||
|
||||
ru sk sl sr sv ta tr uk vi wa zh_CN zh_TW
|
||||
+-------------------------------------------+
|
||||
a2ps | [] [] [] [] [] | 16
|
||||
aegis | () | 0
|
||||
anubis | [] [] | 5
|
||||
ap-utils | () | 1
|
||||
bash | [] | 7
|
||||
batchelor | | 1
|
||||
bfd | [] [] [] | 7
|
||||
binutils | [] [] [] | 7
|
||||
bison | [] [] | 13
|
||||
bluez-pin | | 7
|
||||
clisp | | 0
|
||||
clisp | | 5
|
||||
coreutils | [] [] [] [] [] | 14
|
||||
cpio | [] [] [] | 13
|
||||
darkstat | [] () () | 9
|
||||
diffutils | [] [] [] [] | 21
|
||||
e2fsprogs | [] | 3
|
||||
enscript | [] [] [] | 11
|
||||
error | [] [] [] | 14
|
||||
fetchmail | [] | 7
|
||||
fileutils | [] [] [] [] [] [] | 15
|
||||
findutils | [] [] [] [] [] [] | 27
|
||||
flex | [] [] [] | 10
|
||||
gas | [] | 3
|
||||
gawk | [] [] | 9
|
||||
gcal | [] [] | 4
|
||||
gcc | [] | 4
|
||||
gettext | [] [] [] [] [] [] | 15
|
||||
gettext-runtime | [] [] [] [] [] [] | 16
|
||||
gettext-tools | [] [] | 5
|
||||
gimp-print | [] [] | 10
|
||||
gliv | | 1
|
||||
glunarclock | [] [] [] | 11
|
||||
gnucash | [] [] | 4
|
||||
gnucash-glossary | [] [] [] | 8
|
||||
gnupg | [] [] [] [] | 16
|
||||
gpe-calendar | [] | 5
|
||||
gpe-conf | | 3
|
||||
gpe-contacts | [] | 4
|
||||
gpe-edit | [] | 5
|
||||
gpe-login | [] | 5
|
||||
gpe-ownerinfo | [] | 7
|
||||
gpe-sketchbook | [] | 5
|
||||
gpe-timesheet | [] | 6
|
||||
gpe-today | [] | 6
|
||||
gpe-todo | [] | 6
|
||||
gphoto2 | [] [] | 9
|
||||
gprof | [] [] | 7
|
||||
gpsdrive | [] [] | 3
|
||||
grep | [] [] [] [] | 24
|
||||
gretl | | 2
|
||||
hello | [] [] [] [] [] | 33
|
||||
id-utils | [] [] [] | 11
|
||||
indent | [] [] [] [] | 19
|
||||
jpilot | [] [] [] [] [] | 10
|
||||
jwhois | () () [] [] | 10
|
||||
kbd | [] [] | 8
|
||||
ld | [] [] | 5
|
||||
libc | [] [] [] [] | 20
|
||||
libgpewidget | | 6
|
||||
libiconv | [] [] [] [] [] [] | 21
|
||||
lifelines | [] | 2
|
||||
lilypond | [] | 4
|
||||
lingoteach | | 2
|
||||
lingoteach_lessons | () | 0
|
||||
lynx | [] [] [] [] | 14
|
||||
m4 | [] [] [] | 15
|
||||
mailutils | | 2
|
||||
make | [] [] [] [] | 15
|
||||
man-db | [] | 6
|
||||
mysecretdiary | [] [] | 8
|
||||
nano | [] [] [] | 15
|
||||
nano_1_0 | [] [] [] | 15
|
||||
opcodes | [] [] | 9
|
||||
parted | [] [] | 13
|
||||
ptx | [] [] [] | 22
|
||||
python | | 0
|
||||
radius | | 0
|
||||
recode | [] [] [] [] | 19
|
||||
screem | [] | 1
|
||||
sed | [] [] [] [] [] | 20
|
||||
sh-utils | [] [] [] | 13
|
||||
sharutils | [] [] [] [] | 16
|
||||
sketch | [] | 5
|
||||
soundtracker | [] | 7
|
||||
sp | [] | 3
|
||||
tar | [] [] [] [] [] | 24
|
||||
texinfo | [] [] [] [] | 13
|
||||
textutils | [] [] [] [] [] | 15
|
||||
tin | | 1
|
||||
util-linux | [] [] | 14
|
||||
vorbis-tools | [] | 7
|
||||
wastesedge | | 0
|
||||
wdiff | [] [] [] [] | 17
|
||||
wget | [] [] [] [] [] [] [] | 25
|
||||
xchat | [] [] [] | 11
|
||||
xpad | | 1
|
||||
+-------------------------------------------+
|
||||
50 teams ru sk sl sr sv ta tr uk vi wa zh_CN zh_TW
|
||||
97 domains 32 19 16 0 56 0 48 10 1 1 12 23 913
|
||||
|
||||
Some counters in the preceding matrix are higher than the number of
|
||||
visible blocks let us expect. This is because a few extra PO files are
|
||||
used for implementing regional variants of languages, or language
|
||||
dialects.
|
||||
|
||||
For a PO file in the matrix above to be effective, the package to
|
||||
which it applies should also have been internationalized and
|
||||
distributed as such by its maintainer. There might be an observable
|
||||
lag between the mere existence a PO file and its wide availability in a
|
||||
distribution.
|
||||
|
||||
If May 2003 seems to be old, you may fetch a more recent copy of
|
||||
this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date
|
||||
matrix with full percentage details can be found at
|
||||
`http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'.
|
||||
|
||||
Using `gettext' in new packages
|
||||
===============================
|
||||
|
||||
If you are writing a freely available program and want to
|
||||
internationalize it you are welcome to use GNU `gettext' in your
|
||||
package. Of course you have to respect the GNU Library General Public
|
||||
License which covers the use of the GNU `gettext' library. This means
|
||||
in particular that even non-free programs can use `libintl' as a shared
|
||||
library, whereas only free software can use `libintl' as a static
|
||||
library or use modified versions of `libintl'.
|
||||
|
||||
Once the sources are changed appropriately and the setup can handle
|
||||
the use of `gettext' the only thing missing are the translations. The
|
||||
Free Translation Project is also available for packages which are not
|
||||
developed inside the GNU project. Therefore the information given above
|
||||
applies also for every other Free Software Project. Contact
|
||||
`translation@iro.umontreal.ca' to make the `.pot' files available to
|
||||
the translation teams.
|
||||
|
||||
16
external/bsd/flex/dist/AUTHORS
vendored
Normal file
16
external/bsd/flex/dist/AUTHORS
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
In 2001, Will Estes took over as maintainer of flex.
|
||||
|
||||
John Millaway is a co-author of the current version of flex. He has
|
||||
contributed a large number of new features, fixed a large number of
|
||||
outstanding bugs and has made significant contributions to the flex
|
||||
documentation.
|
||||
|
||||
Aaron Stone has contributed several bug fixes to the flex codebase.
|
||||
|
||||
Vern Paxson wrote flex 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.
|
||||
42
external/bsd/flex/dist/COPYING
vendored
Normal file
42
external/bsd/flex/dist/COPYING
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
Flex carries the copyright used for BSD software, slightly modified
|
||||
because it originated at the Lawrence Berkeley (not Livermore!) Laboratory,
|
||||
which operates under a contract with the Department of Energy:
|
||||
|
||||
Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007 The Flex Project.
|
||||
|
||||
Copyright (c) 1990, 1997 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, 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 basically says "do whatever you please with this software except
|
||||
remove this notice or take advantage of the University's (or the flex
|
||||
authors') name".
|
||||
|
||||
Note that the "flex.skl" scanner skeleton carries no copyright notice.
|
||||
You are free to do whatever you please with scanners generated using flex;
|
||||
for them, you are not even bound by the above copyright.
|
||||
7439
external/bsd/flex/dist/ChangeLog
vendored
Normal file
7439
external/bsd/flex/dist/ChangeLog
vendored
Normal file
File diff suppressed because it is too large
Load Diff
208
external/bsd/flex/dist/FlexLexer.h
vendored
Normal file
208
external/bsd/flex/dist/FlexLexer.h
vendored
Normal file
@@ -0,0 +1,208 @@
|
||||
/* $NetBSD: FlexLexer.h,v 1.1.1.1 2009/10/26 00:24:46 christos Exp $ */
|
||||
|
||||
// -*-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
|
||||
|
||||
236
external/bsd/flex/dist/INSTALL
vendored
Normal file
236
external/bsd/flex/dist/INSTALL
vendored
Normal file
@@ -0,0 +1,236 @@
|
||||
Installation Instructions
|
||||
*************************
|
||||
|
||||
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
|
||||
Software Foundation, Inc.
|
||||
|
||||
This file is free documentation; the Free Software Foundation gives
|
||||
unlimited permission to copy, distribute and modify it.
|
||||
|
||||
Basic Installation
|
||||
==================
|
||||
|
||||
These are generic installation instructions.
|
||||
|
||||
The `configure' shell script attempts to guess correct values for
|
||||
various system-dependent variables used during compilation. It uses
|
||||
those values to create a `Makefile' in each directory of the package.
|
||||
It may also create one or more `.h' files containing system-dependent
|
||||
definitions. Finally, it creates a shell script `config.status' that
|
||||
you can run in the future to recreate the current configuration, and a
|
||||
file `config.log' containing compiler output (useful mainly for
|
||||
debugging `configure').
|
||||
|
||||
It can also use an optional file (typically called `config.cache'
|
||||
and enabled with `--cache-file=config.cache' or simply `-C') that saves
|
||||
the results of its tests to speed up reconfiguring. (Caching is
|
||||
disabled by default to prevent problems with accidental use of stale
|
||||
cache files.)
|
||||
|
||||
If you need to do unusual things to compile the package, please try
|
||||
to figure out how `configure' could check whether to do them, and mail
|
||||
diffs or instructions to the address given in the `README' so they can
|
||||
be considered for the next release. If you are using the cache, and at
|
||||
some point `config.cache' contains results you don't want to keep, you
|
||||
may remove or edit it.
|
||||
|
||||
The file `configure.ac' (or `configure.in') is used to create
|
||||
`configure' by a program called `autoconf'. You only need
|
||||
`configure.ac' if you want to change it or regenerate `configure' using
|
||||
a newer version of `autoconf'.
|
||||
|
||||
The simplest way to compile this package is:
|
||||
|
||||
1. `cd' to the directory containing the package's source code and type
|
||||
`./configure' to configure the package for your system. If you're
|
||||
using `csh' on an old version of System V, you might need to type
|
||||
`sh ./configure' instead to prevent `csh' from trying to execute
|
||||
`configure' itself.
|
||||
|
||||
Running `configure' takes awhile. While running, it prints some
|
||||
messages telling which features it is checking for.
|
||||
|
||||
2. Type `make' to compile the package.
|
||||
|
||||
3. Optionally, type `make check' to run any self-tests that come with
|
||||
the package.
|
||||
|
||||
4. Type `make install' to install the programs and any data files and
|
||||
documentation.
|
||||
|
||||
5. You can remove the program binaries and object files from the
|
||||
source code directory by typing `make clean'. To also remove the
|
||||
files that `configure' created (so you can compile the package for
|
||||
a different kind of computer), type `make distclean'. There is
|
||||
also a `make maintainer-clean' target, but that is intended mainly
|
||||
for the package's developers. If you use it, you may have to get
|
||||
all sorts of other programs in order to regenerate files that came
|
||||
with the distribution.
|
||||
|
||||
Compilers and Options
|
||||
=====================
|
||||
|
||||
Some systems require unusual options for compilation or linking that the
|
||||
`configure' script does not know about. Run `./configure --help' for
|
||||
details on some of the pertinent environment variables.
|
||||
|
||||
You can give `configure' initial values for configuration parameters
|
||||
by setting variables in the command line or in the environment. Here
|
||||
is an example:
|
||||
|
||||
./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
|
||||
|
||||
*Note Defining Variables::, for more details.
|
||||
|
||||
Compiling For Multiple Architectures
|
||||
====================================
|
||||
|
||||
You can compile the package for more than one kind of computer at the
|
||||
same time, by placing the object files for each architecture in their
|
||||
own directory. To do this, you must use a version of `make' that
|
||||
supports the `VPATH' variable, such as GNU `make'. `cd' to the
|
||||
directory where you want the object files and executables to go and run
|
||||
the `configure' script. `configure' automatically checks for the
|
||||
source code in the directory that `configure' is in and in `..'.
|
||||
|
||||
If you have to use a `make' that does not support the `VPATH'
|
||||
variable, you have to compile the package for one architecture at a
|
||||
time in the source code directory. After you have installed the
|
||||
package for one architecture, use `make distclean' before reconfiguring
|
||||
for another architecture.
|
||||
|
||||
Installation Names
|
||||
==================
|
||||
|
||||
By default, `make install' installs the package's commands under
|
||||
`/usr/local/bin', include files under `/usr/local/include', etc. You
|
||||
can specify an installation prefix other than `/usr/local' by giving
|
||||
`configure' the option `--prefix=PREFIX'.
|
||||
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If you
|
||||
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
|
||||
PREFIX as the prefix for installing programs and libraries.
|
||||
Documentation and other data files still use the regular prefix.
|
||||
|
||||
In addition, if you use an unusual directory layout you can give
|
||||
options like `--bindir=DIR' to specify different values for particular
|
||||
kinds of files. Run `configure --help' for a list of the directories
|
||||
you can set and what kinds of files go in them.
|
||||
|
||||
If the package supports it, you can cause programs to be installed
|
||||
with an extra prefix or suffix on their names by giving `configure' the
|
||||
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||
|
||||
Optional Features
|
||||
=================
|
||||
|
||||
Some packages pay attention to `--enable-FEATURE' options to
|
||||
`configure', where FEATURE indicates an optional part of the package.
|
||||
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||
is something like `gnu-as' or `x' (for the X Window System). The
|
||||
`README' should mention any `--enable-' and `--with-' options that the
|
||||
package recognizes.
|
||||
|
||||
For packages that use the X Window System, `configure' can usually
|
||||
find the X include and library files automatically, but if it doesn't,
|
||||
you can use the `configure' options `--x-includes=DIR' and
|
||||
`--x-libraries=DIR' to specify their locations.
|
||||
|
||||
Specifying the System Type
|
||||
==========================
|
||||
|
||||
There may be some features `configure' cannot figure out automatically,
|
||||
but needs to determine by the type of machine the package will run on.
|
||||
Usually, assuming the package is built to be run on the _same_
|
||||
architectures, `configure' can figure that out, but if it prints a
|
||||
message saying it cannot guess the machine type, give it the
|
||||
`--build=TYPE' option. TYPE can either be a short name for the system
|
||||
type, such as `sun4', or a canonical name which has the form:
|
||||
|
||||
CPU-COMPANY-SYSTEM
|
||||
|
||||
where SYSTEM can have one of these forms:
|
||||
|
||||
OS KERNEL-OS
|
||||
|
||||
See the file `config.sub' for the possible values of each field. If
|
||||
`config.sub' isn't included in this package, then this package doesn't
|
||||
need to know the machine type.
|
||||
|
||||
If you are _building_ compiler tools for cross-compiling, you should
|
||||
use the option `--target=TYPE' to select the type of system they will
|
||||
produce code for.
|
||||
|
||||
If you want to _use_ a cross compiler, that generates code for a
|
||||
platform different from the build platform, you should specify the
|
||||
"host" platform (i.e., that on which the generated programs will
|
||||
eventually be run) with `--host=TYPE'.
|
||||
|
||||
Sharing Defaults
|
||||
================
|
||||
|
||||
If you want to set default values for `configure' scripts to share, you
|
||||
can create a site shell script called `config.site' that gives default
|
||||
values for variables like `CC', `cache_file', and `prefix'.
|
||||
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||
`CONFIG_SITE' environment variable to the location of the site script.
|
||||
A warning: not all `configure' scripts look for a site script.
|
||||
|
||||
Defining Variables
|
||||
==================
|
||||
|
||||
Variables not defined in a site shell script can be set in the
|
||||
environment passed to `configure'. However, some packages may run
|
||||
configure again during the build, and the customized values of these
|
||||
variables may be lost. In order to avoid this problem, you should set
|
||||
them in the `configure' command line, using `VAR=value'. For example:
|
||||
|
||||
./configure CC=/usr/local2/bin/gcc
|
||||
|
||||
causes the specified `gcc' to be used as the C compiler (unless it is
|
||||
overridden in the site shell script). Here is a another example:
|
||||
|
||||
/bin/bash ./configure CONFIG_SHELL=/bin/bash
|
||||
|
||||
Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
|
||||
configuration-related scripts to be executed by `/bin/bash'.
|
||||
|
||||
`configure' Invocation
|
||||
======================
|
||||
|
||||
`configure' recognizes the following options to control how it operates.
|
||||
|
||||
`--help'
|
||||
`-h'
|
||||
Print a summary of the options to `configure', and exit.
|
||||
|
||||
`--version'
|
||||
`-V'
|
||||
Print the version of Autoconf used to generate the `configure'
|
||||
script, and exit.
|
||||
|
||||
`--cache-file=FILE'
|
||||
Enable the cache: use and save the results of the tests in FILE,
|
||||
traditionally `config.cache'. FILE defaults to `/dev/null' to
|
||||
disable caching.
|
||||
|
||||
`--config-cache'
|
||||
`-C'
|
||||
Alias for `--cache-file=config.cache'.
|
||||
|
||||
`--quiet'
|
||||
`--silent'
|
||||
`-q'
|
||||
Do not print messages saying which checks are being made. To
|
||||
suppress all normal output, redirect it to `/dev/null' (any error
|
||||
messages will still be shown).
|
||||
|
||||
`--srcdir=DIR'
|
||||
Look for the package's source code in directory DIR. Usually
|
||||
`configure' can determine that directory automatically.
|
||||
|
||||
`configure' also accepts some other, not widely useful, options. Run
|
||||
`configure --help' for more details.
|
||||
|
||||
208
external/bsd/flex/dist/Makefile.am
vendored
Normal file
208
external/bsd/flex/dist/Makefile.am
vendored
Normal file
@@ -0,0 +1,208 @@
|
||||
# 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.
|
||||
|
||||
# Notes on building:
|
||||
|
||||
# Possible values for DEFS:
|
||||
#
|
||||
# By default, flex generates 8-bit scanners when using table compression,
|
||||
# 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_LIBRARIES = \
|
||||
libfl.a \
|
||||
libfl_pic.a
|
||||
|
||||
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
|
||||
|
||||
libfl_a_SOURCES = \
|
||||
libmain.c \
|
||||
libyywrap.c
|
||||
|
||||
libfl_pic_a_SOURCES = \
|
||||
libmain.c \
|
||||
libyywrap.c
|
||||
|
||||
libfl_pic_a_CFLAGS = \
|
||||
-fPIC \
|
||||
$(AM_CFLAGS)
|
||||
|
||||
noinst_HEADERS = \
|
||||
flexdef.h \
|
||||
flexint.h \
|
||||
version.h \
|
||||
options.h \
|
||||
scanopt.h \
|
||||
tables.h \
|
||||
tables_shared.h
|
||||
|
||||
include_HEADERS = \
|
||||
FlexLexer.h
|
||||
|
||||
EXTRA_DIST = \
|
||||
.indent.pro \
|
||||
AUTHORS \
|
||||
COPYING \
|
||||
INSTALL \
|
||||
NEWS \
|
||||
ONEWS \
|
||||
README \
|
||||
README.cvs \
|
||||
THANKS \
|
||||
TODO \
|
||||
autogen.sh \
|
||||
flex.skl \
|
||||
mkskel.sh \
|
||||
ABOUT-NLS \
|
||||
config.rpath \
|
||||
gettext.h
|
||||
|
||||
BUILT_SOURCES = \
|
||||
skel.c
|
||||
|
||||
SUBDIRS = \
|
||||
. \
|
||||
doc \
|
||||
m4 \
|
||||
examples \
|
||||
po \
|
||||
tools \
|
||||
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
|
||||
|
||||
# Create the ChangeLog, but only if we're inside a cvs working directory
|
||||
|
||||
ChangeLog: $(srcdir)/tools/cvsauthors $(srcdir)/tools/cvs2cl.pl
|
||||
if [ -d CVS ] ; then \
|
||||
sh $(srcdir)/tools/cvs2cl.pl -F trunk -U $(srcdir)/tools/cvsauthors \
|
||||
; 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
|
||||
|
||||
.PHONY: ChangeLog tags indent
|
||||
1096
external/bsd/flex/dist/Makefile.in
vendored
Normal file
1096
external/bsd/flex/dist/Makefile.in
vendored
Normal file
File diff suppressed because it is too large
Load Diff
488
external/bsd/flex/dist/NEWS
vendored
Normal file
488
external/bsd/flex/dist/NEWS
vendored
Normal file
@@ -0,0 +1,488 @@
|
||||
This is the file NEWS for the flex package. It records user -visible
|
||||
changes between releases of flex.
|
||||
|
||||
See the file COPYING for copying conditions.
|
||||
|
||||
* version 2.5.35 released 2008-02-26
|
||||
|
||||
** fixed bug that prevented flex from accepting certain comments in the
|
||||
scanner file (resolves bugs #1849809 and #1849805)
|
||||
|
||||
** fix bug that prevented headers for all functions from being generated
|
||||
(resolves bug #1628314)
|
||||
|
||||
** change yy_size_t to be size_t (resolves bug #1849812)
|
||||
|
||||
** new de, nl, pl, pt_br, vi translations from the translation project
|
||||
|
||||
* version 2.5.34 released 2007-12-12
|
||||
|
||||
** introduce yylex_init_extra; see the manual for details
|
||||
|
||||
** introduce %option extra-type="your_type *" (resolves bug #1744505)
|
||||
|
||||
** The flex program now parses multiple short concatenated options (resolves bug
|
||||
#1619820). Thanks to Petr Machata of Red Hat on this issue.
|
||||
|
||||
** better checking after yyalloc/yyrealloc (resolves bug #1595967)
|
||||
|
||||
** flex now provides for a libfl_pic.a compiled with position
|
||||
independent code. Particularly useful when including a flex scanner
|
||||
in a shared library and with more recent versions of gcc. Thanks to the Debian project for the idea.
|
||||
|
||||
** SourceForge feature request #1658379: Expose YY_BUF_SIZE in the
|
||||
header file.
|
||||
|
||||
** flex better escapes filenames with special characters in them
|
||||
(resolves bug #1623600)
|
||||
|
||||
** a memory leak was plugged(resolves bug #1601111)
|
||||
|
||||
** pattern language expanded; see the manual for details on the below
|
||||
highlights
|
||||
|
||||
*** pattern options added to specify patterns as case-insensitive or
|
||||
case-sensitive
|
||||
|
||||
*** pattern options to specify whether the "." character should match
|
||||
the newline character
|
||||
|
||||
*** pattern options added to allow ignoring of whitespace in patterns
|
||||
|
||||
*** POSIX character classes may be negated in patterns
|
||||
|
||||
*** patterns may now use set difference, union operators
|
||||
|
||||
** the manual now contains an appendix listing various common patterns
|
||||
which may be useful when writing scanners
|
||||
|
||||
** some memory leaks were removed from the C++ scanner (but the C++
|
||||
scanner is still experimental and may change radically without
|
||||
notice)
|
||||
|
||||
** c++ scanners can now use yywrap
|
||||
|
||||
** added new unit test for c++ and yywrap
|
||||
|
||||
** portability fixes to some unit tests
|
||||
|
||||
** flex man page and flex manual in pdf now distributed in the flex
|
||||
distribution
|
||||
|
||||
** new ca, vi, ga, nl translations from the translation project
|
||||
|
||||
** flex no longer comes with an rpm spec file
|
||||
|
||||
** flex development now happens with automake 1.9.6
|
||||
|
||||
* version 2.5.33 released 2006-2-20
|
||||
|
||||
** all flex resources are now to be found from the website at
|
||||
http://flex.sourceforge.net/
|
||||
|
||||
** there was no release 2.5.32 published
|
||||
|
||||
** numerous bug and security fixes
|
||||
|
||||
** new nl, vi, sv, ro, po, ga, ca, fr, tr translations from the translation project
|
||||
|
||||
** upgrade to use gettext 0.12 (this now makes the "pdf" and "ps"
|
||||
targets in the build system able to be run successfully)
|
||||
|
||||
* version 2.5.31 released 2003-4-1
|
||||
|
||||
** remove --enable-maintainer-mode configure option; none of the
|
||||
Makefiles were using it and it can be unduely confusing
|
||||
|
||||
* version 2.5.30 released 2003-4-1
|
||||
|
||||
** yylineno is per-buffer in reentrant scanners
|
||||
|
||||
** added %top directive for placing code at the top of the generated
|
||||
scanner; see manual for details
|
||||
|
||||
** flex now uses m4 to generate scanners; while this means that
|
||||
scanners are more readable, it means that flex requires m4 to be
|
||||
installed; see manual for details
|
||||
|
||||
* version 2.5.29 released 2003-3-5
|
||||
|
||||
** Automatic stack management for multiple input buffers in C and C++ scanners
|
||||
|
||||
** moved the flex documentation to a new doc/ subdirectory
|
||||
|
||||
** cleanups to the yy namespace
|
||||
|
||||
* version 2.5.28 released 2003-2-12
|
||||
|
||||
** flex is now hosted at sourceforge
|
||||
|
||||
** Fixed trailing slash bug in YY_INPUT macro def
|
||||
|
||||
** Flex now warns if always-interactive is specified with fast or full
|
||||
|
||||
* version 2.5.27 released 2003-1-21
|
||||
|
||||
** flex now works with recent bison versions
|
||||
|
||||
** new pt_br translation from the translation project
|
||||
|
||||
* version 2.5.26 released 2003-1-14
|
||||
|
||||
** Fixed table deserialization bug on big-endian archs. Patch sent from Bryce Nichols <bryce@bnichols.org>
|
||||
|
||||
** yyleng has proper declarations now; this caused flex to generate
|
||||
unusable scanners for some programs
|
||||
|
||||
** the flex distribution now includes a spec file suitable for use
|
||||
with rpm
|
||||
|
||||
** some more c++ fixes
|
||||
|
||||
** new es translation from the translation project
|
||||
|
||||
** slight tweeks to the flex_int*_t types
|
||||
|
||||
** flex now warns about pattern ranges that might be ambiguous when
|
||||
generating a case-insensitive scanner
|
||||
|
||||
|
||||
* version 2.5.25 released 2002-12-2
|
||||
|
||||
** flex now uses flex_int*_t types. For C99 systems, they are just the
|
||||
int*_t types; for non-C99 systems, we just make some typedefs
|
||||
|
||||
** new pt_br translation from the translation project
|
||||
|
||||
* version 2.5.24 released 2002-11-25
|
||||
|
||||
* more portability fixes
|
||||
|
||||
** the manual continues to be updated and edited, but it's still got a
|
||||
ways to go
|
||||
|
||||
** it is possible to have multiple c++ scanners in the same program again
|
||||
|
||||
** new turkish translation from the translation project
|
||||
|
||||
* version 2.5.23 released 2002-10-21
|
||||
|
||||
** more portability fixes
|
||||
|
||||
** the manual includes a title page and a table-of-contents when printed
|
||||
|
||||
** the test suite can be run with "make check" from the top-level
|
||||
directory
|
||||
|
||||
** configure now accepts the --enable-maintainer-mode option
|
||||
|
||||
** gettext functionality is now only available externally
|
||||
|
||||
** the constant FLEX_BETA is defined if flex is a beta release
|
||||
|
||||
** the script create-test was not included in the distribution and it
|
||||
should have been
|
||||
|
||||
* version 2.5.22 released 2002-10-10
|
||||
|
||||
** more portability fixes around how we get ahold of the integral
|
||||
types; there is a constant FLEX_NEED_INTEGRAL_TYPE_DEFINITIONS
|
||||
which you should define if you don't have the <inttypes.h> header
|
||||
file (after you complain to your C vendor for not providing a
|
||||
reasonable C environment)
|
||||
|
||||
** more test suite cleanups; in particular, the test suite should run
|
||||
correctly when build from a different directory
|
||||
|
||||
** upgraded automake to 1.7 and consequently autoconf to 2.54; this
|
||||
means, among other things, that there is some support for
|
||||
formatting the manual in postscript and pdf in the distributed
|
||||
Makefile.in (and therefore in the Makefile built by configure)
|
||||
|
||||
** the flex.1 manpage is generated by help2man; (this has been true
|
||||
for quite a while but was not listed here)
|
||||
|
||||
** flex now includes three defined constants to indicate which version
|
||||
of flex generated a scanner (YY_FLEX_{MAJOR,MINOR,SUBMINOR}_VERSION)
|
||||
|
||||
** flex tries its best to output only the relevant portions of the
|
||||
skeleton when generating a scanner, thus avoiding as much
|
||||
conditional compilation as possible
|
||||
|
||||
* version 2.5.21 released 2002-9-17
|
||||
|
||||
** one of the tests in the test suite broke the dist target
|
||||
|
||||
* version 2.5.20 released 2002-9-16
|
||||
|
||||
** A flex scanner has the ability to save the DFA tables to a file,
|
||||
and load them at runtime when needed; see the manual for details
|
||||
|
||||
** Added %option bison-bridge (--bison-bridge)
|
||||
|
||||
** Removed %option reentrant-bison/--reentrant-bison/-Rb
|
||||
|
||||
** yylineno is present in all scanners; Modified nasty performance
|
||||
penalty warning with yylineno in documentation
|
||||
|
||||
** test-table-opts is now run last in the test suite because it's so fat
|
||||
|
||||
** flex can, to some extent, diagnose where internal problems occur
|
||||
|
||||
** new translations from the translation project: fr, ca, de, ru, sv
|
||||
|
||||
**Flex generates C99 defs now; see YY_TRADITIONAL_FUNC_DEFS in the
|
||||
manual if that's not a good thing for you
|
||||
|
||||
* version 2.5.19 released 2002-9-5
|
||||
|
||||
** prevent segfault on input lines which are longer than the allocated
|
||||
space (problem report from Manoj Srivastava
|
||||
<srivasta@golden-gryphon.com>)
|
||||
|
||||
** Changed option 'header' to 'header-file'
|
||||
|
||||
* version 2.5.18 released 2002-9-4
|
||||
|
||||
** portability fixes for integer constants and in the way the test
|
||||
suite reports its results
|
||||
|
||||
** the test for bison was reporting bison missing when it was, in
|
||||
fact, found
|
||||
|
||||
** if we don't find GNU indent, we're more careful when we're not
|
||||
finding it
|
||||
|
||||
* version 2.5.17 released 2002-8-29
|
||||
|
||||
** more portability fixes
|
||||
|
||||
** updated config.sub and config.guess
|
||||
|
||||
** flex is indented by GNU indent (this was done earlier but not
|
||||
explicitly documented)
|
||||
|
||||
* version 2.5.16 released 2002-8-28
|
||||
|
||||
** c++ scanners compile again
|
||||
|
||||
** there is now an indent target in the top-level Makefile; configure
|
||||
checks for GNU indent which is required for proper operation of the
|
||||
indent target
|
||||
|
||||
** some more portability fixes were made
|
||||
|
||||
** %options and invocation sections of manual merged
|
||||
|
||||
** a c++ test was added to the test suite
|
||||
|
||||
** we're trying to clean up more files in the test suite's make clean
|
||||
targets
|
||||
|
||||
* version 2.5.15 released 2002-8-21
|
||||
|
||||
** reject-state buffer is now dynamically allocated and REJECT buffer
|
||||
variables are reentrant-safe
|
||||
|
||||
** manual now discusses memory usage
|
||||
|
||||
** skeleton now processed by m4 before mkskel.sh; (this only matters
|
||||
if you want to change the skeleton or if you're doing flex development)
|
||||
|
||||
** zh_cn translation added from translation project
|
||||
|
||||
** a bug that caused a segfault has now been fixed
|
||||
|
||||
** the test suite now respects the usual CFLAGS, etc. variables
|
||||
|
||||
** removed some warnings which some tests trigggered with the -s option
|
||||
|
||||
** the flex-generated header file now tries to be smarter about
|
||||
conditionally including start conditions
|
||||
|
||||
** tables code omitted from generated scanner when not used
|
||||
|
||||
* version 2.5.14 released 2002-8-15
|
||||
|
||||
** the tests using the reentrant c scanner as c++ were reworked
|
||||
slightly to be sure that the c++ was enforced
|
||||
|
||||
** de translation now included in the distribution
|
||||
|
||||
** various portability fixes regarding nls support, c++ include
|
||||
headers, etc.
|
||||
|
||||
* version 2.5.13 released 2002-8-15
|
||||
|
||||
** the header file output with %option header is now much smaller
|
||||
|
||||
** Fixed type mismatch in printf in scanner skeleton
|
||||
|
||||
** yylex_init now reports errors
|
||||
|
||||
* version 2.5.12 released 2002-8-8
|
||||
|
||||
** updated gettext support to 0.11.5
|
||||
|
||||
** new fr translation from the translation project
|
||||
|
||||
** bison is no longer needed to build flex; If you are building flex
|
||||
from a release (i.e., not from a cvs snapshot), then you don't need
|
||||
to have a pre-built lex around either (unless you modify scan.l, of
|
||||
course); (This has been true for some time, but was not mentioned
|
||||
here.)
|
||||
|
||||
* version 2.5.11 released 2002-7-31
|
||||
|
||||
** Fixed bug where yyless did not consider yylineno
|
||||
|
||||
** the yylineno performance hit is now gone
|
||||
|
||||
** fixed some typos in the manual and we now include texinfo.tex in
|
||||
the distribution
|
||||
|
||||
** traditional prototypes output for C scanners, controlled by a
|
||||
preprocessor symbol; see documentation for details
|
||||
|
||||
* version 2.5.10 released 2002-7-24
|
||||
|
||||
** yy_globals renamed to yyscanner and yy_globals_t renamed to
|
||||
yy_guts_t
|
||||
|
||||
** added dist-bzip2 option to Makefile.am so we now produce a bzip2'd
|
||||
archive in addition to the standard gzip archive
|
||||
|
||||
* version 2.5.9
|
||||
|
||||
** new tests in test suite: test-mem-{nr,r}, test-posix,
|
||||
test-posixly-correct, test-debug-{nr,r}
|
||||
|
||||
** made changes to work with gcc-3.2 development code
|
||||
|
||||
** ability to choose which memory functions are used in flex
|
||||
|
||||
** new yylex_destroy() function for the non-reentrant scanner
|
||||
|
||||
** new handling of POSIXLY_CORRECT environment variable
|
||||
|
||||
** the test suite now has its copyrights explicitly described
|
||||
|
||||
** new ca, de, fr, ru, sv, tr translations
|
||||
|
||||
* version 2.5.8
|
||||
|
||||
** a new --posix option generates scanners with posix-style abc{1,3}
|
||||
compatible parsing, see manual for the screwy details
|
||||
|
||||
* version 2.5.7
|
||||
|
||||
** configure.in now includes a call to AC_PREREQ to enforce the
|
||||
requirement for autoconf at least 2.50 (This only effects you if
|
||||
you're doing flex development.)
|
||||
|
||||
** configure now uses autoconf's versioning information and configure
|
||||
--help reports the bug-reporting address for flex
|
||||
|
||||
** test suite now only reports success versus failure; reporting
|
||||
skipped is problematic under the current setup
|
||||
|
||||
** compilation with --disable-nls now works
|
||||
|
||||
** flex can now be built in a separate directory
|
||||
|
||||
* version 2.5.6
|
||||
|
||||
** gettext support added (from gettext 0.11)
|
||||
|
||||
*** translations for ca, da, de, es, fr, ko, ru, sv, tr included
|
||||
|
||||
** distribution now built under automake 1.6 and autoconf 2.53
|
||||
|
||||
** command-line option parsing happens differently now:
|
||||
|
||||
*** Added long option parsing
|
||||
|
||||
*** Options -n and -c, previously deprecated, now simply do nothing
|
||||
|
||||
*** Options are now parsed left to right
|
||||
|
||||
** added a number of new options
|
||||
|
||||
*** All positive %options are now accessible from the command line
|
||||
|
||||
*** Added option -D, to define a preprocessor symbol
|
||||
|
||||
*** Added option --header=FILE to specify a C .h file to generate
|
||||
|
||||
*** added option --yywrap to call yywrap on EOF
|
||||
|
||||
*** added option --yylineno to track line count in yylineno
|
||||
|
||||
*** --yyclass=NAME name of C++ class when generating c++ scanners
|
||||
|
||||
*** for long option names which are associated with existing short
|
||||
options, see accompanying documentation
|
||||
|
||||
*** new %option nounistd or command-line --nounistd added to prevent
|
||||
flex from generating #include <unistd.h> on systems that don't
|
||||
have that include file
|
||||
|
||||
** Support for reentrant C scanners has been added
|
||||
|
||||
*** Updated the manual with the new reentrant API
|
||||
|
||||
*** Two new options %option reentrant (-R) and
|
||||
%option reentrant-bison (-Rb)
|
||||
|
||||
*** All globals optionally placed into struct yyglobals_t
|
||||
|
||||
*** All access to globals replaced by macro invocations
|
||||
|
||||
*** All functions optionally take one additional
|
||||
argument, yy_globals
|
||||
|
||||
*** New style for invoking reentrant scanner:
|
||||
yylex_init(void** scanner );
|
||||
yylex( scanner );
|
||||
yylex_destroy( scanner );
|
||||
|
||||
*** Added get/set functions for members of struct yy_globals_t
|
||||
e.g., yyget_text, yyget_leng, etc
|
||||
|
||||
*** Prefix substitution added for new functions
|
||||
|
||||
*** Macro shortcuts to the lengthy get/set functions
|
||||
provided for use in actions, e.g., yytext, yyleng, etc
|
||||
|
||||
*** Arbitrary, user-defined data, "yyextra", may be added to scanner
|
||||
|
||||
** %option nomain no longer implies %option yywrap
|
||||
But the inverse is still true
|
||||
|
||||
** Developer test suite added
|
||||
|
||||
*** TESTS/ directory has been added. Users can
|
||||
'make test' in the TESTS directory to execute the test suite
|
||||
|
||||
** Support for bison variables yylval and yylloc added
|
||||
|
||||
** automake support for the build process
|
||||
|
||||
** manual is now in texinfo/info format
|
||||
|
||||
*** flex.1 removed from distribution
|
||||
|
||||
** flex no longer generates C-language scanners with C++-style
|
||||
comments
|
||||
|
||||
** flex now generates scanners in c++ which are compatible with
|
||||
recent c++ compilers
|
||||
|
||||
** flex input scanner now recognizes '\r' as an EOL character
|
||||
|
||||
See the file ONEWS for changes in earlier releases.
|
||||
|
||||
Local Variables:
|
||||
mode: text
|
||||
mode: outline-minor
|
||||
end:
|
||||
1233
external/bsd/flex/dist/ONEWS
vendored
Normal file
1233
external/bsd/flex/dist/ONEWS
vendored
Normal file
File diff suppressed because it is too large
Load Diff
79
external/bsd/flex/dist/README
vendored
Normal file
79
external/bsd/flex/dist/README
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
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
|
||||
facilities which can be found from flex's SourceForge project page at:
|
||||
|
||||
http://sourceforge.net/projects/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
|
||||
|
||||
Note that flex is distributed under a copyright very similar to that of
|
||||
BSD Unix, and not under the GNU General Public License (GPL).
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
2
external/bsd/flex/dist/README-alpha
vendored
Normal file
2
external/bsd/flex/dist/README-alpha
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
Beta versions and cvs snapshots of flex can be had at
|
||||
ftp://ftp.uncg.edu/people/wlestes/.
|
||||
46
external/bsd/flex/dist/README.cvs
vendored
Normal file
46
external/bsd/flex/dist/README.cvs
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
This file gives information regarding the cvs tree of flex. The cvs
|
||||
tree of flex contains the files which are under version control by
|
||||
the flex maintainers for the flex project.
|
||||
|
||||
You can learn about the details of retrieving a copy of the cvs flex
|
||||
tree from flex's SourceForge project page at:
|
||||
|
||||
http://sourceforge.net/projects/flex
|
||||
|
||||
If you are not interested in flex development or you are not in need
|
||||
of the latest bleeding-edge features, then the cvs flex tree is
|
||||
not for you.
|
||||
|
||||
When you get a distribution of flex, a large number of intermediate
|
||||
files needed to make building flex easy are included. You don't have
|
||||
that in the cvs tree.
|
||||
|
||||
You will need various external tools in order to build the distribution. Here is
|
||||
a (hopefully complete and correct) list of the required tools. Always get the latest
|
||||
version of each tool; we list the versions used in development of
|
||||
flex, but the listed versions may not work for you.
|
||||
|
||||
compiler suite; e.g., gcc
|
||||
bash or some other fairly robust sh-style shell
|
||||
GNU bison; to generate parse.c from parse.y
|
||||
GNU m4 1.4; required by GNU autoconf (yes, it *must* be GNU m4)
|
||||
GNU autoconf 2.59 and GNU automake 1.9.6; for generating Makefiles etc.
|
||||
GNU gettext 0.14.5; for i18n
|
||||
flex (latest beta release); for bootstrap of scan.l
|
||||
help2man 1.36; to generate the flex man page
|
||||
tar, gzip, etc.; for packaging of the source distribution
|
||||
GNU texinfo 4.8; to build and test the flex manual
|
||||
perl; GNU automake and GNU autoconf now depend on perl to run
|
||||
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.
|
||||
53
external/bsd/flex/dist/THANKS
vendored
Normal file
53
external/bsd/flex/dist/THANKS
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
Vern had the following things to say:
|
||||
|
||||
Many thanks to the 2.5 beta-testers for finding bugs and helping test and
|
||||
increase portability: Stan Adermann, Scott David Daniels, Charles Elliott,
|
||||
Joe Gayda, Chris Meier, James Nordby, Terrence O'Kane, Karsten Pahnke,
|
||||
Francois Pinard, Pat Rankin, Andreas Scherer, Marc Wiese, Nathan Zelle.
|
||||
|
||||
Thanks to the many 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.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
101
external/bsd/flex/dist/TODO
vendored
Normal file
101
external/bsd/flex/dist/TODO
vendored
Normal file
@@ -0,0 +1,101 @@
|
||||
* sourceforge migration
|
||||
|
||||
** Move CVS to sourceforge (estes) %%
|
||||
|
||||
** test the mailing lists (estes) %%
|
||||
|
||||
** inform GNU folks about changeover (estes) %%
|
||||
|
||||
* resolve the items in the to.do directory
|
||||
|
||||
** expand the above into individual requests and handle those requests
|
||||
|
||||
** transfer to.do/Wishlist contents to top level TODO file
|
||||
|
||||
* 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.
|
||||
|
||||
* address lex-replacement: document or provide an option through
|
||||
configure for creating lex and libl.a files (but remember this has
|
||||
posix implications)
|
||||
|
||||
* 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++
|
||||
|
||||
** c++ is getting so broken and different from C, that we need to
|
||||
reevaluate the usefuleness of c++ in flex
|
||||
|
||||
** revisit the C++ API. We get requests to make it more complete.
|
||||
|
||||
* distribution
|
||||
|
||||
** use bootstrapper
|
||||
|
||||
** remove texinfo.tex from the cvs tree; it only needs to be present
|
||||
on the system where the flex release is put together
|
||||
|
||||
** use clcommit to manage ChangeLog
|
||||
|
||||
Legend:
|
||||
|
||||
*, **, ***: outline depth
|
||||
%% at end of item: must be adressed before next major release
|
||||
|
||||
Local Variables:
|
||||
Mode: text
|
||||
mode: outline-minor
|
||||
End:
|
||||
879
external/bsd/flex/dist/aclocal.m4
vendored
Normal file
879
external/bsd/flex/dist/aclocal.m4
vendored
Normal file
@@ -0,0 +1,879 @@
|
||||
# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
|
||||
# 2005 Free Software Foundation, Inc.
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# AM_AUTOMAKE_VERSION(VERSION)
|
||||
# ----------------------------
|
||||
# Automake X.Y traces this macro to ensure aclocal.m4 has been
|
||||
# generated from the m4 files accompanying Automake X.Y.
|
||||
AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
|
||||
|
||||
# AM_SET_CURRENT_AUTOMAKE_VERSION
|
||||
# -------------------------------
|
||||
# Call AM_AUTOMAKE_VERSION so it can be traced.
|
||||
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
|
||||
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
|
||||
[AM_AUTOMAKE_VERSION([1.9.6])])
|
||||
|
||||
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
|
||||
# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
|
||||
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
|
||||
#
|
||||
# Of course, Automake must honor this variable whenever it calls a
|
||||
# tool from the auxiliary directory. The problem is that $srcdir (and
|
||||
# therefore $ac_aux_dir as well) can be either absolute or relative,
|
||||
# depending on how configure is run. This is pretty annoying, since
|
||||
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
|
||||
# source directory, any form will work fine, but in subdirectories a
|
||||
# relative path needs to be adjusted first.
|
||||
#
|
||||
# $ac_aux_dir/missing
|
||||
# fails when called from a subdirectory if $ac_aux_dir is relative
|
||||
# $top_srcdir/$ac_aux_dir/missing
|
||||
# fails if $ac_aux_dir is absolute,
|
||||
# fails when called from a subdirectory in a VPATH build with
|
||||
# a relative $ac_aux_dir
|
||||
#
|
||||
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
|
||||
# are both prefixed by $srcdir. In an in-source build this is usually
|
||||
# harmless because $srcdir is `.', but things will broke when you
|
||||
# start a VPATH build or use an absolute $srcdir.
|
||||
#
|
||||
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
|
||||
# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
|
||||
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
|
||||
# and then we would define $MISSING as
|
||||
# MISSING="\${SHELL} $am_aux_dir/missing"
|
||||
# This will work as long as MISSING is not called from configure, because
|
||||
# unfortunately $(top_srcdir) has no meaning in configure.
|
||||
# However there are other variables, like CC, which are often used in
|
||||
# configure, and could therefore not use this "fixed" $ac_aux_dir.
|
||||
#
|
||||
# Another solution, used here, is to always expand $ac_aux_dir to an
|
||||
# absolute PATH. The drawback is that using absolute paths prevent a
|
||||
# configured tree to be moved without reconfiguration.
|
||||
|
||||
AC_DEFUN([AM_AUX_DIR_EXPAND],
|
||||
[dnl Rely on autoconf to set up CDPATH properly.
|
||||
AC_PREREQ([2.50])dnl
|
||||
# expand $ac_aux_dir to an absolute path
|
||||
am_aux_dir=`cd $ac_aux_dir && pwd`
|
||||
])
|
||||
|
||||
# AM_CONDITIONAL -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 7
|
||||
|
||||
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
|
||||
# -------------------------------------
|
||||
# Define a conditional.
|
||||
AC_DEFUN([AM_CONDITIONAL],
|
||||
[AC_PREREQ(2.52)dnl
|
||||
ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
|
||||
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
|
||||
AC_SUBST([$1_TRUE])
|
||||
AC_SUBST([$1_FALSE])
|
||||
if $2; then
|
||||
$1_TRUE=
|
||||
$1_FALSE='#'
|
||||
else
|
||||
$1_TRUE='#'
|
||||
$1_FALSE=
|
||||
fi
|
||||
AC_CONFIG_COMMANDS_PRE(
|
||||
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
|
||||
AC_MSG_ERROR([[conditional "$1" was never defined.
|
||||
Usually this means the macro was only invoked conditionally.]])
|
||||
fi])])
|
||||
|
||||
|
||||
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 8
|
||||
|
||||
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
|
||||
# written in clear, in which case automake, when reading aclocal.m4,
|
||||
# will think it sees a *use*, and therefore will trigger all it's
|
||||
# C support machinery. Also note that it means that autoscan, seeing
|
||||
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
|
||||
|
||||
|
||||
# _AM_DEPENDENCIES(NAME)
|
||||
# ----------------------
|
||||
# See how the compiler implements dependency checking.
|
||||
# NAME is "CC", "CXX", "GCJ", or "OBJC".
|
||||
# We try a few techniques and use that to set a single cache variable.
|
||||
#
|
||||
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
|
||||
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
|
||||
# dependency, and given that the user is not expected to run this macro,
|
||||
# just rely on AC_PROG_CC.
|
||||
AC_DEFUN([_AM_DEPENDENCIES],
|
||||
[AC_REQUIRE([AM_SET_DEPDIR])dnl
|
||||
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
|
||||
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
|
||||
AC_REQUIRE([AM_DEP_TRACK])dnl
|
||||
|
||||
ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
|
||||
[$1], CXX, [depcc="$CXX" am_compiler_list=],
|
||||
[$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
|
||||
[$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
|
||||
[depcc="$$1" am_compiler_list=])
|
||||
|
||||
AC_CACHE_CHECK([dependency style of $depcc],
|
||||
[am_cv_$1_dependencies_compiler_type],
|
||||
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
|
||||
# We make a subdir and do the tests there. Otherwise we can end up
|
||||
# making bogus files that we don't know about and never remove. For
|
||||
# instance it was reported that on HP-UX the gcc test will end up
|
||||
# making a dummy file named `D' -- because `-MD' means `put the output
|
||||
# in D'.
|
||||
mkdir conftest.dir
|
||||
# Copy depcomp to subdir because otherwise we won't find it if we're
|
||||
# using a relative directory.
|
||||
cp "$am_depcomp" conftest.dir
|
||||
cd conftest.dir
|
||||
# We will build objects and dependencies in a subdirectory because
|
||||
# it helps to detect inapplicable dependency modes. For instance
|
||||
# both Tru64's cc and ICC support -MD to output dependencies as a
|
||||
# side effect of compilation, but ICC will put the dependencies in
|
||||
# the current directory while Tru64 will put them in the object
|
||||
# directory.
|
||||
mkdir sub
|
||||
|
||||
am_cv_$1_dependencies_compiler_type=none
|
||||
if test "$am_compiler_list" = ""; then
|
||||
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
|
||||
fi
|
||||
for depmode in $am_compiler_list; do
|
||||
# Setup a source with many dependencies, because some compilers
|
||||
# like to wrap large dependency lists on column 80 (with \), and
|
||||
# we should not choose a depcomp mode which is confused by this.
|
||||
#
|
||||
# We need to recreate these files for each test, as the compiler may
|
||||
# overwrite some of them when testing with obscure command lines.
|
||||
# This happens at least with the AIX C compiler.
|
||||
: > sub/conftest.c
|
||||
for i in 1 2 3 4 5 6; do
|
||||
echo '#include "conftst'$i'.h"' >> sub/conftest.c
|
||||
# Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
|
||||
# Solaris 8's {/usr,}/bin/sh.
|
||||
touch sub/conftst$i.h
|
||||
done
|
||||
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
|
||||
|
||||
case $depmode in
|
||||
nosideeffect)
|
||||
# after this tag, mechanisms are not by side-effect, so they'll
|
||||
# only be used when explicitly requested
|
||||
if test "x$enable_dependency_tracking" = xyes; then
|
||||
continue
|
||||
else
|
||||
break
|
||||
fi
|
||||
;;
|
||||
none) break ;;
|
||||
esac
|
||||
# We check with `-c' and `-o' for the sake of the "dashmstdout"
|
||||
# mode. It turns out that the SunPro C++ compiler does not properly
|
||||
# handle `-M -o', and we need to detect this.
|
||||
if depmode=$depmode \
|
||||
source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
|
||||
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
|
||||
$SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
|
||||
>/dev/null 2>conftest.err &&
|
||||
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
|
||||
grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
|
||||
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
|
||||
# icc doesn't choke on unknown options, it will just issue warnings
|
||||
# or remarks (even with -Werror). So we grep stderr for any message
|
||||
# that says an option was ignored or not supported.
|
||||
# When given -MP, icc 7.0 and 7.1 complain thusly:
|
||||
# icc: Command line warning: ignoring option '-M'; no argument required
|
||||
# The diagnosis changed in icc 8.0:
|
||||
# icc: Command line remark: option '-MP' not supported
|
||||
if (grep 'ignoring option' conftest.err ||
|
||||
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
|
||||
am_cv_$1_dependencies_compiler_type=$depmode
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
cd ..
|
||||
rm -rf conftest.dir
|
||||
else
|
||||
am_cv_$1_dependencies_compiler_type=none
|
||||
fi
|
||||
])
|
||||
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
|
||||
AM_CONDITIONAL([am__fastdep$1], [
|
||||
test "x$enable_dependency_tracking" != xno \
|
||||
&& test "$am_cv_$1_dependencies_compiler_type" = gcc3])
|
||||
])
|
||||
|
||||
|
||||
# AM_SET_DEPDIR
|
||||
# -------------
|
||||
# Choose a directory name for dependency files.
|
||||
# This macro is AC_REQUIREd in _AM_DEPENDENCIES
|
||||
AC_DEFUN([AM_SET_DEPDIR],
|
||||
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
|
||||
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
|
||||
])
|
||||
|
||||
|
||||
# AM_DEP_TRACK
|
||||
# ------------
|
||||
AC_DEFUN([AM_DEP_TRACK],
|
||||
[AC_ARG_ENABLE(dependency-tracking,
|
||||
[ --disable-dependency-tracking speeds up one-time build
|
||||
--enable-dependency-tracking do not reject slow dependency extractors])
|
||||
if test "x$enable_dependency_tracking" != xno; then
|
||||
am_depcomp="$ac_aux_dir/depcomp"
|
||||
AMDEPBACKSLASH='\'
|
||||
fi
|
||||
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
|
||||
AC_SUBST([AMDEPBACKSLASH])
|
||||
])
|
||||
|
||||
# Generate code to set up dependency tracking. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
#serial 3
|
||||
|
||||
# _AM_OUTPUT_DEPENDENCY_COMMANDS
|
||||
# ------------------------------
|
||||
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
|
||||
[for mf in $CONFIG_FILES; do
|
||||
# Strip MF so we end up with the name of the file.
|
||||
mf=`echo "$mf" | sed -e 's/:.*$//'`
|
||||
# Check whether this is an Automake generated Makefile or not.
|
||||
# We used to match only the files named `Makefile.in', but
|
||||
# some people rename them; so instead we look at the file content.
|
||||
# Grep'ing the first line is not enough: some people post-process
|
||||
# each Makefile.in and add a new line on top of each file to say so.
|
||||
# So let's grep whole file.
|
||||
if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
|
||||
dirpart=`AS_DIRNAME("$mf")`
|
||||
else
|
||||
continue
|
||||
fi
|
||||
# Extract the definition of DEPDIR, am__include, and am__quote
|
||||
# from the Makefile without running `make'.
|
||||
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
|
||||
test -z "$DEPDIR" && continue
|
||||
am__include=`sed -n 's/^am__include = //p' < "$mf"`
|
||||
test -z "am__include" && continue
|
||||
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
|
||||
# When using ansi2knr, U may be empty or an underscore; expand it
|
||||
U=`sed -n 's/^U = //p' < "$mf"`
|
||||
# Find all dependency output files, they are included files with
|
||||
# $(DEPDIR) in their names. We invoke sed twice because it is the
|
||||
# simplest approach to changing $(DEPDIR) to its actual value in the
|
||||
# expansion.
|
||||
for file in `sed -n "
|
||||
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
|
||||
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
|
||||
# Make sure the directory exists.
|
||||
test -f "$dirpart/$file" && continue
|
||||
fdir=`AS_DIRNAME(["$file"])`
|
||||
AS_MKDIR_P([$dirpart/$fdir])
|
||||
# echo "creating $dirpart/$file"
|
||||
echo '# dummy' > "$dirpart/$file"
|
||||
done
|
||||
done
|
||||
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
|
||||
|
||||
|
||||
# AM_OUTPUT_DEPENDENCY_COMMANDS
|
||||
# -----------------------------
|
||||
# This macro should only be invoked once -- use via AC_REQUIRE.
|
||||
#
|
||||
# This code is only required when automatic dependency tracking
|
||||
# is enabled. FIXME. This creates each `.P' file that we will
|
||||
# need in order to bootstrap the dependency handling code.
|
||||
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
|
||||
[AC_CONFIG_COMMANDS([depfiles],
|
||||
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
|
||||
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
|
||||
])
|
||||
|
||||
# Do all the work for Automake. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 12
|
||||
|
||||
# This macro actually does too much. Some checks are only needed if
|
||||
# your package does certain things. But this isn't really a big deal.
|
||||
|
||||
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
|
||||
# AM_INIT_AUTOMAKE([OPTIONS])
|
||||
# -----------------------------------------------
|
||||
# The call with PACKAGE and VERSION arguments is the old style
|
||||
# call (pre autoconf-2.50), which is being phased out. PACKAGE
|
||||
# and VERSION should now be passed to AC_INIT and removed from
|
||||
# the call to AM_INIT_AUTOMAKE.
|
||||
# We support both call styles for the transition. After
|
||||
# the next Automake release, Autoconf can make the AC_INIT
|
||||
# arguments mandatory, and then we can depend on a new Autoconf
|
||||
# release and drop the old call support.
|
||||
AC_DEFUN([AM_INIT_AUTOMAKE],
|
||||
[AC_PREREQ([2.58])dnl
|
||||
dnl Autoconf wants to disallow AM_ names. We explicitly allow
|
||||
dnl the ones we care about.
|
||||
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
|
||||
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
|
||||
AC_REQUIRE([AC_PROG_INSTALL])dnl
|
||||
# test to see if srcdir already configured
|
||||
if test "`cd $srcdir && pwd`" != "`pwd`" &&
|
||||
test -f $srcdir/config.status; then
|
||||
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
|
||||
fi
|
||||
|
||||
# test whether we have cygpath
|
||||
if test -z "$CYGPATH_W"; then
|
||||
if (cygpath --version) >/dev/null 2>/dev/null; then
|
||||
CYGPATH_W='cygpath -w'
|
||||
else
|
||||
CYGPATH_W=echo
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([CYGPATH_W])
|
||||
|
||||
# Define the identity of the package.
|
||||
dnl Distinguish between old-style and new-style calls.
|
||||
m4_ifval([$2],
|
||||
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
|
||||
AC_SUBST([PACKAGE], [$1])dnl
|
||||
AC_SUBST([VERSION], [$2])],
|
||||
[_AM_SET_OPTIONS([$1])dnl
|
||||
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
|
||||
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
|
||||
|
||||
_AM_IF_OPTION([no-define],,
|
||||
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
|
||||
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
|
||||
|
||||
# Some tools Automake needs.
|
||||
AC_REQUIRE([AM_SANITY_CHECK])dnl
|
||||
AC_REQUIRE([AC_ARG_PROGRAM])dnl
|
||||
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
|
||||
AM_MISSING_PROG(AUTOCONF, autoconf)
|
||||
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
|
||||
AM_MISSING_PROG(AUTOHEADER, autoheader)
|
||||
AM_MISSING_PROG(MAKEINFO, makeinfo)
|
||||
AM_PROG_INSTALL_SH
|
||||
AM_PROG_INSTALL_STRIP
|
||||
AC_REQUIRE([AM_PROG_MKDIR_P])dnl
|
||||
# We need awk for the "check" target. The system "awk" is bad on
|
||||
# some platforms.
|
||||
AC_REQUIRE([AC_PROG_AWK])dnl
|
||||
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
|
||||
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
|
||||
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
|
||||
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
|
||||
[_AM_PROG_TAR([v7])])])
|
||||
_AM_IF_OPTION([no-dependencies],,
|
||||
[AC_PROVIDE_IFELSE([AC_PROG_CC],
|
||||
[_AM_DEPENDENCIES(CC)],
|
||||
[define([AC_PROG_CC],
|
||||
defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
|
||||
AC_PROVIDE_IFELSE([AC_PROG_CXX],
|
||||
[_AM_DEPENDENCIES(CXX)],
|
||||
[define([AC_PROG_CXX],
|
||||
defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
|
||||
])
|
||||
])
|
||||
|
||||
|
||||
# When config.status generates a header, we must update the stamp-h file.
|
||||
# This file resides in the same directory as the config header
|
||||
# that is generated. The stamp files are numbered to have different names.
|
||||
|
||||
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
|
||||
# loop where config.status creates the headers, so we can generate
|
||||
# our stamp files there.
|
||||
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
|
||||
[# Compute $1's index in $config_headers.
|
||||
_am_stamp_count=1
|
||||
for _am_header in $config_headers :; do
|
||||
case $_am_header in
|
||||
$1 | $1:* )
|
||||
break ;;
|
||||
* )
|
||||
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
|
||||
esac
|
||||
done
|
||||
echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
|
||||
|
||||
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# AM_PROG_INSTALL_SH
|
||||
# ------------------
|
||||
# Define $install_sh.
|
||||
AC_DEFUN([AM_PROG_INSTALL_SH],
|
||||
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
||||
install_sh=${install_sh-"$am_aux_dir/install-sh"}
|
||||
AC_SUBST(install_sh)])
|
||||
|
||||
# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 2
|
||||
|
||||
# Check whether the underlying file-system supports filenames
|
||||
# with a leading dot. For instance MS-DOS doesn't.
|
||||
AC_DEFUN([AM_SET_LEADING_DOT],
|
||||
[rm -rf .tst 2>/dev/null
|
||||
mkdir .tst 2>/dev/null
|
||||
if test -d .tst; then
|
||||
am__leading_dot=.
|
||||
else
|
||||
am__leading_dot=_
|
||||
fi
|
||||
rmdir .tst 2>/dev/null
|
||||
AC_SUBST([am__leading_dot])])
|
||||
|
||||
# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 5
|
||||
|
||||
# AM_PROG_LEX
|
||||
# -----------
|
||||
# Autoconf leaves LEX=: if lex or flex can't be found. Change that to a
|
||||
# "missing" invocation, for better error output.
|
||||
AC_DEFUN([AM_PROG_LEX],
|
||||
[AC_PREREQ(2.50)dnl
|
||||
AC_REQUIRE([AM_MISSING_HAS_RUN])dnl
|
||||
AC_REQUIRE([AC_PROG_LEX])dnl
|
||||
if test "$LEX" = :; then
|
||||
LEX=${am_missing_run}flex
|
||||
fi])
|
||||
|
||||
# Check to see how 'make' treats includes. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 3
|
||||
|
||||
# AM_MAKE_INCLUDE()
|
||||
# -----------------
|
||||
# Check to see how make treats includes.
|
||||
AC_DEFUN([AM_MAKE_INCLUDE],
|
||||
[am_make=${MAKE-make}
|
||||
cat > confinc << 'END'
|
||||
am__doit:
|
||||
@echo done
|
||||
.PHONY: am__doit
|
||||
END
|
||||
# If we don't find an include directive, just comment out the code.
|
||||
AC_MSG_CHECKING([for style of include used by $am_make])
|
||||
am__include="#"
|
||||
am__quote=
|
||||
_am_result=none
|
||||
# First try GNU make style include.
|
||||
echo "include confinc" > confmf
|
||||
# We grep out `Entering directory' and `Leaving directory'
|
||||
# messages which can occur if `w' ends up in MAKEFLAGS.
|
||||
# In particular we don't look at `^make:' because GNU make might
|
||||
# be invoked under some other name (usually "gmake"), in which
|
||||
# case it prints its new name instead of `make'.
|
||||
if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
|
||||
am__include=include
|
||||
am__quote=
|
||||
_am_result=GNU
|
||||
fi
|
||||
# Now try BSD make style include.
|
||||
if test "$am__include" = "#"; then
|
||||
echo '.include "confinc"' > confmf
|
||||
if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
|
||||
am__include=.include
|
||||
am__quote="\""
|
||||
_am_result=BSD
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([am__include])
|
||||
AC_SUBST([am__quote])
|
||||
AC_MSG_RESULT([$_am_result])
|
||||
rm -f confinc confmf
|
||||
])
|
||||
|
||||
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 4
|
||||
|
||||
# AM_MISSING_PROG(NAME, PROGRAM)
|
||||
# ------------------------------
|
||||
AC_DEFUN([AM_MISSING_PROG],
|
||||
[AC_REQUIRE([AM_MISSING_HAS_RUN])
|
||||
$1=${$1-"${am_missing_run}$2"}
|
||||
AC_SUBST($1)])
|
||||
|
||||
|
||||
# AM_MISSING_HAS_RUN
|
||||
# ------------------
|
||||
# Define MISSING if not defined so far and test if it supports --run.
|
||||
# If it does, set am_missing_run to use it, otherwise, to nothing.
|
||||
AC_DEFUN([AM_MISSING_HAS_RUN],
|
||||
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
||||
test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
|
||||
# Use eval to expand $SHELL
|
||||
if eval "$MISSING --run true"; then
|
||||
am_missing_run="$MISSING --run "
|
||||
else
|
||||
am_missing_run=
|
||||
AC_MSG_WARN([`missing' script is too old or missing])
|
||||
fi
|
||||
])
|
||||
|
||||
# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# AM_PROG_MKDIR_P
|
||||
# ---------------
|
||||
# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
|
||||
#
|
||||
# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
|
||||
# created by `make install' are always world readable, even if the
|
||||
# installer happens to have an overly restrictive umask (e.g. 077).
|
||||
# This was a mistake. There are at least two reasons why we must not
|
||||
# use `-m 0755':
|
||||
# - it causes special bits like SGID to be ignored,
|
||||
# - it may be too restrictive (some setups expect 775 directories).
|
||||
#
|
||||
# Do not use -m 0755 and let people choose whatever they expect by
|
||||
# setting umask.
|
||||
#
|
||||
# We cannot accept any implementation of `mkdir' that recognizes `-p'.
|
||||
# Some implementations (such as Solaris 8's) are not thread-safe: if a
|
||||
# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
|
||||
# concurrently, both version can detect that a/ is missing, but only
|
||||
# one can create it and the other will error out. Consequently we
|
||||
# restrict ourselves to GNU make (using the --version option ensures
|
||||
# this.)
|
||||
AC_DEFUN([AM_PROG_MKDIR_P],
|
||||
[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
|
||||
# We used to keeping the `.' as first argument, in order to
|
||||
# allow $(mkdir_p) to be used without argument. As in
|
||||
# $(mkdir_p) $(somedir)
|
||||
# where $(somedir) is conditionally defined. However this is wrong
|
||||
# for two reasons:
|
||||
# 1. if the package is installed by a user who cannot write `.'
|
||||
# make install will fail,
|
||||
# 2. the above comment should most certainly read
|
||||
# $(mkdir_p) $(DESTDIR)$(somedir)
|
||||
# so it does not work when $(somedir) is undefined and
|
||||
# $(DESTDIR) is not.
|
||||
# To support the latter case, we have to write
|
||||
# test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
|
||||
# so the `.' trick is pointless.
|
||||
mkdir_p='mkdir -p --'
|
||||
else
|
||||
# On NextStep and OpenStep, the `mkdir' command does not
|
||||
# recognize any option. It will interpret all options as
|
||||
# directories to create, and then abort because `.' already
|
||||
# exists.
|
||||
for d in ./-p ./--version;
|
||||
do
|
||||
test -d $d && rmdir $d
|
||||
done
|
||||
# $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
|
||||
if test -f "$ac_aux_dir/mkinstalldirs"; then
|
||||
mkdir_p='$(mkinstalldirs)'
|
||||
else
|
||||
mkdir_p='$(install_sh) -d'
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([mkdir_p])])
|
||||
|
||||
# Helper functions for option handling. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 3
|
||||
|
||||
# _AM_MANGLE_OPTION(NAME)
|
||||
# -----------------------
|
||||
AC_DEFUN([_AM_MANGLE_OPTION],
|
||||
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
|
||||
|
||||
# _AM_SET_OPTION(NAME)
|
||||
# ------------------------------
|
||||
# Set option NAME. Presently that only means defining a flag for this option.
|
||||
AC_DEFUN([_AM_SET_OPTION],
|
||||
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
|
||||
|
||||
# _AM_SET_OPTIONS(OPTIONS)
|
||||
# ----------------------------------
|
||||
# OPTIONS is a space-separated list of Automake options.
|
||||
AC_DEFUN([_AM_SET_OPTIONS],
|
||||
[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
|
||||
|
||||
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
|
||||
# -------------------------------------------
|
||||
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
|
||||
AC_DEFUN([_AM_IF_OPTION],
|
||||
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
|
||||
|
||||
# Check to make sure that the build environment is sane. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 4
|
||||
|
||||
# AM_SANITY_CHECK
|
||||
# ---------------
|
||||
AC_DEFUN([AM_SANITY_CHECK],
|
||||
[AC_MSG_CHECKING([whether build environment is sane])
|
||||
# Just in case
|
||||
sleep 1
|
||||
echo timestamp > conftest.file
|
||||
# Do `set' in a subshell so we don't clobber the current shell's
|
||||
# arguments. Must try -L first in case configure is actually a
|
||||
# symlink; some systems play weird games with the mod time of symlinks
|
||||
# (eg FreeBSD returns the mod time of the symlink's containing
|
||||
# directory).
|
||||
if (
|
||||
set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
|
||||
if test "$[*]" = "X"; then
|
||||
# -L didn't work.
|
||||
set X `ls -t $srcdir/configure conftest.file`
|
||||
fi
|
||||
rm -f conftest.file
|
||||
if test "$[*]" != "X $srcdir/configure conftest.file" \
|
||||
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
|
||||
|
||||
# If neither matched, then we have a broken ls. This can happen
|
||||
# if, for instance, CONFIG_SHELL is bash and it inherits a
|
||||
# broken ls alias from the environment. This has actually
|
||||
# happened. Such a system could not be considered "sane".
|
||||
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
|
||||
alias in your environment])
|
||||
fi
|
||||
|
||||
test "$[2]" = conftest.file
|
||||
)
|
||||
then
|
||||
# Ok.
|
||||
:
|
||||
else
|
||||
AC_MSG_ERROR([newly created file is older than distributed files!
|
||||
Check your system clock])
|
||||
fi
|
||||
AC_MSG_RESULT(yes)])
|
||||
|
||||
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# AM_PROG_INSTALL_STRIP
|
||||
# ---------------------
|
||||
# One issue with vendor `install' (even GNU) is that you can't
|
||||
# specify the program used to strip binaries. This is especially
|
||||
# annoying in cross-compiling environments, where the build's strip
|
||||
# is unlikely to handle the host's binaries.
|
||||
# Fortunately install-sh will honor a STRIPPROG variable, so we
|
||||
# always use install-sh in `make install-strip', and initialize
|
||||
# STRIPPROG with the value of the STRIP variable (set by the user).
|
||||
AC_DEFUN([AM_PROG_INSTALL_STRIP],
|
||||
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
|
||||
# Installed binaries are usually stripped using `strip' when the user
|
||||
# run `make install-strip'. However `strip' might not be the right
|
||||
# tool to use in cross-compilation environments, therefore Automake
|
||||
# will honor the `STRIP' environment variable to overrule this program.
|
||||
dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
|
||||
if test "$cross_compiling" != no; then
|
||||
AC_CHECK_TOOL([STRIP], [strip], :)
|
||||
fi
|
||||
INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
|
||||
AC_SUBST([INSTALL_STRIP_PROGRAM])])
|
||||
|
||||
# Check how to create a tarball. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 2
|
||||
|
||||
# _AM_PROG_TAR(FORMAT)
|
||||
# --------------------
|
||||
# Check how to create a tarball in format FORMAT.
|
||||
# FORMAT should be one of `v7', `ustar', or `pax'.
|
||||
#
|
||||
# Substitute a variable $(am__tar) that is a command
|
||||
# writing to stdout a FORMAT-tarball containing the directory
|
||||
# $tardir.
|
||||
# tardir=directory && $(am__tar) > result.tar
|
||||
#
|
||||
# Substitute a variable $(am__untar) that extract such
|
||||
# a tarball read from stdin.
|
||||
# $(am__untar) < result.tar
|
||||
AC_DEFUN([_AM_PROG_TAR],
|
||||
[# Always define AMTAR for backward compatibility.
|
||||
AM_MISSING_PROG([AMTAR], [tar])
|
||||
m4_if([$1], [v7],
|
||||
[am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
|
||||
[m4_case([$1], [ustar],, [pax],,
|
||||
[m4_fatal([Unknown tar format])])
|
||||
AC_MSG_CHECKING([how to create a $1 tar archive])
|
||||
# Loop over all known methods to create a tar archive until one works.
|
||||
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
|
||||
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
|
||||
# Do not fold the above two line into one, because Tru64 sh and
|
||||
# Solaris sh will not grok spaces in the rhs of `-'.
|
||||
for _am_tool in $_am_tools
|
||||
do
|
||||
case $_am_tool in
|
||||
gnutar)
|
||||
for _am_tar in tar gnutar gtar;
|
||||
do
|
||||
AM_RUN_LOG([$_am_tar --version]) && break
|
||||
done
|
||||
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
|
||||
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
|
||||
am__untar="$_am_tar -xf -"
|
||||
;;
|
||||
plaintar)
|
||||
# Must skip GNU tar: if it does not support --format= it doesn't create
|
||||
# ustar tarball either.
|
||||
(tar --version) >/dev/null 2>&1 && continue
|
||||
am__tar='tar chf - "$$tardir"'
|
||||
am__tar_='tar chf - "$tardir"'
|
||||
am__untar='tar xf -'
|
||||
;;
|
||||
pax)
|
||||
am__tar='pax -L -x $1 -w "$$tardir"'
|
||||
am__tar_='pax -L -x $1 -w "$tardir"'
|
||||
am__untar='pax -r'
|
||||
;;
|
||||
cpio)
|
||||
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
|
||||
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
|
||||
am__untar='cpio -i -H $1 -d'
|
||||
;;
|
||||
none)
|
||||
am__tar=false
|
||||
am__tar_=false
|
||||
am__untar=false
|
||||
;;
|
||||
esac
|
||||
|
||||
# If the value was cached, stop now. We just wanted to have am__tar
|
||||
# and am__untar set.
|
||||
test -n "${am_cv_prog_tar_$1}" && break
|
||||
|
||||
# tar/untar a dummy directory, and stop if the command works
|
||||
rm -rf conftest.dir
|
||||
mkdir conftest.dir
|
||||
echo GrepMe > conftest.dir/file
|
||||
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
|
||||
rm -rf conftest.dir
|
||||
if test -s conftest.tar; then
|
||||
AM_RUN_LOG([$am__untar <conftest.tar])
|
||||
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
|
||||
fi
|
||||
done
|
||||
rm -rf conftest.dir
|
||||
|
||||
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
|
||||
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
|
||||
AC_SUBST([am__tar])
|
||||
AC_SUBST([am__untar])
|
||||
]) # _AM_PROG_TAR
|
||||
|
||||
m4_include([m4/gettext.m4])
|
||||
m4_include([m4/iconv.m4])
|
||||
m4_include([m4/lib-ld.m4])
|
||||
m4_include([m4/lib-link.m4])
|
||||
m4_include([m4/lib-prefix.m4])
|
||||
m4_include([m4/nls.m4])
|
||||
m4_include([m4/po.m4])
|
||||
m4_include([m4/progtest.m4])
|
||||
32
external/bsd/flex/dist/autogen.sh
vendored
Executable file
32
external/bsd/flex/dist/autogen.sh
vendored
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
# 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.
|
||||
|
||||
# If you see no configure script, then run ./autogen.sh to create it
|
||||
# and procede with the "normal" build procedures.
|
||||
|
||||
#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
|
||||
260
external/bsd/flex/dist/buf.c
vendored
Normal file
260
external/bsd/flex/dist/buf.c
vendored
Normal file
@@ -0,0 +1,260 @@
|
||||
/* $NetBSD: buf.c,v 1.1.1.1 2009/10/26 00:25:04 christos Exp $ */
|
||||
|
||||
/* 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. */
|
||||
|
||||
/* 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 "flexdef.h"
|
||||
|
||||
/* Take note: The buffer object is sometimes used as a String buffer (one
|
||||
* continuous string), and sometimes used as a list of strings, usually line by
|
||||
* line.
|
||||
*
|
||||
* The type is specified in buf_init by the elt_size. If the elt_size is
|
||||
* sizeof(char), then the buffer should be treated as string buffer. If the
|
||||
* elt_size is sizeof(char*), then the buffer should be treated as a list of
|
||||
* strings.
|
||||
*
|
||||
* Certain functions are only appropriate for one type or the other.
|
||||
*/
|
||||
|
||||
/* global buffers. */
|
||||
struct Buf userdef_buf; /**< for user #definitions triggered by cmd-line. */
|
||||
struct Buf defs_buf; /**< for #define's autogenerated. List of strings. */
|
||||
struct Buf yydmap_buf; /**< string buffer to hold yydmap elements */
|
||||
struct Buf m4defs_buf; /**< m4 definitions. List of strings. */
|
||||
struct Buf top_buf; /**< contains %top code. String buffer. */
|
||||
|
||||
struct Buf *buf_print_strings(struct Buf * buf, FILE* out)
|
||||
{
|
||||
int i;
|
||||
|
||||
if(!buf || !out)
|
||||
return buf;
|
||||
|
||||
for (i=0; i < buf->nelts; i++){
|
||||
const char * s = ((char**)buf->elts)[i];
|
||||
if(s)
|
||||
fprintf(out, "%s", s);
|
||||
}
|
||||
return buf;
|
||||
}
|
||||
|
||||
/* Append a "%s" formatted string to a string buffer */
|
||||
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);
|
||||
snprintf (t, tsz, fmt, s);
|
||||
buf = buf_strappend (buf, t);
|
||||
flex_free (t);
|
||||
return buf;
|
||||
}
|
||||
|
||||
/** Append a line directive to the string buffer.
|
||||
* @param buf A string buffer.
|
||||
* @param filename file name
|
||||
* @param lineno line number
|
||||
* @return buf
|
||||
*/
|
||||
struct Buf *buf_linedir (struct Buf *buf, const char* filename, int lineno)
|
||||
{
|
||||
char *t, *fmt = "#line %d \"%s\"\n";
|
||||
size_t tsz;
|
||||
|
||||
t = flex_alloc (tsz = strlen (fmt) + strlen (filename) + (int)(1 + log10(lineno>=0?lineno:-lineno)) + 1);
|
||||
snprintf (t, tsz, fmt, lineno, filename);
|
||||
buf = buf_strappend (buf, t);
|
||||
flex_free (t);
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
||||
/** Append the contents of @a src to @a dest.
|
||||
* @param @a dest the destination buffer
|
||||
* @param @a dest the source buffer
|
||||
* @return @a dest
|
||||
*/
|
||||
struct Buf *buf_concat(struct Buf* dest, const struct Buf* src)
|
||||
{
|
||||
buf_append(dest, src->elts, src->nelts);
|
||||
return dest;
|
||||
}
|
||||
|
||||
|
||||
/* Appends n characters in str to buf. */
|
||||
struct Buf *buf_strnappend (buf, str, n)
|
||||
struct Buf *buf;
|
||||
const char *str;
|
||||
int n;
|
||||
{
|
||||
buf_append (buf, str, n + 1);
|
||||
|
||||
/* "undo" the '\0' character that buf_append() already copied. */
|
||||
buf->nelts--;
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
/* Appends characters in str to buf. */
|
||||
struct Buf *buf_strappend (buf, str)
|
||||
struct Buf *buf;
|
||||
const char *str;
|
||||
{
|
||||
return buf_strnappend (buf, str, strlen (str));
|
||||
}
|
||||
|
||||
/* appends "#define str def\n" */
|
||||
struct Buf *buf_strdefine (buf, str, def)
|
||||
struct Buf *buf;
|
||||
const char *str;
|
||||
const char *def;
|
||||
{
|
||||
buf_strappend (buf, "#define ");
|
||||
buf_strappend (buf, " ");
|
||||
buf_strappend (buf, str);
|
||||
buf_strappend (buf, " ");
|
||||
buf_strappend (buf, def);
|
||||
buf_strappend (buf, "\n");
|
||||
return buf;
|
||||
}
|
||||
|
||||
/** Pushes "m4_define( [[def]], [[val]])m4_dnl" to end of buffer.
|
||||
* @param buf A buffer as a list of strings.
|
||||
* @param def The m4 symbol to define.
|
||||
* @param val The definition; may be NULL.
|
||||
* @return buf
|
||||
*/
|
||||
struct Buf *buf_m4_define (struct Buf *buf, const char* def, const char* val)
|
||||
{
|
||||
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);
|
||||
|
||||
snprintf(str, strsz, fmt, def, val);
|
||||
buf_append(buf, &str, 1);
|
||||
return buf;
|
||||
}
|
||||
|
||||
/** Pushes "m4_undefine([[def]])m4_dnl" to end of buffer.
|
||||
* @param buf A buffer as a list of strings.
|
||||
* @param def The m4 symbol to undefine.
|
||||
* @return buf
|
||||
*/
|
||||
struct Buf *buf_m4_undefine (struct Buf *buf, const char* def)
|
||||
{
|
||||
const char * fmt = "m4_undefine( [[%s]])m4_dnl\n";
|
||||
char * str;
|
||||
size_t strsz;
|
||||
|
||||
str = (char*)flex_alloc(strsz = strlen(fmt) + strlen(def) + 2);
|
||||
|
||||
snprintf(str, strsz, fmt, def);
|
||||
buf_append(buf, &str, 1);
|
||||
return buf;
|
||||
}
|
||||
|
||||
/* create buf with 0 elements, each of size elem_size. */
|
||||
void buf_init (buf, elem_size)
|
||||
struct Buf *buf;
|
||||
size_t elem_size;
|
||||
{
|
||||
buf->elts = (void *) 0;
|
||||
buf->nelts = 0;
|
||||
buf->elt_size = elem_size;
|
||||
buf->nmax = 0;
|
||||
}
|
||||
|
||||
/* frees memory */
|
||||
void buf_destroy (buf)
|
||||
struct Buf *buf;
|
||||
{
|
||||
if (buf && buf->elts)
|
||||
flex_free (buf->elts);
|
||||
buf->elts = (void *) 0;
|
||||
}
|
||||
|
||||
|
||||
/* appends ptr[] to buf, grow if necessary.
|
||||
* n_elem is number of elements in ptr[], NOT bytes.
|
||||
* returns buf.
|
||||
* We grow by mod(512) boundaries.
|
||||
*/
|
||||
|
||||
struct Buf *buf_append (buf, ptr, n_elem)
|
||||
struct Buf *buf;
|
||||
const void *ptr;
|
||||
int n_elem;
|
||||
{
|
||||
int n_alloc = 0;
|
||||
|
||||
if (!ptr || n_elem == 0)
|
||||
return buf;
|
||||
|
||||
/* May need to alloc more. */
|
||||
if (n_elem + buf->nelts > buf->nmax) {
|
||||
|
||||
/* exact amount needed... */
|
||||
n_alloc = (n_elem + buf->nelts) * buf->elt_size;
|
||||
|
||||
/* ...plus some extra */
|
||||
if (((n_alloc * buf->elt_size) % 512) != 0
|
||||
&& buf->elt_size < 512)
|
||||
n_alloc +=
|
||||
(512 -
|
||||
((n_alloc * buf->elt_size) % 512)) /
|
||||
buf->elt_size;
|
||||
|
||||
if (!buf->elts)
|
||||
buf->elts =
|
||||
allocate_array (n_alloc, buf->elt_size);
|
||||
else
|
||||
buf->elts =
|
||||
reallocate_array (buf->elts, n_alloc,
|
||||
buf->elt_size);
|
||||
|
||||
buf->nmax = n_alloc;
|
||||
}
|
||||
|
||||
memcpy ((char *) buf->elts + buf->nelts * buf->elt_size, ptr,
|
||||
n_elem * buf->elt_size);
|
||||
buf->nelts += n_elem;
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
/* vim:set tabstop=8 softtabstop=4 shiftwidth=4: */
|
||||
312
external/bsd/flex/dist/ccl.c
vendored
Normal file
312
external/bsd/flex/dist/ccl.c
vendored
Normal file
@@ -0,0 +1,312 @@
|
||||
/* $NetBSD: ccl.c,v 1.1.1.1 2009/10/26 00:25:06 christos Exp $ */
|
||||
|
||||
/* 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. */
|
||||
|
||||
/* 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 "flexdef.h"
|
||||
|
||||
/* return true if the chr is in the ccl. Takes negation into account. */
|
||||
static bool
|
||||
ccl_contains (const int cclp, const int ch)
|
||||
{
|
||||
int ind, len, i;
|
||||
|
||||
len = ccllen[cclp];
|
||||
ind = cclmap[cclp];
|
||||
|
||||
for (i = 0; i < len; ++i)
|
||||
if (ccltbl[ind + i] == ch)
|
||||
return !cclng[cclp];
|
||||
|
||||
return cclng[cclp];
|
||||
}
|
||||
|
||||
|
||||
/* 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;
|
||||
|
||||
/* mark newlines */
|
||||
if (ch == nlch)
|
||||
ccl_has_nl[cclp] = true;
|
||||
|
||||
newpos = ind + len;
|
||||
|
||||
if (newpos >= current_max_ccl_tbl_size) {
|
||||
current_max_ccl_tbl_size += MAX_CCL_TBL_SIZE_INCREMENT;
|
||||
|
||||
++num_reallocs;
|
||||
|
||||
ccltbl = reallocate_Character_array (ccltbl,
|
||||
current_max_ccl_tbl_size);
|
||||
}
|
||||
|
||||
ccllen[cclp] = len + 1;
|
||||
ccltbl[newpos] = ch;
|
||||
}
|
||||
|
||||
/* dump_cclp - same thing as list_character_set, but for cclps. */
|
||||
|
||||
static void dump_cclp (FILE* file, int cclp)
|
||||
{
|
||||
register int i;
|
||||
|
||||
putc ('[', file);
|
||||
|
||||
for (i = 0; i < csize; ++i) {
|
||||
if (ccl_contains(cclp, i)){
|
||||
register int start_char = i;
|
||||
|
||||
putc (' ', file);
|
||||
|
||||
fputs (readable_form (i), file);
|
||||
|
||||
while (++i < csize && ccl_contains(cclp,i)) ;
|
||||
|
||||
if (i - 1 > start_char)
|
||||
/* this was a run */
|
||||
fprintf (file, "-%s",
|
||||
readable_form (i - 1));
|
||||
|
||||
putc (' ', file);
|
||||
}
|
||||
}
|
||||
|
||||
putc (']', file);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ccl_set_diff - create a new ccl as the set difference of the two given ccls. */
|
||||
int
|
||||
ccl_set_diff (int a, int b)
|
||||
{
|
||||
int d, ch;
|
||||
|
||||
/* create new class */
|
||||
d = cclinit();
|
||||
|
||||
/* In order to handle negation, we spin through all possible chars,
|
||||
* addding each char in a that is not in b.
|
||||
* (This could be O(n^2), but n is small and bounded.)
|
||||
*/
|
||||
for ( ch = 0; ch < csize; ++ch )
|
||||
if (ccl_contains (a, ch) && !ccl_contains(b, ch))
|
||||
ccladd (d, ch);
|
||||
|
||||
/* debug */
|
||||
if (0){
|
||||
fprintf(stderr, "ccl_set_diff (");
|
||||
fprintf(stderr, "\n ");
|
||||
dump_cclp (stderr, a);
|
||||
fprintf(stderr, "\n ");
|
||||
dump_cclp (stderr, b);
|
||||
fprintf(stderr, "\n ");
|
||||
dump_cclp (stderr, d);
|
||||
fprintf(stderr, "\n)\n");
|
||||
}
|
||||
return d;
|
||||
}
|
||||
|
||||
/* ccl_set_union - create a new ccl as the set union of the two given ccls. */
|
||||
int
|
||||
ccl_set_union (int a, int b)
|
||||
{
|
||||
int d, i;
|
||||
|
||||
/* create new class */
|
||||
d = cclinit();
|
||||
|
||||
/* Add all of a */
|
||||
for (i = 0; i < ccllen[a]; ++i)
|
||||
ccladd (d, ccltbl[cclmap[a] + i]);
|
||||
|
||||
/* Add all of b */
|
||||
for (i = 0; i < ccllen[b]; ++i)
|
||||
ccladd (d, ccltbl[cclmap[b] + i]);
|
||||
|
||||
/* debug */
|
||||
if (0){
|
||||
fprintf(stderr, "ccl_set_union (%d + %d = %d", a, b, d);
|
||||
fprintf(stderr, "\n ");
|
||||
dump_cclp (stderr, a);
|
||||
fprintf(stderr, "\n ");
|
||||
dump_cclp (stderr, b);
|
||||
fprintf(stderr, "\n ");
|
||||
dump_cclp (stderr, d);
|
||||
fprintf(stderr, "\n)\n");
|
||||
}
|
||||
return d;
|
||||
}
|
||||
|
||||
|
||||
/* 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);
|
||||
ccl_has_nl =
|
||||
reallocate_bool_array (ccl_has_nl,
|
||||
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 */
|
||||
ccl_has_nl[lastccl] = false;
|
||||
|
||||
return lastccl;
|
||||
}
|
||||
|
||||
|
||||
/* cclnegate - negate the given ccl */
|
||||
|
||||
void cclnegate (cclp)
|
||||
int cclp;
|
||||
{
|
||||
cclng[cclp] = 1;
|
||||
ccl_has_nl[cclp] = !ccl_has_nl[cclp];
|
||||
}
|
||||
|
||||
|
||||
/* 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);
|
||||
}
|
||||
|
||||
/** Determines if the range [c1-c2] is unambiguous in a case-insensitive
|
||||
* scanner. Specifically, if a lowercase or uppercase character, x, is in the
|
||||
* range [c1-c2], then we require that UPPERCASE(x) and LOWERCASE(x) must also
|
||||
* be in the range. If not, then this range is ambiguous, and the function
|
||||
* returns false. For example, [@-_] spans [a-z] but not [A-Z]. Beware that
|
||||
* [a-z] will be labeled ambiguous because it does not include [A-Z].
|
||||
*
|
||||
* @param c1 the lower end of the range
|
||||
* @param c2 the upper end of the range
|
||||
* @return true if [c1-c2] is not ambiguous for a caseless scanner.
|
||||
*/
|
||||
bool range_covers_case (int c1, int c2)
|
||||
{
|
||||
int i, o;
|
||||
|
||||
for (i = c1; i <= c2; i++) {
|
||||
if (has_case (i)) {
|
||||
o = reverse_case (i);
|
||||
if (o < c1 || c2 < o)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Reverse the case of a character, if possible.
|
||||
* @return c if case-reversal does not apply.
|
||||
*/
|
||||
int reverse_case (int c)
|
||||
{
|
||||
return isupper (c) ? tolower (c) : (islower (c) ? toupper (c) : c);
|
||||
}
|
||||
|
||||
/** Return true if c is uppercase or lowercase. */
|
||||
bool has_case (int c)
|
||||
{
|
||||
return (isupper (c) || islower (c)) ? true : false;
|
||||
}
|
||||
142
external/bsd/flex/dist/compile
vendored
Executable file
142
external/bsd/flex/dist/compile
vendored
Executable file
@@ -0,0 +1,142 @@
|
||||
#! /bin/sh
|
||||
# Wrapper for compilers which do not understand `-c -o'.
|
||||
|
||||
scriptversion=2005-05-14.22
|
||||
|
||||
# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
# Written by Tom Tromey <tromey@cygnus.com>.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# This file is maintained in Automake, please report
|
||||
# bugs to <bug-automake@gnu.org> or send patches to
|
||||
# <automake-patches@gnu.org>.
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: compile [--help] [--version] PROGRAM [ARGS]
|
||||
|
||||
Wrapper for compilers which do not understand `-c -o'.
|
||||
Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
|
||||
arguments, and rename the output as expected.
|
||||
|
||||
If you are trying to build a whole package this is not the
|
||||
right script to run: please start by reading the file `INSTALL'.
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "compile $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
esac
|
||||
|
||||
ofile=
|
||||
cfile=
|
||||
eat=
|
||||
|
||||
for arg
|
||||
do
|
||||
if test -n "$eat"; then
|
||||
eat=
|
||||
else
|
||||
case $1 in
|
||||
-o)
|
||||
# configure might choose to run compile as `compile cc -o foo foo.c'.
|
||||
# So we strip `-o arg' only if arg is an object.
|
||||
eat=1
|
||||
case $2 in
|
||||
*.o | *.obj)
|
||||
ofile=$2
|
||||
;;
|
||||
*)
|
||||
set x "$@" -o "$2"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*.c)
|
||||
cfile=$1
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
if test -z "$ofile" || test -z "$cfile"; then
|
||||
# If no `-o' option was seen then we might have been invoked from a
|
||||
# pattern rule where we don't need one. That is ok -- this is a
|
||||
# normal compilation that the losing compiler can handle. If no
|
||||
# `.c' file was seen then we are probably linking. That is also
|
||||
# ok.
|
||||
exec "$@"
|
||||
fi
|
||||
|
||||
# Name of file we expect compiler to create.
|
||||
cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
|
||||
|
||||
# Create the lock directory.
|
||||
# Note: use `[/.-]' here to ensure that we don't use the same name
|
||||
# that we are using for the .o file. Also, base the name on the expected
|
||||
# object file name, since that is what matters with a parallel build.
|
||||
lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d
|
||||
while true; do
|
||||
if mkdir "$lockdir" >/dev/null 2>&1; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
# FIXME: race condition here if user kills between mkdir and trap.
|
||||
trap "rmdir '$lockdir'; exit 1" 1 2 15
|
||||
|
||||
# Run the compile.
|
||||
"$@"
|
||||
ret=$?
|
||||
|
||||
if test -f "$cofile"; then
|
||||
mv "$cofile" "$ofile"
|
||||
elif test -f "${cofile}bj"; then
|
||||
mv "${cofile}bj" "$ofile"
|
||||
fi
|
||||
|
||||
rmdir "$lockdir"
|
||||
exit $ret
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
||||
197
external/bsd/flex/dist/conf.in
vendored
Normal file
197
external/bsd/flex/dist/conf.in
vendored
Normal file
@@ -0,0 +1,197 @@
|
||||
/* conf.in. Generated from configure.in by autoheader. */
|
||||
|
||||
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
|
||||
systems. This function is required for `alloca.c' support on those systems.
|
||||
*/
|
||||
#undef CRAY_STACKSEG_END
|
||||
|
||||
/* Define to 1 if using `alloca.c'. */
|
||||
#undef C_ALLOCA
|
||||
|
||||
/* Define to 1 if translation of program messages to the user's native
|
||||
language is requested. */
|
||||
#undef ENABLE_NLS
|
||||
|
||||
/* Define to 1 if you have `alloca', as a function or macro. */
|
||||
#undef HAVE_ALLOCA
|
||||
|
||||
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
|
||||
*/
|
||||
#undef HAVE_ALLOCA_H
|
||||
|
||||
/* Define if the GNU dcgettext() function is already present or preinstalled.
|
||||
*/
|
||||
#undef HAVE_DCGETTEXT
|
||||
|
||||
/* Define to 1 if you have the `dup2' function. */
|
||||
#undef HAVE_DUP2
|
||||
|
||||
/* Define to 1 if you have the `fork' function. */
|
||||
#undef HAVE_FORK
|
||||
|
||||
/* Define if the GNU gettext() function is already present or preinstalled. */
|
||||
#undef HAVE_GETTEXT
|
||||
|
||||
/* Define if you have the iconv() function. */
|
||||
#undef HAVE_ICONV
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define to 1 if you have the `isascii' function. */
|
||||
#undef HAVE_ISASCII
|
||||
|
||||
/* Define to 1 if you have the <libintl.h> header file. */
|
||||
#undef HAVE_LIBINTL_H
|
||||
|
||||
/* Define to 1 if you have the `m' library (-lm). */
|
||||
#undef HAVE_LIBM
|
||||
|
||||
/* pthread library */
|
||||
#undef HAVE_LIBPTHREAD
|
||||
|
||||
/* Define to 1 if you have the <limits.h> header file. */
|
||||
#undef HAVE_LIMITS_H
|
||||
|
||||
/* Define to 1 if you have the <locale.h> header file. */
|
||||
#undef HAVE_LOCALE_H
|
||||
|
||||
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
|
||||
to 0 otherwise. */
|
||||
#undef HAVE_MALLOC
|
||||
|
||||
/* Define to 1 if you have the <malloc.h> header file. */
|
||||
#undef HAVE_MALLOC_H
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define to 1 if you have the `memset' function. */
|
||||
#undef HAVE_MEMSET
|
||||
|
||||
/* Define to 1 if you have the <netinet/in.h> header file. */
|
||||
#undef HAVE_NETINET_IN_H
|
||||
|
||||
/* Define to 1 if you have the `pow' function. */
|
||||
#undef HAVE_POW
|
||||
|
||||
/* Define to 1 if you have the <pthread.h> header file. */
|
||||
#undef HAVE_PTHREAD_H
|
||||
|
||||
/* Define to 1 if your system has a GNU libc compatible `realloc' function,
|
||||
and to 0 otherwise. */
|
||||
#undef HAVE_REALLOC
|
||||
|
||||
/* Define to 1 if you have the `regcomp' function. */
|
||||
#undef HAVE_REGCOMP
|
||||
|
||||
/* Define to 1 if you have the `setlocale' function. */
|
||||
#undef HAVE_SETLOCALE
|
||||
|
||||
/* Define to 1 if stdbool.h conforms to C99. */
|
||||
#undef HAVE_STDBOOL_H
|
||||
|
||||
/* Define to 1 if you have the <stddef.h> header file. */
|
||||
#undef HAVE_STDDEF_H
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if you have the `strchr' function. */
|
||||
#undef HAVE_STRCHR
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define to 1 if you have the `strtol' function. */
|
||||
#undef HAVE_STRTOL
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||
#undef HAVE_SYS_WAIT_H
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define to 1 if you have the `vfork' function. */
|
||||
#undef HAVE_VFORK
|
||||
|
||||
/* Define to 1 if you have the <vfork.h> header file. */
|
||||
#undef HAVE_VFORK_H
|
||||
|
||||
/* Define to 1 if `fork' works. */
|
||||
#undef HAVE_WORKING_FORK
|
||||
|
||||
/* Define to 1 if `vfork' works. */
|
||||
#undef HAVE_WORKING_VFORK
|
||||
|
||||
/* Define to 1 if the system has the type `_Bool'. */
|
||||
#undef HAVE__BOOL
|
||||
|
||||
/* Define to the GNU M4 executable name. */
|
||||
#undef M4
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at run-time.
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown */
|
||||
#undef STACK_DIRECTION
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
|
||||
`char[]'. */
|
||||
#undef YYTEXT_POINTER
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
#undef const
|
||||
|
||||
/* Define to rpl_malloc if the replacement function should be used. */
|
||||
#undef malloc
|
||||
|
||||
/* Define to `int' if <sys/types.h> does not define. */
|
||||
#undef pid_t
|
||||
|
||||
/* Define to rpl_realloc if the replacement function should be used. */
|
||||
#undef realloc
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> does not define. */
|
||||
#undef size_t
|
||||
|
||||
/* Define as `fork' if `vfork' does not work. */
|
||||
#undef vfork
|
||||
1466
external/bsd/flex/dist/config.guess
vendored
Executable file
1466
external/bsd/flex/dist/config.guess
vendored
Executable file
File diff suppressed because it is too large
Load Diff
548
external/bsd/flex/dist/config.rpath
vendored
Executable file
548
external/bsd/flex/dist/config.rpath
vendored
Executable file
@@ -0,0 +1,548 @@
|
||||
#! /bin/sh
|
||||
# Output a system dependent set of variables, describing how to set the
|
||||
# run time search path of shared libraries in an executable.
|
||||
#
|
||||
# Copyright 1996-2003 Free Software Foundation, Inc.
|
||||
# Taken from GNU libtool, 2001
|
||||
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
#
|
||||
# The first argument passed to this file is the canonical host specification,
|
||||
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
|
||||
# or
|
||||
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
|
||||
# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
|
||||
# should be set by the caller.
|
||||
#
|
||||
# The set of defined variables is at the end of this script.
|
||||
|
||||
# Known limitations:
|
||||
# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
|
||||
# than 256 bytes, otherwise the compiler driver will dump core. The only
|
||||
# known workaround is to choose shorter directory names for the build
|
||||
# directory and/or the installation directory.
|
||||
|
||||
# All known linkers require a `.a' archive for static linking (except M$VC,
|
||||
# which needs '.lib').
|
||||
libext=a
|
||||
shrext=.so
|
||||
|
||||
host="$1"
|
||||
host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
|
||||
host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
|
||||
host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
|
||||
|
||||
# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
|
||||
|
||||
wl=
|
||||
if test "$GCC" = yes; then
|
||||
wl='-Wl,'
|
||||
else
|
||||
case "$host_os" in
|
||||
aix*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
mingw* | pw32* | os2*)
|
||||
;;
|
||||
hpux9* | hpux10* | hpux11*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
irix5* | irix6* | nonstopux*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
newsos6)
|
||||
;;
|
||||
linux*)
|
||||
case $CC in
|
||||
icc|ecc)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
ccc)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
osf3* | osf4* | osf5*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
sco3.2v5*)
|
||||
;;
|
||||
solaris*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
sunos4*)
|
||||
wl='-Qoption ld '
|
||||
;;
|
||||
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
sysv4*MP*)
|
||||
;;
|
||||
uts4*)
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS.
|
||||
|
||||
hardcode_libdir_flag_spec=
|
||||
hardcode_libdir_separator=
|
||||
hardcode_direct=no
|
||||
hardcode_minus_L=no
|
||||
|
||||
case "$host_os" in
|
||||
cygwin* | mingw* | pw32*)
|
||||
# FIXME: the MSVC++ port hasn't been tested in a loooong time
|
||||
# When not using gcc, we currently assume that we are using
|
||||
# Microsoft Visual C++.
|
||||
if test "$GCC" != yes; then
|
||||
with_gnu_ld=no
|
||||
fi
|
||||
;;
|
||||
openbsd*)
|
||||
with_gnu_ld=no
|
||||
;;
|
||||
esac
|
||||
|
||||
ld_shlibs=yes
|
||||
if test "$with_gnu_ld" = yes; then
|
||||
case "$host_os" in
|
||||
aix3* | aix4* | aix5*)
|
||||
# On AIX/PPC, the GNU linker is very broken
|
||||
if test "$host_cpu" != ia64; then
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
amigaos*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
# Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
|
||||
# that the semantics of dynamic libraries on AmigaOS, at least up
|
||||
# to version 4, is to share data among multiple programs linked
|
||||
# with the same dynamic library. Since this doesn't match the
|
||||
# behavior of shared libraries on other platforms, we can use
|
||||
# them.
|
||||
ld_shlibs=no
|
||||
;;
|
||||
beos*)
|
||||
if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
cygwin* | mingw* | pw32*)
|
||||
# hardcode_libdir_flag_spec is actually meaningless, as there is
|
||||
# no search path for DLLs.
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
netbsd*)
|
||||
;;
|
||||
solaris* | sysv5*)
|
||||
if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
|
||||
ld_shlibs=no
|
||||
elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
sunos4*)
|
||||
hardcode_direct=yes
|
||||
;;
|
||||
*)
|
||||
if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
if test "$ld_shlibs" = yes; then
|
||||
# Unlike libtool, we use -rpath here, not --rpath, since the documented
|
||||
# option of GNU ld is called -rpath, not --rpath.
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
fi
|
||||
else
|
||||
case "$host_os" in
|
||||
aix3*)
|
||||
# Note: this linker hardcodes the directories in LIBPATH if there
|
||||
# are no directories specified by -L.
|
||||
hardcode_minus_L=yes
|
||||
if test "$GCC" = yes; then
|
||||
# Neither direct hardcoding nor static linking is supported with a
|
||||
# broken collect2.
|
||||
hardcode_direct=unsupported
|
||||
fi
|
||||
;;
|
||||
aix4* | aix5*)
|
||||
if test "$host_cpu" = ia64; then
|
||||
# On IA64, the linker does run time linking by default, so we don't
|
||||
# have to do anything special.
|
||||
aix_use_runtimelinking=no
|
||||
else
|
||||
aix_use_runtimelinking=no
|
||||
# Test if we are trying to use run time linking or normal
|
||||
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
|
||||
# need to do runtime linking.
|
||||
case $host_os in aix4.[23]|aix4.[23].*|aix5*)
|
||||
for ld_flag in $LDFLAGS; do
|
||||
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
|
||||
aix_use_runtimelinking=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
esac
|
||||
fi
|
||||
hardcode_direct=yes
|
||||
hardcode_libdir_separator=':'
|
||||
if test "$GCC" = yes; then
|
||||
case $host_os in aix4.[012]|aix4.[012].*)
|
||||
collect2name=`${CC} -print-prog-name=collect2`
|
||||
if test -f "$collect2name" && \
|
||||
strings "$collect2name" | grep resolve_lib_name >/dev/null
|
||||
then
|
||||
# We have reworked collect2
|
||||
hardcode_direct=yes
|
||||
else
|
||||
# We have old collect2
|
||||
hardcode_direct=unsupported
|
||||
hardcode_minus_L=yes
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_libdir_separator=
|
||||
fi
|
||||
esac
|
||||
fi
|
||||
# Begin _LT_AC_SYS_LIBPATH_AIX.
|
||||
echo 'int main () { return 0; }' > conftest.c
|
||||
${CC} ${LDFLAGS} conftest.c -o conftest
|
||||
aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
|
||||
}'`
|
||||
if test -z "$aix_libpath"; then
|
||||
aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
|
||||
}'`
|
||||
fi
|
||||
if test -z "$aix_libpath"; then
|
||||
aix_libpath="/usr/lib:/lib"
|
||||
fi
|
||||
rm -f conftest.c conftest
|
||||
# End _LT_AC_SYS_LIBPATH_AIX.
|
||||
if test "$aix_use_runtimelinking" = yes; then
|
||||
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
|
||||
else
|
||||
if test "$host_cpu" = ia64; then
|
||||
hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
|
||||
else
|
||||
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
amigaos*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
# see comment about different semantics on the GNU ld section
|
||||
ld_shlibs=no
|
||||
;;
|
||||
bsdi4*)
|
||||
;;
|
||||
cygwin* | mingw* | pw32*)
|
||||
# When not using gcc, we currently assume that we are using
|
||||
# Microsoft Visual C++.
|
||||
# hardcode_libdir_flag_spec is actually meaningless, as there is
|
||||
# no search path for DLLs.
|
||||
hardcode_libdir_flag_spec=' '
|
||||
libext=lib
|
||||
;;
|
||||
darwin* | rhapsody*)
|
||||
if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
|
||||
hardcode_direct=no
|
||||
fi
|
||||
;;
|
||||
dgux*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
;;
|
||||
freebsd1*)
|
||||
ld_shlibs=no
|
||||
;;
|
||||
freebsd2.2*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
hardcode_direct=yes
|
||||
;;
|
||||
freebsd2*)
|
||||
hardcode_direct=yes
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
freebsd*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
hardcode_direct=yes
|
||||
;;
|
||||
hpux9*)
|
||||
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
hardcode_direct=yes
|
||||
# hardcode_minus_L: Not really in the search PATH,
|
||||
# but as the default location of the library.
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
hpux10* | hpux11*)
|
||||
if test "$with_gnu_ld" = no; then
|
||||
case "$host_cpu" in
|
||||
hppa*64*)
|
||||
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
hardcode_direct=no
|
||||
;;
|
||||
ia64*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_direct=no
|
||||
# hardcode_minus_L: Not really in the search PATH,
|
||||
# but as the default location of the library.
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
*)
|
||||
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
hardcode_direct=yes
|
||||
# hardcode_minus_L: Not really in the search PATH,
|
||||
# but as the default location of the library.
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
irix5* | irix6* | nonstopux*)
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
netbsd*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
hardcode_direct=yes
|
||||
;;
|
||||
newsos6)
|
||||
hardcode_direct=yes
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
openbsd*)
|
||||
hardcode_direct=yes
|
||||
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
|
||||
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||
else
|
||||
case "$host_os" in
|
||||
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
;;
|
||||
*)
|
||||
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
os2*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
osf3*)
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
osf4* | osf5*)
|
||||
if test "$GCC" = yes; then
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
else
|
||||
# Both cc and cxx compiler support -rpath directly
|
||||
hardcode_libdir_flag_spec='-rpath $libdir'
|
||||
fi
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
sco3.2v5*)
|
||||
;;
|
||||
solaris*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
;;
|
||||
sunos4*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_direct=yes
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
sysv4)
|
||||
case $host_vendor in
|
||||
sni)
|
||||
hardcode_direct=yes # is this really true???
|
||||
;;
|
||||
siemens)
|
||||
hardcode_direct=no
|
||||
;;
|
||||
motorola)
|
||||
hardcode_direct=no #Motorola manual says yes, but my tests say they lie
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
sysv4.3*)
|
||||
;;
|
||||
sysv4*MP*)
|
||||
if test -d /usr/nec; then
|
||||
ld_shlibs=yes
|
||||
fi
|
||||
;;
|
||||
sysv4.2uw2*)
|
||||
hardcode_direct=yes
|
||||
hardcode_minus_L=no
|
||||
;;
|
||||
sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
|
||||
;;
|
||||
sysv5*)
|
||||
hardcode_libdir_flag_spec=
|
||||
;;
|
||||
uts4*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
;;
|
||||
*)
|
||||
ld_shlibs=no
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Check dynamic linker characteristics
|
||||
# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
|
||||
libname_spec='lib$name'
|
||||
case "$host_os" in
|
||||
aix3*)
|
||||
;;
|
||||
aix4* | aix5*)
|
||||
;;
|
||||
amigaos*)
|
||||
;;
|
||||
beos*)
|
||||
;;
|
||||
bsdi4*)
|
||||
;;
|
||||
cygwin* | mingw* | pw32*)
|
||||
shrext=.dll
|
||||
;;
|
||||
darwin* | rhapsody*)
|
||||
shrext=.dylib
|
||||
;;
|
||||
dgux*)
|
||||
;;
|
||||
freebsd1*)
|
||||
;;
|
||||
freebsd*)
|
||||
;;
|
||||
gnu*)
|
||||
;;
|
||||
hpux9* | hpux10* | hpux11*)
|
||||
case "$host_cpu" in
|
||||
ia64*)
|
||||
shrext=.so
|
||||
;;
|
||||
hppa*64*)
|
||||
shrext=.sl
|
||||
;;
|
||||
*)
|
||||
shrext=.sl
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
irix5* | irix6* | nonstopux*)
|
||||
case "$host_os" in
|
||||
irix5* | nonstopux*)
|
||||
libsuff= shlibsuff=
|
||||
;;
|
||||
*)
|
||||
case $LD in
|
||||
*-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
|
||||
*-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
|
||||
*-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
|
||||
*) libsuff= shlibsuff= ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
linux*oldld* | linux*aout* | linux*coff*)
|
||||
;;
|
||||
linux*)
|
||||
;;
|
||||
netbsd*)
|
||||
;;
|
||||
newsos6)
|
||||
;;
|
||||
nto-qnx)
|
||||
;;
|
||||
openbsd*)
|
||||
;;
|
||||
os2*)
|
||||
libname_spec='$name'
|
||||
shrext=.dll
|
||||
;;
|
||||
osf3* | osf4* | osf5*)
|
||||
;;
|
||||
sco3.2v5*)
|
||||
;;
|
||||
solaris*)
|
||||
;;
|
||||
sunos4*)
|
||||
;;
|
||||
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
|
||||
;;
|
||||
sysv4*MP*)
|
||||
;;
|
||||
uts4*)
|
||||
;;
|
||||
esac
|
||||
|
||||
sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
|
||||
escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
|
||||
escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
|
||||
sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
|
||||
|
||||
# How to pass a linker flag through the compiler.
|
||||
wl="$escaped_wl"
|
||||
|
||||
# Static library suffix (normally "a").
|
||||
libext="$libext"
|
||||
|
||||
# Shared library suffix (normally "so").
|
||||
shlibext="$shlibext"
|
||||
|
||||
# Flag to hardcode \$libdir into a binary during linking.
|
||||
# This must work even if \$libdir does not exist.
|
||||
hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
|
||||
|
||||
# Whether we need a single -rpath flag with a separated argument.
|
||||
hardcode_libdir_separator="$hardcode_libdir_separator"
|
||||
|
||||
# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
|
||||
# resulting binary.
|
||||
hardcode_direct="$hardcode_direct"
|
||||
|
||||
# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
|
||||
# resulting binary.
|
||||
hardcode_minus_L="$hardcode_minus_L"
|
||||
|
||||
EOF
|
||||
1579
external/bsd/flex/dist/config.sub
vendored
Executable file
1579
external/bsd/flex/dist/config.sub
vendored
Executable file
File diff suppressed because it is too large
Load Diff
11131
external/bsd/flex/dist/configure
vendored
Executable file
11131
external/bsd/flex/dist/configure
vendored
Executable file
File diff suppressed because it is too large
Load Diff
173
external/bsd/flex/dist/configure.in
vendored
Normal file
173
external/bsd/flex/dist/configure.in
vendored
Normal file
@@ -0,0 +1,173 @@
|
||||
# -*- Autoconf -*-
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
# 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.
|
||||
|
||||
# autoconf requirements and initialization
|
||||
|
||||
AC_PREREQ(2.59)
|
||||
AC_INIT([the fast lexical analyser generator], [2.5.35],
|
||||
[flex-help@lists.sourceforge.net], [flex])
|
||||
AC_CONFIG_SRCDIR([scan.l])
|
||||
AM_INIT_AUTOMAKE([gnits dist-bzip2])
|
||||
AC_CONFIG_HEADER([config.h:conf.in])
|
||||
|
||||
# checks for programs
|
||||
|
||||
AM_GNU_GETTEXT([external])
|
||||
AM_GNU_GETTEXT_VERSION(0.12)
|
||||
|
||||
AC_PROG_YACC
|
||||
AM_PROG_LEX
|
||||
AC_PROG_CC
|
||||
AC_PROG_CXX
|
||||
AC_PROG_LN_S
|
||||
AC_PROG_RANLIB
|
||||
AC_PROG_AWK
|
||||
AC_PROG_INSTALL
|
||||
|
||||
AC_PATH_PROG(BISON, bison,bison)
|
||||
AC_PATH_PROG(HELP2MAN, help2man, help2man)
|
||||
|
||||
# Check for a GNU m4 that supports --prefix-builtins
|
||||
|
||||
AC_PATH_PROGS(M4, gm4 gnum4 m4, m4)
|
||||
|
||||
if test x"$M4" != x; then
|
||||
AC_MSG_CHECKING([for GNU m4])
|
||||
case `$M4 --help < /dev/null 2>&1` in
|
||||
*prefix-builtins*) AC_MSG_RESULT(yes) ;;
|
||||
*) AC_MSG_RESULT(no) ;
|
||||
AC_MSG_ERROR([GNU M4 1.4 is required]) ;;
|
||||
esac
|
||||
else
|
||||
AC_MSG_ERROR([GNU M4 1.4 is required]) ;
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED([M4], ["$M4"], [Define to the GNU 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
|
||||
|
||||
# checks for libraries
|
||||
|
||||
AC_FUNC_ALLOCA
|
||||
AC_HEADER_STDC
|
||||
AC_HEADER_SYS_WAIT
|
||||
AC_CHECK_HEADERS([inttypes.h libintl.h limits.h locale.h malloc.h netinet/in.h stddef.h stdlib.h string.h strings.h unistd.h])
|
||||
AC_CHECK_LIB(m, log10)
|
||||
|
||||
# The test test-pthread uses libpthread, so we check for it here, but
|
||||
# all we need is the preprocessor symbol defined since we don't need
|
||||
# LIBS to include libpthread for building flex.
|
||||
|
||||
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])
|
||||
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
|
||||
AC_HEADER_STDBOOL
|
||||
AC_C_CONST
|
||||
AC_TYPE_SIZE_T
|
||||
|
||||
# Checks for library functions.
|
||||
|
||||
AC_FUNC_FORK
|
||||
AC_FUNC_MALLOC
|
||||
AC_FUNC_REALLOC
|
||||
AC_CHECK_FUNCS([dup2 isascii memset pow regcomp setlocale strchr strtol])
|
||||
|
||||
AC_CONFIG_FILES(
|
||||
Makefile
|
||||
doc/Makefile
|
||||
examples/Makefile
|
||||
examples/fastwc/Makefile
|
||||
examples/manual/Makefile
|
||||
m4/Makefile
|
||||
po/Makefile.in
|
||||
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-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
|
||||
530
external/bsd/flex/dist/depcomp
vendored
Executable file
530
external/bsd/flex/dist/depcomp
vendored
Executable file
@@ -0,0 +1,530 @@
|
||||
#! /bin/sh
|
||||
# depcomp - compile a program generating dependencies as side-effects
|
||||
|
||||
scriptversion=2005-07-09.11
|
||||
|
||||
# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
|
||||
|
||||
Run PROGRAMS ARGS to compile a file, generating dependencies
|
||||
as side-effects.
|
||||
|
||||
Environment variables:
|
||||
depmode Dependency tracking mode.
|
||||
source Source file read by `PROGRAMS ARGS'.
|
||||
object Object file output by `PROGRAMS ARGS'.
|
||||
DEPDIR directory where to store dependencies.
|
||||
depfile Dependency file to output.
|
||||
tmpdepfile Temporary file to use when outputing dependencies.
|
||||
libtool Whether libtool is used (yes/no).
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "depcomp $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
esac
|
||||
|
||||
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
|
||||
echo "depcomp: Variables source, object and depmode must be set" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
|
||||
depfile=${depfile-`echo "$object" |
|
||||
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
|
||||
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
|
||||
|
||||
rm -f "$tmpdepfile"
|
||||
|
||||
# Some modes work just like other modes, but use different flags. We
|
||||
# parameterize here, but still list the modes in the big case below,
|
||||
# to make depend.m4 easier to write. Note that we *cannot* use a case
|
||||
# here, because this file can only contain one case statement.
|
||||
if test "$depmode" = hp; then
|
||||
# HP compiler uses -M and no extra arg.
|
||||
gccflag=-M
|
||||
depmode=gcc
|
||||
fi
|
||||
|
||||
if test "$depmode" = dashXmstdout; then
|
||||
# This is just like dashmstdout with a different argument.
|
||||
dashmflag=-xM
|
||||
depmode=dashmstdout
|
||||
fi
|
||||
|
||||
case "$depmode" in
|
||||
gcc3)
|
||||
## gcc 3 implements dependency tracking that does exactly what
|
||||
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
|
||||
## it if -MD -MP comes after the -MF stuff. Hmm.
|
||||
"$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
mv "$tmpdepfile" "$depfile"
|
||||
;;
|
||||
|
||||
gcc)
|
||||
## There are various ways to get dependency output from gcc. Here's
|
||||
## why we pick this rather obscure method:
|
||||
## - Don't want to use -MD because we'd like the dependencies to end
|
||||
## up in a subdir. Having to rename by hand is ugly.
|
||||
## (We might end up doing this anyway to support other compilers.)
|
||||
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
|
||||
## -MM, not -M (despite what the docs say).
|
||||
## - Using -M directly means running the compiler twice (even worse
|
||||
## than renaming).
|
||||
if test -z "$gccflag"; then
|
||||
gccflag=-MD,
|
||||
fi
|
||||
"$@" -Wp,"$gccflag$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
|
||||
## The second -e expression handles DOS-style file names with drive letters.
|
||||
sed -e 's/^[^:]*: / /' \
|
||||
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
|
||||
## This next piece of magic avoids the `deleted header file' problem.
|
||||
## The problem is that when a header file which appears in a .P file
|
||||
## is deleted, the dependency causes make to die (because there is
|
||||
## typically no way to rebuild the header). We avoid this by adding
|
||||
## dummy dependencies for each header file. Too bad gcc doesn't do
|
||||
## this for us directly.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" |
|
||||
## Some versions of gcc put a space before the `:'. On the theory
|
||||
## that the space means something, we add a space to the output as
|
||||
## well.
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
hp)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
sgi)
|
||||
if test "$libtool" = yes; then
|
||||
"$@" "-Wp,-MDupdate,$tmpdepfile"
|
||||
else
|
||||
"$@" -MDupdate "$tmpdepfile"
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
|
||||
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
|
||||
echo "$object : \\" > "$depfile"
|
||||
|
||||
# Clip off the initial element (the dependent). Don't try to be
|
||||
# clever and replace this with sed code, as IRIX sed won't handle
|
||||
# lines with more than a fixed number of characters (4096 in
|
||||
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
|
||||
# the IRIX cc adds comments like `#:fec' to the end of the
|
||||
# dependency line.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
|
||||
tr '
|
||||
' ' ' >> $depfile
|
||||
echo >> $depfile
|
||||
|
||||
# The second pass generates a dummy entry for each header file.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
|
||||
>> $depfile
|
||||
else
|
||||
# The sourcefile does not contain any dependencies, so just
|
||||
# store a dummy comment line, to avoid errors with the Makefile
|
||||
# "include basename.Plo" scheme.
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
aix)
|
||||
# The C for AIX Compiler uses -M and outputs the dependencies
|
||||
# in a .u file. In older versions, this file always lives in the
|
||||
# current directory. Also, the AIX compiler puts `$object:' at the
|
||||
# start of each line; $object doesn't have directory information.
|
||||
# Version 6 uses the directory in both cases.
|
||||
stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
|
||||
tmpdepfile="$stripped.u"
|
||||
if test "$libtool" = yes; then
|
||||
"$@" -Wc,-M
|
||||
else
|
||||
"$@" -M
|
||||
fi
|
||||
stat=$?
|
||||
|
||||
if test -f "$tmpdepfile"; then :
|
||||
else
|
||||
stripped=`echo "$stripped" | sed 's,^.*/,,'`
|
||||
tmpdepfile="$stripped.u"
|
||||
fi
|
||||
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
if test -f "$tmpdepfile"; then
|
||||
outname="$stripped.o"
|
||||
# Each line is of the form `foo.o: dependent.h'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
# The sourcefile does not contain any dependencies, so just
|
||||
# store a dummy comment line, to avoid errors with the Makefile
|
||||
# "include basename.Plo" scheme.
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
icc)
|
||||
# Intel's C compiler understands `-MD -MF file'. However on
|
||||
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
|
||||
# ICC 7.0 will fill foo.d with something like
|
||||
# foo.o: sub/foo.c
|
||||
# foo.o: sub/foo.h
|
||||
# which is wrong. We want:
|
||||
# sub/foo.o: sub/foo.c
|
||||
# sub/foo.o: sub/foo.h
|
||||
# sub/foo.c:
|
||||
# sub/foo.h:
|
||||
# ICC 7.1 will output
|
||||
# foo.o: sub/foo.c sub/foo.h
|
||||
# and will wrap long lines using \ :
|
||||
# foo.o: sub/foo.c ... \
|
||||
# sub/foo.h ... \
|
||||
# ...
|
||||
|
||||
"$@" -MD -MF "$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
# Each line is of the form `foo.o: dependent.h',
|
||||
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
|
||||
sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
tru64)
|
||||
# The Tru64 compiler uses -MD to generate dependencies as a side
|
||||
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
|
||||
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
|
||||
# dependencies in `foo.d' instead, so we check for that too.
|
||||
# Subdirectories are respected.
|
||||
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||
test "x$dir" = "x$object" && dir=
|
||||
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||
|
||||
if test "$libtool" = yes; then
|
||||
# With Tru64 cc, shared objects can also be used to make a
|
||||
# static library. This mecanism is used in libtool 1.4 series to
|
||||
# handle both shared and static libraries in a single compilation.
|
||||
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
|
||||
#
|
||||
# With libtool 1.5 this exception was removed, and libtool now
|
||||
# generates 2 separate objects for the 2 libraries. These two
|
||||
# compilations output dependencies in in $dir.libs/$base.o.d and
|
||||
# in $dir$base.o.d. We have to check for both files, because
|
||||
# one of the two compilations can be disabled. We should prefer
|
||||
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
|
||||
# automatically cleaned when .libs/ is deleted, while ignoring
|
||||
# the former would cause a distcleancheck panic.
|
||||
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
|
||||
tmpdepfile2=$dir$base.o.d # libtool 1.5
|
||||
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
|
||||
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
|
||||
"$@" -Wc,-MD
|
||||
else
|
||||
tmpdepfile1=$dir$base.o.d
|
||||
tmpdepfile2=$dir$base.d
|
||||
tmpdepfile3=$dir$base.d
|
||||
tmpdepfile4=$dir$base.d
|
||||
"$@" -MD
|
||||
fi
|
||||
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
if test -f "$tmpdepfile"; then
|
||||
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
|
||||
# That's a tab and a space in the [].
|
||||
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
#nosideeffect)
|
||||
# This comment above is used by automake to tell side-effect
|
||||
# dependency tracking mechanisms from slower ones.
|
||||
|
||||
dashmstdout)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout, regardless of -o.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove `-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
test -z "$dashmflag" && dashmflag=-M
|
||||
# Require at least two characters before searching for `:'
|
||||
# in the target name. This is to cope with DOS-style filenames:
|
||||
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
|
||||
"$@" $dashmflag |
|
||||
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
dashXmstdout)
|
||||
# This case only exists to satisfy depend.m4. It is never actually
|
||||
# run, as this mode is specially recognized in the preamble.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
makedepend)
|
||||
"$@" || exit $?
|
||||
# Remove any Libtool call
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
# X makedepend
|
||||
shift
|
||||
cleared=no
|
||||
for arg in "$@"; do
|
||||
case $cleared in
|
||||
no)
|
||||
set ""; shift
|
||||
cleared=yes ;;
|
||||
esac
|
||||
case "$arg" in
|
||||
-D*|-I*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
# Strip any option that makedepend may not understand. Remove
|
||||
# the object too, otherwise makedepend will parse it as a source file.
|
||||
-*|$object)
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
esac
|
||||
done
|
||||
obj_suffix="`echo $object | sed 's/^.*\././'`"
|
||||
touch "$tmpdepfile"
|
||||
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
sed '1,2d' "$tmpdepfile" | tr ' ' '
|
||||
' | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile" "$tmpdepfile".bak
|
||||
;;
|
||||
|
||||
cpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove `-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
"$@" -E |
|
||||
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
||||
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
|
||||
sed '$ s: \\$::' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
cat < "$tmpdepfile" >> "$depfile"
|
||||
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvisualcpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout, regardless of -o,
|
||||
# because we must use -o when running libtool.
|
||||
"$@" || exit $?
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case "$arg" in
|
||||
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
|
||||
set fnord "$@"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
"$@" -E |
|
||||
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
|
||||
echo " " >> "$depfile"
|
||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
none)
|
||||
exec "$@"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unknown depmode $depmode" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
||||
1101
external/bsd/flex/dist/dfa.c
vendored
Normal file
1101
external/bsd/flex/dist/dfa.c
vendored
Normal file
File diff suppressed because it is too large
Load Diff
16
external/bsd/flex/dist/doc/Makefile.am
vendored
Normal file
16
external/bsd/flex/dist/doc/Makefile.am
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
help2man = @HELP2MAN@
|
||||
|
||||
info_TEXINFOS = flex.texi
|
||||
dist_man_MANS = flex.1
|
||||
EXTRA_DIST = flex.pdf
|
||||
|
||||
CLEANFILES = \
|
||||
flex.hks \
|
||||
flex.ops
|
||||
|
||||
$(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
|
||||
560
external/bsd/flex/dist/doc/Makefile.in
vendored
Normal file
560
external/bsd/flex/dist/doc/Makefile.in
vendored
Normal file
@@ -0,0 +1,560 @@
|
||||
# Makefile.in generated by automake 1.9.6 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = ..
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = @INSTALL@
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = doc
|
||||
DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in $(srcdir)/stamp-vti \
|
||||
$(srcdir)/version.texi mdate-sh texinfo.tex
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
|
||||
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
|
||||
$(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
|
||||
$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
|
||||
$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.in
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
INFO_DEPS = $(srcdir)/flex.info
|
||||
am__TEXINFO_TEX_DIR = $(srcdir)
|
||||
DVIS = flex.dvi
|
||||
PDFS = flex.pdf
|
||||
PSS = flex.ps
|
||||
HTMLS = flex.html
|
||||
TEXINFOS = flex.texi
|
||||
TEXI2DVI = texi2dvi
|
||||
TEXI2PDF = $(TEXI2DVI) --pdf --batch
|
||||
MAKEINFOHTML = $(MAKEINFO) --html
|
||||
AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS)
|
||||
DVIPS = dvips
|
||||
am__installdirs = "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)"
|
||||
man1dir = $(mandir)/man1
|
||||
NROFF = nroff
|
||||
MANS = $(dist_man_MANS)
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ALLOCA = @ALLOCA@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
AMTAR = @AMTAR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
BISON = @BISON@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
HELP2MAN = @HELP2MAN@
|
||||
INDENT = @INDENT@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
INTLLIBS = @INTLLIBS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LEX = @LEX@
|
||||
LEXLIB = @LEXLIB@
|
||||
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
|
||||
LIBICONV = @LIBICONV@
|
||||
LIBINTL = @LIBINTL@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LN_S = @LN_S@
|
||||
LTLIBICONV = @LTLIBICONV@
|
||||
LTLIBINTL = @LTLIBINTL@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
M4 = @M4@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKINSTALLDIRS = @MKINSTALLDIRS@
|
||||
MSGFMT = @MSGFMT@
|
||||
MSGMERGE = @MSGMERGE@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
POSUB = @POSUB@
|
||||
RANLIB = @RANLIB@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
USE_NLS = @USE_NLS@
|
||||
VERSION = @VERSION@
|
||||
XGETTEXT = @XGETTEXT@
|
||||
YACC = @YACC@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
datadir = @datadir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
help2man = @HELP2MAN@
|
||||
info_TEXINFOS = flex.texi
|
||||
dist_man_MANS = flex.1
|
||||
EXTRA_DIST = flex.pdf
|
||||
CLEANFILES = \
|
||||
flex.hks \
|
||||
flex.ops
|
||||
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .dvi .html .info .pdf .ps .texi
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits doc/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnits doc/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
.texi.info:
|
||||
restore=: && backupdir="$(am__leading_dot)am$$$$" && \
|
||||
am__cwd=`pwd` && cd $(srcdir) && \
|
||||
rm -rf $$backupdir && mkdir $$backupdir && \
|
||||
if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
|
||||
for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \
|
||||
if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \
|
||||
done; \
|
||||
else :; fi && \
|
||||
cd "$$am__cwd"; \
|
||||
if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
|
||||
-o $@ $<; \
|
||||
then \
|
||||
rc=0; \
|
||||
cd $(srcdir); \
|
||||
else \
|
||||
rc=$$?; \
|
||||
cd $(srcdir) && \
|
||||
$$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
|
||||
fi; \
|
||||
rm -rf $$backupdir; exit $$rc
|
||||
|
||||
.texi.dvi:
|
||||
TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
|
||||
MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
|
||||
$(TEXI2DVI) $<
|
||||
|
||||
.texi.pdf:
|
||||
TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
|
||||
MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
|
||||
$(TEXI2PDF) $<
|
||||
|
||||
.texi.html:
|
||||
rm -rf $(@:.html=.htp)
|
||||
if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
|
||||
-o $(@:.html=.htp) $<; \
|
||||
then \
|
||||
rm -rf $@; \
|
||||
if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \
|
||||
mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \
|
||||
else \
|
||||
if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \
|
||||
rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \
|
||||
exit 1; \
|
||||
fi
|
||||
$(srcdir)/flex.info: flex.texi $(srcdir)/version.texi
|
||||
flex.dvi: flex.texi $(srcdir)/version.texi
|
||||
flex.pdf: flex.texi $(srcdir)/version.texi
|
||||
flex.html: flex.texi $(srcdir)/version.texi
|
||||
$(srcdir)/version.texi: $(srcdir)/stamp-vti
|
||||
$(srcdir)/stamp-vti: flex.texi $(top_srcdir)/configure
|
||||
@(dir=.; test -f ./flex.texi || dir=$(srcdir); \
|
||||
set `$(SHELL) $(srcdir)/mdate-sh $$dir/flex.texi`; \
|
||||
echo "@set UPDATED $$1 $$2 $$3"; \
|
||||
echo "@set UPDATED-MONTH $$2 $$3"; \
|
||||
echo "@set EDITION $(VERSION)"; \
|
||||
echo "@set VERSION $(VERSION)") > vti.tmp
|
||||
@cmp -s vti.tmp $(srcdir)/version.texi \
|
||||
|| (echo "Updating $(srcdir)/version.texi"; \
|
||||
cp vti.tmp $(srcdir)/version.texi)
|
||||
-@rm -f vti.tmp
|
||||
@cp $(srcdir)/version.texi $@
|
||||
|
||||
mostlyclean-vti:
|
||||
-rm -f vti.tmp
|
||||
|
||||
maintainer-clean-vti:
|
||||
-rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi
|
||||
.dvi.ps:
|
||||
TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
|
||||
$(DVIPS) -o $@ $<
|
||||
|
||||
uninstall-info-am:
|
||||
@$(PRE_UNINSTALL)
|
||||
@if (install-info --version && \
|
||||
install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
|
||||
list='$(INFO_DEPS)'; \
|
||||
for file in $$list; do \
|
||||
relfile=`echo "$$file" | sed 's|^.*/||'`; \
|
||||
echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \
|
||||
install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \
|
||||
done; \
|
||||
else :; fi
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(INFO_DEPS)'; \
|
||||
for file in $$list; do \
|
||||
relfile=`echo "$$file" | sed 's|^.*/||'`; \
|
||||
relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \
|
||||
(if cd "$(DESTDIR)$(infodir)"; then \
|
||||
echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \
|
||||
rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \
|
||||
else :; fi); \
|
||||
done
|
||||
|
||||
dist-info: $(INFO_DEPS)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(INFO_DEPS)'; \
|
||||
for base in $$list; do \
|
||||
case $$base in \
|
||||
$(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
esac; \
|
||||
if test -f $$base; then d=.; else d=$(srcdir); fi; \
|
||||
for file in $$d/$$base*; do \
|
||||
relfile=`expr "$$file" : "$$d/\(.*\)"`; \
|
||||
test -f $(distdir)/$$relfile || \
|
||||
cp -p $$file $(distdir)/$$relfile; \
|
||||
done; \
|
||||
done
|
||||
|
||||
mostlyclean-aminfo:
|
||||
-rm -rf flex.aux flex.cp flex.cps flex.fn flex.fns flex.hk flex.hks flex.ky \
|
||||
flex.kys flex.log flex.op flex.ops flex.pg flex.pgs flex.tmp \
|
||||
flex.toc flex.tp flex.tps flex.vr flex.vrs flex.dvi flex.pdf \
|
||||
flex.ps flex.html
|
||||
|
||||
maintainer-clean-aminfo:
|
||||
@list='$(INFO_DEPS)'; for i in $$list; do \
|
||||
i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \
|
||||
echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \
|
||||
rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \
|
||||
done
|
||||
install-man1: $(man1_MANS) $(man_MANS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)"
|
||||
@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
|
||||
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
|
||||
for i in $$l2; do \
|
||||
case "$$i" in \
|
||||
*.1*) list="$$list $$i" ;; \
|
||||
esac; \
|
||||
done; \
|
||||
for i in $$list; do \
|
||||
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
|
||||
else file=$$i; fi; \
|
||||
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
|
||||
case "$$ext" in \
|
||||
1*) ;; \
|
||||
*) ext='1' ;; \
|
||||
esac; \
|
||||
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
|
||||
inst=`echo $$inst | sed -e 's/^.*\///'`; \
|
||||
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
|
||||
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
|
||||
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \
|
||||
done
|
||||
uninstall-man1:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
|
||||
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
|
||||
for i in $$l2; do \
|
||||
case "$$i" in \
|
||||
*.1*) list="$$list $$i" ;; \
|
||||
esac; \
|
||||
done; \
|
||||
for i in $$list; do \
|
||||
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
|
||||
case "$$ext" in \
|
||||
1*) ;; \
|
||||
*) ext='1' ;; \
|
||||
esac; \
|
||||
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
|
||||
inst=`echo $$inst | sed -e 's/^.*\///'`; \
|
||||
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
|
||||
echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \
|
||||
rm -f "$(DESTDIR)$(man1dir)/$$inst"; \
|
||||
done
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
|
||||
ctags: CTAGS
|
||||
CTAGS:
|
||||
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkdir_p) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$(top_distdir)" distdir="$(distdir)" \
|
||||
dist-info
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(INFO_DEPS) $(MANS)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)"; do \
|
||||
test -z "$$dir" || $(mkdir_p) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am: $(DVIS)
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am: $(HTMLS)
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am: $(INFO_DEPS)
|
||||
|
||||
install-data-am: install-info-am install-man
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am: $(INFO_DEPS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(infodir)" || $(mkdir_p) "$(DESTDIR)$(infodir)"
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(INFO_DEPS)'; \
|
||||
for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
esac; \
|
||||
if test -f $$file; then d=.; else d=$(srcdir); fi; \
|
||||
file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \
|
||||
for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \
|
||||
$$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \
|
||||
if test -f $$ifile; then \
|
||||
relfile=`echo "$$ifile" | sed 's|^.*/||'`; \
|
||||
echo " $(INSTALL_DATA) '$$ifile' '$(DESTDIR)$(infodir)/$$relfile'"; \
|
||||
$(INSTALL_DATA) "$$ifile" "$(DESTDIR)$(infodir)/$$relfile"; \
|
||||
else : ; fi; \
|
||||
done; \
|
||||
done
|
||||
@$(POST_INSTALL)
|
||||
@if (install-info --version && \
|
||||
install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
|
||||
list='$(INFO_DEPS)'; \
|
||||
for file in $$list; do \
|
||||
relfile=`echo "$$file" | sed 's|^.*/||'`; \
|
||||
echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\
|
||||
install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\
|
||||
done; \
|
||||
else : ; fi
|
||||
install-man: install-man1
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-aminfo \
|
||||
maintainer-clean-generic maintainer-clean-vti
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-aminfo mostlyclean-generic mostlyclean-vti
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am: $(PDFS)
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am: $(PSS)
|
||||
|
||||
uninstall-am: uninstall-info-am uninstall-man
|
||||
|
||||
uninstall-man: uninstall-man1
|
||||
|
||||
.PHONY: all all-am check check-am clean clean-generic dist-info \
|
||||
distclean distclean-generic distdir dvi dvi-am html html-am \
|
||||
info info-am install install-am install-data install-data-am \
|
||||
install-exec install-exec-am install-info install-info-am \
|
||||
install-man install-man1 install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-aminfo maintainer-clean-generic \
|
||||
maintainer-clean-vti mostlyclean mostlyclean-aminfo \
|
||||
mostlyclean-generic mostlyclean-vti pdf pdf-am ps ps-am \
|
||||
uninstall uninstall-am uninstall-info-am uninstall-man \
|
||||
uninstall-man1
|
||||
|
||||
|
||||
$(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
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
167
external/bsd/flex/dist/doc/flex.1
vendored
Normal file
167
external/bsd/flex/dist/doc/flex.1
vendored
Normal file
@@ -0,0 +1,167 @@
|
||||
.\" $NetBSD: flex.1,v 1.1.1.1 2009/10/26 00:27:06 christos Exp $
|
||||
.\"
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36.
|
||||
.TH FLEX "1" "February 2008" "flex 2.5.35" "User Commands"
|
||||
.SH NAME
|
||||
flex \- the fast lexical analyser generator
|
||||
.SH SYNOPSIS
|
||||
.B flex
|
||||
[\fIOPTIONS\fR] [\fIFILE\fR]...
|
||||
.SH DESCRIPTION
|
||||
Generates programs that perform pattern\-matching on text.
|
||||
.SS "Table Compression:"
|
||||
.TP
|
||||
\fB\-Ca\fR, \fB\-\-align\fR
|
||||
trade off larger tables for better memory alignment
|
||||
.TP
|
||||
\fB\-Ce\fR, \fB\-\-ecs\fR
|
||||
construct equivalence classes
|
||||
.TP
|
||||
\fB\-Cf\fR
|
||||
do not compress tables; use \fB\-f\fR representation
|
||||
.TP
|
||||
\fB\-CF\fR
|
||||
do not compress tables; use \fB\-F\fR representation
|
||||
.TP
|
||||
\fB\-Cm\fR, \fB\-\-meta\-ecs\fR
|
||||
construct meta\-equivalence classes
|
||||
.TP
|
||||
\fB\-Cr\fR, \fB\-\-read\fR
|
||||
use read() instead of stdio for scanner input
|
||||
.TP
|
||||
\fB\-f\fR, \fB\-\-full\fR
|
||||
generate fast, large scanner. Same as \fB\-Cfr\fR
|
||||
.TP
|
||||
\fB\-F\fR, \fB\-\-fast\fR
|
||||
use alternate table representation. Same as \fB\-CFr\fR
|
||||
.TP
|
||||
\fB\-Cem\fR
|
||||
default compression (same as \fB\-\-ecs\fR \fB\-\-meta\-ecs\fR)
|
||||
.SS "Debugging:"
|
||||
.TP
|
||||
\fB\-d\fR, \fB\-\-debug\fR
|
||||
enable debug mode in scanner
|
||||
.TP
|
||||
\fB\-b\fR, \fB\-\-backup\fR
|
||||
write backing\-up information to lex.backup
|
||||
.TP
|
||||
\fB\-p\fR, \fB\-\-perf\-report\fR
|
||||
write performance report to stderr
|
||||
.TP
|
||||
\fB\-s\fR, \fB\-\-nodefault\fR
|
||||
suppress default rule to ECHO unmatched text
|
||||
.TP
|
||||
\fB\-T\fR, \fB\-\-trace\fR
|
||||
flex should run in trace mode
|
||||
.TP
|
||||
\fB\-w\fR, \fB\-\-nowarn\fR
|
||||
do not generate warnings
|
||||
.TP
|
||||
\fB\-v\fR, \fB\-\-verbose\fR
|
||||
write summary of scanner statistics to stdout
|
||||
.SS "Files:"
|
||||
.TP
|
||||
\fB\-o\fR, \fB\-\-outfile\fR=\fIFILE\fR
|
||||
specify output filename
|
||||
.TP
|
||||
\fB\-S\fR, \fB\-\-skel\fR=\fIFILE\fR
|
||||
specify skeleton file
|
||||
.TP
|
||||
\fB\-t\fR, \fB\-\-stdout\fR
|
||||
write scanner on stdout instead of lex.yy.c
|
||||
.TP
|
||||
\fB\-\-yyclass\fR=\fINAME\fR
|
||||
name of C++ class
|
||||
.TP
|
||||
\fB\-\-header\-file\fR=\fIFILE\fR
|
||||
create a C header file in addition to the scanner
|
||||
.HP
|
||||
\fB\-\-tables\-file\fR[=\fIFILE\fR] write tables to FILE
|
||||
.SS "Scanner behavior:"
|
||||
.TP
|
||||
\fB\-7\fR, \fB\-\-7bit\fR
|
||||
generate 7\-bit scanner
|
||||
.TP
|
||||
\fB\-8\fR, \fB\-\-8bit\fR
|
||||
generate 8\-bit scanner
|
||||
.TP
|
||||
\fB\-B\fR, \fB\-\-batch\fR
|
||||
generate batch scanner (opposite of \fB\-I\fR)
|
||||
.TP
|
||||
\fB\-i\fR, \fB\-\-case\-insensitive\fR
|
||||
ignore case in patterns
|
||||
.TP
|
||||
\fB\-l\fR, \fB\-\-lex\-compat\fR
|
||||
maximal compatibility with original lex
|
||||
.TP
|
||||
\fB\-X\fR, \fB\-\-posix\-compat\fR
|
||||
maximal compatibility with POSIX lex
|
||||
.TP
|
||||
\fB\-I\fR, \fB\-\-interactive\fR
|
||||
generate interactive scanner (opposite of \fB\-B\fR)
|
||||
.TP
|
||||
\fB\-\-yylineno\fR
|
||||
track line count in yylineno
|
||||
.SS "Generated code:"
|
||||
.TP
|
||||
\-+, \fB\-\-c\fR++
|
||||
generate C++ scanner class
|
||||
.TP
|
||||
\fB\-Dmacro\fR[=\fIdefn\fR]
|
||||
#define macro defn (default defn is '1')
|
||||
.TP
|
||||
\fB\-L\fR, \fB\-\-noline\fR
|
||||
suppress #line directives in scanner
|
||||
.TP
|
||||
\fB\-P\fR, \fB\-\-prefix\fR=\fISTRING\fR
|
||||
use STRING as prefix instead of "yy"
|
||||
.TP
|
||||
\fB\-R\fR, \fB\-\-reentrant\fR
|
||||
generate a reentrant C scanner
|
||||
.TP
|
||||
\fB\-\-bison\-bridge\fR
|
||||
scanner for bison pure parser.
|
||||
.TP
|
||||
\fB\-\-bison\-locations\fR
|
||||
include yylloc support.
|
||||
.TP
|
||||
\fB\-\-stdinit\fR
|
||||
initialize yyin/yyout to stdin/stdout
|
||||
.HP
|
||||
\fB\-\-noansi\-definitions\fR old\-style function definitions
|
||||
.TP
|
||||
\fB\-\-noansi\-prototypes\fR
|
||||
empty parameter list in prototypes
|
||||
.TP
|
||||
\fB\-\-nounistd\fR
|
||||
do not include <unistd.h>
|
||||
.TP
|
||||
\fB\-\-noFUNCTION\fR
|
||||
do not generate a particular FUNCTION
|
||||
.SS "Miscellaneous:"
|
||||
.TP
|
||||
\fB\-c\fR
|
||||
do\-nothing POSIX option
|
||||
.TP
|
||||
\fB\-n\fR
|
||||
do\-nothing POSIX option
|
||||
.HP
|
||||
\-?
|
||||
.TP
|
||||
\fB\-h\fR, \fB\-\-help\fR
|
||||
produce this help message
|
||||
.TP
|
||||
\fB\-V\fR, \fB\-\-version\fR
|
||||
report flex version
|
||||
.SH "SEE ALSO"
|
||||
The full documentation for
|
||||
.B flex
|
||||
is maintained as a Texinfo manual. If the
|
||||
.B info
|
||||
and
|
||||
.B flex
|
||||
programs are properly installed at your site, the command
|
||||
.IP
|
||||
.B info flex
|
||||
.PP
|
||||
should give you access to the complete manual.
|
||||
282
external/bsd/flex/dist/doc/flex.info
vendored
Normal file
282
external/bsd/flex/dist/doc/flex.info
vendored
Normal file
@@ -0,0 +1,282 @@
|
||||
This is flex.info, produced by makeinfo version 4.8 from flex.texi.
|
||||
|
||||
INFO-DIR-SECTION Programming
|
||||
START-INFO-DIR-ENTRY
|
||||
* flex: (flex). Fast lexical analyzer generator (lex replacement).
|
||||
END-INFO-DIR-ENTRY
|
||||
|
||||
The flex manual is placed under the same licensing conditions as the
|
||||
rest of flex:
|
||||
|
||||
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 The Flex
|
||||
Project.
|
||||
|
||||
Copyright (C) 1990, 1997 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, 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.
|
||||
|
||||
|
||||
Indirect:
|
||||
flex.info-1: 1620
|
||||
flex.info-2: 287921
|
||||
|
||||
Tag Table:
|
||||
(Indirect)
|
||||
Node: Top1620
|
||||
Node: Copyright7690
|
||||
Node: Reporting Bugs9203
|
||||
Node: Introduction9508
|
||||
Node: Simple Examples10336
|
||||
Node: Format13646
|
||||
Node: Definitions Section14060
|
||||
Ref: Definitions Section-Footnote-116323
|
||||
Node: Rules Section16391
|
||||
Node: User Code Section17549
|
||||
Node: Comments in the Input17987
|
||||
Node: Patterns19355
|
||||
Ref: case and character ranges26186
|
||||
Node: Matching30201
|
||||
Node: Actions33487
|
||||
Node: Generated Scanner42466
|
||||
Node: Start Conditions47484
|
||||
Node: Multiple Input Buffers58043
|
||||
Ref: Scanning Strings64581
|
||||
Node: EOF66211
|
||||
Node: Misc Macros67799
|
||||
Node: User Values70653
|
||||
Node: Yacc72984
|
||||
Node: Scanner Options73880
|
||||
Node: Options for Specifying Filenames76638
|
||||
Ref: option-header76864
|
||||
Ref: option-outfile77576
|
||||
Ref: option-stdout77901
|
||||
Node: Options Affecting Scanner Behavior78883
|
||||
Ref: option-case-insensitive79124
|
||||
Ref: option-lex-compat79557
|
||||
Ref: option-batch80089
|
||||
Ref: option-interactive80613
|
||||
Ref: option-7bit81967
|
||||
Ref: option-8bit83271
|
||||
Ref: option-default83683
|
||||
Ref: option-always-interactive83747
|
||||
Ref: option-posix84351
|
||||
Ref: option-stack85498
|
||||
Ref: option-stdinit85606
|
||||
Ref: option-yylineno86084
|
||||
Ref: option-yywrap86527
|
||||
Node: Code-Level And API Options86795
|
||||
Ref: option-ansi-definitions87022
|
||||
Ref: option-ansi-prototypes87274
|
||||
Ref: option-bison-bridge87521
|
||||
Ref: option-bison-locations87860
|
||||
Ref: option-noline88120
|
||||
Ref: option-reentrant88634
|
||||
Ref: option-c++89245
|
||||
Ref: option-array89371
|
||||
Ref: option-pointer89469
|
||||
Ref: option-prefix89597
|
||||
Ref: option-main91126
|
||||
Ref: option-nounistd91310
|
||||
Ref: option-yyclass91818
|
||||
Node: Options for Scanner Speed and Size92304
|
||||
Ref: option-align92853
|
||||
Ref: option-ecs93354
|
||||
Ref: option-meta-ecs94390
|
||||
Ref: option-read94877
|
||||
Ref: option-full96760
|
||||
Ref: option-fast96955
|
||||
Node: Debugging Options97881
|
||||
Ref: option-backup98068
|
||||
Ref: option-debug98613
|
||||
Ref: option-perf-report99336
|
||||
Ref: option-nodefault99962
|
||||
Ref: option-trace100280
|
||||
Ref: option-nowarn100571
|
||||
Ref: option-verbose100639
|
||||
Ref: option-warn101068
|
||||
Node: Miscellaneous Options101287
|
||||
Node: Performance101744
|
||||
Node: Cxx112008
|
||||
Node: Reentrant119531
|
||||
Node: Reentrant Uses120208
|
||||
Node: Reentrant Overview121771
|
||||
Node: Reentrant Example122570
|
||||
Node: Reentrant Detail123345
|
||||
Node: Specify Reentrant123778
|
||||
Node: Extra Reentrant Argument124425
|
||||
Node: Global Replacement125677
|
||||
Node: Init and Destroy Functions126906
|
||||
Node: Accessor Methods129418
|
||||
Node: Extra Data130762
|
||||
Node: About yyscan_t133029
|
||||
Node: Reentrant Functions133425
|
||||
Ref: bison-functions134909
|
||||
Node: Lex and Posix135650
|
||||
Node: Memory Management143034
|
||||
Ref: memory-management143180
|
||||
Node: The Default Memory Management143408
|
||||
Ref: The Default Memory Management-Footnote-1147217
|
||||
Node: Overriding The Default Memory Management147370
|
||||
Ref: Overriding The Default Memory Management-Footnote-1149769
|
||||
Node: A Note About yytext And Memory149933
|
||||
Node: Serialized Tables151166
|
||||
Ref: serialization151310
|
||||
Node: Creating Serialized Tables152075
|
||||
Node: Loading and Unloading Serialized Tables153685
|
||||
Node: Tables File Format155453
|
||||
Node: Diagnostics162468
|
||||
Node: Limitations165879
|
||||
Node: Bibliography167828
|
||||
Node: FAQ168501
|
||||
Node: When was flex born?172741
|
||||
Node: How do I expand backslash-escape sequences in C-style quoted strings?173118
|
||||
Node: Why do flex scanners call fileno if it is not ANSI compatible?174422
|
||||
Node: Does flex support recursive pattern definitions?175217
|
||||
Node: How do I skip huge chunks of input (tens of megabytes) while using flex?176064
|
||||
Node: Flex is not matching my patterns in the same order that I defined them.176531
|
||||
Node: My actions are executing out of order or sometimes not at all.178277
|
||||
Node: How can I have multiple input sources feed into the same scanner at the same time?179052
|
||||
Node: Can I build nested parsers that work with the same input file?181040
|
||||
Node: How can I match text only at the end of a file?182046
|
||||
Node: How can I make REJECT cascade across start condition boundaries?182851
|
||||
Node: Why cant I use fast or full tables with interactive mode?183866
|
||||
Node: How much faster is -F or -f than -C?185124
|
||||
Node: If I have a simple grammar cant I just parse it with flex?185436
|
||||
Node: Why doesn't yyrestart() set the start state back to INITIAL?185917
|
||||
Node: How can I match C-style comments?186544
|
||||
Node: The period isn't working the way I expected.187358
|
||||
Node: Can I get the flex manual in another format?188605
|
||||
Node: Does there exist a "faster" NDFA->DFA algorithm?189094
|
||||
Node: How does flex compile the DFA so quickly?189604
|
||||
Node: How can I use more than 8192 rules?190571
|
||||
Node: How do I abandon a file in the middle of a scan and switch to a new file?191983
|
||||
Node: How do I execute code only during initialization (only before the first scan)?192536
|
||||
Node: How do I execute code at termination?193314
|
||||
Node: Where else can I find help?193640
|
||||
Node: Can I include comments in the "rules" section of the file?194013
|
||||
Node: I get an error about undefined yywrap().194392
|
||||
Node: How can I change the matching pattern at run time?194869
|
||||
Node: How can I expand macros in the input?195231
|
||||
Node: How can I build a two-pass scanner?196264
|
||||
Node: How do I match any string not matched in the preceding rules?197180
|
||||
Node: I am trying to port code from AT&T lex that uses yysptr and yysbuf.198090
|
||||
Node: Is there a way to make flex treat NULL like a regular character?198885
|
||||
Node: Whenever flex can not match the input it says "flex scanner jammed".199406
|
||||
Node: Why doesn't flex have non-greedy operators like perl does?200050
|
||||
Node: Memory leak - 16386 bytes allocated by malloc.201403
|
||||
Ref: faq-memory-leak201701
|
||||
Node: How do I track the byte offset for lseek()?202669
|
||||
Node: How do I use my own I/O classes in a C++ scanner?204180
|
||||
Node: How do I skip as many chars as possible?205023
|
||||
Node: deleteme00206100
|
||||
Node: Are certain equivalent patterns faster than others?206541
|
||||
Node: Is backing up a big deal?209960
|
||||
Node: Can I fake multi-byte character support?211867
|
||||
Node: deleteme01213309
|
||||
Node: Can you discuss some flex internals?214419
|
||||
Node: unput() messes up yy_at_bol216664
|
||||
Node: The | operator is not doing what I want217767
|
||||
Node: Why can't flex understand this variable trailing context pattern?219314
|
||||
Node: The ^ operator isn't working220564
|
||||
Node: Trailing context is getting confused with trailing optional patterns221800
|
||||
Node: Is flex GNU or not?223044
|
||||
Node: ERASEME53224718
|
||||
Node: I need to scan if-then-else blocks and while loops225489
|
||||
Node: ERASEME55226689
|
||||
Node: ERASEME56227788
|
||||
Node: ERASEME57229147
|
||||
Node: Is there a repository for flex scanners?230146
|
||||
Node: How can I conditionally compile or preprocess my flex input file?230461
|
||||
Node: Where can I find grammars for lex and yacc?230934
|
||||
Node: I get an end-of-buffer message for each character scanned.231281
|
||||
Node: unnamed-faq-62231876
|
||||
Node: unnamed-faq-63232895
|
||||
Node: unnamed-faq-64234193
|
||||
Node: unnamed-faq-65235160
|
||||
Node: unnamed-faq-66235947
|
||||
Node: unnamed-faq-67237063
|
||||
Node: unnamed-faq-68238051
|
||||
Node: unnamed-faq-69239194
|
||||
Node: unnamed-faq-70239908
|
||||
Node: unnamed-faq-71240670
|
||||
Node: unnamed-faq-72241880
|
||||
Node: unnamed-faq-73242924
|
||||
Node: unnamed-faq-74243849
|
||||
Node: unnamed-faq-75244795
|
||||
Node: unnamed-faq-76245928
|
||||
Node: unnamed-faq-77246635
|
||||
Node: unnamed-faq-78247529
|
||||
Node: unnamed-faq-79248528
|
||||
Node: unnamed-faq-80250229
|
||||
Node: unnamed-faq-81251548
|
||||
Node: unnamed-faq-82254349
|
||||
Node: unnamed-faq-83255307
|
||||
Node: unnamed-faq-84257088
|
||||
Node: unnamed-faq-85258192
|
||||
Node: unnamed-faq-86259200
|
||||
Node: unnamed-faq-87260139
|
||||
Node: unnamed-faq-88260786
|
||||
Node: unnamed-faq-90261618
|
||||
Node: unnamed-faq-91262882
|
||||
Node: unnamed-faq-92265311
|
||||
Node: unnamed-faq-93265811
|
||||
Node: unnamed-faq-94266739
|
||||
Node: unnamed-faq-95268152
|
||||
Node: unnamed-faq-96269671
|
||||
Node: unnamed-faq-97270431
|
||||
Node: unnamed-faq-98271099
|
||||
Node: unnamed-faq-99271765
|
||||
Node: unnamed-faq-100272695
|
||||
Node: unnamed-faq-101273406
|
||||
Node: What is the difference between YYLEX_PARAM and YY_DECL?274220
|
||||
Node: Why do I get "conflicting types for yylex" error?274742
|
||||
Node: How do I access the values set in a Flex action from within a Bison action?275272
|
||||
Node: Appendices275703
|
||||
Node: Makefiles and Flex275912
|
||||
Ref: Makefiles and Flex-Footnote-1279112
|
||||
Ref: Makefiles and Flex-Footnote-2279229
|
||||
Ref: Makefiles and Flex-Footnote-3279415
|
||||
Node: Bison Bridge279466
|
||||
Ref: Bison Bridge-Footnote-1282135
|
||||
Node: M4 Dependency282327
|
||||
Ref: M4 Dependency-Footnote-1283732
|
||||
Node: Common Patterns283867
|
||||
Node: Numbers284158
|
||||
Node: Identifiers285135
|
||||
Node: Quoted Constructs285964
|
||||
Node: Addresses287017
|
||||
Node: Indices287683
|
||||
Node: Concept Index287921
|
||||
Node: Index of Functions and Macros313204
|
||||
Node: Index of Variables318100
|
||||
Node: Index of Data Types319766
|
||||
Node: Index of Hooks320654
|
||||
Node: Index of Scanner Options321222
|
||||
|
||||
End Tag Table
|
||||
7683
external/bsd/flex/dist/doc/flex.info-1
vendored
Normal file
7683
external/bsd/flex/dist/doc/flex.info-1
vendored
Normal file
File diff suppressed because it is too large
Load Diff
BIN
external/bsd/flex/dist/doc/flex.info-2
vendored
Normal file
BIN
external/bsd/flex/dist/doc/flex.info-2
vendored
Normal file
Binary file not shown.
BIN
external/bsd/flex/dist/doc/flex.pdf
vendored
Normal file
BIN
external/bsd/flex/dist/doc/flex.pdf
vendored
Normal file
Binary file not shown.
8601
external/bsd/flex/dist/doc/flex.texi
vendored
Normal file
8601
external/bsd/flex/dist/doc/flex.texi
vendored
Normal file
File diff suppressed because it is too large
Load Diff
201
external/bsd/flex/dist/doc/mdate-sh
vendored
Executable file
201
external/bsd/flex/dist/doc/mdate-sh
vendored
Executable file
@@ -0,0 +1,201 @@
|
||||
#!/bin/sh
|
||||
# Get modification time of a file or directory and pretty-print it.
|
||||
|
||||
scriptversion=2005-06-29.22
|
||||
|
||||
# Copyright (C) 1995, 1996, 1997, 2003, 2004, 2005 Free Software
|
||||
# Foundation, Inc.
|
||||
# written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# This file is maintained in Automake, please report
|
||||
# bugs to <bug-automake@gnu.org> or send patches to
|
||||
# <automake-patches@gnu.org>.
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No file. Try \`$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: mdate-sh [--help] [--version] FILE
|
||||
|
||||
Pretty-print the modification time of FILE.
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "mdate-sh $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
esac
|
||||
|
||||
# Prevent date giving response in another language.
|
||||
LANG=C
|
||||
export LANG
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
LC_TIME=C
|
||||
export LC_TIME
|
||||
|
||||
# GNU ls changes its time format in response to the TIME_STYLE
|
||||
# variable. Since we cannot assume `unset' works, revert this
|
||||
# variable to its documented default.
|
||||
if test "${TIME_STYLE+set}" = set; then
|
||||
TIME_STYLE=posix-long-iso
|
||||
export TIME_STYLE
|
||||
fi
|
||||
|
||||
save_arg1=$1
|
||||
|
||||
# Find out how to get the extended ls output of a file or directory.
|
||||
if ls -L /dev/null 1>/dev/null 2>&1; then
|
||||
ls_command='ls -L -l -d'
|
||||
else
|
||||
ls_command='ls -l -d'
|
||||
fi
|
||||
|
||||
# A `ls -l' line looks as follows on OS/2.
|
||||
# drwxrwx--- 0 Aug 11 2001 foo
|
||||
# This differs from Unix, which adds ownership information.
|
||||
# drwxrwx--- 2 root root 4096 Aug 11 2001 foo
|
||||
#
|
||||
# To find the date, we split the line on spaces and iterate on words
|
||||
# until we find a month. This cannot work with files whose owner is a
|
||||
# user named `Jan', or `Feb', etc. However, it's unlikely that `/'
|
||||
# will be owned by a user whose name is a month. So we first look at
|
||||
# the extended ls output of the root directory to decide how many
|
||||
# words should be skipped to get the date.
|
||||
|
||||
# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below.
|
||||
set x`ls -l -d /`
|
||||
|
||||
# Find which argument is the month.
|
||||
month=
|
||||
command=
|
||||
until test $month
|
||||
do
|
||||
shift
|
||||
# Add another shift to the command.
|
||||
command="$command shift;"
|
||||
case $1 in
|
||||
Jan) month=January; nummonth=1;;
|
||||
Feb) month=February; nummonth=2;;
|
||||
Mar) month=March; nummonth=3;;
|
||||
Apr) month=April; nummonth=4;;
|
||||
May) month=May; nummonth=5;;
|
||||
Jun) month=June; nummonth=6;;
|
||||
Jul) month=July; nummonth=7;;
|
||||
Aug) month=August; nummonth=8;;
|
||||
Sep) month=September; nummonth=9;;
|
||||
Oct) month=October; nummonth=10;;
|
||||
Nov) month=November; nummonth=11;;
|
||||
Dec) month=December; nummonth=12;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Get the extended ls output of the file or directory.
|
||||
set dummy x`eval "$ls_command \"\$save_arg1\""`
|
||||
|
||||
# Remove all preceding arguments
|
||||
eval $command
|
||||
|
||||
# Because of the dummy argument above, month is in $2.
|
||||
#
|
||||
# On a POSIX system, we should have
|
||||
#
|
||||
# $# = 5
|
||||
# $1 = file size
|
||||
# $2 = month
|
||||
# $3 = day
|
||||
# $4 = year or time
|
||||
# $5 = filename
|
||||
#
|
||||
# On Darwin 7.7.0 and 7.6.0, we have
|
||||
#
|
||||
# $# = 4
|
||||
# $1 = day
|
||||
# $2 = month
|
||||
# $3 = year or time
|
||||
# $4 = filename
|
||||
|
||||
# Get the month.
|
||||
case $2 in
|
||||
Jan) month=January; nummonth=1;;
|
||||
Feb) month=February; nummonth=2;;
|
||||
Mar) month=March; nummonth=3;;
|
||||
Apr) month=April; nummonth=4;;
|
||||
May) month=May; nummonth=5;;
|
||||
Jun) month=June; nummonth=6;;
|
||||
Jul) month=July; nummonth=7;;
|
||||
Aug) month=August; nummonth=8;;
|
||||
Sep) month=September; nummonth=9;;
|
||||
Oct) month=October; nummonth=10;;
|
||||
Nov) month=November; nummonth=11;;
|
||||
Dec) month=December; nummonth=12;;
|
||||
esac
|
||||
|
||||
case $3 in
|
||||
???*) day=$1;;
|
||||
*) day=$3; shift;;
|
||||
esac
|
||||
|
||||
# Here we have to deal with the problem that the ls output gives either
|
||||
# the time of day or the year.
|
||||
case $3 in
|
||||
*:*) set `date`; eval year=\$$#
|
||||
case $2 in
|
||||
Jan) nummonthtod=1;;
|
||||
Feb) nummonthtod=2;;
|
||||
Mar) nummonthtod=3;;
|
||||
Apr) nummonthtod=4;;
|
||||
May) nummonthtod=5;;
|
||||
Jun) nummonthtod=6;;
|
||||
Jul) nummonthtod=7;;
|
||||
Aug) nummonthtod=8;;
|
||||
Sep) nummonthtod=9;;
|
||||
Oct) nummonthtod=10;;
|
||||
Nov) nummonthtod=11;;
|
||||
Dec) nummonthtod=12;;
|
||||
esac
|
||||
# For the first six month of the year the time notation can also
|
||||
# be used for files modified in the last year.
|
||||
if (expr $nummonth \> $nummonthtod) > /dev/null;
|
||||
then
|
||||
year=`expr $year - 1`
|
||||
fi;;
|
||||
*) year=$3;;
|
||||
esac
|
||||
|
||||
# The result.
|
||||
echo $day $month $year
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
||||
4
external/bsd/flex/dist/doc/stamp-vti
vendored
Normal file
4
external/bsd/flex/dist/doc/stamp-vti
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
@set UPDATED 10 September 2007
|
||||
@set UPDATED-MONTH September 2007
|
||||
@set EDITION 2.5.35
|
||||
@set VERSION 2.5.35
|
||||
7210
external/bsd/flex/dist/doc/texinfo.tex
vendored
Normal file
7210
external/bsd/flex/dist/doc/texinfo.tex
vendored
Normal file
File diff suppressed because it is too large
Load Diff
5
external/bsd/flex/dist/doc/version.texi
vendored
Normal file
5
external/bsd/flex/dist/doc/version.texi
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
@set UPDATED 10 September 2007
|
||||
@c $NetBSD: version.texi,v 1.1.1.1 2009/10/26 00:27:06 christos Exp $
|
||||
@set UPDATED-MONTH September 2007
|
||||
@set EDITION 2.5.35
|
||||
@set VERSION 2.5.35
|
||||
221
external/bsd/flex/dist/ecs.c
vendored
Normal file
221
external/bsd/flex/dist/ecs.c
vendored
Normal file
@@ -0,0 +1,221 @@
|
||||
/* $NetBSD: ecs.c,v 1.1.1.1 2009/10/26 00:24:20 christos Exp $ */
|
||||
|
||||
/* 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. */
|
||||
|
||||
/* 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 "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)
|
||||
Char 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;
|
||||
}
|
||||
29
external/bsd/flex/dist/examples/Makefile.am
vendored
Normal file
29
external/bsd/flex/dist/examples/Makefile.am
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
# 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.
|
||||
|
||||
EXTRA_DIST = \
|
||||
testxxLexer.l \
|
||||
debflex.awk \
|
||||
README
|
||||
|
||||
SUBDIRS = \
|
||||
manual \
|
||||
fastwc
|
||||
501
external/bsd/flex/dist/examples/Makefile.in
vendored
Normal file
501
external/bsd/flex/dist/examples/Makefile.in
vendored
Normal file
@@ -0,0 +1,501 @@
|
||||
# Makefile.in generated by automake 1.9.6 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
# 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.
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = ..
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = @INSTALL@
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = examples
|
||||
DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
|
||||
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
|
||||
$(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
|
||||
$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
|
||||
$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.in
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||
html-recursive info-recursive install-data-recursive \
|
||||
install-exec-recursive install-info-recursive \
|
||||
install-recursive installcheck-recursive installdirs-recursive \
|
||||
pdf-recursive ps-recursive uninstall-info-recursive \
|
||||
uninstall-recursive
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ALLOCA = @ALLOCA@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
AMTAR = @AMTAR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
BISON = @BISON@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
HELP2MAN = @HELP2MAN@
|
||||
INDENT = @INDENT@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
INTLLIBS = @INTLLIBS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LEX = @LEX@
|
||||
LEXLIB = @LEXLIB@
|
||||
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
|
||||
LIBICONV = @LIBICONV@
|
||||
LIBINTL = @LIBINTL@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LN_S = @LN_S@
|
||||
LTLIBICONV = @LTLIBICONV@
|
||||
LTLIBINTL = @LTLIBINTL@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
M4 = @M4@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKINSTALLDIRS = @MKINSTALLDIRS@
|
||||
MSGFMT = @MSGFMT@
|
||||
MSGMERGE = @MSGMERGE@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
POSUB = @POSUB@
|
||||
RANLIB = @RANLIB@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
USE_NLS = @USE_NLS@
|
||||
VERSION = @VERSION@
|
||||
XGETTEXT = @XGETTEXT@
|
||||
YACC = @YACC@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
datadir = @datadir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
EXTRA_DIST = \
|
||||
testxxLexer.l \
|
||||
debflex.awk \
|
||||
README
|
||||
|
||||
SUBDIRS = \
|
||||
manual \
|
||||
fastwc
|
||||
|
||||
all: all-recursive
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits examples/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnits examples/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
uninstall-info-am:
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
$(RECURSIVE_TARGETS):
|
||||
@failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
mostlyclean-recursive clean-recursive distclean-recursive \
|
||||
maintainer-clean-recursive:
|
||||
@failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
rev=''; for subdir in $$list; do \
|
||||
if test "$$subdir" = "."; then :; else \
|
||||
rev="$$subdir $$rev"; \
|
||||
fi; \
|
||||
done; \
|
||||
rev="$$rev ."; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
for subdir in $$rev; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
ctags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
|
||||
done
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||
include_option=--etags-include; \
|
||||
empty_fix=.; \
|
||||
else \
|
||||
include_option=--include; \
|
||||
empty_fix=; \
|
||||
fi; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test ! -f $$subdir/TAGS || \
|
||||
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkdir_p) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -d "$(distdir)/$$subdir" \
|
||||
|| $(mkdir_p) "$(distdir)/$$subdir" \
|
||||
|| exit 1; \
|
||||
distdir=`$(am__cd) $(distdir) && pwd`; \
|
||||
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
|
||||
(cd $$subdir && \
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$$top_distdir" \
|
||||
distdir="$$distdir/$$subdir" \
|
||||
distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
all-am: Makefile
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
install: install-recursive
|
||||
install-exec: install-exec-recursive
|
||||
install-data: install-data-recursive
|
||||
uninstall: uninstall-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-recursive
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-recursive
|
||||
|
||||
clean-am: clean-generic mostlyclean-am
|
||||
|
||||
distclean: distclean-recursive
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic distclean-tags
|
||||
|
||||
dvi: dvi-recursive
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-recursive
|
||||
|
||||
info: info-recursive
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-info: install-info-recursive
|
||||
|
||||
install-man:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-recursive
|
||||
|
||||
mostlyclean-am: mostlyclean-generic
|
||||
|
||||
pdf: pdf-recursive
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-recursive
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-info-am
|
||||
|
||||
uninstall-info: uninstall-info-recursive
|
||||
|
||||
.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
|
||||
clean clean-generic clean-recursive ctags ctags-recursive \
|
||||
distclean distclean-generic distclean-recursive distclean-tags \
|
||||
distdir dvi dvi-am html html-am info info-am install \
|
||||
install-am install-data install-data-am install-exec \
|
||||
install-exec-am install-info install-info-am install-man \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
installdirs-am maintainer-clean maintainer-clean-generic \
|
||||
maintainer-clean-recursive mostlyclean mostlyclean-generic \
|
||||
mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
|
||||
uninstall uninstall-am uninstall-info-am
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
15
external/bsd/flex/dist/examples/README
vendored
Normal file
15
external/bsd/flex/dist/examples/README
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
This directory contains some examples of what you can do with
|
||||
flex. These files are not tested regularly so you might have to tinker
|
||||
a bit before they work for you. Updates, new files and patches are welcome.
|
||||
|
||||
- debflex.awk, an awk script for anotating flex debug output.
|
||||
It presently only works with gawk and mawk, not with "old"
|
||||
or "new" awk.
|
||||
|
||||
- testxxLexer.l, a sample C++ program that uses flex's scanner
|
||||
class option ("-+").
|
||||
|
||||
- fastwc/, a subdirectory containing examples of how to use flex
|
||||
to write progressively higher-performance versions of the Unix
|
||||
"wc" utility. This certainly should work with 2.5, but hasn't
|
||||
been tested.
|
||||
119
external/bsd/flex/dist/examples/debflex.awk
vendored
Normal file
119
external/bsd/flex/dist/examples/debflex.awk
vendored
Normal file
@@ -0,0 +1,119 @@
|
||||
# Clarify the flex debug trace by substituting first line of each rule.
|
||||
# Francois Pinard <pinard@iro.umontreal.ca>, July 1990.
|
||||
#
|
||||
# Rewritten to process correctly \n's in scanner input.
|
||||
# BEGIN section modified to correct a collection of rules.
|
||||
# Michal Jaegermann <michal@phys.ualberta.ca>, December 1993
|
||||
#
|
||||
# Sample usage:
|
||||
# flex -d PROGRAM.l
|
||||
# gcc -o PROGRAM PROGRAM.c -lfl
|
||||
# PROGRAM 2>&1 | gawk -f debflex.awk PROGRAM.l
|
||||
#
|
||||
# (VP's note: this script presently does not work with either "old" or
|
||||
# "new" awk; fixes so it does will be welcome)
|
||||
|
||||
BEGIN {
|
||||
# Insure proper usage.
|
||||
|
||||
if (ARGC != 2) {
|
||||
print "usage: gawk -f debflex.awk FLEX_SOURCE <DEBUG_OUTPUT";
|
||||
exit (1);
|
||||
}
|
||||
|
||||
# Remove and save the name of flex source.
|
||||
|
||||
source = ARGV[1];
|
||||
ARGC--;
|
||||
|
||||
# Swallow the flex source file.
|
||||
|
||||
line = 0;
|
||||
section = 1;
|
||||
while (getline <source) {
|
||||
|
||||
# Count the lines.
|
||||
|
||||
line++;
|
||||
|
||||
# Count the sections. When encountering section 3,
|
||||
# break out of the awk BEGIN block.
|
||||
|
||||
if (match ($0, /^%%/)) {
|
||||
section++;
|
||||
if (section == 3) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
# Only the lines in section 2 which do not begin in a
|
||||
# tab or space might be referred to by the flex debug
|
||||
# trace. Save only those lines.
|
||||
|
||||
if (section == 2 && match ($0, /^[^ \t]/)) {
|
||||
rules[line] = $0;
|
||||
}
|
||||
}
|
||||
}
|
||||
dashes = "-----------------------------------------------------------";
|
||||
collect = "";
|
||||
line = 0;
|
||||
}
|
||||
|
||||
# collect complete rule output from a scanner
|
||||
$0 !~ /^--/ {
|
||||
collect = collect "\n" $0;
|
||||
next;
|
||||
}
|
||||
# otherwise we have a new rule - process what we got so far
|
||||
{
|
||||
process();
|
||||
}
|
||||
# and the same thing if we hit EOF
|
||||
END {
|
||||
process();
|
||||
}
|
||||
|
||||
function process() {
|
||||
|
||||
# splitting this way we loose some double dashes and
|
||||
# left parentheses from echoed input - a small price to pay
|
||||
n = split(collect, field, "\n--|[(]");
|
||||
|
||||
# this loop kicks in only when we already collected something
|
||||
for (i = 1; i <= n; i++) {
|
||||
if (0 != line) {
|
||||
# we do not care for traces of newlines.
|
||||
if (0 == match(field[i], /\"\n+\"[)]/)) {
|
||||
if (rules[line]) {
|
||||
text = field[i];
|
||||
while ( ++i <= n) {
|
||||
text = text field[i];
|
||||
}
|
||||
printf("%s:%d: %-8s -- %s\n",
|
||||
source, line, text, rules[line]);
|
||||
}
|
||||
else {
|
||||
print;
|
||||
printf "%s:%d: *** No such rule.\n", source, line;
|
||||
}
|
||||
}
|
||||
line = 0;
|
||||
break;
|
||||
}
|
||||
if ("" != field[i]) {
|
||||
if ("end of buffer or a NUL)" == field[i]) {
|
||||
print dashes; # Simplify trace of buffer reloads
|
||||
continue;
|
||||
}
|
||||
if (match(field[i], /accepting rule at line /)) {
|
||||
# force interpretation of line as a number
|
||||
line = 0 + substr(field[i], RLENGTH);
|
||||
continue;
|
||||
}
|
||||
# echo everything else
|
||||
printf("--%s\n", field[i]);
|
||||
}
|
||||
}
|
||||
collect = "\n" $0; # ... and start next trace
|
||||
}
|
||||
29
external/bsd/flex/dist/examples/fastwc/Makefile.am
vendored
Normal file
29
external/bsd/flex/dist/examples/fastwc/Makefile.am
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
# 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.
|
||||
|
||||
EXTRA_DIST = \
|
||||
wc5.l \
|
||||
wc4.l \
|
||||
wc3.l \
|
||||
wc2.l \
|
||||
wc1.l \
|
||||
mywc.c \
|
||||
README
|
||||
345
external/bsd/flex/dist/examples/fastwc/Makefile.in
vendored
Normal file
345
external/bsd/flex/dist/examples/fastwc/Makefile.in
vendored
Normal file
@@ -0,0 +1,345 @@
|
||||
# Makefile.in generated by automake 1.9.6 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
# 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.
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = ../..
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = @INSTALL@
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = examples/fastwc
|
||||
DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
|
||||
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
|
||||
$(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
|
||||
$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
|
||||
$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.in
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ALLOCA = @ALLOCA@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
AMTAR = @AMTAR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
BISON = @BISON@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
HELP2MAN = @HELP2MAN@
|
||||
INDENT = @INDENT@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
INTLLIBS = @INTLLIBS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LEX = @LEX@
|
||||
LEXLIB = @LEXLIB@
|
||||
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
|
||||
LIBICONV = @LIBICONV@
|
||||
LIBINTL = @LIBINTL@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LN_S = @LN_S@
|
||||
LTLIBICONV = @LTLIBICONV@
|
||||
LTLIBINTL = @LTLIBINTL@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
M4 = @M4@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKINSTALLDIRS = @MKINSTALLDIRS@
|
||||
MSGFMT = @MSGFMT@
|
||||
MSGMERGE = @MSGMERGE@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
POSUB = @POSUB@
|
||||
RANLIB = @RANLIB@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
USE_NLS = @USE_NLS@
|
||||
VERSION = @VERSION@
|
||||
XGETTEXT = @XGETTEXT@
|
||||
YACC = @YACC@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
datadir = @datadir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
EXTRA_DIST = \
|
||||
wc5.l \
|
||||
wc4.l \
|
||||
wc3.l \
|
||||
wc2.l \
|
||||
wc1.l \
|
||||
mywc.c \
|
||||
README
|
||||
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits examples/fastwc/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnits examples/fastwc/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
uninstall-info-am:
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
|
||||
ctags: CTAGS
|
||||
CTAGS:
|
||||
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkdir_p) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile
|
||||
installdirs:
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-generic
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-info-am
|
||||
|
||||
.PHONY: all all-am check check-am clean clean-generic distclean \
|
||||
distclean-generic distdir dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am install-exec \
|
||||
install-exec-am install-info install-info-am install-man \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \
|
||||
uninstall-info-am
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
56
external/bsd/flex/dist/examples/fastwc/README
vendored
Normal file
56
external/bsd/flex/dist/examples/fastwc/README
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
This directory contains some examples illustrating techniques for extracting
|
||||
high-performance from flex scanners. Each program implements a simplified
|
||||
version of the Unix "wc" tool: read text from stdin and print the number of
|
||||
characters, words, and lines present in the text. All programs were compiled
|
||||
using gcc (version unavailable, sorry) with the -O flag, and run on a
|
||||
SPARCstation 1+. The input used was a PostScript file, mainly containing
|
||||
figures, with the following "wc" counts:
|
||||
|
||||
lines words characters
|
||||
214217 635954 2592172
|
||||
|
||||
|
||||
The basic principles illustrated by these programs are:
|
||||
|
||||
- match as much text with each rule as possible
|
||||
- adding rules does not slow you down!
|
||||
- avoid backing up
|
||||
|
||||
and the big caveat that comes with them is:
|
||||
|
||||
- you buy performance with decreased maintainability; make
|
||||
sure you really need it before applying the above techniques.
|
||||
|
||||
See the "Performance Considerations" section of flexdoc for more
|
||||
details regarding these principles.
|
||||
|
||||
|
||||
The different versions of "wc":
|
||||
|
||||
mywc.c
|
||||
a simple but fairly efficient C version
|
||||
|
||||
wc1.l a naive flex "wc" implementation
|
||||
|
||||
wc2.l somewhat faster; adds rules to match multiple tokens at once
|
||||
|
||||
wc3.l faster still; adds more rules to match longer runs of tokens
|
||||
|
||||
wc4.l fastest; still more rules added; hard to do much better
|
||||
using flex (or, I suspect, hand-coding)
|
||||
|
||||
wc5.l identical to wc3.l except one rule has been slightly
|
||||
shortened, introducing backing-up
|
||||
|
||||
Timing results (all times in user CPU seconds):
|
||||
|
||||
program time notes
|
||||
------- ---- -----
|
||||
wc1 16.4 default flex table compression (= -Cem)
|
||||
wc1 6.7 -Cf compression option
|
||||
/bin/wc 5.8 Sun's standard "wc" tool
|
||||
mywc 4.6 simple but better C implementation!
|
||||
wc2 4.6 as good as C implementation; built using -Cf
|
||||
wc3 3.8 -Cf
|
||||
wc4 3.3 -Cf
|
||||
wc5 5.7 -Cf; ouch, backing up is expensive
|
||||
28
external/bsd/flex/dist/examples/fastwc/mywc.c
vendored
Normal file
28
external/bsd/flex/dist/examples/fastwc/mywc.c
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
/* $NetBSD: mywc.c,v 1.1.1.1 2009/10/26 00:28:34 christos Exp $ */
|
||||
|
||||
/* A simple but fairly efficient C version of the Unix "wc" tool */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
main()
|
||||
{
|
||||
register int c, cc = 0, wc = 0, lc = 0;
|
||||
FILE *f = stdin;
|
||||
|
||||
while ((c = getc(f)) != EOF) {
|
||||
++cc;
|
||||
if (isgraph(c)) {
|
||||
++wc;
|
||||
do {
|
||||
c = getc(f);
|
||||
if (c == EOF)
|
||||
goto done;
|
||||
++cc;
|
||||
} while (isgraph(c));
|
||||
}
|
||||
if (c == '\n')
|
||||
++lc;
|
||||
}
|
||||
done: printf( "%8d%8d%8d\n", lc, wc, cc );
|
||||
}
|
||||
21
external/bsd/flex/dist/examples/fastwc/wc1.l
vendored
Normal file
21
external/bsd/flex/dist/examples/fastwc/wc1.l
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
/* $NetBSD: wc1.l,v 1.1.1.1 2009/10/26 00:28:34 christos Exp $ */
|
||||
|
||||
/* First cut at a flex-based "wc" tool. */
|
||||
|
||||
ws [ \t]
|
||||
nonws [^ \t\n]
|
||||
|
||||
%option main noyywrap
|
||||
%%
|
||||
int cc = 0, wc = 0, lc = 0;
|
||||
|
||||
{nonws}+ cc += yyleng; ++wc;
|
||||
|
||||
{ws}+ cc += yyleng;
|
||||
|
||||
\n ++lc; ++cc;
|
||||
|
||||
<<EOF>> {
|
||||
printf( "%8d %8d %8d\n", lc, wc, cc );
|
||||
yyterminate();
|
||||
}
|
||||
23
external/bsd/flex/dist/examples/fastwc/wc2.l
vendored
Normal file
23
external/bsd/flex/dist/examples/fastwc/wc2.l
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
/* $NetBSD: wc2.l,v 1.1.1.1 2009/10/26 00:28:34 christos Exp $ */
|
||||
|
||||
/* Somewhat faster "wc" tool: match more text with each rule */
|
||||
|
||||
ws [ \t]
|
||||
nonws [^ \t\n]
|
||||
word {ws}*{nonws}+
|
||||
|
||||
%option main noyywrap
|
||||
%%
|
||||
int cc = 0, wc = 0, lc = 0;
|
||||
|
||||
{word}{ws}* cc += yyleng; ++wc;
|
||||
{word}{ws}*\n cc += yyleng; ++wc; ++lc;
|
||||
|
||||
{ws}+ cc += yyleng;
|
||||
|
||||
\n+ cc += yyleng; lc += yyleng;
|
||||
|
||||
<<EOF>> {
|
||||
printf( "%8d %8d %8d\n", lc, wc, cc );
|
||||
yyterminate();
|
||||
}
|
||||
27
external/bsd/flex/dist/examples/fastwc/wc3.l
vendored
Normal file
27
external/bsd/flex/dist/examples/fastwc/wc3.l
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
/* $NetBSD: wc3.l,v 1.1.1.1 2009/10/26 00:28:34 christos Exp $ */
|
||||
|
||||
/* Somewhat faster still: potentially match a lot of text with each rule */
|
||||
|
||||
ws [ \t]
|
||||
nonws [^ \t\n]
|
||||
word {ws}*{nonws}+
|
||||
words {word}{ws}+
|
||||
|
||||
%option main noyywrap
|
||||
%%
|
||||
int cc = 0, wc = 0, lc = 0;
|
||||
|
||||
{word}{ws}* cc += yyleng; ++wc;
|
||||
{word}{ws}*\n cc += yyleng; ++wc; ++lc;
|
||||
{words}{word}{ws}* cc += yyleng; wc += 2;
|
||||
{words}{2}{word}{ws}* cc += yyleng; wc += 3;
|
||||
{words}{3}{word}{ws}* cc += yyleng; wc += 4;
|
||||
|
||||
{ws}+ cc += yyleng;
|
||||
|
||||
\n+ cc += yyleng; lc += yyleng;
|
||||
|
||||
<<EOF>> {
|
||||
printf( "%8d %8d %8d\n", lc, wc, cc );
|
||||
yyterminate();
|
||||
}
|
||||
30
external/bsd/flex/dist/examples/fastwc/wc4.l
vendored
Normal file
30
external/bsd/flex/dist/examples/fastwc/wc4.l
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
/* $NetBSD: wc4.l,v 1.1.1.1 2009/10/26 00:28:34 christos Exp $ */
|
||||
|
||||
/* Fastest version of wc: add rules to pick up newlines, too */
|
||||
|
||||
ws [ \t]
|
||||
nonws [^ \t\n]
|
||||
word {ws}*{nonws}+
|
||||
words {word}{ws}+
|
||||
|
||||
%option main noyywrap
|
||||
%%
|
||||
int cc = 0, wc = 0, lc = 0;
|
||||
|
||||
{word}{ws}* ++wc; cc += yyleng;
|
||||
{word}{ws}*\n ++wc; cc += yyleng; ++lc;
|
||||
{words}{word}{ws}* wc += 2; cc += yyleng;
|
||||
{words}{word}{ws}*\n wc += 2; cc += yyleng; ++lc;
|
||||
{words}{2}{word}{ws}* wc += 3; cc += yyleng;
|
||||
{words}{2}{word}{ws}*\n wc += 3; cc += yyleng; ++lc;
|
||||
{words}{3}{word}{ws}* wc += 4; cc += yyleng;
|
||||
{words}{3}{word}{ws}*\n wc += 4; cc += yyleng; ++lc;
|
||||
|
||||
{ws}+ cc += yyleng;
|
||||
|
||||
\n+ cc += yyleng; lc += yyleng;
|
||||
|
||||
<<EOF>> {
|
||||
printf( "%8d %8d %8d\n", lc, wc, cc );
|
||||
yyterminate();
|
||||
}
|
||||
27
external/bsd/flex/dist/examples/fastwc/wc5.l
vendored
Normal file
27
external/bsd/flex/dist/examples/fastwc/wc5.l
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
/* $NetBSD: wc5.l,v 1.1.1.1 2009/10/26 00:28:34 christos Exp $ */
|
||||
|
||||
/* Oops; slight change from wc3.l introduces backtracking */
|
||||
|
||||
ws [ \t]
|
||||
nonws [^ \t\n]
|
||||
word {ws}*{nonws}+
|
||||
words {word}{ws}+
|
||||
|
||||
%option main noyywrap
|
||||
%%
|
||||
int cc = 0, wc = 0, lc = 0;
|
||||
|
||||
{word}{ws}* cc += yyleng; ++wc;
|
||||
{word}{ws}*\n cc += yyleng; ++wc; ++lc;
|
||||
{words}{word} cc += yyleng; wc += 2; /* oops */
|
||||
{words}{2}{word}{ws}* cc += yyleng; wc += 3;
|
||||
{words}{3}{word}{ws}* cc += yyleng; wc += 4;
|
||||
|
||||
{ws}+ cc += yyleng;
|
||||
|
||||
\n+ cc += yyleng; lc += yyleng;
|
||||
|
||||
<<EOF>> {
|
||||
printf( "%8d %8d %8d\n", lc, wc, cc );
|
||||
yyterminate();
|
||||
}
|
||||
24
external/bsd/flex/dist/examples/manual/ChangeLog
vendored
Normal file
24
external/bsd/flex/dist/examples/manual/ChangeLog
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
Tue Oct 5 21:51:59 1993 Vern Paxson
|
||||
|
||||
* Removed FILTER/ subdirectory.
|
||||
|
||||
* Removed alloca.c.
|
||||
|
||||
* Changed Makefile definition of CC to just "gcc -g", removed
|
||||
assumption of alloca being present.
|
||||
|
||||
* Added pointer to MISC/fastwc/ to wc.lex.
|
||||
|
||||
Tue Jun 8 15:47:39 1993 Gavin Thomas Nicol (nick at sillybugs)
|
||||
|
||||
* Changed main() in wc.lex extensively. The old version would not
|
||||
work correctly without the YY_NEW_FILE. (lex handles the older
|
||||
version OK though).
|
||||
|
||||
* Added a rule to expr.lex to handle whitespace. The old version
|
||||
reported an illegal character.
|
||||
|
||||
* Added -traditional to the gcc flags because the flex definition
|
||||
for free() clashes with some systems that have old header files.
|
||||
|
||||
|
||||
55
external/bsd/flex/dist/examples/manual/Makefile.am
vendored
Normal file
55
external/bsd/flex/dist/examples/manual/Makefile.am
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
# 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.
|
||||
|
||||
EXTRA_DIST = \
|
||||
ChangeLog \
|
||||
Makefile.examples \
|
||||
README \
|
||||
cat.lex \
|
||||
dates.lex \
|
||||
datetest.dat \
|
||||
eof_rules.lex \
|
||||
eof_test01.txt \
|
||||
eof_test02.txt \
|
||||
eof_test03.txt \
|
||||
expr.lex \
|
||||
expr.y \
|
||||
front.lex \
|
||||
front.y \
|
||||
j2t.lex \
|
||||
myname.lex \
|
||||
myname.txt \
|
||||
myname2.lex \
|
||||
numbers.lex \
|
||||
pas_include.lex \
|
||||
pascal.lex \
|
||||
reject.lex \
|
||||
replace.lex \
|
||||
string1.lex \
|
||||
string2.lex \
|
||||
strtest.dat \
|
||||
unput.lex \
|
||||
user_act.lex \
|
||||
userinit.lex \
|
||||
wc.lex \
|
||||
yymore.lex \
|
||||
yymore2.lex \
|
||||
yymoretest.dat
|
||||
88
external/bsd/flex/dist/examples/manual/Makefile.examples
vendored
Normal file
88
external/bsd/flex/dist/examples/manual/Makefile.examples
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
#############################################################
|
||||
#
|
||||
# Makefile : Makefile for Flex examples.
|
||||
# Author : G.T.Nicol
|
||||
# Last Updated : 1993/10/05
|
||||
#
|
||||
# If you use bison, you may have to supply an alloca
|
||||
#
|
||||
#############################################################
|
||||
|
||||
CC = gcc -g
|
||||
LEX = flex -i -I
|
||||
YACC = bison -d -y
|
||||
ALLOCA =
|
||||
|
||||
############################################################
|
||||
#
|
||||
# DO NOT CHANGE ANYTHING FROM HERE ON !!!!!!!!!
|
||||
#
|
||||
############################################################
|
||||
|
||||
all: expr front myname eof wc replace user_act string1\
|
||||
string2 yymore numbers dates cat
|
||||
|
||||
expr: expr.y expr.lex
|
||||
$(YACC) expr.y
|
||||
$(LEX) expr.lex
|
||||
$(CC) -o expr lex.yy.c y.tab.c $(ALLOCA) -ll -lm
|
||||
|
||||
front: front.y front.lex
|
||||
$(YACC) front.y
|
||||
$(LEX) front.lex
|
||||
$(CC) -o front lex.yy.c y.tab.c $(ALLOCA) -ll -lm
|
||||
|
||||
numbers: numbers.lex
|
||||
$(LEX) numbers.lex
|
||||
$(CC) lex.yy.c -o numbers
|
||||
|
||||
dates: dates.lex
|
||||
$(LEX) dates.lex
|
||||
$(CC) lex.yy.c -o dates -ll
|
||||
|
||||
yymore: yymore.lex
|
||||
$(LEX) yymore.lex
|
||||
$(CC) lex.yy.c -o yymore -ll
|
||||
|
||||
string1: string1.lex
|
||||
$(LEX) string1.lex
|
||||
$(CC) lex.yy.c -o string1 -ll
|
||||
|
||||
string2: string2.lex
|
||||
$(LEX) string2.lex
|
||||
$(CC) lex.yy.c -o string2 -ll
|
||||
|
||||
myname: myname.lex
|
||||
$(LEX) myname.lex
|
||||
$(CC) lex.yy.c -o myname -ll
|
||||
|
||||
myname2: myname2.lex
|
||||
$(LEX) myname2.lex
|
||||
$(CC) lex.yy.c -o myname2 -ll
|
||||
|
||||
eof: eof_rules.lex
|
||||
$(LEX) eof_rules.lex
|
||||
$(CC) lex.yy.c -o eof -ll
|
||||
|
||||
wc: wc.lex
|
||||
$(LEX) wc.lex
|
||||
$(CC) lex.yy.c -o wc -ll
|
||||
|
||||
cat: cat.lex
|
||||
$(LEX) cat.lex
|
||||
$(CC) lex.yy.c -o cat -ll
|
||||
|
||||
replace: replace.lex
|
||||
$(LEX) replace.lex
|
||||
$(CC) lex.yy.c -o replace -ll
|
||||
|
||||
user_act: expr.y expr.lex
|
||||
$(LEX) user_act.lex
|
||||
$(CC) -o user_act lex.yy.c -ll
|
||||
|
||||
clean:
|
||||
rm -f *.BAK *.o core *~* *.a
|
||||
rm -f *.tab.h *.tab.c
|
||||
rm -f myname expr lex.yy.c *.out eof wc yymore
|
||||
rm -f replace front user_act string1 string2
|
||||
rm -f dates numbers cat
|
||||
372
external/bsd/flex/dist/examples/manual/Makefile.in
vendored
Normal file
372
external/bsd/flex/dist/examples/manual/Makefile.in
vendored
Normal file
@@ -0,0 +1,372 @@
|
||||
# Makefile.in generated by automake 1.9.6 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
# 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.
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = ../..
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = @INSTALL@
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = examples/manual
|
||||
DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
|
||||
ChangeLog
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
|
||||
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
|
||||
$(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
|
||||
$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
|
||||
$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.in
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ALLOCA = @ALLOCA@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
AMTAR = @AMTAR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
BISON = @BISON@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
HELP2MAN = @HELP2MAN@
|
||||
INDENT = @INDENT@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
INTLLIBS = @INTLLIBS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LEX = @LEX@
|
||||
LEXLIB = @LEXLIB@
|
||||
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
|
||||
LIBICONV = @LIBICONV@
|
||||
LIBINTL = @LIBINTL@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LN_S = @LN_S@
|
||||
LTLIBICONV = @LTLIBICONV@
|
||||
LTLIBINTL = @LTLIBINTL@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
M4 = @M4@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKINSTALLDIRS = @MKINSTALLDIRS@
|
||||
MSGFMT = @MSGFMT@
|
||||
MSGMERGE = @MSGMERGE@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
POSUB = @POSUB@
|
||||
RANLIB = @RANLIB@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
USE_NLS = @USE_NLS@
|
||||
VERSION = @VERSION@
|
||||
XGETTEXT = @XGETTEXT@
|
||||
YACC = @YACC@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
datadir = @datadir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
EXTRA_DIST = \
|
||||
ChangeLog \
|
||||
Makefile.examples \
|
||||
README \
|
||||
cat.lex \
|
||||
dates.lex \
|
||||
datetest.dat \
|
||||
eof_rules.lex \
|
||||
eof_test01.txt \
|
||||
eof_test02.txt \
|
||||
eof_test03.txt \
|
||||
expr.lex \
|
||||
expr.y \
|
||||
front.lex \
|
||||
front.y \
|
||||
j2t.lex \
|
||||
myname.lex \
|
||||
myname.txt \
|
||||
myname2.lex \
|
||||
numbers.lex \
|
||||
pas_include.lex \
|
||||
pascal.lex \
|
||||
reject.lex \
|
||||
replace.lex \
|
||||
string1.lex \
|
||||
string2.lex \
|
||||
strtest.dat \
|
||||
unput.lex \
|
||||
user_act.lex \
|
||||
userinit.lex \
|
||||
wc.lex \
|
||||
yymore.lex \
|
||||
yymore2.lex \
|
||||
yymoretest.dat
|
||||
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits examples/manual/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnits examples/manual/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
uninstall-info-am:
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
|
||||
ctags: CTAGS
|
||||
CTAGS:
|
||||
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkdir_p) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile
|
||||
installdirs:
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-generic
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-info-am
|
||||
|
||||
.PHONY: all all-am check check-am clean clean-generic distclean \
|
||||
distclean-generic distdir dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am install-exec \
|
||||
install-exec-am install-info install-info-am install-man \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \
|
||||
uninstall-info-am
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
12
external/bsd/flex/dist/examples/manual/README
vendored
Normal file
12
external/bsd/flex/dist/examples/manual/README
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
This directory contains the example programs from the manual, and a
|
||||
few other things as well. To make all the programs, simply type "make
|
||||
-f Makefile.examples", and assuming you have flex and gcc, all will be
|
||||
well.
|
||||
|
||||
To build the programs individually, type
|
||||
|
||||
make -f Makefile.examples program_name
|
||||
|
||||
For example:
|
||||
|
||||
make -f Makefile.examples expr
|
||||
45
external/bsd/flex/dist/examples/manual/cat.lex
vendored
Normal file
45
external/bsd/flex/dist/examples/manual/cat.lex
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* cat.lex: A demonstration of YY_NEW_FILE.
|
||||
*/
|
||||
|
||||
%{
|
||||
#include <stdio.h>
|
||||
|
||||
char **names = NULL;
|
||||
int current = 1;
|
||||
%}
|
||||
|
||||
%%
|
||||
<<EOF>> {
|
||||
current += 1;
|
||||
if(names[current] != NULL){
|
||||
yyin = fopen(names[current],"r");
|
||||
if(yyin == NULL){
|
||||
fprintf(stderr,"cat: unable to open %s\n",
|
||||
names[current]);
|
||||
yyterminate();
|
||||
}
|
||||
YY_NEW_FILE;
|
||||
} else {
|
||||
yyterminate();
|
||||
}
|
||||
}
|
||||
%%
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
if(argc < 2){
|
||||
fprintf(stderr,"Usage: cat files....\n");
|
||||
exit(1);
|
||||
}
|
||||
names = argv;
|
||||
|
||||
yyin = fopen(names[current],"r");
|
||||
if(yyin == NULL){
|
||||
fprintf(stderr,"cat: unable to open %s\n",
|
||||
names[current]);
|
||||
yyterminate();
|
||||
}
|
||||
|
||||
yylex();
|
||||
}
|
||||
106
external/bsd/flex/dist/examples/manual/dates.lex
vendored
Normal file
106
external/bsd/flex/dist/examples/manual/dates.lex
vendored
Normal file
@@ -0,0 +1,106 @@
|
||||
/*
|
||||
* dates.lex: An example of using start states to
|
||||
* distinguish between different date formats.
|
||||
*/
|
||||
|
||||
%{
|
||||
#include <ctype.h>
|
||||
|
||||
char month[20],dow[20],day[20],year[20];
|
||||
|
||||
%}
|
||||
|
||||
skip of|the|[ \t,]*
|
||||
|
||||
mon (mon(day)?)
|
||||
tue (tue(sday)?)
|
||||
wed (wed(nesday)?)
|
||||
thu (thu(rsday)?)
|
||||
fri (fri(day)?)
|
||||
sat (sat(urday)?)
|
||||
sun (sun(day)?)
|
||||
|
||||
day_of_the_week ({mon}|{tue}|{wed}|{thu}|{fri}|{sat}|{sun})
|
||||
|
||||
jan (jan(uary)?)
|
||||
feb (feb(ruary)?)
|
||||
mar (mar(ch)?)
|
||||
apr (apr(il)?)
|
||||
may (may)
|
||||
jun (jun(e)?)
|
||||
jul (jul(y)?)
|
||||
aug (aug(ust)?)
|
||||
sep (sep(tember)?)
|
||||
oct (oct(ober)?)
|
||||
nov (nov(ember)?)
|
||||
dec (dec(ember)?)
|
||||
|
||||
first_half ({jan}|{feb}|{mar}|{apr}|{may}|{jun})
|
||||
second_half ({jul}|{aug}|{sep}|{oct}|{nov}|{dec})
|
||||
month {first_half}|{second_half}
|
||||
|
||||
nday [1-9]|[1-2][0-9]|3[0-1]
|
||||
nmonth [1-9]|1[0-2]
|
||||
nyear [0-9]{1,4}
|
||||
|
||||
year_ext (ad|AD|bc|BC)?
|
||||
day_ext (st|nd|rd|th)?
|
||||
|
||||
%s LONG SHORT
|
||||
%s DAY DAY_FIRST YEAR_FIRST YEAR_LAST YFMONTH YLMONTH
|
||||
|
||||
%%
|
||||
|
||||
/* the default is month-day-year */
|
||||
|
||||
<LONG>{day_of_the_week} strcpy(dow,yytext);
|
||||
<LONG>{month} strcpy(month,yytext); BEGIN(DAY);
|
||||
|
||||
/* handle the form: day-month-year */
|
||||
|
||||
<LONG>{nday}{day_ext} strcpy(day,yytext); BEGIN(DAY_FIRST);
|
||||
<DAY_FIRST>{month} strcpy(month,yytext); BEGIN(LONG);
|
||||
<DAY>{nday}{day_ext} strcpy(day,yytext); BEGIN(LONG);
|
||||
|
||||
<LONG>{nyear}{year_ext} {
|
||||
printf("Long:\n");
|
||||
printf(" DOW : %s \n",dow);
|
||||
printf(" Day : %s \n",day);
|
||||
printf(" Month : %s \n",month);
|
||||
printf(" Year : %s \n",yytext);
|
||||
strcpy(dow,"");
|
||||
strcpy(day,"");
|
||||
strcpy(month,"");
|
||||
}
|
||||
|
||||
/* handle dates of the form: day-month-year */
|
||||
|
||||
<SHORT>{nday} strcpy(day,yytext); BEGIN(YEAR_LAST);
|
||||
<YEAR_LAST>{nmonth} strcpy(month,yytext);BEGIN(YLMONTH);
|
||||
<YLMONTH>{nyear} strcpy(year,yytext); BEGIN(SHORT);
|
||||
|
||||
/* handle dates of the form: year-month-day */
|
||||
|
||||
<SHORT>{nyear} strcpy(year,yytext); BEGIN(YEAR_FIRST);
|
||||
<YEAR_FIRST>{nmonth} strcpy(month,yytext);BEGIN(YFMONTH);
|
||||
<YFMONTH>{nday} strcpy(day,yytext); BEGIN(SHORT);
|
||||
|
||||
|
||||
<SHORT>\n {
|
||||
printf("Short:\n");
|
||||
printf(" Day : %s \n",day);
|
||||
printf(" Month : %s \n",month);
|
||||
printf(" Year : %s \n",year);
|
||||
strcpy(year,"");
|
||||
strcpy(day,"");
|
||||
strcpy(month,"");
|
||||
}
|
||||
|
||||
long\n BEGIN(LONG);
|
||||
short\n BEGIN(SHORT);
|
||||
|
||||
{skip}*
|
||||
\n
|
||||
.
|
||||
|
||||
|
||||
28
external/bsd/flex/dist/examples/manual/datetest.dat
vendored
Normal file
28
external/bsd/flex/dist/examples/manual/datetest.dat
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
short
|
||||
1989:12:23
|
||||
1989:11:12
|
||||
23:12:1989
|
||||
11:12:1989
|
||||
1989/12/23
|
||||
1989/11/12
|
||||
23/12/1989
|
||||
11/12/1989
|
||||
1989-12-23
|
||||
1989-11-12
|
||||
23-12-1989
|
||||
11-12-1989
|
||||
long
|
||||
Friday the 5th of January, 1989
|
||||
Friday, 5th of January, 1989
|
||||
Friday, January 5th, 1989
|
||||
Fri, January 5th, 1989
|
||||
Fri, Jan 5th, 1989
|
||||
Fri, Jan 5, 1989
|
||||
FriJan 5, 1989
|
||||
FriJan5, 1989
|
||||
FriJan51989
|
||||
Jan51989
|
||||
|
||||
|
||||
|
||||
|
||||
65
external/bsd/flex/dist/examples/manual/eof_rules.lex
vendored
Normal file
65
external/bsd/flex/dist/examples/manual/eof_rules.lex
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* eof_rules.lex : An example of using multiple buffers
|
||||
* EOF rules, and start states
|
||||
*/
|
||||
|
||||
%{
|
||||
|
||||
#define MAX_NEST 10
|
||||
|
||||
YY_BUFFER_STATE include_stack[MAX_NEST];
|
||||
int include_count = -1;
|
||||
|
||||
%}
|
||||
|
||||
|
||||
%x INCLUDE
|
||||
|
||||
%%
|
||||
|
||||
^"#include"[ \t]*\" BEGIN(INCLUDE);
|
||||
<INCLUDE>\" BEGIN(INITIAL);
|
||||
<INCLUDE>[^\"]+ { /* get the include file name */
|
||||
if ( include_count >= MAX_NEST){
|
||||
fprintf( stderr, "Too many include files" );
|
||||
exit( 1 );
|
||||
}
|
||||
|
||||
include_stack[++include_count] = YY_CURRENT_BUFFER;
|
||||
|
||||
yyin = fopen( yytext, "r" );
|
||||
if ( ! yyin ){
|
||||
fprintf( stderr, "Unable to open \"%s\"\n",yytext);
|
||||
exit( 1 );
|
||||
}
|
||||
|
||||
yy_switch_to_buffer(yy_create_buffer(yyin,YY_BUF_SIZE));
|
||||
|
||||
BEGIN(INITIAL);
|
||||
}
|
||||
<INCLUDE><<EOF>>
|
||||
{
|
||||
fprintf( stderr, "EOF in include" );
|
||||
yyterminate();
|
||||
}
|
||||
<<EOF>> {
|
||||
if ( include_count <= 0 ){
|
||||
yyterminate();
|
||||
} else {
|
||||
yy_delete_buffer(include_stack[include_count--] );
|
||||
yy_switch_to_buffer(include_stack[include_count] );
|
||||
BEGIN(INCLUDE);
|
||||
}
|
||||
}
|
||||
[a-z]+ ECHO;
|
||||
.|\n ECHO;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
17
external/bsd/flex/dist/examples/manual/eof_test01.txt
vendored
Normal file
17
external/bsd/flex/dist/examples/manual/eof_test01.txt
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
This is test file #1
|
||||
|
||||
-------------------------------------------------
|
||||
|
||||
We will now include test #2 in a standard way.
|
||||
|
||||
#include "eof_test02.txt"
|
||||
|
||||
-------------------------------------------------
|
||||
|
||||
And now we will include test # 2 with a different
|
||||
format
|
||||
|
||||
#include "eof_test02.txt"
|
||||
-------------------------------------------------
|
||||
|
||||
and this is the end of the test.
|
||||
8
external/bsd/flex/dist/examples/manual/eof_test02.txt
vendored
Normal file
8
external/bsd/flex/dist/examples/manual/eof_test02.txt
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
INCLUDE #2
|
||||
|
||||
This is the second file that will
|
||||
be included.
|
||||
|
||||
>>> Foo are GNU?
|
||||
|
||||
#include "eof_test03.txt"
|
||||
7
external/bsd/flex/dist/examples/manual/eof_test03.txt
vendored
Normal file
7
external/bsd/flex/dist/examples/manual/eof_test03.txt
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
INCLUDE #3
|
||||
|
||||
This is the third file that will
|
||||
be included.
|
||||
|
||||
>>> echo "I am `whoami`!!"
|
||||
|
||||
35
external/bsd/flex/dist/examples/manual/expr.lex
vendored
Normal file
35
external/bsd/flex/dist/examples/manual/expr.lex
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* expr.lex : Scanner for a simple
|
||||
* expression parser.
|
||||
*/
|
||||
|
||||
%{
|
||||
#include "y.tab.h"
|
||||
|
||||
%}
|
||||
|
||||
%%
|
||||
|
||||
[0-9]+ { yylval.val = atol(yytext);
|
||||
return(NUMBER);
|
||||
}
|
||||
[0-9]+\.[0-9]+ {
|
||||
sscanf(yytext,"%f",&yylval.val);
|
||||
return(NUMBER);
|
||||
}
|
||||
"+" return(PLUS);
|
||||
"-" return(MINUS);
|
||||
"*" return(MULT);
|
||||
"/" return(DIV);
|
||||
"^" return(EXPON);
|
||||
"(" return(LB);
|
||||
")" return(RB);
|
||||
\n return(EOL);
|
||||
[\t ]* /* throw away whitespace */
|
||||
. { yyerror("Illegal character");
|
||||
return(EOL);
|
||||
}
|
||||
%%
|
||||
|
||||
|
||||
|
||||
66
external/bsd/flex/dist/examples/manual/expr.y
vendored
Normal file
66
external/bsd/flex/dist/examples/manual/expr.y
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
/* $NetBSD: expr.y,v 1.1.1.1 2009/10/26 00:28:33 christos Exp $ */
|
||||
|
||||
/*
|
||||
* expr.y : A simple yacc expression parser
|
||||
* Based on the Bison manual example.
|
||||
*/
|
||||
|
||||
%{
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
|
||||
%}
|
||||
|
||||
%union {
|
||||
float val;
|
||||
}
|
||||
|
||||
%token NUMBER
|
||||
%token PLUS MINUS MULT DIV EXPON
|
||||
%token EOL
|
||||
%token LB RB
|
||||
|
||||
%left MINUS PLUS
|
||||
%left MULT DIV
|
||||
%right EXPON
|
||||
|
||||
%type <val> exp NUMBER
|
||||
|
||||
%%
|
||||
input :
|
||||
| input line
|
||||
;
|
||||
|
||||
line : EOL
|
||||
| exp EOL { printf("%g\n",$1);}
|
||||
|
||||
exp : NUMBER { $$ = $1; }
|
||||
| exp PLUS exp { $$ = $1 + $3; }
|
||||
| exp MINUS exp { $$ = $1 - $3; }
|
||||
| exp MULT exp { $$ = $1 * $3; }
|
||||
| exp DIV exp { $$ = $1 / $3; }
|
||||
| MINUS exp %prec MINUS { $$ = -$2; }
|
||||
| exp EXPON exp { $$ = pow($1,$3);}
|
||||
| LB exp RB { $$ = $2; }
|
||||
;
|
||||
|
||||
%%
|
||||
|
||||
yyerror(char *message)
|
||||
{
|
||||
printf("%s\n",message);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
yyparse();
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
40
external/bsd/flex/dist/examples/manual/front.lex
vendored
Normal file
40
external/bsd/flex/dist/examples/manual/front.lex
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
%{
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "y.tab.h" /* this comes from bison */
|
||||
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
|
||||
#define copy_and_return(token_type) { strcpy(yylval.name,yytext); \
|
||||
return(token_type); }
|
||||
|
||||
int yylexlinenum = 0; /* so we can count lines */
|
||||
%}
|
||||
|
||||
%%
|
||||
/* Lexical scanning rules begin from here. */
|
||||
|
||||
MEN|WOMEN|STOCKS|TREES copy_and_return(NOUN)
|
||||
MISTAKES|GNUS|EMPLOYEES copy_and_return(NOUN)
|
||||
LOSERS|USERS|CARS|WINDOWS copy_and_return(NOUN)
|
||||
|
||||
DATABASE|NETWORK|FSF|GNU copy_and_return(PROPER_NOUN)
|
||||
COMPANY|HOUSE|OFFICE|LPF copy_and_return(PROPER_NOUN)
|
||||
|
||||
THE|THIS|THAT|THOSE copy_and_return(DECLARATIVE)
|
||||
|
||||
ALL|FIRST|LAST copy_and_return(CONDITIONAL)
|
||||
|
||||
FIND|SEARCH|SORT|ERASE|KILL copy_and_return(VERB)
|
||||
ADD|REMOVE|DELETE|PRINT copy_and_return(VERB)
|
||||
|
||||
QUICKLY|SLOWLY|CAREFULLY copy_and_return(ADVERB)
|
||||
|
||||
IN|AT|ON|AROUND|INSIDE|ON copy_and_return(POSITIONAL)
|
||||
|
||||
"." return(PERIOD);
|
||||
"\n" yylexlinenum++; return(NEWLINE);
|
||||
.
|
||||
%%
|
||||
|
||||
120
external/bsd/flex/dist/examples/manual/front.y
vendored
Normal file
120
external/bsd/flex/dist/examples/manual/front.y
vendored
Normal file
@@ -0,0 +1,120 @@
|
||||
/* $NetBSD: front.y,v 1.1.1.1 2009/10/26 00:28:33 christos Exp $ */
|
||||
|
||||
/* C code supplied at the beginning of the file. */
|
||||
|
||||
%{
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
extern int yylexlinenum; /* these are in YYlex */
|
||||
extern char *yytext; /* current token */
|
||||
|
||||
|
||||
%}
|
||||
|
||||
/* Keywords and reserved words begin here. */
|
||||
|
||||
%union{ /* this is the data union */
|
||||
char name[128]; /* names */
|
||||
}
|
||||
|
||||
/*-------------------- the reserved words -----------------------------*/
|
||||
|
||||
%token PERIOD
|
||||
%token NEWLINE
|
||||
%token POSITIONAL
|
||||
|
||||
%token VERB
|
||||
%token ADVERB
|
||||
|
||||
%token PROPER_NOUN
|
||||
%token NOUN
|
||||
|
||||
%token DECLARATIVE
|
||||
%token CONDITIONAL
|
||||
|
||||
|
||||
%type <name> declarative
|
||||
%type <name> verb_phrase
|
||||
%type <name> noun_phrase
|
||||
%type <name> position_phrase
|
||||
%type <name> adverb
|
||||
|
||||
%type <name> POSITIONAL VERB ADVERB PROPER_NOUN
|
||||
%type <name> NOUN DECLARATIVE CONDITIONAL
|
||||
|
||||
%%
|
||||
|
||||
sentence_list : sentence
|
||||
| sentence_list NEWLINE sentence
|
||||
;
|
||||
|
||||
|
||||
sentence : verb_phrase noun_phrase position_phrase adverb period
|
||||
{
|
||||
printf("I understand that sentence.\n");
|
||||
printf("VP = %s \n",$1);
|
||||
printf("NP = %s \n",$2);
|
||||
printf("PP = %s \n",$3);
|
||||
printf("AD = %s \n",$4);
|
||||
}
|
||||
| { yyerror("That's a strange sentence !!"); }
|
||||
;
|
||||
|
||||
position_phrase : POSITIONAL declarative PROPER_NOUN
|
||||
{
|
||||
sprintf($$,"%s %s %s",$1,$2,$3);
|
||||
}
|
||||
| /* empty */ { strcpy($$,""); }
|
||||
;
|
||||
|
||||
|
||||
verb_phrase : VERB { strcpy($$,$1); strcat($$," "); }
|
||||
| adverb VERB
|
||||
{
|
||||
sprintf($$,"%s %s",$1,$2);
|
||||
}
|
||||
;
|
||||
|
||||
adverb : ADVERB { strcpy($$,$1); }
|
||||
| /* empty */ { strcpy($$,""); }
|
||||
;
|
||||
|
||||
noun_phrase : DECLARATIVE NOUN
|
||||
{
|
||||
sprintf($$,"%s %s",$1,$2);
|
||||
}
|
||||
| CONDITIONAL declarative NOUN
|
||||
{
|
||||
sprintf($$,"%s %s %s",$1,$2,$3);
|
||||
}
|
||||
| NOUN { strcpy($$,$1); strcat($$," "); }
|
||||
;
|
||||
|
||||
declarative : DECLARATIVE { strcpy($$,$1); }
|
||||
| /* empty */ { strcpy($$,""); }
|
||||
;
|
||||
|
||||
period : /* empty */
|
||||
| PERIOD
|
||||
;
|
||||
|
||||
|
||||
%%
|
||||
|
||||
/* Supplied main() and yyerror() functions. */
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
yyparse(); /* parse the file */
|
||||
return(0);
|
||||
}
|
||||
|
||||
int yyerror(char *message)
|
||||
{
|
||||
extern FILE *yyout;
|
||||
|
||||
fprintf(yyout,"\nError at line %5d. (%s) \n",
|
||||
yylexlinenum,message);
|
||||
}
|
||||
442
external/bsd/flex/dist/examples/manual/j2t.lex
vendored
Normal file
442
external/bsd/flex/dist/examples/manual/j2t.lex
vendored
Normal file
@@ -0,0 +1,442 @@
|
||||
/*
|
||||
* j2t.lex : An example of the use (possibly abuse!)
|
||||
* of start states.
|
||||
*/
|
||||
|
||||
%{
|
||||
#define MAX_STATES 1024
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
|
||||
#define CHAPTER "@chapter"
|
||||
#define SECTION "@section"
|
||||
#define SSECTION "@subsection"
|
||||
#define SSSECTION "@subsubsection"
|
||||
|
||||
int states[MAX_STATES];
|
||||
int statep = 0;
|
||||
|
||||
int need_closing = FALSE;
|
||||
|
||||
char buffer[YY_BUF_SIZE];
|
||||
|
||||
extern char *yytext;
|
||||
|
||||
/*
|
||||
* set up the head of the *.texinfo file the program
|
||||
* will produce. This is a standard texinfo header.
|
||||
*/
|
||||
|
||||
void print_header(void)
|
||||
{
|
||||
printf("\\input texinfo @c -*-texinfo-*-\n");
|
||||
printf("@c %c**start of header\n",'%');
|
||||
printf("@setfilename jargon.info\n");
|
||||
printf("@settitle The New Hackers Dictionary\n");
|
||||
printf("@synindex fn cp\n");
|
||||
printf("@synindex vr cp\n");
|
||||
printf("@c %c**end of header\n",'%');
|
||||
printf("@setchapternewpage odd\n");
|
||||
printf("@finalout\n");
|
||||
printf("@c @smallbook\n");
|
||||
printf("\n");
|
||||
printf("@c ==========================================================\n\n");
|
||||
printf("@c This file was produced by j2t. Any mistakes are *not* the\n");
|
||||
printf("@c fault of the jargon file editors. \n");
|
||||
printf("@c ==========================================================\n\n");
|
||||
printf("@titlepage\n");
|
||||
printf("@title The New Hackers Dictionary\n");
|
||||
printf("@subtitle Version 2.9.10\n");
|
||||
printf("@subtitle Generated by j2t\n");
|
||||
printf("@author Eric S. Raymond, Guy L. Steel, Mark Crispin et al.\n");
|
||||
printf("@end titlepage\n");
|
||||
printf("@page\n");
|
||||
printf("\n@c ==========================================================\n");
|
||||
printf("\n\n");
|
||||
printf("@unnumbered Preface\n");
|
||||
printf("@c *******\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* create the tail of the texinfo file produced.
|
||||
*/
|
||||
|
||||
void print_trailer(void)
|
||||
{
|
||||
printf("\n@c ==========================================================\n");
|
||||
printf("@contents\n"); /* print the table of contents */
|
||||
printf("@bye\n\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* write an underline under a section
|
||||
* or chapter so we can find it later.
|
||||
*/
|
||||
|
||||
void write_underline(int len, int space, char ch)
|
||||
{
|
||||
int loop;
|
||||
|
||||
printf("@c ");
|
||||
|
||||
for(loop=3; loop<space; loop++){
|
||||
printf(" ");
|
||||
}
|
||||
|
||||
while(len--){
|
||||
printf("%c",ch);
|
||||
}
|
||||
printf("\n\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* check for texinfo special characters
|
||||
* and escape them
|
||||
*/
|
||||
|
||||
char *check_and_convert(char *string)
|
||||
{
|
||||
int buffpos = 0;
|
||||
int len,loop;
|
||||
|
||||
len = strlen(string);
|
||||
for(loop=0; loop<len; loop++){
|
||||
if(string[loop] == '@' || string[loop] == '{' || string[loop] == '}'){
|
||||
buffer[buffpos++] = '@';
|
||||
buffer[buffpos++] = string[loop];
|
||||
} else {
|
||||
buffer[buffpos++] = string[loop];
|
||||
}
|
||||
}
|
||||
buffer[buffpos] = '\0';
|
||||
return(buffer);
|
||||
}
|
||||
|
||||
/*
|
||||
* write out a chapter,section, or subsection
|
||||
* header
|
||||
*/
|
||||
|
||||
void write_block_header(char *type)
|
||||
{
|
||||
int loop;
|
||||
int len;
|
||||
|
||||
(void)check_and_convert(yytext);
|
||||
len = strlen(buffer);
|
||||
for(loop=0; buffer[loop] != '\n';loop++)
|
||||
;
|
||||
buffer[loop] = '\0';
|
||||
printf("%s %s\n",type,buffer);
|
||||
write_underline(strlen(buffer),strlen(type)+1,'*');
|
||||
}
|
||||
|
||||
%}
|
||||
|
||||
/*
|
||||
* the flex description starts here
|
||||
*/
|
||||
|
||||
%x HEADING EXAMPLE ENUM EXAMPLE2
|
||||
%x BITEM BITEM_ITEM
|
||||
%s LITEM LITEM2
|
||||
|
||||
%%
|
||||
|
||||
^#[^#]*"#" /* skip the header & trailer */
|
||||
/* chapters have asterisks under them
|
||||
* and are terminated by a colon
|
||||
*/
|
||||
^[^\n:]+\n[*]+\n write_block_header(CHAPTER);
|
||||
|
||||
^"= "[A-Z]" ="\n"="* { /* we create a seciton for each category */
|
||||
if(need_closing == TRUE){
|
||||
printf("@end table\n\n\n");
|
||||
}
|
||||
need_closing = TRUE;
|
||||
write_block_header(SECTION);
|
||||
printf("\n\n@table @b\n");
|
||||
}
|
||||
|
||||
"Examples:"[^\.]+ ECHO;
|
||||
|
||||
"*"[^*\n]+"*" { /* @emph{}(emphasized) text */
|
||||
yytext[yyleng-1] = '\0';
|
||||
(void)check_and_convert(&yytext[1]);
|
||||
printf("@i{%s}",buffer);
|
||||
}
|
||||
|
||||
"{{"[^}]+"}}" { /* special emphasis */
|
||||
yytext[yyleng-2] = '\0';
|
||||
(void)check_and_convert(&yytext[2]);
|
||||
printf("@b{%s}",buffer);
|
||||
}
|
||||
|
||||
"{"[^}]+"}" { /* special emphasis */
|
||||
yytext[yyleng-1] = '\0';
|
||||
(void)check_and_convert(&yytext[1]);
|
||||
printf("@b{%s}",buffer);
|
||||
}
|
||||
|
||||
/* escape some special texinfo characters */
|
||||
<INITIAL,LITEM,LITEM2,BITEM,ENUM,EXAMPLE,EXAMPLE2>"@" printf("@@");
|
||||
<INITIAL,LITEM,LITEM2,BITEM,ENUM,EXAMPLE,EXAMPLE2>"{" printf("@{");
|
||||
<INITIAL,LITEM,LITEM2,BITEM,ENUM,EXAMPLE,EXAMPLE2>"}" printf("@}");
|
||||
|
||||
/*
|
||||
* reproduce @example code
|
||||
*/
|
||||
|
||||
":"\n+[^\n0-9*]+\n" "[^ ] {
|
||||
int loop;
|
||||
int len;
|
||||
int cnt;
|
||||
|
||||
printf(":\n\n@example \n");
|
||||
strcpy(buffer,yytext);
|
||||
len = strlen(buffer);
|
||||
cnt = 0;
|
||||
for(loop=len; loop > 0;loop--){
|
||||
if(buffer[loop] == '\n')
|
||||
cnt++;
|
||||
if(cnt == 2)
|
||||
break;
|
||||
}
|
||||
yyless(loop+1);
|
||||
statep++;
|
||||
states[statep] = EXAMPLE2;
|
||||
BEGIN(EXAMPLE2);
|
||||
}
|
||||
<EXAMPLE,EXAMPLE2>^\n {
|
||||
printf("@end example\n\n");
|
||||
statep--;
|
||||
BEGIN(states[statep]);
|
||||
}
|
||||
|
||||
/*
|
||||
* repoduce @enumerate lists
|
||||
*/
|
||||
|
||||
":"\n+[ \t]*[0-9]+"." {
|
||||
int loop;
|
||||
int len;
|
||||
|
||||
printf(":\n\n@enumerate \n");
|
||||
strcpy(buffer,yytext);
|
||||
len = strlen(buffer);
|
||||
for(loop=len; loop > 0;loop--){
|
||||
if(buffer[loop] == '\n')
|
||||
break;
|
||||
}
|
||||
yyless(loop);
|
||||
statep++;
|
||||
states[statep] = ENUM;
|
||||
BEGIN(ENUM);
|
||||
}
|
||||
|
||||
<ENUM>"@" printf("@@");
|
||||
<ENUM>":"\n+" "[^0-9] {
|
||||
printf(":\n\n@example\n");
|
||||
statep++;
|
||||
states[statep] = EXAMPLE;
|
||||
BEGIN(EXAMPLE);
|
||||
}
|
||||
|
||||
|
||||
<ENUM>\n[ \t]+[0-9]+"." {
|
||||
printf("\n\n@item ");
|
||||
}
|
||||
<ENUM>^[^ ] |
|
||||
<ENUM>\n\n\n[ \t]+[^0-9] {
|
||||
printf("\n\n@end enumerate\n\n");
|
||||
statep--;
|
||||
BEGIN(states[statep]);
|
||||
}
|
||||
|
||||
/*
|
||||
* reproduce one kind of @itemize list
|
||||
*/
|
||||
|
||||
":"\n+":" {
|
||||
int loop;
|
||||
int len;
|
||||
|
||||
printf(":\n\n@itemize @bullet \n");
|
||||
yyless(2);
|
||||
statep++;
|
||||
states[statep] = LITEM2;
|
||||
BEGIN(LITEM2);
|
||||
}
|
||||
<LITEM2>^":".+":" {
|
||||
(void)check_and_convert(&yytext[1]);
|
||||
buffer[strlen(buffer)-1]='\0';
|
||||
printf("@item @b{%s:}\n",buffer);
|
||||
}
|
||||
|
||||
<LITEM2>\n\n\n+[^:\n] {
|
||||
printf("\n\n@end itemize\n\n");
|
||||
ECHO;
|
||||
statep--;
|
||||
BEGIN(states[statep]);
|
||||
}
|
||||
|
||||
/*
|
||||
* create a list out of the revision history part.
|
||||
* We need the "Version" for this because it
|
||||
* clashes with other rules otherwise.
|
||||
*/
|
||||
|
||||
:[\n]+"Version"[^:\n*]+":" {
|
||||
int loop;
|
||||
int len;
|
||||
|
||||
printf(":\n\n@itemize @bullet \n");
|
||||
strcpy(buffer,yytext);
|
||||
len = strlen(buffer);
|
||||
for(loop=len; loop > 0;loop--){
|
||||
if(buffer[loop] == '\n')
|
||||
break;
|
||||
}
|
||||
yyless(loop);
|
||||
statep++;
|
||||
states[statep] = LITEM;
|
||||
BEGIN(LITEM);
|
||||
}
|
||||
<LITEM>^.+":" {
|
||||
(void)check_and_convert(yytext);
|
||||
buffer[strlen(buffer)-1]='\0';
|
||||
printf("@item @b{%s}\n\n",buffer);
|
||||
}
|
||||
|
||||
<LITEM>^[^:\n]+\n\n[^:\n]+\n {
|
||||
int loop;
|
||||
|
||||
strcpy(buffer,yytext);
|
||||
for(loop=0; buffer[loop] != '\n'; loop++);
|
||||
buffer[loop] = '\0';
|
||||
printf("%s\n",buffer);
|
||||
printf("@end itemize\n\n");
|
||||
printf("%s",&buffer[loop+1]);
|
||||
statep--;
|
||||
BEGIN(states[statep]);
|
||||
}
|
||||
|
||||
/*
|
||||
* reproduce @itemize @bullet lists
|
||||
*/
|
||||
|
||||
":"\n[ ]*"*" {
|
||||
int loop;
|
||||
int len;
|
||||
|
||||
printf(":\n\n@itemize @bullet \n");
|
||||
len = strlen(buffer);
|
||||
for(loop=0; loop < len;loop++){
|
||||
if(buffer[loop] == '\n')
|
||||
break;
|
||||
}
|
||||
yyless((len-loop)+2);
|
||||
statep++;
|
||||
states[statep] = BITEM;
|
||||
BEGIN(BITEM);
|
||||
}
|
||||
|
||||
<BITEM>^" "*"*" {
|
||||
printf("@item");
|
||||
statep++;
|
||||
states[statep] = BITEM_ITEM;
|
||||
BEGIN(BITEM_ITEM);
|
||||
}
|
||||
<BITEM>"@" printf("@@");
|
||||
<BITEM>^\n {
|
||||
printf("@end itemize\n\n");
|
||||
statep--;
|
||||
BEGIN(states[statep]);
|
||||
}
|
||||
<BITEM_ITEM>[^\:]* {
|
||||
printf(" @b{%s}\n\n",check_and_convert(yytext));
|
||||
}
|
||||
<BITEM_ITEM>":" {
|
||||
statep--;
|
||||
BEGIN(states[statep]);
|
||||
}
|
||||
|
||||
/*
|
||||
* recreate @chapter, @section etc.
|
||||
*/
|
||||
|
||||
^:[^:]* {
|
||||
(void)check_and_convert(&yytext[1]);
|
||||
statep++;
|
||||
states[statep] = HEADING;
|
||||
BEGIN(HEADING);
|
||||
}
|
||||
<HEADING>:[^\n] {
|
||||
printf("@item @b{%s}\n",buffer);
|
||||
write_underline(strlen(buffer),6,'~');
|
||||
statep--;
|
||||
BEGIN(states[statep]);
|
||||
}
|
||||
<HEADING>:\n"*"* {
|
||||
if(need_closing == TRUE){
|
||||
printf("@end table\n\n\n");
|
||||
need_closing = FALSE;
|
||||
}
|
||||
printf("@chapter %s\n",buffer);
|
||||
write_underline(strlen(buffer),9,'*');
|
||||
statep--;
|
||||
BEGIN(states[statep]);
|
||||
}
|
||||
<HEADING>:\n"="* {
|
||||
if(need_closing == TRUE){
|
||||
printf("@end table\n\n\n");
|
||||
need_closing = FALSE;
|
||||
}
|
||||
printf("@section %s\n",buffer);
|
||||
write_underline(strlen(buffer),9,'=');
|
||||
statep--;
|
||||
BEGIN(states[statep]);
|
||||
}
|
||||
<HEADING>"@" printf("@@");
|
||||
<HEADING>:\n"-"* {
|
||||
if(need_closing == TRUE){
|
||||
printf("@end table\n\n\n");
|
||||
need_closing = FALSE;
|
||||
}
|
||||
printf("@subsection %s\n",buffer);
|
||||
write_underline(strlen(buffer),12,'-');
|
||||
statep--;
|
||||
BEGIN(states[statep]);
|
||||
}
|
||||
|
||||
/*
|
||||
* recreate @example text
|
||||
*/
|
||||
|
||||
^" " {
|
||||
printf("@example\n");
|
||||
statep++;
|
||||
states[statep] = EXAMPLE;
|
||||
BEGIN(EXAMPLE);
|
||||
}
|
||||
<EXAMPLE>^" "
|
||||
. ECHO;
|
||||
|
||||
%%
|
||||
|
||||
/*
|
||||
* initialise and go.
|
||||
*/
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
states[0] = INITIAL;
|
||||
statep = 0;
|
||||
print_header();
|
||||
yylex();
|
||||
print_trailer();
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
15
external/bsd/flex/dist/examples/manual/myname.lex
vendored
Normal file
15
external/bsd/flex/dist/examples/manual/myname.lex
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
*
|
||||
* myname.lex : A sample Flex program
|
||||
* that does token replacement.
|
||||
*/
|
||||
|
||||
%%
|
||||
|
||||
%NAME { printf("%s",getenv("LOGNAME")); }
|
||||
%HOST { printf("%s",getenv("HOST")); }
|
||||
%HOSTTYPE { printf("%s",getenv("HOSTTYPE"));}
|
||||
%HOME { printf("%s",getenv("HOME")); }
|
||||
|
||||
%%
|
||||
|
||||
6
external/bsd/flex/dist/examples/manual/myname.txt
vendored
Normal file
6
external/bsd/flex/dist/examples/manual/myname.txt
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
Hello, my name name is %NAME. Actually
|
||||
"%NAME" isn't my real name, it is the
|
||||
alias I use when I'm on %HOST, which
|
||||
is the %HOSTTYPE I use. My HOME
|
||||
directory is %HOME.
|
||||
|
||||
19
external/bsd/flex/dist/examples/manual/myname2.lex
vendored
Normal file
19
external/bsd/flex/dist/examples/manual/myname2.lex
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* myname2.lex : A sample Flex program
|
||||
* that does token replacement.
|
||||
*/
|
||||
|
||||
%{
|
||||
#include <stdio.h>
|
||||
%}
|
||||
|
||||
%x STRING
|
||||
%%
|
||||
\" ECHO; BEGIN(STRING);
|
||||
<STRING>[^\"\n]* ECHO;
|
||||
<STRING>\" ECHO; BEGIN(INITIAL);
|
||||
|
||||
%NAME { printf("%s",getenv("LOGNAME")); }
|
||||
%HOST { printf("%s",getenv("HOST")); }
|
||||
%HOSTTYPE { printf("%s",getenv("HOSTTYPE"));}
|
||||
%HOME { printf("%s",getenv("HOME")); }
|
||||
145
external/bsd/flex/dist/examples/manual/numbers.lex
vendored
Normal file
145
external/bsd/flex/dist/examples/manual/numbers.lex
vendored
Normal file
@@ -0,0 +1,145 @@
|
||||
/*
|
||||
* numbers.lex : An example of the definitions and techniques
|
||||
* for scanning numbers
|
||||
*/
|
||||
|
||||
%{
|
||||
#include <stdio.h>
|
||||
|
||||
#define UNSIGNED_LONG_SYM 1
|
||||
#define SIGNED_LONG_SYM 2
|
||||
#define UNSIGNED_SYM 3
|
||||
#define SIGNED_SYM 4
|
||||
#define LONG_DOUBLE_SYM 5
|
||||
#define FLOAT_SYM 6
|
||||
|
||||
union _yylval {
|
||||
long double ylong_double;
|
||||
float yfloat;
|
||||
unsigned long yunsigned_long;
|
||||
unsigned yunsigned;
|
||||
long ysigned_long;
|
||||
int ysigned;
|
||||
} yylval;
|
||||
|
||||
%}
|
||||
|
||||
digit [0-9]
|
||||
hex_digit [0-9a-fA-F]
|
||||
oct_digit [0-7]
|
||||
|
||||
exponent [eE][+-]?{digit}+
|
||||
i {digit}+
|
||||
float_constant ({i}\.{i}?|{i}?\.{i}){exponent}?
|
||||
hex_constant 0[xX]{hex_digit}+
|
||||
oct_constant 0{oct_digit}*
|
||||
int_constant {digit}+
|
||||
long_ext [lL]
|
||||
unsigned_ext [uU]
|
||||
float_ext [fF]
|
||||
ulong_ext {long_ext}{unsigned_ext}|{unsigned_ext}{long_ext}
|
||||
|
||||
%%
|
||||
|
||||
{hex_constant}{ulong_ext} { /* we need to skip the "0x" part */
|
||||
sscanf(&yytext[2],"%lx",&yylval.yunsigned_long);
|
||||
return(UNSIGNED_LONG_SYM);
|
||||
}
|
||||
{hex_constant}{long_ext} {
|
||||
sscanf(&yytext[2],"%lx",&yylval.ysigned_long);
|
||||
return(SIGNED_LONG_SYM);
|
||||
}
|
||||
{hex_constant}{unsigned_ext} {
|
||||
sscanf(&yytext[2],"%x",&yylval.yunsigned);
|
||||
return(UNSIGNED_SYM);
|
||||
}
|
||||
{hex_constant} { /* use %lx to protect against overflow */
|
||||
sscanf(&yytext[2],"%lx",&yylval.ysigned_long);
|
||||
return(SIGNED_LONG_SYM);
|
||||
}
|
||||
{oct_constant}{ulong_ext} {
|
||||
sscanf(yytext,"%lo",&yylval.yunsigned_long);
|
||||
return(UNSIGNED_LONG_SYM);
|
||||
}
|
||||
{oct_constant}{long_ext} {
|
||||
sscanf(yytext,"%lo",&yylval.ysigned_long);
|
||||
return(SIGNED_LONG_SYM);
|
||||
}
|
||||
{oct_constant}{unsigned_ext} {
|
||||
sscanf(yytext,"%o",&yylval.yunsigned);
|
||||
return(UNSIGNED_SYM);
|
||||
}
|
||||
{oct_constant} { /* use %lo to protect against overflow */
|
||||
sscanf(yytext,"%lo",&yylval.ysigned_long);
|
||||
return(SIGNED_LONG_SYM);
|
||||
}
|
||||
{int_constant}{ulong_ext} {
|
||||
sscanf(yytext,"%ld",&yylval.yunsigned_long);
|
||||
return(UNSIGNED_LONG_SYM);
|
||||
}
|
||||
{int_constant}{long_ext} {
|
||||
sscanf(yytext,"%ld",&yylval.ysigned_long);
|
||||
return(SIGNED_LONG_SYM);
|
||||
}
|
||||
{int_constant}{unsigned_ext} {
|
||||
sscanf(yytext,"%d",&yylval.yunsigned);
|
||||
return(UNSIGNED_SYM);
|
||||
}
|
||||
{int_constant} { /* use %ld to protect against overflow */
|
||||
sscanf(yytext,"%ld",&yylval.ysigned_long);
|
||||
return(SIGNED_LONG_SYM);
|
||||
}
|
||||
{float_constant}{long_ext} {
|
||||
sscanf(yytext,"%lf",&yylval.ylong_double);
|
||||
return(LONG_DOUBLE_SYM);
|
||||
}
|
||||
{float_constant}{float_ext} {
|
||||
sscanf(yytext,"%f",&yylval.yfloat);
|
||||
return(FLOAT_SYM);
|
||||
}
|
||||
{float_constant} { /* use %lf to protect against overflow */
|
||||
sscanf(yytext,"%lf",&yylval.ylong_double);
|
||||
return(LONG_DOUBLE_SYM);
|
||||
}
|
||||
%%
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int code;
|
||||
|
||||
while((code = yylex())){
|
||||
printf("yytext : %s\n",yytext);
|
||||
switch(code){
|
||||
case UNSIGNED_LONG_SYM:
|
||||
printf("Type of number : UNSIGNED LONG\n");
|
||||
printf("Value of number : %lu\n",yylval.yunsigned_long);
|
||||
break;
|
||||
case SIGNED_LONG_SYM:
|
||||
printf("Type of number : SIGNED LONG\n");
|
||||
printf("Value of number : %ld\n",yylval.ysigned_long);
|
||||
break;
|
||||
case UNSIGNED_SYM:
|
||||
printf("Type of number : UNSIGNED\n");
|
||||
printf("Value of number : %u\n",yylval.yunsigned);
|
||||
break;
|
||||
case SIGNED_SYM:
|
||||
printf("Type of number : SIGNED\n");
|
||||
printf("Value of number : %d\n",yylval.ysigned);
|
||||
break;
|
||||
case LONG_DOUBLE_SYM:
|
||||
printf("Type of number : LONG DOUBLE\n");
|
||||
printf("Value of number : %lf\n",yylval.ylong_double);
|
||||
break;
|
||||
case FLOAT_SYM:
|
||||
printf("Type of number : FLOAT\n");
|
||||
printf("Value of number : %f\n",yylval.yfloat);
|
||||
break;
|
||||
default:
|
||||
printf("Type of number : UNDEFINED\n");
|
||||
printf("Value of number : UNDEFINED\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
78
external/bsd/flex/dist/examples/manual/pas_include.lex
vendored
Normal file
78
external/bsd/flex/dist/examples/manual/pas_include.lex
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* eof_rules.lex : An example of using multiple buffers
|
||||
* EOF rules, and start states
|
||||
*/
|
||||
|
||||
%{
|
||||
|
||||
#define MAX_NEST 10
|
||||
|
||||
YY_BUFFER_STATE include_stack[MAX_NEST];
|
||||
int include_count = -1;
|
||||
|
||||
%}
|
||||
|
||||
|
||||
%x INCLUDE
|
||||
%x COMMENT
|
||||
|
||||
|
||||
%%
|
||||
|
||||
"{" BEGIN(COMMENT);
|
||||
|
||||
<COMMENT>"}" BEGIN(INITIAL);
|
||||
<COMMENT>"$include"[ \t]*"(" BEGIN(INCLUDE);
|
||||
<COMMENT>[ \t]* /* skip whitespace */
|
||||
|
||||
<INCLUDE>")" BEGIN(COMMENT);
|
||||
<INCLUDE>[ \t]* /* skip whitespace */
|
||||
<INCLUDE>[^ \t\n() ]+ { /* get the include file name */
|
||||
if ( include_count >= MAX_NEST){
|
||||
fprintf( stderr, "Too many include files" );
|
||||
exit( 1 );
|
||||
}
|
||||
|
||||
include_stack[++include_count] = YY_CURRENT_BUFFER;
|
||||
|
||||
yyin = fopen( yytext, "r" );
|
||||
if ( ! yyin ){
|
||||
fprintf( stderr, "Unable to open %s",yytext);
|
||||
exit( 1 );
|
||||
}
|
||||
|
||||
yy_switch_to_buffer(yy_create_buffer(yyin,YY_BUF_SIZE));
|
||||
|
||||
BEGIN(INITIAL);
|
||||
}
|
||||
<INCLUDE><<EOF>>
|
||||
{
|
||||
fprintf( stderr, "EOF in include" );
|
||||
yyterminate();
|
||||
}
|
||||
<COMMENT><<EOF>>
|
||||
{
|
||||
fprintf( stderr, "EOF in comment" );
|
||||
yyterminate();
|
||||
}
|
||||
<<EOF>> {
|
||||
if ( include_count <= 0 ){
|
||||
yyterminate();
|
||||
} else {
|
||||
yy_delete_buffer(include_stack[include_count--] );
|
||||
yy_switch_to_buffer(include_stack[include_count] );
|
||||
BEGIN(INCLUDE);
|
||||
}
|
||||
}
|
||||
[a-z]+ ECHO;
|
||||
.|\n ECHO;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
120
external/bsd/flex/dist/examples/manual/pascal.lex
vendored
Normal file
120
external/bsd/flex/dist/examples/manual/pascal.lex
vendored
Normal file
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
* pascal.lex: An example PASCAL scanner
|
||||
*
|
||||
*/
|
||||
|
||||
%{
|
||||
#include <stdio.h>
|
||||
#include "y.tab.h"
|
||||
|
||||
int line_number = 0;
|
||||
|
||||
void yyerror(char *message);
|
||||
|
||||
%}
|
||||
|
||||
%x COMMENT1 COMMENT2
|
||||
|
||||
white_space [ \t]*
|
||||
digit [0-9]
|
||||
alpha [A-Za-z_]
|
||||
alpha_num ({alpha}|{digit})
|
||||
hex_digit [0-9A-F]
|
||||
identifier {alpha}{alpha_num}*
|
||||
unsigned_integer {digit}+
|
||||
hex_integer ${hex_digit}{hex_digit}*
|
||||
exponent e[+-]?{digit}+
|
||||
i {unsigned_integer}
|
||||
real ({i}\.{i}?|{i}?\.{i}){exponent}?
|
||||
string \'([^'\n]|\'\')+\'
|
||||
bad_string \'([^'\n]|\'\')+
|
||||
|
||||
%%
|
||||
|
||||
"{" BEGIN(COMMENT1);
|
||||
<COMMENT1>[^}\n]+
|
||||
<COMMENT1>\n ++line_number;
|
||||
<COMMENT1><<EOF>> yyerror("EOF in comment");
|
||||
<COMMENT1>"}" BEGIN(INITIAL);
|
||||
|
||||
"(*" BEGIN(COMMENT2);
|
||||
<COMMENT2>[^)*\n]+
|
||||
<COMMENT2>\n ++line_number;
|
||||
<COMMENT2><<EOF>> yyerror("EOF in comment");
|
||||
<COMMENT2>"*)" BEGIN(INITIAL);
|
||||
<COMMENT2>[*)]
|
||||
|
||||
/* note that FILE and BEGIN are already
|
||||
* defined in FLEX or C so they can't
|
||||
* be used. This can be overcome in
|
||||
* a cleaner way by defining all the
|
||||
* tokens to start with TOK_ or some
|
||||
* other prefix.
|
||||
*/
|
||||
|
||||
and return(AND);
|
||||
array return(ARRAY);
|
||||
begin return(_BEGIN);
|
||||
case return(CASE);
|
||||
const return(CONST);
|
||||
div return(DIV);
|
||||
do return(DO);
|
||||
downto return(DOWNTO);
|
||||
else return(ELSE);
|
||||
end return(END);
|
||||
file return(_FILE);
|
||||
for return(FOR);
|
||||
function return(FUNCTION);
|
||||
goto return(GOTO);
|
||||
if return(IF);
|
||||
in return(IN);
|
||||
label return(LABEL);
|
||||
mod return(MOD);
|
||||
nil return(NIL);
|
||||
not return(NOT);
|
||||
of return(OF);
|
||||
packed return(PACKED);
|
||||
procedure return(PROCEDURE);
|
||||
program return(PROGRAM);
|
||||
record return(RECORD);
|
||||
repeat return(REPEAT);
|
||||
set return(SET);
|
||||
then return(THEN);
|
||||
to return(TO);
|
||||
type return(TYPE);
|
||||
until return(UNTIL);
|
||||
var return(VAR);
|
||||
while return(WHILE);
|
||||
with return(WITH);
|
||||
|
||||
"<="|"=<" return(LEQ);
|
||||
"=>"|">=" return(GEQ);
|
||||
"<>" return(NEQ);
|
||||
"=" return(EQ);
|
||||
|
||||
".." return(DOUBLEDOT);
|
||||
|
||||
{unsigned_integer} return(UNSIGNED_INTEGER);
|
||||
{real} return(REAL);
|
||||
{hex_integer} return(HEX_INTEGER);
|
||||
{string} return{STRING};
|
||||
{bad_string} yyerror("Unterminated string");
|
||||
|
||||
{identifier} return(IDENTIFIER);
|
||||
|
||||
[*/+\-,^.;:()\[\]] return(yytext[0]);
|
||||
|
||||
{white_space} /* do nothing */
|
||||
\n line_number += 1;
|
||||
. yyerror("Illegal input");
|
||||
|
||||
%%
|
||||
|
||||
void yyerror(char *message)
|
||||
{
|
||||
fprintf(stderr,"Error: \"%s\" in line %d. Token = %s\n",
|
||||
message,line_number,yytext);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
12
external/bsd/flex/dist/examples/manual/reject.lex
vendored
Normal file
12
external/bsd/flex/dist/examples/manual/reject.lex
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
* reject.lex: An example of REJECT and unput()
|
||||
* misuse.
|
||||
*/
|
||||
|
||||
%%
|
||||
UNIX {
|
||||
unput('U'); unput('N'); unput('G'); unput('\0');
|
||||
REJECT;
|
||||
}
|
||||
GNU printf("GNU is Not Unix!\n");
|
||||
%%
|
||||
33
external/bsd/flex/dist/examples/manual/replace.lex
vendored
Normal file
33
external/bsd/flex/dist/examples/manual/replace.lex
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* replace.lex : A simple filter for renaming
|
||||
* parts of flex of bison generated
|
||||
* scanners or parsers.
|
||||
*/
|
||||
|
||||
%{
|
||||
#include <stdio.h>
|
||||
|
||||
char lower_replace[1024];
|
||||
char upper_replace[1024];
|
||||
|
||||
%}
|
||||
|
||||
%%
|
||||
|
||||
"yy" printf("%s",lower_replace);
|
||||
"YY" printf("%s",upper_replace);
|
||||
, ECHO;
|
||||
|
||||
%%
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
if(argc < 2){
|
||||
printf("Usage %s lower UPPER\n",argv[0]);
|
||||
exit(1);
|
||||
}
|
||||
strcpy(lower_replace,argv[1]);
|
||||
strcpy(upper_replace,argv[2]);
|
||||
yylex();
|
||||
return(0);
|
||||
}
|
||||
98
external/bsd/flex/dist/examples/manual/string1.lex
vendored
Normal file
98
external/bsd/flex/dist/examples/manual/string1.lex
vendored
Normal file
@@ -0,0 +1,98 @@
|
||||
/*
|
||||
* string1.lex: Handling strings by using input()
|
||||
*/
|
||||
|
||||
%{
|
||||
#include <ctype.h>
|
||||
#include <malloc.h>
|
||||
|
||||
#define ALLOC_SIZE 32 /* for (re)allocating the buffer */
|
||||
|
||||
#define isodigit(x) ((x) >= '0' && (x) <= '7')
|
||||
#define hextoint(x) (isdigit((x)) ? (x) - '0' : ((x) - 'A') + 10)
|
||||
|
||||
void yyerror(char *message)
|
||||
{
|
||||
printf("\nError: %s\n",message);
|
||||
}
|
||||
|
||||
%}
|
||||
|
||||
%%
|
||||
|
||||
\" {
|
||||
int inch,count,max_size;
|
||||
char *buffer;
|
||||
int temp;
|
||||
|
||||
buffer = malloc(ALLOC_SIZE);
|
||||
max_size = ALLOC_SIZE;
|
||||
inch = input();
|
||||
count = 0;
|
||||
while(inch != EOF && inch != '"' && inch != '\n'){
|
||||
if(inch == '\\'){
|
||||
inch = input();
|
||||
switch(inch){
|
||||
case '\n': inch = input(); break;
|
||||
case 'b' : inch = '\b'; break;
|
||||
case 't' : inch = '\t'; break;
|
||||
case 'n' : inch = '\n'; break;
|
||||
case 'v' : inch = '\v'; break;
|
||||
case 'f' : inch = '\f'; break;
|
||||
case 'r' : inch = '\r'; break;
|
||||
case 'X' :
|
||||
case 'x' : inch = input();
|
||||
if(isxdigit(inch)){
|
||||
temp = hextoint(toupper(inch));
|
||||
inch = input();
|
||||
if(isxdigit(inch)){
|
||||
temp = (temp << 4) + hextoint(toupper(inch));
|
||||
} else {
|
||||
unput(inch);
|
||||
}
|
||||
inch = temp;
|
||||
} else {
|
||||
unput(inch);
|
||||
inch = 'x';
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if(isodigit(inch)){
|
||||
temp = inch - '0';
|
||||
inch = input();
|
||||
if(isodigit(inch)){
|
||||
temp = (temp << 3) + (inch - '0');
|
||||
} else {
|
||||
unput(inch);
|
||||
goto done;
|
||||
}
|
||||
inch = input();
|
||||
if(isodigit(inch)){
|
||||
temp = (temp << 3) + (inch - '0');
|
||||
} else {
|
||||
unput(inch);
|
||||
}
|
||||
done:
|
||||
inch = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
buffer[count++] = inch;
|
||||
if(count >= max_size){
|
||||
buffer = realloc(buffer,max_size + ALLOC_SIZE);
|
||||
max_size += ALLOC_SIZE;
|
||||
}
|
||||
inch = input();
|
||||
}
|
||||
if(inch == EOF || inch == '\n'){
|
||||
yyerror("Unterminated string.");
|
||||
}
|
||||
buffer[count] = '\0';
|
||||
printf("String = \"%s\"\n",buffer);
|
||||
free(buffer);
|
||||
}
|
||||
.
|
||||
\n
|
||||
%%
|
||||
|
||||
|
||||
94
external/bsd/flex/dist/examples/manual/string2.lex
vendored
Normal file
94
external/bsd/flex/dist/examples/manual/string2.lex
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* string2.lex: An example of using scanning strings
|
||||
* by using start states.
|
||||
*/
|
||||
|
||||
%{
|
||||
#include <ctype.h>
|
||||
#include <malloc.h>
|
||||
|
||||
#define isodigit(x) ((x) >= '0' && (x) <= '7')
|
||||
#define hextoint(x) (isdigit((x)) ? (x) - '0' : ((x) - 'A') + 10)
|
||||
|
||||
char *buffer = NULL;
|
||||
int buffer_size = 0;
|
||||
|
||||
void yyerror(char *message)
|
||||
{
|
||||
printf("\nError: %s\n",message);
|
||||
}
|
||||
|
||||
%}
|
||||
|
||||
%x STRING
|
||||
|
||||
hex (x|X)[0-9a-fA-F]{1,2}
|
||||
oct [0-7]{1,3}
|
||||
|
||||
%%
|
||||
|
||||
\" {
|
||||
buffer = malloc(1);
|
||||
buffer_size = 1; strcpy(buffer,"");
|
||||
BEGIN(STRING);
|
||||
}
|
||||
<STRING>\n {
|
||||
yyerror("Unterminated string");
|
||||
free(buffer);
|
||||
BEGIN(INITIAL);
|
||||
}
|
||||
<STRING><<EOF>> {
|
||||
yyerror("EOF in string");
|
||||
free(buffer);
|
||||
BEGIN(INITIAL);
|
||||
}
|
||||
<STRING>[^\\\n"] {
|
||||
buffer = realloc(buffer,buffer_size+yyleng+1);
|
||||
buffer_size += yyleng;
|
||||
strcat(buffer,yytext);
|
||||
}
|
||||
<STRING>\\\n /* ignore this */
|
||||
<STRING>\\{hex} {
|
||||
int temp =0,loop = 0;
|
||||
for(loop=yyleng-2; loop>0; loop--){
|
||||
temp <<= 4;
|
||||
temp += hextoint(toupper(yytext[yyleng-loop]));
|
||||
}
|
||||
buffer = realloc(buffer,buffer_size+1);
|
||||
buffer[buffer_size-1] = temp;
|
||||
buffer[buffer_size] = '\0';
|
||||
buffer_size += 1;
|
||||
}
|
||||
<STRING>\\{oct} {
|
||||
int temp =0,loop = 0;
|
||||
for(loop=yyleng-1; loop>0; loop--){
|
||||
temp <<= 3;
|
||||
temp += (yytext[yyleng-loop] - '0');
|
||||
}
|
||||
buffer = realloc(buffer,buffer_size+1);
|
||||
buffer[buffer_size-1] = temp;
|
||||
buffer[buffer_size] = '\0';
|
||||
buffer_size += 1;
|
||||
}
|
||||
<STRING>\\[^\n] {
|
||||
buffer = realloc(buffer,buffer_size+1);
|
||||
switch(yytext[yyleng-1]){
|
||||
case 'b' : buffer[buffer_size-1] = '\b'; break;
|
||||
case 't' : buffer[buffer_size-1] = '\t'; break;
|
||||
case 'n' : buffer[buffer_size-1] = '\n'; break;
|
||||
case 'v' : buffer[buffer_size-1] = '\v'; break;
|
||||
case 'f' : buffer[buffer_size-1] = '\f'; break;
|
||||
case 'r' : buffer[buffer_size-1] = '\r'; break;
|
||||
default : buffer[buffer_size-1] = yytext[yyleng-1];
|
||||
}
|
||||
buffer[buffer_size] = '\0';
|
||||
buffer_size += 1;
|
||||
}
|
||||
<STRING>\" {
|
||||
printf("string = \"%s\"",buffer);
|
||||
free(buffer);
|
||||
BEGIN(INITIAL);
|
||||
}
|
||||
%%
|
||||
|
||||
|
||||
21
external/bsd/flex/dist/examples/manual/strtest.dat
vendored
Normal file
21
external/bsd/flex/dist/examples/manual/strtest.dat
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
"This is a string"
|
||||
"The next string will be empty"
|
||||
""
|
||||
"This is a string with a \b(\\b) in it"
|
||||
"This is a string with a \t(\\t) in it"
|
||||
"This is a string with a \n(\\n) in it"
|
||||
"This is a string with a \v(\\v) in it"
|
||||
"This is a string with a \f(\\f) in it"
|
||||
"This is a string with a \r(\\r) in it"
|
||||
"This is a string with a \"(\\\") in it"
|
||||
"This is a string with a \z(\\z) in it"
|
||||
"This is a string with a \X4a(\\X4a) in it"
|
||||
"This is a string with a \x4a(\\x4a) in it"
|
||||
"This is a string with a \x7(\\x7) in it"
|
||||
"This is a string with a \112(\\112) in it"
|
||||
"This is a string with a \043(\\043) in it"
|
||||
"This is a string with a \7(\\7) in it"
|
||||
"This is a multi-line \
|
||||
string"
|
||||
"This is an unterminated string
|
||||
"This is an unterminated string too
|
||||
32
external/bsd/flex/dist/examples/manual/unput.lex
vendored
Normal file
32
external/bsd/flex/dist/examples/manual/unput.lex
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* unput.l : An example of what *not*
|
||||
* to do with unput().
|
||||
*/
|
||||
|
||||
|
||||
%{
|
||||
#include <stdio.h>
|
||||
|
||||
void putback_yytext(void);
|
||||
%}
|
||||
|
||||
%%
|
||||
foobar putback_yytext();
|
||||
raboof putback_yytext();
|
||||
%%
|
||||
|
||||
void putback_yytext(void)
|
||||
{
|
||||
int i;
|
||||
int l = strlen(yytext);
|
||||
char buffer[YY_BUF_SIZE];
|
||||
|
||||
strcpy(buffer,yytext);
|
||||
printf("Got: %s\n",yytext);
|
||||
for(i=0; i<l; i++){
|
||||
unput(buffer[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
31
external/bsd/flex/dist/examples/manual/user_act.lex
vendored
Normal file
31
external/bsd/flex/dist/examples/manual/user_act.lex
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
%{
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
void user_action(void);
|
||||
|
||||
#define YY_USER_ACTION user_action();
|
||||
|
||||
%}
|
||||
|
||||
%%
|
||||
|
||||
.* ECHO;
|
||||
\n ECHO;
|
||||
|
||||
%%
|
||||
|
||||
void user_action(void)
|
||||
{
|
||||
int loop;
|
||||
|
||||
for(loop=0; loop<yyleng; loop++){
|
||||
if(islower(yytext[loop])){
|
||||
yytext[loop] = toupper(yytext[loop]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
30
external/bsd/flex/dist/examples/manual/userinit.lex
vendored
Normal file
30
external/bsd/flex/dist/examples/manual/userinit.lex
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
%{
|
||||
#define YY_USER_INIT open_input_file()
|
||||
|
||||
extern FILE *yyin;
|
||||
|
||||
void open_input_file(void)
|
||||
{
|
||||
char *file_name,buffer[1024];
|
||||
|
||||
yyin = NULL;
|
||||
|
||||
while(yyin == NULL){
|
||||
printf("Input file: ");
|
||||
file_name = fgets(buffer,1024,stdin);
|
||||
if(file_name){
|
||||
file_name[strlen(file_name)-1] = '\0';
|
||||
yyin = fopen(file_name,"r");
|
||||
if(yyin == NULL){
|
||||
printf("Unable to open \"%s\"\n",file_name);
|
||||
}
|
||||
} else {
|
||||
printf("stdin\n");
|
||||
yyin = stdin;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
%}
|
||||
%%
|
||||
122
external/bsd/flex/dist/examples/manual/wc.lex
vendored
Normal file
122
external/bsd/flex/dist/examples/manual/wc.lex
vendored
Normal file
@@ -0,0 +1,122 @@
|
||||
%{
|
||||
|
||||
/*
|
||||
* wc.lex : A simple example of using FLEX
|
||||
* to create a wc-like utility.
|
||||
*
|
||||
* See MISC/fastwc/ in the flex distribution for examples
|
||||
* of how to write this scanner for maximum performance.
|
||||
*/
|
||||
|
||||
int numchars = 0;
|
||||
int numwords = 0;
|
||||
int numlines = 0;
|
||||
int totchars = 0;
|
||||
int totwords = 0;
|
||||
int totlines = 0;
|
||||
|
||||
/*
|
||||
* rules start from here
|
||||
*/
|
||||
|
||||
%}
|
||||
|
||||
%%
|
||||
|
||||
[\n] { numchars++; numlines++; }
|
||||
[\r] { numchars++; }
|
||||
[^ \t\n]+ { numwords++; numchars += yyleng; }
|
||||
. { numchars++; }
|
||||
|
||||
%%
|
||||
|
||||
/*
|
||||
* additional C code start from here. This supplies
|
||||
* all the argument processing etc.
|
||||
*/
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int loop,first=1;
|
||||
int lflag = 0; /* 1 if we count # of lines */
|
||||
int wflag = 0; /* 1 if we count # of words */
|
||||
int cflag = 0; /* 1 if we count # of characters */
|
||||
int fflag = 0; /* 1 if we have a file name */
|
||||
|
||||
for(loop=1; loop<argc; loop++){
|
||||
if(argv[loop][0] == '-'){
|
||||
switch(argv[loop][1]){
|
||||
case 'l':
|
||||
lflag = 1;
|
||||
break;
|
||||
case 'w':
|
||||
wflag = 1;
|
||||
break;
|
||||
case 'c':
|
||||
cflag = 1;
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr,"unknown option -%c\n",
|
||||
argv[loop][1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(lflag == 0 && wflag == 0 && cflag == 0){
|
||||
lflag = wflag = cflag = 1; /* default to all on */
|
||||
}
|
||||
|
||||
for(loop=1; loop<argc; loop++){
|
||||
if(argv[loop][0] != '-'){
|
||||
fflag = 1;
|
||||
numlines = numchars = numwords = 0;
|
||||
if((yyin = fopen(argv[loop],"rb")) != NULL){
|
||||
if(first){
|
||||
first = 0;
|
||||
} else {
|
||||
YY_NEW_FILE;
|
||||
}
|
||||
(void) yylex();
|
||||
fclose(yyin);
|
||||
totwords += numwords;
|
||||
totchars += numchars;
|
||||
totlines += numlines;
|
||||
printf("file : %25s :",argv[loop]) ;
|
||||
if(lflag){
|
||||
fprintf(stdout,"lines %5d ",numlines);
|
||||
}
|
||||
if(cflag){
|
||||
fprintf(stdout,"characters %5d ",numchars);
|
||||
}
|
||||
if(wflag){
|
||||
fprintf(stdout,"words %5d ",numwords);
|
||||
}
|
||||
fprintf(stdout,"\n");
|
||||
}else{
|
||||
fprintf(stderr,"wc : file not found %s\n",argv[loop]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!fflag){
|
||||
fprintf(stderr,"usage : wc [-l -w -c] file [file...]\n");
|
||||
fprintf(stderr,"-l = count lines\n");
|
||||
fprintf(stderr,"-c = count characters\n");
|
||||
fprintf(stderr,"-w = count words\n");
|
||||
exit(1);
|
||||
}
|
||||
for(loop=0;loop<79; loop++){
|
||||
fprintf(stdout,"-");
|
||||
}
|
||||
fprintf(stdout,"\n");
|
||||
fprintf(stdout,"total : %25s ","") ;
|
||||
if(lflag){
|
||||
fprintf(stdout,"lines %5d ",totlines);
|
||||
}
|
||||
if(cflag){
|
||||
fprintf(stdout,"characters %5d ",totchars);
|
||||
}
|
||||
if(wflag){
|
||||
fprintf(stdout,"words %5d ",totwords);
|
||||
}
|
||||
fprintf(stdout,"\n");
|
||||
return(0);
|
||||
}
|
||||
29
external/bsd/flex/dist/examples/manual/yymore.lex
vendored
Normal file
29
external/bsd/flex/dist/examples/manual/yymore.lex
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* yymore.lex: An example of using yymore()
|
||||
* to good effect.
|
||||
*/
|
||||
|
||||
%{
|
||||
#include <memory.h>
|
||||
|
||||
void yyerror(char *message)
|
||||
{
|
||||
printf("Error: %s\n",message);
|
||||
}
|
||||
|
||||
%}
|
||||
|
||||
%x STRING
|
||||
|
||||
%%
|
||||
\" BEGIN(STRING);
|
||||
|
||||
<STRING>[^\\\n"]* yymore();
|
||||
<STRING><<EOF>> yyerror("EOF in string."); BEGIN(INITIAL);
|
||||
<STRING>\n yyerror("Unterminated string."); BEGIN(INITIAL);
|
||||
<STRING>\\\n yymore();
|
||||
<STRING>\" {
|
||||
yytext[yyleng-1] = '\0';
|
||||
printf("string = \"%s\"",yytext); BEGIN(INITIAL);
|
||||
}
|
||||
%%
|
||||
33
external/bsd/flex/dist/examples/manual/yymore2.lex
vendored
Normal file
33
external/bsd/flex/dist/examples/manual/yymore2.lex
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* yymore.lex: An example of using yymore()
|
||||
* to good effect.
|
||||
*/
|
||||
|
||||
%{
|
||||
#include <memory.h>
|
||||
|
||||
void yyerror(char *message)
|
||||
{
|
||||
printf("Error: %s\n",message);
|
||||
}
|
||||
|
||||
%}
|
||||
|
||||
%x STRING
|
||||
|
||||
%%
|
||||
\" BEGIN(STRING);
|
||||
|
||||
<STRING>[^\\\n"]* yymore();
|
||||
<STRING><<EOF>> yyerror("EOF in string."); BEGIN(INITIAL);
|
||||
<STRING>\n yyerror("Unterminated string."); BEGIN(INITIAL);
|
||||
<STRING>\\\n {
|
||||
bcopy(yytext,yytext+2,yyleng-2);
|
||||
yytext += 2; yyleng -= 2;
|
||||
yymore();
|
||||
}
|
||||
<STRING>\" {
|
||||
yyleng -= 1; yytext[yyleng] = '\0';
|
||||
printf("string = \"%s\"",yytext); BEGIN(INITIAL);
|
||||
}
|
||||
%%
|
||||
7
external/bsd/flex/dist/examples/manual/yymoretest.dat
vendored
Normal file
7
external/bsd/flex/dist/examples/manual/yymoretest.dat
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
"This is a test \
|
||||
of multi-line string \
|
||||
scanning in flex. \
|
||||
This may be breaking some law \
|
||||
of usage though..."
|
||||
|
||||
|
||||
60
external/bsd/flex/dist/examples/testxxLexer.l
vendored
Normal file
60
external/bsd/flex/dist/examples/testxxLexer.l
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
/* $NetBSD: testxxLexer.l,v 1.1.1.1 2009/10/26 00:28:31 christos Exp $ */
|
||||
|
||||
// An example of using the flex C++ scanner class.
|
||||
|
||||
%option C++ noyywrap
|
||||
|
||||
%{
|
||||
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} FLEX_STD cout << "number " << YYText() << '\n';
|
||||
|
||||
\n mylineno++;
|
||||
|
||||
{name} FLEX_STD cout << "name " << YYText() << '\n';
|
||||
|
||||
{string} FLEX_STD cout << "string " << YYText() << '\n';
|
||||
|
||||
%%
|
||||
|
||||
int main( int /* argc */, char** /* argv */ )
|
||||
{
|
||||
FlexLexer* lexer = new yyFlexLexer;
|
||||
while(lexer->yylex() != 0)
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
429
external/bsd/flex/dist/filter.c
vendored
Normal file
429
external/bsd/flex/dist/filter.c
vendored
Normal file
@@ -0,0 +1,429 @@
|
||||
/* $NetBSD: filter.c,v 1.1.1.1 2009/10/26 00:26:00 christos Exp $ */
|
||||
|
||||
/* filter - postprocessing of flex output through filters */
|
||||
|
||||
/* 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 "flexdef.h"
|
||||
static const char * check_4_gnu_m4 =
|
||||
"m4_dnl ifdef(`__gnu__', ,"
|
||||
"`errprint(Flex requires GNU M4. Set the PATH or set the M4 environment variable to its path name.)"
|
||||
" m4exit(2)')\n";
|
||||
|
||||
|
||||
/** global chain. */
|
||||
struct filter *output_chain = NULL;
|
||||
|
||||
/* Allocate and initialize an external filter.
|
||||
* @param chain the current chain or NULL for new chain
|
||||
* @param cmd the command to execute.
|
||||
* @param ... a NULL terminated list of (const char*) arguments to command,
|
||||
* not including argv[0].
|
||||
* @return newest filter in chain
|
||||
*/
|
||||
struct filter *filter_create_ext (struct filter *chain, const char *cmd,
|
||||
...)
|
||||
{
|
||||
struct filter *f;
|
||||
int max_args;
|
||||
const char *s;
|
||||
va_list ap;
|
||||
|
||||
/* allocate and initialize new filter */
|
||||
f = (struct filter *) flex_alloc (sizeof (struct filter));
|
||||
memset (f, 0, sizeof (*f));
|
||||
f->filter_func = NULL;
|
||||
f->extra = NULL;
|
||||
f->next = NULL;
|
||||
f->argc = 0;
|
||||
|
||||
if (chain != NULL) {
|
||||
/* append f to end of chain */
|
||||
while (chain->next)
|
||||
chain = chain->next;
|
||||
chain->next = f;
|
||||
}
|
||||
|
||||
|
||||
/* 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[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[f->argc++] = s;
|
||||
}
|
||||
f->argv[f->argc] = NULL;
|
||||
|
||||
va_end (ap);
|
||||
return f;
|
||||
}
|
||||
|
||||
/* Allocate and initialize an internal filter.
|
||||
* @param chain the current chain or NULL for new chain
|
||||
* @param filter_func The function that will perform the filtering.
|
||||
* filter_func should return 0 if successful, and -1
|
||||
* if an error occurs -- or it can simply exit().
|
||||
* @param extra optional user-defined data to pass to the filter.
|
||||
* @return newest filter in chain
|
||||
*/
|
||||
struct filter *filter_create_int (struct filter *chain,
|
||||
int (*filter_func) (struct filter *),
|
||||
void *extra)
|
||||
{
|
||||
struct filter *f;
|
||||
|
||||
/* allocate and initialize new filter */
|
||||
f = (struct filter *) flex_alloc (sizeof (struct filter));
|
||||
memset (f, 0, sizeof (*f));
|
||||
f->next = NULL;
|
||||
f->argc = 0;
|
||||
f->argv = NULL;
|
||||
|
||||
f->filter_func = filter_func;
|
||||
f->extra = extra;
|
||||
|
||||
if (chain != NULL) {
|
||||
/* append f to end of chain */
|
||||
while (chain->next)
|
||||
chain = chain->next;
|
||||
chain->next = f;
|
||||
}
|
||||
|
||||
return f;
|
||||
}
|
||||
|
||||
/** Fork and exec entire filter chain.
|
||||
* @param chain The head of the chain.
|
||||
* @return true on success.
|
||||
*/
|
||||
bool filter_apply_chain (struct filter * chain)
|
||||
{
|
||||
int pid, pipes[2];
|
||||
|
||||
/* Tricky recursion, since we want to begin the chain
|
||||
* at the END. Why? Because we need all the forked processes
|
||||
* to be children of the main flex process.
|
||||
*/
|
||||
if (chain)
|
||||
filter_apply_chain (chain->next);
|
||||
else
|
||||
return true;
|
||||
|
||||
/* Now we are the right-most unprocessed link in the chain.
|
||||
*/
|
||||
|
||||
fflush (stdout);
|
||||
fflush (stderr);
|
||||
|
||||
if (pipe (pipes) == -1)
|
||||
flexerror (_("pipe failed"));
|
||||
|
||||
if ((pid = fork ()) == -1)
|
||||
flexerror (_("fork failed"));
|
||||
|
||||
if (pid == 0) {
|
||||
/* child */
|
||||
|
||||
/* We need stdin (the FILE* stdin) to connect to this new pipe.
|
||||
* There is no portable way to set stdin to a new file descriptor,
|
||||
* as stdin is not an lvalue on some systems (BSD).
|
||||
* So we dup the new pipe onto the stdin descriptor and use a no-op fseek
|
||||
* to sync the stream. This is a Hail Mary situation. It seems to work.
|
||||
*/
|
||||
close (pipes[1]);
|
||||
if (dup2 (pipes[0], fileno (stdin)) == -1)
|
||||
flexfatal (_("dup2(pipes[0],0)"));
|
||||
close (pipes[0]);
|
||||
fseek (stdin, 0, SEEK_CUR);
|
||||
|
||||
/* run as a filter, either internally or by exec */
|
||||
if (chain->filter_func) {
|
||||
int r;
|
||||
|
||||
if ((r = chain->filter_func (chain)) == -1)
|
||||
flexfatal (_("filter_func failed"));
|
||||
exit (0);
|
||||
}
|
||||
else {
|
||||
execvp (chain->argv[0],
|
||||
(char **const) (chain->argv));
|
||||
flexfatal (_("exec failed"));
|
||||
}
|
||||
|
||||
exit (1);
|
||||
}
|
||||
|
||||
/* Parent */
|
||||
close (pipes[0]);
|
||||
if (dup2 (pipes[1], fileno (stdout)) == -1)
|
||||
flexfatal (_("dup2(pipes[1],1)"));
|
||||
close (pipes[1]);
|
||||
fseek (stdout, 0, SEEK_CUR);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Truncate the chain to max_len number of filters.
|
||||
* @param chain the current chain.
|
||||
* @param max_len the maximum length of the chain.
|
||||
* @return the resulting length of the chain.
|
||||
*/
|
||||
int filter_truncate (struct filter *chain, int max_len)
|
||||
{
|
||||
int len = 1;
|
||||
|
||||
if (!chain)
|
||||
return 0;
|
||||
|
||||
while (chain->next && len < max_len) {
|
||||
chain = chain->next;
|
||||
++len;
|
||||
}
|
||||
|
||||
chain->next = NULL;
|
||||
return len;
|
||||
}
|
||||
|
||||
/** Splits the chain in order to write to a header file.
|
||||
* Similar in spirit to the 'tee' program.
|
||||
* The header file name is in extra.
|
||||
* @return 0 (zero) on success, and -1 on failure.
|
||||
*/
|
||||
int filter_tee_header (struct filter *chain)
|
||||
{
|
||||
/* This function reads from stdin and writes to both the C file and the
|
||||
* header file at the same time.
|
||||
*/
|
||||
|
||||
const int readsz = 512;
|
||||
char *buf;
|
||||
int to_cfd = -1;
|
||||
FILE *to_c = NULL, *to_h = NULL;
|
||||
bool write_header;
|
||||
|
||||
write_header = (chain->extra != NULL);
|
||||
|
||||
/* Store a copy of the stdout pipe, which is already piped to C file
|
||||
* through the running chain. Then create a new pipe to the H file as
|
||||
* stdout, and fork the rest of the chain again.
|
||||
*/
|
||||
|
||||
if ((to_cfd = dup (1)) == -1)
|
||||
flexfatal (_("dup(1) failed"));
|
||||
to_c = fdopen (to_cfd, "w");
|
||||
|
||||
if (write_header) {
|
||||
if (freopen ((char *) chain->extra, "w", stdout) == NULL)
|
||||
flexfatal (_("freopen(headerfilename) failed"));
|
||||
|
||||
filter_apply_chain (chain->next);
|
||||
to_h = stdout;
|
||||
}
|
||||
|
||||
/* Now to_c is a pipe to the C branch, and to_h is a pipe to the H branch.
|
||||
*/
|
||||
|
||||
if (write_header) {
|
||||
fputs (check_4_gnu_m4, to_h);
|
||||
fputs ("m4_changecom`'m4_dnl\n", to_h);
|
||||
fputs ("m4_changequote`'m4_dnl\n", to_h);
|
||||
fputs ("m4_changequote([[,]])[[]]m4_dnl\n", to_h);
|
||||
fputs ("m4_define([[M4_YY_NOOP]])[[]]m4_dnl\n", to_h);
|
||||
fputs ("m4_define( [[M4_YY_IN_HEADER]],[[]])m4_dnl\n",
|
||||
to_h);
|
||||
fprintf (to_h, "#ifndef %sHEADER_H\n", prefix);
|
||||
fprintf (to_h, "#define %sHEADER_H 1\n", prefix);
|
||||
fprintf (to_h, "#define %sIN_HEADER 1\n\n", prefix);
|
||||
fprintf (to_h,
|
||||
"m4_define( [[M4_YY_OUTFILE_NAME]],[[%s]])m4_dnl\n",
|
||||
headerfilename ? headerfilename : "<stdout>");
|
||||
|
||||
}
|
||||
|
||||
fputs (check_4_gnu_m4, to_c);
|
||||
fputs ("m4_changecom`'m4_dnl\n", to_c);
|
||||
fputs ("m4_changequote`'m4_dnl\n", to_c);
|
||||
fputs ("m4_changequote([[,]])[[]]m4_dnl\n", to_c);
|
||||
fputs ("m4_define([[M4_YY_NOOP]])[[]]m4_dnl\n", to_c);
|
||||
fprintf (to_c, "m4_define( [[M4_YY_OUTFILE_NAME]],[[%s]])m4_dnl\n",
|
||||
outfilename ? outfilename : "<stdout>");
|
||||
|
||||
buf = (char *) flex_alloc (readsz);
|
||||
while (fgets (buf, readsz, stdin)) {
|
||||
fputs (buf, to_c);
|
||||
if (write_header)
|
||||
fputs (buf, to_h);
|
||||
}
|
||||
|
||||
if (write_header) {
|
||||
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");
|
||||
|
||||
fprintf (to_h, "#undef %sIN_HEADER\n", prefix);
|
||||
fprintf (to_h, "#endif /* %sHEADER_H */\n", prefix);
|
||||
fputs ("m4_undefine( [[M4_YY_IN_HEADER]])m4_dnl\n", to_h);
|
||||
|
||||
fflush (to_h);
|
||||
if (ferror (to_h))
|
||||
lerrsf (_("error writing output file %s"),
|
||||
(char *) chain->extra);
|
||||
|
||||
else if (fclose (to_h))
|
||||
lerrsf (_("error closing output file %s"),
|
||||
(char *) chain->extra);
|
||||
}
|
||||
|
||||
fflush (to_c);
|
||||
if (ferror (to_c))
|
||||
lerrsf (_("error writing output file %s"),
|
||||
outfilename ? outfilename : "<stdout>");
|
||||
|
||||
else if (fclose (to_c))
|
||||
lerrsf (_("error closing output file %s"),
|
||||
outfilename ? outfilename : "<stdout>");
|
||||
|
||||
while (wait (0) > 0) ;
|
||||
|
||||
exit (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** Adjust the line numbers in the #line directives of the generated scanner.
|
||||
* After the m4 expansion, the line numbers are incorrect since the m4 macros
|
||||
* can add or remove lines. This only adjusts line numbers for generated code,
|
||||
* not user code. This also happens to be a good place to squeeze multiple
|
||||
* blank lines into a single blank line.
|
||||
*/
|
||||
int filter_fix_linedirs (struct filter *chain)
|
||||
{
|
||||
char *buf;
|
||||
const int readsz = 512;
|
||||
int lineno = 1;
|
||||
bool in_gen = true; /* in generated code */
|
||||
bool last_was_blank = false;
|
||||
|
||||
if (!chain)
|
||||
return 0;
|
||||
|
||||
buf = (char *) flex_alloc (readsz);
|
||||
|
||||
while (fgets (buf, readsz, stdin)) {
|
||||
|
||||
regmatch_t m[10];
|
||||
|
||||
/* Check for #line directive. */
|
||||
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,
|
||||
outfilename ? outfilename : "<stdout>")
|
||||
== 0
|
||||
|| strcmp (fname,
|
||||
headerfilename ? headerfilename : "<stdout>")
|
||||
== 0) {
|
||||
|
||||
char *s1, *s2;
|
||||
char filename[MAXLINE];
|
||||
|
||||
s1 = fname;
|
||||
s2 = filename;
|
||||
|
||||
while ((s2 - filename) < (MAXLINE - 1) && *s1) {
|
||||
/* Escape the backslash */
|
||||
if (*s1 == '\\')
|
||||
*s2++ = '\\';
|
||||
/* Escape the double quote */
|
||||
if (*s1 == '\"')
|
||||
*s2++ = '\\';
|
||||
/* Copy the character as usual */
|
||||
*s2++ = *s1++;
|
||||
}
|
||||
|
||||
*s2 = '\0';
|
||||
|
||||
/* Adjust the line directives. */
|
||||
in_gen = true;
|
||||
snprintf (buf, readsz, "#line %d \"%s\"\n",
|
||||
lineno + 1, filename);
|
||||
}
|
||||
else {
|
||||
/* it's a #line directive for code we didn't write */
|
||||
in_gen = false;
|
||||
}
|
||||
|
||||
free (fname);
|
||||
last_was_blank = false;
|
||||
}
|
||||
|
||||
/* squeeze blank lines from generated code */
|
||||
else if (in_gen
|
||||
&& regexec (®ex_blank_line, buf, 0, NULL,
|
||||
0) == 0) {
|
||||
if (last_was_blank)
|
||||
continue;
|
||||
else
|
||||
last_was_blank = true;
|
||||
}
|
||||
|
||||
else {
|
||||
/* it's a line of normal, non-empty code. */
|
||||
last_was_blank = false;
|
||||
}
|
||||
|
||||
fputs (buf, stdout);
|
||||
lineno++;
|
||||
}
|
||||
fflush (stdout);
|
||||
if (ferror (stdout))
|
||||
lerrsf (_("error writing output file %s"),
|
||||
outfilename ? outfilename : "<stdout>");
|
||||
|
||||
else if (fclose (stdout))
|
||||
lerrsf (_("error closing output file %s"),
|
||||
outfilename ? outfilename : "<stdout>");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* vim:set expandtab cindent tabstop=4 softtabstop=4 shiftwidth=4 textwidth=0: */
|
||||
3443
external/bsd/flex/dist/flex.skl
vendored
Normal file
3443
external/bsd/flex/dist/flex.skl
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1225
external/bsd/flex/dist/flexdef.h
vendored
Normal file
1225
external/bsd/flex/dist/flexdef.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
65
external/bsd/flex/dist/flexint.h
vendored
Normal file
65
external/bsd/flex/dist/flexint.h
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
/* $NetBSD: flexint.h,v 1.1.1.1 2009/10/26 00:26:19 christos Exp $ */
|
||||
|
||||
/* flex integer type definitions */
|
||||
|
||||
#ifndef FLEXINT_H
|
||||
#define FLEXINT_H
|
||||
|
||||
/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
|
||||
|
||||
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
||||
|
||||
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
|
||||
* if you want the limit (max/min) macros for int types.
|
||||
*/
|
||||
#ifndef __STDC_LIMIT_MACROS
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <inttypes.h>
|
||||
typedef int8_t flex_int8_t;
|
||||
typedef uint8_t flex_uint8_t;
|
||||
typedef int16_t flex_int16_t;
|
||||
typedef uint16_t flex_uint16_t;
|
||||
typedef int32_t flex_int32_t;
|
||||
typedef uint32_t flex_uint32_t;
|
||||
#else
|
||||
typedef signed char flex_int8_t;
|
||||
typedef short int flex_int16_t;
|
||||
typedef int flex_int32_t;
|
||||
typedef unsigned char flex_uint8_t;
|
||||
typedef unsigned short int flex_uint16_t;
|
||||
typedef unsigned int flex_uint32_t;
|
||||
#endif /* ! C99 */
|
||||
|
||||
/* Limits of integral types. */
|
||||
#ifndef INT8_MIN
|
||||
#define INT8_MIN (-128)
|
||||
#endif
|
||||
#ifndef INT16_MIN
|
||||
#define INT16_MIN (-32767-1)
|
||||
#endif
|
||||
#ifndef INT32_MIN
|
||||
#define INT32_MIN (-2147483647-1)
|
||||
#endif
|
||||
#ifndef INT8_MAX
|
||||
#define INT8_MAX (127)
|
||||
#endif
|
||||
#ifndef INT16_MAX
|
||||
#define INT16_MAX (32767)
|
||||
#endif
|
||||
#ifndef INT32_MAX
|
||||
#define INT32_MAX (2147483647)
|
||||
#endif
|
||||
#ifndef UINT8_MAX
|
||||
#define UINT8_MAX (255U)
|
||||
#endif
|
||||
#ifndef UINT16_MAX
|
||||
#define UINT16_MAX (65535U)
|
||||
#endif
|
||||
#ifndef UINT32_MAX
|
||||
#define UINT32_MAX (4294967295U)
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* ! FLEXINT_H */
|
||||
2174
external/bsd/flex/dist/gen.c
vendored
Normal file
2174
external/bsd/flex/dist/gen.c
vendored
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user