00001
00002
00003 #ifndef AsciiLexer_h
00004 #define AsciiLexer_h
00005
00006 #include <fstream>
00007 #include <string>
00008 using namespace std;
00009
00010
00011
00012
00013
00014
00015
00016 #undef yyFlexLexer
00017 #define yyFlexLexer AscFlexLexer
00018
00019
00020
00021
00022
00023
00024 #ifndef __FLEX_LEXER_H
00025 #include <FlexLexer.h>
00026 #endif
00027
00028
00029
00030
00031 namespace BIE {
00032 class AsciiLexer;
00033 }
00034
00058 class BIE::AsciiLexer : public yyFlexLexer{
00059
00060 public:
00063 AsciiLexer(string filename);
00064
00067 AsciiLexer(istream * stream);
00068
00070 ~AsciiLexer();
00071
00074 inline int nextToken() { return yylex(); }
00075
00078 inline const char * tokenText() { return al_stripped; }
00079
00081 enum {AL_NEWLINE_, AL_INT_KEYWORD_, AL_REAL_KEYWORD_, AL_BOOL_KEYWORD_,
00082 AL_STRING_KEYWORD_, AL_STRING_VALUE_, AL_INT_VALUE_, AL_REAL_VALUE_,
00083 AL_COMMA_, AL_EQUALS_, AL_LEFT_CURLY_, AL_RIGHT_CURLY_,
00084 AL_LEFT_SQUAREBRACKET_, AL_ATRATE_,
00085 AL_EOF_, AL_ERROR_};
00086
00087 private:
00089 int yylex();
00090
00093 char * al_stripped;
00094
00096 bool al_streamismine;
00097
00099
00101 istream * al_inputstream;
00102 };
00103
00104 #endif