home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume20 / notation / part03 / lexer.c < prev   
Encoding:
C/C++ Source or Header  |  1991-06-18  |  31.9 KB  |  1,269 lines

  1. /* A lexical scanner generated by flex */
  2.  
  3. /* scanner skeleton version:
  4.  * $Header: /usr/fsys/odin/a/vern/flex/RCS/flex.skel,v 2.16 90/08/03 14:09:36 vern Exp $
  5.  */
  6.  
  7. #define FLEX_SCANNER
  8.  
  9. #include <stdio.h>
  10.  
  11.  
  12. /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
  13. #ifdef c_plusplus
  14. #ifndef __cplusplus
  15. #define __cplusplus
  16. #endif
  17. #endif
  18.  
  19.  
  20. #ifdef __cplusplus
  21.  
  22. #include <stdlib.h>
  23. #include <osfcn.h>
  24.  
  25. /* use prototypes in function declarations */
  26. #define YY_USE_PROTOS
  27.  
  28. /* the "const" storage-class-modifier is valid */
  29. #define YY_USE_CONST
  30.  
  31. #else    /* ! __cplusplus */
  32.  
  33. #ifdef __STDC__
  34.  
  35. #ifdef __GNUC__
  36. #include <stddef.h>
  37. void *malloc( size_t );
  38. void free( void* );
  39. #else
  40. #include <stdlib.h>
  41. #endif    /* __GNUC__ */
  42.  
  43. #define YY_USE_PROTOS
  44. #define YY_USE_CONST
  45.  
  46. #endif    /* __STDC__ */
  47. #endif    /* ! __cplusplus */
  48.  
  49.  
  50. #ifdef __TURBOC__
  51. #define YY_USE_CONST
  52. #endif
  53.  
  54.  
  55. #ifndef YY_USE_CONST
  56. #define const
  57. #endif
  58.  
  59.  
  60. #ifdef YY_USE_PROTOS
  61. #define YY_PROTO(proto) proto
  62. #else
  63. #define YY_PROTO(proto) ()
  64. /* we can't get here if it's an ANSI C compiler, or a C++ compiler,
  65.  * so it's got to be a K&R compiler, and therefore there's no standard
  66.  * place from which to include these definitions
  67.  */
  68. char *malloc();
  69. int free();
  70. int read();
  71. #endif
  72.  
  73.  
  74. /* amount of stuff to slurp up with each read */
  75. #ifndef YY_READ_BUF_SIZE
  76. #define YY_READ_BUF_SIZE 8192
  77. #endif
  78.  
  79. /* returned upon end-of-file */
  80. #define YY_END_TOK 0
  81.  
  82. /* copy whatever the last rule matched to the standard output */
  83.  
  84. /* cast to (char *) is because for 8-bit chars, yytext is (unsigned char *) */
  85. /* this used to be an fputs(), but since the string might contain NUL's,
  86.  * we now use fwrite()
  87.  */
  88. #define ECHO (void) fwrite( (char *) yytext, yyleng, 1, yyout )
  89.  
  90. /* gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
  91.  * is returned in "result".
  92.  */
  93. #define YY_INPUT(buf,result,max_size) \
  94.     if ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \
  95.         YY_FATAL_ERROR( "read() in flex scanner failed" );
  96. #define YY_NULL 0
  97.  
  98. /* no semi-colon after return; correct usage is to write "yyterminate();" -
  99.  * we don't want an extra ';' after the "return" because that will cause
  100.  * some compilers to complain about unreachable statements.
  101.  */
  102. #define yyterminate() return ( YY_NULL )
  103.  
  104. /* report a fatal error */
  105.  
  106. /* The funky do-while is used to turn this macro definition into
  107.  * a single C statement (which needs a semi-colon terminator).
  108.  * This avoids problems with code like:
  109.  *
  110.  *     if ( something_happens )
  111.  *        YY_FATAL_ERROR( "oops, the something happened" );
  112.  *    else
  113.  *        everything_okay();
  114.  *
  115.  * Prior to using the do-while the compiler would get upset at the
  116.  * "else" because it interpreted the "if" statement as being all
  117.  * done when it reached the ';' after the YY_FATAL_ERROR() call.
  118.  */
  119.  
  120. #define YY_FATAL_ERROR(msg) \
  121.     do \
  122.         { \
  123.         (void) fputs( msg, stderr ); \
  124.         (void) putc( '\n', stderr ); \
  125.         exit( 1 ); \
  126.         } \
  127.     while ( 0 )
  128.  
  129. /* default yywrap function - always treat EOF as an EOF */
  130. #define yywrap() 1
  131.  
  132. /* enter a start condition.  This macro really ought to take a parameter,
  133.  * but we do it the disgusting crufty way forced on us by the ()-less
  134.  * definition of BEGIN
  135.  */
  136. #define BEGIN yy_start = 1 + 2 *
  137.  
  138. /* action number for EOF rule of a given start state */
  139. #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
  140.  
  141. /* special action meaning "start processing a new file" */
  142. #define YY_NEW_FILE \
  143.     do \
  144.         { \
  145.         yy_init_buffer( yy_current_buffer, yyin ); \
  146.         yy_load_buffer_state(); \
  147.         } \
  148.     while ( 0 )
  149.  
  150. /* default declaration of generated scanner - a define so the user can
  151.  * easily add parameters
  152.  */
  153. #define YY_DECL int yylex YY_PROTO(( void )) 
  154.  
  155. /* code executed at the end of each rule */
  156. #define YY_BREAK break;
  157.  
  158. #define YY_END_OF_BUFFER_CHAR 0
  159.  
  160. #ifndef YY_BUF_SIZE
  161. #define YY_BUF_SIZE (YY_READ_BUF_SIZE * 2) /* size of default input buffer */
  162. #endif
  163.  
  164. typedef struct yy_buffer_state *YY_BUFFER_STATE;
  165.  
  166. #define YY_CHAR char
  167. # line 1 "lexer.l"
  168. #define INITIAL 0
  169. /* DO NOT REMOVE THIS LINE                      */
  170. /*                                              */
  171. /* Notation program                             */
  172. /* @(#)lexer.l    3.1 (C) Henry Thomas\tVersion 3.1\tDated 6/16/91 */
  173. /*                                              */
  174. # line 7 "lexer.l"
  175. #include <stdio.h>
  176.  
  177. #include "chesstype.h"
  178. #include"notation.h"
  179.  
  180. #define NCURLINE 1024
  181. char curline [NCURLINE] ;
  182.  
  183. #define LARGE_BUF 4096
  184. static char commbuf[LARGE_BUF];
  185.  
  186. int column = 0;
  187. int lineno = 1;
  188.  
  189. #ifdef __STDC__
  190. extern void count(void);
  191. extern char * comment(int closing);
  192. #else
  193. extern void count();
  194. extern char * comment();
  195. #endif
  196.  
  197. # line 34 "lexer.l"
  198.  
  199. /* done after the current pattern has been matched and before the
  200.  * corresponding action - sets up yytext
  201.  */
  202. #define YY_DO_BEFORE_ACTION \
  203.     yytext = yy_bp; \
  204.     yyleng = yy_cp - yy_bp; \
  205.     yy_hold_char = *yy_cp; \
  206.     *yy_cp = '\0'; \
  207.     yy_c_buf_p = yy_cp;
  208.  
  209. #define EOB_ACT_CONTINUE_SCAN 0
  210. #define EOB_ACT_END_OF_FILE 1
  211. #define EOB_ACT_LAST_MATCH 2
  212.  
  213. /* return all but the first 'n' matched characters back to the input stream */
  214. #define yyless(n) \
  215.     do \
  216.         { \
  217.         /* undo effects of setting up yytext */ \
  218.         *yy_cp = yy_hold_char; \
  219.         yy_c_buf_p = yy_cp = yy_bp + n; \
  220.         YY_DO_BEFORE_ACTION; /* set up yytext again */ \
  221.         } \
  222.     while ( 0 )
  223.  
  224. #define unput(c) yyunput( c, yytext )
  225.  
  226.  
  227. struct yy_buffer_state
  228.     {
  229.     FILE *yy_input_file;
  230.  
  231.     YY_CHAR *yy_ch_buf;        /* input buffer */
  232.     YY_CHAR *yy_buf_pos;    /* current position in input buffer */
  233.  
  234.     /* size of input buffer in bytes, not including room for EOB characters*/
  235.     int yy_buf_size;    
  236.  
  237.     /* number of characters read into yy_ch_buf, not including EOB characters */
  238.     int yy_n_chars;
  239.  
  240.     int yy_eof_status;        /* whether we've seen an EOF on this buffer */
  241. #define EOF_NOT_SEEN 0
  242.     /* "pending" happens when the EOF has been seen but there's still
  243.      * some text process
  244.      */
  245. #define EOF_PENDING 1
  246. #define EOF_DONE 2
  247.     };
  248.  
  249. static YY_BUFFER_STATE yy_current_buffer;
  250.  
  251. /* we provide macros for accessing buffer states in case in the
  252.  * future we want to put the buffer states in a more general
  253.  * "scanner state"
  254.  */
  255. #define YY_CURRENT_BUFFER yy_current_buffer
  256.  
  257.  
  258. /* yy_hold_char holds the character lost when yytext is formed */
  259. static YY_CHAR yy_hold_char;
  260.  
  261. static int yy_n_chars;        /* number of characters read into yy_ch_buf */
  262.  
  263.  
  264.  
  265. #ifndef YY_USER_ACTION
  266. #define YY_USER_ACTION
  267. #endif
  268.  
  269. #ifndef YY_USER_INIT
  270. #define YY_USER_INIT
  271. #endif
  272.  
  273. extern YY_CHAR *yytext;
  274. extern int yyleng;
  275. extern FILE *yyin, *yyout;
  276.  
  277. YY_CHAR *yytext;
  278. int yyleng;
  279.  
  280. FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
  281.  
  282. #define YY_END_OF_BUFFER 32
  283. typedef int yy_state_type;
  284. static const short int yy_accept[80] =
  285.     {   0,
  286.         0,    0,   32,   30,   29,   29,    8,    7,   30,    7,
  287.        25,   28,    7,    2,    2,   30,   30,   30,   30,   24,
  288.        30,   30,   30,   30,   26,   27,    6,    5,    5,    0,
  289.        13,    0,    0,    0,    0,    0,    2,    1,    2,    1,
  290.        18,   23,    0,    0,    0,    0,    1,    0,   14,    3,
  291.         0,    0,   20,    0,    0,    0,    1,    4,    0,   10,
  292.         9,   11,    3,    0,    1,    1,   22,    1,    0,    1,
  293.        12,    0,   19,    0,   17,   21,   20,   15,    0
  294.     } ;
  295.  
  296. static const YY_CHAR yy_ec[128] =
  297.     {   0,
  298.         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
  299.         2,    2,    1,    1,    1,    1,    1,    1,    1,    1,
  300.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  301.         1,    2,    4,    1,    5,    6,    1,    7,    1,    8,
  302.         9,   10,   11,   12,   13,   14,   15,   16,   17,   17,
  303.        17,   17,   17,   17,   17,   17,   18,    1,   12,    7,
  304.         7,    7,    4,   19,   20,   20,   20,   20,   20,   20,
  305.        20,   20,   20,   20,   20,   20,   20,   20,   21,   20,
  306.        20,   20,   20,   20,   20,   20,   20,   22,   20,   20,
  307.        23,    7,   24,   25,    7,    1,   26,   26,   27,   26,
  308.  
  309.        28,   26,   26,   26,   26,   26,   26,   26,   26,   26,
  310.        29,   30,   26,   26,   26,   31,   26,   26,   26,   32,
  311.        26,   26,   33,    7,   34,    7,    1
  312.     } ;
  313.  
  314. static const YY_CHAR yy_meta[35] =
  315.     {   0,
  316.         1,    1,    1,    1,    2,    1,    2,    1,    1,    2,
  317.         2,    1,    3,    1,    2,    1,    4,    1,    1,    1,
  318.         1,    5,    1,    1,    6,    7,    7,    7,    7,    7,
  319.         7,    7,    1,    1
  320.     } ;
  321.  
  322. static const short int yy_base[88] =
  323.     {   0,
  324.         0,    0,  148,  225,  225,  225,   31,   41,    0,    0,
  325.        48,  225,   48,   68,   23,  119,   37,   85,   70,   36,
  326.        77,  105,  125,   78,  225,  225,  225,    0,    0,    0,
  327.       225,  134,  121,  119,  109,  129,  225,  146,   47,  152,
  328.       225,   63,  107,    0,    0,  145,  156,  101,  225,  106,
  329.       104,   78,   88,   26,   90,   74,  163,  225,    0,  225,
  330.       225,  225,  225,  162,   54,  225,  225,  173,  166,   76,
  331.       225,   73,  225,   38,  225,  225,  225,  225,  225,   48,
  332.       201,  202,  207,  212,  218,   42,   31
  333.     } ;
  334.  
  335. static const short int yy_def[88] =
  336.     {   0,
  337.        79,    1,   79,   79,   79,   79,   79,   79,   80,   81,
  338.        79,   79,    8,   79,   79,   82,   83,   79,   83,   79,
  339.        84,   79,   79,   84,   79,   79,   79,   85,   85,   86,
  340.        79,   79,   79,   79,   79,   79,   79,   79,   79,   79,
  341.        79,   82,   84,   24,   24,   43,   24,   79,   79,   24,
  342.        43,   79,   79,   79,   79,   79,   79,   79,   87,   79,
  343.        79,   79,   79,   79,   79,   79,   79,   79,   43,   79,
  344.        79,   79,   79,   79,   79,   79,   79,   79,    0,   79,
  345.        79,   79,   79,   79,   79,   79,   79
  346.     } ;
  347.  
  348. static const short int yy_nxt[260] =
  349.     {   0,
  350.         4,    5,    6,    7,    8,    9,   10,   11,    4,   10,
  351.         8,   12,   13,   12,   10,   14,   15,   15,   16,   17,
  352.        18,   19,   20,    4,   10,   21,   21,   22,   23,   21,
  353.        21,   24,   25,   26,   27,   27,   37,   76,   39,   39,
  354.        39,   27,   63,   27,   27,   28,   48,   29,   59,   43,
  355.        29,   28,   73,   28,   30,   29,   31,   32,   43,   49,
  356.        37,   33,   39,   39,   39,   29,   78,   37,   45,   39,
  357.        39,   39,   34,   35,   35,   35,   35,   35,   35,   35,
  358.        36,   37,   43,   38,   39,   39,   77,   79,   40,   43,
  359.        43,   43,   63,   50,   50,   67,   40,   46,   43,   43,
  360.  
  361.        40,   45,   75,   74,   63,   40,   43,   72,   51,   51,
  362.        44,   44,   44,   47,   44,   44,   45,   43,   52,   79,
  363.        63,   50,   79,   79,   71,   63,   43,   62,   79,   61,
  364.        35,   35,   35,   35,   53,   54,   51,   46,   55,   56,
  365.        40,   50,   60,   41,   40,   40,   43,   79,   79,   40,
  366.        35,   35,   35,   57,   35,   35,   51,   40,   64,   37,
  367.        40,   65,   39,   39,   64,   40,   66,   66,   69,   79,
  368.        79,   66,   66,   68,   66,   64,   66,   66,   66,   63,
  369.        66,   66,   66,   66,   70,   64,   66,   79,   66,   63,
  370.        66,   66,   79,   66,   70,   79,   79,   79,   79,   79,
  371.  
  372.        79,   66,   29,   29,   79,   79,   29,   42,   42,   44,
  373.        79,   44,   79,   44,   35,   35,   35,   79,   35,   58,
  374.        58,   79,   79,   58,    3,   79,   79,   79,   79,   79,
  375.        79,   79,   79,   79,   79,   79,   79,   79,   79,   79,
  376.        79,   79,   79,   79,   79,   79,   79,   79,   79,   79,
  377.        79,   79,   79,   79,   79,   79,   79,   79,   79
  378.     } ;
  379.  
  380. static const short int yy_chk[260] =
  381.     {   0,
  382.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  383.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  384.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  385.         1,    1,    1,    1,    7,    7,   15,   87,   15,   15,
  386.        15,    7,   54,    7,    8,    8,   20,    8,   86,   17,
  387.         8,    8,   54,    8,   80,    8,   11,   11,   17,   20,
  388.        39,   11,   39,   39,   39,    8,   74,   65,   17,   65,
  389.        65,   65,   11,   13,   13,   13,   13,   13,   13,   13,
  390.        14,   14,   19,   14,   14,   14,   72,   42,   14,   21,
  391.        24,   19,   70,   21,   24,   42,   14,   18,   21,   24,
  392.  
  393.        18,   19,   56,   55,   53,   18,   18,   52,   21,   24,
  394.        18,   18,   18,   18,   18,   18,   18,   22,   22,   43,
  395.        51,   22,   50,   43,   48,   35,   22,   34,   43,   33,
  396.        22,   22,   22,   22,   22,   22,   22,   23,   23,   23,
  397.        23,   23,   32,   16,   36,   23,   23,    3,    0,   36,
  398.        23,   23,   23,   23,   23,   23,   23,   36,   38,   38,
  399.        46,   38,   38,   38,   40,   46,   38,   40,   47,    0,
  400.         0,   47,   40,   46,   38,   57,   47,   64,   57,   57,
  401.        40,   69,   64,   57,   47,   68,   69,    0,   68,   68,
  402.        64,   57,    0,   68,   69,    0,    0,    0,    0,    0,
  403.  
  404.         0,   68,   81,   81,    0,    0,   81,   82,   82,   83,
  405.         0,   83,    0,   83,   84,   84,   84,    0,   84,   85,
  406.        85,    0,    0,   85,   79,   79,   79,   79,   79,   79,
  407.        79,   79,   79,   79,   79,   79,   79,   79,   79,   79,
  408.        79,   79,   79,   79,   79,   79,   79,   79,   79,   79,
  409.        79,   79,   79,   79,   79,   79,   79,   79,   79
  410.     } ;
  411.  
  412. static yy_state_type yy_last_accepting_state;
  413. static YY_CHAR *yy_last_accepting_cpos;
  414.  
  415. /* the intent behind this definition is that it'll catch
  416.  * any uses of REJECT which flex missed
  417.  */
  418. #define REJECT reject_used_but_not_detected
  419. #define yymore() yymore_used_but_not_detected
  420. #define YY_MORE_ADJ 0
  421.  
  422. /* these variables are all declared out here so that section 3 code can
  423.  * manipulate them
  424.  */
  425. /* points to current character in buffer */
  426. static YY_CHAR *yy_c_buf_p = (YY_CHAR *) 0;
  427. static int yy_init = 1;        /* whether we need to initialize */
  428. static int yy_start = 0;    /* start state number */
  429.  
  430. /* flag which is used to allow yywrap()'s to do buffer switches
  431.  * instead of setting up a fresh yyin.  A bit of a hack ...
  432.  */
  433. static int yy_did_buffer_switch_on_eof;
  434.  
  435. static yy_state_type yy_get_previous_state YY_PROTO(( void ));
  436. static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
  437. static int yy_get_next_buffer YY_PROTO(( void ));
  438. static void yyunput YY_PROTO(( YY_CHAR c, YY_CHAR *buf_ptr ));
  439. void yyrestart YY_PROTO(( FILE *input_file ));
  440. void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
  441. void yy_load_buffer_state YY_PROTO(( void ));
  442. YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
  443. void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
  444. void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
  445.  
  446. #define yy_new_buffer yy_create_buffer
  447.  
  448. #ifdef __cplusplus
  449. static int yyinput YY_PROTO(( void ));
  450. #else
  451. static int input YY_PROTO(( void ));
  452. #endif
  453.  
  454. YY_DECL
  455.     {
  456.     register yy_state_type yy_current_state;
  457.     register YY_CHAR *yy_cp, *yy_bp;
  458.     register int yy_act;
  459.  
  460.  
  461.  
  462.     if ( yy_init )
  463.     {
  464.     YY_USER_INIT;
  465.  
  466.     if ( ! yy_start )
  467.         yy_start = 1;    /* first start state */
  468.  
  469.     if ( ! yyin )
  470.         yyin = stdin;
  471.  
  472.     if ( ! yyout )
  473.         yyout = stdout;
  474.  
  475.     if ( yy_current_buffer )
  476.         yy_init_buffer( yy_current_buffer, yyin );
  477.     else
  478.         yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
  479.  
  480.     yy_load_buffer_state();
  481.  
  482.     yy_init = 0;
  483.     }
  484.  
  485.     while ( 1 )        /* loops until end-of-file is reached */
  486.     {
  487.     yy_cp = yy_c_buf_p;
  488.  
  489.     /* support of yytext */
  490.     *yy_cp = yy_hold_char;
  491.  
  492.     /* yy_bp points to the position in yy_ch_buf of the start of the
  493.      * current run.
  494.      */
  495.     yy_bp = yy_cp;
  496.  
  497.     yy_current_state = yy_start;
  498. yy_match:
  499.     do
  500.         {
  501.         register YY_CHAR yy_c = yy_ec[*yy_cp];
  502.         if ( yy_accept[yy_current_state] )
  503.         {
  504.         yy_last_accepting_state = yy_current_state;
  505.         yy_last_accepting_cpos = yy_cp;
  506.         }
  507.         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  508.         {
  509.         yy_current_state = yy_def[yy_current_state];
  510.         if ( yy_current_state >= 80 )
  511.             yy_c = yy_meta[yy_c];
  512.         }
  513.         yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
  514.         ++yy_cp;
  515.         }
  516.     while ( yy_current_state != 79 );
  517.     yy_cp = yy_last_accepting_cpos;
  518.     yy_current_state = yy_last_accepting_state;
  519.  
  520. yy_find_action:
  521.     yy_act = yy_accept[yy_current_state];
  522.  
  523.     YY_DO_BEFORE_ACTION;
  524.     YY_USER_ACTION;
  525.  
  526. do_action:    /* this label is used only to access EOF actions */
  527.  
  528.  
  529.     switch ( yy_act )
  530.         {
  531.         case 0: /* must backtrack */
  532.         /* undo the effects of YY_DO_BEFORE_ACTION */
  533.         *yy_cp = yy_hold_char;
  534.         yy_cp = yy_last_accepting_cpos;
  535.         yy_current_state = yy_last_accepting_state;
  536.         goto yy_find_action;
  537.  
  538. case 1:
  539. # line 35 "lexer.l"
  540. { /* roque */ ; parse_roque(yytext); }
  541.     YY_BREAK
  542. case 2:
  543. # line 36 "lexer.l"
  544. { /* move number */ parse_number(yytext); }
  545.     YY_BREAK
  546. case 3:
  547. # line 37 "lexer.l"
  548. { /* move */  
  549.   (void) parse_move(yytext);
  550.   /*; fprintf(stderr,"%s, ",yytext);*/ 
  551. }
  552.     YY_BREAK
  553. case 4:
  554. # line 43 "lexer.l"
  555. { /* comment */ ; 
  556.                 parse_comment(yytext); }
  557.     YY_BREAK
  558. case 5:
  559. # line 45 "lexer.l"
  560. { /* comment */ ; 
  561.                    parse_comment(yytext); }
  562.     YY_BREAK
  563. case 6:
  564. # line 47 "lexer.l"
  565. { /* comment */ ; 
  566.                      parse_comment(yytext); }
  567.     YY_BREAK
  568. case 7:
  569. # line 49 "lexer.l"
  570. { /* comment */ ; 
  571.                parse_comment(yytext); }
  572.     YY_BREAK
  573. case 8:
  574. # line 51 "lexer.l"
  575. { /* comment */ ; parse_comment(yytext); }
  576.     YY_BREAK
  577. case 9:
  578. # line 52 "lexer.l"
  579. { /* comment */ ; parse_comment(yytext); }
  580.     YY_BREAK
  581. case 10:
  582. # line 53 "lexer.l"
  583. { /* comment */ ; parse_comment(yytext); }
  584.     YY_BREAK
  585. case 11:
  586. # line 54 "lexer.l"
  587. { /* comment */ ; parse_comment(yytext); }
  588.     YY_BREAK
  589. case 12:
  590. # line 55 "lexer.l"
  591. { /* comment */ ; parse_comment(yytext); }
  592.     YY_BREAK
  593. case 13:
  594. # line 56 "lexer.l"
  595. { /* comment */ ; parse_comment(yytext); }
  596.     YY_BREAK
  597. case 14:
  598. # line 57 "lexer.l"
  599. { /* comment */ ; parse_comment(yytext); }
  600.     YY_BREAK
  601. case 15:
  602. # line 58 "lexer.l"
  603. { /* comment */ ; parse_comment(yytext); }
  604.     YY_BREAK
  605. case 16:
  606. # line 59 "lexer.l"
  607. { /* comment */ ; parse_comment(yytext); }
  608.     YY_BREAK
  609. case 17:
  610. # line 60 "lexer.l"
  611. { /* comment */ ; parse_comment(yytext); }
  612.     YY_BREAK
  613. case 18:
  614. # line 61 "lexer.l"
  615. { /* comment */ ; parse_comment(yytext); }
  616.     YY_BREAK
  617. case 19:
  618. # line 62 "lexer.l"
  619. { /* comment */ ; parse_comment("etc"); }
  620.     YY_BREAK
  621. case 20:
  622. # line 63 "lexer.l"
  623. { /* comment */ ; parse_comment("ep"); }
  624.     YY_BREAK
  625. case 21:
  626. # line 64 "lexer.l"
  627. { /* game comment */ ; parse_comment(yytext); }
  628.     YY_BREAK
  629. case 22:
  630. # line 65 "lexer.l"
  631. { /* keyword with arg */ 
  632.   yytext[yyleng -1] = '\0' ;
  633.   parse_keyword(yytext, comment('}'));
  634. }
  635.     YY_BREAK
  636. case 23:
  637. # line 69 "lexer.l"
  638. { /* keyword without arg */ 
  639.   parse_keyword(yytext,NULL); }
  640.     YY_BREAK
  641. case 24:
  642. # line 71 "lexer.l"
  643. { parse_text(comment(']')); }
  644.     YY_BREAK
  645. case 25:
  646. # line 72 "lexer.l"
  647. { parse_text(comment(')')); }
  648.     YY_BREAK
  649. case 26:
  650. # line 73 "lexer.l"
  651. { /* enter variation */ ; enter_variation(); }
  652.     YY_BREAK
  653. case 27:
  654. # line 74 "lexer.l"
  655. { /* close variation */ ; exit_variation(); }
  656.     YY_BREAK
  657. case 28:
  658. # line 75 "lexer.l"
  659. { /* skip , ; */ ; }
  660.     YY_BREAK
  661. case 29:
  662. # line 76 "lexer.l"
  663. { /* skip blanks */; }
  664.     YY_BREAK
  665. case 30:
  666. # line 77 "lexer.l"
  667. { /* ignore bad characters */ (void) fprintf(stderr,"I don't understand: %s\n",yytext);}
  668.     YY_BREAK
  669. case 31:
  670. # line 78 "lexer.l"
  671. ECHO;
  672.     YY_BREAK
  673. case YY_STATE_EOF(INITIAL):
  674.     yyterminate();
  675.  
  676.         case YY_END_OF_BUFFER:
  677.         {
  678.         /* amount of text matched not including the EOB char */
  679.         int yy_amount_of_matched_text = yy_cp - yytext - 1;
  680.  
  681.         /* undo the effects of YY_DO_BEFORE_ACTION */
  682.         *yy_cp = yy_hold_char;
  683.  
  684.         /* note that here we test for yy_c_buf_p "<=" to the position
  685.          * of the first EOB in the buffer, since yy_c_buf_p will
  686.          * already have been incremented past the NUL character
  687.          * (since all states make transitions on EOB to the end-
  688.          * of-buffer state).  Contrast this with the test in yyinput().
  689.          */
  690.         if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
  691.             /* this was really a NUL */
  692.             {
  693.             yy_state_type yy_next_state;
  694.  
  695.             yy_c_buf_p = yytext + yy_amount_of_matched_text;
  696.  
  697.             yy_current_state = yy_get_previous_state();
  698.  
  699.             /* okay, we're now positioned to make the
  700.              * NUL transition.  We couldn't have
  701.              * yy_get_previous_state() go ahead and do it
  702.              * for us because it doesn't know how to deal
  703.              * with the possibility of jamming (and we
  704.              * don't want to build jamming into it because
  705.              * then it will run more slowly)
  706.              */
  707.  
  708.             yy_next_state = yy_try_NUL_trans( yy_current_state );
  709.  
  710.             yy_bp = yytext + YY_MORE_ADJ;
  711.  
  712.             if ( yy_next_state )
  713.             {
  714.             /* consume the NUL */
  715.             yy_cp = ++yy_c_buf_p;
  716.             yy_current_state = yy_next_state;
  717.             goto yy_match;
  718.             }
  719.  
  720.             else
  721.             {
  722.                 yy_cp = yy_last_accepting_cpos;
  723.                 yy_current_state = yy_last_accepting_state;
  724.             goto yy_find_action;
  725.             }
  726.             }
  727.  
  728.         else switch ( yy_get_next_buffer() )
  729.             {
  730.             case EOB_ACT_END_OF_FILE:
  731.             {
  732.             yy_did_buffer_switch_on_eof = 0;
  733.  
  734.             if ( yywrap() )
  735.                 {
  736.                 /* note: because we've taken care in
  737.                  * yy_get_next_buffer() to have set up yytext,
  738.                  * we can now set up yy_c_buf_p so that if some
  739.                  * total hoser (like flex itself) wants
  740.                  * to call the scanner after we return the
  741.                  * YY_NULL, it'll still work - another YY_NULL
  742.                  * will get returned.
  743.                  */
  744.                 yy_c_buf_p = yytext + YY_MORE_ADJ;
  745.  
  746.                 yy_act = YY_STATE_EOF((yy_start - 1) / 2);
  747.                 goto do_action;
  748.                 }
  749.  
  750.             else
  751.                 {
  752.                 if ( ! yy_did_buffer_switch_on_eof )
  753.                 YY_NEW_FILE;
  754.                 }
  755.             }
  756.             break;
  757.  
  758.             case EOB_ACT_CONTINUE_SCAN:
  759.             yy_c_buf_p = yytext + yy_amount_of_matched_text;
  760.  
  761.             yy_current_state = yy_get_previous_state();
  762.  
  763.             yy_cp = yy_c_buf_p;
  764.             yy_bp = yytext + YY_MORE_ADJ;
  765.             goto yy_match;
  766.  
  767.             case EOB_ACT_LAST_MATCH:
  768.             yy_c_buf_p =
  769.                 &yy_current_buffer->yy_ch_buf[yy_n_chars];
  770.  
  771.             yy_current_state = yy_get_previous_state();
  772.  
  773.             yy_cp = yy_c_buf_p;
  774.             yy_bp = yytext + YY_MORE_ADJ;
  775.             goto yy_find_action;
  776.             }
  777.         break;
  778.         }
  779.  
  780.         default:
  781. #ifdef FLEX_DEBUG
  782.         printf( "action # %d\n", yy_act );
  783. #endif
  784.         YY_FATAL_ERROR(
  785.             "fatal flex scanner internal error--no action found" );
  786.         }
  787.     }
  788.     }
  789.  
  790.  
  791. /* yy_get_next_buffer - try to read in a new buffer
  792.  *
  793.  * synopsis
  794.  *     int yy_get_next_buffer();
  795.  *     
  796.  * returns a code representing an action
  797.  *     EOB_ACT_LAST_MATCH - 
  798.  *     EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  799.  *     EOB_ACT_END_OF_FILE - end of file
  800.  */
  801.  
  802. static int yy_get_next_buffer()
  803.  
  804.     {
  805.     register YY_CHAR *dest = yy_current_buffer->yy_ch_buf;
  806.     register YY_CHAR *source = yytext - 1; /* copy prev. char, too */
  807.     register int number_to_move, i;
  808.     int ret_val;
  809.  
  810.     if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
  811.     YY_FATAL_ERROR(
  812.         "fatal flex scanner internal error--end of buffer missed" );
  813.  
  814.     /* try to read more data */
  815.  
  816.     /* first move last chars to start of buffer */
  817.     number_to_move = yy_c_buf_p - yytext;
  818.  
  819.     for ( i = 0; i < number_to_move; ++i )
  820.     *(dest++) = *(source++);
  821.  
  822.     if ( yy_current_buffer->yy_eof_status != EOF_NOT_SEEN )
  823.     /* don't do the read, it's not guaranteed to return an EOF,
  824.      * just force an EOF
  825.      */
  826.     yy_n_chars = 0;
  827.  
  828.     else
  829.     {
  830.     int num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1;
  831.  
  832.     if ( num_to_read > YY_READ_BUF_SIZE )
  833.         num_to_read = YY_READ_BUF_SIZE;
  834.  
  835.     else if ( num_to_read <= 0 )
  836.         YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" );
  837.  
  838.     /* read in more data */
  839.     YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
  840.           yy_n_chars, num_to_read );
  841.     }
  842.  
  843.     if ( yy_n_chars == 0 )
  844.     {
  845.     if ( number_to_move == 1 )
  846.         {
  847.         ret_val = EOB_ACT_END_OF_FILE;
  848.         yy_current_buffer->yy_eof_status = EOF_DONE;
  849.         }
  850.  
  851.     else
  852.         {
  853.         ret_val = EOB_ACT_LAST_MATCH;
  854.         yy_current_buffer->yy_eof_status = EOF_PENDING;
  855.         }
  856.     }
  857.  
  858.     else
  859.     ret_val = EOB_ACT_CONTINUE_SCAN;
  860.  
  861.     yy_n_chars += number_to_move;
  862.     yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
  863.     yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
  864.  
  865.     /* yytext begins at the second character in yy_ch_buf; the first
  866.      * character is the one which preceded it before reading in the latest
  867.      * buffer; it needs to be kept around in case it's a newline, so
  868.      * yy_get_previous_state() will have with '^' rules active
  869.      */
  870.  
  871.     yytext = &yy_current_buffer->yy_ch_buf[1];
  872.  
  873.     return ( ret_val );
  874.     }
  875.  
  876.  
  877. /* yy_get_previous_state - get the state just before the EOB char was reached
  878.  *
  879.  * synopsis
  880.  *     yy_state_type yy_get_previous_state();
  881.  */
  882.  
  883. static yy_state_type yy_get_previous_state()
  884.  
  885.     {
  886.     register yy_state_type yy_current_state;
  887.     register YY_CHAR *yy_cp;
  888.  
  889.     yy_current_state = yy_start;
  890.  
  891.     for ( yy_cp = yytext + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
  892.     {
  893.     register YY_CHAR yy_c = (*yy_cp ? yy_ec[*yy_cp] : 1);
  894.     if ( yy_accept[yy_current_state] )
  895.         {
  896.         yy_last_accepting_state = yy_current_state;
  897.         yy_last_accepting_cpos = yy_cp;
  898.         }
  899.     while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  900.         {
  901.         yy_current_state = yy_def[yy_current_state];
  902.         if ( yy_current_state >= 80 )
  903.         yy_c = yy_meta[yy_c];
  904.         }
  905.     yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
  906.     }
  907.  
  908.     return ( yy_current_state );
  909.     }
  910.  
  911.  
  912. /* yy_try_NUL_trans - try to make a transition on the NUL character
  913.  *
  914.  * synopsis
  915.  *     next_state = yy_try_NUL_trans( current_state );
  916.  */
  917.  
  918. #ifdef YY_USE_PROTOS
  919. static yy_state_type yy_try_NUL_trans( register yy_state_type yy_current_state )
  920. #else
  921. static yy_state_type yy_try_NUL_trans( yy_current_state )
  922. register yy_state_type yy_current_state;
  923. #endif
  924.  
  925.     {
  926.     register int yy_is_jam;
  927.     register YY_CHAR *yy_cp = yy_c_buf_p;
  928.  
  929.     register YY_CHAR yy_c = 1;
  930.     if ( yy_accept[yy_current_state] )
  931.     {
  932.     yy_last_accepting_state = yy_current_state;
  933.     yy_last_accepting_cpos = yy_cp;
  934.     }
  935.     while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  936.     {
  937.     yy_current_state = yy_def[yy_current_state];
  938.     if ( yy_current_state >= 80 )
  939.         yy_c = yy_meta[yy_c];
  940.     }
  941.     yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
  942.     yy_is_jam = (yy_current_state == 79);
  943.  
  944.     return ( yy_is_jam ? 0 : yy_current_state );
  945.     }
  946.  
  947.  
  948. #ifdef YY_USE_PROTOS
  949. static void yyunput( YY_CHAR c, register YY_CHAR *yy_bp )
  950. #else
  951. static void yyunput( c, yy_bp )
  952. YY_CHAR c;
  953. register YY_CHAR *yy_bp;
  954. #endif
  955.  
  956.     {
  957.     register YY_CHAR *yy_cp = yy_c_buf_p;
  958.  
  959.     /* undo effects of setting up yytext */
  960.     *yy_cp = yy_hold_char;
  961.  
  962.     if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
  963.     { /* need to shift things up to make room */
  964.     register int number_to_move = yy_n_chars + 2; /* +2 for EOB chars */
  965.     register YY_CHAR *dest =
  966.         &yy_current_buffer->yy_ch_buf[yy_current_buffer->yy_buf_size + 2];
  967.     register YY_CHAR *source =
  968.         &yy_current_buffer->yy_ch_buf[number_to_move];
  969.  
  970.     while ( source > yy_current_buffer->yy_ch_buf )
  971.         *--dest = *--source;
  972.  
  973.     yy_cp += dest - source;
  974.     yy_bp += dest - source;
  975.     yy_n_chars = yy_current_buffer->yy_buf_size;
  976.  
  977.     if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
  978.         YY_FATAL_ERROR( "flex scanner push-back overflow" );
  979.     }
  980.  
  981.     if ( yy_cp > yy_bp && yy_cp[-1] == '\n' )
  982.     yy_cp[-2] = '\n';
  983.  
  984.     *--yy_cp = c;
  985.  
  986.     /* note: the formal parameter *must* be called "yy_bp" for this
  987.      *       macro to now work correctly
  988.      */
  989.     YY_DO_BEFORE_ACTION; /* set up yytext again */
  990.     }
  991.  
  992.  
  993. #ifdef __cplusplus
  994. static int yyinput()
  995. #else
  996. static int input()
  997. #endif
  998.  
  999.     {
  1000.     int c;
  1001.     YY_CHAR *yy_cp = yy_c_buf_p;
  1002.  
  1003.     *yy_cp = yy_hold_char;
  1004.  
  1005.     if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
  1006.     {
  1007.     /* yy_c_buf_p now points to the character we want to return.
  1008.      * If this occurs *before* the EOB characters, then it's a
  1009.      * valid NUL; if not, then we've hit the end of the buffer.
  1010.      */
  1011.     if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
  1012.         /* this was really a NUL */
  1013.         *yy_c_buf_p = '\0';
  1014.  
  1015.     else
  1016.         { /* need more input */
  1017.         yytext = yy_c_buf_p;
  1018.         ++yy_c_buf_p;
  1019.  
  1020.         switch ( yy_get_next_buffer() )
  1021.         {
  1022.         case EOB_ACT_END_OF_FILE:
  1023.             {
  1024.             if ( yywrap() )
  1025.             {
  1026.             yy_c_buf_p = yytext + YY_MORE_ADJ;
  1027.             return ( EOF );
  1028.             }
  1029.  
  1030.             YY_NEW_FILE;
  1031.  
  1032. #ifdef __cplusplus
  1033.             return ( yyinput() );
  1034. #else
  1035.             return ( input() );
  1036. #endif
  1037.             }
  1038.             break;
  1039.  
  1040.         case EOB_ACT_CONTINUE_SCAN:
  1041.             yy_c_buf_p = yytext + YY_MORE_ADJ;
  1042.             break;
  1043.  
  1044.         case EOB_ACT_LAST_MATCH:
  1045. #ifdef __cplusplus
  1046.             YY_FATAL_ERROR( "unexpected last match in yyinput()" );
  1047. #else
  1048.             YY_FATAL_ERROR( "unexpected last match in input()" );
  1049. #endif
  1050.         }
  1051.         }
  1052.     }
  1053.  
  1054.     c = *yy_c_buf_p;
  1055.     yy_hold_char = *++yy_c_buf_p;
  1056.  
  1057.     return ( c );
  1058.     }
  1059.  
  1060.  
  1061. #ifdef YY_USE_PROTOS
  1062. void yyrestart( FILE *input_file )
  1063. #else
  1064. void yyrestart( input_file )
  1065. FILE *input_file;
  1066. #endif
  1067.  
  1068.     {
  1069.     yy_init_buffer( yy_current_buffer, input_file );
  1070.     yy_load_buffer_state();
  1071.     }
  1072.  
  1073.  
  1074. #ifdef YY_USE_PROTOS
  1075. void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
  1076. #else
  1077. void yy_switch_to_buffer( new_buffer )
  1078. YY_BUFFER_STATE new_buffer;
  1079. #endif
  1080.  
  1081.     {
  1082.     if ( yy_current_buffer == new_buffer )
  1083.     return;
  1084.  
  1085.     if ( yy_current_buffer )
  1086.     {
  1087.     /* flush out information for old buffer */
  1088.     *yy_c_buf_p = yy_hold_char;
  1089.     yy_current_buffer->yy_buf_pos = yy_c_buf_p;
  1090.     yy_current_buffer->yy_n_chars = yy_n_chars;
  1091.     }
  1092.  
  1093.     yy_current_buffer = new_buffer;
  1094.     yy_load_buffer_state();
  1095.  
  1096.     /* we don't actually know whether we did this switch during
  1097.      * EOF (yywrap()) processing, but the only time this flag
  1098.      * is looked at is after yywrap() is called, so it's safe
  1099.      * to go ahead and always set it.
  1100.      */
  1101.     yy_did_buffer_switch_on_eof = 1;
  1102.     }
  1103.  
  1104.  
  1105. #ifdef YY_USE_PROTOS
  1106. void yy_load_buffer_state( void )
  1107. #else
  1108. void yy_load_buffer_state()
  1109. #endif
  1110.  
  1111.     {
  1112.     yy_n_chars = yy_current_buffer->yy_n_chars;
  1113.     yytext = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
  1114.     yyin = yy_current_buffer->yy_input_file;
  1115.     yy_hold_char = *yy_c_buf_p;
  1116.     }
  1117.  
  1118.  
  1119. #ifdef YY_USE_PROTOS
  1120. YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
  1121. #else
  1122. YY_BUFFER_STATE yy_create_buffer( file, size )
  1123. FILE *file;
  1124. int size;
  1125. #endif
  1126.  
  1127.     {
  1128.     YY_BUFFER_STATE b;
  1129.  
  1130.     b = (YY_BUFFER_STATE) malloc( sizeof( struct yy_buffer_state ) );
  1131.  
  1132.     if ( ! b )
  1133.     YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1134.  
  1135.     b->yy_buf_size = size;
  1136.  
  1137.     /* yy_ch_buf has to be 2 characters longer than the size given because
  1138.      * we need to put in 2 end-of-buffer characters.
  1139.      */
  1140.     b->yy_ch_buf = (YY_CHAR *) malloc( (unsigned) (b->yy_buf_size + 2) );
  1141.  
  1142.     if ( ! b->yy_ch_buf )
  1143.     YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1144.  
  1145.     yy_init_buffer( b, file );
  1146.  
  1147.     return ( b );
  1148.     }
  1149.  
  1150.  
  1151. #ifdef YY_USE_PROTOS
  1152. void yy_delete_buffer( YY_BUFFER_STATE b )
  1153. #else
  1154. void yy_delete_buffer( b )
  1155. YY_BUFFER_STATE b;
  1156. #endif
  1157.  
  1158.     {
  1159.     if ( b == yy_current_buffer )
  1160.     yy_current_buffer = (YY_BUFFER_STATE) 0;
  1161.  
  1162.     free( (char *) b->yy_ch_buf );
  1163.     free( (char *) b );
  1164.     }
  1165.  
  1166.  
  1167. #ifdef YY_USE_PROTOS
  1168. void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
  1169. #else
  1170. void yy_init_buffer( b, file )
  1171. YY_BUFFER_STATE b;
  1172. FILE *file;
  1173. #endif
  1174.  
  1175.     {
  1176.     b->yy_input_file = file;
  1177.  
  1178.     /* we put in the '\n' and start reading from [1] so that an
  1179.      * initial match-at-newline will be true.
  1180.      */
  1181.  
  1182.     b->yy_ch_buf[0] = '\n';
  1183.     b->yy_n_chars = 1;
  1184.  
  1185.     /* we always need two end-of-buffer characters.  The first causes
  1186.      * a transition to the end-of-buffer state.  The second causes
  1187.      * a jam in that state.
  1188.      */
  1189.     b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
  1190.     b->yy_ch_buf[2] = YY_END_OF_BUFFER_CHAR;
  1191.  
  1192.     b->yy_buf_pos = &b->yy_ch_buf[1];
  1193.  
  1194.     b->yy_eof_status = EOF_NOT_SEEN;
  1195.     }
  1196. # line 78 "lexer.l"
  1197.  
  1198.  
  1199. #ifdef FLEX_SCANNER
  1200. #undef yywrap
  1201. #endif
  1202. #ifdef __STDC__
  1203. int yywrap(void)
  1204. #else
  1205. int yywrap()
  1206. #endif
  1207. {
  1208.         return(1);
  1209. }
  1210.  
  1211.  
  1212. /* this procedure store comments in the text array commbuf
  1213.    Escape char are allowed for putting the end-of-comment symbol
  1214.    in the buffer
  1215.    */
  1216. #ifdef __STDC__
  1217. static char * comment(int closing)
  1218. #else
  1219. static char * comment(closing)
  1220.      char closing;
  1221. #endif
  1222. {
  1223.   register char c;
  1224.   register int i=0;
  1225.  
  1226.   while ( ((c = input()) != closing)  && (c != 0) && (c != EOF)) {
  1227.     commbuf[i] = c;
  1228.     if (i <LARGE_BUF) i++ ;
  1229.     
  1230.     if (c == '\\') {
  1231.       c = input() ;
  1232.       if (c == closing)
  1233.     commbuf[i-1] = c;
  1234.       else
  1235.     unput(c);
  1236.     }
  1237.   }
  1238.   commbuf[i] = '\0' ;
  1239.   return(commbuf);
  1240. }
  1241.  
  1242. #ifdef __STDC__
  1243. static void count(void)
  1244. #else
  1245. static void count()
  1246. #endif
  1247. {
  1248.   register int i;
  1249.   register int k;
  1250.  
  1251.   for (i = 0; yytext[i] != '\0'; i++) {
  1252.     if (yytext[i] == '\n') {
  1253.       column = 0;
  1254.       for (k = 0 ; k< NCURLINE; k++) /*PANDORE*/
  1255.         curline[k] = ' '; /*PANDORE*/
  1256.       lineno++;
  1257.     }
  1258.     else if (yytext[i] == '\t') {
  1259.       column += 8 - (column % 8);
  1260.       curline[column] = yytext[i];
  1261.     } else {
  1262.       column++;
  1263.       curline[column] = yytext[i];
  1264.     }
  1265.     curline[column+1]= '\0' ;
  1266.   }
  1267.   /*ECHO;*/
  1268. }
  1269.