ftp.nice.ch/pub/next/text/tex/programs/auctex.7.0p.d.tar.gz#/auctex/lacheck/lacheck.c

This is lacheck.c in view mode; [Download] [Up]

/* A lexical scanner generated by flex */

/* scanner skeleton version:
 * $Header: /usr/fsys/odin/a/vern/flex/RCS/flex.skel,v 2.16 90/08/03 14:09:36 vern Exp $
 */

#define FLEX_SCANNER

#include <stdio.h>


/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
#ifdef c_plusplus
#ifndef __cplusplus
#define __cplusplus
#endif
#endif


#ifdef __cplusplus

#include <stdlib.h>
#include <osfcn.h>

/* use prototypes in function declarations */
#define YY_USE_PROTOS

/* the "const" storage-class-modifier is valid */
#define YY_USE_CONST

#else	/* ! __cplusplus */

#ifdef __STDC__

#ifdef __GNUC__
#include <stddef.h>
void *malloc( size_t );
void free( void* );
#else
#include <stdlib.h>
#endif	/* __GNUC__ */

#define YY_USE_PROTOS
#define YY_USE_CONST

#endif	/* __STDC__ */
#endif	/* ! __cplusplus */


#ifdef __TURBOC__
#define YY_USE_CONST
#endif


#ifndef YY_USE_CONST
#define const
#endif


#ifdef YY_USE_PROTOS
#define YY_PROTO(proto) proto
#else
#define YY_PROTO(proto) ()
/* we can't get here if it's an ANSI C compiler, or a C++ compiler,
 * so it's got to be a K&R compiler, and therefore there's no standard
 * place from which to include these definitions
 */
char *malloc();
int free();
int read();
#endif


/* amount of stuff to slurp up with each read */
#ifndef YY_READ_BUF_SIZE
#define YY_READ_BUF_SIZE 8192
#endif

/* returned upon end-of-file */
#define YY_END_TOK 0

/* copy whatever the last rule matched to the standard output */

/* cast to (char *) is because for 8-bit chars, yytext is (unsigned char *) */
/* this used to be an fputs(), but since the string might contain NUL's,
 * we now use fwrite()
 */
#define ECHO (void) fwrite( (char *) yytext, yyleng, 1, yyout )

/* gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
 * is returned in "result".
 */
#define YY_INPUT(buf,result,max_size) \
	if ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \
	    YY_FATAL_ERROR( "read() in flex scanner failed" );
#define YY_NULL 0

/* no semi-colon after return; correct usage is to write "yyterminate();" -
 * we don't want an extra ';' after the "return" because that will cause
 * some compilers to complain about unreachable statements.
 */
#define yyterminate() return ( YY_NULL )

/* report a fatal error */

/* The funky do-while is used to turn this macro definition into
 * a single C statement (which needs a semi-colon terminator).
 * This avoids problems with code like:
 *
 * 	if ( something_happens )
 *		YY_FATAL_ERROR( "oops, the something happened" );
 *	else
 *		everything_okay();
 *
 * Prior to using the do-while the compiler would get upset at the
 * "else" because it interpreted the "if" statement as being all
 * done when it reached the ';' after the YY_FATAL_ERROR() call.
 */

#define YY_FATAL_ERROR(msg) \
	do \
		{ \
		(void) fputs( msg, stderr ); \
		(void) putc( '\n', stderr ); \
		exit( 1 ); \
		} \
	while ( 0 )

/* default yywrap function - always treat EOF as an EOF */
#define yywrap() 1

/* enter a start condition.  This macro really ought to take a parameter,
 * but we do it the disgusting crufty way forced on us by the ()-less
 * definition of BEGIN
 */
#define BEGIN yy_start = 1 + 2 *

/* action number for EOF rule of a given start state */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)

/* special action meaning "start processing a new file" */
#define YY_NEW_FILE \
	do \
		{ \
		yy_init_buffer( yy_current_buffer, yyin ); \
		yy_load_buffer_state(); \
		} \
	while ( 0 )

/* default declaration of generated scanner - a define so the user can
 * easily add parameters
 */
#define YY_DECL int yylex YY_PROTO(( void )) 

/* code executed at the end of each rule */
#define YY_BREAK break;

#define YY_END_OF_BUFFER_CHAR 0

#ifndef YY_BUF_SIZE
#define YY_BUF_SIZE (YY_READ_BUF_SIZE * 2) /* size of default input buffer */
#endif

typedef struct yy_buffer_state *YY_BUFFER_STATE;

#define YY_CHAR unsigned char
# line 1 "lacheck.lex"
#define INITIAL 0
/*                    -*- Mode: C -*- 
 * 
 * lacheck.lex - A consistency checker checker for LaTeX documents
 *	
 * ** NOTE: if anyone makes this compile on VMS I'd like to know ***
 * 
 * Copyright (C) 1991 Kresten Krab Thorup (krab@iesd.auc.dk).
 * 
 * $Locker:  $
 * $Revision: 1.2 $
 * Author          : Kresten Krab Thorup
 * Created On      : Sun May 26 18:11:58 1991
 * Last Modified By: Kresten Krab Thorup
 * Last Modified On: Wed Jul 15 11:15:46 1992
 * Update Count    : 103
 * 
 * HISTORY
 * 6-Jun-1992		Kresten Krab Thorup	
 *    Last Modified: Sat Jun  6 16:37:44 1992 #48 (Kresten Krab Thorup)
 *    Added test for whitespace before punctation mark
 * 17-Dec-1991  (Last Mod: Tue Dec 17 21:01:24 1991 #41)  Kresten Krab Thorup
 *    Added 'word word` and missing ~ before cite and ref
 * 18-Jun-1991  (Last Mod: Tue Jun 18 19:20:43 1991 #17)  Kresten Krab Thorup
 *    Added check (or rather management) for \newenvironment and
 *    \newcommand - as suggested by Per Abrahamsen abrham@hugin.dk
 * 30-May-1991  (Last Mod: Thu May 30 02:22:33 1991 #15)  Kresten Krab Thorup
 *    Added check for `$${punct}' and `{punct}$' constructions
 * 30-May-1991  (Last Mod: Wed May 29 10:31:35 1991 #6)  Kresten Krab Thorup
 *    Improved (dynamic) stack management from Andreas Stolcke ...
 *                                       <stolcke@ICSI.Berkeley.EDU> 
 * 26-May-1991  Kresten Krab Thorup
 *    Initial distribution version.
 */
# line 36 "lacheck.lex"

/* * Last edited: Jul 15 11:15 1992 (krab) */

#include <stdio.h>
#include <string.h>
/* #include <sys/param.h> */

extern char *realloc();

#ifdef NEED_STRSTR
char *strstr();
#endif

#define GROUP_STACK_SIZE 10
#define INPUT_STACK_SIZE 10

#define PROGNAME "LaCheck"

  /* macros */

#define CG_NAME gstack[gstackp-1].s_name
#define CG_TYPE gstack[gstackp-1].s_type
#define CG_LINE gstack[gstackp-1].s_line
#define CG_FILE gstack[gstackp-1].s_file

char *bg_command();
void pop();
void push();
void g_checkend();
void e_checkend();
void f_checkend();
void input_file();
void print_bad_match();
int check_top_level_end();

  /* global variables */

char returnval[100];
int line_count = 1;
int warn_count = 0;
char *file_name;
char verb_char;

  /* the group stack */

typedef struct tex_group 
 {
    unsigned char *s_name;
    int s_type;
    int s_line;
    char *s_file; 
 } tex_group;

tex_group *gstack;
int gstack_size = GROUP_STACK_SIZE;
int gstackp = 0;

typedef struct input_ 
 {
    YY_BUFFER_STATE stream;
    char *name;
    int linenum;
 } input_;

input_ *istack;
int istack_size = INPUT_STACK_SIZE;
int istackp = 0;

int def_count = 0;

#define B_ENVIRONMENT 1
#define E_ENVIRONMENT 2
#define VERBATIM 3
#define INCLUDE 4
#define MATH 5
#define COMMENT 6
#define VERB 7
#define DEF 8
#define AFTER_DISPLAY 9
#define ENV_DEF 10
# line 147 "lacheck.lex"

/* done after the current pattern has been matched and before the
 * corresponding action - sets up yytext
 */
#define YY_DO_BEFORE_ACTION \
	yytext = yy_bp; \
	yyleng = yy_cp - yy_bp; \
	yy_hold_char = *yy_cp; \
	*yy_cp = '\0'; \
	yy_c_buf_p = yy_cp;

#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2

/* return all but the first 'n' matched characters back to the input stream */
#define yyless(n) \
	do \
		{ \
		/* undo effects of setting up yytext */ \
		*yy_cp = yy_hold_char; \
		yy_c_buf_p = yy_cp = yy_bp + n; \
		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
		} \
	while ( 0 )

#define unput(c) yyunput( c, yytext )


struct yy_buffer_state
    {
    FILE *yy_input_file;

    YY_CHAR *yy_ch_buf;		/* input buffer */
    YY_CHAR *yy_buf_pos;	/* current position in input buffer */

    /* size of input buffer in bytes, not including room for EOB characters*/
    int yy_buf_size;	

    /* number of characters read into yy_ch_buf, not including EOB characters */
    int yy_n_chars;

    int yy_eof_status;		/* whether we've seen an EOF on this buffer */
#define EOF_NOT_SEEN 0
    /* "pending" happens when the EOF has been seen but there's still
     * some text process
     */
#define EOF_PENDING 1
#define EOF_DONE 2
    };

static YY_BUFFER_STATE yy_current_buffer;

/* we provide macros for accessing buffer states in case in the
 * future we want to put the buffer states in a more general
 * "scanner state"
 */
#define YY_CURRENT_BUFFER yy_current_buffer


/* yy_hold_char holds the character lost when yytext is formed */
static YY_CHAR yy_hold_char;

static int yy_n_chars;		/* number of characters read into yy_ch_buf */



#ifndef YY_USER_ACTION
#define YY_USER_ACTION
#endif

#ifndef YY_USER_INIT
#define YY_USER_INIT
#endif

extern YY_CHAR *yytext;
extern int yyleng;
extern FILE *yyin, *yyout;

YY_CHAR *yytext;
int yyleng;

FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;

#define YY_END_OF_BUFFER 71
typedef int yy_state_type;
static const short int yy_acclist[254] =
    {   0,
       71,   69,   70,   69,   70,    4,   70,   69,   70,   69,
       70,   27,   69,   70,    3,   63,   69,   70,   69,   70,
       69,   70,   69,   70,   69,   70,   69,   70,   69,   70,
       69,   70,    9,   69,   70,   10,   69,   70,   69,   70,
       33,   70,   70,   42,   70,   36,   70,   35,   36,   70,
       37,   70,   36,   70,   67,   70,   65,   70,   64,   70,
       39,   70,   14,   70,    4,   70,    3,   14,   70,   14,
       70,   12,   14,   70,   13,   14,   70,   24,   70,   25,
       70,   23,   24,   70,   18,   70,    3,   18,   70,   18,
       70,   16,   18,   70,   17,   18,   70,   62,   47,   26,

       28,    3,    3,    3,    7,    2,   19,   20,   21,    1,
       22,    5,    6,16428,    8,   47,   33,   42,   67,16427,
        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
        3,   50,   52,16430,   59,   59,   59,16442,16429,    3,
        3,    3,    3,    3,    3,    3,    3,16442,    3,    3,
       59,   59,   55,   55,   59, 8236,   51,   51, 8250, 8235,
        3,    3,   51,    3,    3,   51,    3,    3,    3,    3,
     8250,    3,    3, 8238,   11,   11,   59,   11,   41,   40,
     8237,    3,    3,    3,   11,   59,   11,   59,   56,   56,
       56,   59,   56,   56,   38,   38,   59,   38,    3,    3,

        3,   32,   31,    9,   10,   66,   57,   57,   57,   59,
       57,   57,   12,   13,   16,   17,   53,    3,    3,    3,
       48,    3,    3,    3,    3,    3,   61,   49,   49,   54,
       60,    3,   49,    3,    3,   49,    3,    3,    3,   30,
       30,   59,16428,    3,    3,    3,    3,   29,   29,   59,
        3,   34,   15
    } ;

static const short int yy_accept[666] =
    {   0,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    2,    4,    6,    8,   10,   12,   15,
       19,   21,   23,   25,   27,   29,   31,   33,   36,   39,
       41,   43,   44,   46,   48,   51,   53,   55,   57,   59,
       61,   63,   65,   67,   70,   72,   75,   78,   80,   82,
       85,   87,   90,   92,   95,   98,   98,   98,   98,   99,
       99,   99,   99,   99,   99,  100,  100,  101,  101,  102,
      103,  104,  105,  105,  105,  105,  105,  105,  106,  107,
      108,  109,  109,  109,  110,  111,  112,  112,  112,  112,

      112,  112,  112,  112,  112,  112,  112,  112,  112,  112,
      112,  112,  112,  113,  114,  115,  115,  115,  116,  117,
      117,  118,  119,  119,  120,  120,  120,  120,  120,  120,
      120,  120,  120,  120,  120,  120,  120,  120,  120,  120,
      120,  120,  120,  120,  120,  121,  121,  121,  121,  121,
      122,  123,  124,  125,  126,  127,  128,  129,  130,  131,
      132,  132,  132,  132,  133,  133,  133,  133,  134,  135,
      136,  137,  138,  138,  138,  138,  138,  138,  138,  138,
      138,  138,  138,  138,  138,  138,  138,  138,  138,  138,
      138,  138,  138,  138,  138,  138,  138,  138,  138,  138,

      138,  138,  138,  138,  138,  138,  138,  138,  138,  138,
      138,  138,  138,  138,  138,  138,  138,  138,  138,  138,
      138,  138,  138,  139,  139,  139,  140,  140,  140,  140,
      140,  140,  140,  140,  140,  140,  140,  141,  142,  143,
      144,  145,  146,  147,  149,  150,  151,  151,  151,  151,
      151,  151,  151,  151,  151,  151,  152,  153,  153,  153,
      153,  153,  153,  153,  153,  153,  153,  153,  154,  156,
      156,  156,  156,  156,  156,  156,  156,  156,  156,  156,
      156,  156,  156,  156,  156,  156,  156,  156,  156,  156,
      156,  156,  156,  156,  156,  156,  156,  157,  157,  157,

      157,  157,  157,  157,  157,  157,  157,  157,  157,  157,
      158,  158,  159,  159,  159,  159,  160,  160,  160,  160,
      160,  160,  160,  160,  160,  160,  160,  161,  161,  161,
      161,  161,  161,  162,  164,  165,  167,  168,  169,  170,
      172,  173,  174,  174,  174,  174,  174,  174,  174,  174,
      174,  175,  175,  175,  175,  175,  175,  175,  175,  175,
      175,  175,  175,  175,  176,  178,  179,  179,  179,  179,
      179,  179,  180,  180,  181,  181,  181,  181,  181,  181,
      181,  181,  181,  181,  181,  181,  181,  181,  181,  181,
      181,  181,  181,  181,  181,  181,  181,  181,  181,  181,

      181,  181,  181,  181,  181,  181,  181,  182,  182,  182,
      182,  182,  182,  182,  182,  182,  182,  183,  184,  185,
      185,  185,  185,  185,  185,  185,  185,  185,  185,  185,
      185,  185,  185,  185,  187,  189,  189,  189,  189,  189,
      189,  189,  189,  189,  190,  191,  191,  193,  194,  195,
      195,  195,  195,  195,  195,  195,  196,  198,  199,  199,
      199,  199,  199,  199,  199,  199,  199,  199,  199,  199,
      199,  199,  199,  199,  199,  199,  199,  199,  199,  200,
      201,  202,  202,  202,  202,  202,  202,  202,  203,  203,
      204,  205,  205,  205,  205,  205,  205,  205,  205,  206,

      206,  206,  206,  207,  207,  207,  207,  208,  209,  209,
      211,  212,  213,  213,  213,  213,  213,  213,  213,  214,
      215,  216,  217,  217,  217,  217,  217,  218,  218,  218,
      218,  218,  219,  220,  221,  221,  221,  222,  222,  222,
      222,  222,  222,  222,  222,  222,  222,  222,  222,  222,
      222,  222,  222,  222,  222,  222,  222,  222,  222,  222,
      222,  223,  224,  225,  226,  227,  227,  227,  227,  227,
      227,  227,  227,  227,  227,  227,  227,  227,  228,  228,
      228,  228,  228,  229,  229,  230,  230,  230,  230,  231,
      231,  231,  231,  232,  234,  235,  237,  238,  239,  240,

      240,  240,  240,  240,  240,  240,  241,  243,  243,  243,
      243,  243,  244,  244,  244,  244,  244,  244,  245,  246,
      246,  246,  246,  246,  246,  246,  246,  246,  246,  246,
      246,  246,  246,  246,  247,  248,  248,  248,  248,  249,
      251,  251,  251,  251,  251,  251,  252,  252,  252,  252,
      252,  252,  252,  253,  253,  253,  253,  253,  253,  253,
      253,  253,  253,  254,  254
    } ;

static const YY_CHAR yy_ec[256] =
    {   0,
        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
        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,   11,   12,   13,   14,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,   15,   16,    1,
        1,    1,    5,   17,   18,   18,   18,   18,   18,   18,
       18,   18,   18,   18,   18,   18,   18,   18,   18,   18,
       18,   18,   18,   18,   18,   18,   18,   18,   18,   18,
       19,   20,   21,    1,   22,   23,   24,   25,   26,   27,

       28,   29,   30,   31,   32,   33,   34,   35,   36,   37,
       38,   39,   33,   40,   41,   42,   43,   44,   45,   46,
       47,   33,   48,    1,   49,   50,    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,
        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,    1,    1,   51,   51,    1,    1,

        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,   51,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,   52,   52,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,   52,    1,    1,
        1,    1,    1,    1,    1
    } ;

static const YY_CHAR yy_meta[53] =
    {   0,
        1,    2,    3,    2,    4,    1,    1,    1,    1,    1,
        1,    4,    1,    4,    1,    1,    5,    6,    1,    4,
        1,    1,    7,    8,    8,    8,    8,    8,    8,    8,
        8,    8,    8,    8,    8,    8,    8,    8,    8,    8,
        8,    8,    8,    8,    8,    8,    8,    9,   10,    4,
        4,   11
    } ;

static const short int yy_base[695] =
    {   0,
        0,    0,   50,   51,   52,   53,   55,   57,   58,   59,
        0,    0, 2001, 2000, 1999, 1998,   61,   63,   60,   64,
       69,   77, 2000,   59,  125,  175, 1991,   76,   86,   73,
      101,  126,  102,  221,  121,  122,  135,  159,   74,  162,
        0, 2005,    0, 2005, 2005, 2005, 1970,    0, 2005, 2005,
     2005, 2005, 2005,    0,  160, 2005, 2005, 2005, 2005, 2005,
     2005,    0,  166, 2005, 2005,  197,  246,  202, 2005,   72,
      143, 1983,   73,  102, 2005,  178, 2005, 1986, 2005,    0,
      277,  273,  292,  314,  208, 1981,  271, 2005, 2005, 2005,
     2005, 1977, 1976, 2005,    0, 2005,  131,  291,  318,  164,

      306,  114,  303,  258,  133,  216,  256,  287,  202,  285,
      260,  320, 2005, 2005,  360, 1957, 1956, 2005, 2005, 1949,
        0,    0, 1952,    0, 1958, 1957, 1956, 1955,  363,  366,
      359, 1955, 1947, 1940, 1953, 1942, 1943, 1943, 1935,  333,
     1944, 1937,  123,  163,  233, 1939, 1938, 1950, 1949,  385,
      388,  395, 1941, 1933, 1926, 1939, 1928, 1929, 1929, 1921,
      183,  382,  411, 2005,  404,  423, 1935, 2005,  430, 1944,
     1943, 1942,  255,  337,  273,  315,  340,  322,  283,  355,
      361,  446,  294,  406,  482,  384,  389,  411,  483,  484,
      485,  486,  488,  487,   74,  489,  491,  495,  511,  493,

      490,  498,  534,  537, 1944,  422,  497, 1929, 1928,  311,
     1928, 1914, 1913, 1912, 1911,  528, 1938,  541,  548,  542,
      561, 1922,  529, 1921, 1907,  567, 1904, 1907, 1915, 1919,
      570,  576, 1914, 1913, 1905, 1904,  535, 1926,  580,  583,
      590,  587, 1910,  592, 1909, 1895, 1899,  597,  609, 1906,
      190, 1900, 1893,  612,  617, 1913, 1912,  549,  601,  592,
      529,  606,  492,  559,  609,  581,  610, 2005, 1911,  614,
      617,  668,  616,  620,  619,  530,  621,  719,  622,  628,
      699,  626,  627,  707,  709,  629,  708,  710,  711,  712,
      632,  636,  713,  714,  730,  752, 2005,  755, 1892, 1891,

     1883, 1882, 1899,  733, 1884, 1883, 1882, 1881, 1892, 2005,
      728, 1905,  758, 1878,  740, 2005, 1883, 1878,  761,  764,
     1885, 1870, 1863, 1884,  767,  770, 2005,  773, 1867, 1866,
     1879, 1878, 1879,    0,  777, 1892,  781, 1865,  788,    0,
     1870, 1865,  760, 1862, 1864, 1866, 1861, 1854,  791,  801,
     2005,  802,  779,  774,  791,  770,  783,  820,  639,  782,
     1869,  797,  799,    0,  853,    0,  800,  808,  814,  801,
      904, 2005,  809, 2005,  884,  810,  892,  894,  952,  812,
      895,  813,  896,  815,  897,  898,  899, 1004,  902,  918,
     1866, 1865, 1850, 1849, 1864, 1055, 1845, 1845, 1844, 1843,

     1842, 1842, 1840, 1858, 1058, 1061, 2005, 1062, 1844,    0,
     1852,  921, 1837, 1836, 1835, 1834, 1833, 1831, 1849, 1830,
     1828, 1834, 1841, 1827, 1065,  901, 1069,  911,  916,  914,
      913,  634,  921,    0,    0,  917,  920, 1053, 1051, 1057,
     1058, 1060, 1080, 2005, 1112,    0, 1850, 1849, 1090,  912,
     1061, 1071, 1074, 1159, 1210, 2005, 1848, 1847, 1821, 1820,
     1833, 1832, 1831, 1830, 1818, 1817, 1816, 1815, 1812, 1816,
     1816, 1213, 1812, 1800, 1820, 1819, 1804, 1803, 1803, 1807,
     1805, 1789, 1799, 1785, 1221, 1072, 1217, 2005, 1079, 2005,
     1783, 1090, 1069, 1084, 1089, 1094, 1103, 1106, 1771, 1199,

     1109, 1107, 2005, 1091,  816, 1201, 2005, 1249,    0, 1761,
     1760, 1233, 1734, 1732, 1731, 1732, 1728, 1727, 2005, 2005,
     2005, 2005, 1236, 1724, 1723, 1721, 2005, 1722, 1718, 1704,
     1703, 1242, 1688, 1687, 1686, 1248, 2005, 1285, 1087, 1205,
     1240, 1241, 1209, 1281, 1285, 1232, 1687, 1694, 1690, 1281,
     1689, 1695, 1310, 1291, 1675, 1665, 1664, 1329, 1645, 1634,
     1658, 1316, 1323, 1641, 1636, 1331, 1350, 1638,  302, 1518,
     1211, 1380, 1298, 1308, 1291, 1509, 1508, 2005, 1533, 1241,
     1334, 1522, 2005, 1338, 1533, 1431, 1504, 1518, 2005, 1332,
     1343, 1346, 1331,    0, 1433, 1529, 1435, 1500, 1513, 1414,

     1498, 1499, 1501, 1496, 1338, 2005, 1514, 1345, 1342, 1424,
     1419, 1444, 1488, 1497, 1488, 1491, 1490, 1492, 1484, 1480,
     1478, 1424, 1431, 1462, 1498, 1499, 1435, 1436, 1412, 1415,
     1350, 1348, 1343, 1298, 1293, 1276, 1243, 1192, 2005, 1212,
     1500, 1066, 1017,  965,  875,  805,  711, 1502,  690,  546,
      403, 1501, 2005,  412,  351, 1503,  336,  150,    0,  140,
       24,    0,    0, 2005, 1551, 1562, 1573, 1584, 1595, 1606,
     1617, 1628, 1639, 1650, 1660, 1671, 1682, 1693, 1704, 1711,
     1715, 1722, 1733, 1744, 1751, 1758, 1768, 1779, 1790, 1801,
     1812, 1817, 1823, 1831

    } ;

static const short int yy_def[695] =
    {   0,
      664,    1,  665,  665,  666,  666,  667,  667,  668,  668,
      669,  669,  670,  670,  671,  671,  672,  672,  673,  673,
      674,  674,  664,  664,  675,  675,   26,  664,  664,  676,
      664,  664,  664,  664,  664,  664,  664,  664,  664,  664,
      677,  664,  678,  664,  664,  664,  664,  679,  664,  664,
      664,  664,  664,  676,  664,  664,  664,  664,  664,  664,
      664,  676,  664,  664,  664,  664,  664,  664,  664,  664,
       67,  664,  664,  664,  664,  664,  664,   67,  664,  676,
      676,  676,  664,  664,   67,  664,  664,  664,  664,  664,
      664,  680,  681,  664,   67,  664,  681,  681,  681,  681,

      681,  681,  681,  681,  681,  681,  681,  681,  681,  681,
      681,  681,  664,  664,  682,  664,  664,  664,  664,   67,
      677,  678,  664,  679,  664,  664,  664,  664,  664,  683,
      664,  664,  664,  664,  664,  664,  664,  664,  664,  664,
      664,  664,  664,  664,  664,  664,  664,  664,  664,  676,
      684,  676,  676,  676,  676,  676,  676,  676,  676,  676,
      664,  664,  664,  664,  664,  664,  664,  664,  664,  685,
      680,  685,  681,  681,  681,  681,  681,  681,  681,  681,
      681,  664,  681,  681,  681,  681,  681,  681,  681,  681,
      681,  681,  681,  681,  681,  681,  681,  681,  681,  681,

      681,  681,  686,  686,  664,  664,  664,  664,  664,  664,
      664,  664,  664,  664,  664,  664,  664,  683,  683,  664,
      664,  664,  664,  664,  664,  664,  664,  664,  664,  664,
      687,  687,  664,  664,  664,  664,  676,  676,  684,  684,
      676,  676,  676,  676,  676,  676,  664,  664,  664,  664,
      664,  664,  664,  664,  664,  685,  685,  681,  681,  681,
      681,  681,  681,  681,  681,  681,  681,  664,  685,  681,
      681,  664,  681,  681,  681,  681,  681,  681,  681,  681,
      681,  681,  681,  681,  681,  681,  681,  681,  681,  681,
      681,  681,  681,  681,  686,  686,  664,  686,  664,  664,

      664,  664,  664,  664,  664,  664,  664,  664,  664,  664,
      683,  664,  683,  664,  664,  664,  664,  664,  664,  664,
      664,  664,  664,  664,  687,  687,  664,  687,  664,  664,
      664,  664,  676,  676,  684,  676,  684,  676,  676,  676,
      676,  676,  664,  664,  664,  664,  664,  664,  664,  664,
      664,  664,  681,  681,  681,  681,  681,  681,  681,  681,
      182,  681,  681,  688,  664,  272,  681,  681,  681,  681,
      664,  664,  681,  664,  681,  681,  681,  681,  664,  681,
      681,  681,  681,  681,  681,  681,  681,  664,  681,  686,
      664,  664,  664,  664,  664,  664,  664,  664,  664,  664,

      664,  664,  664,  664,  664,  664,  664,  664,  664,  689,
      664,  687,  664,  664,  664,  664,  676,  676,  676,  664,
      664,  664,  664,  664,  664,  681,  278,  681,  681,  681,
      681,  182,  681,  365,  365,  681,  182,  681,  681,  681,
      681,  681,  681,  664,  379,  445,  685,  681,  445,  681,
      681,  681,  681,  664,  681,  664,  685,  681,  664,  664,
      664,  664,  664,  664,  664,  664,  664,  664,  664,  664,
      664,  664,  664,  689,  664,  664,  664,  664,  676,  676,
      676,  664,  664,  664,  664,  681,  664,  664,  681,  664,
      681,  681,  681,  681,  681,  681,  681,  681,  681,  681,

      681,  681,  664,  681,  681,  681,  664,  454,  508,  685,
      681,  508,  664,  664,  664,  664,  664,  664,  664,  664,
      664,  664,  690,  664,  664,  664,  664,  664,  664,  664,
      664,  691,  676,  676,  664,  664,  664,  664,  681,  681,
      681,  681,  681,  681,  681,  681,  664,  664,  664,  692,
      664,  664,  690,  664,  664,  664,  664,   26,  664,  664,
      676,  691,  676,  676,  676,  664,  664,  664,  664,  664,
      681,  664,  681,  681,  681,  664,  664,  664,  664,  664,
      664,  664,  664,  690,  664,  690,  664,  664,  664,  558,
      664,  664,  664,  676,  691,  676,  691,  676,  676,  664,

      664,  664,  664,  664,  681,  664,  685,  681,  681,  681,
      692,  664,  664,  664,  664,  664,  664,  676,  676,  664,
      664,  664,  664,  664,  681,  681,  664,  664,  664,  664,
      664,  664,  664,  676,  676,  664,  664,  664,  664,  685,
      681,  664,  664,  664,  664,  676,  664,  681,  664,  664,
      664,  681,  664,  664,  664,  681,  664,  664,  693,  558,
      693,  694,  694,    0,  664,  664,  664,  664,  664,  664,
      664,  664,  664,  664,  664,  664,  664,  664,  664,  664,
      664,  664,  664,  664,  664,  664,  664,  664,  664,  664,
      664,  664,  664,  664

    } ;

static const short int yy_nxt[2058] =
    {   0,
       24,   25,   26,   27,   28,   29,   30,   24,   24,   24,
       31,   24,   31,   32,   24,   24,   24,   33,   24,   34,
       24,   24,   24,   35,   35,   35,   35,   35,   35,   35,
       35,   35,   35,   35,   36,   35,   35,   35,   35,   35,
       35,   35,   37,   35,   35,   35,   35,   38,   39,   40,
       33,   35,   42,   42,   42,   42,   45,   46,   45,   46,
       42,   42,   59,   53,   60,   53,   59,   54,   60,   54,
       66,   53,  662,   60,   47,   62,   47,   60,   67,   53,
       55,   77,   55,   62,   81,   66,  145,   66,   63,  140,
      172,   79,   82,   67,  146,   78,   63,   66,   42,   42,

       42,   42,   83,   83,   83,   67,   42,   42,   56,   57,
       56,   57,   66,   66,   84,  145,   64,   65,  286,   87,
       85,   67,  140,  147,   64,   65,   68,   68,   68,   69,
      172,   77,   66,   66,  115,  115,   66,   66,   69,   86,
       67,   67,   70,  116,   71,   78,   66,  172,  115,  172,
      229,  190,   87,  664,   67,  173,  117,  174,  223,   73,
      118,  118,  118,  119,  119,  119,   89,   74,  141,  193,
       66,  142,   89,   66,   75,   70,   68,   68,   68,   69,
      172,  120,  143,  144,  125,   76,   66,  126,   69,  660,
      127,  184,   70,  128,   71,  185,   84,  223,  129,  129,

      129,  230,  247,   68,   68,   68,   69,  113,  114,   73,
      130,   75,  148,  113,  114,   69,  131,   74,  172,  166,
      149,  166,  166,  166,   75,   70,   88,   89,  345,   90,
       91,  346,  172,  198,  231,  232,  231,   92,   93,   94,
       95,   96,  167,  194,   97,   98,   99,  100,  101,  102,
      103,  104,  105,   93,   93,  106,   93,  107,  108,   93,
      109,  110,  111,   93,  112,   93,  103,   93,  113,  114,
      132,  172,  172,  133,  172,  169,  172,  134,  150,  129,
      150,  135,  136,  195,  169,  137,  138,  139,   87,  172,
      151,  200,  258,  161,  161,  161,  152,  153,  192,  172,

      154,  172,  260,  172,  155,   84,  264,  172,  156,  157,
      172,  162,  158,  159,  160,  163,  163,  163,  175,  172,
      176,   87,  172,  199,  164,  196,  164,   84,  197,  186,
      271,  172,  186,  165,  172,  187,  172,  226,  172,  191,
      602,  177,  188,  603,  178,  223,  226,  201,  179,  303,
      140,  189,  180,  172,  261,  181,  172,  182,  183,  263,
      202,  203,  204,  203,  216,  216,  216,  218,  218,  218,
      221,  172,  221,  221,  221,  660,  130,  172,  658,  219,
      259,  262,  131,  140,  222,  220,  237,  216,  237,  239,
      218,  239,  265,  166,  206,  166,  166,  166,  151,  266,

      172,  240,  207,  267,  152,  172,  242,  241,  242,  242,
      242,  276,  248,  248,  248,  249,  167,  249,  249,  249,
      243,  164,  172,  164,  161,  161,  161,  172,  277,  250,
      165,  254,  255,  254,  272,  115,   84,  278,  279,  657,
      273,  251,  162,  299,  655,  252,  268,  268,  268,  268,
      268,  268,  268,  268,  268,  268,  268,  268,  268,  268,
      268,  268,  269,   93,  268,  268,  268,  268,  268,   93,
       93,  270,   93,   93,   93,   93,   93,   93,   93,   93,
       93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
       93,   93,   93,  268,  268,  268,  268,  268,  172,  172,

      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      115,  172,  279,  283,  172,  285,  287,  274,  300,  282,
      281,  280,  289,  288,  290,  275,  284,  172,  292,  293,
      315,  294,  315,  358,  291,  295,  296,  295,  298,  204,
      298,  130,  311,  311,  311,  172,  172,  309,  151,  218,
      218,  218,  312,  313,  333,  313,  313,  313,  272,  312,
      220,  219,  216,  216,  216,  172,  356,  220,  319,  320,
      319,  325,  326,  325,  130,  172,  316,  328,  232,  328,
      131,  335,  311,  335,  239,  218,  239,  654,  237,  216,
      237,  336,  353,  339,  336,  339,  240,  172,  359,  241,

      151,  337,  241,  337,  337,  337,  152,  164,  172,  164,
      248,  248,  248,  349,  350,  349,  343,  172,  352,  164,
      352,  164,  172,  355,  354,  172,  172,  361,  165,  351,
      172,  357,  172,  172,  351,  172,  172,  172,  172,  340,
      363,  367,  172,  172,  172,  172,  362,  368,  172,  360,
      369,  376,  172,  361,  380,  172,  381,  386,  370,   93,
      496,  377,  351,  387,  361,  430,  375,  351,  364,  364,
      364,  364,  364,  364,  364,  364,  364,  364,  364,  364,
      364,  364,  364,  364,  365,  366,  364,  364,  364,  364,
      364,  366,  366,  366,  366,  366,  366,  366,  366,  366,

      366,  366,  366,  366,  366,  366,  366,  366,  366,  366,
      366,  366,  366,  366,  366,  172,  364,  364,  364,  364,
      371,  372,  371,  172,  172,  172,  172,  172,  172,  172,
      172,  295,  296,  295,  396,  172,  396,  388,  653,  312,
      361,  315,  385,  315,  382,  389,  384,  664,  373,  378,
      379,  537,  383,  390,  204,  390,  390,  296,  390,  311,
      311,  311,  405,  406,  405,  408,  374,  408,  325,  326,
      325,  412,  232,  412,  412,  326,  412,  220,  407,  217,
      397,  407,  335,  311,  335,  250,  172,  316,  336,  339,
      172,  339,  349,  350,  349,  172,   80,  251,  172,  172,

      241,  252,  425,  352,  425,  352,  361,  172,  351,  431,
      426,  407,  428,  172,  407,  172,  172,  172,  351,  351,
      429,   83,   83,   83,  172,  172,  172,  427,  172,  172,
      172,  172,  172,   84,  433,  340,  172,  436,  432,  162,
      438,  351,  453,  439,  437,  244,  441,  546,  440,  450,
      452,  351,  351,  364,  364,  364,  364,  364,  364,  364,
      364,  364,  364,  364,  364,  364,  364,  364,  364,  434,
      435,  364,  364,  364,  364,  364,  435,  435,  435,  435,
      435,  435,  435,  435,  435,  435,  435,  435,  435,  435,
      435,  435,  435,  435,  435,  435,  435,  435,  435,  435,

      172,  364,  364,  364,  364,  371,  372,  371,  172,  380,
      172,  172,  172,  172,  172,  172,  651,  172,  172,  390,
      296,  390,  412,  326,  412,  455,  486,  172,  172,  172,
      172,  451,  172,  172,  442,  443,  358,  172,  454,  358,
      361,  493,  492,  497,  494,   93,  498,  504,  361,  491,
      495,  374,  444,  445,  446,  445,  444,  444,  444,  444,
      444,  444,  444,  444,  444,  444,  444,  444,  447,  448,
      444,  449,  444,  444,  444,  448,  448,  448,  448,  448,
      448,  448,  448,  448,  448,  448,  448,  448,  448,  448,
      448,  448,  448,  448,  448,  448,  448,  448,  448,  444,

      444,  444,  444,  444,  456,  456,  650,  456,  456,  456,
      456,  456,  456,  456,  456,  456,  456,  456,  456,  456,
      457,  458,  456,  456,  456,  456,  456,  458,  458,  458,
      458,  458,  458,  458,  458,  458,  458,  458,  458,  458,
      458,  458,  458,  458,  458,  458,  458,  458,  458,  458,
      458,  456,  456,  456,  456,  456,  396,  223,  396,  405,
      406,  405,  472,  408,  472,  408,  425,  172,  425,  172,
      487,  488,  487,  172,  172,  407,  172,  172,  407,  407,
      361,  503,  351,  503,  501,  172,  502,  172,  172,  499,
      172,  444,  664,  444,  500,  172,  172,  361,  489,  361,

      172,  649,  397,  172,  505,  172,  172,  172,  407,  444,
      172,  407,  407,  506,  358,  351,  490,  361,  539,  172,
      361,  541,  172,  172,  571,  172,  545,  503,  444,  444,
      361,  540,  544,  542,  443,  444,  444,  444,  444,  444,
      444,  444,  444,  444,  444,  444,  444,  444,  444,  444,
      444,  444,  444,  444,  444,  444,  444,  444,  444,  507,
      508,  509,  508,  507,  507,  507,  507,  507,  507,  507,
      507,  507,  507,  507,  507,  510,  511,  507,  512,  507,
      507,  507,  511,  511,  511,  511,  511,  511,  511,  511,
      511,  511,  511,  511,  511,  511,  511,  511,  511,  511,

      511,  511,  511,  511,  511,  511,  507,  507,  507,  507,
      507,  119,  119,  119,  472,  172,  472,  172,  487,  488,
      487,  172,  536,  536,  536,  172,  172,  172,  256,  513,
      407,  537,  537,  537,  507,  664,  507,  553,  553,  553,
      538,  543,  361,  562,  553,  562,  361,  572,  172,  566,
      566,  566,  507,  605,  612,  554,  172,  172,  537,   75,
      537,  563,  116,  407,  490,  507,  507,  538,  361,  361,
      647,  575,  507,  507,  507,  507,  507,  507,  507,  507,
      507,  507,  507,  507,  507,  507,  507,  507,  507,  507,
      507,  507,  507,  507,  507,  507,  567,  172,  567,  567,

      567,  172,  586,  578,  586,  586,  586,  172,  574,  573,
      568,  584,  584,  584,  172,  580,  537,  595,  584,  595,
      244,  585,  569,  581,  172,  646,  570,  596,  610,  554,
      664,  664,  664,  664,  597,  563,  597,  597,  597,  608,
      664,  537,  590,  537,  609,  664,  664,  612,  664,  585,
      600,  566,  566,  566,  172,  117,  145,  664,  172,  145,
      537,  172,  537,  591,  616,  148,   73,  617,  272,  538,
      645,  592,  625,  149,   74,  644,  624,  223,  664,  664,
      606,  606,  606,  606,  606,  606,  606,  606,  606,  606,
      606,  606,  606,  606,  606,  606,  607,   93,  606,  606,

      606,  606,  606,   93,   93,   93,   93,   93,   93,   93,
       93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
       93,   93,   93,   93,   93,   93,   93,  606,  606,  606,
      606,  606,  584,  584,  584,  552,  595,  584,  595,  568,
      172,  664,  643,  642,  596,  203,  204,  203,  612,  612,
      554,  569,   80,  627,  563,  570,  299,  300,  638,  637,
      626,  628,  639,  639,  639,  639,  639,  639,  639,  639,
      639,  639,  639,  639,  639,  639,  639,  639,  640,   93,
      639,  639,  639,  639,  639,   93,   93,   93,   93,   93,
       93,   93,   93,   93,   93,   93,   93,   93,   93,   93,

       93,   93,   93,   93,   93,   93,   93,   93,   93,  639,
      639,  639,  639,  639,  172,  172,  172,  172,  172,  172,
      636,  537,  635,  634,  633,  632,  631,  648,  630,  629,
      256,  623,  622,  621,  641,  620,  619,  361,  652,  618,
      594,  615,  656,  614,  583,  613,  612,  611,  611,  604,
      659,   41,   41,   41,   41,   41,   41,   41,   41,   41,
       41,   41,   43,   43,   43,   43,   43,   43,   43,   43,
       43,   43,   43,   44,   44,   44,   44,   44,   44,   44,
       44,   44,   44,   44,   48,   48,   48,   48,   48,   48,
       48,   48,   48,   48,   48,   42,   42,   42,   42,   42,

       42,   42,   42,   42,   42,   42,   49,   49,   49,   49,
       49,   49,   49,   49,   49,   49,   49,   51,   51,   51,
       51,   51,   51,   51,   51,   51,   51,   51,   52,   52,
       52,   52,   52,   52,   52,   52,   52,   52,   52,   58,
       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
       61,   61,   61,   61,   61,   61,   61,   61,   61,   61,
       61,   72,   72,   72,  601,   72,  599,   72,  598,  594,
       72,   80,   80,  593,   80,   80,   80,   80,   80,   80,
       80,   80,  121,  121,  593,  121,  121,  121,  121,  121,
      121,  589,  121,  122,  122,  588,  122,  122,  122,  122,

      122,  122,  587,  122,  124,  124,  583,  124,  124,  124,
      124,  124,  124,  582,  124,  171,  171,  577,  171,   93,
       93,  576,   93,  205,  205,  303,  164,  565,  564,  205,
      560,  559,  205,  217,  217,  217,  217,  217,  217,  217,
      217,  217,  217,  217,  238,  238,  238,  238,  238,  238,
      238,  238,  238,  238,  238,  257,  257,  558,  257,  297,
      297,  558,  557,  556,  555,  297,  551,  550,  297,  327,
      327,  550,  549,  548,  547,  327,  172,  256,  327,  364,
      364,  364,  364,  364,  364,  364,  364,  172,  364,  364,
      474,  474,  474,  474,  474,  474,  474,  474,  474,  172,

      474,  552,  552,  552,  552,  552,  552,  552,  552,  552,
      552,  552,  561,  561,  561,  561,  561,  561,  561,  561,
      561,  561,  561,  579,  579,  164,  535,  579,  661,  164,
      661,  663,  663,  663,  663,  663,  663,  663,  663,  534,
      663,  663,  533,  532,  531,  530,  529,  528,  527,  526,
      525,  524,  523,  522,  521,  520,  519,  518,   75,  517,
      516,  515,  514,  172,  256,  172,  256,  485,  484,  483,
      482,  164,  481,  480,  479,  478,  477,  476,  475,   75,
      473,  471,  470,  469,  468,  467,  466,  465,  464,  463,
      462,  461,  460,  459,   93,  424,  423,  422,  421,  420,

      419,  418,  417,  334,  243,  416,  415,  414,  413,  411,
      410,  409,  323,  404,  403,  402,  310,  222,  401,  400,
      399,  398,  395,  394,  393,  392,  391,  256,  256,  256,
      348,  347,  344,  167,  342,  341,  338,  334,  332,  331,
      330,  329,  324,  323,  322,  321,  318,  317,  314,  310,
      308,  307,  306,  305,  304,  302,  301,  115,  256,  170,
      256,  253,  244,  244,  244,  246,  245,  244,  244,  244,
      236,  235,  234,  233,  228,  227,  223,  223,  223,  225,
      224,  223,  223,  223,  215,  214,  213,  212,  211,  210,
      209,  208,  172,  170,  168,   77,  145,  123,   76,  664,

       42,   42,   50,   50,   23,  664,  664,  664,  664,  664,
      664,  664,  664,  664,  664,  664,  664,  664,  664,  664,
      664,  664,  664,  664,  664,  664,  664,  664,  664,  664,
      664,  664,  664,  664,  664,  664,  664,  664,  664,  664,
      664,  664,  664,  664,  664,  664,  664,  664,  664,  664,
      664,  664,  664,  664,  664,  664,  664
    } ;

static const short int yy_chk[2058] =
    {   0,
        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,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    3,    4,    5,    6,    7,    7,    8,    8,
        9,   10,   19,   17,   19,   18,   20,   17,   20,   18,
       24,   21,  661,   19,    7,   21,    8,   20,   24,   22,
       17,   28,   18,   22,   30,   39,   73,   28,   21,   70,
      195,   29,   30,   39,   73,   28,   22,   29,    3,    4,

        5,    6,   31,   31,   31,   29,    9,   10,   17,   17,
       18,   18,   31,   33,   31,   74,   21,   21,  195,   33,
       31,   33,   70,   74,   22,   22,   25,   25,   25,   25,
      102,   32,   35,   36,   35,   36,   25,   32,   25,   32,
       35,   36,   25,   36,   25,   32,   37,   97,   37,  105,
      143,  102,   33,  660,   37,   97,   37,   97,  143,   25,
       38,   38,   38,   40,   40,   40,   55,   25,   71,  105,
       38,   71,   63,   40,   25,   25,   26,   26,   26,   26,
      100,   40,   71,   71,   55,   76,   26,   55,   26,  658,
       63,  100,   26,   63,   26,  100,  161,  144,   66,   66,

       66,  144,  161,   68,   68,   68,   68,   55,   55,   26,
       66,   40,   76,   63,   63,   68,   66,   26,  109,   85,
       76,   85,   85,   85,   26,   26,   34,   34,  251,   34,
       34,  251,  106,  109,  145,  145,  145,   34,   34,   34,
       34,   34,   85,  106,   34,   34,   34,   34,   34,   34,
       34,   34,   34,   34,   34,   34,   34,   34,   34,   34,
       34,   34,   34,   34,   34,   34,   34,   34,   34,   34,
       67,  173,  107,   67,  104,   87,  111,   67,   81,   81,
       81,   67,   67,  107,   87,   67,   67,   67,   87,  175,
       81,  111,  173,   83,   83,   83,   81,   82,  104,  179,

       82,  110,  175,  108,   82,   83,  179,   98,   82,   82,
      183,   83,   82,   82,   82,   84,   84,   84,   98,  103,
       98,   87,  101,  110,   84,  108,   84,   84,  108,  103,
      183,  176,  101,   84,   99,  101,  112,  140,  178,  103,
      569,   99,  101,  569,   99,  210,  140,  112,   99,  210,
      140,  101,   99,  174,  176,   99,  177,   99,   99,  178,
      112,  115,  115,  115,  129,  129,  129,  130,  130,  130,
      131,  180,  131,  131,  131,  657,  129,  181,  655,  130,
      174,  177,  129,  140,  131,  130,  150,  150,  150,  151,
      151,  151,  180,  162,  115,  162,  162,  162,  150,  181,

      186,  151,  115,  181,  150,  187,  152,  151,  152,  152,
      152,  186,  163,  163,  163,  165,  162,  165,  165,  165,
      152,  163,  184,  163,  166,  166,  166,  188,  187,  165,
      163,  169,  169,  169,  184,  206,  166,  188,  188,  654,
      184,  165,  166,  206,  651,  165,  182,  182,  182,  182,
      182,  182,  182,  182,  182,  182,  182,  182,  182,  182,
      182,  182,  182,  182,  182,  182,  182,  182,  182,  182,
      182,  182,  182,  182,  182,  182,  182,  182,  182,  182,
      182,  182,  182,  182,  182,  182,  182,  182,  182,  182,
      182,  182,  182,  182,  182,  182,  182,  182,  185,  189,

      190,  191,  192,  194,  193,  196,  201,  197,  263,  200,
      207,  198,  191,  193,  202,  194,  196,  185,  207,  192,
      190,  189,  197,  196,  198,  185,  193,  199,  200,  201,
      223,  202,  223,  263,  199,  203,  203,  203,  204,  204,
      204,  216,  218,  218,  218,  261,  276,  216,  237,  219,
      219,  219,  218,  220,  237,  220,  220,  220,  276,  219,
      218,  219,  221,  221,  221,  258,  261,  219,  226,  226,
      226,  231,  231,  231,  221,  264,  223,  232,  232,  232,
      221,  239,  239,  239,  240,  240,  240,  650,  242,  242,
      242,  239,  258,  244,  240,  244,  240,  266,  264,  239,

      242,  241,  240,  241,  241,  241,  242,  248,  260,  248,
      249,  249,  249,  254,  254,  254,  248,  259,  255,  249,
      255,  249,  262,  260,  259,  265,  267,  266,  249,  254,
      270,  262,  273,  271,  255,  275,  274,  277,  279,  244,
      271,  273,  282,  283,  280,  286,  267,  274,  291,  265,
      275,  280,  292,  270,  286,  359,  286,  291,  277,  432,
      432,  283,  254,  292,  282,  359,  279,  255,  272,  272,
      272,  272,  272,  272,  272,  272,  272,  272,  272,  272,
      272,  272,  272,  272,  272,  272,  272,  272,  272,  272,
      272,  272,  272,  272,  272,  272,  272,  272,  272,  272,

      272,  272,  272,  272,  272,  272,  272,  272,  272,  272,
      272,  272,  272,  272,  272,  281,  272,  272,  272,  272,
      278,  278,  278,  284,  287,  285,  288,  289,  290,  293,
      294,  295,  295,  295,  304,  278,  304,  293,  649,  311,
      281,  315,  290,  315,  287,  294,  289,  311,  278,  284,
      285,  647,  288,  296,  296,  296,  298,  298,  298,  313,
      313,  313,  319,  319,  319,  320,  278,  320,  325,  325,
      325,  326,  326,  326,  328,  328,  328,  313,  319,  335,
      304,  320,  337,  337,  337,  343,  356,  315,  335,  339,
      354,  339,  349,  349,  349,  353,  335,  343,  360,  357,

      337,  343,  350,  352,  350,  352,  353,  355,  349,  360,
      354,  319,  356,  362,  320,  363,  367,  370,  350,  352,
      357,  358,  358,  358,  368,  373,  376,  355,  380,  382,
      369,  384,  505,  358,  363,  339,  358,  367,  362,  358,
      369,  349,  384,  370,  368,  646,  376,  505,  373,  380,
      382,  350,  352,  365,  365,  365,  365,  365,  365,  365,
      365,  365,  365,  365,  365,  365,  365,  365,  365,  365,
      365,  365,  365,  365,  365,  365,  365,  365,  365,  365,
      365,  365,  365,  365,  365,  365,  365,  365,  365,  365,
      365,  365,  365,  365,  365,  365,  365,  365,  365,  365,

      375,  365,  365,  365,  365,  371,  371,  371,  377,  375,
      378,  381,  383,  385,  386,  387,  645,  426,  389,  390,
      390,  390,  412,  412,  412,  386,  426,  428,  450,  431,
      430,  381,  429,  436,  377,  378,  383,  433,  385,  387,
      389,  430,  429,  436,  431,  437,  437,  450,  433,  428,
      431,  371,  379,  379,  379,  379,  379,  379,  379,  379,
      379,  379,  379,  379,  379,  379,  379,  379,  379,  379,
      379,  379,  379,  379,  379,  379,  379,  379,  379,  379,
      379,  379,  379,  379,  379,  379,  379,  379,  379,  379,
      379,  379,  379,  379,  379,  379,  379,  379,  379,  379,

      379,  379,  379,  379,  388,  388,  644,  388,  388,  388,
      388,  388,  388,  388,  388,  388,  388,  388,  388,  388,
      388,  388,  388,  388,  388,  388,  388,  388,  388,  388,
      388,  388,  388,  388,  388,  388,  388,  388,  388,  388,
      388,  388,  388,  388,  388,  388,  388,  388,  388,  388,
      388,  388,  388,  388,  388,  388,  396,  643,  396,  405,
      405,  405,  406,  408,  406,  408,  425,  439,  425,  438,
      427,  427,  427,  440,  441,  405,  442,  451,  406,  408,
      438,  443,  425,  443,  441,  493,  442,  452,  486,  439,
      453,  449,  449,  449,  440,  489,  443,  493,  427,  486,

      494,  642,  396,  539,  451,  495,  492,  504,  405,  449,
      496,  406,  408,  452,  453,  425,  427,  492,  489,  497,
      494,  496,  498,  502,  539,  501,  504,  443,  445,  445,
      497,  495,  501,  498,  502,  445,  445,  445,  445,  445,
      445,  445,  445,  445,  445,  445,  445,  445,  445,  445,
      445,  445,  445,  445,  445,  445,  445,  445,  445,  454,
      454,  454,  454,  454,  454,  454,  454,  454,  454,  454,
      454,  454,  454,  454,  454,  454,  454,  454,  454,  454,
      454,  454,  454,  454,  454,  454,  454,  454,  454,  454,
      454,  454,  454,  454,  454,  454,  454,  454,  454,  454,

      454,  454,  454,  454,  454,  454,  454,  454,  454,  454,
      454,  455,  455,  455,  472,  500,  472,  506,  487,  487,
      487,  540,  485,  485,  485,  543,  455,  571,  640,  455,
      472,  485,  638,  485,  512,  512,  512,  523,  523,  523,
      485,  500,  506,  532,  532,  532,  540,  543,  546,  536,
      536,  536,  512,  571,  580,  523,  541,  542,  536,  455,
      536,  532,  580,  472,  487,  508,  508,  536,  541,  542,
      637,  546,  508,  508,  508,  508,  508,  508,  508,  508,
      508,  508,  508,  508,  508,  508,  508,  508,  508,  508,
      508,  508,  508,  508,  508,  508,  538,  544,  538,  538,

      538,  545,  554,  550,  554,  554,  554,  575,  545,  544,
      538,  553,  553,  553,  573,  550,  636,  562,  562,  562,
      635,  553,  538,  550,  574,  634,  538,  562,  575,  553,
      558,  558,  558,  558,  563,  562,  563,  563,  563,  573,
      558,  566,  558,  566,  574,  590,  558,  581,  558,  584,
      566,  567,  567,  567,  605,  581,  591,  584,  609,  592,
      567,  608,  567,  558,  591,  593,  590,  592,  609,  567,
      633,  558,  608,  593,  590,  632,  605,  631,  558,  558,
      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,

      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
      572,  572,  586,  586,  586,  595,  597,  597,  597,  600,
      610,  611,  630,  629,  595,  612,  612,  612,  627,  628,
      586,  600,  595,  611,  597,  600,  627,  628,  623,  622,
      610,  611,  624,  624,  624,  624,  624,  624,  624,  624,
      624,  624,  624,  624,  624,  624,  624,  624,  624,  624,
      624,  624,  624,  624,  624,  624,  624,  624,  624,  624,
      624,  624,  624,  624,  624,  624,  624,  624,  624,  624,

      624,  624,  624,  624,  624,  624,  624,  624,  624,  624,
      624,  624,  624,  624,  625,  626,  641,  652,  648,  656,
      621,  620,  619,  618,  617,  616,  615,  641,  614,  613,
      607,  604,  603,  602,  626,  601,  599,  625,  648,  598,
      596,  588,  652,  587,  585,  582,  579,  577,  576,  570,
      656,  665,  665,  665,  665,  665,  665,  665,  665,  665,
      665,  665,  666,  666,  666,  666,  666,  666,  666,  666,
      666,  666,  666,  667,  667,  667,  667,  667,  667,  667,
      667,  667,  667,  667,  668,  668,  668,  668,  668,  668,
      668,  668,  668,  668,  668,  669,  669,  669,  669,  669,

      669,  669,  669,  669,  669,  669,  670,  670,  670,  670,
      670,  670,  670,  670,  670,  670,  670,  671,  671,  671,
      671,  671,  671,  671,  671,  671,  671,  671,  672,  672,
      672,  672,  672,  672,  672,  672,  672,  672,  672,  673,
      673,  673,  673,  673,  673,  673,  673,  673,  673,  673,
      674,  674,  674,  674,  674,  674,  674,  674,  674,  674,
      674,  675,  675,  675,  568,  675,  565,  675,  564,  561,
      675,  676,  676,  560,  676,  676,  676,  676,  676,  676,
      676,  676,  677,  677,  559,  677,  677,  677,  677,  677,
      677,  557,  677,  678,  678,  556,  678,  678,  678,  678,

      678,  678,  555,  678,  679,  679,  552,  679,  679,  679,
      679,  679,  679,  551,  679,  680,  680,  549,  680,  681,
      681,  548,  681,  682,  682,  547,  535,  534,  533,  682,
      531,  530,  682,  683,  683,  683,  683,  683,  683,  683,
      683,  683,  683,  683,  684,  684,  684,  684,  684,  684,
      684,  684,  684,  684,  684,  685,  685,  529,  685,  686,
      686,  528,  526,  525,  524,  686,  518,  517,  686,  687,
      687,  516,  515,  514,  513,  687,  511,  510,  687,  688,
      688,  688,  688,  688,  688,  688,  688,  499,  688,  688,
      689,  689,  689,  689,  689,  689,  689,  689,  689,  491,

      689,  690,  690,  690,  690,  690,  690,  690,  690,  690,
      690,  690,  691,  691,  691,  691,  691,  691,  691,  691,
      691,  691,  691,  692,  692,  484,  483,  692,  693,  482,
      693,  694,  694,  694,  694,  694,  694,  694,  694,  481,
      694,  694,  480,  479,  478,  477,  476,  475,  474,  473,
      471,  470,  469,  468,  467,  466,  465,  464,  463,  462,
      461,  460,  459,  458,  457,  448,  447,  424,  423,  422,
      421,  420,  419,  418,  417,  416,  415,  414,  413,  411,
      409,  404,  403,  402,  401,  400,  399,  398,  397,  395,
      394,  393,  392,  391,  361,  348,  347,  346,  345,  344,

      342,  341,  338,  336,  333,  332,  331,  330,  329,  324,
      323,  322,  321,  318,  317,  314,  312,  309,  308,  307,
      306,  305,  303,  302,  301,  300,  299,  269,  257,  256,
      253,  252,  250,  247,  246,  245,  243,  238,  236,  235,
      234,  233,  230,  229,  228,  227,  225,  224,  222,  217,
      215,  214,  213,  212,  211,  209,  208,  205,  172,  171,
      170,  167,  160,  159,  158,  157,  156,  155,  154,  153,
      149,  148,  147,  146,  142,  141,  139,  138,  137,  136,
      135,  134,  133,  132,  128,  127,  126,  125,  123,  120,
      117,  116,   93,   92,   86,   78,   72,   47,   27,   23,

       16,   15,   14,   13,  664,  664,  664,  664,  664,  664,
      664,  664,  664,  664,  664,  664,  664,  664,  664,  664,
      664,  664,  664,  664,  664,  664,  664,  664,  664,  664,
      664,  664,  664,  664,  664,  664,  664,  664,  664,  664,
      664,  664,  664,  664,  664,  664,  664,  664,  664,  664,
      664,  664,  664,  664,  664,  664,  664
    } ;

static yy_state_type yy_last_accepting_state;
static YY_CHAR *yy_last_accepting_cpos;

static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;
static YY_CHAR *yy_full_match;
static int yy_lp;
static int yy_looking_for_trail_begin = 0;
static int yy_full_lp;
static int *yy_full_state;
#define YY_TRAILING_MASK 0x2000
#define YY_TRAILING_HEAD_MASK 0x4000
#define REJECT \
{ \
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \
yy_cp = yy_full_match; /* restore poss. backed-over text */ \
yy_lp = yy_full_lp; /* restore orig. accepting pos. */ \
yy_state_ptr = yy_full_state; /* restore orig. state */ \
yy_current_state = *yy_state_ptr; /* restore curr. state */ \
++yy_lp; \
goto find_rule; \
}
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0

/* these variables are all declared out here so that section 3 code can
 * manipulate them
 */
/* points to current character in buffer */
static YY_CHAR *yy_c_buf_p = (YY_CHAR *) 0;
static int yy_init = 1;		/* whether we need to initialize */
static int yy_start = 0;	/* start state number */

/* flag which is used to allow yywrap()'s to do buffer switches
 * instead of setting up a fresh yyin.  A bit of a hack ...
 */
static int yy_did_buffer_switch_on_eof;

static yy_state_type yy_get_previous_state YY_PROTO(( void ));
static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
static int yy_get_next_buffer YY_PROTO(( void ));
static void yyunput YY_PROTO(( YY_CHAR c, YY_CHAR *buf_ptr ));
void yyrestart YY_PROTO(( FILE *input_file ));
void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
void yy_load_buffer_state YY_PROTO(( void ));
YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));

#define yy_new_buffer yy_create_buffer

#ifdef __cplusplus
static int yyinput YY_PROTO(( void ));
#else
static int input YY_PROTO(( void ));
#endif

YY_DECL
    {
    register yy_state_type yy_current_state;
    register YY_CHAR *yy_cp, *yy_bp;
    register int yy_act;




    if ( yy_init )
	{
	YY_USER_INIT;

	if ( ! yy_start )
	    yy_start = 1;	/* first start state */

	if ( ! yyin )
	    yyin = stdin;

	if ( ! yyout )
	    yyout = stdout;

	if ( yy_current_buffer )
	    yy_init_buffer( yy_current_buffer, yyin );
	else
	    yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );

	yy_load_buffer_state();

	yy_init = 0;
	}

    while ( 1 )		/* loops until end-of-file is reached */
	{
	yy_cp = yy_c_buf_p;

	/* support of yytext */
	*yy_cp = yy_hold_char;

	/* yy_bp points to the position in yy_ch_buf of the start of the
	 * current run.
	 */
	yy_bp = yy_cp;

	yy_current_state = yy_start;
	yy_state_ptr = yy_state_buf;
	*yy_state_ptr++ = yy_current_state;
yy_match:
	do
	    {
	    register YY_CHAR yy_c = yy_ec[*yy_cp];
	    while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
		{
		yy_current_state = yy_def[yy_current_state];
		if ( yy_current_state >= 665 )
		    yy_c = yy_meta[yy_c];
		}
	    yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
	    *yy_state_ptr++ = yy_current_state;
	    ++yy_cp;
	    }
	while ( yy_current_state != 664 );

yy_find_action:
	yy_current_state = *--yy_state_ptr;
	yy_lp = yy_accept[yy_current_state];
find_rule: /* we branch to this label when backtracking */
	for ( ; ; ) /* until we find what rule we matched */
	    {
	    if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] )
		{
		yy_act = yy_acclist[yy_lp];
		if ( yy_act & YY_TRAILING_HEAD_MASK ||
		     yy_looking_for_trail_begin )
		    {
		    if ( yy_act == yy_looking_for_trail_begin )
			{
			yy_looking_for_trail_begin = 0;
			yy_act &= ~YY_TRAILING_HEAD_MASK;
			break;
			}
		    }
		else if ( yy_act & YY_TRAILING_MASK )
		    {
		    yy_looking_for_trail_begin = yy_act & ~YY_TRAILING_MASK;
		    yy_looking_for_trail_begin |= YY_TRAILING_HEAD_MASK;
		    }
		else
		    {
		    yy_full_match = yy_cp;
		    yy_full_state = yy_state_ptr;
		    yy_full_lp = yy_lp;
		    break;
		    }
		++yy_lp;
		goto find_rule;
		}
	    --yy_cp;
	    yy_current_state = *--yy_state_ptr;
	    yy_lp = yy_accept[yy_current_state];
	    }

	YY_DO_BEFORE_ACTION;
	YY_USER_ACTION;

do_action:	/* this label is used only to access EOF actions */


	switch ( yy_act )
	    {
case 1:
# line 149 "lacheck.lex"
{ ; }
	YY_BREAK
case 2:
# line 151 "lacheck.lex"
{ ; }
	YY_BREAK
case 3:
# line 153 "lacheck.lex"
{ ; }
	YY_BREAK
case 4:
# line 155 "lacheck.lex"
{ line_count++; }
	YY_BREAK
case 5:
# line 157 "lacheck.lex"
{ ; }
	YY_BREAK
case 6:
# line 159 "lacheck.lex"
{ ; }
	YY_BREAK
case 7:
# line 161 "lacheck.lex"
{ ; }
	YY_BREAK
case 8:
# line 163 "lacheck.lex"
{  
  if (CG_TYPE != 4 && CG_TYPE != 5) {
    if (!(CG_TYPE == 2 && strstr(CG_NAME, "array"))) {
      printf( "\"%s\", line %d: possible unwanted space at \"{\"\n", 
	     file_name, line_count); 
      ++warn_count ;
    }
  }
  push( "{", 0, line_count);
  if (strcmp(yytext, "{\n") == 0)
    line_count++;
 }
	YY_BREAK
case 9:
# line 176 "lacheck.lex"
{  push( "{", 0, line_count);}
	YY_BREAK
case 10:
# line 178 "lacheck.lex"
{  g_checkend(0); }
	YY_BREAK
case 11:
# line 180 "lacheck.lex"
BEGIN(DEF);
	YY_BREAK
case 12:
# line 183 "lacheck.lex"
{ ++def_count; }
	YY_BREAK
case 13:
# line 185 "lacheck.lex"
{ --def_count;
		 if(def_count == 0)
		     BEGIN(INITIAL); }
	YY_BREAK
case 14:
# line 189 "lacheck.lex"
{ ; }
	YY_BREAK
case 15:
# line 191 "lacheck.lex"
BEGIN(ENV_DEF);
	YY_BREAK
case 16:
# line 193 "lacheck.lex"
{ ++def_count; }
	YY_BREAK
case 17:
# line 195 "lacheck.lex"
{ --def_count;
		 if(def_count == 0)
		     BEGIN(DEF); }
	YY_BREAK
case 18:
# line 199 "lacheck.lex"
{ ; }
	YY_BREAK
case 19:
# line 201 "lacheck.lex"
{
    if(CG_TYPE == 4 || CG_TYPE == 5)
	print_bad_match(yytext,4);
    else
    {
	push( yytext, 4, line_count);
    }}
	YY_BREAK
case 20:
# line 209 "lacheck.lex"
{  g_checkend(4); }
	YY_BREAK
case 21:
# line 211 "lacheck.lex"
{
    if(CG_TYPE == 4 || CG_TYPE == 5)
	print_bad_match(yytext,5);
    else 
    {
	push( yytext, 5, line_count);
    }}
	YY_BREAK
case 22:
# line 220 "lacheck.lex"
{  g_checkend(5);     BEGIN(AFTER_DISPLAY);}
	YY_BREAK
case 23:
# line 222 "lacheck.lex"
{ 

    printf( "\"%s\", line %d: punctuation mark \"%s\" should be placed before end of displaymath\n", 
	   file_name, line_count, yytext); 
    ++warn_count ; 

  BEGIN(INITIAL); }
	YY_BREAK
case 24:
# line 230 "lacheck.lex"
{  BEGIN(INITIAL); }
	YY_BREAK
case 25:
# line 232 "lacheck.lex"
{ 	++line_count; 
			BEGIN(INITIAL); }
	YY_BREAK
case 26:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp = yy_bp + 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
# line 235 "lacheck.lex"
{ if (CG_TYPE == 4)
       {
	 printf( "\"%s\", line %d: punctuation mark \"%s\" should be placed after end of math mode\n", 
		file_name, line_count, yytext); 
	 ++warn_count ;
       }}
	YY_BREAK
case 27:
# line 242 "lacheck.lex"
{

    if(CG_TYPE == 5)
	print_bad_match(yytext, 4);
    else 

    if(CG_TYPE == 4)
    {
	e_checkend(4, yytext);
    }
    else
    {
	push( yytext, 4, line_count); 
    }}
	YY_BREAK
case 28:
# line 258 "lacheck.lex"
{

    if(CG_TYPE == 4)
	print_bad_match(yytext,5);
    else 

    if(CG_TYPE == 5)
    {
	e_checkend(5, yytext);
        BEGIN(AFTER_DISPLAY);
    }
    else
    {
	push( yytext, 5, line_count);
    }}
	YY_BREAK
case 29:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp = yy_bp + 11;
YY_DO_BEFORE_ACTION; /* set up yytext again */
# line 274 "lacheck.lex"
{
 {
    push((unsigned char *)"\\begingroup", 1, line_count); 
 }}
	YY_BREAK
case 30:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp = yy_bp + 9;
YY_DO_BEFORE_ACTION; /* set up yytext again */
# line 280 "lacheck.lex"
{
 {
    g_checkend(1);
 }}
	YY_BREAK
case 31:
# line 286 "lacheck.lex"
{ BEGIN(B_ENVIRONMENT); }
	YY_BREAK
case 32:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
# line 288 "lacheck.lex"
{ 
 {
    
    printf("\"%s\", line %i: {argument} missing for \\begin\n",
	   file_name, line_count) ;
    ++warn_count;
 }}
	YY_BREAK
case 33:
# line 296 "lacheck.lex"
{ 
 {
    if (strcmp( yytext, "verbatim" ) == 0 )
	{
	 input();
	 BEGIN(VERBATIM);
	}
    else
	{
    	 push(yytext, 2, line_count);
 	 input();
	 BEGIN(INITIAL);
	}
 }}
	YY_BREAK
case 34:
# line 311 "lacheck.lex"
{ BEGIN(INITIAL); }
	YY_BREAK
case 35:
# line 313 "lacheck.lex"
{
     printf("\"%s\", line %i: TAB character in verbatim environment\n",
	   file_name, line_count) ;
    ++warn_count;
 }
	YY_BREAK
case 36:
# line 319 "lacheck.lex"
{ ; }
	YY_BREAK
case 37:
# line 321 "lacheck.lex"
{ ++line_count; }
	YY_BREAK
case 38:
# line 324 "lacheck.lex"
{ 
	  sscanf (yytext, "\\verb%c", &verb_char  ); 
	  BEGIN(VERB); 
	}
	YY_BREAK
case 39:
# line 329 "lacheck.lex"
{
		if ( *yytext == verb_char )
		  BEGIN(INITIAL); 
		if ( *yytext == '\n' )
 		  ++line_count;
	} 
	YY_BREAK
case 40:
# line 337 "lacheck.lex"
{ BEGIN(E_ENVIRONMENT); }
	YY_BREAK
case 41:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
# line 339 "lacheck.lex"
{ 
 {
    printf("\"%s\", line %i: {argument} missing for \\end\n",
	   file_name, line_count) ;
    ++warn_count;
 }}
	YY_BREAK
case 42:
# line 347 "lacheck.lex"
{ 
 {
    e_checkend(2, yytext);
    input();
    
    BEGIN(INITIAL);
 }}
	YY_BREAK
case 43:
# line 356 "lacheck.lex"
{ 
 {
    if ( *yytext == '\n' )
		++line_count; 

    printf( "\"%s\", line %d: missing `\\ ' after \"%s\"\n", 
	   file_name, line_count, ++yytext); 
    ++warn_count ; 
 }}
	YY_BREAK
case 44:
# line 366 "lacheck.lex"
{ 
 {
    printf( "\"%s\", line %d: missing `\\ ' after \"%s\"\n", 
	   file_name, line_count, yytext); 
    ++warn_count ; 
 }}
	YY_BREAK
case 45:
# line 373 "lacheck.lex"
{ 
 {
    if ( *yytext == '\n' )
	++line_count;
    printf("\"%s\", line %d: missing `\\@' before punctuation mark in \"%s\"\n", 
	   file_name, line_count, ++yytext); 
    ++warn_count ; 
 }}
	YY_BREAK
case 46:
# line 382 "lacheck.lex"
{ 
 {
    printf("\"%s\", line %d: missing `\\@' before `.' in \"%s\"\n", 
	   file_name, line_count, yytext); 
    ++warn_count ; 
 }}
	YY_BREAK
case 47:
# line 389 "lacheck.lex"
{ 

    printf("\"%s\", line %d: double space at \"%s\"\n",
	   file_name, line_count, yytext); 
    ++warn_count;
  }
	YY_BREAK
case 48:
# line 396 "lacheck.lex"
{
	printf("\"%s\", line %d: \\ldots should be \\cdots in \"%s\"\n",
	   file_name, line_count, yytext); 
	++warn_count;
  }
	YY_BREAK
case 49:
# line 402 "lacheck.lex"
{
	printf("\"%s\", line %d: \\cdots should be \\ldots in \"%s\"\n",
	   file_name, line_count, yytext); 
	++warn_count;
  }
	YY_BREAK
case 50:
# line 408 "lacheck.lex"
{
	printf("\"%s\", line %d: Dots should be \\cdots in \"%s\"\n",
	   file_name, line_count, yytext); 
	++warn_count;
  }
	YY_BREAK
case 51:
# line 414 "lacheck.lex"
{
	printf("\"%s\", line %d: Dots should be \\ldots in \"%s\"\n",
	   file_name, line_count, yytext); 
	++warn_count;
  }
	YY_BREAK
case 52:
# line 421 "lacheck.lex"
{ 
    printf("\"%s\", line %d: Dots should be ellipsis \"%s\"\n",
	   file_name, line_count, yytext); 
    ++warn_count;
  }
	YY_BREAK
case 53:
# line 427 "lacheck.lex"
{

    printf("\"%s\", line %d: perhaps you should insert a `~' before \"%s\"\n",
	   file_name, line_count, ++yytext); 
  }
	YY_BREAK
case 54:
# line 433 "lacheck.lex"
{

    printf("\"%s\", line %d: whitespace before footnote in \"%s\"\n",
	   file_name, line_count, ++yytext); 
  }
	YY_BREAK
case 55:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
# line 440 "lacheck.lex"
{
 {
    printf("\"%s\", line %d: Don't use \"%s\" in LaTeX documents\n", 
	   file_name, line_count, yytext); 
    ++warn_count ; 
 }}    
	YY_BREAK
case 56:
# line 447 "lacheck.lex"
{;}
	YY_BREAK
case 57:
# line 448 "lacheck.lex"
{;}
	YY_BREAK
case 58:
# line 450 "lacheck.lex"
{ 
 {
    printf("\"%s\", line %d: Fontspecifiers don't take arguments. \"%s\"\n", 
	   file_name, line_count, yytext); 
    ++warn_count; 
  /*    (void) input(); */
 }}
	YY_BREAK
case 59:
# line 459 "lacheck.lex"
{ 
 {
    printf("\"%s\", line %d: Do not use @ in LaTeX macro names. \"%s\"\n", 
	   file_name, line_count, yytext); 
    ++warn_count; 
 }}
	YY_BREAK
case 60:
# line 466 "lacheck.lex"
{ 
 {
    printf("\"%s\", line %d: Use ` to begin quotation, not ' \"%s\"\n", 
	   file_name, line_count, yytext); 
    ++warn_count; 
 }}
	YY_BREAK
case 61:
# line 473 "lacheck.lex"
{ 
 {
    printf("\"%s\", line %d: Use ' to end quotation, not ` \"%s\"\n", 
	   file_name, line_count, yytext); 
    ++warn_count; 
 }}
	YY_BREAK
case 62:
# line 481 "lacheck.lex"
{ 
 {
    printf("\"%s\", line %d: Whitespace before punctation mark in \"%s\"\n", 
	   file_name, line_count, yytext); 
    ++warn_count; 
 }}
	YY_BREAK
case 63:
# line 489 "lacheck.lex"
{ BEGIN(COMMENT); }
	YY_BREAK
case 64:
# line 491 "lacheck.lex"
{ BEGIN(INITIAL); ++line_count; }
	YY_BREAK
case 65:
# line 493 "lacheck.lex"
{ ; }
	YY_BREAK
case 66:
# line 496 "lacheck.lex"
{ BEGIN(INCLUDE); }
	YY_BREAK
case 67:
# line 498 "lacheck.lex"
{
 {
	if ( strstr(yytext,".sty") == NULL )
	{
	  printf("** %s:\n", yytext);
	  input_file(yytext);
	}
	else
	{
		printf("\"%s\", line %d: Style file `%s\' omitted.\n",
			file_name,
			line_count,
			yytext);
		input();
	}
	BEGIN(INITIAL);
 }}
	YY_BREAK
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(B_ENVIRONMENT):
case YY_STATE_EOF(E_ENVIRONMENT):
case YY_STATE_EOF(VERBATIM):
case YY_STATE_EOF(INCLUDE):
case YY_STATE_EOF(MATH):
case YY_STATE_EOF(COMMENT):
case YY_STATE_EOF(VERB):
case YY_STATE_EOF(DEF):
case YY_STATE_EOF(AFTER_DISPLAY):
case YY_STATE_EOF(ENV_DEF):
# line 516 "lacheck.lex"
{ 
	  if (--istackp < 0)
		  yyterminate(); 

	  else
		{ 
		  fclose(yyin);
	  	  f_checkend(file_name);
		  yy_switch_to_buffer(istack[istackp].stream);
		  free(file_name);
		  line_count = istack[istackp].linenum;
		  file_name = istack[istackp].name;
		  input();
		  BEGIN(INITIAL);
		}    	
	 
	}
	YY_BREAK
case 69:
# line 535 "lacheck.lex"
{ ; }
	YY_BREAK
case 70:
# line 536 "lacheck.lex"
ECHO;
	YY_BREAK

	    case YY_END_OF_BUFFER:
		{
		/* amount of text matched not including the EOB char */
		int yy_amount_of_matched_text = yy_cp - yytext - 1;

		/* undo the effects of YY_DO_BEFORE_ACTION */
		*yy_cp = yy_hold_char;

		/* note that here we test for yy_c_buf_p "<=" to the position
		 * of the first EOB in the buffer, since yy_c_buf_p will
		 * already have been incremented past the NUL character
		 * (since all states make transitions on EOB to the end-
		 * of-buffer state).  Contrast this with the test in yyinput().
		 */
		if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
		    /* this was really a NUL */
		    {
		    yy_state_type yy_next_state;

		    yy_c_buf_p = yytext + yy_amount_of_matched_text;

		    yy_current_state = yy_get_previous_state();

		    /* okay, we're now positioned to make the
		     * NUL transition.  We couldn't have
		     * yy_get_previous_state() go ahead and do it
		     * for us because it doesn't know how to deal
		     * with the possibility of jamming (and we
		     * don't want to build jamming into it because
		     * then it will run more slowly)
		     */

		    yy_next_state = yy_try_NUL_trans( yy_current_state );

		    yy_bp = yytext + YY_MORE_ADJ;

		    if ( yy_next_state )
			{
			/* consume the NUL */
			yy_cp = ++yy_c_buf_p;
			yy_current_state = yy_next_state;
			goto yy_match;
			}

		    else
			{
			goto yy_find_action;
			}
		    }

		else switch ( yy_get_next_buffer() )
		    {
		    case EOB_ACT_END_OF_FILE:
			{
			yy_did_buffer_switch_on_eof = 0;

			if ( yywrap() )
			    {
			    /* note: because we've taken care in
			     * yy_get_next_buffer() to have set up yytext,
			     * we can now set up yy_c_buf_p so that if some
			     * total hoser (like flex itself) wants
			     * to call the scanner after we return the
			     * YY_NULL, it'll still work - another YY_NULL
			     * will get returned.
			     */
			    yy_c_buf_p = yytext + YY_MORE_ADJ;

			    yy_act = YY_STATE_EOF((yy_start - 1) / 2);
			    goto do_action;
			    }

			else
			    {
			    if ( ! yy_did_buffer_switch_on_eof )
				YY_NEW_FILE;
			    }
			}
			break;

		    case EOB_ACT_CONTINUE_SCAN:
			yy_c_buf_p = yytext + yy_amount_of_matched_text;

			yy_current_state = yy_get_previous_state();

			yy_cp = yy_c_buf_p;
			yy_bp = yytext + YY_MORE_ADJ;
			goto yy_match;

		    case EOB_ACT_LAST_MATCH:
			yy_c_buf_p =
			    &yy_current_buffer->yy_ch_buf[yy_n_chars];

			yy_current_state = yy_get_previous_state();

			yy_cp = yy_c_buf_p;
			yy_bp = yytext + YY_MORE_ADJ;
			goto yy_find_action;
		    }
		break;
		}

	    default:
#ifdef FLEX_DEBUG
		printf( "action # %d\n", yy_act );
#endif
		YY_FATAL_ERROR(
			"fatal flex scanner internal error--no action found" );
	    }
	}
    }


/* yy_get_next_buffer - try to read in a new buffer
 *
 * synopsis
 *     int yy_get_next_buffer();
 *     
 * returns a code representing an action
 *     EOB_ACT_LAST_MATCH - 
 *     EOB_ACT_CONTINUE_SCAN - continue scanning from current position
 *     EOB_ACT_END_OF_FILE - end of file
 */

static int yy_get_next_buffer()

    {
    register YY_CHAR *dest = yy_current_buffer->yy_ch_buf;
    register YY_CHAR *source = yytext - 1; /* copy prev. char, too */
    register int number_to_move, i;
    int ret_val;

    if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
	YY_FATAL_ERROR(
		"fatal flex scanner internal error--end of buffer missed" );

    /* try to read more data */

    /* first move last chars to start of buffer */
    number_to_move = yy_c_buf_p - yytext;

    for ( i = 0; i < number_to_move; ++i )
	*(dest++) = *(source++);

    if ( yy_current_buffer->yy_eof_status != EOF_NOT_SEEN )
	/* don't do the read, it's not guaranteed to return an EOF,
	 * just force an EOF
	 */
	yy_n_chars = 0;

    else
	{
	int num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1;

	if ( num_to_read > YY_READ_BUF_SIZE )
	    num_to_read = YY_READ_BUF_SIZE;

	else if ( num_to_read <= 0 )
	    YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" );

	/* read in more data */
	YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
		  yy_n_chars, num_to_read );
	}

    if ( yy_n_chars == 0 )
	{
	if ( number_to_move == 1 )
	    {
	    ret_val = EOB_ACT_END_OF_FILE;
	    yy_current_buffer->yy_eof_status = EOF_DONE;
	    }

	else
	    {
	    ret_val = EOB_ACT_LAST_MATCH;
	    yy_current_buffer->yy_eof_status = EOF_PENDING;
	    }
	}

    else
	ret_val = EOB_ACT_CONTINUE_SCAN;

    yy_n_chars += number_to_move;
    yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
    yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;

    /* yytext begins at the second character in yy_ch_buf; the first
     * character is the one which preceded it before reading in the latest
     * buffer; it needs to be kept around in case it's a newline, so
     * yy_get_previous_state() will have with '^' rules active
     */

    yytext = &yy_current_buffer->yy_ch_buf[1];

    return ( ret_val );
    }


/* yy_get_previous_state - get the state just before the EOB char was reached
 *
 * synopsis
 *     yy_state_type yy_get_previous_state();
 */

static yy_state_type yy_get_previous_state()

    {
    register yy_state_type yy_current_state;
    register YY_CHAR *yy_cp;

    yy_current_state = yy_start;
    yy_state_ptr = yy_state_buf;
    *yy_state_ptr++ = yy_current_state;

    for ( yy_cp = yytext + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
	{
	register YY_CHAR yy_c = (*yy_cp ? yy_ec[*yy_cp] : 1);
	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
	    {
	    yy_current_state = yy_def[yy_current_state];
	    if ( yy_current_state >= 665 )
		yy_c = yy_meta[yy_c];
	    }
	yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
	*yy_state_ptr++ = yy_current_state;
	}

    return ( yy_current_state );
    }


/* yy_try_NUL_trans - try to make a transition on the NUL character
 *
 * synopsis
 *     next_state = yy_try_NUL_trans( current_state );
 */

#ifdef YY_USE_PROTOS
static yy_state_type yy_try_NUL_trans( register yy_state_type yy_current_state )
#else
static yy_state_type yy_try_NUL_trans( yy_current_state )
register yy_state_type yy_current_state;
#endif

    {
    register int yy_is_jam;

    register YY_CHAR yy_c = 1;
    while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
	{
	yy_current_state = yy_def[yy_current_state];
	if ( yy_current_state >= 665 )
	    yy_c = yy_meta[yy_c];
	}
    yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
    *yy_state_ptr++ = yy_current_state;
    yy_is_jam = (yy_current_state == 664);

    return ( yy_is_jam ? 0 : yy_current_state );
    }


#ifdef YY_USE_PROTOS
static void yyunput( YY_CHAR c, register YY_CHAR *yy_bp )
#else
static void yyunput( c, yy_bp )
YY_CHAR c;
register YY_CHAR *yy_bp;
#endif

    {
    register YY_CHAR *yy_cp = yy_c_buf_p;

    /* undo effects of setting up yytext */
    *yy_cp = yy_hold_char;

    if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
	{ /* need to shift things up to make room */
	register int number_to_move = yy_n_chars + 2; /* +2 for EOB chars */
	register YY_CHAR *dest =
	    &yy_current_buffer->yy_ch_buf[yy_current_buffer->yy_buf_size + 2];
	register YY_CHAR *source =
	    &yy_current_buffer->yy_ch_buf[number_to_move];

	while ( source > yy_current_buffer->yy_ch_buf )
	    *--dest = *--source;

	yy_cp += dest - source;
	yy_bp += dest - source;
	yy_n_chars = yy_current_buffer->yy_buf_size;

	if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
	    YY_FATAL_ERROR( "flex scanner push-back overflow" );
	}

    if ( yy_cp > yy_bp && yy_cp[-1] == '\n' )
	yy_cp[-2] = '\n';

    *--yy_cp = c;

    /* note: the formal parameter *must* be called "yy_bp" for this
     *       macro to now work correctly
     */
    YY_DO_BEFORE_ACTION; /* set up yytext again */
    }


#ifdef __cplusplus
static int yyinput()
#else
static int input()
#endif

    {
    int c;
    YY_CHAR *yy_cp = yy_c_buf_p;

    *yy_cp = yy_hold_char;

    if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
	{
	/* yy_c_buf_p now points to the character we want to return.
	 * If this occurs *before* the EOB characters, then it's a
	 * valid NUL; if not, then we've hit the end of the buffer.
	 */
	if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
	    /* this was really a NUL */
	    *yy_c_buf_p = '\0';

	else
	    { /* need more input */
	    yytext = yy_c_buf_p;
	    ++yy_c_buf_p;

	    switch ( yy_get_next_buffer() )
		{
		case EOB_ACT_END_OF_FILE:
		    {
		    if ( yywrap() )
			{
			yy_c_buf_p = yytext + YY_MORE_ADJ;
			return ( EOF );
			}

		    YY_NEW_FILE;

#ifdef __cplusplus
		    return ( yyinput() );
#else
		    return ( input() );
#endif
		    }
		    break;

		case EOB_ACT_CONTINUE_SCAN:
		    yy_c_buf_p = yytext + YY_MORE_ADJ;
		    break;

		case EOB_ACT_LAST_MATCH:
#ifdef __cplusplus
		    YY_FATAL_ERROR( "unexpected last match in yyinput()" );
#else
		    YY_FATAL_ERROR( "unexpected last match in input()" );
#endif
		}
	    }
	}

    c = *yy_c_buf_p;
    yy_hold_char = *++yy_c_buf_p;

    return ( c );
    }


#ifdef YY_USE_PROTOS
void yyrestart( FILE *input_file )
#else
void yyrestart( input_file )
FILE *input_file;
#endif

    {
    yy_init_buffer( yy_current_buffer, input_file );
    yy_load_buffer_state();
    }


#ifdef YY_USE_PROTOS
void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
#else
void yy_switch_to_buffer( new_buffer )
YY_BUFFER_STATE new_buffer;
#endif

    {
    if ( yy_current_buffer == new_buffer )
	return;

    if ( yy_current_buffer )
	{
	/* flush out information for old buffer */
	*yy_c_buf_p = yy_hold_char;
	yy_current_buffer->yy_buf_pos = yy_c_buf_p;
	yy_current_buffer->yy_n_chars = yy_n_chars;
	}

    yy_current_buffer = new_buffer;
    yy_load_buffer_state();

    /* we don't actually know whether we did this switch during
     * EOF (yywrap()) processing, but the only time this flag
     * is looked at is after yywrap() is called, so it's safe
     * to go ahead and always set it.
     */
    yy_did_buffer_switch_on_eof = 1;
    }


#ifdef YY_USE_PROTOS
void yy_load_buffer_state( void )
#else
void yy_load_buffer_state()
#endif

    {
    yy_n_chars = yy_current_buffer->yy_n_chars;
    yytext = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
    yyin = yy_current_buffer->yy_input_file;
    yy_hold_char = *yy_c_buf_p;
    }


#ifdef YY_USE_PROTOS
YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
#else
YY_BUFFER_STATE yy_create_buffer( file, size )
FILE *file;
int size;
#endif

    {
    YY_BUFFER_STATE b;

    b = (YY_BUFFER_STATE) malloc( sizeof( struct yy_buffer_state ) );

    if ( ! b )
	YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );

    b->yy_buf_size = size;

    /* yy_ch_buf has to be 2 characters longer than the size given because
     * we need to put in 2 end-of-buffer characters.
     */
    b->yy_ch_buf = (YY_CHAR *) malloc( (unsigned) (b->yy_buf_size + 2) );

    if ( ! b->yy_ch_buf )
	YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );

    yy_init_buffer( b, file );

    return ( b );
    }


#ifdef YY_USE_PROTOS
void yy_delete_buffer( YY_BUFFER_STATE b )
#else
void yy_delete_buffer( b )
YY_BUFFER_STATE b;
#endif

    {
    if ( b == yy_current_buffer )
	yy_current_buffer = (YY_BUFFER_STATE) 0;

    free( (char *) b->yy_ch_buf );
    free( (char *) b );
    }


#ifdef YY_USE_PROTOS
void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
#else
void yy_init_buffer( b, file )
YY_BUFFER_STATE b;
FILE *file;
#endif

    {
    b->yy_input_file = file;

    /* we put in the '\n' and start reading from [1] so that an
     * initial match-at-newline will be true.
     */

    b->yy_ch_buf[0] = '\n';
    b->yy_n_chars = 1;

    /* we always need two end-of-buffer characters.  The first causes
     * a transition to the end-of-buffer state.  The second causes
     * a jam in that state.
     */
    b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
    b->yy_ch_buf[2] = YY_END_OF_BUFFER_CHAR;

    b->yy_buf_pos = &b->yy_ch_buf[1];

    b->yy_eof_status = EOF_NOT_SEEN;
    }
# line 536 "lacheck.lex"

int main( argc, argv )
int argc;
char *argv[];
{
    /* allocate initial stacks */
    gstack = (tex_group *)malloc(gstack_size * sizeof(tex_group));
    istack = (input_ *)malloc(istack_size * sizeof(input_));
    if ( gstack == NULL || istack == NULL ) {
	fprintf(stderr, "%s: not enough memory for stacks\n", PROGNAME);
	exit(3);
    }
	
    if(argc > 1)
    {
        if ( (file_name = malloc(strlen(argv[1]) + 5)) == NULL ) {
		fprintf(stderr, "%s: out of memory\n", PROGNAME);
		exit(3);
	}
	
	strcpy(file_name, argv[1]);
	
	if ((yyin = fopen( file_name, "r")) != NULL )
	{
	    push(file_name, 3, 1);
	    yylex();
	    f_checkend(file_name);
	}
	else {   
		 strcat(file_name, ".tex" );
		 if ((yyin = fopen( file_name, "r")) != NULL )
		 {
		     push(file_name, 3, 1);
		     yylex();
		     f_checkend(file_name);
		 }
		 else
		     fprintf(stderr,
				"%s: Could not open : %s\n",PROGNAME, argv[1]);
	     }
    }
    else
    {
	printf("\n* %s *\n\n",PROGNAME);
	printf("\t...a consistency checker for LaTeX documents.\n\n");

	printf("Usage:\n\tlacheck filename[.tex] <return>\n\n\n");

	printf("\tFrom within Emacs:\n\n\t");
	printf("M-x compile <return>\n\tlacheck filename[.tex] <return>");
	printf("\n\n\tUse C-x ` to step through the messages.\n\n");
	printf("\n\tThe found context is displayed in \"double quotes\"\n\n");
	printf("Remark:\n\tAll messages are only warnings!\n\n");
	printf("\tYour document may be right though LaCheck tells\n");
	printf("\tsomething else.\n\n");
    }
    return(0);
}

#ifdef NEED_STRSTR
char *
strstr(string, substring)
    register char *string;	/* String to search. */
    char *substring;		/* Substring to try to find in string. */
{
    register char *a, *b;

    /* First scan quickly through the two strings looking for a
     * single-character match.  When it's found, then compare the
     * rest of the substring.
     */

    b = substring;
    if (*b == 0) {
	return string;
    }
    for ( ; *string != 0; string += 1) {
	if (*string != *b) {
	    continue;
	}
	a = string;
	while (1) {
	    if (*b == 0) {
		return string;
	    }
	    if (*a++ != *b++) {
		break;
	    }
	}
	b = substring;
    }
    return (char *) 0;
}
#endif /* NEED_STRSTR */

void push(p_name, p_type, p_line)
unsigned char *p_name;
int p_type;
int p_line;
{
    if ( gstackp == gstack_size ) {	/* extend stack */
	gstack_size *= 2;
	gstack = (tex_group *)realloc(gstack, gstack_size * sizeof(tex_group));
	if ( gstack == NULL ) {
		fprintf(stderr, "%s: stack out of memory", PROGNAME);
	exit(3);
    }
    }
    
    if ( (gstack[gstackp].s_name =
		(unsigned char *)malloc(strlen(p_name) + 1)) == NULL ||
         (gstack[gstackp].s_file =
		(char *)malloc(strlen(file_name) + 1)) == NULL ) {
	fprintf(stderr, "%s: out of memory\n", PROGNAME);
	exit(3);
    }

    strcpy(gstack[gstackp].s_name,p_name);
    gstack[gstackp].s_type = p_type;
    gstack[gstackp].s_line = p_line;	
    strcpy(gstack[gstackp].s_file,file_name);
    ++gstackp;	

}

void input_file(file_nam)
char *file_nam;
{
    char *tmp_file_name;
    FILE *tmp_yyin;

    if ( (tmp_file_name = malloc(strlen(file_nam) + 5)) == NULL ) {
	fprintf(stderr, "%s: out of memory\n", PROGNAME);
	exit(3);
    }
    strcpy(tmp_file_name,file_nam);

    if (istackp == istack_size) {	/* extend stack */
	istack_size *= 2;
	istack = (input_ *)realloc(istack, istack_size * sizeof(input_));
	if ( istack == NULL ) {
		fprintf(stderr, "%s: \\input stack out of memory\n", PROGNAME);
	exit(3);
        } 
    } 
    	
    istack[istackp].stream = YY_CURRENT_BUFFER;
    istack[istackp].linenum = line_count;
    istack[istackp].name = file_name;
    ++istackp;    

    if ((tmp_yyin = fopen( file_nam, "r")) != NULL )
	{
	  yyin = tmp_yyin;
	  yy_switch_to_buffer(yy_create_buffer(yyin,YY_BUF_SIZE));
	  file_name = tmp_file_name;
	  push(file_name, 3, 1);
          line_count = 1;
	}
    else {
	  (void) strcat(tmp_file_name, ".tex");
	  if ((tmp_yyin = fopen( tmp_file_name , "r")) != NULL )
	    {
		yyin = tmp_yyin;
	   	yy_switch_to_buffer(yy_create_buffer(yyin,YY_BUF_SIZE));
		file_name = tmp_file_name;
		push(file_name, 3, 1);
   	        line_count = 1;
	    }
          else
	  {
	       --istackp;
	       fclose(tmp_yyin);
	       free(tmp_file_name);
	       printf("\"%s\", line %d: Could not open \"%s\"\n", 
			file_name,
			line_count,
			file_nam);
	       input();
	  }
	 }
}

void pop()
{
    if ( gstackp == 0 )
    {
       	fprintf(stderr, "%s: Stack underflow\n", PROGNAME);
	exit(4);
    }
    --gstackp;

    free(gstack[gstackp].s_name);
    free(gstack[gstackp].s_file);
}

char *bg_command(name)
char *name;
{
    
    switch (CG_TYPE) {
	
    case 2:
	(void) strcpy( returnval, "\\begin\{" );
	(void) strcat( returnval, (char *) name);
	(void) strcat( returnval, "}" );
	break;
	
    case 3:
	(void) strcpy( returnval, "beginning of file " );
	(void) strcat( returnval, (char *) name);
	break;
    
    case 4:
	(void) strcpy( returnval, "math begin " );
	(void) strcat( returnval, (char *) name);
	break;
    
    case 5:
	(void) strcpy( returnval, "display math begin " );
	(void) strcat( returnval, (char *) name);
	break;
    
    default:
    	(void) strcpy( returnval, name );
	
    }
    
    return ((char *)returnval);
}

char *eg_command(name,type)
int type;
char *name;
{
    
    switch (type) {
	
    case 2:
	(void) strcpy( returnval, "\\end{" );
	(void) strcat( returnval, (char *) name);
	(void) strcat( returnval, "}" );
	break;
	
    case 3:
	(void) strcpy( returnval, "end of file " );
	(void) strcat( returnval, (char *) name);
	break;
    
    case 4:
	(void) strcpy( returnval, "math end " );
	(void) strcat( returnval, (char *) name);
	break;
    
    case 5:
	(void) strcpy( returnval, "display math end " );
	(void) strcat( returnval, (char *) name);
	break;
    
    default:
    	(void) strcpy( returnval, name );
	break;
    }
    
    return ((char *)returnval);
}


void g_checkend(n)
int n;
{
    if ( check_top_level_end(yytext,n) == 1 ) 
       if (  CG_TYPE != n  )
	 print_bad_match(yytext,n);
       else
	pop();
}

void e_checkend(n, name)
int n;
char *name;
{
   if ( check_top_level_end(name,n) == 1 )
    {
     if (  CG_TYPE != n  ||  strcmp( CG_NAME, name ) != 0 )
    	print_bad_match(name,n);

     pop();

    }
}

void f_checkend(name)
char *name;
{
    if ( check_top_level_end(name,3) == 1 )
     {
       if (  CG_TYPE != 3  ||  strcmp( CG_NAME, name ) != 0 )

    	while( CG_TYPE != 3  )
	{
	  print_bad_match(name,3);
          pop();
        }

         pop();  
     }
}

void print_bad_match(end_command,type)
char *end_command;	      
int type;
{
	  printf("\"%s\", line %i: <- unmatched \"%s\"\n",
	         file_name, 
		 line_count, 
		 eg_command( end_command , type) ) ;

	  printf("\"%s\", line %i: -> unmatched \"%s\"\n",
	         CG_FILE, 
		 CG_LINE, 
		 bg_command( CG_NAME ) ) ;
	  warn_count += 2;
}

int check_top_level_end(end_command,type)
char *end_command;	      
int type;
{
    if ( gstackp == 0 )
	{
	 printf("\"%s\", line %i: \"%s\" found at top level\n",
	       file_name, 
	       line_count, 
	       eg_command( end_command, type )) ;
	 ++warn_count;
         return(0);
	}
    else
    	return(1);
}



These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.