00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef _JAULA_PARSE_H_
00030 #define _JAULA_PARSE_H_
00031
00036 #include <jaula/jaula_lexan.h>
00037 #include <jaula/jaula_syntax_error.h>
00038 #include <jaula/jaula_value_complex.h>
00039
00040 namespace JAULA
00041 {
00052 class Parser
00053 {
00054 public:
00055
00059 Parser(void);
00060
00064 ~Parser(void);
00065
00109 static Value_Complex *parseStream(std::istream &inpStream
00110 , bool comments_allowed = false
00111 , bool full_read = true
00112 ) throw(Exception);
00113
00114 private:
00115
00126 class Value_Parser
00127 {
00128 public:
00129
00133 Value_Parser(void);
00134
00138 ~Value_Parser(void);
00139
00167 static Value *parseValue(Lexan &lexan, unsigned int token)
00168 throw(Exception);
00169
00170 private:
00171
00179 enum parser_states
00180 {
00182 START,
00184 array_addItem,
00186 array_nextItem,
00191 error,
00193 false_value,
00195 null_value,
00197 number_int_value,
00199 number_value,
00201 property_begin,
00203 property_name,
00205 property_value,
00207 property_next,
00209 string_value,
00211 true_value,
00213 END
00214 };
00215
00239 static void EOFError(Lexan &lexan, Syntax_Error const &ex)
00240 throw(Exception);
00241 };
00242
00243 };
00244
00245 }
00246 #endif
00247
00248