00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef TORC_GENERIC_PARSER_SCANNER_HPP
00024 #define TORC_GENERIC_PARSER_SCANNER_HPP
00025
00026
00027
00028
00029 #ifndef YY_DECL
00030
00031 #define YY_DECL \
00032 torc::generic::Parser::token_type \
00033 torc::generic::Scanner::lex( \
00034 torc::generic::Parser::semantic_type* yylval, \
00035 torc::generic::Parser::location_type* yylloc \
00036 )
00037 #endif
00038
00039 #ifndef __FLEX_LEXER_H
00040 #define yyFlexLexer EdifFlexLexer
00041 #include "torc/generic/parser/FlexLexer.h"
00042 #undef EdifFlexLexer
00043 #endif
00044
00045 #include "torc/generic/parser/Parser.h"
00046
00047 namespace torc {
00048 namespace generic {
00049
00050
00051
00052
00053
00054
00055 class Scanner : public EdifFlexLexer
00056 {
00057 public:
00058
00059
00060
00061 Scanner(std::istream* arg_yyin = 0,
00062 std::ostream* arg_yyout = 0);
00063
00064
00065 virtual ~Scanner();
00066
00067
00068
00069
00070 virtual Parser::token_type lex(
00071 Parser::semantic_type* yylval,
00072 Parser::location_type* yylloc
00073 );
00074
00075
00076 void set_debug(bool b);
00077
00078 inline bool
00079 getIsIdContext() const throw();
00080
00081 inline void
00082 setIsIdContext( bool inIsIdContext ) throw();
00083
00084 void
00085 skipThisRule( char *yytext );
00086
00087 inline bool
00088 getAppendToBuffer() throw();
00089
00090 void
00091 setAppendToBuffer( bool inAppendToBuffer ) throw();
00092
00093 void
00094 resetBuffer() throw();
00095
00096 void
00097 addToBuffer( const char *str ) throw();
00098
00099 inline std::string
00100 getBuffer() throw();
00101
00102 inline bool
00103 getAppendToUserDataBuffer() throw();
00104
00105 void
00106 setAppendToUserDataBuffer( bool inAppendToBuffer ) throw();
00107
00108 void
00109 addToUserDataBuffer( const char *str ) throw();
00110
00111 void
00112 resetUserDataBuffer() throw();
00113
00114 inline std::string
00115 getUserDataBuffer() throw();
00116
00117 private:
00118 bool mIsIdContext;
00119 bool mAppendToBuffer;
00120 bool mAppendToUserDataBuffer;
00121 std::string mBuffer;
00122 std::string mUserDataBuffer;
00123 bool mIsIdAlreadyAdded;
00124 };
00125
00126 inline bool
00127 Scanner::getIsIdContext() const throw() {
00128 return mIsIdContext;
00129 }
00130
00131 inline void
00132 Scanner::setIsIdContext( bool inIsIdContext ) throw() {
00133 mIsIdContext = inIsIdContext;
00134 }
00135
00136 inline bool
00137 Scanner::getAppendToBuffer() throw() {
00138 return mAppendToBuffer;
00139 }
00140
00141 inline std::string
00142 Scanner::getBuffer() throw() {
00143 return mBuffer;
00144 }
00145
00146 inline bool
00147 Scanner::getAppendToUserDataBuffer() throw() {
00148 return mAppendToUserDataBuffer;
00149 }
00150
00151 inline std::string
00152 Scanner::getUserDataBuffer() throw() {
00153 return mUserDataBuffer;
00154 }
00155
00156 }
00157 }
00158
00159 #endif // TORC_GENERIC_PARSER_SCANNER_HPP