DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T c

⟦22f128f22⟧ TextFile

    Length: 65367 (0xff57)
    Types: TextFile
    Names: »c2latex.c«

Derivation

└─⟦52210d11f⟧ Bits:30007239 EUUGD2: TeX 3 1992-12
    └─⟦f92554e5b⟧ »utils/C++2LaTeX-1.1-PL5.tar.Z« 
        └─⟦4dcd60fcf⟧ 
            └─⟦this⟧ »C++2LaTeX/c2latex.c« 

TextFile

/* 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 char
# line 1 "c++2latex.l"
#define INITIAL 0
/*
 *  This is a flex input file but should be edited in -*-C-*- mode
 *
 *  C++2LaTeX: Produce prettyprinted LaTeX files from  C++ or C sources.
 *  Copyright (C) 1990 Norbert Kiesel
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 1, or (at your option)
 *  any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 *  Norbert Kiesel     
 *  RWTH Aachen / Institut f. Informatik III
 *  Ahornstr. 55
 *  D-5100 Aachen
 *  West Germany  
 *
 *  Phone:  +49 241 80-7266
 *  EUNET:  norbert@rwthi3.uucp
 *  USENET: ...!mcvax!unido!rwthi3!norbert
 *  X.400:  norbert@rwthi3.informatik.rwth-aachen.de
 *
 *  Please contact me for any bugs you find in this code or any
 *  improvements! I'd also be very happy to get feedback where and
 *  how frequently this program is used (just drop a little mail :-).
 */
#define STRING 1
#define BCOMMENT 2
#define INCLUDE 3
#define CPLUSPLUS 4
# line 41 "c++2latex.l"
#define KEY	printf ("{\\%s %s}", keyword_font, yytext)
#define CPP	printf ("{\\%s \\%s}", cpp_font, yytext)
#define SYM(x)	printf ("$\\%s$", x)
#define OUT(x)	printf ("%s", x)
#define SUB(x)	substitute(x)
#define IND	indent(yytext)
#define INIT	BEGIN (cplusplus_mode ? CPLUSPLUS : INITIAL);

#include <stdio.h>

#ifdef ANSI_C
  #ifdef C_PLUSPLUS
    #error ANSI_C and C_PLUSPLUS are mutually exclusive
  #else
    int cplusplus_mode = 0;
  #endif
#else /* CPLUSPLUS or default */
  int cplusplus_mode = 1;
#endif

int complete_file = 0;
int header = 0;
int tabtotab = 8;
int piped = 0;
char * font_size = "11";
char * indentation = "0.5em";
char * comment_font = "it";
char * keyword_font = "bf";
char * header_font = "sl";
char * cpp_font = "tt";
char * string_font = "tt";
void substitute(const char *);
void indent(const char *);
void newpage(int);
void usage(const char *);
# line 78 "c++2latex.l"

/* 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 142
typedef int yy_state_type;
static const short int yy_accept[549] =
    {   0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      142,  141,  138,  140,  139,   97,  118,  141,   88,   87,
      141,  105,  106,   75,   99,   94,   98,   95,   79,  129,
      129,   92,   96,   80,   93,   81,   91,  111,  111,  107,
      141,  108,   76,  111,  111,  111,  111,  111,  111,  111,
      111,  111,  111,  111,  111,  111,  111,  111,   85,   77,
       86,   74,  137,  124,  122,  121,  124,  123,  116,  114,
      116,  115,   16,   14,   15,   16,   16,  110,   98,   95,
       79,   92,  110,  110,  110,  110,  110,  110,  110,  110,
      110,  110,  110,  110,  110,  110,  110,  110,  110,  110,

      110,  110,  138,  139,   66,    0,    0,    0,    0,    0,
        0,   83,   82,   84,    0,    0,   69,  102,  103,   89,
      104,   61,    0,  125,  112,  100,  126,  129,  129,    0,
      129,    0,   62,   64,  101,   65,   63,  111,  118,    0,
      136,   72,  111,  111,  111,  111,  111,  111,   45,  111,
      111,  111,  111,  111,  111,   46,  111,  111,  111,  111,
      111,  111,  111,  111,  111,  111,  111,   73,   67,  137,
      120,  119,  123,  113,  115,   14,    0,   13,    0,   12,
      110,   61,   90,    0,  109,  110,  110,  110,  110,  110,
      110,  110,  110,   45,  110,  110,  110,  110,  110,  110,

      110,   46,  110,  110,  110,  110,  110,  110,  110,  110,
      110,  110,  110,  110,  110,  110,  110,  110,  110,  110,
        0,    0,    0,    0,    5,    0,    0,    0,  130,    0,
      130,    0,    0,   68,    0,  125,  125,    0,  126,  129,
        0,  127,  135,   70,   71,  111,  111,  111,  111,  111,
      111,  111,  111,  111,  111,  111,   38,  111,   19,  111,
      111,  111,  111,  111,  111,  111,  111,  111,  111,  111,
      111,  111,  111,  111,   78,    0,  117,  110,  110,  110,
      110,  110,  110,  110,  110,  110,  110,  110,  110,  110,
       38,  110,  110,  110,   19,  110,   49,  110,  110,  110,

      110,  110,  110,  110,  110,  110,  110,  110,  110,  110,
      110,  110,  110,  110,  110,  110,  110,  110,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,  131,  132,
        0,    0,    0,  127,  125,    0,  128,  135,   17,  111,
       25,   29,  111,  111,  111,  111,   22,   26,  111,  111,
       42,   23,  111,  111,  111,  111,  111,  111,  111,  111,
      111,  111,  111,   40,  111,  111,   17,  110,   25,   29,
      110,  110,  110,  110,  110,  110,   22,   26,  110,  110,
      110,   42,  110,   23,  110,  110,  110,  110,  110,  110,
      110,  110,  110,  110,  110,  110,  110,   51,  110,  110,

      110,  110,   40,  110,  110,    0,    8,    9,    0,    0,
        0,    0,    0,    0,    0,    0,  133,    0,   21,   33,
      111,  111,  111,  111,   34,  111,  111,   35,  111,  111,
      111,  111,  111,  111,   32,  111,  111,   48,   21,   53,
       33,  110,  110,  110,  110,  110,   34,  110,  110,  110,
      110,  110,  110,  110,  110,  110,   35,  110,  110,  110,
      110,  110,  110,   32,  110,  110,  110,   48,    0,   11,
       10,    6,    0,    0,    0,    3,  111,  111,   18,   30,
      111,   31,   39,   43,   47,   20,   24,  111,  111,  111,
      110,  110,   50,   18,   30,   58,   59,  110,  110,  110,

      110,   54,  110,   31,   39,   43,   47,   20,   24,  110,
      110,  110,  110,    2,    7,    0,    4,  111,   41,  111,
       28,  111,  111,  110,   41,  110,  110,   56,  110,  110,
       28,  110,   57,  110,    1,   37,   27,   36,   44,   37,
       52,   60,  110,   27,   36,   44,   55,    0
    } ;

static const YY_CHAR yy_ec[128] =
    {   0,
        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
        1,    4,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    5,    6,    7,    8,    9,   10,   11,   12,   13,
       14,   15,   16,   17,   18,   19,   20,   21,   22,   22,
       22,   22,   22,   22,   22,   23,   23,   24,   25,   26,
       27,   28,   29,   30,   31,   31,   31,   31,   32,   33,
       34,   34,   34,   34,   34,   35,   34,   34,   34,   34,
       34,   34,   34,   34,   36,   34,   34,   34,   34,   34,
       37,   38,   39,   40,   34,   30,   41,   42,   43,   44,

       45,   46,   47,   48,   49,   34,   50,   51,   52,   53,
       54,   55,   34,   56,   57,   58,   59,   60,   61,   62,
       63,   64,   65,   66,   67,   68,    1
    } ;

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

static const short int yy_base[563] =
    {   0,
        0,   67,   67,   73,   68,   79,   83,   90,  116,   94,
     1031, 1032,   96, 1032, 1027, 1002, 1032,  183, 1001,   62,
      989, 1032, 1032,  999,   75, 1032,   85,   85,  171,  224,
      170, 1032, 1032,   88,  998,  167, 1032,    0,  189, 1032,
     1021, 1032,  996,  963,  965,  149,  154,  156,  159,  966,
      158,  965,  973,  175,  954,  963,  961,  966, 1032,  160,
     1032, 1032,  212, 1032, 1032, 1032,  232,  214, 1032, 1032,
      993,  220, 1032,  229, 1032, 1005,  983,    0,  222,  242,
      252,  986, 1000,  246,  203,  221,  243,  226,  242,  245,
      228,  257,  259,  264,  267,  272,  278,  289,  291,  280,

      297,  293,  303, 1032, 1032,  312,  963,  265,  195,  951,
      953, 1032, 1032, 1032,  993,  303, 1032, 1032, 1032, 1032,
     1032, 1032,  985,  337, 1032, 1032,  341,  358,  376,  384,
     1032,    0,  976, 1032, 1032, 1032,  975,    0, 1032,  963,
     1032, 1032,  942,  954,  941,  956,  943,  949,  935,  936,
      933,  933,  936,  933,  930,    0,  929,  933,  272,  931,
      265,  270,  935,  928,   30,  283,  933, 1032, 1032,  338,
     1032, 1032,  340, 1032,  347,  373,  974, 1032,  952, 1032,
        0,  964, 1032,  975, 1032,  968,  326,  344,  298,  327,
      382,  357,  387,  392,  395,  404,  376,  405,  406,  407,

      409,  967,  410,  411,  413,  415,  420,  417,   68,  422,
      416,  428,  431,  427,  430,  423,  432,  421,  433,  434,
      929,  396,  930,  917,  402,  929,  930,  926, 1032,  957,
      956,  436,    0, 1032,  472, 1032,  475,  483, 1032, 1032,
      490,  493,  482, 1032, 1032,  913,  925,  920,  908,  392,
      922,  920,  916,  908,  914,  917,    0,  903,    0,  909,
      906,  895,  897,  899,  906,  892,  890,  890,  902,  892,
      896,  900,  902,  891, 1032,  938, 1032,  419,  445,  482,
      476,  491,  493,  494,  500,  510,  513,  514,  515,  516,
      931,  519,  520,  521,  930,  522,  929,  525,  527,  528,

      529,  531,  530,  533,  534,  538,  535,  537,  540,  544,
      546,  552,  547,  545,  550,  554,  559,  553,  888,  890,
      890,  885,  879,  887,  887,  879,  882,  883, 1032, 1032,
      555,  915,  550,  563, 1032,  584,  588, 1032,    0,  876,
        0,    0,  867,  875,  864,  871,    0,    0,  865,  862,
        0,    0,  862,  862,  859,  871,  861,  865,  870,  869,
      867,  857,  862,    0,  850,  862,  897,  566,  896,  895,
      556,  569,  580,  584,  587,  603,  894,  893,  605,  606,
      609,  892,  610,  891,  608,  614,  611,  612,  617,  613,
      615,  616,  622,  619,  623,  625,  626,  890,  631,  624,

      629,  621,  889,  627,  633,  844, 1032, 1032,  850,  839,
      848,  848,  833,  839,  844,  877, 1032,  876,    0,    0,
      834,  835,  840,  831,    0,  825,  829,    0,  837,  834,
      836,  820,  829,  831,    0,  822,  825,    0,  864,  863,
      862,  628,  632,  637,  639,  635,  861,  642,  644,  638,
      641,  646,  647,  649,  650,  670,  860,  678,  651,  682,
      684,  685,  689,  859,  690,  691,  692,  858,  821, 1032,
     1032, 1032,  819,  820,  822, 1032,  803,  803,    0,    0,
      815,    0,    0,    0,    0,    0,    0,  813,  813,  789,
      693,  696,  830,  827,  821,  815,  750,  694,  697,  700,

      698,  749,  701,  742,  735,  731,  730,  728,  727,  703,
      702,  704,  706, 1032, 1032,  690, 1032,  686,    0,  674,
        0,  684,  676,  705,  711,  707,  709,  710,  715,  708,
      630,  717,  438,  720, 1032,    0,    0,    0,    0,  435,
      339,  335,  718,  311,  211,  191,   91, 1032,  765,  774,
      783,  791,  795,  804,  813,  819,  825,  832,  836,  843,
      847,  850
    } ;

static const short int yy_def[563] =
    {   0,
      548,    1,  549,  549,  550,  550,  551,  551,  548,    9,
      548,  548,  548,  548,  548,  548,  548,  548,  548,  548,
      552,  548,  548,  548,  548,  548,  548,  548,  548,  548,
      548,  548,  548,  548,  548,  548,  548,  553,  553,  548,
      548,  548,  548,  553,  553,  553,  553,  553,  553,  553,
      553,  553,  553,  553,  553,  553,  553,  553,  548,  548,
      548,  548,  548,  548,  548,  548,  548,  548,  548,  548,
      548,  548,  548,  548,  548,  554,  555,  556,  548,  548,
      548,  548,  557,  557,  557,  557,  557,  557,  557,  557,
      557,  557,  557,  557,  557,  557,  557,  557,  557,  557,

      557,  557,  548,  548,  548,  548,  548,  548,  548,  548,
      548,  548,  548,  548,  548,  558,  548,  548,  548,  548,
      548,  548,  548,  548,  548,  548,  548,  548,  548,  548,
      548,  559,  548,  548,  548,  548,  548,  553,  548,  552,
      548,  548,  553,  553,  553,  553,  553,  553,  553,  553,
      553,  553,  553,  553,  553,  553,  553,  553,  553,  553,
      553,  553,  553,  553,  553,  553,  553,  548,  548,  548,
      548,  548,  548,  548,  548,  548,  554,  548,  555,  548,
      556,  548,  548,  560,  548,  557,  557,  557,  557,  557,
      557,  557,  557,  557,  557,  557,  557,  557,  557,  557,

      557,  557,  557,  557,  557,  557,  557,  557,  557,  557,
      557,  557,  557,  557,  557,  557,  557,  557,  557,  557,
      548,  548,  548,  548,  548,  548,  548,  548,  548,  548,
      548,  548,  561,  548,  548,  548,  548,  548,  548,  548,
      548,  548,  559,  548,  548,  553,  553,  553,  553,  553,
      553,  553,  553,  553,  553,  553,  553,  553,  553,  553,
      553,  553,  553,  553,  553,  553,  553,  553,  553,  553,
      553,  553,  553,  553,  548,  560,  548,  557,  557,  557,
      557,  557,  557,  557,  557,  557,  557,  557,  557,  557,
      557,  557,  557,  557,  557,  557,  557,  557,  557,  557,

      557,  557,  557,  557,  557,  557,  557,  557,  557,  557,
      557,  557,  557,  557,  557,  557,  557,  557,  548,  548,
      548,  548,  548,  548,  548,  548,  548,  548,  548,  548,
      548,  562,  548,  548,  548,  548,  548,  548,  553,  553,
      553,  553,  553,  553,  553,  553,  553,  553,  553,  553,
      553,  553,  553,  553,  553,  553,  553,  553,  553,  553,
      553,  553,  553,  553,  553,  553,  557,  557,  557,  557,
      557,  557,  557,  557,  557,  557,  557,  557,  557,  557,
      557,  557,  557,  557,  557,  557,  557,  557,  557,  557,
      557,  557,  557,  557,  557,  557,  557,  557,  557,  557,

      557,  557,  557,  557,  557,  548,  548,  548,  548,  548,
      548,  548,  548,  548,  548,  548,  548,  548,  553,  553,
      553,  553,  553,  553,  553,  553,  553,  553,  553,  553,
      553,  553,  553,  553,  553,  553,  553,  553,  557,  557,
      557,  557,  557,  557,  557,  557,  557,  557,  557,  557,
      557,  557,  557,  557,  557,  557,  557,  557,  557,  557,
      557,  557,  557,  557,  557,  557,  557,  557,  548,  548,
      548,  548,  548,  548,  548,  548,  553,  553,  553,  553,
      553,  553,  553,  553,  553,  553,  553,  553,  553,  553,
      557,  557,  557,  557,  557,  557,  557,  557,  557,  557,

      557,  557,  557,  557,  557,  557,  557,  557,  557,  557,
      557,  557,  557,  548,  548,  548,  548,  553,  553,  553,
      553,  553,  553,  557,  557,  557,  557,  557,  557,  557,
      557,  557,  557,  557,  548,  553,  553,  553,  553,  557,
      557,  557,  557,  557,  557,  557,  557,    0,  548,  548,
      548,  548,  548,  548,  548,  548,  548,  548,  548,  548,
      548,  548
    } ;

static const short int yy_nxt[1101] =
    {   0,
       12,   13,   14,   15,   13,   16,   17,   18,   12,   19,
       20,   21,   22,   23,   24,   25,   26,   27,   28,   29,
       30,   31,   31,   32,   33,   34,   35,   36,   37,   12,
       38,   38,   38,   38,   39,   38,   40,   41,   42,   43,
       44,   45,   46,   47,   48,   49,   50,   38,   51,   38,
       52,   38,   38,   38,   38,   53,   54,   55,   56,   57,
       58,   38,   38,   38,   59,   60,   61,   62,   63,   65,
       70,   63,  113,   66,   68,   65,  181,   68,  270,   66,
       72,   70,   71,   72,   74,   75,  271,   74,  114,   76,
      118,   74,   75,   71,   74,   63,   76,  103,   63,  181,

      103,  119,  120,  123,   67,  124,  124,  124,   77,  302,
       67,  121,  122,  133,  134,   77,   12,   13,   14,   15,
       13,   16,   17,   18,   78,   19,   20,   21,   22,   23,
       24,   25,   26,   79,   80,   81,   30,   31,   31,   82,
       33,   34,   35,   36,   37,   12,   83,   83,   83,   83,
       84,   83,   40,   41,   42,   43,   85,   86,   87,   88,
       89,   90,   91,   83,   92,   83,   93,   83,   94,   95,
       96,   97,   98,   99,  100,  101,  102,   83,   83,   83,
       59,   60,   61,   62,  106,  125,  168,  106,  127,  145,
      129,  129,  129,  136,  137,  139,  146,  126,  148,  181,

      140,  130,  147,  156,  131,  131,  150,  149,  151,  153,
      157,  181,  154,  170,  130,  173,  170,  152,  173,  181,
      131,  175,  160,  161,  175,  169,  107,  108,  131,  181,
      176,  109,  162,  176,  181,  163,  181,  110,  171,  120,
      225,  111,  127,  171,  128,  128,  129,  226,  121,  182,
      181,  181,  139,  181,  181,  130,  183,  140,  131,  131,
      123,  187,  124,  124,  124,  181,  125,  181,  130,  172,
      193,  184,  181,  171,  131,  181,  188,  171,  126,  194,
      181,  201,  131,  189,  171,  132,  181,  171,  181,  171,
      190,  171,  195,  191,  196,  198,  192,  181,  199,  181,

      200,  181,  202,  197,  103,  181,  181,  103,  205,  203,
      266,  264,  204,  106,  231,  222,  106,  223,  261,  181,
      224,  206,  210,  232,  232,  267,  207,  208,  265,  262,
      209,  272,  217,  273,  181,  181,  211,  212,  215,  170,
      220,  173,  170,  181,  173,  218,  213,  181,  175,  214,
      219,  175,  181,  216,  280,  107,  108,  124,  124,  124,
      109,  237,  237,  237,  233,  181,  110,  281,  235,  236,
      111,  236,  238,  239,  176,  239,  127,  176,  128,  128,
      129,  235,  236,  278,  181,  238,  239,  236,  279,  130,
      181,  239,  240,  240,  127,  181,  129,  129,  129,  241,

      181,  241,  130,  181,  242,  242,  242,  130,  240,  283,
      131,  131,  181,  181,  181,  181,  240,  181,  181,  181,
      130,  181,  282,  181,  181,  181,  131,  181,  181,  181,
      181,  181,  284,  289,  131,  181,  181,  285,  181,  181,
      181,  181,  181,  181,  320,  324,  181,  330,  343,  344,
      286,  287,  321,  181,  325,  292,  331,  331,  290,  298,
      294,  291,  288,  296,  299,  300,  293,  295,  303,  305,
      301,  308,  367,  297,  306,  310,  315,  312,  311,  304,
      313,  316,  318,  317,  181,  368,  309,  333,  314,  333,
      181,  307,  334,  334,  334,  237,  237,  237,  336,  181,

      336,  181,  181,  337,  337,  337,  130,  335,  181,  335,
      242,  242,  242,  242,  242,  242,  338,  338,  181,  130,
      335,  181,  181,  181,  181,  335,  369,  181,  181,  181,
      181,  370,  338,  181,  374,  181,  181,  181,  181,  181,
      338,  181,  181,  181,  375,  181,  181,  371,  181,  372,
      373,  376,  181,  181,  181,  181,  380,  377,  181,  379,
      181,  181,  181,  381,  181,  378,  330,  181,  384,  383,
      334,  334,  334,  382,  181,  416,  416,  181,  390,  394,
      385,  389,  386,  334,  334,  334,  388,  387,  181,  392,
      393,  391,  181,  401,  395,  181,  399,  403,  396,  404,

      400,  397,  398,  405,  337,  337,  337,  402,  337,  337,
      337,  181,  440,  181,  181,  439,  181,  181,  181,  181,
      181,  181,  181,  181,  181,  181,  441,  181,  442,  181,
      181,  181,  181,  181,  181,  181,  181,  181,  181,  181,
      181,  181,  443,  181,  444,  181,  181,  181,  450,  181,
      181,  452,  181,  445,  181,  181,  453,  181,  181,  181,
      446,  448,  449,  447,  451,  454,  458,  461,  462,  455,
      456,  460,  459,  457,  463,  465,  464,  468,  181,  466,
      491,  493,  492,  494,  467,  496,  181,  495,  497,  501,
      181,  502,  181,  181,  499,  498,  506,  181,  181,  181,

      181,  181,  181,  500,  181,  181,  181,  503,  181,  181,
      181,  181,  181,  181,  181,  181,  181,  181,  181,  181,
      539,  505,  504,  181,  507,  181,  181,  538,  181,  537,
      536,  512,  509,  510,  535,  181,  181,  527,  181,  181,
      513,  508,  511,  181,  528,  530,  532,  526,  531,  540,
      181,  524,  542,  525,  533,  529,  534,  181,  181,  543,
      545,  547,  541,  544,  546,   64,   64,   64,   64,   64,
       64,   64,   64,   64,   69,   69,   69,   69,   69,   69,
       69,   69,   69,   73,   73,   73,   73,   73,   73,   73,
       73,   73,  115,  115,  115,  115,  115,  115,  115,  115,

      138,  138,  138,  138,  177,  177,  177,  177,  177,  177,
      177,  177,  177,  179,  179,  179,  179,  179,  179,  179,
      179,  179,  181,  181,  181,  181,  181,  181,  186,  181,
      186,  186,  186,  186,  230,  181,  230,  230,  181,  523,
      230,  243,  243,  276,  276,  276,  276,  276,  276,  276,
      276,  276,  332,  332,  418,  418,  418,  522,  521,  520,
      519,  518,  517,  516,  515,  514,  181,  181,  181,  181,
      181,  181,  181,  490,  489,  488,  487,  486,  485,  484,
      483,  482,  481,  480,  479,  478,  477,  417,  330,  476,
      475,  474,  473,  472,  471,  470,  469,  181,  181,  181,

      181,  181,  181,  181,  181,  181,  438,  437,  436,  435,
      434,  433,  432,  431,  430,  429,  428,  427,  426,  425,
      424,  423,  422,  421,  420,  419,  417,  415,  414,  413,
      412,  411,  410,  409,  408,  407,  406,  181,  181,  181,
      277,  366,  365,  364,  363,  362,  361,  360,  359,  358,
      357,  356,  355,  354,  353,  352,  351,  350,  349,  348,
      347,  346,  345,  342,  341,  340,  339,  329,  329,  328,
      327,  326,  323,  322,  319,  181,  181,  277,  275,  180,
      178,  274,  269,  268,  263,  260,  259,  258,  257,  256,
      255,  254,  253,  252,  251,  250,  249,  248,  247,  246,

      116,  245,  244,  234,  229,  228,  227,  221,  181,  185,
      180,  178,  174,  167,  166,  165,  164,  159,  158,  155,
      144,  143,  142,  141,  135,  117,  116,  112,  105,  104,
      548,   11,  548,  548,  548,  548,  548,  548,  548,  548,
      548,  548,  548,  548,  548,  548,  548,  548,  548,  548,
      548,  548,  548,  548,  548,  548,  548,  548,  548,  548,
      548,  548,  548,  548,  548,  548,  548,  548,  548,  548,
      548,  548,  548,  548,  548,  548,  548,  548,  548,  548,
      548,  548,  548,  548,  548,  548,  548,  548,  548,  548,
      548,  548,  548,  548,  548,  548,  548,  548,  548,  548

    } ;

static const short int yy_chk[1101] =
    {   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,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
        5,    2,   20,    3,    4,    4,  209,    4,  165,    4,
        6,    6,    5,    6,    7,    7,  165,    7,   20,    7,
       25,    8,    8,    6,    8,   10,    8,   13,   10,  547,

       13,   25,   27,   28,    3,   28,   28,   28,    7,  209,
        4,   27,   27,   34,   34,    8,    9,    9,    9,    9,
        9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
        9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
        9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
        9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
        9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
        9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
        9,    9,    9,    9,   18,   29,   60,   18,   31,   46,
       31,   31,   31,   36,   36,   39,   46,   29,   47,  546,

       39,   31,   46,   51,   31,   31,   48,   47,   48,   49,
       51,   85,   49,   63,   31,   68,   63,   48,   68,  545,
       31,   72,   54,   54,   72,   60,   18,   18,   31,   86,
       74,   18,   54,   74,   88,   54,   91,   18,   67,   79,
      109,   18,   30,   67,   30,   30,   30,  109,   79,   79,
       89,   87,   84,   90,   84,   30,   80,   84,   30,   30,
       80,   85,   80,   80,   80,   92,   81,   93,   30,   67,
       88,   81,   94,   67,   30,   95,   86,   67,   81,   88,
       96,   91,   30,   87,   67,   30,   97,   67,  100,   67,
       87,   67,   89,   87,   89,   90,   87,   98,   90,   99,

       90,  102,   92,   89,  103,  101,  189,  103,   94,   92,
      162,  161,   93,  106,  116,  108,  106,  108,  159,  544,
      108,   95,   97,  116,  116,  162,   95,   96,  161,  159,
       96,  166,  100,  166,  187,  190,   98,   98,   99,  170,
      102,  173,  170,  542,  173,  101,   98,  541,  175,   98,
      101,  175,  188,   99,  189,  106,  106,  124,  124,  124,
      106,  127,  127,  127,  116,  192,  106,  190,  124,  124,
      106,  124,  127,  127,  176,  127,  128,  176,  128,  128,
      128,  124,  124,  187,  197,  127,  127,  124,  188,  128,
      191,  127,  128,  128,  129,  193,  129,  129,  129,  130,

      194,  130,  128,  195,  130,  130,  130,  129,  128,  192,
      129,  129,  196,  198,  199,  200,  128,  201,  203,  204,
      129,  205,  191,  206,  211,  208,  129,  278,  207,  218,
      210,  216,  193,  197,  129,  214,  212,  193,  215,  213,
      217,  219,  220,  540,  222,  225,  533,  232,  250,  250,
      194,  195,  222,  279,  225,  200,  232,  232,  198,  206,
      203,  199,  196,  204,  207,  208,  201,  203,  210,  211,
      208,  213,  278,  205,  212,  214,  218,  216,  215,  210,
      217,  219,  220,  219,  281,  279,  213,  235,  217,  235,
      280,  212,  235,  235,  235,  237,  237,  237,  238,  282,

      238,  283,  284,  238,  238,  238,  237,  237,  285,  237,
      241,  241,  241,  242,  242,  242,  243,  243,  286,  237,
      237,  287,  288,  289,  290,  237,  280,  292,  293,  294,
      296,  281,  243,  298,  284,  299,  300,  301,  303,  302,
      243,  304,  305,  307,  285,  308,  306,  282,  309,  283,
      283,  286,  310,  314,  311,  313,  290,  287,  315,  289,
      312,  318,  316,  292,  371,  288,  331,  317,  296,  294,
      333,  333,  333,  293,  368,  331,  331,  372,  303,  307,
      298,  302,  299,  334,  334,  334,  301,  300,  373,  305,
      306,  304,  374,  314,  308,  375,  312,  316,  309,  317,

      313,  310,  311,  318,  336,  336,  336,  315,  337,  337,
      337,  376,  371,  379,  380,  368,  385,  381,  383,  387,
      388,  390,  386,  391,  392,  389,  372,  394,  373,  402,
      393,  395,  400,  396,  397,  404,  442,  401,  531,  399,
      443,  405,  374,  446,  375,  444,  450,  445,  385,  451,
      448,  387,  449,  376,  452,  453,  388,  454,  455,  459,
      379,  381,  383,  380,  386,  389,  393,  396,  397,  390,
      391,  395,  394,  392,  399,  401,  400,  405,  456,  402,
      442,  444,  443,  445,  404,  448,  458,  446,  449,  453,
      460,  454,  461,  462,  451,  450,  459,  463,  465,  466,

      467,  491,  498,  452,  492,  499,  501,  455,  500,  503,
      511,  510,  512,  524,  513,  526,  530,  527,  528,  525,
      523,  458,  456,  529,  460,  532,  543,  522,  534,  520,
      518,  466,  462,  463,  516,  509,  508,  499,  507,  506,
      467,  461,  465,  505,  500,  503,  511,  498,  510,  524,
      504,  491,  527,  492,  512,  501,  513,  502,  497,  529,
      532,  543,  526,  530,  534,  549,  549,  549,  549,  549,
      549,  549,  549,  549,  550,  550,  550,  550,  550,  550,
      550,  550,  550,  551,  551,  551,  551,  551,  551,  551,
      551,  551,  552,  552,  552,  552,  552,  552,  552,  552,

      553,  553,  553,  553,  554,  554,  554,  554,  554,  554,
      554,  554,  554,  555,  555,  555,  555,  555,  555,  555,
      555,  555,  556,  496,  556,  556,  556,  556,  557,  495,
      557,  557,  557,  557,  558,  494,  558,  558,  493,  490,
      558,  559,  559,  560,  560,  560,  560,  560,  560,  560,
      560,  560,  561,  561,  562,  562,  562,  489,  488,  481,
      478,  477,  475,  474,  473,  469,  468,  464,  457,  447,
      441,  440,  439,  437,  436,  434,  433,  432,  431,  430,
      429,  427,  426,  424,  423,  422,  421,  418,  416,  415,
      414,  413,  412,  411,  410,  409,  406,  403,  398,  384,

      382,  378,  377,  370,  369,  367,  366,  365,  363,  362,
      361,  360,  359,  358,  357,  356,  355,  354,  353,  350,
      349,  346,  345,  344,  343,  340,  332,  328,  327,  326,
      325,  324,  323,  322,  321,  320,  319,  297,  295,  291,
      276,  274,  273,  272,  271,  270,  269,  268,  267,  266,
      265,  264,  263,  262,  261,  260,  258,  256,  255,  254,
      253,  252,  251,  249,  248,  247,  246,  231,  230,  228,
      227,  226,  224,  223,  221,  202,  186,  184,  182,  179,
      177,  167,  164,  163,  160,  158,  157,  155,  154,  153,
      152,  151,  150,  149,  148,  147,  146,  145,  144,  143,

      140,  137,  133,  123,  115,  111,  110,  107,   83,   82,
       77,   76,   71,   58,   57,   56,   55,   53,   52,   50,
       45,   44,   43,   41,   35,   24,   21,   19,   16,   15,
       11,  548,  548,  548,  548,  548,  548,  548,  548,  548,
      548,  548,  548,  548,  548,  548,  548,  548,  548,  548,
      548,  548,  548,  548,  548,  548,  548,  548,  548,  548,
      548,  548,  548,  548,  548,  548,  548,  548,  548,  548,
      548,  548,  548,  548,  548,  548,  548,  548,  548,  548,
      548,  548,  548,  548,  548,  548,  548,  548,  548,  548,
      548,  548,  548,  548,  548,  548,  548,  548,  548,  548

    } ;

static yy_state_type yy_last_accepting_state;
static YY_CHAR *yy_last_accepting_cpos;

/* the intent behind this definition is that it'll catch
 * any uses of REJECT which flex missed
 */
#define REJECT reject_used_but_not_detected
#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;



	INIT;


    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;
	if ( yy_bp[-1] == '\n' )
	    ++yy_current_state;
yy_match:
	do
	    {
	    register YY_CHAR yy_c = yy_ec[*yy_cp];
	    if ( yy_accept[yy_current_state] )
		{
		yy_last_accepting_state = yy_current_state;
		yy_last_accepting_cpos = 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 >= 549 )
		    yy_c = yy_meta[yy_c];
		}
	    yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
	    ++yy_cp;
	    }
	while ( yy_current_state != 548 );
	yy_cp = yy_last_accepting_cpos;
	yy_current_state = yy_last_accepting_state;

yy_find_action:
	yy_act = 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 0: /* must backtrack */
	    /* undo the effects of YY_DO_BEFORE_ACTION */
	    *yy_cp = yy_hold_char;
	    yy_cp = yy_last_accepting_cpos;
	    yy_current_state = yy_last_accepting_state;
	    goto yy_find_action;

case 1:
# line 82 "c++2latex.l"
{ CPP; BEGIN (INCLUDE); }
	YY_BREAK
case 2:
# line 84 "c++2latex.l"
case 3:
# line 85 "c++2latex.l"
case 4:
# line 86 "c++2latex.l"
case 5:
# line 87 "c++2latex.l"
case 6:
# line 88 "c++2latex.l"
case 7:
# line 89 "c++2latex.l"
case 8:
# line 90 "c++2latex.l"
case 9:
# line 91 "c++2latex.l"
case 10:
# line 92 "c++2latex.l"
case 11:
# line 92 "c++2latex.l"
CPP;
	YY_BREAK
case 12:
*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 95 "c++2latex.l"
{ OUT ("$<${\\"); OUT (string_font);
			  OUT ("{}"); SUB (yytext+1); OUT ("}$>$");
			  input(); INIT; }
	YY_BREAK
case 13:
*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 98 "c++2latex.l"
{ OUT ("\"{\\"); OUT (string_font);
			  OUT ("{}"); SUB (yytext+1); OUT ("}\"");
			  input(); INIT; }
	YY_BREAK
case 14:
# line 101 "c++2latex.l"
ECHO;
	YY_BREAK
case 15:
# line 102 "c++2latex.l"
OUT ("\\mbox{}\\\\\n");
	YY_BREAK
case 16:
# line 103 "c++2latex.l"
{ yyless (0); INIT; }
	YY_BREAK
case 17:
# line 106 "c++2latex.l"
case 18:
# line 107 "c++2latex.l"
case 19:
# line 108 "c++2latex.l"
case 20:
# line 109 "c++2latex.l"
case 21:
# line 110 "c++2latex.l"
case 22:
# line 111 "c++2latex.l"
case 23:
# line 112 "c++2latex.l"
case 24:
# line 113 "c++2latex.l"
case 25:
# line 114 "c++2latex.l"
case 26:
# line 115 "c++2latex.l"
case 27:
# line 116 "c++2latex.l"
case 28:
# line 117 "c++2latex.l"
case 29:
# line 118 "c++2latex.l"
case 30:
# line 119 "c++2latex.l"
case 31:
# line 120 "c++2latex.l"
case 32:
# line 121 "c++2latex.l"
case 33:
# line 122 "c++2latex.l"
case 34:
# line 123 "c++2latex.l"
case 35:
# line 124 "c++2latex.l"
case 36:
# line 125 "c++2latex.l"
case 37:
# line 126 "c++2latex.l"
case 38:
# line 127 "c++2latex.l"
case 39:
# line 128 "c++2latex.l"
case 40:
# line 129 "c++2latex.l"
case 41:
# line 130 "c++2latex.l"
case 42:
# line 131 "c++2latex.l"
case 43:
# line 132 "c++2latex.l"
case 44:
# line 133 "c++2latex.l"
case 45:
# line 134 "c++2latex.l"
case 46:
# line 135 "c++2latex.l"
case 47:
# line 136 "c++2latex.l"
case 48:
# line 137 "c++2latex.l"
case 49:
# line 138 "c++2latex.l"
case 50:
# line 139 "c++2latex.l"
case 51:
# line 140 "c++2latex.l"
case 52:
# line 141 "c++2latex.l"
case 53:
# line 142 "c++2latex.l"
case 54:
# line 143 "c++2latex.l"
case 55:
# line 144 "c++2latex.l"
case 56:
# line 145 "c++2latex.l"
case 57:
# line 146 "c++2latex.l"
case 58:
# line 147 "c++2latex.l"
case 59:
# line 148 "c++2latex.l"
case 60:
# line 148 "c++2latex.l"
KEY;
	YY_BREAK
case 61:
# line 149 "c++2latex.l"
SYM ("rightarrow");
	YY_BREAK
case 62:
# line 150 "c++2latex.l"
SYM ("ll");
	YY_BREAK
case 63:
# line 151 "c++2latex.l"
SYM ("gg");
	YY_BREAK
case 64:
# line 152 "c++2latex.l"
SYM ("leq");
	YY_BREAK
case 65:
# line 153 "c++2latex.l"
SYM ("geq");
	YY_BREAK
case 66:
# line 154 "c++2latex.l"
SYM ("neq");
	YY_BREAK
case 67:
# line 155 "c++2latex.l"
SYM ("mid\\mid");
	YY_BREAK
case 68:
# line 156 "c++2latex.l"
SYM ("ldots");
	YY_BREAK
case 69:
# line 157 "c++2latex.l"
SYM ("ast=");
	YY_BREAK
case 70:
# line 158 "c++2latex.l"
SYM ("ll=");
	YY_BREAK
case 71:
# line 159 "c++2latex.l"
SYM ("gg=");
	YY_BREAK
case 72:
# line 160 "c++2latex.l"
SYM ("vee=");
	YY_BREAK
case 73:
# line 161 "c++2latex.l"
SYM ("mid=");
	YY_BREAK
case 74:
# line 162 "c++2latex.l"
SYM ("sim");
	YY_BREAK
case 75:
# line 163 "c++2latex.l"
SYM ("ast");
	YY_BREAK
case 76:
# line 164 "c++2latex.l"
SYM ("wedge");
	YY_BREAK
case 77:
# line 165 "c++2latex.l"
SYM ("mid");
	YY_BREAK
case 78:
# line 166 "c++2latex.l"
SYM ("rightarrow\\ast");
	YY_BREAK
case 79:
# line 167 "c++2latex.l"
OUT ("$/$");
	YY_BREAK
case 80:
# line 168 "c++2latex.l"
OUT ("$<$");
	YY_BREAK
case 81:
# line 169 "c++2latex.l"
OUT ("$>$");
	YY_BREAK
case 82:
# line 170 "c++2latex.l"
OUT ("\\&\\&");
	YY_BREAK
case 83:
# line 171 "c++2latex.l"
OUT ("\\%=");
	YY_BREAK
case 84:
# line 172 "c++2latex.l"
OUT ("\\&=");
	YY_BREAK
case 85:
# line 173 "c++2latex.l"
OUT ("\\{");
	YY_BREAK
case 86:
# line 174 "c++2latex.l"
OUT ("\\}");
	YY_BREAK
case 87:
# line 175 "c++2latex.l"
OUT ("\\&");
	YY_BREAK
case 88:
# line 176 "c++2latex.l"
OUT ("\\%");
	YY_BREAK
case 89:
# line 177 "c++2latex.l"
OUT ("-{}-");
	YY_BREAK
case 90:
# line 178 "c++2latex.l"
OUT (".$\\ast$");
	YY_BREAK
case 91:
# line 180 "c++2latex.l"
case 92:
# line 181 "c++2latex.l"
case 93:
# line 182 "c++2latex.l"
case 94:
# line 183 "c++2latex.l"
case 95:
# line 184 "c++2latex.l"
case 96:
# line 185 "c++2latex.l"
case 97:
# line 186 "c++2latex.l"
case 98:
# line 187 "c++2latex.l"
case 99:
# line 188 "c++2latex.l"
case 100:
# line 189 "c++2latex.l"
case 101:
# line 190 "c++2latex.l"
case 102:
# line 191 "c++2latex.l"
case 103:
# line 192 "c++2latex.l"
case 104:
# line 193 "c++2latex.l"
case 105:
# line 194 "c++2latex.l"
case 106:
# line 195 "c++2latex.l"
case 107:
# line 196 "c++2latex.l"
case 108:
# line 197 "c++2latex.l"
case 109:
# line 197 "c++2latex.l"
ECHO;
	YY_BREAK
case 110:
# line 200 "c++2latex.l"
case 111:
# line 200 "c++2latex.l"
SUB (yytext);
	YY_BREAK
case 112:
# line 202 "c++2latex.l"
{ BEGIN (BCOMMENT); OUT ("{$/\\ast$\\");
				  OUT (comment_font); OUT ("{}"); }
	YY_BREAK
case 113:
# line 204 "c++2latex.l"
{ INIT; OUT ("$\\ast/$}"); }
	YY_BREAK
case 114:
# line 205 "c++2latex.l"
OUT ("\\mbox{}\\\\\n");
	YY_BREAK
case 115:
# line 206 "c++2latex.l"
IND;
	YY_BREAK
case 116:
# line 207 "c++2latex.l"
SUB (yytext);
	YY_BREAK
case 117:
*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 209 "c++2latex.l"
{ OUT ("{$//$\\"); 
				  OUT (comment_font); OUT ("{}");
			          SUB (yytext + 2);
				  OUT ("}\\mbox{}\\\\\n"); }
	YY_BREAK
case 118:
# line 214 "c++2latex.l"
{ BEGIN (STRING); OUT ("{\\");
				  OUT (string_font); OUT ("\""); }
	YY_BREAK
case 119:
# line 216 "c++2latex.l"
OUT ("$\\backslash\\backslash$");
	YY_BREAK
case 120:
# line 217 "c++2latex.l"
{ OUT ("$\\backslash$"); SUB (yytext+1); }
	YY_BREAK
case 121:
# line 218 "c++2latex.l"
{ INIT; OUT ("\"}"); }
	YY_BREAK
case 122:
# line 219 "c++2latex.l"
OUT ("\\mbox{}\\\\\n");
	YY_BREAK
case 123:
# line 220 "c++2latex.l"
IND;
	YY_BREAK
case 124:
# line 221 "c++2latex.l"
SUB (yytext);
	YY_BREAK
case 125:
# line 224 "c++2latex.l"
case 126:
# line 225 "c++2latex.l"
case 127:
# line 226 "c++2latex.l"
case 128:
# line 226 "c++2latex.l"
ECHO;
	YY_BREAK
case 129:
# line 228 "c++2latex.l"
ECHO;
	YY_BREAK
case 130:
# line 231 "c++2latex.l"
case 131:
# line 232 "c++2latex.l"
case 132:
# line 233 "c++2latex.l"
case 133:
# line 233 "c++2latex.l"
SUB (yytext);
	YY_BREAK
case 134:
# line 235 "c++2latex.l"
ECHO;
	YY_BREAK
case 135:
# line 237 "c++2latex.l"
ECHO;
	YY_BREAK
case 136:
# line 239 "c++2latex.l"
OUT ("$\\backslash$\\\\\n");
	YY_BREAK
case 137:
# line 240 "c++2latex.l"
IND;
	YY_BREAK
case 138:
# line 241 "c++2latex.l"
ECHO;
	YY_BREAK
case 139:
# line 242 "c++2latex.l"
OUT ("\\newpage\n");
	YY_BREAK
case 140:
# line 243 "c++2latex.l"
OUT ("\\mbox{}\\\\\n");
	YY_BREAK
case 141:
# line 245 "c++2latex.l"
ECHO;
	YY_BREAK
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(STRING):
case YY_STATE_EOF(BCOMMENT):
case YY_STATE_EOF(INCLUDE):
case YY_STATE_EOF(CPLUSPLUS):
    yyterminate();

	    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
			{
			    yy_cp = yy_last_accepting_cpos;
			    yy_current_state = yy_last_accepting_state;
			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;

    register YY_CHAR *yy_bp = yytext;

    yy_current_state = yy_start;
    if ( yy_bp[-1] == '\n' )
	++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);
	if ( yy_accept[yy_current_state] )
	    {
	    yy_last_accepting_state = yy_current_state;
	    yy_last_accepting_cpos = 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 >= 549 )
		yy_c = yy_meta[yy_c];
	    }
	yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
	}

    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_cp = yy_c_buf_p;

    register YY_CHAR yy_c = 1;
    if ( yy_accept[yy_current_state] )
	{
	yy_last_accepting_state = yy_current_state;
	yy_last_accepting_cpos = 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 >= 549 )
	    yy_c = yy_meta[yy_c];
	}
    yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
    yy_is_jam = (yy_current_state == 548);

    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 245 "c++2latex.l"


void substitute (const char * input)
{
  while (*input)
    {
      switch (*input)
	{
	case '_':
	case '&':
	case '#':
	case '$':
	case '%':
	case '{':
	case '}':
	  printf ("\\%c", *input);
	  break;
	case '+':
	case '=':
	case '<':
	case '>':
	  printf ("$%c$", *input);
	  break;
	case '*':
	  printf ("$\\ast$");
	  break;
	case '|':
	  printf ("$\\mid$");
	  break;
	case '\\':
	  printf ("$\\backslash$");
	  break;
	case '^':
	  printf ("$\\wedge$");
	  break;
	case '~':
	  printf ("$\\sim$");
	  break;
	default:
	  printf ("%c", *input);
	  break;
	}
      input++;
    }
}

void
indent(const char * blanks)
{
  int i;
  
  i = 0;
  while (*blanks)
    {
      if (*blanks == ' ')
	{
	  i++;
	}
      else			/* *blanks == '\t' */
	{
	  while (++i % tabtotab) ;
	}
      blanks++;
    }
  printf ("\\hspace*{%d\\indentation}", i);
}

#include "getopt.h"
#include <string.h>
#include <fcntl.h>
#include <ctype.h>
#include <time.h>

extern char * version_string;

static struct option opts[] =
{
  {"ansi-c", 0, 0, 'a'},
  {"c-plusplus", 0, 0, 'p'},
  {"complete-file", 0, 0, 'c'},
  {"font-size", 1, 0, 's'},
  {"indentation", 1, 0, 'i'},
  {"header", 0, 0, 'h'},
  {"piped", 0, 0, 't'},
  {"output", 1, 0, 'o'},
  {"tabstop", 1, 0, 'T'},
  {"comment-font", 1, 0, 'C'},
  {"string-font", 1, 0, 'S'},
  {"keyword-font", 1, 0, 'K'},
  {"header-font", 1, 0, 'H'},
  {"cpp-font", 1, 0, 'P'},
  {"version", 0, 0, 'V'},
  {0, 0, 0, 0}
};


main (int argc, char** argv)
{
  int c;
  int index;
  int i;
  int has_filename;
  char * input_name;
  char * output_name;
  char * program_name;
  long now;
  char * today;

  input_name = "Standard Input";
  output_name = 0;

  now = time(0);
  today = ctime(&now);

  now = time(0);
  today = ctime(&now);

  program_name = strrchr (argv[0], '/');
  if (program_name == NULL)	/* no pathname */
    {
      program_name = argv[0];
    }
  else
    {
      program_name++;
    }
  
#ifdef USE_NAME 
#if defined(ANSI_C) || defined(C_PLUSPLUS)
#error USE_NAME, ANSI_C and C_PLUSPLUS are mutually exclusive
#else
  /* simple heuristic: '+' in name means C++ */
  cplusplus_mode = (strchr (program_name, '+') != 0);
#endif
#endif
  
  while ((c = getopt_long (argc, argv,
			   "acpo:s:i:thT:C:H:S:K:P:V", opts, &index))
	 != EOF)
    {
      if (c == 0)		/* Long option */
	{
	  c = opts[index].val;
	}
      switch (c)
	{
	case 'a':
	  cplusplus_mode = 0;
	  break;
	case 'p':
	  cplusplus_mode = 1;
	  break;
	case 'c':
	  complete_file = 1;
	  break;
	case 'o':
	  if (piped)
	    {
	      fprintf (stderr,
		       "%s: Can't use {-t,+pipe} and {-o,+output} together\n",
		       program_name);
	      exit(5);
	    }
	  output_name = optarg;
	  break;
	case 's':
	  font_size = optarg;
	  break;
	case 'i':
	  indentation = optarg;
	  break;
	case 'T':
	  tabtotab = atoi(optarg);
	  break;
	    case 't':
	      if (output_name != 0)
	    {
	      fprintf (stderr,
		       "%s: Can't use {-t,+pipe} and {-o,+output} together\n",
		       program_name);
	      exit(5);
	    }
	  piped = 1;
	  break;
	case 'h':
	  header = 1;
	  complete_file = 1;	/* header implies complete-file */
	  break;
	case 'C':
	  comment_font = optarg;
	  break;
	case 'H':
	  header_font = optarg;
	  break;
	case 'P':
	  cpp_font = optarg;
	  break;
	case 'S':
	  string_font = optarg;
	  break;
	case 'K':
	  keyword_font = optarg;
	  break;
	case 'V':
	  fprintf (stderr, "%s\n", version_string);
	  break;
	default:
	  usage(program_name);
	}
    }
  has_filename = (argc - optind == 1);
  if (has_filename)		/* last argument is input file name */
    {
      input_name = argv[optind];
      if (freopen (input_name, "r", stdin) == NULL)
	{
	  fprintf (stderr, "%s: Can't open `%s' for reading\n",
		   program_name, input_name);
	  exit (2);
	}
    }
  if ((output_name == 0) && !piped)
    {
      char * tmp;
      if (has_filename)
	{
	  char * point;
	  
	  point = strrchr (input_name, '/');
	  if (point == 0)	/* plain filename */
	    {
	      point = input_name;
	    }
	  else
	    {
	      point++;
	    }
	  tmp = malloc (strlen (point) + 1);
	  if (tmp == 0)
	    {
	      fprintf (stderr, "%s: Virtual memory exhausted\n", program_name);
	      exit (3);
	    }
	  strcpy (tmp, point);
	  point = strrchr (tmp, '.');
	  if (point != 0)
	    {
	      *point = '\0';
	    }
	}
      else
	{
	  tmp = program_name;
	}
      output_name = malloc (strlen (tmp) + 4);
      if (output_name == 0)
	{
	  fprintf (stderr, "%s: Virtual memory exhausted\n", program_name);
	  exit (3);
	}
      strcpy (output_name, tmp);
      strcat (output_name, ".tex");
    }
  if (!piped)
    {
      if (freopen (output_name, "w", stdout) == NULL)
	{
	  fprintf (stderr, "%s: Can't open `%s' for writing\n",
		   program_name, output_name);
	  exit (4);
	}
    }
  printf ("\
%%\n\
%% This file was automatically produced at %.24s by\n\
%% %s", today, program_name);
  for (i = 1; i < argc; i++)
    {
      printf(" %s", argv[i]);
    }
  if (!has_filename)
    {
      printf(" (from Standard Input)");
    }
  printf("\n%%\n");
  if (complete_file)
    {
      if (header)
	{
	  if (strcmp (font_size, "10") == 0)
	    {
	      printf ("\\documentstyle[fancyheadings]{article}\n");
	    }
	  else
	    {
	      printf ("\\documentstyle[%spt,fancyheadings]{article}\n",
		      font_size);
	    }
	}
      else
	{
	  if (strcmp (font_size, "10") == 0)
	    {
	      printf ("\\documentstyle{article}\n");
	    }
	  else
	    {
	      printf ("\\documentstyle[%spt]{article}\n", font_size);
	    }
	}
      printf ("\\setlength{\\textwidth}{15cm}\n");
      printf ("\\setlength{\\textheight}{22.5cm}\n");
      printf ("\\setlength{\\hoffset}{-2cm}\n");
      printf ("\\setlength{\\voffset}{-2cm}\n");
      if (header)
	{
	  printf ("\\chead{\\%s Produced from ", header_font);
	  substitute(input_name);
	  printf (" at %.24s}\n", today);
	  printf ("\\cfoot{\\rm\\thepage}\n");
	  printf ("\\addtolength{\\headheight}{14pt}\n");
	  printf ("\\pagestyle{fancy}\n");
	}
      printf ("\\begin{document}\n");
    }
  printf ("\\expandafter\\ifx\\csname indentation\\endcsname\\relax%\n");
  printf ("\\newlength{\\indentation}\\fi\n");
  printf ("\\setlength{\\indentation}{%s}\n", indentation);
  printf ("\\begin{flushleft}\n");
  yylex();
  printf ("\\end{flushleft}\n");
  if (complete_file)
    {
      printf ("\\end{document}\n");
    }
  exit(0);
}

void
usage(const char * name)
{
  fprintf (stderr, "%s\n", version_string);
  fprintf (stderr, "\
Usage: %s [-a] [-c] [-h] [-i length] [-o path] [-p] [-s size] [-t]\n\
       [-C font][-H font] [-K font] [-P font] [-S font] [-T wide] [-V]\n\
       [+ansi-c] [+complete-file] [+header] [+indentation length]\n\
       [+output path] [+c-plusplus] [+font-size size] [+pipe]\n\
       [+comment-font font] [+keyword-font font] [+cpp-font font]\n\
       [+header-font font] [+string-font font] [+tabstop wide]\n\
       [+version] [path]\n", name);
  exit (1);
}