ds9FlexLexer.h

Go to the documentation of this file.
00001 // -*-C++-*-
00002 // FlexLexer.h -- define interfaces for lexical analyzer classes generated
00003 // by flex
00004 
00005 // Copyright (c) 1993 The Regents of the University of California.
00006 // All rights reserved.
00007 //
00008 // This code is derived from software contributed to Berkeley by
00009 // Kent Williams and Tom Epperly.
00010 //
00011 //  Redistribution and use in source and binary forms, with or without
00012 //  modification, are permitted provided that the following conditions
00013 //  are met:
00014 
00015 //  1. Redistributions of source code must retain the above copyright
00016 //  notice, this list of conditions and the following disclaimer.
00017 //  2. Redistributions in binary form must reproduce the above copyright
00018 //  notice, this list of conditions and the following disclaimer in the
00019 //  documentation and/or other materials provided with the distribution.
00020 
00021 //  Neither the name of the University nor the names of its contributors
00022 //  may be used to endorse or promote products derived from this software
00023 //  without specific prior written permission.
00024 
00025 //  THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
00026 //  IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
00027 //  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00028 //  PURPOSE.
00029 
00030 // This file defines FlexLexer, an abstract class which specifies the
00031 // external interface provided to flex C++ lexer objects, and yyFlexLexer,
00032 // which defines a particular lexer class.
00033 //
00034 // If you want to create multiple lexer classes, you use the -P flag
00035 // to rename each yyFlexLexer to some other xxFlexLexer.  You then
00036 // include <FlexLexer.h> in your other sources once per lexer class:
00037 //
00038 //      #undef yyFlexLexer
00039 //      #define yyFlexLexer xxFlexLexer
00040 //      #include <FlexLexer.h>
00041 //
00042 //      #undef yyFlexLexer
00043 //      #define yyFlexLexer zzFlexLexer
00044 //      #include <FlexLexer.h>
00045 //      ...
00046 
00047 #ifndef __FLEX_LEXER_H
00048 // Never included before - need to define base class.
00049 #define __FLEX_LEXER_H
00050 
00051 #include <iostream>
00052 #  ifndef FLEX_STD
00053 #    define FLEX_STD std::
00054 #  endif
00055 
00056 extern "C++" {
00057 
00058         struct yy_buffer_state;
00059         typedef int yy_state_type;
00060 
00061         class FlexLexer {
00062         public:
00063                 virtual ~FlexLexer()    { }
00064 
00065                 const char* YYText() const      {
00066                         return yytext;
00067                 }
00068                 int YYLeng()    const   {
00069                         return yyleng;
00070                 }
00071 
00072                 virtual void
00073                 yy_switch_to_buffer( struct yy_buffer_state* new_buffer ) = 0;
00074                 virtual struct yy_buffer_state*
00075                 yy_create_buffer( FLEX_STD istream* s, int size ) = 0;
00076                 virtual void yy_delete_buffer( struct yy_buffer_state* b ) = 0;
00077                 virtual void yyrestart( FLEX_STD istream* s ) = 0;
00078 
00079                 virtual int yylex() = 0;
00080 
00081                 // Call yylex with new input/output sources.
00082                 int yylex( FLEX_STD istream* new_in, FLEX_STD ostream* new_out = 0 ) {
00083                         switch_streams( new_in, new_out );
00084                         return yylex();
00085                 }
00086 
00087                 // Switch to new input/output streams.  A nil stream pointer
00088                 // indicates "keep the current one".
00089                 virtual void switch_streams( FLEX_STD istream* new_in = 0,
00090                                              FLEX_STD ostream* new_out = 0 ) = 0;
00091 
00092                 int lineno() const              {
00093                         return yylineno;
00094                 }
00095 
00096                 int debug() const               {
00097                         return yy_flex_debug;
00098                 }
00099                 void set_debug( int flag )      {
00100                         yy_flex_debug = flag;
00101                 }
00102 
00103         protected:
00104                 char* yytext;
00105                 int yyleng;
00106                 int yylineno;           // only maintained if you use %option yylineno
00107                 int yy_flex_debug;      // only has effect with -d or "%option debug"
00108         };
00109 
00110 }
00111 #endif // FLEXLEXER_H
00112 
00113 #if defined(yyFlexLexer) || ! defined(yyFlexLexerOnce)
00114 // Either this is the first time through (yyFlexLexerOnce not defined),
00115 // or this is a repeated include to define a different flavor of
00116 // yyFlexLexer, as discussed in the flex manual.
00117 #define yyFlexLexerOnce
00118 
00119 extern "C++" {
00120 
00121         class yyFlexLexer : public FlexLexer {
00122         public:
00123                 // arg_yyin and arg_yyout default to the cin and cout, but we
00124                 // only make that assignment when initializing in yylex().
00125                 yyFlexLexer( FLEX_STD istream* arg_yyin = 0, FLEX_STD ostream* arg_yyout = 0 );
00126 
00127                 virtual ~yyFlexLexer();
00128 
00129                 void yy_switch_to_buffer( struct yy_buffer_state* new_buffer );
00130                 struct yy_buffer_state* yy_create_buffer( FLEX_STD istream* s, int size );
00131                 void yy_delete_buffer( struct yy_buffer_state* b );
00132                 void yyrestart( FLEX_STD istream* s );
00133 
00134                 void yypush_buffer_state( struct yy_buffer_state* new_buffer );
00135                 void yypop_buffer_state();
00136 
00137                 virtual int yylex();
00138                 virtual void switch_streams( FLEX_STD istream* new_in, FLEX_STD ostream* new_out = 0 );
00139                 virtual int yywrap();
00140 
00141         protected:
00142                 virtual int LexerInput( char* buf, int max_size );
00143                 virtual void LexerOutput( const char* buf, int size );
00144                 virtual void LexerError( const char* msg );
00145 
00146                 void yyunput( int c, char* buf_ptr );
00147                 int yyinput();
00148 
00149                 void yy_load_buffer_state();
00150                 void yy_init_buffer( struct yy_buffer_state* b, FLEX_STD istream* s );
00151                 void yy_flush_buffer( struct yy_buffer_state* b );
00152 
00153                 int yy_start_stack_ptr;
00154                 int yy_start_stack_depth;
00155                 int* yy_start_stack;
00156 
00157                 void yy_push_state( int new_state );
00158                 void yy_pop_state();
00159                 int yy_top_state();
00160 
00161                 yy_state_type yy_get_previous_state();
00162                 yy_state_type yy_try_NUL_trans( yy_state_type current_state );
00163                 int yy_get_next_buffer();
00164 
00165                 FLEX_STD istream* yyin; // input source for default LexerInput
00166                 FLEX_STD ostream* yyout;        // output sink for default LexerOutput
00167 
00168                 // yy_hold_char holds the character lost when yytext is formed.
00169                 char yy_hold_char;
00170 
00171                 // Number of characters read into yy_ch_buf.
00172                 int yy_n_chars;
00173 
00174                 // Points to current character in buffer.
00175                 char* yy_c_buf_p;
00176 
00177                 int yy_init;            // whether we need to initialize
00178                 int yy_start;           // start state number
00179 
00180                 // Flag which is used to allow yywrap()'s to do buffer switches
00181                 // instead of setting up a fresh yyin.  A bit of a hack ...
00182                 int yy_did_buffer_switch_on_eof;
00183 
00184 
00185                 size_t yy_buffer_stack_top; 
00186                 size_t yy_buffer_stack_max; 
00187                 struct yy_buffer_state ** yy_buffer_stack; 
00188                 void yyensure_buffer_stack(void);
00189 
00190                 // The following are not always needed, but may be depending
00191                 // on use of certain flex features (like REJECT or yymore()).
00192 
00193                 yy_state_type yy_last_accepting_state;
00194                 char* yy_last_accepting_cpos;
00195 
00196                 yy_state_type* yy_state_buf;
00197                 yy_state_type* yy_state_ptr;
00198 
00199                 char* yy_full_match;
00200                 int* yy_full_state;
00201                 int yy_full_lp;
00202 
00203                 int yy_lp;
00204                 int yy_looking_for_trail_begin;
00205 
00206                 int yy_more_flag;
00207                 int yy_more_len;
00208                 int yy_more_offset;
00209                 int yy_prev_more_offset;
00210         };
00211 
00212 }
00213 
00214 #endif // yyFlexLexer || ! yyFlexLexerOnce
00215 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1