MeVisLabToolboxReference
|
00001 // **InsertLicense** code 00002 //---------------------------------------------------------------------------------- 00007 00012 //---------------------------------------------------------------------------------- 00013 00014 #ifndef __mlParserBase_H 00015 #define __mlParserBase_H 00016 00017 00018 // ML-includes 00019 #ifndef __mlBaseInit_H 00020 #include "mlBaseInit.h" 00021 #endif 00022 #ifndef __mlModuleIncludes_H 00023 #include "mlModuleIncludes.h" 00024 #endif 00025 00026 00027 ML_START_NAMESPACE 00028 00029 00030 // ------------------------------------------------------------------ 00031 // Class ParserBase 00032 // ------------------------------------------------------------------ 00033 00036 class MLBASEEXPORT ParserBase 00037 { 00038 public: 00039 00041 ParserBase () : _source(0), _pNext(0), _eos(true) {} 00042 00044 virtual ~ParserBase() {} 00045 00048 virtual int init (const char *source); 00049 00051 const char *getCurrentPos () { return _pNext; } 00052 00054 bool endOfSource () { return _eos; } 00055 00057 virtual const char *getErrorMessage (int errorCode); 00058 00060 enum { 00061 kNoError = 0, 00062 kEmptyString, 00063 kNumBaseErrorCodes, 00064 kEndOfSource = -1 00065 }; 00066 00067 00071 static char *newString (const std::string &str); 00072 00074 static void deleteString (char *str); 00075 00076 00077 protected: 00078 00080 void skipWhitespace (); 00081 00082 00084 const char *_source; 00086 const char *_pNext; 00088 bool _eos; 00089 00090 }; 00091 00092 00093 ML_END_NAMESPACE 00094 00095 #endif // __mlParserBase_H