From 0f510c9d7340bf01f7d6a3455b6c9ef69b7c6136 Mon Sep 17 00:00:00 2001 From: Peter Breitenlohner Date: Thu, 10 Jun 2010 08:41:11 +0000 Subject: detex 2.8 git-svn-id: svn://tug.org/texlive/trunk@18861 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/detex/Makefile.am | 2 +- Build/source/texk/detex/Makefile.in | 2 +- Build/source/texk/detex/configure | 26 +- Build/source/texk/detex/configure.ac | 2 +- .../texk/detex/detex-2.8-PATCHES/patch-01-ANSI-C | 102 +- .../texk/detex/detex-2.8-PATCHES/patch-02-const | 116 ++ .../texk/detex/detex-2.8-PATCHES/patch-03-warnings | 28 + .../texk/detex/detex-2.8-PATCHES/patch-04-kpathsea | 167 ++ Build/source/texk/detex/detex-2.8/detex.l | 100 +- Build/source/texk/detex/detex.c | 1772 ++++++++++++++------ Build/source/texk/detex/test.lout | 2 +- 11 files changed, 1717 insertions(+), 602 deletions(-) create mode 100644 Build/source/texk/detex/detex-2.8-PATCHES/patch-02-const create mode 100644 Build/source/texk/detex/detex-2.8-PATCHES/patch-03-warnings create mode 100644 Build/source/texk/detex/detex-2.8-PATCHES/patch-04-kpathsea (limited to 'Build') diff --git a/Build/source/texk/detex/Makefile.am b/Build/source/texk/detex/Makefile.am index 528c9289a7d..8383abffe4b 100644 --- a/Build/source/texk/detex/Makefile.am +++ b/Build/source/texk/detex/Makefile.am @@ -18,7 +18,7 @@ dist-hook: rm -rf `find $(distdir) -name .svn` INCLUDES = -I$(top_srcdir)/$(DETEX_TREE) $(KPATHSEA_INCLUDES) -AM_CPPFLAGS = -DKPATHSEA -Dlint +AM_CPPFLAGS = -DNO_MALLOC_DECL -DKPATHSEA -Dlint AM_CFLAGS = $(WARNING_CFLAGS) ## The Makefile.in from 2002 by Thomas Esser applied the sed script diff --git a/Build/source/texk/detex/Makefile.in b/Build/source/texk/detex/Makefile.in index 95ad9b0025c..e9e3aac7e15 100644 --- a/Build/source/texk/detex/Makefile.in +++ b/Build/source/texk/detex/Makefile.in @@ -261,7 +261,7 @@ ACLOCAL_AMFLAGS = -I ../../m4 EXTRA_DIST = $(DETEX_TREE) $(DETEX_TREE)-PATCHES $(OTHER_TREE) \ $(OTHER_TREE)-PATCHES test.lout test.tex test.tout INCLUDES = -I$(top_srcdir)/$(DETEX_TREE) $(KPATHSEA_INCLUDES) -AM_CPPFLAGS = -DKPATHSEA -Dlint +AM_CPPFLAGS = -DNO_MALLOC_DECL -DKPATHSEA -Dlint AM_CFLAGS = $(WARNING_CFLAGS) detex_SOURCES = \ $(DETEX_TREE)/detex.h \ diff --git a/Build/source/texk/detex/configure b/Build/source/texk/detex/configure index a9bff426828..c8ba91264e5 100755 --- a/Build/source/texk/detex/configure +++ b/Build/source/texk/detex/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.65 for detex for TeX Live 2.7. +# Generated by GNU Autoconf 2.65 for detex for TeX Live 2.8. # # Report bugs to . # @@ -701,12 +701,12 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='detex for TeX Live' PACKAGE_TARNAME='detex-for-tex-live' -PACKAGE_VERSION='2.7' -PACKAGE_STRING='detex for TeX Live 2.7' +PACKAGE_VERSION='2.8' +PACKAGE_STRING='detex for TeX Live 2.8' PACKAGE_BUGREPORT='tex-k@tug.org' PACKAGE_URL='' -ac_unique_file="detex-2.7/detex.l" +ac_unique_file="detex-2.8/detex.l" # Factoring default headers for most tests. ac_includes_default="\ #include @@ -1434,7 +1434,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures detex for TeX Live 2.7 to adapt to many kinds of systems. +\`configure' configures detex for TeX Live 2.8 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1505,7 +1505,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of detex for TeX Live 2.7:";; + short | recursive ) echo "Configuration of detex for TeX Live 2.8:";; esac cat <<\_ACEOF @@ -1615,7 +1615,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -detex for TeX Live configure 2.7 +detex for TeX Live configure 2.8 generated by GNU Autoconf 2.65 Copyright (C) 2009 Free Software Foundation, Inc. @@ -2097,7 +2097,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by detex for TeX Live $as_me 2.7, which was +It was created by detex for TeX Live $as_me 2.8, which was generated by GNU Autoconf 2.65. Invocation command line was $ $0 $@ @@ -6822,7 +6822,7 @@ fi # Define the identity of the package. PACKAGE='detex-for-tex-live' - VERSION='2.7' + VERSION='2.8' cat >>confdefs.h <<_ACEOF @@ -12368,7 +12368,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -detex for TeX Live config.lt 2.7 +detex for TeX Live config.lt 2.8 configured by $0, generated by GNU Autoconf 2.65. Copyright (C) 2008 Free Software Foundation, Inc. @@ -13406,7 +13406,7 @@ if test "x$kpse_cv_kpse_debug" != xyes; then : fi -DETEX_TREE=detex-2.7 +DETEX_TREE=detex-2.8 OTHER_TREE=`echo $DETEX_TREE | tr 78 87` @@ -13940,7 +13940,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by detex for TeX Live $as_me 2.7, which was +This file was extended by detex for TeX Live $as_me 2.8, which was generated by GNU Autoconf 2.65. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14006,7 +14006,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -detex for TeX Live config.status 2.7 +detex for TeX Live config.status 2.8 configured by $0, generated by GNU Autoconf 2.65, with options \\"\$ac_cs_config\\" diff --git a/Build/source/texk/detex/configure.ac b/Build/source/texk/detex/configure.ac index 0fd31b2cf01..7436cbac282 100644 --- a/Build/source/texk/detex/configure.ac +++ b/Build/source/texk/detex/configure.ac @@ -6,7 +6,7 @@ dnl This file is free software; the copyright holder dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl -m4_define([detex_version], [2.7])[]dnl using unmodified detex source tree +m4_define([detex_version], [2.8])[]dnl using unmodified detex source tree AC_INIT([detex for TeX Live], detex_version, [tex-k@tug.org]) AC_PREREQ([2.65]) AC_CONFIG_SRCDIR([detex-]detex_version[/detex.l]) diff --git a/Build/source/texk/detex/detex-2.8-PATCHES/patch-01-ANSI-C b/Build/source/texk/detex/detex-2.8-PATCHES/patch-01-ANSI-C index 660003330c9..15dadd020dd 100644 --- a/Build/source/texk/detex/detex-2.8-PATCHES/patch-01-ANSI-C +++ b/Build/source/texk/detex/detex-2.8-PATCHES/patch-01-ANSI-C @@ -1,17 +1,53 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l --- detex-2.8.orig/detex.l 2008-02-01 20:55:51.000000000 +0100 -+++ detex-2.8/detex.l 2010-06-09 01:42:52.422362498 +0200 -@@ -368,7 +368,8 @@ ++++ detex-2.8/detex.l 2010-06-09 13:34:01.456409201 +0200 +@@ -63,6 +63,21 @@ + #include + #endif + ++#undef IGNORE ++ ++int BeginEnv(char *sbEnv); ++int EndEnv(char *sbEnv); ++void InputFile(char *sbFile); ++void IncludeFile(char *sbFile); ++void AddInclude(char *sbFile); ++void SetInputPaths(void); ++void SetEnvIgnore(char *sbEnvList); ++void Warning(char *sb1, char *sb2); ++void ErrorExit(char *sb1); ++int SeparateList(char *sbList, char *rgsbList[] ,char chSep,int csbMax); ++int InList(char *sbFile); ++FILE * TexOpen(char *sbFile); ++ + #define LaBEGIN if (fLatex) BEGIN + #define IGNORE if (fSpace && !fWord) putchar(' ') + #define SPACE if (!fWord) putchar(' ') +@@ -72,7 +87,7 @@ + #define STRIPARGS(x) cArgs=x; LaBEGIN LaMacro2 + #define CITE(x) if (fLatex && !fCite) KILLARGS(x) + +-char *SafeMalloc(); ++char *SafeMalloc(int cch, char *sbMessage); + #ifndef NO_MALLOC_DECL + char *malloc(); + #endif +@@ -368,12 +383,10 @@ ** If no input files are specified on the command line, process stdin. ******/ -main(cArgs,rgsbArgs) +-int cArgs; +-char *rgsbArgs[]; +int +main(int cArgs, char *rgsbArgs[]) - int cArgs; - char *rgsbArgs[]; { -@@ -477,7 +478,8 @@ + char *pch, *sbEnvList = DEFAULTENV, sbBadOpt[2]; +- FILE *TexOpen(); + int fSawFile = 0, iArgs = 1; + + /* get base name and decide what we are doing, detex or delatex */ +@@ -477,7 +490,8 @@ ** return the termination signal for lex. ******/ @@ -21,7 +57,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l { (void)fclose(yyin); #ifdef FLEX_SCANNER -@@ -501,8 +503,8 @@ +@@ -501,8 +515,8 @@ ** a yyless routine ******/ @@ -32,40 +68,40 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l { int i = strlen(yytext); -@@ -516,8 +518,8 @@ +@@ -516,8 +530,8 @@ ** sbEnvList. ******/ -SetEnvIgnore(sbEnvList) -char *sbEnvList; +void -+SetEnvIgnore(const char *sbEnvList) ++SetEnvIgnore(char *sbEnvList) { char *sb; -@@ -533,8 +535,8 @@ +@@ -533,8 +547,8 @@ ** is, sbCurrentEnv is set to sbEnv. ******/ -BeginEnv(sbEnv) -char *sbEnv; +int -+BeginEnv(const char *sbEnv) ++BeginEnv(char *sbEnv) { int i; -@@ -551,8 +553,8 @@ +@@ -551,8 +565,8 @@ ** EndEnv -- checks to see if sbEnv is the current environment being ignored. ******/ -EndEnv(sbEnv) -char *sbEnv; +int -+EndEnv(const char *sbEnv) ++EndEnv(char *sbEnv) { if (!fLatex) return(0); if (strcmp(sbEnv, sbCurrentEnv) == 0) -@@ -565,8 +567,8 @@ +@@ -565,11 +579,9 @@ ** the sbFile is ignored. ******/ @@ -74,9 +110,12 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l +void +InputFile(char *sbFile) { - FILE *TexOpen(); - -@@ -589,8 +591,8 @@ +- FILE *TexOpen(); +- + if (!fFollow) + return; + rgfp[cfp++] = yyin; +@@ -589,11 +601,9 @@ ** and open sbFile. If the open fails, the sbFile is ignored. ******/ @@ -85,9 +124,12 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l +void +IncludeFile(char *sbFile) { - FILE *TexOpen(); - -@@ -615,8 +617,8 @@ +- FILE *TexOpen(); +- + if (!fFollow) + return; + if (!InList(sbFile)) +@@ -615,8 +625,8 @@ ** If the include list is too long, sbFile is ignored. ******/ @@ -98,7 +140,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l { if (!fFollow) return; -@@ -631,8 +633,8 @@ +@@ -631,8 +641,8 @@ ** no list, all files are assumed to be "in the list". ******/ @@ -109,7 +151,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l { char *pch, sbBase[MAXPATHLEN]; int i; -@@ -658,7 +660,8 @@ +@@ -658,7 +668,8 @@ ** routine does not honor the '//' construct (expand subdirs). ******/ @@ -119,7 +161,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l { char *sb, *sbPaths, *getenv(); int cchDefaults, cchPaths; -@@ -698,9 +701,8 @@ +@@ -698,9 +709,8 @@ ** ERROR is returned if there are more than csbMax words. ******/ @@ -131,7 +173,7 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l { int csbList = 0; -@@ -725,8 +727,7 @@ +@@ -725,8 +735,7 @@ ******/ FILE * @@ -141,40 +183,40 @@ diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l { char *pch, *sbNew; FILE *fp; -@@ -784,9 +785,7 @@ +@@ -784,9 +793,7 @@ ******/ char * -SafeMalloc(cch, sbMessage) -int cch; -char *sbMessage; -+SafeMalloc(int cch, const char *sbMessage) ++SafeMalloc(int cch, char *sbMessage) { char *sb; -@@ -799,8 +798,8 @@ +@@ -799,8 +806,8 @@ ** Warning -- print a warning message preceded by the program name. ******/ -Warning(sb1, sb2) -char *sb1, *sb2; +void -+Warning(const char *sb1, const char *sb2) ++Warning(char *sb1, char *sb2) { (void)fprintf(stderr, "%s: warning: %s %s\n", sbProgName, sb1, sb2); } -@@ -810,8 +809,8 @@ +@@ -810,8 +817,8 @@ ** Stdout is flushed and detex exits. ******/ -ErrorExit(sb1) -char *sb1; +void -+ErrorExit(const char *sb1) ++ErrorExit(char *sb1) { (void)fflush(stdout); (void)fprintf(stderr, "%s: error: %s\n", sbProgName, sb1); -@@ -823,7 +822,8 @@ +@@ -823,7 +830,8 @@ ** OS2UsageExit -- print OS/2 usage message and exit. ******/ diff --git a/Build/source/texk/detex/detex-2.8-PATCHES/patch-02-const b/Build/source/texk/detex/detex-2.8-PATCHES/patch-02-const new file mode 100644 index 00000000000..8c82386e8d9 --- /dev/null +++ b/Build/source/texk/detex/detex-2.8-PATCHES/patch-02-const @@ -0,0 +1,116 @@ +diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l +--- detex-2.8.orig/detex.l 2010-06-09 13:34:01.000000000 +0200 ++++ detex-2.8/detex.l 2010-06-09 22:11:27.086080276 +0200 +@@ -65,15 +65,15 @@ + + #undef IGNORE + +-int BeginEnv(char *sbEnv); +-int EndEnv(char *sbEnv); ++int BeginEnv(const char *sbEnv); ++int EndEnv(const char *sbEnv); + void InputFile(char *sbFile); + void IncludeFile(char *sbFile); + void AddInclude(char *sbFile); + void SetInputPaths(void); +-void SetEnvIgnore(char *sbEnvList); +-void Warning(char *sb1, char *sb2); +-void ErrorExit(char *sb1); ++void SetEnvIgnore(const char *sbEnvList); ++void Warning(const char *sb1, const char *sb2); ++void ErrorExit(const char *sb1); + int SeparateList(char *sbList, char *rgsbList[] ,char chSep,int csbMax); + int InList(char *sbFile); + FILE * TexOpen(char *sbFile); +@@ -87,10 +87,13 @@ + #define STRIPARGS(x) cArgs=x; LaBEGIN LaMacro2 + #define CITE(x) if (fLatex && !fCite) KILLARGS(x) + +-char *SafeMalloc(int cch, char *sbMessage); ++char *SafeMalloc(int cch, const char *sbMessage); + #ifndef NO_MALLOC_DECL + char *malloc(); + #endif ++#ifndef WIN32 ++char *getenv(); ++#endif + #ifdef OS2 + void yyless(int); + #endif +@@ -386,7 +389,8 @@ + int + main(int cArgs, char *rgsbArgs[]) + { +- char *pch, *sbEnvList = DEFAULTENV, sbBadOpt[2]; ++ char *pch, sbBadOpt[2]; ++ const char *sbEnvList = DEFAULTENV; + int fSawFile = 0, iArgs = 1; + + /* get base name and decide what we are doing, detex or delatex */ +@@ -531,7 +535,7 @@ + ******/ + + void +-SetEnvIgnore(char *sbEnvList) ++SetEnvIgnore(const char *sbEnvList) + { + char *sb; + +@@ -548,7 +552,7 @@ + ******/ + + int +-BeginEnv(char *sbEnv) ++BeginEnv(const char *sbEnv) + { + int i; + +@@ -566,7 +570,7 @@ + ******/ + + int +-EndEnv(char *sbEnv) ++EndEnv(const char *sbEnv) + { + if (!fLatex) return(0); + if (strcmp(sbEnv, sbCurrentEnv) == 0) +@@ -671,7 +675,11 @@ + void + SetInputPaths(void) + { +- char *sb, *sbPaths, *getenv(); ++ const char *sb; ++ char *sbPaths; ++#ifndef WIN32 ++ char *getenv(); ++#endif + int cchDefaults, cchPaths; + + cchDefaults = strlen(DEFAULTINPUTS); +@@ -793,7 +801,7 @@ + ******/ + + char * +-SafeMalloc(int cch, char *sbMessage) ++SafeMalloc(int cch, const char *sbMessage) + { + char *sb; + +@@ -807,7 +815,7 @@ + ******/ + + void +-Warning(char *sb1, char *sb2) ++Warning(const char *sb1, const char *sb2) + { + (void)fprintf(stderr, "%s: warning: %s %s\n", sbProgName, sb1, sb2); + } +@@ -818,7 +826,7 @@ + ******/ + + void +-ErrorExit(char *sb1) ++ErrorExit(const char *sb1) + { + (void)fflush(stdout); + (void)fprintf(stderr, "%s: error: %s\n", sbProgName, sb1); diff --git a/Build/source/texk/detex/detex-2.8-PATCHES/patch-03-warnings b/Build/source/texk/detex/detex-2.8-PATCHES/patch-03-warnings new file mode 100644 index 00000000000..8199c855f6f --- /dev/null +++ b/Build/source/texk/detex/detex-2.8-PATCHES/patch-03-warnings @@ -0,0 +1,28 @@ +Only in detex-2.8: detex.c +diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l +--- detex-2.8.orig/detex.l 2010-06-09 22:11:27.000000000 +0200 ++++ detex-2.8/detex.l 2010-06-09 23:21:25.969948651 +0200 +@@ -724,7 +724,7 @@ + + while (sbList && *sbList && csbList < csbMax) { + rgsbList[csbList++] = sbList; +- if (sbList = index(sbList, chSep)) ++ if ((sbList = index(sbList, chSep))) + *sbList++ = '\0'; + } + return(sbList && *sbList ? ERROR : csbList); +@@ -769,10 +769,12 @@ + /* If sbFile ends in .tex then it must be there */ + if ((pch = rindex(sbFullPath, '.')) != NULL + && (strcmp(pch, ".tex") == 0)) ++ { + if ((fp = fopen(sbFullPath, "r")) != NULL) + return(fp); + else + continue; ++ } + + /* if . then try to open it. the '.' represents */ + /* the beginning of an extension if it is not the first */ +Only in detex-2.8: test.lout +Only in detex-2.8: test.tout diff --git a/Build/source/texk/detex/detex-2.8-PATCHES/patch-04-kpathsea b/Build/source/texk/detex/detex-2.8-PATCHES/patch-04-kpathsea new file mode 100644 index 00000000000..149c479c535 --- /dev/null +++ b/Build/source/texk/detex/detex-2.8-PATCHES/patch-04-kpathsea @@ -0,0 +1,167 @@ +diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l +--- detex-2.8.orig/detex.l 2010-06-09 23:21:25.000000000 +0200 ++++ detex-2.8/detex.l 2010-06-10 01:09:20.413856795 +0200 +@@ -49,6 +49,8 @@ + */ + + #include "detex.h" ++#ifndef KPATHSEA ++ + #ifdef HAVE_STRING_H + #include + #define index strchr +@@ -59,24 +61,52 @@ + #ifndef MAXPATHLEN + #include + #endif ++#define PATH_MAX MAXPATHLEN + #ifdef OS2 + #include + #endif ++#ifndef NO_MALLOC_DECL ++char *malloc(); ++#endif ++#ifndef WIN32 ++char *getenv(); ++#endif ++ ++#else ++ ++#include "c-auto.h" ++#include "kpathsea/c-auto.h" ++#include "kpathsea/config.h" ++#include "kpathsea/c-memstr.h" ++#include "kpathsea/c-pathmx.h" ++#include "kpathsea/c-std.h" ++#include "kpathsea/tex-file.h" ++ ++#ifdef HAVE_SYS_PARAM_H ++#include ++#endif ++ ++#endif + + #undef IGNORE + +-int BeginEnv(const char *sbEnv); +-int EndEnv(const char *sbEnv); +-void InputFile(char *sbFile); +-void IncludeFile(char *sbFile); +-void AddInclude(char *sbFile); +-void SetInputPaths(void); +-void SetEnvIgnore(const char *sbEnvList); +-void Warning(const char *sb1, const char *sb2); +-void ErrorExit(const char *sb1); +-int SeparateList(char *sbList, char *rgsbList[] ,char chSep,int csbMax); +-int InList(char *sbFile); +-FILE * TexOpen(char *sbFile); ++int BeginEnv(const char *sbEnv); ++int EndEnv(const char *sbEnv); ++void InputFile(char *sbFile); ++void IncludeFile(char *sbFile); ++void AddInclude(char *sbFile); ++void SetInputPaths(void); ++void SetEnvIgnore(const char *sbEnvList); ++void Warning(const char *sb1, const char *sb2); ++void ErrorExit(const char *sb1); ++int SeparateList(char *sbList, char *rgsbList[] ,char chSep,int csbMax); ++int InList(char *sbFile); ++FILE *TexOpen(char *sbFile); ++char *SafeMalloc(int cch, const char *sbMessage); ++#ifdef OS2 ++void yyless(int); ++void OS2UsageExit(void); ++#endif + + #define LaBEGIN if (fLatex) BEGIN + #define IGNORE if (fSpace && !fWord) putchar(' ') +@@ -87,22 +117,15 @@ + #define STRIPARGS(x) cArgs=x; LaBEGIN LaMacro2 + #define CITE(x) if (fLatex && !fCite) KILLARGS(x) + +-char *SafeMalloc(int cch, const char *sbMessage); +-#ifndef NO_MALLOC_DECL +-char *malloc(); +-#endif +-#ifndef WIN32 +-char *getenv(); +-#endif +-#ifdef OS2 +-void yyless(int); +-#endif + + char *rgsbEnvIgnore[MAXENVS]; /* list of environments ignored */ + char *rgsbIncList[MAXINCLIST]; /* list of includeonly files */ + char *rgsbInputPaths[MAXINPUTPATHS]; /* list of input paths in order */ + char sbCurrentEnv[CCHMAXENV]; /* current environment being ignored */ + char *sbProgName; /* name we were invoked with */ ++#ifndef NOFILE /* might be defined in */ ++#define NOFILE 256 ++#endif + FILE *rgfp[NOFILE+1]; /* stack of input/include files */ + int cfp = 0; /* count of files in stack */ + int cOpenBrace = 0; /* count of `{' in and */ +@@ -404,6 +427,9 @@ + _splitpath (rgsbArgs[0], drive, dir, fname, ext); + sbProgName = strlwr(fname); + #else ++#ifdef KPATHSEA ++ kpse_set_program_name (rgsbArgs[0], NULL); ++#endif + if ((sbProgName = rindex(rgsbArgs[0], '/')) != NULL) + sbProgName++; + else +@@ -411,9 +437,11 @@ + #endif + if (strcmp("delatex",sbProgName) == 0) + fLatex = 1; +- ++ ++#ifndef KPATHSEA + /* set rgsbInputPaths for use with TexOpen() */ + SetInputPaths(); ++#endif + + /* process command line options */ + while (iArgs < cArgs && *(pch = rgsbArgs[iArgs]) == CHOPT) { +@@ -648,7 +676,7 @@ + int + InList(char *sbFile) + { +- char *pch, sbBase[MAXPATHLEN]; ++ char *pch, sbBase[PATH_MAX]; + int i; + + if (csbIncList == 0) /* no list */ +@@ -745,10 +773,12 @@ + FILE * + TexOpen(char *sbFile) + { +- char *pch, *sbNew; ++ char *sbNew; ++#ifndef KPATHSEA ++ char *pch; + FILE *fp; + int iPath; +- static char sbFullPath[MAXPATHLEN]; ++ static char sbFullPath[PATH_MAX]; + + for (iPath = 0; iPath < csbInputPaths; iPath++) { + #ifdef OS2 +@@ -795,7 +825,15 @@ + if ((fp = fopen(sbFullPath, "r")) != NULL) + return(fp); + } +- return((FILE *)NULL); ++ return NULL; ++#else ++ sbNew = kpse_find_file (sbFile, kpse_tex_format, false); ++ ++ if (sbNew == NULL) ++ return NULL; ++ ++ return fopen (sbNew, "r"); ++#endif + } + + /****** diff --git a/Build/source/texk/detex/detex-2.8/detex.l b/Build/source/texk/detex/detex-2.8/detex.l index 789f5b07b00..862460df3af 100644 --- a/Build/source/texk/detex/detex-2.8/detex.l +++ b/Build/source/texk/detex/detex-2.8/detex.l @@ -49,6 +49,8 @@ static char rcsid[] = "$Header: /p/src/local/bin/detex/RCS/detex.l,v 2.22 2007/0 */ #include "detex.h" +#ifndef KPATHSEA + #ifdef HAVE_STRING_H #include #define index strchr @@ -59,9 +61,52 @@ static char rcsid[] = "$Header: /p/src/local/bin/detex/RCS/detex.l,v 2.22 2007/0 #ifndef MAXPATHLEN #include #endif +#define PATH_MAX MAXPATHLEN #ifdef OS2 #include #endif +#ifndef NO_MALLOC_DECL +char *malloc(); +#endif +#ifndef WIN32 +char *getenv(); +#endif + +#else + +#include "c-auto.h" +#include "kpathsea/c-auto.h" +#include "kpathsea/config.h" +#include "kpathsea/c-memstr.h" +#include "kpathsea/c-pathmx.h" +#include "kpathsea/c-std.h" +#include "kpathsea/tex-file.h" + +#ifdef HAVE_SYS_PARAM_H +#include +#endif + +#endif + +#undef IGNORE + +int BeginEnv(const char *sbEnv); +int EndEnv(const char *sbEnv); +void InputFile(char *sbFile); +void IncludeFile(char *sbFile); +void AddInclude(char *sbFile); +void SetInputPaths(void); +void SetEnvIgnore(const char *sbEnvList); +void Warning(const char *sb1, const char *sb2); +void ErrorExit(const char *sb1); +int SeparateList(char *sbList, char *rgsbList[] ,char chSep,int csbMax); +int InList(char *sbFile); +FILE *TexOpen(char *sbFile); +char *SafeMalloc(int cch, const char *sbMessage); +#ifdef OS2 +void yyless(int); +void OS2UsageExit(void); +#endif #define LaBEGIN if (fLatex) BEGIN #define IGNORE if (fSpace && !fWord) putchar(' ') @@ -72,19 +117,15 @@ static char rcsid[] = "$Header: /p/src/local/bin/detex/RCS/detex.l,v 2.22 2007/0 #define STRIPARGS(x) cArgs=x; LaBEGIN LaMacro2 #define CITE(x) if (fLatex && !fCite) KILLARGS(x) -char *SafeMalloc(); -#ifndef NO_MALLOC_DECL -char *malloc(); -#endif -#ifdef OS2 -void yyless(int); -#endif char *rgsbEnvIgnore[MAXENVS]; /* list of environments ignored */ char *rgsbIncList[MAXINCLIST]; /* list of includeonly files */ char *rgsbInputPaths[MAXINPUTPATHS]; /* list of input paths in order */ char sbCurrentEnv[CCHMAXENV]; /* current environment being ignored */ char *sbProgName; /* name we were invoked with */ +#ifndef NOFILE /* might be defined in */ +#define NOFILE 256 +#endif FILE *rgfp[NOFILE+1]; /* stack of input/include files */ int cfp = 0; /* count of files in stack */ int cOpenBrace = 0; /* count of `{' in and */ @@ -370,11 +411,9 @@ Z \*? int main(int cArgs, char *rgsbArgs[]) -int cArgs; -char *rgsbArgs[]; { - char *pch, *sbEnvList = DEFAULTENV, sbBadOpt[2]; - FILE *TexOpen(); + char *pch, sbBadOpt[2]; + const char *sbEnvList = DEFAULTENV; int fSawFile = 0, iArgs = 1; /* get base name and decide what we are doing, detex or delatex */ @@ -388,6 +427,9 @@ char *rgsbArgs[]; _splitpath (rgsbArgs[0], drive, dir, fname, ext); sbProgName = strlwr(fname); #else +#ifdef KPATHSEA + kpse_set_program_name (rgsbArgs[0], NULL); +#endif if ((sbProgName = rindex(rgsbArgs[0], '/')) != NULL) sbProgName++; else @@ -395,9 +437,11 @@ char *rgsbArgs[]; #endif if (strcmp("delatex",sbProgName) == 0) fLatex = 1; - + +#ifndef KPATHSEA /* set rgsbInputPaths for use with TexOpen() */ SetInputPaths(); +#endif /* process command line options */ while (iArgs < cArgs && *(pch = rgsbArgs[iArgs]) == CHOPT) { @@ -570,8 +614,6 @@ EndEnv(const char *sbEnv) void InputFile(char *sbFile) { - FILE *TexOpen(); - if (!fFollow) return; rgfp[cfp++] = yyin; @@ -594,8 +636,6 @@ InputFile(char *sbFile) void IncludeFile(char *sbFile) { - FILE *TexOpen(); - if (!fFollow) return; if (!InList(sbFile)) @@ -636,7 +676,7 @@ AddInclude(char *sbFile) int InList(char *sbFile) { - char *pch, sbBase[MAXPATHLEN]; + char *pch, sbBase[PATH_MAX]; int i; if (csbIncList == 0) /* no list */ @@ -663,7 +703,11 @@ InList(char *sbFile) void SetInputPaths(void) { - char *sb, *sbPaths, *getenv(); + const char *sb; + char *sbPaths; +#ifndef WIN32 + char *getenv(); +#endif int cchDefaults, cchPaths; cchDefaults = strlen(DEFAULTINPUTS); @@ -708,7 +752,7 @@ SeparateList(char *sbList, char *rgsbList[], char chSep, int csbMax) while (sbList && *sbList && csbList < csbMax) { rgsbList[csbList++] = sbList; - if (sbList = index(sbList, chSep)) + if ((sbList = index(sbList, chSep))) *sbList++ = '\0'; } return(sbList && *sbList ? ERROR : csbList); @@ -729,10 +773,12 @@ SeparateList(char *sbList, char *rgsbList[], char chSep, int csbMax) FILE * TexOpen(char *sbFile) { - char *pch, *sbNew; + char *sbNew; +#ifndef KPATHSEA + char *pch; FILE *fp; int iPath; - static char sbFullPath[MAXPATHLEN]; + static char sbFullPath[PATH_MAX]; for (iPath = 0; iPath < csbInputPaths; iPath++) { #ifdef OS2 @@ -753,10 +799,12 @@ TexOpen(char *sbFile) /* If sbFile ends in .tex then it must be there */ if ((pch = rindex(sbFullPath, '.')) != NULL && (strcmp(pch, ".tex") == 0)) + { if ((fp = fopen(sbFullPath, "r")) != NULL) return(fp); else continue; + } /* if . then try to open it. the '.' represents */ /* the beginning of an extension if it is not the first */ @@ -777,7 +825,15 @@ TexOpen(char *sbFile) if ((fp = fopen(sbFullPath, "r")) != NULL) return(fp); } - return((FILE *)NULL); + return NULL; +#else + sbNew = kpse_find_file (sbFile, kpse_tex_format, false); + + if (sbNew == NULL) + return NULL; + + return fopen (sbNew, "r"); +#endif } /****** diff --git a/Build/source/texk/detex/detex.c b/Build/source/texk/detex/detex.c index dcda71cc208..f9344446a4c 100644 --- a/Build/source/texk/detex/detex.c +++ b/Build/source/texk/detex/detex.c @@ -359,8 +359,8 @@ static void yy_fatal_error (yyconst char msg[] ); *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 88 -#define YY_END_OF_BUFFER 89 +#define YY_NUM_RULES 141 +#define YY_END_OF_BUFFER 142 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -368,39 +368,86 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[290] = +static yyconst flex_int16_t yy_accept[708] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 80, 80, 0, 0, 0, 0, + 0, 0, 0, 0, 121, 121, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 89, 88, 41, 40, 39, 53, - 52, 53, 64, 67, 66, 65, 69, 71, 70, 58, - 56, 55, 58, 87, 87, 54, 1, 86, 87, 82, - 82, 84, 81, 80, 79, 78, 81, 81, 80, 9, - 9, 8, 7, 9, 49, 48, 49, 16, 15, 13, - 14, 12, 11, 12, 45, 44, 45, 60, 62, 61, - 33, 32, 31, 37, 36, 34, 35, 6, 6, 51, - - 64, 69, 57, 83, 50, 1, 86, 0, 85, 76, - 75, 42, 74, 74, 74, 74, 46, 74, 74, 74, - 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, - 80, 80, 78, 78, 0, 77, 0, 0, 7, 0, - 0, 47, 13, 0, 43, 60, 0, 85, 74, 74, - 73, 73, 74, 74, 74, 74, 74, 74, 74, 74, - 74, 74, 74, 74, 74, 0, 0, 0, 72, 72, - 74, 74, 74, 38, 74, 22, 74, 74, 74, 74, - 74, 74, 28, 74, 74, 0, 10, 0, 74, 74, - 74, 74, 20, 74, 74, 74, 74, 74, 74, 74, - - 74, 30, 0, 0, 0, 3, 74, 74, 74, 74, - 74, 74, 24, 68, 25, 74, 74, 74, 0, 0, - 0, 0, 0, 74, 74, 74, 74, 74, 74, 74, - 74, 74, 0, 0, 0, 0, 17, 74, 74, 74, - 74, 59, 26, 74, 74, 0, 0, 0, 74, 19, - 74, 23, 74, 74, 74, 0, 0, 0, 74, 74, - 74, 27, 74, 0, 4, 0, 0, 74, 74, 74, - 29, 0, 0, 74, 74, 63, 0, 0, 18, 74, - 0, 0, 21, 0, 5, 0, 0, 2, 0 + 134, 134, 0, 0, 0, 0, 0, 0, 117, 117, + 0, 0, 142, 141, 79, 78, 77, 91, 90, 91, + 102, 105, 104, 103, 107, 109, 108, 96, 94, 93, + 96, 128, 128, 92, 1, 127, 128, 123, 123, 125, + 122, 121, 120, 119, 122, 122, 121, 11, 11, 10, + 9, 11, 87, 86, 87, 18, 17, 15, 16, 14, + 13, 14, 83, 82, 83, 98, 100, 99, 132, 129, + + 130, 131, 134, 133, 138, 135, 136, 137, 140, 139, + 6, 6, 7, 117, 42, 41, 43, 89, 102, 107, + 95, 124, 88, 1, 127, 0, 126, 116, 114, 80, + 113, 113, 113, 113, 84, 115, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 121, 121, 119, 119, 0, 118, 0, + 0, 9, 0, 0, 0, 85, 15, 0, 81, 98, + 134, 6, 0, 42, 126, 113, 113, 111, 111, 115, + 0, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + + 113, 113, 113, 113, 113, 113, 113, 113, 113, 0, + 0, 0, 0, 110, 110, 0, 115, 113, 113, 113, + 113, 113, 76, 113, 64, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 70, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 0, 0, 12, 0, 113, + 113, 113, 113, 113, 113, 60, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 51, 113, 113, 113, + 113, 113, 113, 31, 113, 113, 113, 113, 113, 113, + + 113, 113, 113, 113, 72, 113, 113, 0, 0, 0, + 0, 113, 113, 3, 113, 113, 113, 45, 113, 113, + 113, 113, 113, 113, 113, 113, 65, 106, 67, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 51, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 0, + 0, 0, 0, 113, 113, 0, 0, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 0, 0, 0, 0, + 0, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 35, 113, 113, 113, 113, 113, 113, 113, + + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 33, 113, 0, 0, 0, 0, 0, 113, 0, 0, + 0, 113, 113, 0, 0, 57, 113, 113, 113, 113, + 113, 113, 113, 113, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 21, 0, 0, 0, 97, 113, + 113, 113, 113, 113, 113, 68, 113, 113, 113, 113, + 113, 113, 113, 32, 113, 52, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, + 0, 0, 0, 113, 113, 0, 113, 59, 47, 113, + + 113, 113, 50, 66, 0, 21, 21, 0, 0, 0, + 0, 0, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 34, 113, 113, 113, 113, 36, 52, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 0, + 19, 19, 0, 0, 0, 0, 0, 0, 0, 0, + 113, 113, 0, 113, 113, 113, 113, 48, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 113, + 113, 112, 113, 113, 24, 113, 49, 69, 55, 113, + 113, 37, 39, 113, 25, 113, 113, 113, 113, 113, + 113, 46, 113, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 8, 0, 4, 0, 113, + 0, 0, 0, 113, 113, 113, 113, 0, 0, 0, + 22, 113, 113, 73, 113, 30, 55, 38, 113, 37, + 71, 29, 113, 27, 53, 113, 113, 63, 0, 0, + 0, 20, 0, 26, 0, 0, 0, 0, 0, 0, + 113, 44, 113, 113, 113, 101, 113, 113, 28, 53, + 113, 113, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 58, 113, 113, 113, 113, + 74, 113, 56, 0, 0, 0, 0, 23, 0, 62, + 61, 113, 113, 54, 56, 0, 5, 0, 113, 75, + + 54, 0, 2, 40, 40, 40, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -409,16 +456,16 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 5, 1, 1, 6, 7, 1, 8, 9, - 10, 1, 1, 11, 12, 1, 1, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 1, 1, 1, - 12, 1, 5, 14, 15, 16, 16, 16, 17, 16, - 16, 16, 16, 16, 16, 18, 16, 16, 19, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 20, 21, 22, 1, 1, 23, 24, 25, 26, 27, - - 28, 29, 30, 31, 32, 18, 16, 33, 34, 35, - 36, 37, 16, 38, 39, 40, 41, 42, 16, 43, - 44, 16, 45, 46, 47, 48, 1, 1, 1, 1, + 10, 11, 12, 13, 14, 15, 1, 16, 16, 16, + 16, 16, 17, 17, 17, 17, 17, 1, 1, 1, + 18, 1, 5, 19, 20, 21, 21, 21, 22, 21, + 21, 21, 21, 21, 21, 23, 21, 21, 24, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 25, 26, 27, 1, 1, 28, 29, 30, 31, 32, + + 33, 34, 35, 36, 37, 23, 38, 39, 40, 41, + 42, 43, 21, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -435,275 +482,564 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[49] = +static yyconst flex_int32_t yy_meta[57] = { 0, 1, 2, 3, 2, 1, 1, 1, 4, 1, 1, - 5, 6, 6, 7, 8, 8, 8, 8, 8, 1, - 1, 1, 6, 8, 8, 8, 8, 8, 8, 8, + 1, 1, 5, 6, 1, 6, 6, 6, 7, 8, + 8, 8, 8, 8, 1, 9, 10, 6, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 2, 1, 9, 1 + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 11, 1, 12, 1 } ; -static yyconst flex_int16_t yy_base[315] = +static yyconst flex_int16_t yy_base[746] = { 0, - 0, 0, 0, 1, 2, 3, 8, 11, 14, 21, - 23, 27, 68, 0, 116, 0, 164, 0, 17, 18, - 212, 0, 28, 29, 31, 33, 259, 262, 4, 264, - 265, 268, 39, 44, 744, 745, 745, 745, 745, 745, - 745, 737, 0, 745, 745, 745, 0, 745, 745, 745, - 745, 745, 736, 745, 718, 734, 0, 726, 730, 315, - 745, 745, 745, 273, 745, 0, 261, 0, 692, 745, - 362, 365, 0, 369, 745, 745, 714, 745, 745, 0, - 745, 745, 745, 707, 745, 745, 724, 0, 745, 745, - 745, 745, 745, 745, 745, 745, 745, 745, 702, 745, - - 0, 0, 745, 745, 745, 0, 716, 720, 713, 745, - 745, 745, 0, 20, 372, 375, 745, 39, 242, 688, - 244, 678, 669, 378, 381, 384, 680, 673, 248, 672, - 387, 654, 0, 0, 270, 0, 391, 395, 0, 398, - 663, 745, 0, 648, 745, 0, 647, 669, 0, 412, - 431, 745, 645, 649, 514, 524, 525, 523, 513, 259, - 523, 517, 516, 504, 505, 504, 514, 513, 439, 745, - 507, 256, 510, 0, 496, 0, 496, 502, 506, 492, - 504, 503, 0, 504, 504, 503, 745, 442, 491, 485, - 491, 482, 0, 487, 485, 478, 474, 476, 482, 2, - - 478, 0, 489, 445, 449, 452, 477, 468, 455, 470, - 460, 467, 0, 0, 0, 465, 449, 447, 445, 458, - 449, 461, 465, 442, 436, 425, 422, 410, 411, 409, - 386, 394, 395, 388, 468, 388, 0, 385, 393, 380, - 390, 381, 0, 376, 368, 372, 379, 377, 372, 0, - 351, 0, 335, 286, 280, 471, 281, 262, 265, 261, - 267, 0, 261, 477, 745, 258, 263, 263, 248, 247, - 0, 258, 255, 237, 246, 0, 30, 27, 0, 29, - 480, 3, 0, 499, 745, 505, 508, 745, 745, 555, - 564, 573, 582, 591, 600, 609, 618, 627, 636, 645, - - 654, 663, 672, 680, 688, 694, 702, 708, 710, 20, - 19, 718, 723, 725 + 0, 0, 0, 1, 2, 3, 8, 11, 14, 23, + 16, 17, 78, 0, 134, 0, 190, 0, 4, 25, + 246, 0, 26, 29, 30, 31, 301, 304, 307, 308, + 1604, 1603, 311, 312, 32, 33, 36, 42, 1613, 1612, + 17, 18, 1627, 1632, 1632, 1632, 1632, 1632, 1632, 1620, + 0, 1632, 1632, 1632, 0, 1632, 1632, 1632, 1632, 1632, + 1619, 1632, 1596, 1617, 0, 21, 1614, 367, 1632, 1632, + 1632, 317, 1632, 0, 310, 0, 1568, 1632, 422, 425, + 0, 428, 1632, 1632, 1593, 1632, 1632, 0, 1632, 1632, + 1632, 1586, 1632, 1632, 1608, 0, 1632, 1632, 1632, 1632, + + 1632, 1632, 0, 1632, 1632, 1632, 1632, 1632, 1632, 1632, + 0, 0, 1584, 1632, 0, 1632, 1632, 1632, 0, 0, + 1632, 1632, 1632, 0, 24, 1608, 1607, 1632, 1632, 1632, + 0, 24, 431, 434, 1632, 298, 284, 289, 283, 16, + 1573, 298, 1568, 438, 443, 1579, 448, 1582, 301, 424, + 1577, 1564, 32, 456, 1555, 0, 0, 327, 0, 459, + 462, 0, 480, 1570, 1573, 1632, 0, 1564, 1632, 0, + 0, 0, 1563, 0, 1595, 0, 488, 492, 1632, 1577, + 1574, 1568, 1564, 1568, 1551, 1557, 1561, 1563, 1561, 1550, + 302, 304, 442, 1561, 1549, 1540, 314, 1551, 463, 1541, + + 1538, 1543, 1555, 281, 418, 1533, 1549, 1537, 308, 1539, + 1535, 1546, 1545, 497, 1632, 1549, 1632, 2, 1538, 468, + 1541, 1531, 1535, 1524, 0, 1531, 1530, 1522, 1530, 1537, + 1526, 1531, 1516, 1529, 1528, 484, 1527, 489, 1514, 1519, + 1524, 1519, 1526, 1521, 1503, 1513, 1505, 475, 1505, 1506, + 1502, 481, 1517, 1509, 1516, 1507, 1513, 1632, 523, 1500, + 1496, 1499, 1493, 1501, 1491, 0, 1492, 1494, 1494, 1491, + 1496, 1490, 1487, 1498, 1481, 1477, 1480, 1486, 1494, 1481, + 1481, 1488, 1491, 500, 1484, 1476, 1506, 1483, 1482, 1465, + 1461, 1466, 1481, 0, 1477, 1472, 1466, 1474, 1464, 483, + + 1476, 1473, 1461, 1473, 0, 1458, 1469, 1456, 1469, 530, + 534, 1458, 1453, 537, 1462, 1452, 1442, 1462, 1458, 1457, + 1445, 1455, 1445, 589, 1453, 1453, 0, 0, 0, 1440, + 1443, 1434, 1440, 1432, 1437, 1445, 1431, 1432, 1425, 1632, + 1444, 1442, 1441, 1438, 1437, 1427, 1438, 1425, 1419, 1424, + 510, 1433, 1433, 1418, 1419, 1410, 1428, 614, 1425, 1428, + 1410, 546, 1422, 1421, 1424, 554, 563, 1412, 1416, 1411, + 1407, 1417, 1406, 1416, 1416, 1398, 639, 538, 58, 664, + 0, 558, 1410, 1409, 1401, 1403, 1404, 1405, 1398, 1402, + 1384, 1405, 0, 1391, 1386, 1389, 1400, 1399, 1378, 1385, + + 1385, 1384, 1389, 1390, 1389, 1384, 1374, 1374, 1389, 1378, + 0, 1378, 708, 555, 336, 733, 0, 585, 1380, 1377, + 1369, 1371, 1380, 576, 1368, 0, 1365, 1375, 1357, 1364, + 1359, 1362, 1371, 1369, 558, 427, 471, 1358, 537, 1368, + 1358, 1358, 553, 1354, 610, 617, 620, 777, 435, 1367, + 1366, 1350, 1347, 1362, 1349, 0, 1351, 1346, 1338, 1357, + 1346, 1343, 1342, 0, 1333, 1371, 1335, 1334, 1336, 1341, + 1345, 1339, 1342, 1339, 1331, 1343, 617, 547, 569, 1328, + 569, 1338, 1328, 1328, 579, 1324, 633, 644, 655, 802, + 1333, 1325, 1333, 1302, 1303, 1304, 1291, 0, 0, 1270, + + 618, 1242, 0, 0, 581, 658, 672, 0, 667, 628, + 827, 0, 1247, 1243, 1243, 1232, 1230, 1233, 1226, 1223, + 1223, 1210, 0, 1203, 1198, 1186, 1185, 0, 1632, 1005, + 948, 936, 946, 933, 936, 945, 931, 930, 934, 655, + 683, 686, 0, 676, 661, 871, 0, 696, 711, 939, + 921, 714, 919, 922, 922, 924, 916, 0, 711, 686, + 689, 918, 690, 928, 918, 918, 698, 911, 729, 924, + 913, 0, 919, 909, 0, 898, 0, 0, 936, 895, + 911, 928, 0, 894, 0, 901, 900, 899, 893, 882, + 897, 0, 892, 723, 725, 729, 881, 712, 891, 874, + + 872, 716, 867, 752, 755, 1632, 783, 1632, 863, 871, + 793, 915, 865, 868, 855, 862, 839, 744, 796, 821, + 1632, 846, 833, 0, 843, 0, 1632, 0, 838, 1632, + 0, 0, 832, 0, 866, 834, 826, 0, 752, 830, + 837, 1632, 831, 0, 0, 796, 755, 940, 0, 833, + 814, 0, 818, 817, 814, 0, 812, 804, 0, 1632, + 785, 779, 769, 805, 758, 766, 765, 795, 758, 747, + 737, 806, 710, 845, 678, 0, 624, 631, 615, 609, + 0, 598, 616, 851, 785, 858, 878, 1632, 556, 0, + 0, 550, 505, 511, 1632, 891, 1632, 894, 422, 0, + + 1632, 918, 1632, 985, 0, 0, 1632, 1041, 1053, 1065, + 1077, 1089, 1101, 1113, 1125, 1137, 1149, 1161, 1173, 1185, + 1197, 1209, 1221, 1233, 1243, 1253, 1262, 1270, 1279, 1281, + 441, 431, 1289, 1299, 1311, 1323, 1330, 1332, 1340, 342, + 340, 323, 39, 23, 1352 } ; -static yyconst flex_int16_t yy_def[315] = +static yyconst flex_int16_t yy_def[746] = { 0, - 290, 290, 291, 291, 292, 292, 293, 293, 294, 294, - 295, 295, 289, 13, 289, 15, 289, 17, 296, 296, - 289, 21, 297, 297, 298, 298, 299, 299, 300, 300, - 301, 301, 302, 302, 289, 289, 289, 289, 289, 289, - 289, 289, 303, 289, 289, 289, 304, 289, 289, 289, - 289, 289, 289, 289, 289, 289, 305, 289, 306, 289, - 289, 289, 289, 289, 289, 307, 308, 309, 289, 289, - 289, 289, 310, 289, 289, 289, 289, 289, 289, 311, - 289, 289, 289, 289, 289, 289, 289, 312, 289, 289, - 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, - - 303, 304, 289, 289, 289, 305, 289, 313, 306, 289, - 289, 289, 314, 314, 314, 314, 289, 314, 314, 314, - 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, - 289, 289, 307, 307, 308, 309, 289, 289, 310, 289, - 289, 289, 311, 289, 289, 312, 289, 313, 314, 314, - 289, 289, 314, 314, 314, 314, 314, 314, 314, 314, - 314, 314, 314, 314, 314, 289, 289, 289, 289, 289, - 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, - 314, 314, 314, 314, 314, 289, 289, 289, 314, 314, - 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, - - 314, 314, 289, 289, 289, 314, 314, 314, 314, 314, - 314, 314, 314, 314, 314, 314, 314, 314, 289, 289, - 289, 289, 289, 314, 314, 314, 314, 314, 314, 314, - 314, 314, 289, 289, 289, 289, 314, 314, 314, 314, - 314, 314, 314, 314, 314, 289, 289, 289, 314, 314, - 314, 314, 314, 314, 314, 289, 289, 289, 314, 314, - 314, 314, 314, 289, 289, 289, 289, 314, 314, 314, - 314, 289, 289, 314, 314, 314, 289, 289, 314, 314, - 289, 289, 314, 289, 289, 289, 289, 289, 0, 289, - 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, - - 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, - 289, 289, 289, 289 + 708, 708, 709, 709, 710, 710, 711, 711, 712, 712, + 713, 713, 707, 13, 707, 15, 707, 17, 714, 714, + 707, 21, 715, 715, 716, 716, 717, 717, 718, 718, + 719, 719, 720, 720, 721, 721, 722, 722, 708, 708, + 723, 723, 707, 707, 707, 707, 707, 707, 707, 707, + 724, 707, 707, 707, 725, 707, 707, 707, 707, 707, + 707, 707, 707, 707, 726, 707, 727, 707, 707, 707, + 707, 707, 707, 728, 729, 730, 707, 707, 707, 707, + 731, 707, 707, 707, 707, 707, 707, 732, 707, 707, + 707, 707, 707, 707, 707, 733, 707, 707, 707, 707, + + 707, 707, 734, 707, 707, 707, 707, 707, 707, 707, + 735, 735, 707, 707, 736, 707, 707, 707, 724, 725, + 707, 707, 707, 726, 707, 737, 727, 707, 707, 707, + 738, 738, 738, 738, 707, 707, 738, 738, 738, 738, + 738, 738, 738, 738, 738, 738, 738, 738, 738, 738, + 738, 738, 738, 707, 707, 728, 728, 729, 730, 707, + 707, 731, 707, 707, 707, 707, 732, 707, 707, 733, + 734, 735, 707, 736, 737, 738, 738, 707, 707, 707, + 739, 738, 738, 738, 738, 738, 738, 738, 738, 738, + 738, 738, 738, 738, 738, 738, 738, 738, 738, 738, + + 738, 738, 738, 738, 738, 738, 738, 738, 738, 707, + 707, 707, 707, 707, 707, 739, 707, 738, 738, 738, + 738, 738, 738, 738, 738, 738, 738, 738, 738, 738, + 738, 738, 738, 738, 738, 738, 738, 738, 738, 738, + 738, 738, 738, 738, 738, 738, 738, 738, 738, 738, + 738, 738, 738, 738, 738, 707, 707, 707, 707, 738, + 738, 738, 738, 738, 738, 738, 738, 738, 738, 738, + 738, 738, 738, 738, 738, 738, 738, 738, 738, 738, + 738, 738, 738, 738, 738, 738, 738, 738, 738, 738, + 738, 738, 738, 738, 738, 738, 738, 738, 738, 738, + + 738, 738, 738, 738, 738, 738, 738, 707, 707, 707, + 707, 738, 738, 738, 738, 738, 738, 738, 738, 738, + 738, 738, 738, 738, 738, 738, 738, 738, 738, 738, + 738, 738, 738, 738, 738, 738, 738, 738, 738, 707, + 738, 738, 738, 738, 738, 738, 738, 738, 738, 738, + 738, 738, 738, 738, 738, 738, 738, 738, 738, 707, + 707, 707, 707, 738, 738, 707, 707, 738, 738, 738, + 738, 738, 738, 738, 738, 738, 707, 707, 707, 707, + 740, 738, 738, 738, 738, 738, 738, 738, 738, 738, + 738, 738, 738, 738, 738, 738, 738, 738, 738, 738, + + 738, 738, 738, 738, 738, 738, 738, 738, 738, 738, + 738, 738, 707, 707, 707, 707, 741, 738, 707, 707, + 707, 738, 738, 707, 707, 738, 738, 738, 738, 738, + 738, 738, 738, 738, 380, 435, 707, 707, 707, 707, + 707, 707, 707, 707, 740, 707, 707, 707, 738, 738, + 738, 738, 738, 738, 738, 738, 738, 738, 738, 738, + 738, 738, 738, 738, 738, 738, 738, 738, 738, 738, + 738, 738, 738, 738, 738, 738, 416, 477, 707, 707, + 707, 707, 707, 707, 707, 707, 741, 707, 707, 707, + 707, 707, 707, 738, 738, 707, 738, 738, 738, 738, + + 738, 738, 738, 738, 435, 707, 707, 448, 707, 707, + 707, 742, 738, 738, 738, 738, 738, 738, 738, 738, + 738, 738, 738, 738, 738, 738, 738, 738, 707, 738, + 738, 738, 738, 738, 738, 738, 738, 738, 738, 477, + 707, 707, 490, 707, 707, 707, 743, 707, 707, 707, + 738, 738, 707, 738, 738, 738, 738, 738, 511, 559, + 707, 707, 707, 707, 707, 707, 707, 707, 742, 738, + 738, 738, 738, 738, 738, 738, 738, 738, 738, 738, + 738, 738, 738, 738, 738, 738, 738, 738, 738, 738, + 738, 738, 738, 546, 594, 707, 707, 707, 707, 707, + + 707, 707, 707, 743, 707, 707, 707, 707, 707, 738, + 707, 707, 707, 738, 738, 738, 738, 559, 707, 707, + 707, 738, 738, 738, 738, 738, 707, 738, 738, 707, + 738, 738, 738, 738, 738, 738, 738, 738, 594, 707, + 707, 707, 707, 738, 612, 707, 707, 707, 744, 707, + 738, 738, 738, 738, 738, 738, 738, 738, 738, 707, + 738, 738, 707, 648, 664, 707, 707, 707, 707, 707, + 707, 707, 707, 744, 707, 738, 738, 738, 738, 738, + 738, 738, 738, 707, 664, 707, 707, 707, 707, 738, + 738, 738, 738, 738, 707, 707, 707, 707, 738, 738, + + 707, 707, 707, 707, 745, 704, 0, 707, 707, 707, + 707, 707, 707, 707, 707, 707, 707, 707, 707, 707, + 707, 707, 707, 707, 707, 707, 707, 707, 707, 707, + 707, 707, 707, 707, 707, 707, 707, 707, 707, 707, + 707, 707, 707, 707, 707 } ; -static yyconst flex_int16_t yy_nxt[794] = +static yyconst flex_int16_t yy_nxt[1689] = { 0, - 289, 289, 38, 38, 41, 41, 92, 42, 42, 44, - 45, 44, 44, 45, 44, 48, 49, 48, 44, 76, - 76, 44, 48, 49, 48, 51, 143, 139, 52, 51, - 83, 83, 52, 86, 150, 86, 150, 77, 77, 216, - 217, 36, 286, 53, 39, 39, 36, 53, 84, 84, - 93, 87, 44, 87, 46, 44, 283, 46, 48, 99, - 48, 282, 150, 281, 99, 48, 150, 48, 54, 54, - 54, 54, 55, 56, 57, 54, 54, 54, 54, 54, - 58, 54, 59, 59, 59, 59, 59, 54, 60, 54, - 54, 59, 59, 59, 59, 59, 59, 59, 59, 59, - - 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, - 59, 59, 61, 61, 61, 62, 63, 64, 65, 64, - 63, 63, 63, 66, 63, 63, 63, 66, 67, 67, - 67, 67, 67, 67, 67, 63, 68, 63, 66, 67, + 707, 707, 46, 46, 49, 49, 84, 50, 50, 52, + 53, 52, 52, 53, 52, 56, 57, 56, 59, 59, + 52, 60, 60, 52, 56, 57, 56, 84, 91, 85, + 674, 91, 94, 94, 44, 44, 125, 125, 112, 125, + 125, 61, 61, 177, 112, 177, 604, 260, 187, 261, + 85, 92, 47, 47, 92, 95, 95, 188, 110, 110, + 52, 113, 54, 52, 208, 54, 56, 113, 56, 116, + 116, 117, 117, 435, 435, 56, 209, 56, 62, 62, + 62, 62, 63, 64, 65, 62, 62, 62, 62, 62, + 62, 62, 62, 66, 66, 62, 62, 67, 67, 67, + + 67, 67, 62, 68, 62, 62, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 69, 63, 63, 63, 70, 71, 72, 71, 70, 70, - 70, 70, 70, 70, 70, 70, 70, 70, 73, 73, - 73, 73, 73, 70, 70, 70, 70, 73, 73, 73, - 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, - - 73, 73, 73, 73, 73, 73, 73, 73, 74, 70, - 70, 70, 78, 78, 79, 78, 78, 78, 78, 78, - 78, 78, 78, 78, 78, 78, 80, 80, 80, 80, - 80, 78, 78, 78, 78, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 78, 78, 81, 78, - 89, 90, 89, 89, 90, 89, 92, 95, 134, 153, - 95, 156, 134, 154, 131, 164, 131, 134, 280, 157, - 279, 134, 278, 134, 178, 179, 150, 190, 191, 277, - 276, 275, 134, 274, 192, 180, 273, 272, 271, 270, - - 269, 268, 267, 89, 266, 89, 89, 263, 89, 96, - 93, 97, 96, 262, 97, 110, 110, 132, 111, 110, - 110, 110, 110, 112, 110, 110, 110, 110, 113, 114, - 113, 113, 115, 116, 117, 110, 110, 110, 118, 119, - 120, 121, 122, 123, 113, 113, 124, 125, 113, 113, - 126, 127, 128, 129, 113, 113, 130, 113, 113, 110, - 110, 110, 110, 137, 137, 137, 137, 137, 137, 261, - 140, 140, 140, 151, 152, 151, 151, 152, 151, 151, - 152, 151, 151, 152, 151, 151, 152, 151, 131, 260, - 131, 150, 137, 137, 137, 259, 140, 140, 140, 140, - - 140, 140, 258, 257, 161, 256, 138, 255, 254, 138, - 141, 150, 160, 169, 170, 169, 253, 252, 152, 251, - 250, 152, 249, 248, 152, 247, 246, 152, 245, 244, - 152, 132, 151, 152, 151, 138, 141, 243, 242, 141, - 169, 170, 169, 204, 204, 204, 204, 204, 204, 241, - 220, 220, 220, 222, 222, 222, 240, 239, 170, 220, - 220, 220, 222, 222, 222, 238, 235, 235, 235, 235, - 235, 235, 264, 264, 264, 237, 234, 152, 264, 264, - 264, 284, 284, 284, 233, 170, 205, 232, 231, 205, - 221, 236, 230, 229, 236, 228, 223, 227, 226, 221, - - 284, 284, 284, 225, 224, 223, 287, 287, 287, 287, - 287, 287, 219, 218, 215, 214, 213, 265, 212, 211, - 210, 209, 208, 265, 207, 206, 285, 203, 202, 201, - 200, 199, 198, 197, 196, 195, 194, 193, 189, 188, - 187, 186, 185, 184, 183, 285, 182, 181, 177, 176, - 175, 288, 174, 173, 288, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 40, 40, 40, 40, 40, 40, 40, - 40, 40, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 47, 47, 47, 47, 47, 47, 47, 47, 47, - - 50, 50, 50, 50, 50, 50, 50, 50, 50, 75, - 75, 75, 75, 75, 75, 75, 75, 75, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 85, 85, 85, - 85, 85, 85, 85, 85, 85, 88, 88, 88, 88, - 88, 88, 88, 88, 88, 91, 91, 91, 91, 91, - 91, 91, 91, 91, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 98, 98, 98, 98, 98, 98, 98, - 98, 98, 101, 172, 171, 101, 289, 101, 101, 101, - 102, 168, 167, 102, 102, 102, 102, 102, 106, 106, - 166, 106, 106, 106, 106, 106, 106, 109, 132, 165, - - 163, 109, 133, 162, 159, 133, 133, 133, 133, 133, - 133, 135, 158, 135, 135, 135, 136, 136, 146, 155, - 108, 146, 146, 146, 146, 146, 148, 108, 107, 147, - 148, 149, 149, 145, 144, 142, 132, 108, 107, 105, - 104, 103, 100, 289, 35, 289, 289, 289, 289, 289, - 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, - 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, - 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, - 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, - 289, 289, 289 - + 69, 69, 69, 70, 71, 72, 73, 72, 71, 71, + 71, 74, 71, 71, 71, 71, 71, 74, 71, 75, + 75, 74, 75, 75, 75, 75, 75, 75, 71, 76, + 71, 74, 75, 75, 75, 75, 75, 75, 75, 75, + 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, + 75, 75, 75, 75, 75, 75, 77, 71, 71, 71, + 78, 79, 80, 79, 78, 78, 78, 78, 78, 78, + + 78, 78, 78, 78, 78, 78, 78, 78, 78, 81, + 81, 81, 81, 81, 78, 78, 78, 78, 81, 81, + 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, + 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, + 81, 81, 82, 78, 78, 78, 86, 86, 87, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 88, 88, 88, 88, 88, + 86, 86, 86, 86, 88, 88, 88, 88, 88, 88, + 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, + 88, 88, 88, 88, 88, 88, 88, 88, 86, 86, + + 89, 86, 97, 98, 97, 97, 98, 97, 180, 44, + 44, 247, 177, 44, 44, 182, 177, 157, 154, 185, + 154, 183, 181, 157, 186, 184, 248, 157, 190, 198, + 569, 100, 100, 199, 157, 106, 106, 157, 227, 191, + 157, 229, 200, 228, 157, 254, 230, 487, 237, 445, + 255, 477, 477, 97, 157, 97, 97, 238, 97, 101, + 101, 102, 102, 107, 107, 108, 108, 128, 128, 155, + 129, 128, 128, 128, 128, 130, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 131, 132, 131, 131, 133, + 134, 135, 136, 128, 128, 137, 138, 139, 140, 141, + + 142, 131, 143, 144, 131, 145, 131, 146, 147, 148, + 149, 150, 151, 152, 153, 131, 131, 131, 131, 128, + 128, 128, 128, 160, 160, 160, 160, 160, 160, 163, + 163, 163, 178, 179, 178, 178, 179, 178, 167, 178, + 179, 178, 707, 707, 178, 179, 178, 249, 162, 178, + 179, 178, 201, 202, 203, 177, 204, 154, 250, 154, + 160, 160, 160, 163, 163, 163, 704, 164, 177, 513, + 205, 194, 231, 232, 161, 165, 514, 161, 193, 195, + 177, 163, 163, 163, 233, 179, 505, 505, 179, 214, + 215, 214, 179, 178, 179, 178, 240, 179, 214, 215, + + 214, 164, 179, 241, 263, 297, 264, 242, 155, 165, + 303, 161, 265, 298, 280, 352, 281, 285, 286, 164, + 299, 701, 282, 304, 310, 310, 310, 165, 283, 353, + 335, 310, 310, 310, 287, 362, 362, 362, 366, 366, + 366, 404, 215, 336, 337, 405, 179, 362, 362, 362, + 700, 215, 379, 380, 380, 366, 366, 366, 406, 446, + 446, 446, 707, 707, 424, 424, 424, 506, 447, 415, + 416, 416, 707, 435, 435, 311, 506, 424, 424, 424, + 699, 363, 311, 506, 540, 540, 488, 488, 488, 367, + 377, 377, 377, 363, 425, 489, 505, 505, 506, 541, + + 378, 698, 378, 379, 380, 380, 367, 425, 541, 541, + 448, 507, 507, 507, 381, 413, 413, 413, 446, 446, + 446, 446, 446, 446, 541, 414, 695, 414, 415, 416, + 416, 707, 477, 477, 542, 542, 542, 490, 694, 417, + 377, 377, 377, 559, 559, 488, 488, 488, 556, 693, + 378, 692, 378, 379, 380, 380, 488, 488, 488, 507, + 507, 507, 557, 691, 381, 436, 436, 436, 690, 448, + 540, 540, 448, 507, 507, 507, 594, 594, 437, 380, + 380, 510, 511, 511, 542, 542, 542, 542, 542, 542, + 545, 546, 546, 438, 439, 440, 490, 605, 605, 605, + + 441, 707, 707, 442, 618, 618, 443, 490, 444, 413, + 413, 413, 607, 607, 607, 611, 611, 611, 689, 414, + 619, 414, 415, 416, 416, 707, 559, 559, 619, 619, + 620, 620, 620, 417, 478, 478, 478, 707, 594, 594, + 707, 707, 640, 619, 639, 639, 640, 479, 416, 416, + 606, 640, 686, 641, 641, 641, 605, 605, 605, 618, + 618, 640, 480, 481, 482, 608, 612, 639, 639, 483, + 664, 664, 484, 707, 707, 485, 686, 486, 508, 508, + 508, 685, 685, 621, 607, 607, 607, 686, 509, 686, + 509, 510, 511, 511, 611, 611, 611, 620, 620, 620, + + 685, 685, 512, 543, 543, 543, 642, 686, 684, 606, + 647, 648, 648, 544, 683, 544, 545, 546, 546, 707, + 664, 664, 620, 620, 620, 686, 682, 547, 560, 560, + 560, 641, 641, 641, 686, 681, 686, 608, 641, 641, + 641, 561, 511, 511, 680, 612, 687, 687, 687, 679, + 621, 686, 696, 696, 696, 678, 562, 563, 564, 687, + 687, 687, 677, 565, 676, 675, 566, 663, 662, 567, + 661, 568, 595, 595, 595, 621, 660, 659, 658, 687, + 687, 687, 657, 656, 642, 596, 546, 546, 655, 654, + 653, 642, 696, 696, 696, 702, 702, 702, 652, 688, + + 597, 598, 599, 651, 650, 697, 644, 600, 643, 640, + 601, 640, 688, 602, 640, 603, 645, 645, 645, 702, + 702, 702, 640, 640, 638, 637, 646, 636, 646, 647, + 648, 648, 688, 635, 634, 633, 632, 631, 630, 629, + 649, 665, 665, 665, 628, 697, 627, 626, 703, 625, + 624, 623, 622, 619, 666, 648, 648, 619, 619, 619, + 619, 617, 616, 615, 614, 613, 610, 609, 593, 667, + 668, 669, 703, 592, 591, 590, 670, 589, 588, 671, + 587, 586, 672, 585, 673, 705, 705, 705, 705, 705, + 705, 705, 705, 705, 705, 705, 705, 705, 705, 705, + + 705, 705, 705, 706, 706, 706, 706, 706, 706, 705, + 705, 705, 705, 706, 706, 706, 706, 706, 706, 706, + 706, 706, 706, 706, 706, 706, 706, 706, 706, 706, + 706, 706, 706, 706, 706, 706, 706, 584, 705, 705, + 705, 44, 44, 44, 44, 44, 44, 44, 44, 44, + 44, 44, 44, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 55, + 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, + + 55, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 83, 83, 83, 83, 83, 83, 83, + 83, 83, 83, 83, 83, 90, 90, 90, 90, 90, + 90, 90, 90, 90, 90, 90, 90, 93, 93, 93, + 93, 93, 93, 93, 93, 93, 93, 93, 93, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 99, 99, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 103, 103, 103, 103, 103, 103, 103, + 103, 103, 103, 103, 103, 105, 105, 105, 105, 105, + 105, 105, 105, 105, 105, 105, 105, 109, 109, 109, + + 109, 109, 109, 109, 109, 109, 109, 109, 109, 111, + 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, + 111, 115, 115, 115, 115, 115, 115, 115, 115, 115, + 115, 115, 115, 119, 583, 582, 119, 581, 119, 119, + 119, 119, 119, 120, 580, 579, 120, 120, 120, 120, + 120, 120, 120, 124, 124, 578, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 127, 577, 576, 575, 127, + 156, 574, 573, 156, 156, 156, 156, 156, 156, 156, + 572, 156, 158, 571, 158, 158, 158, 159, 159, 170, + 570, 558, 170, 170, 170, 170, 170, 170, 170, 171, + + 171, 171, 171, 171, 171, 171, 171, 171, 555, 171, + 171, 172, 172, 172, 172, 172, 172, 172, 172, 554, + 172, 172, 172, 174, 174, 174, 174, 174, 174, 174, + 174, 174, 174, 175, 553, 552, 551, 175, 176, 176, + 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, + 216, 216, 705, 705, 705, 705, 705, 705, 705, 705, + 705, 705, 550, 705, 549, 548, 541, 541, 541, 541, + 541, 539, 538, 537, 536, 535, 534, 533, 532, 531, + 530, 529, 528, 527, 526, 525, 524, 523, 522, 521, + 520, 519, 518, 517, 516, 515, 506, 506, 506, 506, + + 506, 504, 503, 502, 501, 500, 499, 498, 497, 496, + 495, 494, 493, 492, 491, 476, 475, 474, 473, 472, + 471, 470, 469, 468, 467, 466, 465, 464, 463, 462, + 461, 460, 459, 458, 457, 456, 455, 454, 453, 452, + 451, 450, 449, 434, 433, 432, 431, 430, 429, 428, + 427, 426, 423, 422, 421, 420, 419, 418, 412, 411, + 410, 409, 408, 407, 403, 402, 401, 400, 399, 398, + 397, 396, 395, 394, 393, 392, 391, 390, 389, 388, + 387, 386, 385, 384, 383, 382, 376, 375, 374, 373, + 372, 371, 370, 369, 368, 365, 364, 361, 360, 359, + + 358, 357, 356, 355, 354, 351, 350, 349, 348, 347, + 346, 345, 344, 343, 342, 341, 340, 339, 338, 334, + 333, 332, 331, 330, 329, 328, 327, 326, 325, 324, + 323, 322, 321, 320, 319, 318, 317, 316, 315, 314, + 313, 312, 309, 308, 307, 306, 305, 302, 301, 300, + 296, 295, 294, 293, 292, 291, 290, 289, 288, 284, + 279, 278, 277, 276, 275, 274, 273, 272, 271, 270, + 269, 268, 267, 266, 262, 217, 259, 258, 257, 256, + 253, 252, 251, 246, 245, 244, 243, 239, 236, 235, + 234, 226, 225, 224, 223, 222, 221, 220, 219, 218, + + 217, 181, 707, 213, 212, 211, 210, 155, 207, 206, + 197, 196, 192, 189, 126, 126, 173, 169, 168, 166, + 155, 126, 123, 122, 121, 118, 707, 114, 114, 104, + 104, 43, 707, 707, 707, 707, 707, 707, 707, 707, + 707, 707, 707, 707, 707, 707, 707, 707, 707, 707, + 707, 707, 707, 707, 707, 707, 707, 707, 707, 707, + 707, 707, 707, 707, 707, 707, 707, 707, 707, 707, + 707, 707, 707, 707, 707, 707, 707, 707, 707, 707, + 707, 707, 707, 707, 707, 707, 707, 707 } ; -static yyconst flex_int16_t yy_chk[794] = +static yyconst flex_int16_t yy_chk[1689] = { 0, - 0, 0, 3, 4, 5, 6, 29, 5, 6, 7, - 7, 7, 8, 8, 8, 9, 9, 9, 7, 19, - 20, 8, 10, 10, 10, 11, 311, 310, 11, 12, - 23, 24, 12, 25, 114, 26, 114, 19, 20, 200, - 200, 33, 282, 11, 3, 4, 34, 12, 23, 24, - 29, 25, 7, 26, 7, 8, 280, 8, 9, 33, - 9, 278, 118, 277, 34, 10, 118, 10, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 0, 0, 3, 4, 5, 6, 19, 5, 6, 7, + 7, 7, 8, 8, 8, 9, 9, 9, 11, 12, + 7, 11, 12, 8, 10, 10, 10, 20, 23, 19, + 744, 24, 25, 26, 35, 36, 66, 66, 37, 125, + 125, 11, 12, 132, 38, 132, 743, 218, 140, 218, + 20, 23, 3, 4, 24, 25, 26, 140, 35, 36, + 7, 37, 7, 8, 153, 8, 9, 38, 9, 41, + 42, 41, 42, 379, 379, 10, 153, 10, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 15, 15, 15, 15, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 17, 17, 17, 17, 17, 17, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 21, 21, 21, 21, 21, 21, 21, 21, + 17, 17, 17, 17, 17, 17, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - 27, 27, 27, 28, 28, 28, 30, 31, 67, 119, - 32, 121, 67, 119, 64, 129, 64, 135, 275, 121, - 274, 135, 273, 67, 160, 160, 129, 172, 172, 272, - 270, 269, 135, 268, 172, 160, 267, 266, 263, 261, - - 260, 259, 258, 27, 257, 27, 28, 255, 28, 31, - 30, 31, 32, 254, 32, 60, 60, 64, 60, 60, - 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, - 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, - 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, - 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, - 60, 60, 60, 71, 71, 71, 72, 72, 72, 253, - 74, 74, 74, 115, 115, 115, 116, 116, 116, 124, - 124, 124, 125, 125, 125, 126, 126, 126, 131, 251, - 131, 116, 137, 137, 137, 249, 138, 138, 138, 140, - - 140, 140, 248, 247, 125, 246, 71, 245, 244, 72, - 74, 126, 124, 150, 150, 150, 242, 241, 115, 240, - 239, 116, 238, 236, 124, 234, 233, 125, 232, 231, - 126, 131, 151, 151, 151, 137, 138, 230, 229, 140, - 169, 169, 169, 188, 188, 188, 204, 204, 204, 228, - 205, 205, 205, 206, 206, 206, 227, 226, 150, 220, - 220, 220, 222, 222, 222, 225, 223, 223, 223, 235, - 235, 235, 256, 256, 256, 224, 221, 151, 264, 264, - 264, 281, 281, 281, 219, 169, 188, 218, 217, 204, - 205, 223, 216, 212, 235, 211, 206, 210, 209, 220, - - 284, 284, 284, 208, 207, 222, 286, 286, 286, 287, - 287, 287, 203, 201, 199, 198, 197, 256, 196, 195, - 194, 192, 191, 264, 190, 189, 281, 186, 185, 184, - 182, 181, 180, 179, 178, 177, 175, 173, 171, 168, - 167, 166, 165, 164, 163, 284, 162, 161, 159, 158, - 157, 286, 156, 155, 287, 290, 290, 290, 290, 290, - 290, 290, 290, 290, 291, 291, 291, 291, 291, 291, - 291, 291, 291, 292, 292, 292, 292, 292, 292, 292, - 292, 292, 293, 293, 293, 293, 293, 293, 293, 293, - 293, 294, 294, 294, 294, 294, 294, 294, 294, 294, - - 295, 295, 295, 295, 295, 295, 295, 295, 295, 296, - 296, 296, 296, 296, 296, 296, 296, 296, 297, 297, - 297, 297, 297, 297, 297, 297, 297, 298, 298, 298, - 298, 298, 298, 298, 298, 298, 299, 299, 299, 299, - 299, 299, 299, 299, 299, 300, 300, 300, 300, 300, - 300, 300, 300, 300, 301, 301, 301, 301, 301, 301, - 301, 301, 301, 302, 302, 302, 302, 302, 302, 302, - 302, 302, 303, 154, 153, 303, 148, 303, 303, 303, - 304, 147, 144, 304, 304, 304, 304, 304, 305, 305, - 141, 305, 305, 305, 305, 305, 305, 306, 132, 130, - - 128, 306, 307, 127, 123, 307, 307, 307, 307, 307, - 307, 308, 122, 308, 308, 308, 309, 309, 312, 120, - 109, 312, 312, 312, 312, 312, 313, 108, 107, 99, - 313, 314, 314, 87, 84, 77, 69, 59, 58, 56, - 55, 53, 42, 35, 289, 289, 289, 289, 289, 289, - 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, - 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, - 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, - 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, - 289, 289, 289 + 21, 21, 27, 27, 27, 28, 28, 28, 136, 29, + 30, 204, 137, 33, 34, 137, 137, 75, 72, 139, + 72, 138, 136, 75, 139, 138, 204, 75, 142, 149, + 742, 29, 30, 149, 158, 33, 34, 75, 191, 142, + 158, 192, 149, 191, 158, 209, 192, 741, 197, 740, + 209, 415, 415, 27, 158, 27, 28, 197, 28, 29, + 30, 29, 30, 33, 34, 33, 34, 68, 68, 72, + 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, + + 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, + 68, 68, 68, 79, 79, 79, 80, 80, 80, 82, + 82, 82, 133, 133, 133, 134, 134, 134, 732, 144, + 144, 144, 436, 436, 145, 145, 145, 205, 731, 147, + 147, 147, 150, 150, 150, 134, 150, 154, 205, 154, + 160, 160, 160, 161, 161, 161, 699, 82, 150, 449, + 150, 145, 193, 193, 79, 82, 449, 80, 144, 145, + 147, 163, 163, 163, 193, 133, 437, 437, 134, 177, + 177, 177, 144, 178, 178, 178, 199, 145, 214, 214, + + 214, 161, 147, 199, 220, 248, 220, 199, 154, 161, + 252, 160, 220, 248, 236, 300, 236, 238, 238, 163, + 248, 694, 236, 252, 259, 259, 259, 163, 236, 300, + 284, 310, 310, 310, 238, 311, 311, 311, 314, 314, + 314, 351, 177, 284, 284, 351, 178, 362, 362, 362, + 693, 214, 378, 378, 378, 366, 366, 366, 351, 382, + 382, 382, 478, 478, 367, 367, 367, 439, 382, 414, + 414, 414, 435, 435, 435, 259, 439, 424, 424, 424, + 692, 311, 310, 443, 479, 479, 418, 418, 418, 314, + 324, 324, 324, 362, 367, 418, 505, 505, 443, 481, + + 324, 689, 324, 324, 324, 324, 366, 424, 481, 485, + 382, 445, 445, 445, 324, 358, 358, 358, 446, 446, + 446, 447, 447, 447, 485, 358, 683, 358, 358, 358, + 358, 477, 477, 477, 487, 487, 487, 418, 682, 358, + 377, 377, 377, 510, 510, 488, 488, 488, 501, 680, + 377, 679, 377, 377, 377, 377, 489, 489, 489, 506, + 506, 506, 501, 678, 377, 380, 380, 380, 677, 446, + 540, 540, 447, 507, 507, 507, 545, 545, 380, 380, + 380, 509, 509, 509, 541, 541, 541, 542, 542, 542, + 544, 544, 544, 380, 380, 380, 488, 548, 548, 548, + + 380, 560, 560, 380, 561, 561, 380, 489, 380, 413, + 413, 413, 549, 549, 549, 552, 552, 552, 675, 413, + 563, 413, 413, 413, 413, 559, 559, 559, 567, 563, + 569, 569, 569, 413, 416, 416, 416, 594, 594, 594, + 595, 595, 598, 567, 596, 596, 602, 416, 416, 416, + 548, 598, 673, 604, 604, 604, 605, 605, 605, 618, + 618, 602, 416, 416, 416, 549, 552, 639, 639, 416, + 647, 647, 416, 665, 665, 416, 671, 416, 448, 448, + 448, 666, 666, 569, 607, 607, 607, 670, 448, 669, + 448, 448, 448, 448, 611, 611, 611, 619, 619, 619, + + 685, 685, 448, 490, 490, 490, 604, 667, 663, 605, + 646, 646, 646, 490, 662, 490, 490, 490, 490, 664, + 664, 664, 620, 620, 620, 668, 661, 490, 511, 511, + 511, 640, 640, 640, 668, 658, 672, 607, 641, 641, + 641, 511, 511, 511, 657, 611, 674, 674, 674, 655, + 619, 672, 684, 684, 684, 654, 511, 511, 511, 686, + 686, 686, 653, 511, 651, 650, 511, 643, 637, 511, + 636, 511, 546, 546, 546, 620, 635, 633, 629, 687, + 687, 687, 625, 623, 640, 546, 546, 546, 622, 617, + 616, 641, 696, 696, 696, 698, 698, 698, 615, 674, + + 546, 546, 546, 614, 613, 684, 610, 546, 609, 603, + 546, 601, 686, 546, 600, 546, 612, 612, 612, 702, + 702, 702, 599, 597, 593, 591, 612, 590, 612, 612, + 612, 612, 687, 589, 588, 587, 586, 584, 582, 581, + 612, 648, 648, 648, 580, 696, 579, 576, 698, 574, + 573, 571, 570, 568, 648, 648, 648, 566, 565, 564, + 562, 557, 556, 555, 554, 553, 551, 550, 539, 648, + 648, 648, 702, 538, 537, 536, 648, 535, 534, 648, + 533, 532, 648, 531, 648, 704, 704, 704, 704, 704, + 704, 704, 704, 704, 704, 704, 704, 704, 704, 704, + + 704, 704, 704, 704, 704, 704, 704, 704, 704, 704, + 704, 704, 704, 704, 704, 704, 704, 704, 704, 704, + 704, 704, 704, 704, 704, 704, 704, 704, 704, 704, + 704, 704, 704, 704, 704, 704, 704, 530, 704, 704, + 704, 708, 708, 708, 708, 708, 708, 708, 708, 708, + 708, 708, 708, 709, 709, 709, 709, 709, 709, 709, + 709, 709, 709, 709, 709, 710, 710, 710, 710, 710, + 710, 710, 710, 710, 710, 710, 710, 711, 711, 711, + 711, 711, 711, 711, 711, 711, 711, 711, 711, 712, + 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, + + 712, 713, 713, 713, 713, 713, 713, 713, 713, 713, + 713, 713, 713, 714, 714, 714, 714, 714, 714, 714, + 714, 714, 714, 714, 714, 715, 715, 715, 715, 715, + 715, 715, 715, 715, 715, 715, 715, 716, 716, 716, + 716, 716, 716, 716, 716, 716, 716, 716, 716, 717, + 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, + 717, 718, 718, 718, 718, 718, 718, 718, 718, 718, + 718, 718, 718, 719, 719, 719, 719, 719, 719, 719, + 719, 719, 719, 719, 719, 720, 720, 720, 720, 720, + 720, 720, 720, 720, 720, 720, 720, 721, 721, 721, + + 721, 721, 721, 721, 721, 721, 721, 721, 721, 722, + 722, 722, 722, 722, 722, 722, 722, 722, 722, 722, + 722, 723, 723, 723, 723, 723, 723, 723, 723, 723, + 723, 723, 723, 724, 527, 526, 724, 525, 724, 724, + 724, 724, 724, 725, 524, 522, 725, 725, 725, 725, + 725, 725, 725, 726, 726, 521, 726, 726, 726, 726, + 726, 726, 726, 726, 726, 727, 520, 519, 518, 727, + 728, 517, 516, 728, 728, 728, 728, 728, 728, 728, + 515, 728, 729, 514, 729, 729, 729, 730, 730, 733, + 513, 502, 733, 733, 733, 733, 733, 733, 733, 734, + + 734, 734, 734, 734, 734, 734, 734, 734, 500, 734, + 734, 735, 735, 735, 735, 735, 735, 735, 735, 497, + 735, 735, 735, 736, 736, 736, 736, 736, 736, 736, + 736, 736, 736, 737, 496, 495, 494, 737, 738, 738, + 739, 739, 739, 739, 739, 739, 739, 739, 739, 739, + 739, 739, 745, 745, 745, 745, 745, 745, 745, 745, + 745, 745, 493, 745, 492, 491, 486, 484, 483, 482, + 480, 476, 475, 474, 473, 472, 471, 470, 469, 468, + 467, 466, 465, 463, 462, 461, 460, 459, 458, 457, + 455, 454, 453, 452, 451, 450, 444, 442, 441, 440, + + 438, 434, 433, 432, 431, 430, 429, 428, 427, 425, + 423, 422, 421, 420, 419, 412, 410, 409, 408, 407, + 406, 405, 404, 403, 402, 401, 400, 399, 398, 397, + 396, 395, 394, 392, 391, 390, 389, 388, 387, 386, + 385, 384, 383, 376, 375, 374, 373, 372, 371, 370, + 369, 368, 365, 364, 363, 361, 360, 359, 357, 356, + 355, 354, 353, 352, 350, 349, 348, 347, 346, 345, + 344, 343, 342, 341, 339, 338, 337, 336, 335, 334, + 333, 332, 331, 330, 326, 325, 323, 322, 321, 320, + 319, 318, 317, 316, 315, 313, 312, 309, 308, 307, + + 306, 304, 303, 302, 301, 299, 298, 297, 296, 295, + 293, 292, 291, 290, 289, 288, 287, 286, 285, 283, + 282, 281, 280, 279, 278, 277, 276, 275, 274, 273, + 272, 271, 270, 269, 268, 267, 265, 264, 263, 262, + 261, 260, 257, 256, 255, 254, 253, 251, 250, 249, + 247, 246, 245, 244, 243, 242, 241, 240, 239, 237, + 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, + 224, 223, 222, 221, 219, 216, 213, 212, 211, 210, + 208, 207, 206, 203, 202, 201, 200, 198, 196, 195, + 194, 190, 189, 188, 187, 186, 185, 184, 183, 182, + + 181, 180, 175, 173, 168, 165, 164, 155, 152, 151, + 148, 146, 143, 141, 127, 126, 113, 95, 92, 85, + 77, 67, 64, 63, 61, 50, 43, 40, 39, 32, + 31, 707, 707, 707, 707, 707, 707, 707, 707, 707, + 707, 707, 707, 707, 707, 707, 707, 707, 707, 707, + 707, 707, 707, 707, 707, 707, 707, 707, 707, 707, + 707, 707, 707, 707, 707, 707, 707, 707, 707, 707, + 707, 707, 707, 707, 707, 707, 707, 707, 707, 707, + 707, 707, 707, 707, 707, 707, 707, 707 } ; static yy_state_type yy_last_accepting_state; @@ -723,27 +1059,54 @@ char *yytext; #line 1 "detex.l" #line 2 "detex.l" #ifndef lint -static char rcsid[] = "$Header: /p/src/local/bin/detex/RCS/detex.l,v 2.19 1997/09/10 18:12:37 trinkle Exp $"; +static char rcsid[] = "$Header: /p/src/local/bin/detex/RCS/detex.l,v 2.22 2007/03/01 20:22:01 trinkle Exp trinkle $"; #endif +/* + * Copyright (c) 1986-2007 Purdue University + * All rights reserved. + * + * Developed by: Daniel Trinkle + * Department of Computer Science, Purdue University + * http://www.cs.purdue.edu/ + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal with the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * o Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimers. + * + * o Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimers in the + * documentation and/or other materials provided with the distribution. + * + * o Neither the names of Daniel Trinkle, Purdue University, nor the + * names of its contributors may be used to endorse or promote products + * derived from this Software without specific prior written + * permission. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. + */ + + /* * detex [-e environment-list] [-c] [-l] [-n] [-s] [-t] [-w] [file[.tex] ] * * This program is used to remove TeX or LaTeX constructs from a text * file. - * - * Written by: - * Daniel Trinkle - * Department of Computer Science - * Purdue University - * */ -#ifdef FPTEX -#include -#undef ERROR -#endif - #include "detex.h" #ifndef KPATHSEA @@ -764,6 +1127,9 @@ static char rcsid[] = "$Header: /p/src/local/bin/detex/RCS/detex.l,v 2.19 1997/0 #ifndef NO_MALLOC_DECL char *malloc(); #endif +#ifndef WIN32 +char *getenv(); +#endif #else @@ -783,30 +1149,33 @@ char *malloc(); #undef IGNORE -void SetEnvIgnore(const char *sbEnvList); -int BeginEnv(const char *sbEnv); -int EndEnv(const char *sbEnv); -void InputFile(char *sbFile); -void IncludeFile(char *sbFile); -void AddInclude(char *sbFile); -int InList(char *sbFile); -void SetInputPaths(void); -int SeparateList(char *sbList, char **rgsbList ,char chSep,int csbMax); -FILE * TexOpen(char *sbFile); -char * SafeMalloc(int cch, const char *sbMessage); -void Warning(const char *sb1, const char *sb2); -void ErrorExit(const char *sb1); +int BeginEnv(const char *sbEnv); +int EndEnv(const char *sbEnv); +void InputFile(char *sbFile); +void IncludeFile(char *sbFile); +void AddInclude(char *sbFile); +void SetInputPaths(void); +void SetEnvIgnore(const char *sbEnvList); +void Warning(const char *sb1, const char *sb2); +void ErrorExit(const char *sb1); +int SeparateList(char *sbList, char *rgsbList[] ,char chSep,int csbMax); +int InList(char *sbFile); +FILE *TexOpen(char *sbFile); +char *SafeMalloc(int cch, const char *sbMessage); +#ifdef OS2 +void yyless(int); +void OS2UsageExit(void); +#endif #define LaBEGIN if (fLatex) BEGIN -#define CITEBEGIN if (fLatex && !fCite) BEGIN #define IGNORE if (fSpace && !fWord) putchar(' ') #define SPACE if (!fWord) putchar(' ') #define NEWLINE if (!fWord) putchar('\n') +#define LATEX fLatex=!fForcetex +#define KILLARGS(x) cArgs=x; LaBEGIN LaMacro +#define STRIPARGS(x) cArgs=x; LaBEGIN LaMacro2 +#define CITE(x) if (fLatex && !fCite) KILLARGS(x) -#ifdef OS2 -void yyless(int); -void OS2UsageExit(void); -#endif char *rgsbEnvIgnore[MAXENVS]; /* list of environments ignored */ char *rgsbIncList[MAXINCLIST]; /* list of includeonly files */ @@ -818,7 +1187,8 @@ char *sbProgName; /* name we were invoked with */ #endif FILE *rgfp[NOFILE+1]; /* stack of input/include files */ int cfp = 0; /* count of files in stack */ -int cOpenBrace = 0; /* count of `{' in */ +int cOpenBrace = 0; /* count of `{' in and */ +int cArgs = 0; /* argument connt in */ int csbEnvIgnore; /* count of environments ignored */ int csbIncList = 0; /* count of includeonly files */ int csbInputPaths; /* count of input paths */ @@ -829,9 +1199,20 @@ int fCite = 0; /* flag to echo \cite and \ref args */ int fSpace = 0; /* flag to replace \cs with space */ int fForcetex = 0; /* flag to inhibit latex mode */ +#ifdef FLEX_SCANNER +/* flex has contexts for buffers that need to be switched when file changes + * otherwise output contains imported files in reverse order. Weird, but + * true. + */ +YY_BUFFER_STATE rgsb[NOFILE + 1]; /* flex context stack */ +int csb = 0; /* depth of flex context stack */ +#endif /* FLEX_SCANNER */ + -#line 835 "detex.c" + + +#line 1216 "detex.c" #define INITIAL 0 #define Define 1 @@ -848,8 +1229,12 @@ int fForcetex = 0; /* flag to inhibit latex mode */ #define LaFormula 12 #define LaInclude 13 #define LaMacro 14 -#define LaMacro2 15 -#define LaVerbatim 16 +#define LaOptArg 15 +#define LaMacro2 16 +#define LaOptArg2 17 +#define LaVerbatim 18 +#define LaBreak 19 +#define LaPicture 20 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way @@ -1029,9 +1414,9 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; -#line 117 "detex.l" +#line 166 "detex.l" -#line 1035 "detex.c" +#line 1420 "detex.c" if ( !(yy_init) ) { @@ -1084,13 +1469,13 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 290 ) + if ( yy_current_state >= 708 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 745 ); + while ( yy_base[yy_current_state] != 1632 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -1116,24 +1501,24 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 118 "detex.l" +#line 167 "detex.l" /* ignore comments */ ; YY_BREAK case 2: /* rule 2 can match eol */ YY_RULE_SETUP -#line 120 "detex.l" -{fLatex = !fForcetex; IGNORE;} +#line 169 "detex.l" +{LATEX; IGNORE;} YY_BREAK case 3: YY_RULE_SETUP -#line 122 "detex.l" +#line 171 "detex.l" /* environment start */ {LaBEGIN LaBegin; IGNORE;} YY_BREAK case 4: /* rule 4 can match eol */ YY_RULE_SETUP -#line 124 "detex.l" +#line 173 "detex.l" { if (BeginEnv("verbatim")) BEGIN LaEnv; else @@ -1144,472 +1529,768 @@ YY_RULE_SETUP case 5: /* rule 5 can match eol */ YY_RULE_SETUP -#line 131 "detex.l" +#line 180 "detex.l" /* verbatim mode */ {BEGIN Normal; IGNORE;} YY_BREAK case 6: +/* rule 6 can match eol */ YY_RULE_SETUP -#line 132 "detex.l" +#line 181 "detex.l" ECHO; YY_BREAK case 7: YY_RULE_SETUP -#line 134 "detex.l" +#line 182 "detex.l" +ECHO; + YY_BREAK +case 8: +/* rule 8 can match eol */ +YY_RULE_SETUP +#line 184 "detex.l" +{ KILLARGS(1); + if (BeginEnv("minpage")) + BEGIN LaEnv; + else + BEGIN Normal; + IGNORE; + } + YY_BREAK +case 9: +YY_RULE_SETUP +#line 192 "detex.l" { if (BeginEnv(yytext)) BEGIN LaEnv; else - BEGIN LaMacro; + BEGIN Normal; IGNORE; } YY_BREAK -case 8: -/* rule 8 can match eol */ +case 10: +/* rule 10 can match eol */ YY_RULE_SETUP -#line 140 "detex.l" +#line 198 "detex.l" NEWLINE; YY_BREAK -case 9: +case 11: YY_RULE_SETUP -#line 141 "detex.l" +#line 199 "detex.l" ; YY_BREAK -case 10: +case 12: YY_RULE_SETUP -#line 143 "detex.l" +#line 201 "detex.l" /* absorb some environments */ {LaBEGIN LaEnd; IGNORE;} YY_BREAK -case 11: -/* rule 11 can match eol */ +case 13: +/* rule 13 can match eol */ YY_RULE_SETUP -#line 144 "detex.l" +#line 202 "detex.l" NEWLINE; YY_BREAK -case 12: +case 14: YY_RULE_SETUP -#line 145 "detex.l" +#line 203 "detex.l" ; YY_BREAK -case 13: +case 15: YY_RULE_SETUP -#line 147 "detex.l" +#line 205 "detex.l" /* end environment */ { if (EndEnv(yytext)) BEGIN Normal; IGNORE; } YY_BREAK -case 14: -YY_RULE_SETUP -#line 151 "detex.l" -{BEGIN LaEnv; IGNORE;} - YY_BREAK -case 15: -/* rule 15 can match eol */ -YY_RULE_SETUP -#line 152 "detex.l" -NEWLINE; - YY_BREAK case 16: YY_RULE_SETUP -#line 153 "detex.l" -; +#line 209 "detex.l" +{BEGIN LaEnv; IGNORE;} YY_BREAK case 17: +/* rule 17 can match eol */ YY_RULE_SETUP -#line 155 "detex.l" -/* ignore args */ {LaBEGIN LaMacro2; IGNORE;} +#line 210 "detex.l" +NEWLINE; YY_BREAK case 18: YY_RULE_SETUP -#line 156 "detex.l" -/* of these \cs */ {LaBEGIN LaMacro; IGNORE;} +#line 211 "detex.l" +; YY_BREAK case 19: +/* rule 19 can match eol */ YY_RULE_SETUP -#line 157 "detex.l" -{LaBEGIN LaMacro; IGNORE;} +#line 213 "detex.l" +; YY_BREAK case 20: +/* rule 20 can match eol */ YY_RULE_SETUP -#line 158 "detex.l" -{CITEBEGIN LaMacro2; IGNORE;} +#line 214 "detex.l" +; YY_BREAK case 21: +/* rule 21 can match eol */ YY_RULE_SETUP -#line 159 "detex.l" -{LaBEGIN LaMacro; IGNORE;} +#line 215 "detex.l" +; YY_BREAK case 22: +/* rule 22 can match eol */ YY_RULE_SETUP -#line 160 "detex.l" -{LaBEGIN LaMacro; IGNORE;} +#line 216 "detex.l" +; YY_BREAK case 23: +/* rule 23 can match eol */ YY_RULE_SETUP -#line 161 "detex.l" -{SPACE;} +#line 217 "detex.l" +; YY_BREAK case 24: YY_RULE_SETUP -#line 162 "detex.l" -{LaBEGIN LaMacro2; SPACE;} +#line 219 "detex.l" +{ KILLARGS(1); } YY_BREAK case 25: YY_RULE_SETUP -#line 163 "detex.l" -{LaBEGIN LaMacro; IGNORE;} +#line 220 "detex.l" +{ KILLARGS(2); } YY_BREAK case 26: YY_RULE_SETUP -#line 164 "detex.l" -{CITEBEGIN LaMacro; IGNORE;} +#line 221 "detex.l" +{ KILLARGS(2); } YY_BREAK case 27: YY_RULE_SETUP -#line 165 "detex.l" -{LaBEGIN LaMacro; IGNORE;} +#line 222 "detex.l" +{ KILLARGS(2); } YY_BREAK case 28: YY_RULE_SETUP -#line 166 "detex.l" -{CITEBEGIN LaMacro; IGNORE;} +#line 223 "detex.l" +{ KILLARGS(2); } YY_BREAK case 29: YY_RULE_SETUP -#line 167 "detex.l" -{LaBEGIN LaMacro; IGNORE;} +#line 224 "detex.l" +{ KILLARGS(2); } YY_BREAK case 30: YY_RULE_SETUP -#line 168 "detex.l" -/* ignore \verb... */ { if (fLatex) { - char verbchar, c; - verbchar = input(); - while ((c = input()) != verbchar) - if (c == '\n') - NEWLINE; - } - IGNORE; - } +#line 225 "detex.l" +{ KILLARGS(1); } YY_BREAK case 31: YY_RULE_SETUP -#line 177 "detex.l" -BEGIN Normal; +#line 226 "detex.l" +{ KILLARGS(1); } YY_BREAK case 32: -/* rule 32 can match eol */ YY_RULE_SETUP -#line 178 "detex.l" -NEWLINE; +#line 227 "detex.l" +{ KILLARGS(2); } YY_BREAK case 33: YY_RULE_SETUP -#line 179 "detex.l" -; +#line 228 "detex.l" +{ KILLARGS(1); } YY_BREAK case 34: YY_RULE_SETUP -#line 180 "detex.l" -{ cOpenBrace++; } +#line 229 "detex.l" +{ STRIPARGS(2); } YY_BREAK case 35: YY_RULE_SETUP -#line 181 "detex.l" -{ cOpenBrace--; - if (cOpenBrace == 0) - BEGIN Normal; - } +#line 230 "detex.l" +{ KILLARGS(1); } YY_BREAK case 36: -/* rule 36 can match eol */ YY_RULE_SETUP -#line 185 "detex.l" -NEWLINE; +#line 231 "detex.l" +{ STRIPARGS(2); } YY_BREAK case 37: YY_RULE_SETUP -#line 186 "detex.l" -; +#line 232 "detex.l" +{ KILLARGS(2); } YY_BREAK case 38: YY_RULE_SETUP -#line 188 "detex.l" -/* ignore def begin */ {BEGIN Define; IGNORE;} +#line 233 "detex.l" +; YY_BREAK case 39: YY_RULE_SETUP -#line 189 "detex.l" -BEGIN Normal; +#line 234 "detex.l" +{ KILLARGS(1); } YY_BREAK case 40: /* rule 40 can match eol */ YY_RULE_SETUP -#line 190 "detex.l" -NEWLINE; +#line 235 "detex.l" +{ LaBEGIN LaPicture; } YY_BREAK case 41: YY_RULE_SETUP -#line 191 "detex.l" +#line 237 "detex.l" ; YY_BREAK case 42: +/* rule 42 can match eol */ YY_RULE_SETUP -#line 193 "detex.l" -/* formula mode */ {LaBEGIN LaFormula; IGNORE;} +#line 238 "detex.l" +{ printf("", yytext); } YY_BREAK case 43: YY_RULE_SETUP -#line 194 "detex.l" +#line 239 "detex.l" BEGIN Normal; YY_BREAK case 44: -/* rule 44 can match eol */ YY_RULE_SETUP -#line 195 "detex.l" -NEWLINE; +#line 241 "detex.l" +{ KILLARGS(3); } YY_BREAK case 45: YY_RULE_SETUP -#line 196 "detex.l" -; +#line 242 "detex.l" +{ KILLARGS(1); } YY_BREAK case 46: YY_RULE_SETUP -#line 198 "detex.l" -/* display mode */ {LaBEGIN LaDisplay; IGNORE;} +#line 243 "detex.l" +{ KILLARGS(2); } YY_BREAK case 47: YY_RULE_SETUP -#line 199 "detex.l" -BEGIN Normal; +#line 244 "detex.l" +{ KILLARGS(2); } YY_BREAK case 48: -/* rule 48 can match eol */ YY_RULE_SETUP -#line 200 "detex.l" -NEWLINE; +#line 245 "detex.l" +{ KILLARGS(3); } YY_BREAK case 49: YY_RULE_SETUP -#line 201 "detex.l" -; +#line 246 "detex.l" +{ KILLARGS(1); } YY_BREAK case 50: YY_RULE_SETUP -#line 203 "detex.l" -/* display mode */ {BEGIN Display; IGNORE;} +#line 247 "detex.l" +{ STRIPARGS(1); } YY_BREAK case 51: YY_RULE_SETUP -#line 204 "detex.l" -BEGIN Normal; +#line 249 "detex.l" +; YY_BREAK case 52: -/* rule 52 can match eol */ YY_RULE_SETUP -#line 205 "detex.l" -NEWLINE; +#line 250 "detex.l" +; YY_BREAK case 53: YY_RULE_SETUP -#line 206 "detex.l" +#line 251 "detex.l" ; YY_BREAK case 54: YY_RULE_SETUP -#line 208 "detex.l" -/* math mode */ {BEGIN Math; IGNORE;} +#line 252 "detex.l" +; YY_BREAK case 55: YY_RULE_SETUP -#line 209 "detex.l" -BEGIN Normal; +#line 253 "detex.l" +; YY_BREAK case 56: -/* rule 56 can match eol */ YY_RULE_SETUP -#line 210 "detex.l" -NEWLINE; +#line 254 "detex.l" +; YY_BREAK case 57: YY_RULE_SETUP -#line 211 "detex.l" -; +#line 256 "detex.l" +/* ignore args */ {KILLARGS(1); IGNORE;} YY_BREAK case 58: YY_RULE_SETUP -#line 212 "detex.l" -; +#line 257 "detex.l" +/* of these \cs */ {KILLARGS(1); IGNORE;} YY_BREAK case 59: YY_RULE_SETUP -#line 214 "detex.l" -/* process files */ {LaBEGIN LaInclude; IGNORE;} +#line 258 "detex.l" +{KILLARGS(1); IGNORE;} YY_BREAK case 60: YY_RULE_SETUP -#line 215 "detex.l" +#line 259 "detex.l" +{CITE(1); IGNORE;} + YY_BREAK +case 61: +YY_RULE_SETUP +#line 260 "detex.l" +{LATEX; KILLARGS(1); IGNORE;} + YY_BREAK +case 62: +YY_RULE_SETUP +#line 261 "detex.l" +{LATEX; KILLARGS(1); IGNORE;} + YY_BREAK +case 63: +YY_RULE_SETUP +#line 262 "detex.l" +{KILLARGS(1); IGNORE;} + YY_BREAK +case 64: +YY_RULE_SETUP +#line 263 "detex.l" +{KILLARGS(1); IGNORE;} + YY_BREAK +case 65: +YY_RULE_SETUP +#line 264 "detex.l" +{KILLARGS(1); SPACE;} + YY_BREAK +case 66: +YY_RULE_SETUP +#line 265 "detex.l" +{KILLARGS(1); SPACE;} + YY_BREAK +case 67: +YY_RULE_SETUP +#line 266 "detex.l" +{KILLARGS(1); IGNORE;} + YY_BREAK +case 68: +YY_RULE_SETUP +#line 267 "detex.l" +{CITE(1); IGNORE;} + YY_BREAK +case 69: +YY_RULE_SETUP +#line 268 "detex.l" +{KILLARGS(1); IGNORE;} + YY_BREAK +case 70: +YY_RULE_SETUP +#line 269 "detex.l" +{CITE(1); IGNORE;} + YY_BREAK +case 71: +YY_RULE_SETUP +#line 270 "detex.l" +{KILLARGS(1); IGNORE;} + YY_BREAK +case 72: +YY_RULE_SETUP +#line 271 "detex.l" +/* ignore \verb... */ { if (fLatex) { + char verbchar, c; + verbchar = input(); + while ((c = input()) != verbchar) + if (c == '\n') + NEWLINE; + } + IGNORE; + } + YY_BREAK +case 73: +YY_RULE_SETUP +#line 281 "detex.l" +{ LATEX; KILLARGS(2); } + YY_BREAK +case 74: +YY_RULE_SETUP +#line 282 "detex.l" +{ LATEX; KILLARGS(2); } + YY_BREAK +case 75: +YY_RULE_SETUP +#line 283 "detex.l" +{ LATEX; KILLARGS(3); } + YY_BREAK +case 76: +YY_RULE_SETUP +#line 285 "detex.l" +/* ignore def begin */ {BEGIN Define; IGNORE;} + YY_BREAK +case 77: +YY_RULE_SETUP +#line 286 "detex.l" +BEGIN Normal; + YY_BREAK +case 78: +/* rule 78 can match eol */ +YY_RULE_SETUP +#line 287 "detex.l" +NEWLINE; + YY_BREAK +case 79: +YY_RULE_SETUP +#line 288 "detex.l" +; + YY_BREAK +case 80: +YY_RULE_SETUP +#line 290 "detex.l" +/* formula mode */ {LaBEGIN LaFormula; IGNORE;} + YY_BREAK +case 81: +YY_RULE_SETUP +#line 291 "detex.l" +BEGIN Normal; + YY_BREAK +case 82: +/* rule 82 can match eol */ +YY_RULE_SETUP +#line 292 "detex.l" +NEWLINE; + YY_BREAK +case 83: +YY_RULE_SETUP +#line 293 "detex.l" +; + YY_BREAK +case 84: +YY_RULE_SETUP +#line 295 "detex.l" +/* display mode */ {LaBEGIN LaDisplay; IGNORE;} + YY_BREAK +case 85: +YY_RULE_SETUP +#line 296 "detex.l" +BEGIN Normal; + YY_BREAK +case 86: +/* rule 86 can match eol */ +YY_RULE_SETUP +#line 297 "detex.l" +NEWLINE; + YY_BREAK +case 87: +YY_RULE_SETUP +#line 298 "detex.l" +; + YY_BREAK +case 88: +YY_RULE_SETUP +#line 300 "detex.l" +/* display mode */ {BEGIN Display; IGNORE;} + YY_BREAK +case 89: +YY_RULE_SETUP +#line 301 "detex.l" +BEGIN Normal; + YY_BREAK +case 90: +/* rule 90 can match eol */ +YY_RULE_SETUP +#line 302 "detex.l" +NEWLINE; + YY_BREAK +case 91: +YY_RULE_SETUP +#line 303 "detex.l" +; + YY_BREAK +case 92: +YY_RULE_SETUP +#line 305 "detex.l" +/* math mode */ {BEGIN Math; IGNORE;} + YY_BREAK +case 93: +YY_RULE_SETUP +#line 306 "detex.l" +BEGIN Normal; + YY_BREAK +case 94: +/* rule 94 can match eol */ +YY_RULE_SETUP +#line 307 "detex.l" +NEWLINE; + YY_BREAK +case 95: +YY_RULE_SETUP +#line 308 "detex.l" +; + YY_BREAK +case 96: +YY_RULE_SETUP +#line 309 "detex.l" +; + YY_BREAK +case 97: +YY_RULE_SETUP +#line 311 "detex.l" +/* process files */ {LaBEGIN LaInclude; IGNORE;} + YY_BREAK +case 98: +YY_RULE_SETUP +#line 312 "detex.l" { IncludeFile(yytext); BEGIN Normal; } YY_BREAK -case 61: -/* rule 61 can match eol */ +case 99: +/* rule 99 can match eol */ YY_RULE_SETUP -#line 218 "detex.l" +#line 315 "detex.l" NEWLINE; YY_BREAK -case 62: +case 100: YY_RULE_SETUP -#line 219 "detex.l" +#line 316 "detex.l" ; YY_BREAK -case 63: +case 101: YY_RULE_SETUP -#line 221 "detex.l" +#line 318 "detex.l" {BEGIN IncludeOnly; IGNORE;} YY_BREAK -case 64: +case 102: YY_RULE_SETUP -#line 222 "detex.l" +#line 319 "detex.l" AddInclude(yytext); YY_BREAK -case 65: +case 103: YY_RULE_SETUP -#line 223 "detex.l" +#line 320 "detex.l" { if (csbIncList == 0) rgsbIncList[csbIncList++] = '\0'; BEGIN Normal; } YY_BREAK -case 66: -/* rule 66 can match eol */ +case 104: +/* rule 104 can match eol */ YY_RULE_SETUP -#line 227 "detex.l" +#line 324 "detex.l" NEWLINE; YY_BREAK -case 67: +case 105: YY_RULE_SETUP -#line 228 "detex.l" +#line 325 "detex.l" ; YY_BREAK -case 68: +case 106: YY_RULE_SETUP -#line 230 "detex.l" +#line 327 "detex.l" {BEGIN Input; IGNORE;} YY_BREAK -case 69: +case 107: YY_RULE_SETUP -#line 231 "detex.l" +#line 328 "detex.l" { InputFile(yytext); BEGIN Normal; } YY_BREAK -case 70: -/* rule 70 can match eol */ +case 108: +/* rule 108 can match eol */ YY_RULE_SETUP -#line 234 "detex.l" +#line 331 "detex.l" NEWLINE; YY_BREAK -case 71: +case 109: YY_RULE_SETUP -#line 235 "detex.l" +#line 332 "detex.l" ; YY_BREAK -case 72: -/* rule 72 can match eol */ +case 110: +/* rule 110 can match eol */ YY_RULE_SETUP -#line 237 "detex.l" +#line 334 "detex.l" /* handle ligatures */ {(void)printf("%.2s", yytext+1);} YY_BREAK -case 73: -/* rule 73 can match eol */ +case 111: +/* rule 111 can match eol */ YY_RULE_SETUP -#line 238 "detex.l" +#line 335 "detex.l" {(void)printf("%.1s", yytext+1);} YY_BREAK -case 74: +case 112: YY_RULE_SETUP -#line 240 "detex.l" +#line 336 "detex.l" +BEGIN LaBreak; + YY_BREAK +case 113: +YY_RULE_SETUP +#line 338 "detex.l" /* ignore other \cs */ {BEGIN Control; IGNORE;} YY_BREAK -case 75: +case 114: YY_RULE_SETUP -#line 241 "detex.l" +#line 339 "detex.l" SPACE; YY_BREAK -case 76: +case 115: +/* rule 115 can match eol */ YY_RULE_SETUP -#line 242 "detex.l" +#line 340 "detex.l" +NEWLINE; + YY_BREAK +case 116: +YY_RULE_SETUP +#line 341 "detex.l" IGNORE; YY_BREAK -case 77: +case 117: YY_RULE_SETUP -#line 243 "detex.l" +#line 342 "detex.l" +{ if (yytext==NULL || strlen(yytext)==0 + || atoi(yytext)==4) + NEWLINE; + BEGIN Normal; + } + YY_BREAK +case 118: +YY_RULE_SETUP +#line 348 "detex.l" IGNORE; YY_BREAK -case 78: +case 119: YY_RULE_SETUP -#line 244 "detex.l" +#line 349 "detex.l" IGNORE; YY_BREAK -case 79: -/* rule 79 can match eol */ +case 120: +/* rule 120 can match eol */ YY_RULE_SETUP -#line 245 "detex.l" +#line 350 "detex.l" {BEGIN Normal; NEWLINE;} YY_BREAK -case 80: +case 121: YY_RULE_SETUP -#line 246 "detex.l" +#line 351 "detex.l" {BEGIN Normal; IGNORE;} YY_BREAK -case 81: +case 122: YY_RULE_SETUP -#line 247 "detex.l" +#line 352 "detex.l" {yyless(0);BEGIN Normal;} YY_BREAK -case 82: +case 123: YY_RULE_SETUP -#line 249 "detex.l" +#line 354 "detex.l" /* special characters */ IGNORE; YY_BREAK -case 83: +case 124: YY_RULE_SETUP -#line 250 "detex.l" +#line 355 "detex.l" IGNORE; YY_BREAK -case 84: +case 125: YY_RULE_SETUP -#line 251 "detex.l" +#line 356 "detex.l" SPACE; YY_BREAK -case 85: +case 126: YY_RULE_SETUP -#line 253 "detex.l" +#line 358 "detex.l" { if (fWord) (void)printf("%s\n", yytext); else ECHO; } YY_BREAK -case 86: +case 127: YY_RULE_SETUP -#line 258 "detex.l" +#line 363 "detex.l" if (!fWord) ECHO; YY_BREAK -case 87: -/* rule 87 can match eol */ +case 128: +/* rule 128 can match eol */ YY_RULE_SETUP -#line 259 "detex.l" +#line 364 "detex.l" if (!fWord) ECHO; YY_BREAK -case 88: +case 129: YY_RULE_SETUP -#line 260 "detex.l" +#line 366 "detex.l" +{ BEGIN LaOptArg; } + YY_BREAK +case 130: +YY_RULE_SETUP +#line 367 "detex.l" +{ cOpenBrace++; } + YY_BREAK +case 131: +YY_RULE_SETUP +#line 368 "detex.l" +{ cOpenBrace--; + if (cOpenBrace == 0) + { + if (--cArgs==0) + BEGIN Normal; + } + } + YY_BREAK +case 132: +YY_RULE_SETUP +#line 375 "detex.l" +; + YY_BREAK +case 133: +YY_RULE_SETUP +#line 376 "detex.l" +BEGIN LaMacro; + YY_BREAK +case 134: +/* rule 134 can match eol */ +YY_RULE_SETUP +#line 377 "detex.l" +; + YY_BREAK +case 135: +YY_RULE_SETUP +#line 379 "detex.l" +{ BEGIN LaOptArg2; } + YY_BREAK +case 136: +YY_RULE_SETUP +#line 380 "detex.l" +{ if (cOpenBrace == 0) + { + if (--cArgs==0) + { + BEGIN Normal; + cOpenBrace--; + } + } + cOpenBrace++; + } + YY_BREAK +case 137: +YY_RULE_SETUP +#line 390 "detex.l" +{ cOpenBrace--; } + YY_BREAK +case 138: +YY_RULE_SETUP +#line 391 "detex.l" +; + YY_BREAK +case 139: +YY_RULE_SETUP +#line 392 "detex.l" +BEGIN LaMacro2; + YY_BREAK +case 140: +YY_RULE_SETUP +#line 393 "detex.l" +; + YY_BREAK +case 141: +YY_RULE_SETUP +#line 394 "detex.l" ECHO; YY_BREAK -#line 1613 "detex.c" +#line 2294 "detex.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(Define): case YY_STATE_EOF(Display): @@ -1625,8 +2306,12 @@ case YY_STATE_EOF(LaEnv): case YY_STATE_EOF(LaFormula): case YY_STATE_EOF(LaInclude): case YY_STATE_EOF(LaMacro): +case YY_STATE_EOF(LaOptArg): case YY_STATE_EOF(LaMacro2): +case YY_STATE_EOF(LaOptArg2): case YY_STATE_EOF(LaVerbatim): +case YY_STATE_EOF(LaBreak): +case YY_STATE_EOF(LaPicture): yyterminate(); case YY_END_OF_BUFFER: @@ -1917,7 +2602,7 @@ static int yy_get_next_buffer (void) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 290 ) + if ( yy_current_state >= 708 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1945,11 +2630,11 @@ static int yy_get_next_buffer (void) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 290 ) + if ( yy_current_state >= 708 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 289); + yy_is_jam = (yy_current_state == 707); return yy_is_jam ? 0 : yy_current_state; } @@ -2623,7 +3308,7 @@ void yyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 260 "detex.l" +#line 394 "detex.l" /****** @@ -2664,14 +3349,14 @@ main(int cArgs, char *rgsbArgs[]) #ifdef KPATHSEA kpse_set_program_name (rgsbArgs[0], NULL); #endif - if ((sbProgName = strrchr(rgsbArgs[0], '/')) != NULL) + if ((sbProgName = rindex(rgsbArgs[0], '/')) != NULL) sbProgName++; else sbProgName = rgsbArgs[0]; #endif if (strcmp("delatex",sbProgName) == 0) fLatex = 1; - + #ifndef KPATHSEA /* set rgsbInputPaths for use with TexOpen() */ SetInputPaths(); @@ -2685,7 +3370,10 @@ main(int cArgs, char *rgsbArgs[]) fCite = 1; break; case CHENVOPT: - sbEnvList = rgsbArgs[++iArgs]; + if (++iArgs >= cArgs) { + ErrorExit("-e option requires and argument"); + } + sbEnvList = rgsbArgs[iArgs]; break; case CHLATEXOPT: fLatex = 1; @@ -2757,6 +3445,13 @@ int yywrap(void) { (void)fclose(yyin); +#ifdef FLEX_SCANNER + /* Pop context state */ + if (csb > 0) { + yy_delete_buffer(YY_CURRENT_BUFFER ); + yy_switch_to_buffer(rgsb[--csb] ); + } +#endif /* FLEX_SCANNER */ if (cfp > 0) { yyin = rgfp[--cfp]; return(0); @@ -2844,7 +3539,12 @@ InputFile(char *sbFile) if ((yyin = TexOpen(sbFile)) == NULL) { Warning("can't open \\input file", sbFile); yyin = rgfp[--cfp]; - } + return; + } +#ifdef FLEX_SCANNER + rgsb[csb++] = YY_CURRENT_BUFFER; + yy_switch_to_buffer(yy_create_buffer(yyin,YY_BUF_SIZE ) ); +#endif /* FLEX_SCANNER */ } /****** @@ -2863,7 +3563,12 @@ IncludeFile(char *sbFile) if ((yyin = TexOpen(sbFile)) == NULL) { Warning("can't open \\include file", sbFile); yyin = rgfp[--cfp]; + return; } +#ifdef FLEX_SCANNER + rgsb[csb++] = YY_CURRENT_BUFFER; + yy_switch_to_buffer(yy_create_buffer(yyin,YY_BUF_SIZE ) ); +#endif /* FLEX_SCANNER */ } /****** @@ -2896,7 +3601,7 @@ InList(char *sbFile) if (csbIncList == 0) /* no list */ return(1); (void)strcpy(sbBase, sbFile); - if ((pch = strrchr(sbBase, '.')) != NULL) + if ((pch = rindex(sbBase, '.')) != NULL) *pch = '\0'; i = 0; while ((i < csbIncList) && rgsbIncList[i]) @@ -2960,13 +3665,13 @@ SetInputPaths(void) ******/ int -SeparateList(char *sbList, char **rgsbList, char chSep, int csbMax) +SeparateList(char *sbList, char *rgsbList[], char chSep, int csbMax) { int csbList = 0; while (sbList && *sbList && csbList < csbMax) { rgsbList[csbList++] = sbList; - if ((sbList = strchr(sbList, chSep))) + if ((sbList = index(sbList, chSep))) *sbList++ = '\0'; } return(sbList && *sbList ? ERROR : csbList); @@ -2996,11 +3701,10 @@ TexOpen(char *sbFile) for (iPath = 0; iPath < csbInputPaths; iPath++) { #ifdef OS2 - if (*sbFile == '/' || *sbFile == '\\' || strchr(sbFile, ':')) /* absolute path */ + if (*sbFile == '/' || *sbFile == '\\' || strchr(sbFile, ':')) { /* absolute path */ #else - if (*sbFile == '/') /* absolute path */ + if (*sbFile == '/') { /* absolute path */ #endif - { (void)sprintf(sbFullPath, "%s", sbFile); iPath = csbInputPaths; /* only check once */ } else @@ -3012,12 +3716,14 @@ TexOpen(char *sbFile) #endif /* If sbFile ends in .tex then it must be there */ - if ((pch = strrchr(sbFullPath, '.')) != NULL + if ((pch = rindex(sbFullPath, '.')) != NULL && (strcmp(pch, ".tex") == 0)) + { if ((fp = fopen(sbFullPath, "r")) != NULL) return(fp); else continue; + } /* if . then try to open it. the '.' represents */ /* the beginning of an extension if it is not the first */ @@ -3038,12 +3744,12 @@ TexOpen(char *sbFile) if ((fp = fopen(sbFullPath, "r")) != NULL) return(fp); } - return((FILE *)NULL); + return NULL; #else sbNew = kpse_find_file (sbFile, kpse_tex_format, false); if (sbNew == NULL) - return (FILE *)NULL; + return NULL; return fopen (sbNew, "r"); #endif diff --git a/Build/source/texk/detex/test.lout b/Build/source/texk/detex/test.lout index 6dc8606e007..276496573a0 100644 --- a/Build/source/texk/detex/test.lout +++ b/Build/source/texk/detex/test.lout @@ -1,4 +1,4 @@ -article + This is the first paragraph. -- cgit v1.2.3