- Timestamp:
- 12/29/06 10:28:00 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Source/System/FileIO/ScanParseSkel/OSGScanParseSkelScanner_FlexLexer.h
r264 r459 1 // $Header: /home/daffy/u0/vern/flex/RCS/FlexLexer.h,v 1.19 96/05/25 20:43:02 vern Exp $ 2 1 2 // -*-C++-*- 3 3 // FlexLexer.h -- define interfaces for lexical analyzer classes generated 4 // by flex4 // by flex 5 5 6 6 // Copyright (c) 1993 The Regents of the University of California. … … 10 10 // Kent Williams and Tom Epperly. 11 11 // 12 // Redistribution and use in source and binary forms with or without 13 // modification are permitted provided that: (1) source distributions retain 14 // this entire copyright notice and comment, and (2) distributions including 15 // binaries display the following acknowledgement: ``This product includes 16 // software developed by the University of California, Berkeley and its 17 // contributors'' in the documentation or other materials provided with the 18 // distribution and in all advertising materials mentioning features or use 19 // of this software. Neither the name of the University nor the names of 20 // its contributors may be used to endorse or promote products derived from 21 // this software without specific prior written permission. 22 23 // THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED 24 // WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 25 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12 // Redistribution and use in source and binary forms, with or without 13 // modification, are permitted provided that the following conditions 14 // are met: 15 16 // 1. Redistributions of source code must retain the above copyright 17 // notice, this list of conditions and the following disclaimer. 18 // 2. Redistributions in binary form must reproduce the above copyright 19 // notice, this list of conditions and the following disclaimer in the 20 // documentation and/or other materials provided with the distribution. 21 22 // Neither the name of the University nor the names of its contributors 23 // may be used to endorse or promote products derived from this software 24 // without specific prior written permission. 25 26 // THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 27 // IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 28 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 29 // PURPOSE. 26 30 27 31 // This file defines FlexLexer, an abstract class which specifies the … … 45 49 // Never included before - need to define base class. 46 50 #define __FLEX_LEXER_H 51 47 52 #include <iostream> 53 # ifndef FLEX_STD 54 # define FLEX_STD std:: 55 # endif 48 56 49 57 extern "C++" { … … 56 64 virtual ~FlexLexer() { } 57 65 58 const char* YYText() { return yytext; }59 int YYLeng() { return yyleng; }66 const char* YYText() const { return yytext; } 67 int YYLeng() const { return yyleng; } 60 68 61 69 virtual void 62 70 yy_switch_to_buffer( struct yy_buffer_state* new_buffer ) = 0; 63 71 virtual struct yy_buffer_state* 64 yy_create_buffer( std::istream* s, int size ) = 0;72 yy_create_buffer( FLEX_STD istream* s, int size ) = 0; 65 73 virtual void yy_delete_buffer( struct yy_buffer_state* b ) = 0; 66 virtual void yyrestart( std::istream* s ) = 0;74 virtual void yyrestart( FLEX_STD istream* s ) = 0; 67 75 68 76 virtual int yylex() = 0; 69 77 70 78 // Call yylex with new input/output sources. 71 int yylex( std::istream* new_in, std::ostream* new_out = 0 )79 int yylex( FLEX_STD istream* new_in, FLEX_STD ostream* new_out = 0 ) 72 80 { 73 81 switch_streams( new_in, new_out ); … … 77 85 // Switch to new input/output streams. A nil stream pointer 78 86 // indicates "keep the current one". 79 virtual void switch_streams( std::istream* new_in = 0,80 std::ostream* new_out = 0 ) = 0;87 virtual void switch_streams( FLEX_STD istream* new_in = 0, 88 FLEX_STD ostream* new_out = 0 ) = 0; 81 89 82 90 int lineno() const { return yylineno; } … … 101 109 #define yyFlexLexerOnce 102 110 111 extern "C++" { 112 103 113 class yyFlexLexer : public FlexLexer { 104 114 public: 105 115 // arg_yyin and arg_yyout default to the cin and cout, but we 106 116 // only make that assignment when initializing in yylex(). 107 yyFlexLexer( std::istream* arg_yyin = 0, std::ostream* arg_yyout = 0 );117 yyFlexLexer( FLEX_STD istream* arg_yyin = 0, FLEX_STD ostream* arg_yyout = 0 ); 108 118 109 119 virtual ~yyFlexLexer(); 110 120 111 121 void yy_switch_to_buffer( struct yy_buffer_state* new_buffer ); 112 struct yy_buffer_state* yy_create_buffer( std::istream* s, int size );122 struct yy_buffer_state* yy_create_buffer( FLEX_STD istream* s, int size ); 113 123 void yy_delete_buffer( struct yy_buffer_state* b ); 114 void yyrestart( std::istream* s ); 124 void yyrestart( FLEX_STD istream* s ); 125 126 void yypush_buffer_state( struct yy_buffer_state* new_buffer ); 127 void yypop_buffer_state(void); 115 128 116 129 virtual int yylex(); 117 virtual void switch_streams( std::istream* new_in, std::ostream* new_out );130 virtual void switch_streams( FLEX_STD istream* new_in, FLEX_STD ostream* new_out ); 118 131 119 132 protected: … … 126 139 127 140 void yy_load_buffer_state(); 128 void yy_init_buffer( struct yy_buffer_state* b, std::istream* s );141 void yy_init_buffer( struct yy_buffer_state* b, FLEX_STD istream* s ); 129 142 void yy_flush_buffer( struct yy_buffer_state* b ); 130 143 … … 141 154 int yy_get_next_buffer(); 142 155 143 std::istream* yyin; // input source for default LexerInput 144 std::ostream* yyout; // output sink for default LexerOutput 145 146 struct yy_buffer_state* yy_current_buffer; 156 FLEX_STD istream* yyin; // input source for default LexerInput 157 FLEX_STD ostream* yyout; // output sink for default LexerOutput 147 158 148 159 // yy_hold_char holds the character lost when yytext is formed. … … 161 172 // instead of setting up a fresh yyin. A bit of a hack ... 162 173 int yy_did_buffer_switch_on_eof; 174 175 176 size_t yy_buffer_stack_top; /**< index of top of stack. */ 177 size_t yy_buffer_stack_max; /**< capacity of stack. */ 178 struct yy_buffer_state ** yy_buffer_stack; /**< Stack as an array. */ 179 void yyensure_buffer_stack(void); 163 180 164 181 // The following are not always needed, but may be depending … … 184 201 }; 185 202 203 } 204 186 205 #endif
