home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 5 / FreshFish_July-August1994.bin / bbs / gnu / flex-2.4.6-src.lha / src / amiga / flex-2.4.6 / skel.c < prev    next >
C/C++ Source or Header  |  1994-01-04  |  33KB  |  1,224 lines

  1. /* File created from flex.skel via mkskel.sh */
  2.  
  3. #include "flexdef.h"
  4.  
  5. char *skel[] = {
  6.   "/* A lexical scanner generated by flex */",
  7.   "",
  8.   "/* Scanner skeleton version:",
  9.   " * $Header: flex.skl,v 1.2 94/01/04 14:33:15 vern Exp $",
  10.   " */",
  11.   "",
  12.   "#define FLEX_SCANNER",
  13.   "",
  14.   "%-",
  15.   "#include <stdio.h>",
  16.   "%*",
  17.   "",
  18.   "",
  19.   "/* cfront 1.2 defines \"c_plusplus\" instead of \"__cplusplus\" */",
  20.   "#ifdef c_plusplus",
  21.   "#ifndef __cplusplus",
  22.   "#define __cplusplus",
  23.   "#endif",
  24.   "#endif",
  25.   "",
  26.   "",
  27.   "#ifdef __cplusplus",
  28.   "",
  29.   "#include <stdlib.h>",
  30.   "%+",
  31.   "class istream;",
  32.   "%*",
  33.   "#include <unistd.h>",
  34.   "",
  35.   "/* Use prototypes in function declarations. */",
  36.   "#define YY_USE_PROTOS",
  37.   "",
  38.   "/* The \"const\" storage-class-modifier is valid. */",
  39.   "#define YY_USE_CONST",
  40.   "",
  41.   "#else    /* ! __cplusplus */",
  42.   "",
  43.   "#ifdef __STDC__",
  44.   "",
  45.   "#define YY_USE_PROTOS",
  46.   "#define YY_USE_CONST",
  47.   "",
  48.   "#endif    /* __STDC__ */",
  49.   "#endif    /* ! __cplusplus */",
  50.   "",
  51.   "",
  52.   "#ifdef __TURBOC__",
  53.   "#define YY_USE_CONST",
  54.   "#endif",
  55.   "",
  56.   "",
  57.   "#ifndef YY_USE_CONST",
  58.   "#ifndef const",
  59.   "#define const",
  60.   "#endif",
  61.   "#endif",
  62.   "",
  63.   "",
  64.   "#ifdef YY_USE_PROTOS",
  65.   "#define YY_PROTO(proto) proto",
  66.   "#else",
  67.   "#define YY_PROTO(proto) ()",
  68.   "#endif",
  69.   "",
  70.   "/* Returned upon end-of-file. */",
  71.   "#define YY_NULL 0",
  72.   "",
  73.   "/* Promotes a possibly negative, possibly signed char to an unsigned",
  74.   " * integer for use as an array index.  If the signed char is negative,",
  75.   " * we want to instead treat it as an 8-bit unsigned char, hence the",
  76.   " * double cast.",
  77.   " */",
  78.   "#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)",
  79.   "",
  80.   "/* Enter a start condition.  This macro really ought to take a parameter,",
  81.   " * but we do it the disgusting crufty way forced on us by the ()-less",
  82.   " * definition of BEGIN.",
  83.   " */",
  84.   "#define BEGIN yy_start = 1 + 2 *",
  85.   "",
  86.   "/* Translate the current start state into a value that can be later handed",
  87.   " * to BEGIN to return to the state.",
  88.   " */",
  89.   "#define YY_START ((yy_start - 1) / 2)",
  90.   "",
  91.   "/* Action number for EOF rule of a given start state. */",
  92.   "#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)",
  93.   "",
  94.   "/* Special action meaning \"start processing a new file\".  Now included",
  95.   " * only for backward compatibility with previous versions of flex.",
  96.   " */",
  97.   "#define YY_NEW_FILE yyrestart( yyin )",
  98.   "",
  99.   "#define YY_END_OF_BUFFER_CHAR 0",
  100.   "",
  101.   "/* Size of default input buffer. */",
  102.   "#define YY_BUF_SIZE 16384",
  103.   "",
  104.   "typedef struct yy_buffer_state *YY_BUFFER_STATE;",
  105.   "",
  106.   "extern int yyleng;",
  107.   "%-",
  108.   "extern FILE *yyin, *yyout;",
  109.   "%*",
  110.   "",
  111.   "#ifdef __cplusplus",
  112.   "extern \"C\" {",
  113.   "#endif",
  114.   "    extern int yywrap YY_PROTO(( void ));",
  115.   "#ifdef __cplusplus",
  116.   "    }",
  117.   "#endif",
  118.   "",
  119.   "#define EOB_ACT_CONTINUE_SCAN 0",
  120.   "#define EOB_ACT_END_OF_FILE 1",
  121.   "#define EOB_ACT_LAST_MATCH 2",
  122.   "",
  123.   "/* The funky do-while in the following #define is used to turn the definition",
  124.   " * int a single C statement (which needs a semi-colon terminator).  This",
  125.   " * avoids problems with code like:",
  126.   " *",
  127.   " *     if ( condition_holds )",
  128.   " *        yyless( 5 );",
  129.   " *    else",
  130.   " *        do_something_else();",
  131.   " *",
  132.   " * Prior to using the do-while the compiler would get upset at the",
  133.   " * \"else\" because it interpreted the \"if\" statement as being all",
  134.   " * done when it reached the ';' after the yyless() call.",
  135.   " */",
  136.   "",
  137.   "/* Return all but the first 'n' matched characters back to the input stream. */",
  138.   "",
  139.   "#define yyless(n) \\",
  140.   "    do \\",
  141.   "        { \\",
  142.   "        /* Undo effects of setting up yytext. */ \\",
  143.   "        *yy_cp = yy_hold_char; \\",
  144.   "        yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \\",
  145.   "        YY_DO_BEFORE_ACTION; /* set up yytext again */ \\",
  146.   "        } \\",
  147.   "    while ( 0 )",
  148.   "",
  149.   "#define unput(c) yyunput( c, yytext_ptr )",
  150.   "",
  151.   "",
  152.   "struct yy_buffer_state",
  153.   "    {",
  154.   "%-",
  155.   "    FILE *yy_input_file;",
  156.   "%+",
  157.   "    istream* yy_input_file;",
  158.   "%*",
  159.   "",
  160.   "    char *yy_ch_buf;        /* input buffer */",
  161.   "    char *yy_buf_pos;        /* current position in input buffer */",
  162.   "",
  163.   "    /* Size of input buffer in bytes, not including room for EOB",
  164.   "     * characters.",
  165.   "     */",
  166.   "    int yy_buf_size;",
  167.   "",
  168.   "    /* Number of characters read into yy_ch_buf, not including EOB",
  169.   "     * characters.",
  170.   "     */",
  171.   "    int yy_n_chars;",
  172.   "",
  173.   "    /* Whether this is an \"interactive\" input source; if so, and",
  174.   "     * if we're using stdio for input, then we want to use getc()",
  175.   "     * instead of fread(), to make sure we stop fetching input after",
  176.   "     * each newline.",
  177.   "     */",
  178.   "    int yy_is_interactive;",
  179.   "",
  180.   "    /* Whether to try to fill the input buffer when we reach the",
  181.   "     * end of it.",
  182.   "     */",
  183.   "    int yy_fill_buffer;",
  184.   "",
  185.   "    /* Whether we've seen an EOF on this buffer. */",
  186.   "    int yy_eof_status;",
  187.   "#define EOF_NOT_SEEN 0",
  188.   "    /* \"Pending\" happens when the EOF has been seen but there's still",
  189.   "     * some text to process.  Note that when we actually see the EOF,",
  190.   "     * we switch the status back to \"not seen\" (via yyrestart()), so",
  191.   "     * that the user can continue scanning by just pointing yyin at",
  192.   "     * a new input file.",
  193.   "     */",
  194.   "#define EOF_PENDING 1",
  195.   "    };",
  196.   "",
  197.   "%- Standard (non-C++) definition",
  198.   "static YY_BUFFER_STATE yy_current_buffer = 0;",
  199.   "%*",
  200.   "",
  201.   "/* We provide macros for accessing buffer states in case in the",
  202.   " * future we want to put the buffer states in a more general",
  203.   " * \"scanner state\".",
  204.   " */",
  205.   "#define YY_CURRENT_BUFFER yy_current_buffer",
  206.   "",
  207.   "",
  208.   "%- Standard (non-C++) definition",
  209.   "/* yy_hold_char holds the character lost when yytext is formed. */",
  210.   "static char yy_hold_char;",
  211.   "",
  212.   "static int yy_n_chars;        /* number of characters read into yy_ch_buf */",
  213.   "",
  214.   "",
  215.   "int yyleng;",
  216.   "",
  217.   "/* Points to current character in buffer. */",
  218.   "static char *yy_c_buf_p = (char *) 0;",
  219.   "static int yy_init = 1;        /* whether we need to initialize */",
  220.   "static int yy_start = 0;    /* start state number */",
  221.   "",
  222.   "/* Flag which is used to allow yywrap()'s to do buffer switches",
  223.   " * instead of setting up a fresh yyin.  A bit of a hack ...",
  224.   " */",
  225.   "static int yy_did_buffer_switch_on_eof;",
  226.   "",
  227.   "static void yyunput YY_PROTO(( int c, char *buf_ptr ));",
  228.   "void yyrestart YY_PROTO(( FILE *input_file ));",
  229.   "void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));",
  230.   "void yy_load_buffer_state YY_PROTO(( void ));",
  231.   "YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));",
  232.   "void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));",
  233.   "void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));",
  234.   "",
  235.   "static int yy_start_stack_ptr = 0;",
  236.   "static int yy_start_stack_depth = 0;",
  237.   "static int *yy_start_stack = 0;",
  238.   "static void yy_push_state YY_PROTO(( int new_state ));",
  239.   "static void yy_pop_state YY_PROTO(( void ));",
  240.   "static int yy_top_state YY_PROTO(( void ));",
  241.   "%*",
  242.   "",
  243.   "#ifndef yytext_ptr",
  244.   "static void yy_flex_strcpy YY_PROTO(( char *, const char * ));",
  245.   "#endif",
  246.   "",
  247.   "static void *yy_flex_alloc YY_PROTO(( unsigned int ));",
  248.   "static void *yy_flex_realloc YY_PROTO(( void *ptr, unsigned int ));",
  249.   "static void yy_flex_free YY_PROTO(( void * ));",
  250.   "",
  251.   "#define yy_new_buffer yy_create_buffer",
  252.   "",
  253.   "%% yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here",
  254.   "",
  255.   "%- Standard (non-C++) definition",
  256.   "#ifdef __cplusplus",
  257.   "static int yyinput YY_PROTO(( void ));",
  258.   "#else",
  259.   "static int input YY_PROTO(( void ));",
  260.   "#endif",
  261.   "%*",
  262.   "",
  263.   "%- Standard (non-C++) definition",
  264.   "static yy_state_type yy_get_previous_state YY_PROTO(( void ));",
  265.   "static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));",
  266.   "static int yy_get_next_buffer YY_PROTO(( void ));",
  267.   "static void yy_fatal_error YY_PROTO(( const char msg[] ));",
  268.   "%*",
  269.   "",
  270.   "/* Done after the current pattern has been matched and before the",
  271.   " * corresponding action - sets up yytext.",
  272.   " */",
  273.   "#define YY_DO_BEFORE_ACTION \\",
  274.   "    yytext_ptr = yy_bp; \\",
  275.   "%%