home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2002 April / pcpro0402.iso / essentials / graphics / Gimp / gimp-src-20001226.exe / src / gimp / plug-ins / imagemap / imap_ncsa_lex.c < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-22  |  42.8 KB  |  1,697 lines

  1. #define yy_create_buffer ncsa__create_buffer
  2. #define yy_delete_buffer ncsa__delete_buffer
  3. #define yy_scan_buffer ncsa__scan_buffer
  4. #define yy_scan_string ncsa__scan_string
  5. #define yy_scan_bytes ncsa__scan_bytes
  6. #define yy_flex_debug ncsa__flex_debug
  7. #define yy_init_buffer ncsa__init_buffer
  8. #define yy_flush_buffer ncsa__flush_buffer
  9. #define yy_load_buffer_state ncsa__load_buffer_state
  10. #define yy_switch_to_buffer ncsa__switch_to_buffer
  11. #define yyin ncsa_in
  12. #define yyleng ncsa_leng
  13. #define yylex ncsa_lex
  14. #define yyout ncsa_out
  15. #define yyrestart ncsa_restart
  16. #define yytext ncsa_text
  17.  
  18. #line 19 "imap_ncsa_lex.c"
  19. /* A lexical scanner generated by flex */
  20.  
  21. /* Scanner skeleton version:
  22.  * $Header: /cvs/gnome/gimp/plug-ins/imagemap/imap_ncsa_lex.c,v 1.3 2000/05/22 17:10:17 mitch Exp $
  23.  */
  24.  
  25. #define FLEX_SCANNER
  26. #define YY_FLEX_MAJOR_VERSION 2
  27. #define YY_FLEX_MINOR_VERSION 5
  28.  
  29. #include <stdio.h>
  30.  
  31.  
  32. /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
  33. #ifdef c_plusplus
  34. #ifndef __cplusplus
  35. #define __cplusplus
  36. #endif
  37. #endif
  38.  
  39.  
  40. #ifdef __cplusplus
  41.  
  42. #include <stdlib.h>
  43. #include <unistd.h>
  44.  
  45. /* Use prototypes in function declarations. */
  46. #define YY_USE_PROTOS
  47.  
  48. /* The "const" storage-class-modifier is valid. */
  49. #define YY_USE_CONST
  50.  
  51. #else    /* ! __cplusplus */
  52.  
  53. #if __STDC__
  54.  
  55. #define YY_USE_PROTOS
  56. #define YY_USE_CONST
  57.  
  58. #endif    /* __STDC__ */
  59. #endif    /* ! __cplusplus */
  60.  
  61. #ifdef __TURBOC__
  62.  #pragma warn -rch
  63.  #pragma warn -use
  64. #include <io.h>
  65. #include <stdlib.h>
  66. #define YY_USE_CONST
  67. #define YY_USE_PROTOS
  68. #endif
  69.  
  70. #ifdef YY_USE_CONST
  71. #define yyconst const
  72. #else
  73. #define yyconst
  74. #endif
  75.  
  76.  
  77. #ifdef YY_USE_PROTOS
  78. #define YY_PROTO(proto) proto
  79. #else
  80. #define YY_PROTO(proto) ()
  81. #endif
  82.  
  83. /* Returned upon end-of-file. */
  84. #define YY_NULL 0
  85.  
  86. /* Promotes a possibly negative, possibly signed char to an unsigned
  87.  * integer for use as an array index.  If the signed char is negative,
  88.  * we want to instead treat it as an 8-bit unsigned char, hence the
  89.  * double cast.
  90.  */
  91. #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
  92.  
  93. /* Enter a start condition.  This macro really ought to take a parameter,
  94.  * but we do it the disgusting crufty way forced on us by the ()-less
  95.  * definition of BEGIN.
  96.  */
  97. #define BEGIN yy_start = 1 + 2 *
  98.  
  99. /* Translate the current start state into a value that can be later handed
  100.  * to BEGIN to return to the state.  The YYSTATE alias is for lex
  101.  * compatibility.
  102.  */
  103. #define YY_START ((yy_start - 1) / 2)
  104. #define YYSTATE YY_START
  105.  
  106. /* Action number for EOF rule of a given start state. */
  107. #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
  108.  
  109. /* Special action meaning "start processing a new file". */
  110. #define YY_NEW_FILE yyrestart( yyin )
  111.  
  112. #define YY_END_OF_BUFFER_CHAR 0
  113.  
  114. /* Size of default input buffer. */
  115. #define YY_BUF_SIZE 16384
  116.  
  117. typedef struct yy_buffer_state *YY_BUFFER_STATE;
  118.  
  119. extern int yyleng;
  120. extern FILE *yyin, *yyout;
  121.  
  122. #define EOB_ACT_CONTINUE_SCAN 0
  123. #define EOB_ACT_END_OF_FILE 1
  124. #define EOB_ACT_LAST_MATCH 2
  125.  
  126. /* The funky do-while in the following #define is used to turn the definition
  127.  * int a single C statement (which needs a semi-colon terminator).  This
  128.  * avoids problems with code like:
  129.  *
  130.  *     if ( condition_holds )
  131.  *        yyless( 5 );
  132.  *    else
  133.  *        do_something_else();
  134.  *
  135.  * Prior to using the do-while the compiler would get upset at the
  136.  * "else" because it interpreted the "if" statement as being all
  137.  * done when it reached the ';' after the yyless() call.
  138.  */
  139.  
  140. /* Return all but the first 'n' matched characters back to the input stream. */
  141.  
  142. #define yyless(n) \
  143.     do \
  144.         { \
  145.         /* Undo effects of setting up yytext. */ \
  146.         *yy_cp = yy_hold_char; \
  147.         YY_RESTORE_YY_MORE_OFFSET \
  148.         yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
  149.         YY_DO_BEFORE_ACTION; /* set up yytext again */ \
  150.         } \
  151.     while ( 0 )
  152.  
  153. #define unput(c) yyunput( c, yytext_ptr )
  154.  
  155. /* The following is because we cannot portably get our hands on size_t
  156.  * (without autoconf's help, which isn't available because we want
  157.  * flex-generated scanners to compile on their own).
  158.  */
  159. typedef unsigned int yy_size_t;
  160.  
  161.  
  162. struct yy_buffer_state
  163.     {
  164.     FILE *yy_input_file;
  165.  
  166.     char *yy_ch_buf;        /* input buffer */
  167.     char *yy_buf_pos;        /* current position in input buffer */
  168.  
  169.     /* Size of input buffer in bytes, not including room for EOB
  170.      * characters.
  171.      */
  172.     yy_size_t yy_buf_size;
  173.  
  174.     /* Number of characters read into yy_ch_buf, not including EOB
  175.      * characters.
  176.      */
  177.     int yy_n_chars;
  178.  
  179.     /* Whether we "own" the buffer - i.e., we know we created it,
  180.      * and can realloc() it to grow it, and should free() it to
  181.      * delete it.
  182.      */
  183.     int yy_is_our_buffer;
  184.  
  185.     /* Whether this is an "interactive" input source; if so, and
  186.      * if we're using stdio for input, then we want to use getc()
  187.      * instead of fread(), to make sure we stop fetching input after
  188.      * each newline.
  189.      */
  190.     int yy_is_interactive;
  191.  
  192.     /* Whether we're considered to be at the beginning of a line.
  193.      * If so, '^' rules will be active on the next match, otherwise
  194.      * not.
  195.      */
  196.     int yy_at_bol;
  197.  
  198.     /* Whether to try to fill the input buffer when we reach the
  199.      * end of it.
  200.      */
  201.     int yy_fill_buffer;
  202.  
  203.     int yy_buffer_status;
  204. #define YY_BUFFER_NEW 0
  205. #define YY_BUFFER_NORMAL 1
  206.     /* When an EOF's been seen but there's still some text to process
  207.      * then we mark the buffer as YY_EOF_PENDING, to indicate that we
  208.      * shouldn't try reading from the input source any more.  We might
  209.      * still have a bunch of tokens to match, though, because of
  210.      * possible backing-up.
  211.      *
  212.      * When we actually see the EOF, we change the status to "new"
  213.      * (via yyrestart()), so that the user can continue scanning by
  214.      * just pointing yyin at a new input file.
  215.      */
  216. #define YY_BUFFER_EOF_PENDING 2
  217.     };
  218.  
  219. static YY_BUFFER_STATE yy_current_buffer = 0;
  220.  
  221. /* We provide macros for accessing buffer states in case in the
  222.  * future we want to put the buffer states in a more general
  223.  * "scanner state".
  224.  */
  225. #define YY_CURRENT_BUFFER yy_current_buffer
  226.  
  227.  
  228. /* yy_hold_char holds the character lost when yytext is formed. */
  229. static char yy_hold_char;
  230.  
  231. static int yy_n_chars;        /* number of characters read into yy_ch_buf */
  232.  
  233.  
  234. int yyleng;
  235.  
  236. /* Points to current character in buffer. */
  237. static char *yy_c_buf_p = (char *) 0;
  238. static int yy_init = 1;        /* whether we need to initialize */
  239. static int yy_start = 0;    /* start state number */
  240.  
  241. /* Flag which is used to allow yywrap()'s to do buffer switches
  242.  * instead of setting up a fresh yyin.  A bit of a hack ...
  243.  */
  244. static int yy_did_buffer_switch_on_eof;
  245.  
  246. void yyrestart YY_PROTO(( FILE *input_file ));
  247.  
  248. void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
  249. void yy_load_buffer_state YY_PROTO(( void ));
  250. YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
  251. void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
  252. void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
  253. void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
  254. #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
  255.  
  256. YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
  257. YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
  258. YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
  259.  
  260. static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
  261. static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
  262. static void yy_flex_free YY_PROTO(( void * ));
  263.  
  264. #define yy_new_buffer yy_create_buffer
  265.  
  266. #define yy_set_interactive(is_interactive) \
  267.     { \
  268.     if ( ! yy_current_buffer ) \
  269.         yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
  270.     yy_current_buffer->yy_is_interactive = is_interactive; \
  271.     }
  272.  
  273. #define yy_set_bol(at_bol) \
  274.     { \
  275.     if ( ! yy_current_buffer ) \
  276.         yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
  277.     yy_current_buffer->yy_at_bol = at_bol; \
  278.     }
  279.  
  280. #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
  281.  
  282.  
  283. #define yywrap() 1
  284. #define YY_SKIP_YYWRAP
  285. typedef unsigned char YY_CHAR;
  286. FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
  287. typedef int yy_state_type;
  288. extern char *yytext;
  289. #define yytext_ptr yytext
  290.  
  291. static yy_state_type yy_get_previous_state YY_PROTO(( void ));
  292. static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
  293. static int yy_get_next_buffer YY_PROTO(( void ));
  294. static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
  295.  
  296. /* Done after the current pattern has been matched and before the
  297.  * corresponding action - sets up yytext.
  298.  */
  299. #define YY_DO_BEFORE_ACTION \
  300.     yytext_ptr = yy_bp; \
  301.     yyleng = (int) (yy_cp - yy_bp); \
  302.     yy_hold_char = *yy_cp; \
  303.     *yy_cp = '\0'; \
  304.     yy_c_buf_p = yy_cp;
  305.  
  306. #define YY_NUM_RULES 14
  307. #define YY_END_OF_BUFFER 15
  308. static yyconst short int yy_accept[76] =
  309.     {   0,
  310.        11,   11,    0,    0,    5,    5,   15,   13,   12,   12,
  311.         4,   11,   11,   11,   13,   13,   11,   13,   13,   10,
  312.        14,    5,   12,    0,   11,   11,   11,   11,    0,    0,
  313.        11,   11,    0,    0,   10,    5,    0,    0,    0,    0,
  314.         0,    0,    0,    0,    0,    0,    0,    0,    8,    6,
  315.         0,    0,    0,    0,    0,    0,    0,    0,    7,    0,
  316.         0,    0,    0,    9,    0,    0,    2,    1,    0,    0,
  317.         0,    0,    0,    3,    0
  318.     } ;
  319.  
  320. static yyconst int yy_ec[256] =
  321.     {   0,
  322.         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
  323.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  324.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  325.         1,    2,    1,    1,    4,    5,    1,    1,    1,    1,
  326.         1,    1,    6,    7,    8,    9,    1,   10,   10,   10,
  327.        10,   10,   10,   10,   10,   10,   10,   11,    1,    1,
  328.         1,    1,    1,    1,   12,    1,   13,   14,   15,   16,
  329.         1,   17,   18,    1,    1,   19,    1,   20,   21,   22,
  330.         1,   23,   24,   25,   26,    1,    1,    1,   27,    1,
  331.         1,    1,    1,    1,    1,    1,   12,    1,   13,   14,
  332.  
  333.        15,   16,    1,   17,   18,    1,    1,   19,    1,   20,
  334.        21,   22,    1,   23,   24,   25,   26,    1,    1,    1,
  335.        27,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  336.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  337.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  338.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  339.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  340.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  341.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  342.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  343.  
  344.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  345.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  346.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  347.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  348.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  349.         1,    1,    1,    1,    1
  350.     } ;
  351.  
  352. static yyconst int yy_meta[28] =
  353.     {   0,
  354.         1,    2,    3,    1,    1,    1,    2,    1,    1,    1,
  355.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  356.         1,    1,    1,    1,    1,    1,    1
  357.     } ;
  358.  
  359. static yyconst short int yy_base[80] =
  360.     {   0,
  361.         0,    0,   26,   28,  114,  113,  115,  118,   34,   36,
  362.       109,   31,   32,   34,   95,   97,   42,   90,   95,    0,
  363.       118,    0,   51,   20,   41,   48,   54,   51,   86,   92,
  364.        97,   96,   86,   91,    0,    0,   77,   87,   83,   87,
  365.        87,   71,   72,   71,   71,   69,   74,   66,  118,  118,
  366.        74,   77,   70,   73,   68,   65,   62,   69,  118,   58,
  367.        59,   63,   69,  118,   68,   56,  118,  118,   52,   58,
  368.        54,   45,   48,  118,  118,   66,   69,   54,   72
  369.     } ;
  370.  
  371. static yyconst short int yy_def[80] =
  372.     {   0,
  373.        75,    1,   76,   76,   77,   77,   75,   75,   75,   75,
  374.        75,   75,   75,   75,   75,   75,   75,   75,   75,   78,
  375.        75,   79,   75,   75,   75,   75,   75,   75,   75,   75,
  376.        75,   75,   75,   75,   78,   79,   75,   75,   75,   75,
  377.        75,   75,   75,   75,   75,   75,   75,   75,   75,   75,
  378.        75,   75,   75,   75,   75,   75,   75,   75,   75,   75,
  379.        75,   75,   75,   75,   75,   75,   75,   75,   75,   75,
  380.        75,   75,   75,   75,    0,   75,   75,   75,   75
  381.     } ;
  382.  
  383. static yyconst short int yy_nxt[146] =
  384.     {   0,
  385.         8,    9,   10,   11,    8,    8,    8,   12,   13,   14,
  386.         8,    8,   15,   16,   17,    8,    8,    8,    8,    8,
  387.         8,   18,   19,    8,    8,    8,    8,   21,   21,   21,
  388.        21,   37,   21,   38,   21,   23,   23,   23,   23,   25,
  389.        26,   28,   25,   26,   39,   27,   27,   31,   27,   31,
  390.        28,   32,   23,   23,   35,   27,   25,   26,   74,   31,
  391.        28,   31,   27,   32,   73,   27,   20,   20,   20,   22,
  392.        22,   22,   36,   36,   72,   71,   70,   69,   68,   67,
  393.        66,   65,   64,   63,   62,   61,   60,   59,   58,   57,
  394.        56,   55,   54,   53,   52,   51,   50,   49,   48,   47,
  395.  
  396.        46,   45,   44,   43,   42,   32,   32,   41,   40,   34,
  397.        33,   30,   29,   24,   75,   21,   21,    7,   75,   75,
  398.        75,   75,   75,   75,   75,   75,   75,   75,   75,   75,
  399.        75,   75,   75,   75,   75,   75,   75,   75,   75,   75,
  400.        75,   75,   75,   75,   75
  401.     } ;
  402.  
  403. static yyconst short int yy_chk[146] =
  404.     {   0,
  405.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  406.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  407.         1,    1,    1,    1,    1,    1,    1,    3,    3,    4,
  408.         4,   24,    3,   24,    4,    9,    9,   10,   10,   12,
  409.        12,   13,   14,   14,   24,   12,   13,   17,   14,   17,
  410.        25,   17,   23,   23,   78,   25,   26,   26,   73,   27,
  411.        28,   27,   26,   27,   72,   28,   76,   76,   76,   77,
  412.        77,   77,   79,   79,   71,   70,   69,   66,   65,   63,
  413.        62,   61,   60,   58,   57,   56,   55,   54,   53,   52,
  414.        51,   48,   47,   46,   45,   44,   43,   42,   41,   40,
  415.  
  416.        39,   38,   37,   34,   33,   32,   31,   30,   29,   19,
  417.        18,   16,   15,   11,    7,    6,    5,   75,   75,   75,
  418.        75,   75,   75,   75,   75,   75,   75,   75,   75,   75,
  419.        75,   75,   75,   75,   75,   75,   75,   75,   75,   75,
  420.        75,   75,   75,   75,   75
  421.     } ;
  422.  
  423. static yy_state_type yy_last_accepting_state;
  424. static char *yy_last_accepting_cpos;
  425.  
  426. /* The intent behind this definition is that it'll catch
  427.  * any uses of REJECT which flex missed.
  428.  */
  429. #define REJECT reject_used_but_not_detected
  430. #define yymore() yymore_used_but_not_detected
  431. #define YY_MORE_ADJ 0
  432. #define YY_RESTORE_YY_MORE_OFFSET
  433. char *yytext;
  434. #line 1 "imap_ncsa.l"
  435. #define INITIAL 0
  436. #line 2 "imap_ncsa.l"
  437. /*
  438.  * This is a plug-in for the GIMP.
  439.  *
  440.  * Generates clickable image maps.
  441.  *
  442.  * Copyright (C) 1998-1999 Maurits Rijk  lpeek.mrijk@consunet.nl
  443.  *
  444.  * This program is free software; you can redistribute it and/or modify
  445.  * it under the terms of the GNU General Public License as published by
  446.  * the Free Software Foundation; either version 2 of the License, or
  447.  * (at your option) any later version.
  448.  *
  449.  * This program is distributed in the hope that it will be useful,
  450.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  451.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  452.  * GNU General Public License for more details.
  453.  *
  454.  * You should have received a copy of the GNU General Public License
  455.  * along with this program; if not, write to the Free Software
  456.  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  457.  *
  458.  */
  459.  
  460. #include "imap_ncsa_parse.h"
  461. #define link 1
  462.  
  463. #define comment 2
  464.  
  465. #line 466 "imap_ncsa_lex.c"
  466.  
  467. /* Macros after this point can all be overridden by user definitions in
  468.  * section 1.
  469.  */
  470.  
  471. #ifndef YY_SKIP_YYWRAP
  472. #ifdef __cplusplus
  473. extern "C" int yywrap YY_PROTO(( void ));
  474. #else
  475. extern int yywrap YY_PROTO(( void ));
  476. #endif
  477. #endif
  478.  
  479. #ifndef YY_NO_UNPUT
  480. static void yyunput YY_PROTO(( int c, char *buf_ptr ));
  481. #endif
  482.  
  483. #ifndef yytext_ptr
  484. static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
  485. #endif
  486.  
  487. #ifdef YY_NEED_STRLEN
  488. static int yy_flex_strlen YY_PROTO(( yyconst char * ));
  489. #endif
  490.  
  491. #ifndef YY_NO_INPUT
  492. #ifdef __cplusplus
  493. static int yyinput YY_PROTO(( void ));
  494. #else
  495. static int input YY_PROTO(( void ));
  496. #endif
  497. #endif
  498.  
  499. #if YY_STACK_USED
  500. static int yy_start_stack_ptr = 0;
  501. static int yy_start_stack_depth = 0;
  502. static int *yy_start_stack = 0;
  503. #ifndef YY_NO_PUSH_STATE
  504. static void yy_push_state YY_PROTO(( int new_state ));
  505. #endif
  506. #ifndef YY_NO_POP_STATE
  507. static void yy_pop_state YY_PROTO(( void ));
  508. #endif
  509. #ifndef YY_NO_TOP_STATE
  510. static int yy_top_state YY_PROTO(( void ));
  511. #endif
  512.  
  513. #else
  514. #define YY_NO_PUSH_STATE 1
  515. #define YY_NO_POP_STATE 1
  516. #define YY_NO_TOP_STATE 1
  517. #endif
  518.  
  519. #ifdef YY_MALLOC_DECL
  520. YY_MALLOC_DECL
  521. #else
  522. #if __STDC__
  523. #ifndef __cplusplus
  524. #include <stdlib.h>
  525. #endif
  526. #else
  527. /* Just try to get by without declaring the routines.  This will fail
  528.  * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
  529.  * or sizeof(void*) != sizeof(int).
  530.  */
  531. #endif
  532. #endif
  533.  
  534. /* Amount of stuff to slurp up with each read. */
  535. #ifndef YY_READ_BUF_SIZE
  536. #define YY_READ_BUF_SIZE 8192
  537. #endif
  538.  
  539. /* Copy whatever the last rule matched to the standard output. */
  540.  
  541. #ifndef ECHO
  542. /* This used to be an fputs(), but since the string might contain NUL's,
  543.  * we now use fwrite().
  544.  */
  545. #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
  546. #endif
  547.  
  548. /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
  549.  * is returned in "result".
  550.  */
  551. #ifndef YY_INPUT
  552. #define YY_INPUT(buf,result,max_size) \
  553.     if ( yy_current_buffer->yy_is_interactive ) \
  554.         { \
  555.         int c = '*', n; \
  556.         for ( n = 0; n < max_size && \
  557.                  (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
  558.             buf[n] = (char) c; \
  559.         if ( c == '\n' ) \
  560.             buf[n++] = (char) c; \
  561.         if ( c == EOF && ferror( yyin ) ) \
  562.             YY_FATAL_ERROR( "input in flex scanner failed" ); \
  563.         result = n; \
  564.         } \
  565.     else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
  566.           && ferror( yyin ) ) \
  567.         YY_FATAL_ERROR( "input in flex scanner failed" );
  568. #endif
  569.  
  570. /* No semi-colon after return; correct usage is to write "yyterminate();" -
  571.  * we don't want an extra ';' after the "return" because that will cause
  572.  * some compilers to complain about unreachable statements.
  573.  */
  574. #ifndef yyterminate
  575. #define yyterminate() return YY_NULL
  576. #endif
  577.  
  578. /* Number of entries by which start-condition stack grows. */
  579. #ifndef YY_START_STACK_INCR
  580. #define YY_START_STACK_INCR 25
  581. #endif
  582.  
  583. /* Report a fatal error. */
  584. #ifndef YY_FATAL_ERROR
  585. #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
  586. #endif
  587.  
  588. /* Default declaration of generated scanner - a define so the user can
  589.  * easily add parameters.
  590.  */
  591. #ifndef YY_DECL
  592. #define YY_DECL int yylex YY_PROTO(( void ))
  593. #endif
  594.  
  595. /* Code executed at the beginning of each rule, after yytext and yyleng
  596.  * have been set up.
  597.  */
  598. #ifndef YY_USER_ACTION
  599. #define YY_USER_ACTION
  600. #endif
  601.  
  602. /* Code executed at the end of each rule. */
  603. #ifndef YY_BREAK
  604. #define YY_BREAK break;
  605. #endif
  606.  
  607. #define YY_RULE_SETUP \
  608.     YY_USER_ACTION
  609.  
  610. YY_DECL
  611.     {
  612.     register yy_state_type yy_current_state;
  613.     register char *yy_cp, *yy_bp;
  614.     register int yy_act;
  615.  
  616. #line 37 "imap_ncsa.l"
  617.  
  618.  
  619. #line 620 "imap_ncsa_lex.c"
  620.  
  621.     if ( yy_init )
  622.         {
  623.         yy_init = 0;
  624.  
  625. #ifdef YY_USER_INIT
  626.         YY_USER_INIT;
  627. #endif
  628.  
  629.         if ( ! yy_start )
  630.             yy_start = 1;    /* first start state */
  631.  
  632.         if ( ! yyin )
  633.             yyin = stdin;
  634.  
  635.         if ( ! yyout )
  636.             yyout = stdout;
  637.  
  638.         if ( ! yy_current_buffer )
  639.             yy_current_buffer =
  640.                 yy_create_buffer( yyin, YY_BUF_SIZE );
  641.  
  642.         yy_load_buffer_state();
  643.         }
  644.  
  645.     while ( 1 )        /* loops until end-of-file is reached */
  646.         {
  647.         yy_cp = yy_c_buf_p;
  648.  
  649.         /* Support of yytext. */
  650.         *yy_cp = yy_hold_char;
  651.  
  652.         /* yy_bp points to the position in yy_ch_buf of the start of
  653.          * the current run.
  654.          */
  655.         yy_bp = yy_cp;
  656.  
  657.         yy_current_state = yy_start;
  658. yy_match:
  659.         do
  660.             {
  661.             register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
  662.             if ( yy_accept[yy_current_state] )
  663.                 {
  664.                 yy_last_accepting_state = yy_current_state;
  665.                 yy_last_accepting_cpos = yy_cp;
  666.                 }
  667.             while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  668.                 {
  669.                 yy_current_state = (int) yy_def[yy_current_state];
  670.                 if ( yy_current_state >= 76 )
  671.                     yy_c = yy_meta[(unsigned int) yy_c];
  672.                 }
  673.             yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  674.             ++yy_cp;
  675.             }
  676.         while ( yy_base[yy_current_state] != 118 );
  677.  
  678. yy_find_action:
  679.         yy_act = yy_accept[yy_current_state];
  680.         if ( yy_act == 0 )
  681.             { /* have to back up */
  682.             yy_cp = yy_last_accepting_cpos;
  683.             yy_current_state = yy_last_accepting_state;
  684.             yy_act = yy_accept[yy_current_state];
  685.             }
  686.  
  687.         YY_DO_BEFORE_ACTION;
  688.  
  689.  
  690. do_action:    /* This label is used only to access EOF actions. */
  691.  
  692.  
  693.         switch ( yy_act )
  694.     { /* beginning of action switch */
  695.             case 0: /* must back up */
  696.             /* undo the effects of YY_DO_BEFORE_ACTION */
  697.             *yy_cp = yy_hold_char;
  698.             yy_cp = yy_last_accepting_cpos;
  699.             yy_current_state = yy_last_accepting_state;
  700.             goto yy_find_action;
  701.  
  702. case 1:
  703. YY_RULE_SETUP
  704. #line 39 "imap_ncsa.l"
  705. {
  706.                    BEGIN(comment);
  707.                    return AUTHOR;
  708.                 }
  709.     YY_BREAK
  710. case 2:
  711. YY_RULE_SETUP
  712. #line 44 "imap_ncsa.l"
  713. {
  714.                    BEGIN(comment);
  715.                    return TITLE;
  716.                 }
  717.     YY_BREAK
  718. case 3:
  719. YY_RULE_SETUP
  720. #line 49 "imap_ncsa.l"
  721. {
  722.                    BEGIN(comment);
  723.                    return DESCRIPTION;
  724.                 }
  725.     YY_BREAK
  726. case 4:
  727. YY_RULE_SETUP
  728. #line 54 "imap_ncsa.l"
  729. {
  730.                    BEGIN(comment);
  731.                    return BEGIN_COMMENT;
  732.                 }
  733.     YY_BREAK
  734. case 5:
  735. YY_RULE_SETUP
  736. #line 59 "imap_ncsa.l"
  737. {
  738.                    BEGIN(INITIAL);
  739.                       strcpy(ncsa_lval.id, yytext);
  740.                       return COMMENT;
  741.                 }
  742.     YY_BREAK
  743. case 6:
  744. YY_RULE_SETUP
  745. #line 65 "imap_ncsa.l"
  746. {
  747.                    BEGIN(link);
  748.                       return RECTANGLE;
  749.                 }
  750.     YY_BREAK
  751. case 7:
  752. YY_RULE_SETUP
  753. #line 70 "imap_ncsa.l"
  754. {
  755.                    BEGIN(link);
  756.                    return CIRCLE;
  757.                 }
  758.     YY_BREAK
  759. case 8:
  760. YY_RULE_SETUP
  761. #line 75 "imap_ncsa.l"
  762. {
  763.                    BEGIN(link);
  764.                    return POLYGON;
  765.                 }
  766.     YY_BREAK
  767. case 9:
  768. YY_RULE_SETUP
  769. #line 80 "imap_ncsa.l"
  770. {
  771.                    BEGIN(link);
  772.                    return DEFAULT;
  773.                 }
  774.     YY_BREAK
  775. case 10:
  776. YY_RULE_SETUP
  777. #line 85 "imap_ncsa.l"
  778. {
  779.                       BEGIN(INITIAL);
  780.                       strcpy(ncsa_lval.id, yytext);
  781.                    ncsa_lval.id[yyleng - 1] = '\0';
  782.                    return LINK;
  783.                 }
  784.     YY_BREAK
  785. case 11:
  786. YY_RULE_SETUP
  787. #line 92 "imap_ncsa.l"
  788. {
  789.                                    ncsa_lval.value = atof(yytext);
  790.                    return FLOAT;
  791.                 }
  792.     YY_BREAK
  793. case 12:
  794. YY_RULE_SETUP
  795. #line 97 "imap_ncsa.l"
  796. ; /* Eat white space */
  797.     YY_BREAK
  798. case 13:
  799. YY_RULE_SETUP
  800. #line 99 "imap_ncsa.l"
  801. return *yytext;
  802.     YY_BREAK
  803. case 14:
  804. YY_RULE_SETUP
  805. #line 101 "imap_ncsa.l"
  806. ECHO;
  807.     YY_BREAK
  808. #line 809 "imap_ncsa_lex.c"
  809. case YY_STATE_EOF(INITIAL):
  810. case YY_STATE_EOF(link):
  811. case YY_STATE_EOF(comment):
  812.     yyterminate();
  813.  
  814.     case YY_END_OF_BUFFER:
  815.         {
  816.         /* Amount of text matched not including the EOB char. */
  817.         int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
  818.  
  819.         /* Undo the effects of YY_DO_BEFORE_ACTION. */
  820.         *yy_cp = yy_hold_char;
  821.         YY_RESTORE_YY_MORE_OFFSET
  822.  
  823.         if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
  824.             {
  825.             /* We're scanning a new file or input source.  It's
  826.              * possible that this happened because the user
  827.              * just pointed yyin at a new source and called
  828.              * yylex().  If so, then we have to assure
  829.              * consistency between yy_current_buffer and our
  830.              * globals.  Here is the right place to do so, because
  831.              * this is the first action (other than possibly a
  832.              * back-up) that will match for the new input source.
  833.              */
  834.             yy_n_chars = yy_current_buffer->yy_n_chars;
  835.             yy_current_buffer->yy_input_file = yyin;
  836.             yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
  837.             }
  838.  
  839.         /* Note that here we test for yy_c_buf_p "<=" to the position
  840.          * of the first EOB in the buffer, since yy_c_buf_p will
  841.          * already have been incremented past the NUL character
  842.          * (since all states make transitions on EOB to the
  843.          * end-of-buffer state).  Contrast this with the test
  844.          * in input().
  845.          */
  846.         if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
  847.             { /* This was really a NUL. */
  848.             yy_state_type yy_next_state;
  849.  
  850.             yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
  851.  
  852.             yy_current_state = yy_get_previous_state();
  853.  
  854.             /* Okay, we're now positioned to make the NUL
  855.              * transition.  We couldn't have
  856.              * yy_get_previous_state() go ahead and do it
  857.              * for us because it doesn't know how to deal
  858.              * with the possibility of jamming (and we don't
  859.              * want to build jamming into it because then it
  860.              * will run more slowly).
  861.              */
  862.  
  863.             yy_next_state = yy_try_NUL_trans( yy_current_state );
  864.  
  865.             yy_bp = yytext_ptr + YY_MORE_ADJ;
  866.  
  867.             if ( yy_next_state )
  868.                 {
  869.                 /* Consume the NUL. */
  870.                 yy_cp = ++yy_c_buf_p;
  871.                 yy_current_state = yy_next_state;
  872.                 goto yy_match;
  873.                 }
  874.  
  875.             else
  876.                 {
  877.                 yy_cp = yy_c_buf_p;
  878.                 goto yy_find_action;
  879.                 }
  880.             }
  881.  
  882.         else switch ( yy_get_next_buffer() )
  883.             {
  884.             case EOB_ACT_END_OF_FILE:
  885.                 {
  886.                 yy_did_buffer_switch_on_eof = 0;
  887.  
  888.                 if ( yywrap() )
  889.                     {
  890.                     /* Note: because we've taken care in
  891.                      * yy_get_next_buffer() to have set up
  892.                      * yytext, we can now set up
  893.                      * yy_c_buf_p so that if some total
  894.                      * hoser (like flex itself) wants to
  895.                      * call the scanner after we return the
  896.                      * YY_NULL, it'll still work - another
  897.                      * YY_NULL will get returned.
  898.                      */
  899.                     yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
  900.  
  901.                     yy_act = YY_STATE_EOF(YY_START);
  902.                     goto do_action;
  903.                     }
  904.  
  905.                 else
  906.                     {
  907.                     if ( ! yy_did_buffer_switch_on_eof )
  908.                         YY_NEW_FILE;
  909.                     }
  910.                 break;
  911.                 }
  912.  
  913.             case EOB_ACT_CONTINUE_SCAN:
  914.                 yy_c_buf_p =
  915.                     yytext_ptr + yy_amount_of_matched_text;
  916.  
  917.                 yy_current_state = yy_get_previous_state();
  918.  
  919.                 yy_cp = yy_c_buf_p;
  920.                 yy_bp = yytext_ptr + YY_MORE_ADJ;
  921.                 goto yy_match;
  922.  
  923.             case EOB_ACT_LAST_MATCH:
  924.                 yy_c_buf_p =
  925.                 &yy_current_buffer->yy_ch_buf[yy_n_chars];
  926.  
  927.                 yy_current_state = yy_get_previous_state();
  928.  
  929.                 yy_cp = yy_c_buf_p;
  930.                 yy_bp = yytext_ptr + YY_MORE_ADJ;
  931.                 goto yy_find_action;
  932.             }
  933.         break;
  934.         }
  935.  
  936.     default:
  937.         YY_FATAL_ERROR(
  938.             "fatal flex scanner internal error--no action found" );
  939.     } /* end of action switch */
  940.         } /* end of scanning one token */
  941.     } /* end of yylex */
  942.  
  943.  
  944. /* yy_get_next_buffer - try to read in a new buffer
  945.  *
  946.  * Returns a code representing an action:
  947.  *    EOB_ACT_LAST_MATCH -
  948.  *    EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  949.  *    EOB_ACT_END_OF_FILE - end of file
  950.  */
  951.  
  952. static int yy_get_next_buffer()
  953.     {
  954.     register char *dest = yy_current_buffer->yy_ch_buf;
  955.     register char *source = yytext_ptr;
  956.     register int number_to_move, i;
  957.     int ret_val;
  958.  
  959.     if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
  960.         YY_FATAL_ERROR(
  961.         "fatal flex scanner internal error--end of buffer missed" );
  962.  
  963.     if ( yy_current_buffer->yy_fill_buffer == 0 )
  964.         { /* Don't try to fill the buffer, so this is an EOF. */
  965.         if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
  966.             {
  967.             /* We matched a single character, the EOB, so
  968.              * treat this as a final EOF.
  969.              */
  970.             return EOB_ACT_END_OF_FILE;
  971.             }
  972.  
  973.         else
  974.             {
  975.             /* We matched some text prior to the EOB, first
  976.              * process it.
  977.              */
  978.             return EOB_ACT_LAST_MATCH;
  979.             }
  980.         }
  981.  
  982.     /* Try to read more data. */
  983.  
  984.     /* First move last chars to start of buffer. */
  985.     number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
  986.  
  987.     for ( i = 0; i < number_to_move; ++i )
  988.         *(dest++) = *(source++);
  989.  
  990.     if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
  991.         /* don't do the read, it's not guaranteed to return an EOF,
  992.          * just force an EOF
  993.          */
  994.         yy_current_buffer->yy_n_chars = yy_n_chars = 0;
  995.  
  996.     else
  997.         {
  998.         int num_to_read =
  999.             yy_current_buffer->yy_buf_size - number_to_move - 1;
  1000.  
  1001.         while ( num_to_read <= 0 )
  1002.             { /* Not enough room in the buffer - grow it. */
  1003. #ifdef YY_USES_REJECT
  1004.             YY_FATAL_ERROR(
  1005. "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
  1006. #else
  1007.  
  1008.             /* just a shorter name for the current buffer */
  1009.             YY_BUFFER_STATE b = yy_current_buffer;
  1010.  
  1011.             int yy_c_buf_p_offset =
  1012.                 (int) (yy_c_buf_p - b->yy_ch_buf);
  1013.  
  1014.             if ( b->yy_is_our_buffer )
  1015.                 {
  1016.                 int new_size = b->yy_buf_size * 2;
  1017.  
  1018.                 if ( new_size <= 0 )
  1019.                     b->yy_buf_size += b->yy_buf_size / 8;
  1020.                 else
  1021.                     b->yy_buf_size *= 2;
  1022.  
  1023.                 b->yy_ch_buf = (char *)
  1024.                     /* Include room in for 2 EOB chars. */
  1025.                     yy_flex_realloc( (void *) b->yy_ch_buf,
  1026.                              b->yy_buf_size + 2 );
  1027.                 }
  1028.             else
  1029.                 /* Can't grow it, we don't own it. */
  1030.                 b->yy_ch_buf = 0;
  1031.  
  1032.             if ( ! b->yy_ch_buf )
  1033.                 YY_FATAL_ERROR(
  1034.                 "fatal error - scanner input buffer overflow" );
  1035.  
  1036.             yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
  1037.  
  1038.             num_to_read = yy_current_buffer->yy_buf_size -
  1039.                         number_to_move - 1;
  1040. #endif
  1041.             }
  1042.  
  1043.         if ( num_to_read > YY_READ_BUF_SIZE )
  1044.             num_to_read = YY_READ_BUF_SIZE;
  1045.  
  1046.         /* Read in more data. */
  1047.         YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
  1048.             yy_n_chars, num_to_read );
  1049.  
  1050.         yy_current_buffer->yy_n_chars = yy_n_chars;
  1051.         }
  1052.  
  1053.     if ( yy_n_chars == 0 )
  1054.         {
  1055.         if ( number_to_move == YY_MORE_ADJ )
  1056.             {
  1057.             ret_val = EOB_ACT_END_OF_FILE;
  1058.             yyrestart( yyin );
  1059.             }
  1060.  
  1061.         else
  1062.             {
  1063.             ret_val = EOB_ACT_LAST_MATCH;
  1064.             yy_current_buffer->yy_buffer_status =
  1065.                 YY_BUFFER_EOF_PENDING;
  1066.             }
  1067.         }
  1068.  
  1069.     else
  1070.         ret_val = EOB_ACT_CONTINUE_SCAN;
  1071.  
  1072.     yy_n_chars += number_to_move;
  1073.     yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
  1074.     yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
  1075.  
  1076.     yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
  1077.  
  1078.     return ret_val;
  1079.     }
  1080.  
  1081.  
  1082. /* yy_get_previous_state - get the state just before the EOB char was reached */
  1083.  
  1084. static yy_state_type yy_get_previous_state()
  1085.     {
  1086.     register yy_state_type yy_current_state;
  1087.     register char *yy_cp;
  1088.  
  1089.     yy_current_state = yy_start;
  1090.  
  1091.     for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
  1092.         {
  1093.         register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
  1094.         if ( yy_accept[yy_current_state] )
  1095.             {
  1096.             yy_last_accepting_state = yy_current_state;
  1097.             yy_last_accepting_cpos = yy_cp;
  1098.             }
  1099.         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1100.             {
  1101.             yy_current_state = (int) yy_def[yy_current_state];
  1102.             if ( yy_current_state >= 76 )
  1103.                 yy_c = yy_meta[(unsigned int) yy_c];
  1104.             }
  1105.         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  1106.         }
  1107.  
  1108.     return yy_current_state;
  1109.     }
  1110.  
  1111.  
  1112. /* yy_try_NUL_trans - try to make a transition on the NUL character
  1113.  *
  1114.  * synopsis
  1115.  *    next_state = yy_try_NUL_trans( current_state );
  1116.  */
  1117.  
  1118. #ifdef YY_USE_PROTOS
  1119. static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
  1120. #else
  1121. static yy_state_type yy_try_NUL_trans( yy_current_state )
  1122. yy_state_type yy_current_state;
  1123. #endif
  1124.     {
  1125.     register int yy_is_jam;
  1126.     register char *yy_cp = yy_c_buf_p;
  1127.  
  1128.     register YY_CHAR yy_c = 1;
  1129.     if ( yy_accept[yy_current_state] )
  1130.         {
  1131.         yy_last_accepting_state = yy_current_state;
  1132.         yy_last_accepting_cpos = yy_cp;
  1133.         }
  1134.     while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1135.         {
  1136.         yy_current_state = (int) yy_def[yy_current_state];
  1137.         if ( yy_current_state >= 76 )
  1138.             yy_c = yy_meta[(unsigned int) yy_c];
  1139.         }
  1140.     yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  1141.     yy_is_jam = (yy_current_state == 75);
  1142.  
  1143.     return yy_is_jam ? 0 : yy_current_state;
  1144.     }
  1145.  
  1146.  
  1147. #ifndef YY_NO_UNPUT
  1148. #ifdef YY_USE_PROTOS
  1149. static void yyunput( int c, register char *yy_bp )
  1150. #else
  1151. static void yyunput( c, yy_bp )
  1152. int c;
  1153. register char *yy_bp;
  1154. #endif
  1155.     {
  1156.     register char *yy_cp = yy_c_buf_p;
  1157.  
  1158.     /* undo effects of setting up yytext */
  1159.     *yy_cp = yy_hold_char;
  1160.  
  1161.     if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
  1162.         { /* need to shift things up to make room */
  1163.         /* +2 for EOB chars. */
  1164.         register int number_to_move = yy_n_chars + 2;
  1165.         register char *dest = &yy_current_buffer->yy_ch_buf[
  1166.                     yy_current_buffer->yy_buf_size + 2];
  1167.         register char *source =
  1168.                 &yy_current_buffer->yy_ch_buf[number_to_move];
  1169.  
  1170.         while ( source > yy_current_buffer->yy_ch_buf )
  1171.             *--dest = *--source;
  1172.  
  1173.         yy_cp += (int) (dest - source);
  1174.         yy_bp += (int) (dest - source);
  1175.         yy_current_buffer->yy_n_chars =
  1176.             yy_n_chars = yy_current_buffer->yy_buf_size;
  1177.  
  1178.         if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
  1179.             YY_FATAL_ERROR( "flex scanner push-back overflow" );
  1180.         }
  1181.  
  1182.     *--yy_cp = (char) c;
  1183.  
  1184.  
  1185.     yytext_ptr = yy_bp;
  1186.     yy_hold_char = *yy_cp;
  1187.     yy_c_buf_p = yy_cp;
  1188.     }
  1189. #endif    /* ifndef YY_NO_UNPUT */
  1190.  
  1191.  
  1192. #ifdef __cplusplus
  1193. static int yyinput()
  1194. #else
  1195. static int input()
  1196. #endif
  1197.     {
  1198.     int c;
  1199.  
  1200.     *yy_c_buf_p = yy_hold_char;
  1201.  
  1202.     if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
  1203.         {
  1204.         /* yy_c_buf_p now points to the character we want to return.
  1205.          * If this occurs *before* the EOB characters, then it's a
  1206.          * valid NUL; if not, then we've hit the end of the buffer.
  1207.          */
  1208.         if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
  1209.             /* This was really a NUL. */
  1210.             *yy_c_buf_p = '\0';
  1211.  
  1212.         else
  1213.             { /* need more input */
  1214.             int offset = yy_c_buf_p - yytext_ptr;
  1215.             ++yy_c_buf_p;
  1216.  
  1217.             switch ( yy_get_next_buffer() )
  1218.                 {
  1219.                 case EOB_ACT_LAST_MATCH:
  1220.                     /* This happens because yy_g_n_b()
  1221.                      * sees that we've accumulated a
  1222.                      * token and flags that we need to
  1223.                      * try matching the token before
  1224.                      * proceeding.  But for input(),
  1225.                      * there's no matching to consider.
  1226.                      * So convert the EOB_ACT_LAST_MATCH
  1227.                      * to EOB_ACT_END_OF_FILE.
  1228.                      */
  1229.  
  1230.                     /* Reset buffer status. */
  1231.                     yyrestart( yyin );
  1232.  
  1233.                     /* fall through */
  1234.  
  1235.                 case EOB_ACT_END_OF_FILE:
  1236.                     {
  1237.                     if ( yywrap() )
  1238.                         return EOF;
  1239.  
  1240.                     if ( ! yy_did_buffer_switch_on_eof )
  1241.                         YY_NEW_FILE;
  1242. #ifdef __cplusplus
  1243.                     return yyinput();
  1244. #else
  1245.                     return input();
  1246. #endif
  1247.                     }
  1248.  
  1249.                 case EOB_ACT_CONTINUE_SCAN:
  1250.                     yy_c_buf_p = yytext_ptr + offset;
  1251.                     break;
  1252.                 }
  1253.             }
  1254.         }
  1255.  
  1256.     c = *(unsigned char *) yy_c_buf_p;    /* cast for 8-bit char's */
  1257.     *yy_c_buf_p = '\0';    /* preserve yytext */
  1258.     yy_hold_char = *++yy_c_buf_p;
  1259.  
  1260.  
  1261.     return c;
  1262.     }
  1263.  
  1264.  
  1265. #ifdef YY_USE_PROTOS
  1266. void yyrestart( FILE *input_file )
  1267. #else
  1268. void yyrestart( input_file )
  1269. FILE *input_file;
  1270. #endif
  1271.     {
  1272.     if ( ! yy_current_buffer )
  1273.         yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
  1274.  
  1275.     yy_init_buffer( yy_current_buffer, input_file );
  1276.     yy_load_buffer_state();
  1277.     }
  1278.  
  1279.  
  1280. #ifdef YY_USE_PROTOS
  1281. void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
  1282. #else
  1283. void yy_switch_to_buffer( new_buffer )
  1284. YY_BUFFER_STATE new_buffer;
  1285. #endif
  1286.     {
  1287.     if ( yy_current_buffer == new_buffer )
  1288.         return;
  1289.  
  1290.     if ( yy_current_buffer )
  1291.         {
  1292.         /* Flush out information for old buffer. */
  1293.         *yy_c_buf_p = yy_hold_char;
  1294.         yy_current_buffer->yy_buf_pos = yy_c_buf_p;
  1295.         yy_current_buffer->yy_n_chars = yy_n_chars;
  1296.         }
  1297.  
  1298.     yy_current_buffer = new_buffer;
  1299.     yy_load_buffer_state();
  1300.  
  1301.     /* We don't actually know whether we did this switch during
  1302.      * EOF (yywrap()) processing, but the only time this flag
  1303.      * is looked at is after yywrap() is called, so it's safe
  1304.      * to go ahead and always set it.
  1305.      */
  1306.     yy_did_buffer_switch_on_eof = 1;
  1307.     }
  1308.  
  1309.  
  1310. #ifdef YY_USE_PROTOS
  1311. void yy_load_buffer_state( void )
  1312. #else
  1313. void yy_load_buffer_state()
  1314. #endif
  1315.     {
  1316.     yy_n_chars = yy_current_buffer->yy_n_chars;
  1317.     yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
  1318.     yyin = yy_current_buffer->yy_input_file;
  1319.     yy_hold_char = *yy_c_buf_p;
  1320.     }
  1321.  
  1322.  
  1323. #ifdef YY_USE_PROTOS
  1324. YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
  1325. #else
  1326. YY_BUFFER_STATE yy_create_buffer( file, size )
  1327. FILE *file;
  1328. int size;
  1329. #endif
  1330.     {
  1331.     YY_BUFFER_STATE b;
  1332.  
  1333.     b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
  1334.     if ( ! b )
  1335.         YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1336.  
  1337.     b->yy_buf_size = size;
  1338.  
  1339.     /* yy_ch_buf has to be 2 characters longer than the size given because
  1340.      * we need to put in 2 end-of-buffer characters.
  1341.      */
  1342.     b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
  1343.     if ( ! b->yy_ch_buf )
  1344.         YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1345.  
  1346.     b->yy_is_our_buffer = 1;
  1347.  
  1348.     yy_init_buffer( b, file );
  1349.  
  1350.     return b;
  1351.     }
  1352.  
  1353.  
  1354. #ifdef YY_USE_PROTOS
  1355. void yy_delete_buffer( YY_BUFFER_STATE b )
  1356. #else
  1357. void yy_delete_buffer( b )
  1358. YY_BUFFER_STATE b;
  1359. #endif
  1360.     {
  1361.     if ( ! b )
  1362.         return;
  1363.  
  1364.     if ( b == yy_current_buffer )
  1365.         yy_current_buffer = (YY_BUFFER_STATE) 0;
  1366.  
  1367.     if ( b->yy_is_our_buffer )
  1368.         yy_flex_free( (void *) b->yy_ch_buf );
  1369.  
  1370.     yy_flex_free( (void *) b );
  1371.     }
  1372.  
  1373.  
  1374. #ifndef YY_ALWAYS_INTERACTIVE
  1375. #ifndef YY_NEVER_INTERACTIVE
  1376. extern int isatty YY_PROTO(( int ));
  1377. #endif
  1378. #endif
  1379.  
  1380. #ifdef YY_USE_PROTOS
  1381. void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
  1382. #else
  1383. void yy_init_buffer( b, file )
  1384. YY_BUFFER_STATE b;
  1385. FILE *file;
  1386. #endif
  1387.  
  1388.  
  1389.     {
  1390.     yy_flush_buffer( b );
  1391.  
  1392.     b->yy_input_file = file;
  1393.     b->yy_fill_buffer = 1;
  1394.  
  1395. #if YY_ALWAYS_INTERACTIVE
  1396.     b->yy_is_interactive = 1;
  1397. #else
  1398. #if YY_NEVER_INTERACTIVE
  1399.     b->yy_is_interactive = 0;
  1400. #else
  1401.     b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
  1402. #endif
  1403. #endif
  1404.     }
  1405.  
  1406.  
  1407. #ifdef YY_USE_PROTOS
  1408. void yy_flush_buffer( YY_BUFFER_STATE b )
  1409. #else
  1410. void yy_flush_buffer( b )
  1411. YY_BUFFER_STATE b;
  1412. #endif
  1413.  
  1414.     {
  1415.     if ( ! b )
  1416.         return;
  1417.  
  1418.     b->yy_n_chars = 0;
  1419.  
  1420.     /* We always need two end-of-buffer characters.  The first causes
  1421.      * a transition to the end-of-buffer state.  The second causes
  1422.      * a jam in that state.
  1423.      */
  1424.     b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
  1425.     b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
  1426.  
  1427.     b->yy_buf_pos = &b->yy_ch_buf[0];
  1428.  
  1429.     b->yy_at_bol = 1;
  1430.     b->yy_buffer_status = YY_BUFFER_NEW;
  1431.  
  1432.     if ( b == yy_current_buffer )
  1433.         yy_load_buffer_state();
  1434.     }
  1435.  
  1436.  
  1437. #ifndef YY_NO_SCAN_BUFFER
  1438. #ifdef YY_USE_PROTOS
  1439. YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
  1440. #else
  1441. YY_BUFFER_STATE yy_scan_buffer( base, size )
  1442. char *base;
  1443. yy_size_t size;
  1444. #endif
  1445.     {
  1446.     YY_BUFFER_STATE b;
  1447.  
  1448.     if ( size < 2 ||
  1449.          base[size-2] != YY_END_OF_BUFFER_CHAR ||
  1450.          base[size-1] != YY_END_OF_BUFFER_CHAR )
  1451.         /* They forgot to leave room for the EOB's. */
  1452.         return 0;
  1453.  
  1454.     b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
  1455.     if ( ! b )
  1456.         YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
  1457.  
  1458.     b->yy_buf_size = size - 2;    /* "- 2" to take care of EOB's */
  1459.     b->yy_buf_pos = b->yy_ch_buf = base;
  1460.     b->yy_is_our_buffer = 0;
  1461.     b->yy_input_file = 0;
  1462.     b->yy_n_chars = b->yy_buf_size;
  1463.     b->yy_is_interactive = 0;
  1464.     b->yy_at_bol = 1;
  1465.     b->yy_fill_buffer = 0;
  1466.     b->yy_buffer_status = YY_BUFFER_NEW;
  1467.  
  1468.     yy_switch_to_buffer( b );
  1469.  
  1470.     return b;
  1471.     }
  1472. #endif
  1473.  
  1474.  
  1475. #ifndef YY_NO_SCAN_STRING
  1476. #ifdef YY_USE_PROTOS
  1477. YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
  1478. #else
  1479. YY_BUFFER_STATE yy_scan_string( yy_str )
  1480. yyconst char *yy_str;
  1481. #endif
  1482.     {
  1483.     int len;
  1484.     for ( len = 0; yy_str[len]; ++len )
  1485.         ;
  1486.  
  1487.     return yy_scan_bytes( yy_str, len );
  1488.     }
  1489. #endif
  1490.  
  1491.  
  1492. #ifndef YY_NO_SCAN_BYTES
  1493. #ifdef YY_USE_PROTOS
  1494. YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
  1495. #else
  1496. YY_BUFFER_STATE yy_scan_bytes( bytes, len )
  1497. yyconst char *bytes;
  1498. int len;
  1499. #endif
  1500.     {
  1501.     YY_BUFFER_STATE b;
  1502.     char *buf;
  1503.     yy_size_t n;
  1504.     int i;
  1505.  
  1506.     /* Get memory for full buffer, including space for trailing EOB's. */
  1507.     n = len + 2;
  1508.     buf = (char *) yy_flex_alloc( n );
  1509.     if ( ! buf )
  1510.         YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
  1511.  
  1512.     for ( i = 0; i < len; ++i )
  1513.         buf[i] = bytes[i];
  1514.  
  1515.     buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
  1516.  
  1517.     b = yy_scan_buffer( buf, n );
  1518.     if ( ! b )
  1519.         YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
  1520.  
  1521.     /* It's okay to grow etc. this buffer, and we should throw it
  1522.      * away when we're done.
  1523.      */
  1524.     b->yy_is_our_buffer = 1;
  1525.  
  1526.     return b;
  1527.     }
  1528. #endif
  1529.  
  1530.  
  1531. #ifndef YY_NO_PUSH_STATE
  1532. #ifdef YY_USE_PROTOS
  1533. static void yy_push_state( int new_state )
  1534. #else
  1535. static void yy_push_state( new_state )
  1536. int new_state;
  1537. #endif
  1538.     {
  1539.     if ( yy_start_stack_ptr >= yy_start_stack_depth )
  1540.         {
  1541.         yy_size_t new_size;
  1542.  
  1543.         yy_start_stack_depth += YY_START_STACK_INCR;
  1544.         new_size = yy_start_stack_depth * sizeof( int );
  1545.  
  1546.         if ( ! yy_start_stack )
  1547.             yy_start_stack = (int *) yy_flex_alloc( new_size );
  1548.  
  1549.         else
  1550.             yy_start_stack = (int *) yy_flex_realloc(
  1551.                     (void *) yy_start_stack, new_size );
  1552.  
  1553.         if ( ! yy_start_stack )
  1554.             YY_FATAL_ERROR(
  1555.             "out of memory expanding start-condition stack" );
  1556.         }
  1557.  
  1558.     yy_start_stack[yy_start_stack_ptr++] = YY_START;
  1559.  
  1560.     BEGIN(new_state);
  1561.     }
  1562. #endif
  1563.  
  1564.  
  1565. #ifndef YY_NO_POP_STATE
  1566. static void yy_pop_state()
  1567.     {
  1568.     if ( --yy_start_stack_ptr < 0 )
  1569.         YY_FATAL_ERROR( "start-condition stack underflow" );
  1570.  
  1571.     BEGIN(yy_start_stack[yy_start_stack_ptr]);
  1572.     }
  1573. #endif
  1574.  
  1575.  
  1576. #ifndef YY_NO_TOP_STATE
  1577. static int yy_top_state()
  1578.     {
  1579.     return yy_start_stack[yy_start_stack_ptr - 1];
  1580.     }
  1581. #endif
  1582.  
  1583. #ifndef YY_EXIT_FAILURE
  1584. #define YY_EXIT_FAILURE 2
  1585. #endif
  1586.  
  1587. #ifdef YY_USE_PROTOS
  1588. static void yy_fatal_error( yyconst char msg[] )
  1589. #else
  1590. static void yy_fatal_error( msg )
  1591. char msg[];
  1592. #endif
  1593.     {
  1594.     (void) fprintf( stderr, "%s\n", msg );
  1595.     exit( YY_EXIT_FAILURE );
  1596.     }
  1597.  
  1598.  
  1599.  
  1600. /* Redefine yyless() so it works in section 3 code. */
  1601.  
  1602. #undef yyless
  1603. #define yyless(n) \
  1604.     do \
  1605.         { \
  1606.         /* Undo effects of setting up yytext. */ \
  1607.         yytext[yyleng] = yy_hold_char; \
  1608.         yy_c_buf_p = yytext + n; \
  1609.         yy_hold_char = *yy_c_buf_p; \
  1610.         *yy_c_buf_p = '\0'; \
  1611.         yyleng = n; \
  1612.         } \
  1613.     while ( 0 )
  1614.  
  1615.  
  1616. /* Internal utility routines. */
  1617.  
  1618. #ifndef yytext_ptr
  1619. #ifdef YY_USE_PROTOS
  1620. static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
  1621. #else
  1622. static void yy_flex_strncpy( s1, s2, n )
  1623. char *s1;
  1624. yyconst char *s2;
  1625. int n;
  1626. #endif
  1627.     {
  1628.     register int i;
  1629.     for ( i = 0; i < n; ++i )
  1630.         s1[i] = s2[i];
  1631.     }
  1632. #endif
  1633.  
  1634. #ifdef YY_NEED_STRLEN
  1635. #ifdef YY_USE_PROTOS
  1636. static int yy_flex_strlen( yyconst char *s )
  1637. #else
  1638. static int yy_flex_strlen( s )
  1639. yyconst char *s;
  1640. #endif
  1641.     {
  1642.     register int n;
  1643.     for ( n = 0; s[n]; ++n )
  1644.         ;
  1645.  
  1646.     return n;
  1647.     }
  1648. #endif
  1649.  
  1650.  
  1651. #ifdef YY_USE_PROTOS
  1652. static void *yy_flex_alloc( yy_size_t size )
  1653. #else
  1654. static void *yy_flex_alloc( size )
  1655. yy_size_t size;
  1656. #endif
  1657.     {
  1658.     return (void *) malloc( size );
  1659.     }
  1660.  
  1661. #ifdef YY_USE_PROTOS
  1662. static void *yy_flex_realloc( void *ptr, yy_size_t size )
  1663. #else
  1664. static void *yy_flex_realloc( ptr, size )
  1665. void *ptr;
  1666. yy_size_t size;
  1667. #endif
  1668.     {
  1669.     /* The cast to (char *) in the following accommodates both
  1670.      * implementations that use char* generic pointers, and those
  1671.      * that use void* generic pointers.  It works with the latter
  1672.      * because both ANSI C and C++ allow castless assignment from
  1673.      * any pointer type to void*, and deal with argument conversions
  1674.      * as though doing an assignment.
  1675.      */
  1676.     return (void *) realloc( (char *) ptr, size );
  1677.     }
  1678.  
  1679. #ifdef YY_USE_PROTOS
  1680. static void yy_flex_free( void *ptr )
  1681. #else
  1682. static void yy_flex_free( ptr )
  1683. void *ptr;
  1684. #endif
  1685.     {
  1686.     free( ptr );
  1687.     }
  1688.  
  1689. #if YY_MAIN
  1690. int main()
  1691.     {
  1692.     yylex();
  1693.     return 0;
  1694.     }
  1695. #endif
  1696. #line 101 "imap_ncsa.l"
  1697.