OpenCOBOL 1.1pre-rel
pplex.c
Go to the documentation of this file.
00001 #define yy_create_buffer pp_create_buffer
00002 #define yy_delete_buffer pp_delete_buffer
00003 #define yy_scan_buffer pp_scan_buffer
00004 #define yy_scan_string pp_scan_string
00005 #define yy_scan_bytes pp_scan_bytes
00006 #define yy_flex_debug pp_flex_debug
00007 #define yy_init_buffer pp_init_buffer
00008 #define yy_flush_buffer pp_flush_buffer
00009 #define yy_load_buffer_state pp_load_buffer_state
00010 #define yy_switch_to_buffer pp_switch_to_buffer
00011 #define yyin ppin
00012 #define yyleng ppleng
00013 #define yylex pplex
00014 #define yyout ppout
00015 #define yyrestart pprestart
00016 #define yytext pptext
00017 
00018 #line 19 "pplex.c"
00019 /* A lexical scanner generated by flex */
00020 
00021 /* Scanner skeleton version:
00022  * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
00023  */
00024 
00025 #define FLEX_SCANNER
00026 #define YY_FLEX_MAJOR_VERSION 2
00027 #define YY_FLEX_MINOR_VERSION 5
00028 
00029 #include <stdio.h>
00030 
00031 
00032 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
00033 #ifdef c_plusplus
00034 #ifndef __cplusplus
00035 #define __cplusplus
00036 #endif
00037 #endif
00038 
00039 
00040 #ifdef __cplusplus
00041 
00042 #include <stdlib.h>
00043 #include <unistd.h>
00044 
00045 /* Use prototypes in function declarations. */
00046 #define YY_USE_PROTOS
00047 
00048 /* The "const" storage-class-modifier is valid. */
00049 #define YY_USE_CONST
00050 
00051 #else   /* ! __cplusplus */
00052 
00053 #if __STDC__
00054 
00055 #define YY_USE_PROTOS
00056 #define YY_USE_CONST
00057 
00058 #endif  /* __STDC__ */
00059 #endif  /* ! __cplusplus */
00060 
00061 #ifdef __TURBOC__
00062  #pragma warn -rch
00063  #pragma warn -use
00064 #include <io.h>
00065 #include <stdlib.h>
00066 #define YY_USE_CONST
00067 #define YY_USE_PROTOS
00068 #endif
00069 
00070 #ifdef YY_USE_CONST
00071 #define yyconst const
00072 #else
00073 #define yyconst
00074 #endif
00075 
00076 
00077 #ifdef YY_USE_PROTOS
00078 #define YY_PROTO(proto) proto
00079 #else
00080 #define YY_PROTO(proto) ()
00081 #endif
00082 
00083 /* Returned upon end-of-file. */
00084 #define YY_NULL 0
00085 
00086 /* Promotes a possibly negative, possibly signed char to an unsigned
00087  * integer for use as an array index.  If the signed char is negative,
00088  * we want to instead treat it as an 8-bit unsigned char, hence the
00089  * double cast.
00090  */
00091 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
00092 
00093 /* Enter a start condition.  This macro really ought to take a parameter,
00094  * but we do it the disgusting crufty way forced on us by the ()-less
00095  * definition of BEGIN.
00096  */
00097 #define BEGIN yy_start = 1 + 2 *
00098 
00099 /* Translate the current start state into a value that can be later handed
00100  * to BEGIN to return to the state.  The YYSTATE alias is for lex
00101  * compatibility.
00102  */
00103 #define YY_START ((yy_start - 1) / 2)
00104 #define YYSTATE YY_START
00105 
00106 /* Action number for EOF rule of a given start state. */
00107 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
00108 
00109 /* Special action meaning "start processing a new file". */
00110 #define YY_NEW_FILE yyrestart( yyin )
00111 
00112 #define YY_END_OF_BUFFER_CHAR 0
00113 
00114 /* Size of default input buffer. */
00115 #define YY_BUF_SIZE 16384
00116 
00117 typedef struct yy_buffer_state *YY_BUFFER_STATE;
00118 
00119 extern int yyleng;
00120 extern FILE *yyin, *yyout;
00121 
00122 #define EOB_ACT_CONTINUE_SCAN 0
00123 #define EOB_ACT_END_OF_FILE 1
00124 #define EOB_ACT_LAST_MATCH 2
00125 
00126 /* The funky do-while in the following #define is used to turn the definition
00127  * int a single C statement (which needs a semi-colon terminator).  This
00128  * avoids problems with code like:
00129  *
00130  *      if ( condition_holds )
00131  *              yyless( 5 );
00132  *      else
00133  *              do_something_else();
00134  *
00135  * Prior to using the do-while the compiler would get upset at the
00136  * "else" because it interpreted the "if" statement as being all
00137  * done when it reached the ';' after the yyless() call.
00138  */
00139 
00140 /* Return all but the first 'n' matched characters back to the input stream. */
00141 
00142 #define yyless(n) \
00143         do \
00144                 { \
00145                 /* Undo effects of setting up yytext. */ \
00146                 *yy_cp = yy_hold_char; \
00147                 YY_RESTORE_YY_MORE_OFFSET \
00148                 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
00149                 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
00150                 } \
00151         while ( 0 )
00152 
00153 #define unput(c) yyunput( c, yytext_ptr )
00154 
00155 /* The following is because we cannot portably get our hands on size_t
00156  * (without autoconf's help, which isn't available because we want
00157  * flex-generated scanners to compile on their own).
00158  */
00159 typedef unsigned int yy_size_t;
00160 
00161 
00162 struct yy_buffer_state
00163         {
00164         FILE *yy_input_file;
00165 
00166         char *yy_ch_buf;                /* input buffer */
00167         char *yy_buf_pos;               /* current position in input buffer */
00168 
00169         /* Size of input buffer in bytes, not including room for EOB
00170          * characters.
00171          */
00172         yy_size_t yy_buf_size;
00173 
00174         /* Number of characters read into yy_ch_buf, not including EOB
00175          * characters.
00176          */
00177         int yy_n_chars;
00178 
00179         /* Whether we "own" the buffer - i.e., we know we created it,
00180          * and can realloc() it to grow it, and should free() it to
00181          * delete it.
00182          */
00183         int yy_is_our_buffer;
00184 
00185         /* Whether this is an "interactive" input source; if so, and
00186          * if we're using stdio for input, then we want to use getc()
00187          * instead of fread(), to make sure we stop fetching input after
00188          * each newline.
00189          */
00190         int yy_is_interactive;
00191 
00192         /* Whether we're considered to be at the beginning of a line.
00193          * If so, '^' rules will be active on the next match, otherwise
00194          * not.
00195          */
00196         int yy_at_bol;
00197 
00198         /* Whether to try to fill the input buffer when we reach the
00199          * end of it.
00200          */
00201         int yy_fill_buffer;
00202 
00203         int yy_buffer_status;
00204 #define YY_BUFFER_NEW 0
00205 #define YY_BUFFER_NORMAL 1
00206         /* When an EOF's been seen but there's still some text to process
00207          * then we mark the buffer as YY_EOF_PENDING, to indicate that we
00208          * shouldn't try reading from the input source any more.  We might
00209          * still have a bunch of tokens to match, though, because of
00210          * possible backing-up.
00211          *
00212          * When we actually see the EOF, we change the status to "new"
00213          * (via yyrestart()), so that the user can continue scanning by
00214          * just pointing yyin at a new input file.
00215          */
00216 #define YY_BUFFER_EOF_PENDING 2
00217         };
00218 
00219 static YY_BUFFER_STATE yy_current_buffer = 0;
00220 
00221 /* We provide macros for accessing buffer states in case in the
00222  * future we want to put the buffer states in a more general
00223  * "scanner state".
00224  */
00225 #define YY_CURRENT_BUFFER yy_current_buffer
00226 
00227 
00228 /* yy_hold_char holds the character lost when yytext is formed. */
00229 static char yy_hold_char;
00230 
00231 static int yy_n_chars;          /* number of characters read into yy_ch_buf */
00232 
00233 
00234 int yyleng;
00235 
00236 /* Points to current character in buffer. */
00237 static char *yy_c_buf_p = (char *) 0;
00238 static int yy_init = 1;         /* whether we need to initialize */
00239 static int yy_start = 0;        /* start state number */
00240 
00241 /* Flag which is used to allow yywrap()'s to do buffer switches
00242  * instead of setting up a fresh yyin.  A bit of a hack ...
00243  */
00244 static int yy_did_buffer_switch_on_eof;
00245 
00246 void yyrestart YY_PROTO(( FILE *input_file ));
00247 
00248 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
00249 void yy_load_buffer_state YY_PROTO(( void ));
00250 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
00251 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
00252 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
00253 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
00254 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
00255 
00256 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
00257 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
00258 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
00259 
00260 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
00261 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
00262 static void yy_flex_free YY_PROTO(( void * ));
00263 
00264 #define yy_new_buffer yy_create_buffer
00265 
00266 #define yy_set_interactive(is_interactive) \
00267         { \
00268         if ( ! yy_current_buffer ) \
00269                 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
00270         yy_current_buffer->yy_is_interactive = is_interactive; \
00271         }
00272 
00273 #define yy_set_bol(at_bol) \
00274         { \
00275         if ( ! yy_current_buffer ) \
00276                 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
00277         yy_current_buffer->yy_at_bol = at_bol; \
00278         }
00279 
00280 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
00281 
00282 
00283 #define yywrap() 1
00284 #define YY_SKIP_YYWRAP
00285 typedef unsigned char YY_CHAR;
00286 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
00287 typedef int yy_state_type;
00288 extern char *yytext;
00289 #define yytext_ptr yytext
00290 
00291 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
00292 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
00293 static int yy_get_next_buffer YY_PROTO(( void ));
00294 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
00295 
00296 /* Done after the current pattern has been matched and before the
00297  * corresponding action - sets up yytext.
00298  */
00299 #define YY_DO_BEFORE_ACTION \
00300         yytext_ptr = yy_bp; \
00301         yyleng = (int) (yy_cp - yy_bp); \
00302         yy_hold_char = *yy_cp; \
00303         *yy_cp = '\0'; \
00304         yy_c_buf_p = yy_cp;
00305 
00306 #define YY_NUM_RULES 54
00307 #define YY_END_OF_BUFFER 55
00308 static yyconst short int yy_accept[240] =
00309     {   0,
00310         0,    0,    6,    6,    0,    0,    0,    0,   55,   53,
00311        45,   46,   53,   53,   48,   49,   53,   53,   53,   50,
00312        53,   50,   53,   50,   50,   50,   50,   50,   50,   50,
00313        50,   50,    2,    3,    6,    5,    6,    2,    3,   26,
00314        10,   11,   26,   26,   14,   15,   26,   26,   26,   23,
00315        12,   23,   26,   26,   23,   23,   23,   23,   23,   23,
00316        23,    2,    3,   33,   27,   28,   33,   33,   33,   33,
00317        33,   30,   33,   30,   33,   33,   30,    2,    3,   46,
00318         0,   52,    0,    1,    0,   51,   45,   47,   50,   50,
00319        46,   50,   50,   50,   50,   50,   50,   50,   50,   50,
00320 
00321         2,    1,    3,    6,    1,    2,    1,    3,   11,    0,
00322        25,    0,    0,   24,   10,   23,   23,   13,   16,   17,
00323        18,   23,   23,   23,   28,    0,   32,    0,    0,   31,
00324        27,   30,   30,   29,    1,   50,   50,   50,   50,   50,
00325        50,   50,   50,   50,   50,   50,    1,    1,    1,   19,
00326        23,   23,   23,   50,    7,   50,   50,   50,   50,   50,
00327        50,   50,   50,   50,   23,   23,   23,   50,   50,   41,
00328        50,   50,   50,   50,   50,   50,   42,   43,   44,   23,
00329        23,   23,   34,   50,   50,   50,   41,   50,   50,   50,
00330        50,   50,   50,   42,   43,   44,   23,   23,   23,   50,
00331 
00332        50,   50,    8,   50,    4,   39,    9,   50,   23,   23,
00333        23,   50,   50,   50,   50,   40,   21,   23,   20,   50,
00334        50,   50,   50,   22,   50,   50,   50,   50,   50,   50,
00335        50,   50,   50,   50,   35,   38,   37,   36,    0
00336     } ;
00337 
00338 static yyconst int yy_ec[256] =
00339     {   0,
00340         1,    1,    1,    1,    1,    1,    1,    1,    1,    2,
00341         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00342         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00343         1,    3,    1,    4,    1,    1,    1,    1,    5,    6,
00344         7,    8,    9,   10,   11,   12,   13,   14,   15,   16,
00345        17,   14,   14,   14,   14,   14,   14,    1,   18,    1,
00346        19,   20,    1,    1,   22,   23,   24,   25,   26,   27,
00347        28,   29,   30,   31,   32,   33,   34,   35,   36,   37,
00348        21,   38,   39,   40,   41,   21,   42,   21,   43,   21,
00349         1,    1,    1,    1,   21,    1,   22,   23,   24,   25,
00350 
00351        26,   27,   28,   29,   30,   31,   32,   33,   34,   35,
00352        36,   37,   21,   38,   39,   40,   41,   21,   42,   21,
00353        43,   21,    1,    1,    1,    1,    1,    1,    1,    1,
00354         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00355         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00356         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00357         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00358         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00359         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00360         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00361 
00362         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00363         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00364         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00365         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00366         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00367         1,    1,    1,    1,    1
00368     } ;
00369 
00370 static yyconst int yy_meta[44] =
00371     {   0,
00372         1,    2,    1,    1,    1,    1,    1,    1,    1,    3,
00373         3,    3,    1,    3,    3,    3,    3,    1,    1,    1,
00374         3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
00375         3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
00376         3,    3,    3
00377     } ;
00378 
00379 static yyconst short int yy_base[259] =
00380     {   0,
00381         0,   36,   43,   44,   57,   40,  100,   42,  504,  756,
00382       756,  485,  476,  472,  756,  756,  446,  134,  150,  158,
00383       166,  174,  152,   44,  146,  135,  147,  167,  182,  183,
00384       187,  190,  439,    0,    0,  756,  432,  420,    0,  756,
00385       756,  429,  423,  402,  756,  756,  383,  191,  221,  229,
00386       237,  245,  207,  378,  151,  215,  230,  202,  218,  208,
00387       238,  373,    0,  756,  756,  358,  356,  352,  333,  254,
00388       278,  286,  294,  302,  270,  296,  264,  287,    0,  284,
00389       282,  756,  273,    0,  310,  318,  756,  264,  265,    0,
00390       260,  273,  311,  319,  279,  326,  327,  330,  331,  339,
00391 
00392         0,    0,    0,    0,    0,    0,    0,    0,  229,  222,
00393       756,  214,  356,  364,  756,  272,    0,  756,  287,  334,
00394       335,  365,  346,  372,  212,  207,  756,  199,  375,  384,
00395       756,  342,    0,  756,    0,  376,  392,  396,  400,  401,
00396       404,  405,  408,  409,  413,  416,    0,    0,    0,  421,
00397       426,  427,  431,  435,  436,  439,  445,  446,  452,  453,
00398       457,  460,  463,  474,  466,  471,  482,  486,  487,  490,
00399       493,  497,  498,  502,  503,  513,  507,  516,  521,  526,
00400       529,  532,  535,  536,  539,  540,  756,  545,  549,  550,
00401       553,  554,  557,  756,  756,  756,  558,  564,  567,  571,
00402 
00403       574,  578,  575,  588,  591,  592,  597,  601,  602,  605,
00404       606,  609,  612,  613,  616,  617,  621,  622,  625,  629,
00405       637,  626,  642,  645,  648,  653,  658,  657,  661,  664,
00406       665,  668,  676,  679,  682,  685,  686,  695,  756,  707,
00407       710,  713,  193,  716,  719,  722,  725,  728,  731,  734,
00408       182,  737,  740,   44,  743,  746,  749,  752
00409     } ;
00410 
00411 static yyconst short int yy_def[259] =
00412     {   0,
00413       239,    1,  240,  240,  239,    5,  239,    7,  239,  239,
00414       239,  239,  241,  242,  239,  239,  239,  239,  239,  243,
00415       239,  243,  239,  243,  243,  243,  243,  243,  243,  243,
00416       243,  243,  244,  245,  246,  239,  246,  247,  248,  239,
00417       239,  239,  249,  250,  239,  239,  239,  239,  239,  251,
00418       239,  251,  239,  239,  251,  251,  251,  251,  251,  251,
00419       251,  244,  245,  239,  239,  239,  252,  253,  239,  239,
00420       239,  254,  239,  254,  239,  239,  254,  244,  245,  239,
00421       241,  239,  242,  255,  239,  239,  239,  239,  243,   22,
00422       239,  243,  243,  243,  243,  243,  243,  243,  243,  243,
00423 
00424       244,  256,  245,  246,  257,  247,  258,  248,  239,  249,
00425       239,  250,  239,  239,  239,  251,   52,  239,  251,  251,
00426       251,  251,  251,  251,  239,  252,  239,  253,  239,  239,
00427       239,  254,   74,  239,  255,  243,  243,  243,  243,  243,
00428       243,  243,  243,  243,  243,  243,  256,  257,  258,  251,
00429       251,  251,  251,  243,  243,  243,  243,  243,  243,  243,
00430       243,  243,  243,  243,  251,  251,  251,  243,  243,  243,
00431       243,  243,  243,  243,  243,  243,  243,  243,  243,  251,
00432       251,  251,  243,  243,  243,  243,  239,  243,  243,  243,
00433       243,  243,  243,  239,  239,  239,  251,  251,  251,  243,
00434 
00435       243,  243,  243,  243,  243,  243,  243,  243,  251,  251,
00436       251,  243,  243,  243,  243,  243,  251,  251,  251,  243,
00437       243,  243,  243,  251,  243,  243,  243,  243,  243,  243,
00438       243,  243,  243,  243,  243,  243,  243,  243,    0,  239,
00439       239,  239,  239,  239,  239,  239,  239,  239,  239,  239,
00440       239,  239,  239,  239,  239,  239,  239,  239
00441     } ;
00442 
00443 static yyconst short int yy_nxt[800] =
00444     {   0,
00445        10,   11,   12,   13,   14,   15,   16,   17,   18,   19,
00446        20,   21,   10,   22,   22,   22,   22,   23,   10,   10,
00447        24,   25,   24,   26,   27,   28,   24,   24,   24,   29,
00448        24,   24,   24,   24,   24,   24,   30,   31,   32,   24,
00449        24,   24,   24,   33,   36,   36,  132,   62,   34,   78,
00450        37,   38,   63,  239,   79,  239,   39,   40,   41,   42,
00451        43,   44,   45,   46,   47,   48,   49,   50,   51,   40,
00452        52,   52,   52,   52,   53,   54,   40,   55,   55,   56,
00453        55,   55,   55,   55,   55,   55,   57,   55,   55,   55,
00454        55,   55,   58,   59,   60,   61,   55,   55,   55,   55,
00455 
00456        64,   65,   66,   67,   68,   64,   64,   69,   70,   71,
00457        72,   73,   64,   74,   74,   74,   74,   75,   76,   64,
00458        77,   77,   77,   77,   77,   77,   77,   77,   77,   77,
00459        77,   77,   77,   77,   77,   77,   77,   77,   77,   77,
00460        77,   77,   77,   85,  239,   85,  239,   86,   86,   86,
00461        86,   87,   88,   87,   91,  239,  239,  239,  239,   85,
00462       239,   85,  239,   86,   86,   86,   86,   85,   94,   85,
00463        93,   90,   90,   90,   90,   85,  239,   85,  239,   86,
00464        86,   86,   86,   85,  116,   85,   92,   90,   90,   90,
00465        90,  239,  239,  239,  239,   89,  239,   95,  239,  239,
00466 
00467       113,  239,  113,  127,  114,  114,  114,  114,  115,  109,
00468       127,  239,   98,  239,  125,   99,   96,  239,  111,  239,
00469        97,  100,  115,  109,  239,  111,  239,  239,  121,  239,
00470       113,  109,  113,  123,  114,  114,  114,  114,  113,  239,
00471       113,  239,  117,  117,  117,  117,  113,  239,  113,  239,
00472       114,  114,  114,  114,  113,  122,  113,  119,  117,  117,
00473       117,  117,   91,  129,  120,  129,   88,  130,  130,  130,
00474       130,  131,  125,  239,  239,  239,  239,   82,  124,  131,
00475       125,  239,  239,  239,  239,   82,   80,  129,  239,  129,
00476       239,  130,  130,  130,  130,  129,  239,  129,  239,  133,
00477 
00478       133,  133,  133,  129,  139,  129,  102,  130,  130,  130,
00479       130,  129,  136,  129,  134,  133,  133,  133,  133,   85,
00480       239,   85,  239,   86,   86,   86,   86,   85,  239,   85,
00481       239,   86,   86,   86,   86,  239,  239,  239,  239,  239,
00482       239,  239,  239,  239,  239,  239,  239,  137,  239,  140,
00483       239,  239,   84,  239,  145,  239,  127,  239,  138,  127,
00484       125,  150,  142,  143,  141,  113,  144,  113,  146,  114,
00485       114,  114,  114,  113,  239,  113,  239,  114,  114,  114,
00486       114,  239,  152,  239,  129,  239,  129,  239,  130,  130,
00487       130,  130,  102,  129,  151,  129,  118,  130,  130,  130,
00488 
00489       130,  239,   84,  239,  154,  239,  111,  239,  153,  239,
00490       239,  239,  239,  239,  239,  239,  239,  239,  239,  239,
00491       239,  156,  239,  157,  239,  239,  111,  239,  160,  161,
00492       239,  109,  239,  158,  155,  239,  239,  239,  239,  107,
00493       239,  162,  239,  159,  239,  239,  239,  239,  239,  169,
00494       239,  105,  164,  163,  239,  239,  239,  239,  102,  166,
00495       165,  239,  239,  239,  239,   84,  239,  167,  239,  239,
00496       168,  239,  239,  172,  239,  239,   82,  239,  173,   82,
00497       239,  175,  239,  239,  170,  239,  171,   80,  177,  178,
00498       179,  239,  181,  239,  174,  239,  239,  239,  239,  239,
00499 
00500       176,  187,  239,  239,  239,  180,  239,  239,  239,  239,
00501       184,  239,  239,  239,  239,  239,  239,  188,  194,  182,
00502       185,  239,  239,  183,  239,  239,  192,  195,  186,  189,
00503       239,  239,  196,  191,  239,  239,  190,  239,  239,  239,
00504       239,  239,  193,  239,  239,  239,  239,  239,  239,  239,
00505       239,  239,  198,  239,  239,  197,  239,  199,  239,  239,
00506       239,  239,  239,  239,  239,  239,  239,  239,  239,  239,
00507       203,  200,  239,  239,  201,  239,  239,  202,  239,  207,
00508       239,  204,  239,  239,  239,  239,  239,  239,  205,  239,
00509       239,  206,  209,  210,  239,  239,  208,  239,  213,  239,
00510 
00511       239,  239,  239,  239,  212,  211,  239,  214,  239,  215,
00512       239,  239,  239,  239,  239,  239,  239,  239,  239,  239,
00513       239,  239,  239,  239,  239,  239,  239,  239,  239,  217,
00514       239,  239,  239,  239,  239,  239,  239,  239,  239,  218,
00515       239,  221,  239,  216,  219,  220,  239,  239,  239,  224,
00516       239,  239,  222,  239,  239,  223,  239,  239,  225,  239,
00517       239,  239,  239,  226,  239,  227,  239,  239,  239,  239,
00518       239,  228,  239,  239,  239,  239,  239,  239,  239,  239,
00519       229,  239,  230,  231,  239,  239,  233,  239,  239,  234,
00520       239,  239,  232,  239,  239,  239,  239,  239,  239,  235,
00521 
00522       237,  239,  236,  238,  239,  239,  239,   35,   35,   35,
00523        81,  239,   81,   83,  239,   83,  101,  239,  101,  103,
00524       239,  103,  104,  239,  104,  106,  239,  106,  108,  239,
00525       108,  110,  239,  110,  112,  239,  112,  126,  239,  126,
00526       128,  239,  128,  135,  239,  135,  147,  239,  147,  148,
00527       239,  148,  149,  239,  149,    9,  239,  239,  239,  239,
00528       239,  239,  239,  239,  239,  239,  239,  239,  239,  239,
00529       239,  239,  239,  239,  239,  239,  239,  239,  239,  239,
00530       239,  239,  239,  239,  239,  239,  239,  239,  239,  239,
00531       239,  239,  239,  239,  239,  239,  239,  239,  239
00532 
00533     } ;
00534 
00535 static yyconst short int yy_chk[800] =
00536     {   0,
00537         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00538         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00539         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00540         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00541         1,    1,    1,    2,    3,    4,  254,    6,    2,    8,
00542         3,    4,    6,   24,    8,   24,    4,    5,    5,    5,
00543         5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
00544         5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
00545         5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
00546         5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
00547 
00548         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
00549         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
00550         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
00551         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
00552         7,    7,    7,   18,   26,   18,   26,   18,   18,   18,
00553        18,   19,   19,   23,   23,   25,   27,   25,   27,   19,
00554        55,   19,   55,   19,   19,   19,   19,   20,   27,   20,
00555        26,   20,   20,   20,   20,   21,   28,   21,   28,   21,
00556        21,   21,   21,   22,  251,   22,   25,   22,   22,   22,
00557        22,   29,   30,   29,   30,  243,   31,   28,   31,   32,
00558 
00559        48,   32,   48,  128,   48,   48,   48,   48,   53,   53,
00560       126,   58,   31,   58,  125,   32,   29,   60,  112,   60,
00561        30,   32,   49,   49,   56,  110,   56,   59,   58,   59,
00562        49,  109,   49,   60,   49,   49,   49,   49,   50,   57,
00563        50,   57,   50,   50,   50,   50,   51,   61,   51,   61,
00564        51,   51,   51,   51,   52,   59,   52,   56,   52,   52,
00565        52,   52,   91,   70,   57,   70,   88,   70,   70,   70,
00566        70,   75,   75,   77,   89,   77,   89,   83,   61,   71,
00567        71,  116,   92,  116,   92,   81,   80,   71,   95,   71,
00568        95,   71,   71,   71,   71,   72,  119,   72,  119,   72,
00569 
00570        72,   72,   72,   73,   95,   73,   78,   73,   73,   73,
00571        73,   74,   92,   74,   76,   74,   74,   74,   74,   85,
00572        93,   85,   93,   85,   85,   85,   85,   86,   94,   86,
00573        94,   86,   86,   86,   86,   96,   97,   96,   97,   98,
00574        99,   98,   99,  120,  121,  120,  121,   93,  100,   96,
00575       100,  132,   69,  132,   99,  123,   68,  123,   94,   67,
00576        66,  121,   97,   98,   96,  113,   98,  113,  100,  113,
00577       113,  113,  113,  114,  122,  114,  122,  114,  114,  114,
00578       114,  124,  123,  124,  129,  136,  129,  136,  129,  129,
00579       129,  129,   62,  130,  122,  130,   54,  130,  130,  130,
00580 
00581       130,  137,   47,  137,  136,  138,   44,  138,  124,  139,
00582       140,  139,  140,  141,  142,  141,  142,  143,  144,  143,
00583       144,  138,  145,  139,  145,  146,   43,  146,  142,  143,
00584       150,   42,  150,  140,  137,  151,  152,  151,  152,   38,
00585       153,  144,  153,  141,  154,  155,  154,  155,  156,  156,
00586       156,   37,  146,  145,  157,  158,  157,  158,   33,  152,
00587       151,  159,  160,  159,  160,   17,  161,  153,  161,  162,
00588       154,  162,  163,  159,  163,  165,   14,  165,  160,   13,
00589       166,  162,  166,  164,  157,  164,  158,   12,  164,  164,
00590       164,  167,  166,  167,  161,  168,  169,  168,  169,  170,
00591 
00592       163,  170,  171,    9,  171,  165,  172,  173,  172,  173,
00593       169,  174,  175,  174,  175,    0,  177,  171,  177,  167,
00594       169,    0,  176,  168,  176,  178,  175,  178,  169,  172,
00595       179,    0,  179,  174,    0,  180,  173,  180,  181,    0,
00596       181,  182,  176,  182,  183,  184,  183,  184,  185,  186,
00597       185,  186,  181,    0,  188,  180,  188,  182,  189,  190,
00598       189,  190,  191,  192,  191,  192,  193,  197,  193,  197,
00599       188,  184,    0,  198,  185,  198,  199,  186,  199,  192,
00600       200,  189,  200,  201,  203,  201,  203,  202,  190,  202,
00601         0,  191,  197,  198,    0,    0,  193,  204,  201,  204,
00602 
00603       205,  206,  205,  206,  200,  199,  207,  202,  207,  204,
00604       208,  209,  208,  209,  210,  211,  210,  211,  212,    0,
00605       212,  213,  214,  213,  214,  215,  216,  215,  216,  209,
00606       217,  218,  217,  218,  219,  222,  219,  222,  220,  210,
00607       220,  213,    0,  208,  211,  212,  221,    0,  221,  218,
00608         0,  223,  214,  223,  224,  215,  224,  225,  220,  225,
00609         0,    0,  226,  221,  226,  222,  228,  227,  228,  227,
00610       229,  223,  229,  230,  231,  230,  231,  232,    0,  232,
00611       225,    0,  226,  227,    0,  233,  229,  233,  234,  230,
00612       234,  235,  228,  235,  236,  237,  236,  237,    0,  231,
00613 
00614       233,    0,  232,  234,  238,    0,  238,  240,  240,  240,
00615       241,    0,  241,  242,    0,  242,  244,    0,  244,  245,
00616         0,  245,  246,    0,  246,  247,    0,  247,  248,    0,
00617       248,  249,    0,  249,  250,    0,  250,  252,    0,  252,
00618       253,    0,  253,  255,    0,  255,  256,    0,  256,  257,
00619         0,  257,  258,    0,  258,  239,  239,  239,  239,  239,
00620       239,  239,  239,  239,  239,  239,  239,  239,  239,  239,
00621       239,  239,  239,  239,  239,  239,  239,  239,  239,  239,
00622       239,  239,  239,  239,  239,  239,  239,  239,  239,  239,
00623       239,  239,  239,  239,  239,  239,  239,  239,  239
00624 
00625     } ;
00626 
00627 static yy_state_type yy_last_accepting_state;
00628 static char *yy_last_accepting_cpos;
00629 
00630 /* The intent behind this definition is that it'll catch
00631  * any uses of REJECT which flex missed.
00632  */
00633 #define REJECT reject_used_but_not_detected
00634 #define yymore() yymore_used_but_not_detected
00635 #define YY_MORE_ADJ 0
00636 #define YY_RESTORE_YY_MORE_OFFSET
00637 char *yytext;
00638 #line 1 "pplex.l"
00639 #define INITIAL 0
00640 /*                                                      -*- c -*-
00641  * Copyright (C) 2001-2009 Keisuke Nishida
00642  * Copyright (C) 2007-2009 Roger While
00643  * 
00644  * This program is free software; you can redistribute it and/or modify
00645  * it under the terms of the GNU General Public License as published by
00646  * the Free Software Foundation; either version 2, or (at your option)
00647  * any later version.
00648  * 
00649  * This program is distributed in the hope that it will be useful,
00650  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00651  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00652  * GNU General Public License for more details.
00653  * 
00654  * You should have received a copy of the GNU General Public License
00655  * along with this software; see the file COPYING.  If not, write to
00656  * the Free Software Foundation, 51 Franklin Street, Fifth Floor
00657  * Boston, MA 02110-1301 USA
00658  */
00659 #define YY_NEVER_INTERACTIVE 1
00660 #line 28 "pplex.l"
00661 
00662 #include "config.h"
00663 
00664 #include <stdio.h>
00665 #include <stdlib.h>
00666 #include <string.h>
00667 #ifdef  HAVE_UNISTD_H
00668 #include <unistd.h>
00669 #endif
00670 #include <ctype.h>
00671 #include <errno.h>
00672 #include <sys/stat.h>
00673 #include <sys/types.h>
00674 
00675 #include "cobc.h"
00676 #include "ppparse.h"
00677 
00678 static char     *plexbuff1 = NULL;
00679 static char     *plexbuff2 = NULL;
00680 static size_t   newline_count = 0;
00681 static size_t   within_comment = 0;
00682 static size_t   inside_bracket = 0;
00683 static size_t   consecutive_quotation = 0;
00684 static int      quotation_mark = 0;
00685 static int      last_line_1 = -1;
00686 static int      last_line_2 = -1;
00687 
00688 static struct cb_replace_list   *current_replace_list = NULL;
00689 
00690 static struct cb_text_list      *text_queue = NULL;
00691 
00692 static struct copy_info {
00693         struct copy_info        *next;
00694         char                    *file;
00695         int                     line;
00696         int                     replacing;
00697         int                     quotation_mark;
00698         YY_BUFFER_STATE         buffer;
00699 } *copy_stack = NULL;
00700 
00701 #define YY_INPUT(buf,result,max_size) result = ppinput (buf, max_size);
00702 
00703 static int ppinput (char *buf, int max_size);
00704 static void ppecho (const char *text);
00705 
00706 static void switch_to_buffer (const int lineno, const char *filename,
00707                               YY_BUFFER_STATE buffer);
00708 
00709 #define PROCESS_STATE 1
00710 #define COPY_STATE 2
00711 #define PSEUDO_STATE 3
00712 
00713 #line 714 "pplex.c"
00714 
00715 /* Macros after this point can all be overridden by user definitions in
00716  * section 1.
00717  */
00718 
00719 #ifndef YY_SKIP_YYWRAP
00720 #ifdef __cplusplus
00721 extern "C" int yywrap YY_PROTO(( void ));
00722 #else
00723 extern int yywrap YY_PROTO(( void ));
00724 #endif
00725 #endif
00726 
00727 #ifndef YY_NO_UNPUT
00728 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
00729 #endif
00730 
00731 #ifndef yytext_ptr
00732 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
00733 #endif
00734 
00735 #ifdef YY_NEED_STRLEN
00736 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
00737 #endif
00738 
00739 #ifndef YY_NO_INPUT
00740 #ifdef __cplusplus
00741 static int yyinput YY_PROTO(( void ));
00742 #else
00743 static int input YY_PROTO(( void ));
00744 #endif
00745 #endif
00746 
00747 #if YY_STACK_USED
00748 static int yy_start_stack_ptr = 0;
00749 static int yy_start_stack_depth = 0;
00750 static int *yy_start_stack = 0;
00751 #ifndef YY_NO_PUSH_STATE
00752 static void yy_push_state YY_PROTO(( int new_state ));
00753 #endif
00754 #ifndef YY_NO_POP_STATE
00755 static void yy_pop_state YY_PROTO(( void ));
00756 #endif
00757 #ifndef YY_NO_TOP_STATE
00758 static int yy_top_state YY_PROTO(( void ));
00759 #endif
00760 
00761 #else
00762 #define YY_NO_PUSH_STATE 1
00763 #define YY_NO_POP_STATE 1
00764 #define YY_NO_TOP_STATE 1
00765 #endif
00766 
00767 #ifdef YY_MALLOC_DECL
00768 YY_MALLOC_DECL
00769 #else
00770 #if __STDC__
00771 #ifndef __cplusplus
00772 #include <stdlib.h>
00773 #endif
00774 #else
00775 /* Just try to get by without declaring the routines.  This will fail
00776  * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
00777  * or sizeof(void*) != sizeof(int).
00778  */
00779 #endif
00780 #endif
00781 
00782 /* Amount of stuff to slurp up with each read. */
00783 #ifndef YY_READ_BUF_SIZE
00784 #define YY_READ_BUF_SIZE 8192
00785 #endif
00786 
00787 /* Copy whatever the last rule matched to the standard output. */
00788 
00789 #ifndef ECHO
00790 /* This used to be an fputs(), but since the string might contain NUL's,
00791  * we now use fwrite().
00792  */
00793 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
00794 #endif
00795 
00796 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
00797  * is returned in "result".
00798  */
00799 #ifndef YY_INPUT
00800 #define YY_INPUT(buf,result,max_size) \
00801         if ( yy_current_buffer->yy_is_interactive ) \
00802                 { \
00803                 int c = '*', n; \
00804                 for ( n = 0; n < max_size && \
00805                              (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
00806                         buf[n] = (char) c; \
00807                 if ( c == '\n' ) \
00808                         buf[n++] = (char) c; \
00809                 if ( c == EOF && ferror( yyin ) ) \
00810                         YY_FATAL_ERROR( "input in flex scanner failed" ); \
00811                 result = n; \
00812                 } \
00813         else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
00814                   && ferror( yyin ) ) \
00815                 YY_FATAL_ERROR( "input in flex scanner failed" );
00816 #endif
00817 
00818 /* No semi-colon after return; correct usage is to write "yyterminate();" -
00819  * we don't want an extra ';' after the "return" because that will cause
00820  * some compilers to complain about unreachable statements.
00821  */
00822 #ifndef yyterminate
00823 #define yyterminate() return YY_NULL
00824 #endif
00825 
00826 /* Number of entries by which start-condition stack grows. */
00827 #ifndef YY_START_STACK_INCR
00828 #define YY_START_STACK_INCR 25
00829 #endif
00830 
00831 /* Report a fatal error. */
00832 #ifndef YY_FATAL_ERROR
00833 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
00834 #endif
00835 
00836 /* Default declaration of generated scanner - a define so the user can
00837  * easily add parameters.
00838  */
00839 #ifndef YY_DECL
00840 #define YY_DECL int yylex YY_PROTO(( void ))
00841 #endif
00842 
00843 /* Code executed at the beginning of each rule, after yytext and yyleng
00844  * have been set up.
00845  */
00846 #ifndef YY_USER_ACTION
00847 #define YY_USER_ACTION
00848 #endif
00849 
00850 /* Code executed at the end of each rule. */
00851 #ifndef YY_BREAK
00852 #define YY_BREAK break;
00853 #endif
00854 
00855 #define YY_RULE_SETUP \
00856         if ( yyleng > 0 ) \
00857                 yy_current_buffer->yy_at_bol = \
00858                                 (yytext[yyleng - 1] == '\n'); \
00859         YY_USER_ACTION
00860 
00861 YY_DECL
00862         {
00863         register yy_state_type yy_current_state;
00864         register char *yy_cp, *yy_bp;
00865         register int yy_act;
00866 
00867 #line 84 "pplex.l"
00868 
00869 
00870 
00871 
00872 
00873 #line 874 "pplex.c"
00874 
00875         if ( yy_init )
00876                 {
00877                 yy_init = 0;
00878 
00879 #ifdef YY_USER_INIT
00880                 YY_USER_INIT;
00881 #endif
00882 
00883                 if ( ! yy_start )
00884                         yy_start = 1;   /* first start state */
00885 
00886                 if ( ! yyin )
00887                         yyin = stdin;
00888 
00889                 if ( ! yyout )
00890                         yyout = stdout;
00891 
00892                 if ( ! yy_current_buffer )
00893                         yy_current_buffer =
00894                                 yy_create_buffer( yyin, YY_BUF_SIZE );
00895 
00896                 yy_load_buffer_state();
00897                 }
00898 
00899         while ( 1 )             /* loops until end-of-file is reached */
00900                 {
00901                 yy_cp = yy_c_buf_p;
00902 
00903                 /* Support of yytext. */
00904                 *yy_cp = yy_hold_char;
00905 
00906                 /* yy_bp points to the position in yy_ch_buf of the start of
00907                  * the current run.
00908                  */
00909                 yy_bp = yy_cp;
00910 
00911                 yy_current_state = yy_start;
00912                 yy_current_state += YY_AT_BOL();
00913 yy_match:
00914                 do
00915                         {
00916                         register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
00917                         if ( yy_accept[yy_current_state] )
00918                                 {
00919                                 yy_last_accepting_state = yy_current_state;
00920                                 yy_last_accepting_cpos = yy_cp;
00921                                 }
00922                         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
00923                                 {
00924                                 yy_current_state = (int) yy_def[yy_current_state];
00925                                 if ( yy_current_state >= 240 )
00926                                         yy_c = yy_meta[(unsigned int) yy_c];
00927                                 }
00928                         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
00929                         ++yy_cp;
00930                         }
00931                 while ( yy_base[yy_current_state] != 756 );
00932 
00933 yy_find_action:
00934                 yy_act = yy_accept[yy_current_state];
00935                 if ( yy_act == 0 )
00936                         { /* have to back up */
00937                         yy_cp = yy_last_accepting_cpos;
00938                         yy_current_state = yy_last_accepting_state;
00939                         yy_act = yy_accept[yy_current_state];
00940                         }
00941 
00942                 YY_DO_BEFORE_ACTION;
00943 
00944 
00945 do_action:      /* This label is used only to access EOF actions. */
00946 
00947 
00948                 switch ( yy_act )
00949         { /* beginning of action switch */
00950                         case 0: /* must back up */
00951                         /* undo the effects of YY_DO_BEFORE_ACTION */
00952                         *yy_cp = yy_hold_char;
00953                         yy_cp = yy_last_accepting_cpos;
00954                         yy_current_state = yy_last_accepting_state;
00955                         goto yy_find_action;
00956 
00957 case 1:
00958 YY_RULE_SETUP
00959 #line 89 "pplex.l"
00960 {
00961         ppecho (" ");
00962 }
00963         YY_BREAK
00964 case 2:
00965 #line 94 "pplex.l"
00966 case 3:
00967 YY_RULE_SETUP
00968 #line 94 "pplex.l"
00969 {
00970         ppecho (" ");
00971         if (cb_source_format != CB_FORMAT_FIXED) {
00972                 ppecho (yytext);
00973         }
00974 }
00975         YY_BREAK
00976 case 4:
00977 YY_RULE_SETUP
00978 #line 101 "pplex.l"
00979 { BEGIN PROCESS_STATE; }
00980         YY_BREAK
00981 
00982 case 5:
00983 YY_RULE_SETUP
00984 #line 104 "pplex.l"
00985 { BEGIN INITIAL; unput ('\n'); }
00986         YY_BREAK
00987 case 6:
00988 YY_RULE_SETUP
00989 #line 105 "pplex.l"
00990 { cb_warning (_("PROCESS statement is ignored")); }
00991         YY_BREAK
00992 
00993 case 7:
00994 YY_RULE_SETUP
00995 #line 108 "pplex.l"
00996 { BEGIN COPY_STATE; return COPY; }
00997         YY_BREAK
00998 case 8:
00999 YY_RULE_SETUP
01000 #line 109 "pplex.l"
01001 { BEGIN COPY_STATE; return COPY; }
01002         YY_BREAK
01003 case 9:
01004 YY_RULE_SETUP
01005 #line 110 "pplex.l"
01006 { BEGIN COPY_STATE; return REPLACE; }
01007         YY_BREAK
01008 
01009 case 10:
01010 YY_RULE_SETUP
01011 #line 113 "pplex.l"
01012 { ECHO; cb_source_line++; }
01013         YY_BREAK
01014 case 11:
01015 YY_RULE_SETUP
01016 #line 114 "pplex.l"
01017 { /* ignore */ }
01018         YY_BREAK
01019 case 12:
01020 YY_RULE_SETUP
01021 #line 115 "pplex.l"
01022 { BEGIN INITIAL; return '.'; }
01023         YY_BREAK
01024 case 13:
01025 YY_RULE_SETUP
01026 #line 116 "pplex.l"
01027 { BEGIN PSEUDO_STATE; return EQEQ; }
01028         YY_BREAK
01029 case 14:
01030 YY_RULE_SETUP
01031 #line 117 "pplex.l"
01032 { return '('; }
01033         YY_BREAK
01034 case 15:
01035 YY_RULE_SETUP
01036 #line 118 "pplex.l"
01037 { return ')'; }
01038         YY_BREAK
01039 case 16:
01040 YY_RULE_SETUP
01041 #line 119 "pplex.l"
01042 { return BY; }
01043         YY_BREAK
01044 case 17:
01045 YY_RULE_SETUP
01046 #line 120 "pplex.l"
01047 { return IN; }
01048         YY_BREAK
01049 case 18:
01050 YY_RULE_SETUP
01051 #line 121 "pplex.l"
01052 { return OF; }
01053         YY_BREAK
01054 case 19:
01055 YY_RULE_SETUP
01056 #line 122 "pplex.l"
01057 { return OFF; }
01058         YY_BREAK
01059 case 20:
01060 YY_RULE_SETUP
01061 #line 123 "pplex.l"
01062 { return SUPPRESS; }
01063         YY_BREAK
01064 case 21:
01065 YY_RULE_SETUP
01066 #line 124 "pplex.l"
01067 { return PRINTING; }
01068         YY_BREAK
01069 case 22:
01070 YY_RULE_SETUP
01071 #line 125 "pplex.l"
01072 { return REPLACING; }
01073         YY_BREAK
01074 case 23:
01075 #line 127 "pplex.l"
01076 case 24:
01077 #line 128 "pplex.l"
01078 case 25:
01079 #line 129 "pplex.l"
01080 case 26:
01081 YY_RULE_SETUP
01082 #line 129 "pplex.l"
01083 { pplval.s = strdup (yytext); return TOKEN; }
01084         YY_BREAK
01085 
01086 
01087 case 27:
01088 YY_RULE_SETUP
01089 #line 133 "pplex.l"
01090 { ECHO; cb_source_line++; }
01091         YY_BREAK
01092 case 28:
01093 YY_RULE_SETUP
01094 #line 134 "pplex.l"
01095 { pplval.s = strdup (" "); return TOKEN; }
01096         YY_BREAK
01097 case 29:
01098 YY_RULE_SETUP
01099 #line 135 "pplex.l"
01100 { BEGIN COPY_STATE; return EQEQ; }
01101         YY_BREAK
01102 case 30:
01103 #line 137 "pplex.l"
01104 case 31:
01105 #line 138 "pplex.l"
01106 case 32:
01107 #line 139 "pplex.l"
01108 case 33:
01109 YY_RULE_SETUP
01110 #line 139 "pplex.l"
01111 { pplval.s = strdup (yytext); return TOKEN; }
01112         YY_BREAK
01113 
01114 case 34:
01115 #line 143 "pplex.l"
01116 case 35:
01117 #line 144 "pplex.l"
01118 case 36:
01119 #line 145 "pplex.l"
01120 case 37:
01121 #line 146 "pplex.l"
01122 case 38:
01123 #line 147 "pplex.l"
01124 case 39:
01125 #line 148 "pplex.l"
01126 case 40:
01127 YY_RULE_SETUP
01128 #line 148 "pplex.l"
01129 {
01130         /* these words are treated as comments */
01131         if (cb_verify (cb_author_paragraph, yytext)) {
01132                 /* skip comments until the end of line */
01133                 int c;
01134 
01135                 within_comment = 1;
01136                 while ((c = input ()) != EOF) {
01137                         if (c == '\n') {
01138                                 break;
01139                         }
01140                 }
01141                 unput (c);
01142         }
01143 }
01144         YY_BREAK
01145 case 41:
01146 #line 165 "pplex.l"
01147 case 42:
01148 #line 166 "pplex.l"
01149 case 43:
01150 #line 167 "pplex.l"
01151 case 44:
01152 YY_RULE_SETUP
01153 #line 167 "pplex.l"
01154 {
01155         /* these words are comments in IBM COBOL */
01156         if (cb_verify (cb_eject_statement, yytext)) {
01157                 /* do nothing for now */
01158         } else {
01159                 ECHO;
01160         }
01161 }
01162         YY_BREAK
01163 case 45:
01164 YY_RULE_SETUP
01165 #line 176 "pplex.l"
01166 { ppecho ("\n"); cb_source_line++; }
01167         YY_BREAK
01168 case 46:
01169 YY_RULE_SETUP
01170 #line 178 "pplex.l"
01171 { ppecho (" "); }
01172         YY_BREAK
01173 case 47:
01174 YY_RULE_SETUP
01175 #line 180 "pplex.l"
01176 {
01177         if (inside_bracket) {
01178                 ppecho (", ");
01179         } else {
01180                 ppecho (" ");
01181         }
01182 }
01183         YY_BREAK
01184 case 48:
01185 YY_RULE_SETUP
01186 #line 188 "pplex.l"
01187 {
01188         inside_bracket++;
01189         ppecho ("(");
01190 }
01191         YY_BREAK
01192 case 49:
01193 YY_RULE_SETUP
01194 #line 193 "pplex.l"
01195 {
01196         if (inside_bracket) {
01197                 inside_bracket--;
01198         }
01199         ppecho (")");
01200 }
01201         YY_BREAK
01202 case 50:
01203 #line 201 "pplex.l"
01204 case 51:
01205 #line 202 "pplex.l"
01206 case 52:
01207 #line 203 "pplex.l"
01208 case 53:
01209 YY_RULE_SETUP
01210 #line 203 "pplex.l"
01211 { ppecho (yytext); }
01212         YY_BREAK
01213 case YY_STATE_EOF(INITIAL):
01214 case YY_STATE_EOF(PROCESS_STATE):
01215 case YY_STATE_EOF(COPY_STATE):
01216 case YY_STATE_EOF(PSEUDO_STATE):
01217 #line 205 "pplex.l"
01218 {
01219         struct copy_info *p;
01220 
01221         p = copy_stack;
01222 
01223         yy_delete_buffer (YY_CURRENT_BUFFER);
01224 
01225         /* Terminate at the end of all input */
01226         if (p->next == NULL) {
01227                 within_comment = 0;
01228                 newline_count = 0;
01229                 inside_bracket = 0;
01230                 current_replace_list = NULL;
01231                 text_queue = NULL;
01232                 copy_stack = NULL;
01233                 quotation_mark = 0;
01234                 consecutive_quotation = 0;
01235                 last_line_1 = -1;
01236                 last_line_2 = -1;
01237                 yyterminate ();
01238         }
01239 
01240         /* Close the current file */
01241         fclose (ppin);
01242 
01243         /* Switch to the last buffer */
01244         if (p->replacing) {
01245                 pp_set_replace_list (NULL);
01246         }
01247         switch_to_buffer (p->line, p->file, p->buffer);
01248         quotation_mark = p->quotation_mark;
01249 
01250         copy_stack = p->next;
01251         free (p);
01252 }
01253         YY_BREAK
01254 case 54:
01255 YY_RULE_SETUP
01256 #line 241 "pplex.l"
01257 YY_FATAL_ERROR( "flex scanner jammed" );
01258         YY_BREAK
01259 #line 1260 "pplex.c"
01260 
01261         case YY_END_OF_BUFFER:
01262                 {
01263                 /* Amount of text matched not including the EOB char. */
01264                 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
01265 
01266                 /* Undo the effects of YY_DO_BEFORE_ACTION. */
01267                 *yy_cp = yy_hold_char;
01268                 YY_RESTORE_YY_MORE_OFFSET
01269 
01270                 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
01271                         {
01272                         /* We're scanning a new file or input source.  It's
01273                          * possible that this happened because the user
01274                          * just pointed yyin at a new source and called
01275                          * yylex().  If so, then we have to assure
01276                          * consistency between yy_current_buffer and our
01277                          * globals.  Here is the right place to do so, because
01278                          * this is the first action (other than possibly a
01279                          * back-up) that will match for the new input source.
01280                          */
01281                         yy_n_chars = yy_current_buffer->yy_n_chars;
01282                         yy_current_buffer->yy_input_file = yyin;
01283                         yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
01284                         }
01285 
01286                 /* Note that here we test for yy_c_buf_p "<=" to the position
01287                  * of the first EOB in the buffer, since yy_c_buf_p will
01288                  * already have been incremented past the NUL character
01289                  * (since all states make transitions on EOB to the
01290                  * end-of-buffer state).  Contrast this with the test
01291                  * in input().
01292                  */
01293                 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
01294                         { /* This was really a NUL. */
01295                         yy_state_type yy_next_state;
01296 
01297                         yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
01298 
01299                         yy_current_state = yy_get_previous_state();
01300 
01301                         /* Okay, we're now positioned to make the NUL
01302                          * transition.  We couldn't have
01303                          * yy_get_previous_state() go ahead and do it
01304                          * for us because it doesn't know how to deal
01305                          * with the possibility of jamming (and we don't
01306                          * want to build jamming into it because then it
01307                          * will run more slowly).
01308                          */
01309 
01310                         yy_next_state = yy_try_NUL_trans( yy_current_state );
01311 
01312                         yy_bp = yytext_ptr + YY_MORE_ADJ;
01313 
01314                         if ( yy_next_state )
01315                                 {
01316                                 /* Consume the NUL. */
01317                                 yy_cp = ++yy_c_buf_p;
01318                                 yy_current_state = yy_next_state;
01319                                 goto yy_match;
01320                                 }
01321 
01322                         else
01323                                 {
01324                                 yy_cp = yy_c_buf_p;
01325                                 goto yy_find_action;
01326                                 }
01327                         }
01328 
01329                 else switch ( yy_get_next_buffer() )
01330                         {
01331                         case EOB_ACT_END_OF_FILE:
01332                                 {
01333                                 yy_did_buffer_switch_on_eof = 0;
01334 
01335                                 if ( yywrap() )
01336                                         {
01337                                         /* Note: because we've taken care in
01338                                          * yy_get_next_buffer() to have set up
01339                                          * yytext, we can now set up
01340                                          * yy_c_buf_p so that if some total
01341                                          * hoser (like flex itself) wants to
01342                                          * call the scanner after we return the
01343                                          * YY_NULL, it'll still work - another
01344                                          * YY_NULL will get returned.
01345                                          */
01346                                         yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
01347 
01348                                         yy_act = YY_STATE_EOF(YY_START);
01349                                         goto do_action;
01350                                         }
01351 
01352                                 else
01353                                         {
01354                                         if ( ! yy_did_buffer_switch_on_eof )
01355                                                 YY_NEW_FILE;
01356                                         }
01357                                 break;
01358                                 }
01359 
01360                         case EOB_ACT_CONTINUE_SCAN:
01361                                 yy_c_buf_p =
01362                                         yytext_ptr + yy_amount_of_matched_text;
01363 
01364                                 yy_current_state = yy_get_previous_state();
01365 
01366                                 yy_cp = yy_c_buf_p;
01367                                 yy_bp = yytext_ptr + YY_MORE_ADJ;
01368                                 goto yy_match;
01369 
01370                         case EOB_ACT_LAST_MATCH:
01371                                 yy_c_buf_p =
01372                                 &yy_current_buffer->yy_ch_buf[yy_n_chars];
01373 
01374                                 yy_current_state = yy_get_previous_state();
01375 
01376                                 yy_cp = yy_c_buf_p;
01377                                 yy_bp = yytext_ptr + YY_MORE_ADJ;
01378                                 goto yy_find_action;
01379                         }
01380                 break;
01381                 }
01382 
01383         default:
01384                 YY_FATAL_ERROR(
01385                         "fatal flex scanner internal error--no action found" );
01386         } /* end of action switch */
01387                 } /* end of scanning one token */
01388         } /* end of yylex */
01389 
01390 
01391 /* yy_get_next_buffer - try to read in a new buffer
01392  *
01393  * Returns a code representing an action:
01394  *      EOB_ACT_LAST_MATCH -
01395  *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
01396  *      EOB_ACT_END_OF_FILE - end of file
01397  */
01398 
01399 static int yy_get_next_buffer()
01400         {
01401         register char *dest = yy_current_buffer->yy_ch_buf;
01402         register char *source = yytext_ptr;
01403         register int number_to_move, i;
01404         int ret_val;
01405 
01406         if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
01407                 YY_FATAL_ERROR(
01408                 "fatal flex scanner internal error--end of buffer missed" );
01409 
01410         if ( yy_current_buffer->yy_fill_buffer == 0 )
01411                 { /* Don't try to fill the buffer, so this is an EOF. */
01412                 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
01413                         {
01414                         /* We matched a single character, the EOB, so
01415                          * treat this as a final EOF.
01416                          */
01417                         return EOB_ACT_END_OF_FILE;
01418                         }
01419 
01420                 else
01421                         {
01422                         /* We matched some text prior to the EOB, first
01423                          * process it.
01424                          */
01425                         return EOB_ACT_LAST_MATCH;
01426                         }
01427                 }
01428 
01429         /* Try to read more data. */
01430 
01431         /* First move last chars to start of buffer. */
01432         number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
01433 
01434         for ( i = 0; i < number_to_move; ++i )
01435                 *(dest++) = *(source++);
01436 
01437         if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
01438                 /* don't do the read, it's not guaranteed to return an EOF,
01439                  * just force an EOF
01440                  */
01441                 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
01442 
01443         else
01444                 {
01445                 int num_to_read =
01446                         yy_current_buffer->yy_buf_size - number_to_move - 1;
01447 
01448                 while ( num_to_read <= 0 )
01449                         { /* Not enough room in the buffer - grow it. */
01450 #ifdef YY_USES_REJECT
01451                         YY_FATAL_ERROR(
01452 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
01453 #else
01454 
01455                         /* just a shorter name for the current buffer */
01456                         YY_BUFFER_STATE b = yy_current_buffer;
01457 
01458                         int yy_c_buf_p_offset =
01459                                 (int) (yy_c_buf_p - b->yy_ch_buf);
01460 
01461                         if ( b->yy_is_our_buffer )
01462                                 {
01463                                 int new_size = b->yy_buf_size * 2;
01464 
01465                                 if ( new_size <= 0 )
01466                                         b->yy_buf_size += b->yy_buf_size / 8;
01467                                 else
01468                                         b->yy_buf_size *= 2;
01469 
01470                                 b->yy_ch_buf = (char *)
01471                                         /* Include room in for 2 EOB chars. */
01472                                         yy_flex_realloc( (void *) b->yy_ch_buf,
01473                                                          b->yy_buf_size + 2 );
01474                                 }
01475                         else
01476                                 /* Can't grow it, we don't own it. */
01477                                 b->yy_ch_buf = 0;
01478 
01479                         if ( ! b->yy_ch_buf )
01480                                 YY_FATAL_ERROR(
01481                                 "fatal error - scanner input buffer overflow" );
01482 
01483                         yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
01484 
01485                         num_to_read = yy_current_buffer->yy_buf_size -
01486                                                 number_to_move - 1;
01487 #endif
01488                         }
01489 
01490                 if ( num_to_read > YY_READ_BUF_SIZE )
01491                         num_to_read = YY_READ_BUF_SIZE;
01492 
01493                 /* Read in more data. */
01494                 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
01495                         yy_n_chars, num_to_read );
01496 
01497                 yy_current_buffer->yy_n_chars = yy_n_chars;
01498                 }
01499 
01500         if ( yy_n_chars == 0 )
01501                 {
01502                 if ( number_to_move == YY_MORE_ADJ )
01503                         {
01504                         ret_val = EOB_ACT_END_OF_FILE;
01505                         yyrestart( yyin );
01506                         }
01507 
01508                 else
01509                         {
01510                         ret_val = EOB_ACT_LAST_MATCH;
01511                         yy_current_buffer->yy_buffer_status =
01512                                 YY_BUFFER_EOF_PENDING;
01513                         }
01514                 }
01515 
01516         else
01517                 ret_val = EOB_ACT_CONTINUE_SCAN;
01518 
01519         yy_n_chars += number_to_move;
01520         yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
01521         yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
01522 
01523         yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
01524 
01525         return ret_val;
01526         }
01527 
01528 
01529 /* yy_get_previous_state - get the state just before the EOB char was reached */
01530 
01531 static yy_state_type yy_get_previous_state()
01532         {
01533         register yy_state_type yy_current_state;
01534         register char *yy_cp;
01535 
01536         yy_current_state = yy_start;
01537         yy_current_state += YY_AT_BOL();
01538 
01539         for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
01540                 {
01541                 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
01542                 if ( yy_accept[yy_current_state] )
01543                         {
01544                         yy_last_accepting_state = yy_current_state;
01545                         yy_last_accepting_cpos = yy_cp;
01546                         }
01547                 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
01548                         {
01549                         yy_current_state = (int) yy_def[yy_current_state];
01550                         if ( yy_current_state >= 240 )
01551                                 yy_c = yy_meta[(unsigned int) yy_c];
01552                         }
01553                 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
01554                 }
01555 
01556         return yy_current_state;
01557         }
01558 
01559 
01560 /* yy_try_NUL_trans - try to make a transition on the NUL character
01561  *
01562  * synopsis
01563  *      next_state = yy_try_NUL_trans( current_state );
01564  */
01565 
01566 #ifdef YY_USE_PROTOS
01567 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
01568 #else
01569 static yy_state_type yy_try_NUL_trans( yy_current_state )
01570 yy_state_type yy_current_state;
01571 #endif
01572         {
01573         register int yy_is_jam;
01574         register char *yy_cp = yy_c_buf_p;
01575 
01576         register YY_CHAR yy_c = 1;
01577         if ( yy_accept[yy_current_state] )
01578                 {
01579                 yy_last_accepting_state = yy_current_state;
01580                 yy_last_accepting_cpos = yy_cp;
01581                 }
01582         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
01583                 {
01584                 yy_current_state = (int) yy_def[yy_current_state];
01585                 if ( yy_current_state >= 240 )
01586                         yy_c = yy_meta[(unsigned int) yy_c];
01587                 }
01588         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
01589         yy_is_jam = (yy_current_state == 239);
01590 
01591         return yy_is_jam ? 0 : yy_current_state;
01592         }
01593 
01594 
01595 #ifndef YY_NO_UNPUT
01596 #ifdef YY_USE_PROTOS
01597 static void yyunput( int c, register char *yy_bp )
01598 #else
01599 static void yyunput( c, yy_bp )
01600 int c;
01601 register char *yy_bp;
01602 #endif
01603         {
01604         register char *yy_cp = yy_c_buf_p;
01605 
01606         /* undo effects of setting up yytext */
01607         *yy_cp = yy_hold_char;
01608 
01609         if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
01610                 { /* need to shift things up to make room */
01611                 /* +2 for EOB chars. */
01612                 register int number_to_move = yy_n_chars + 2;
01613                 register char *dest = &yy_current_buffer->yy_ch_buf[
01614                                         yy_current_buffer->yy_buf_size + 2];
01615                 register char *source =
01616                                 &yy_current_buffer->yy_ch_buf[number_to_move];
01617 
01618                 while ( source > yy_current_buffer->yy_ch_buf )
01619                         *--dest = *--source;
01620 
01621                 yy_cp += (int) (dest - source);
01622                 yy_bp += (int) (dest - source);
01623                 yy_current_buffer->yy_n_chars =
01624                         yy_n_chars = yy_current_buffer->yy_buf_size;
01625 
01626                 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
01627                         YY_FATAL_ERROR( "flex scanner push-back overflow" );
01628                 }
01629 
01630         *--yy_cp = (char) c;
01631 
01632 
01633         yytext_ptr = yy_bp;
01634         yy_hold_char = *yy_cp;
01635         yy_c_buf_p = yy_cp;
01636         }
01637 #endif  /* ifndef YY_NO_UNPUT */
01638 
01639 
01640 #ifdef __cplusplus
01641 static int yyinput()
01642 #else
01643 static int input()
01644 #endif
01645         {
01646         int c;
01647 
01648         *yy_c_buf_p = yy_hold_char;
01649 
01650         if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
01651                 {
01652                 /* yy_c_buf_p now points to the character we want to return.
01653                  * If this occurs *before* the EOB characters, then it's a
01654                  * valid NUL; if not, then we've hit the end of the buffer.
01655                  */
01656                 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
01657                         /* This was really a NUL. */
01658                         *yy_c_buf_p = '\0';
01659 
01660                 else
01661                         { /* need more input */
01662                         int offset = yy_c_buf_p - yytext_ptr;
01663                         ++yy_c_buf_p;
01664 
01665                         switch ( yy_get_next_buffer() )
01666                                 {
01667                                 case EOB_ACT_LAST_MATCH:
01668                                         /* This happens because yy_g_n_b()
01669                                          * sees that we've accumulated a
01670                                          * token and flags that we need to
01671                                          * try matching the token before
01672                                          * proceeding.  But for input(),
01673                                          * there's no matching to consider.
01674                                          * So convert the EOB_ACT_LAST_MATCH
01675                                          * to EOB_ACT_END_OF_FILE.
01676                                          */
01677 
01678                                         /* Reset buffer status. */
01679                                         yyrestart( yyin );
01680 
01681                                         /* fall through */
01682 
01683                                 case EOB_ACT_END_OF_FILE:
01684                                         {
01685                                         if ( yywrap() )
01686                                                 return EOF;
01687 
01688                                         if ( ! yy_did_buffer_switch_on_eof )
01689                                                 YY_NEW_FILE;
01690 #ifdef __cplusplus
01691                                         return yyinput();
01692 #else
01693                                         return input();
01694 #endif
01695                                         }
01696 
01697                                 case EOB_ACT_CONTINUE_SCAN:
01698                                         yy_c_buf_p = yytext_ptr + offset;
01699                                         break;
01700                                 }
01701                         }
01702                 }
01703 
01704         c = *(unsigned char *) yy_c_buf_p;      /* cast for 8-bit char's */
01705         *yy_c_buf_p = '\0';     /* preserve yytext */
01706         yy_hold_char = *++yy_c_buf_p;
01707 
01708         yy_current_buffer->yy_at_bol = (c == '\n');
01709 
01710         return c;
01711         }
01712 
01713 
01714 #ifdef YY_USE_PROTOS
01715 void yyrestart( FILE *input_file )
01716 #else
01717 void yyrestart( input_file )
01718 FILE *input_file;
01719 #endif
01720         {
01721         if ( ! yy_current_buffer )
01722                 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
01723 
01724         yy_init_buffer( yy_current_buffer, input_file );
01725         yy_load_buffer_state();
01726         }
01727 
01728 
01729 #ifdef YY_USE_PROTOS
01730 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
01731 #else
01732 void yy_switch_to_buffer( new_buffer )
01733 YY_BUFFER_STATE new_buffer;
01734 #endif
01735         {
01736         if ( yy_current_buffer == new_buffer )
01737                 return;
01738 
01739         if ( yy_current_buffer )
01740                 {
01741                 /* Flush out information for old buffer. */
01742                 *yy_c_buf_p = yy_hold_char;
01743                 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
01744                 yy_current_buffer->yy_n_chars = yy_n_chars;
01745                 }
01746 
01747         yy_current_buffer = new_buffer;
01748         yy_load_buffer_state();
01749 
01750         /* We don't actually know whether we did this switch during
01751          * EOF (yywrap()) processing, but the only time this flag
01752          * is looked at is after yywrap() is called, so it's safe
01753          * to go ahead and always set it.
01754          */
01755         yy_did_buffer_switch_on_eof = 1;
01756         }
01757 
01758 
01759 #ifdef YY_USE_PROTOS
01760 void yy_load_buffer_state( void )
01761 #else
01762 void yy_load_buffer_state()
01763 #endif
01764         {
01765         yy_n_chars = yy_current_buffer->yy_n_chars;
01766         yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
01767         yyin = yy_current_buffer->yy_input_file;
01768         yy_hold_char = *yy_c_buf_p;
01769         }
01770 
01771 
01772 #ifdef YY_USE_PROTOS
01773 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
01774 #else
01775 YY_BUFFER_STATE yy_create_buffer( file, size )
01776 FILE *file;
01777 int size;
01778 #endif
01779         {
01780         YY_BUFFER_STATE b;
01781 
01782         b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
01783         if ( ! b )
01784                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
01785 
01786         b->yy_buf_size = size;
01787 
01788         /* yy_ch_buf has to be 2 characters longer than the size given because
01789          * we need to put in 2 end-of-buffer characters.
01790          */
01791         b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
01792         if ( ! b->yy_ch_buf )
01793                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
01794 
01795         b->yy_is_our_buffer = 1;
01796 
01797         yy_init_buffer( b, file );
01798 
01799         return b;
01800         }
01801 
01802 
01803 #ifdef YY_USE_PROTOS
01804 void yy_delete_buffer( YY_BUFFER_STATE b )
01805 #else
01806 void yy_delete_buffer( b )
01807 YY_BUFFER_STATE b;
01808 #endif
01809         {
01810         if ( ! b )
01811                 return;
01812 
01813         if ( b == yy_current_buffer )
01814                 yy_current_buffer = (YY_BUFFER_STATE) 0;
01815 
01816         if ( b->yy_is_our_buffer )
01817                 yy_flex_free( (void *) b->yy_ch_buf );
01818 
01819         yy_flex_free( (void *) b );
01820         }
01821 
01822 
01823 #ifndef YY_ALWAYS_INTERACTIVE
01824 #ifndef YY_NEVER_INTERACTIVE
01825 extern int isatty YY_PROTO(( int ));
01826 #endif
01827 #endif
01828 
01829 #ifdef YY_USE_PROTOS
01830 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
01831 #else
01832 void yy_init_buffer( b, file )
01833 YY_BUFFER_STATE b;
01834 FILE *file;
01835 #endif
01836 
01837 
01838         {
01839         yy_flush_buffer( b );
01840 
01841         b->yy_input_file = file;
01842         b->yy_fill_buffer = 1;
01843 
01844 #if YY_ALWAYS_INTERACTIVE
01845         b->yy_is_interactive = 1;
01846 #else
01847 #if YY_NEVER_INTERACTIVE
01848         b->yy_is_interactive = 0;
01849 #else
01850         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
01851 #endif
01852 #endif
01853         }
01854 
01855 
01856 #ifdef YY_USE_PROTOS
01857 void yy_flush_buffer( YY_BUFFER_STATE b )
01858 #else
01859 void yy_flush_buffer( b )
01860 YY_BUFFER_STATE b;
01861 #endif
01862 
01863         {
01864         if ( ! b )
01865                 return;
01866 
01867         b->yy_n_chars = 0;
01868 
01869         /* We always need two end-of-buffer characters.  The first causes
01870          * a transition to the end-of-buffer state.  The second causes
01871          * a jam in that state.
01872          */
01873         b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
01874         b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
01875 
01876         b->yy_buf_pos = &b->yy_ch_buf[0];
01877 
01878         b->yy_at_bol = 1;
01879         b->yy_buffer_status = YY_BUFFER_NEW;
01880 
01881         if ( b == yy_current_buffer )
01882                 yy_load_buffer_state();
01883         }
01884 
01885 
01886 #ifndef YY_NO_SCAN_BUFFER
01887 #ifdef YY_USE_PROTOS
01888 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
01889 #else
01890 YY_BUFFER_STATE yy_scan_buffer( base, size )
01891 char *base;
01892 yy_size_t size;
01893 #endif
01894         {
01895         YY_BUFFER_STATE b;
01896 
01897         if ( size < 2 ||
01898              base[size-2] != YY_END_OF_BUFFER_CHAR ||
01899              base[size-1] != YY_END_OF_BUFFER_CHAR )
01900                 /* They forgot to leave room for the EOB's. */
01901                 return 0;
01902 
01903         b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
01904         if ( ! b )
01905                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
01906 
01907         b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
01908         b->yy_buf_pos = b->yy_ch_buf = base;
01909         b->yy_is_our_buffer = 0;
01910         b->yy_input_file = 0;
01911         b->yy_n_chars = b->yy_buf_size;
01912         b->yy_is_interactive = 0;
01913         b->yy_at_bol = 1;
01914         b->yy_fill_buffer = 0;
01915         b->yy_buffer_status = YY_BUFFER_NEW;
01916 
01917         yy_switch_to_buffer( b );
01918 
01919         return b;
01920         }
01921 #endif
01922 
01923 
01924 #ifndef YY_NO_SCAN_STRING
01925 #ifdef YY_USE_PROTOS
01926 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
01927 #else
01928 YY_BUFFER_STATE yy_scan_string( yy_str )
01929 yyconst char *yy_str;
01930 #endif
01931         {
01932         int len;
01933         for ( len = 0; yy_str[len]; ++len )
01934                 ;
01935 
01936         return yy_scan_bytes( yy_str, len );
01937         }
01938 #endif
01939 
01940 
01941 #ifndef YY_NO_SCAN_BYTES
01942 #ifdef YY_USE_PROTOS
01943 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
01944 #else
01945 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
01946 yyconst char *bytes;
01947 int len;
01948 #endif
01949         {
01950         YY_BUFFER_STATE b;
01951         char *buf;
01952         yy_size_t n;
01953         int i;
01954 
01955         /* Get memory for full buffer, including space for trailing EOB's. */
01956         n = len + 2;
01957         buf = (char *) yy_flex_alloc( n );
01958         if ( ! buf )
01959                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
01960 
01961         for ( i = 0; i < len; ++i )
01962                 buf[i] = bytes[i];
01963 
01964         buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
01965 
01966         b = yy_scan_buffer( buf, n );
01967         if ( ! b )
01968                 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
01969 
01970         /* It's okay to grow etc. this buffer, and we should throw it
01971          * away when we're done.
01972          */
01973         b->yy_is_our_buffer = 1;
01974 
01975         return b;
01976         }
01977 #endif
01978 
01979 
01980 #ifndef YY_NO_PUSH_STATE
01981 #ifdef YY_USE_PROTOS
01982 static void yy_push_state( int new_state )
01983 #else
01984 static void yy_push_state( new_state )
01985 int new_state;
01986 #endif
01987         {
01988         if ( yy_start_stack_ptr >= yy_start_stack_depth )
01989                 {
01990                 yy_size_t new_size;
01991 
01992                 yy_start_stack_depth += YY_START_STACK_INCR;
01993                 new_size = yy_start_stack_depth * sizeof( int );
01994 
01995                 if ( ! yy_start_stack )
01996                         yy_start_stack = (int *) yy_flex_alloc( new_size );
01997 
01998                 else
01999                         yy_start_stack = (int *) yy_flex_realloc(
02000                                         (void *) yy_start_stack, new_size );
02001 
02002                 if ( ! yy_start_stack )
02003                         YY_FATAL_ERROR(
02004                         "out of memory expanding start-condition stack" );
02005                 }
02006 
02007         yy_start_stack[yy_start_stack_ptr++] = YY_START;
02008 
02009         BEGIN(new_state);
02010         }
02011 #endif
02012 
02013 
02014 #ifndef YY_NO_POP_STATE
02015 static void yy_pop_state()
02016         {
02017         if ( --yy_start_stack_ptr < 0 )
02018                 YY_FATAL_ERROR( "start-condition stack underflow" );
02019 
02020         BEGIN(yy_start_stack[yy_start_stack_ptr]);
02021         }
02022 #endif
02023 
02024 
02025 #ifndef YY_NO_TOP_STATE
02026 static int yy_top_state()
02027         {
02028         return yy_start_stack[yy_start_stack_ptr - 1];
02029         }
02030 #endif
02031 
02032 #ifndef YY_EXIT_FAILURE
02033 #define YY_EXIT_FAILURE 2
02034 #endif
02035 
02036 #ifdef YY_USE_PROTOS
02037 static void yy_fatal_error( yyconst char msg[] )
02038 #else
02039 static void yy_fatal_error( msg )
02040 char msg[];
02041 #endif
02042         {
02043         (void) fprintf( stderr, "%s\n", msg );
02044         exit( YY_EXIT_FAILURE );
02045         }
02046 
02047 
02048 
02049 /* Redefine yyless() so it works in section 3 code. */
02050 
02051 #undef yyless
02052 #define yyless(n) \
02053         do \
02054                 { \
02055                 /* Undo effects of setting up yytext. */ \
02056                 yytext[yyleng] = yy_hold_char; \
02057                 yy_c_buf_p = yytext + n; \
02058                 yy_hold_char = *yy_c_buf_p; \
02059                 *yy_c_buf_p = '\0'; \
02060                 yyleng = n; \
02061                 } \
02062         while ( 0 )
02063 
02064 
02065 /* Internal utility routines. */
02066 
02067 #ifndef yytext_ptr
02068 #ifdef YY_USE_PROTOS
02069 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
02070 #else
02071 static void yy_flex_strncpy( s1, s2, n )
02072 char *s1;
02073 yyconst char *s2;
02074 int n;
02075 #endif
02076         {
02077         register int i;
02078         for ( i = 0; i < n; ++i )
02079                 s1[i] = s2[i];
02080         }
02081 #endif
02082 
02083 #ifdef YY_NEED_STRLEN
02084 #ifdef YY_USE_PROTOS
02085 static int yy_flex_strlen( yyconst char *s )
02086 #else
02087 static int yy_flex_strlen( s )
02088 yyconst char *s;
02089 #endif
02090         {
02091         register int n;
02092         for ( n = 0; s[n]; ++n )
02093                 ;
02094 
02095         return n;
02096         }
02097 #endif
02098 
02099 
02100 #ifdef YY_USE_PROTOS
02101 static void *yy_flex_alloc( yy_size_t size )
02102 #else
02103 static void *yy_flex_alloc( size )
02104 yy_size_t size;
02105 #endif
02106         {
02107         return (void *) malloc( size );
02108         }
02109 
02110 #ifdef YY_USE_PROTOS
02111 static void *yy_flex_realloc( void *ptr, yy_size_t size )
02112 #else
02113 static void *yy_flex_realloc( ptr, size )
02114 void *ptr;
02115 yy_size_t size;
02116 #endif
02117         {
02118         /* The cast to (char *) in the following accommodates both
02119          * implementations that use char* generic pointers, and those
02120          * that use void* generic pointers.  It works with the latter
02121          * because both ANSI C and C++ allow castless assignment from
02122          * any pointer type to void*, and deal with argument conversions
02123          * as though doing an assignment.
02124          */
02125         return (void *) realloc( (char *) ptr, size );
02126         }
02127 
02128 #ifdef YY_USE_PROTOS
02129 static void yy_flex_free( void *ptr )
02130 #else
02131 static void yy_flex_free( ptr )
02132 void *ptr;
02133 #endif
02134         {
02135         free( ptr );
02136         }
02137 
02138 #if YY_MAIN
02139 int main()
02140         {
02141         yylex();
02142         return 0;
02143         }
02144 #endif
02145 #line 241 "pplex.l"
02146 
02147 
02148 void
02149 pp_set_replace_list (struct cb_replace_list *list)
02150 {
02151         current_replace_list = list;
02152 }
02153 
02154 static void
02155 switch_to_buffer (const int line, const char *file, YY_BUFFER_STATE buffer)
02156 {
02157         char    *p;
02158 
02159         cb_source_line = line;
02160         cb_source_file = strdup (file);
02161         for (p = cb_source_file; *p; p++) {
02162                 if (*p == '\\') {
02163                         *p = '/';
02164                 }
02165         }
02166         yy_switch_to_buffer (buffer);
02167         fprintf (yyout, "# %d \"%s\"\n", line, cb_source_file);
02168 }
02169 
02170 int
02171 ppopen (const char *name, struct cb_replace_list *replace_list)
02172 {
02173         struct copy_info *p;
02174 
02175         for (; newline_count > 0; newline_count--) {
02176                 ungetc ('\n', ppin);
02177         }
02178 
02179         /* Open the copy file */
02180         ppin = fopen (name, "rb");
02181         if (!ppin) {
02182                 if (cb_source_file) {
02183                         cb_error (_("%s: %s"), name, strerror (errno));
02184                 } else {
02185                         perror (name);
02186                 }
02187                 return -1;
02188         }
02189 
02190         /* Add to dependency list */
02191         if (cb_depend_file) {
02192                 cb_depend_list = cb_text_list_add (cb_depend_list, name);
02193         }
02194 
02195         /* Preserve the current buffer */
02196         p = cobc_malloc (sizeof (struct copy_info));
02197         p->line = cb_source_line;
02198         p->file = cb_source_file;
02199         p->replacing = replace_list ? 1 : 0;
02200         p->buffer = YY_CURRENT_BUFFER;
02201         p->quotation_mark = quotation_mark;
02202         p->next = copy_stack;
02203         copy_stack = p;
02204 
02205         /* Switch to new buffer */
02206         if (replace_list) {
02207                 pp_set_replace_list (replace_list);
02208         }
02209         switch_to_buffer (1, name, yy_create_buffer (ppin, YY_BUF_SIZE));
02210         return 0;
02211 }
02212 
02213 int
02214 ppcopy (const char *name, const char *lib, struct cb_replace_list *replace_list)
02215 {
02216         struct cb_text_list     *il;
02217         struct cb_text_list     *el;
02218         char                    *s;
02219         struct stat             st;
02220 
02221         if (lib) {
02222                 if (!plexbuff1) {
02223                         plexbuff1 = cobc_malloc (COB_SMALL_BUFF);
02224                 }
02225                 snprintf (plexbuff1, COB_SMALL_MAX, "%s/%s", lib, name);
02226                 s = plexbuff1;
02227         } else {
02228                 s = (char *)name;
02229         }
02230 
02231         /* Find the file */
02232         if (stat (s, &st) == 0) {
02233                 return ppopen (s, replace_list);
02234         }
02235         if (!plexbuff2) {
02236                 plexbuff2 = cobc_malloc (COB_SMALL_BUFF);
02237         }
02238         for (el = cb_extension_list; el; el = el->next) {
02239                 snprintf (plexbuff2, COB_SMALL_MAX, "%s%s", s, el->text);
02240                 if (stat (plexbuff2, &st) == 0) {
02241                         return ppopen (plexbuff2, replace_list);
02242                 }
02243         }
02244         if (*s != '/') {
02245                 for (il = cb_include_list; il; il = il->next) {
02246                         for (el = cb_extension_list; el; el = el->next) {
02247                                 snprintf (plexbuff2, COB_SMALL_MAX, "%s/%s%s",
02248                                           il->text, name, el->text);
02249                                 if (stat (plexbuff2, &st) == 0) {
02250                                         return ppopen (plexbuff2, replace_list);
02251                                 }
02252                         }
02253                 }
02254         }
02255         cb_error (_("%s: %s"), name, strerror (errno));
02256         return -1;
02257 }
02258 
02259 /* Check directives */
02260 /* This is horrible but we have to parse directives directly after the read */
02261 /* as flex buffers up input and it is then too late to use the flex parser */
02262 
02263 static void
02264 check_directive (char *buff, int *line_size)
02265 {
02266         char    *s;
02267         char    *dirptr;
02268         size_t  cnt;
02269         int     n;
02270         char    sbuff[5][256];
02271 
02272         if (cb_source_format == CB_FORMAT_FIXED) {
02273                 if (*line_size < 8) {
02274                         return;
02275                 }
02276                 if (buff[6] != ' ') {
02277                         return;
02278                 }
02279                 s = &buff[7];
02280         } else {
02281                 s = buff;
02282         }
02283         for (; *s == ' '; s++) {
02284                 ;
02285         }
02286         dirptr = s;
02287         if (*s != '>') {
02288                 return;
02289         }
02290         s++;
02291         if (*s != '>') {
02292                 return;
02293         }
02294         s++;
02295         if (*s == 'D') {
02296                 if (cb_flag_debugging_line) {
02297                         memset (dirptr, ' ', 3);
02298                 } else {
02299                         for (cnt = 0; cnt < newline_count; cnt++) {
02300                                 buff[cnt] = '\n';
02301                         }
02302                         buff[cnt] = 0;
02303                         strcat (buff, "      *> DEBUG\n");
02304                         *line_size = strlen (buff);
02305                         newline_count = 0;
02306                 }
02307                 return;
02308         }
02309         memset (sbuff[0], 0, sizeof (sbuff));
02310         n = sscanf (s, "%255s %255s %255s %255s %255s",
02311                         sbuff[0], sbuff[1], sbuff[2], sbuff[3], sbuff[4]);
02312         for (cnt = 0; cnt < newline_count; cnt++) {
02313                 buff[cnt] = '\n';
02314         }
02315         buff[cnt] = 0;
02316         newline_count = 0;
02317         strcat (buff, "      *> DIRECTIVE\n");
02318         *line_size = strlen (buff);
02319         if (n < 2 || strcasecmp (sbuff[0], "SOURCE")) {
02320                 cb_warning (_("Invalid directive - ignored"));
02321                 return;
02322         }
02323         switch (n) {
02324         case 2:
02325                 if (!strcasecmp (sbuff[1], "FIXED")) {
02326                         cb_source_format = CB_FORMAT_FIXED;
02327                         return;
02328                 }
02329                 if (!strcasecmp (sbuff[1], "FREE")) {
02330                         cb_source_format = CB_FORMAT_FREE;
02331                         return;
02332                 }
02333                 break;
02334         case 3:
02335                 if (strcasecmp (sbuff[1], "FORMAT") &&
02336                     strcasecmp (sbuff[1], "IS")) {
02337                         break;
02338                 }
02339                 if (!strcasecmp (sbuff[2], "FIXED")) {
02340                         cb_source_format = CB_FORMAT_FIXED;
02341                         return;
02342                 }
02343                 if (!strcasecmp (sbuff[2], "FREE")) {
02344                         cb_source_format = CB_FORMAT_FREE;
02345                         return;
02346                 }
02347                 break;
02348         default:
02349                 if (strcasecmp (sbuff[1], "FORMAT")) {
02350                         break;
02351                 }
02352                 if (strcasecmp (sbuff[2], "IS")) {
02353                         break;
02354                 }
02355                 if (!strcasecmp (sbuff[3], "FIXED")) {
02356                         cb_source_format = CB_FORMAT_FIXED;
02357                         return;
02358                 }
02359                 if (!strcasecmp (sbuff[3], "FREE")) {
02360                         cb_source_format = CB_FORMAT_FREE;
02361                         return;
02362                 }
02363                 break;
02364         }
02365         cb_warning (_("Invalid directive - ignored"));
02366 }
02367 
02368 /*
02369  * Read line
02370  */
02371 
02372 static int
02373 ppinput (char *buff, int max_size)
02374 {
02375 
02376         char    *bp;
02377         size_t  gotcr;
02378         size_t  continuation = 0;
02379         int     ipchar;
02380         int     i;
02381         int     n;
02382         int     coln;
02383 
02384 start:
02385         /* read a line */
02386         gotcr = 0;
02387         ipchar = 0;
02388         for (n = 0; n < 256 && ipchar != '\n';) {
02389                 ipchar = getc (ppin);
02390                 if (ipchar == EOF) {
02391                         if (newline_count == 0) {
02392                                 return 0;
02393                         }
02394                         memset (buff, '\n', newline_count);
02395                         buff[newline_count] = 0;
02396                         newline_count = 0;
02397                         return strlen (buff);
02398                 }
02399                 if (n == 0 && cb_source_format != CB_FORMAT_FIXED) {
02400                         if (ipchar != ' ' && ipchar != '\n') {
02401                                 buff[n++] = ' ';
02402                         }
02403                 }
02404                 if (gotcr) {
02405                         if (ipchar != '\n') {
02406                                 buff[n++] = '\r';
02407                         }
02408                         gotcr = 0;
02409                 }
02410                 if (ipchar == '\r') {
02411                         gotcr = 1;
02412                 } else if (ipchar == '\t') {
02413                         buff[n++] = ' ';
02414                         while (n % cb_tab_width != 0) {
02415                                 buff[n++] = ' ';
02416                         }
02417                 } else {
02418                         buff[n++] = ipchar;
02419                 }
02420         }
02421 
02422         if (buff[n - 1] != '\n') {
02423                 cb_warning (_("Line not terminated by a newline"));
02424                 buff[n++] = '\n';
02425         }
02426         buff[n] = 0;
02427 
02428         check_directive (buff, &n);
02429 
02430         /* nothing more to do with free format */
02431         if (cb_source_format != CB_FORMAT_FIXED) {
02432                 return n;
02433         }
02434 
02435         /* line too short */
02436         if (n < 8) {
02437                 newline_count++;
02438                 goto start;
02439         }
02440 
02441         if (cb_flag_mfcomment) {
02442                 if (buff[0] == '*' || buff[0] == '/') {
02443                         newline_count++;
02444                         goto start;
02445                 }
02446         }
02447         /* check the indicator (column 7) */
02448         bp = buff + 7;
02449         switch (buff[6]) {
02450         case ' ':
02451                 break;
02452         case '-':
02453                 continuation = 1;
02454                 break;
02455         case 'd':
02456         case 'D':
02457                 /* debugging line */
02458                 if (cb_flag_debugging_line) {
02459                         break;
02460                 }
02461                 newline_count++;
02462                 goto start;
02463         case '*':
02464         case '/':
02465                 /* comment line */
02466                 newline_count++;
02467                 goto start;
02468         default:
02469                 /* invalid indicator */
02470                 cb_error (_("Invalid indicator '%c' at column 7"), buff[6]);
02471                 return YY_NULL;
02472         }
02473 
02474         /* skip comments that follow after AUTHORS, etc. */
02475         if (within_comment) {
02476                 /* Check all of "Area A" */
02477                 switch (n) {
02478                 case 8:
02479                         if (buff[7] == ' ') {
02480                                 newline_count++;
02481                                 goto start;
02482                         }
02483                         break;
02484                 case 9:
02485                         if (!memcmp (&buff[7], "  ", 2)) {
02486                                 newline_count++;
02487                                 goto start;
02488                         }
02489                         break;
02490                 case 10:
02491                         if (!memcmp (&buff[7], "   ", 3)) {
02492                                 newline_count++;
02493                                 goto start;
02494                         }
02495                         break;
02496                 default:
02497                         if (!memcmp (&buff[7], "    ", 4)) {
02498                                 newline_count++;
02499                                 goto start;
02500                         }
02501                         break;
02502                 }
02503                 within_comment = 0;
02504         }
02505 
02506         /* check the text that is longer than cb_text_column */
02507         if (n > cb_text_column + 1) {
02508 
02509                 /* show warning if it is not whitespaces */
02510                 if (cb_warn_column_overflow && last_line_2 < cb_source_line - 1) {
02511                         for (coln = cb_text_column; coln < n; coln++) {
02512                                 if (buff[coln] != ' ' && buff[coln] != '\n') {
02513                                         cb_warning (_("Source text after column %d"),
02514                                                     cb_text_column);
02515                                         break;
02516                                 }
02517                         }
02518                 }
02519 
02520                 /* remove it */
02521                 strcpy (buff + cb_text_column, "\n");
02522                 last_line_2 = cb_source_line;
02523                 n = cb_text_column + 1;
02524         }
02525 
02526         /* skip blank lines */
02527         for (i = 7; buff[i] == ' '; i++) ;
02528         if (buff[i] == '\n') {
02529                 newline_count++;
02530                 goto start;
02531         }
02532 
02533         if (continuation) {
02534                 /* line continuation */
02535                 for (; *bp == ' '; bp++) ;
02536 
02537                 /* validate concatenation */
02538                 if (consecutive_quotation) {
02539                         if (bp[0] == quotation_mark && bp[1] == quotation_mark) {
02540                                 bp++;
02541                         } else {
02542                                 cb_error (_("Invalid line continuation"));
02543                                 return YY_NULL;
02544                         }
02545                         quotation_mark = 0;
02546                         consecutive_quotation = 0;
02547                 } else if (quotation_mark) {
02548                         /* literal concatenation */
02549                         if (*bp == quotation_mark) {
02550                                 bp++;
02551                         } else {
02552                                 cb_error (_("Invalid line continuation"));
02553                                 return YY_NULL;
02554                         }
02555                 }
02556         } else {
02557                 /* normal line */
02558                 quotation_mark = 0;
02559                 consecutive_quotation = 0;
02560         }
02561 
02562         /* check if string literal is to be continued */
02563         for (i = bp - buff; buff[i] != '\n'; i++) {
02564                 if (buff[i] == '\'' || buff[i] == '\"') {
02565                         if (quotation_mark == 0) {
02566                                 /* literal start */
02567                                 quotation_mark = buff[i];
02568                         } else if (quotation_mark == buff[i]) {
02569                                 if (i == cb_text_column - 1) {
02570                                         /* consecutive quotation */
02571                                         consecutive_quotation = 1;
02572                                 } else {
02573                                         /* literal end */
02574                                         quotation_mark = 0;
02575                                 }
02576                         }
02577                 }
02578         }
02579 
02580         /* truncate trailing spaces, including the newline */
02581         if (quotation_mark) {
02582                 for (; i < 72;) {
02583                         buff[i++] = ' ';
02584                 }
02585                 buff[i] = 0;
02586         } else {
02587                 for (i--; buff[i] == ' '; i--) ;
02588                 if (buff[i] == '\'' || buff[i] == '\"') {
02589                         buff[++i] = ' ';
02590                 }
02591                 buff[i + 1] = 0;
02592         }
02593 
02594         if (continuation) {
02595                 memmove (buff, bp, strlen (bp) + 1);
02596                 newline_count++;
02597         } else {
02598                 /* insert newlines at the start of the buffer */
02599                 memmove (buff + newline_count, bp, strlen (bp) + 1);
02600                 memset (buff, '\n', newline_count);
02601                 newline_count = 1;
02602         }
02603         return strlen (buff);
02604 }
02605 
02606 static void
02607 ppecho (const char *text)
02608 {
02609         struct cb_replace_list  *r;
02610         struct cb_text_list     *l;
02611         struct cb_text_list     *queue;
02612 
02613         if (text_queue == NULL && (text[0] == ' ' || text[0] == '\n')) {
02614                 fputs (text, ppout);
02615         } else if (!current_replace_list) {
02616                 for (; text_queue; text_queue = text_queue->next) {
02617                         fputs (text_queue->text, ppout);
02618                 }
02619                 fputs (text, ppout);
02620         } else {
02621                 /* Do replacement */
02622 
02623                 text_queue = cb_text_list_add (text_queue, text);
02624 
02625                 for (r = current_replace_list; r; r = r->next) {
02626                         queue = text_queue;
02627                         for (l = r->old_text; l; l = l->next) {
02628                                 while (l && (l->text[0] == ' ' || l->text[0] == '\n')) {
02629                                         l = l->next;
02630                                 }
02631                                 if (l == NULL) {
02632                                         break;
02633                                 }
02634                                 while (queue && (queue->text[0] == ' ' ||
02635                                        queue->text[0] == '\n')) {
02636                                         queue = queue->next;
02637                                 }
02638                                 if (queue == NULL) {
02639                                         return; /* partial match */
02640                                 }
02641                                 if (strcasecmp (l->text, queue->text) != 0) {
02642                                         break;
02643                                 }
02644                                 queue = queue->next;
02645                         }
02646                         if (l == NULL) {
02647                                 /* match */
02648                                 for (l = r->new_text; l; l = l->next) {
02649                                         fputs (l->text, ppout);
02650                                 }
02651 /*
02652                                 text_queue = queue ? queue->next : NULL;
02653 */
02654                                 text_queue = queue;
02655                                 continue;
02656                         }
02657                 }
02658 
02659                 /* no match */
02660                 for (; text_queue; text_queue = text_queue->next) {
02661                         fputs (text_queue->text, ppout);
02662                 }
02663         }
02664 }
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines