00001
00002
00003
00004 #ifndef DEV_W3_ORG__2001_BLINDFOLD_SRC_NTRIPLESPARSER_H
00005 #define DEV_W3_ORG__2001_BLINDFOLD_SRC_NTRIPLESPARSER_H
00006 #include "config.h"
00007
00008
00009
00010 #include "Parser.h"
00011 #include "ByteFIFO.h"
00012
00016 class NTriplesParser : public Parser {
00017
00018 public:
00019
00020
00021 NTriplesParser();
00022 NTriplesParser(const NTriplesParser& other);
00023 const NTriplesParser& operator=(const NTriplesParser& other);
00024 bool operator==(const NTriplesParser& other) const;
00025 bool operator<(const NTriplesParser& other) const;
00026 size_t hash() const;
00027 friend std::ostream& operator<<(std::ostream& s, const NTriplesParser& me);
00028 std::ostream& print_to(std::ostream& stream) const;
00029 ~NTriplesParser();
00030
00031
00032 virtual void write(const void* byteBuffer, size_t numBytes);
00033 virtual void close();
00034
00035
00036 std::string inputName;
00037
00038 private:
00039
00040 friend int ntriples_lex();
00041 ByteFIFO fifo;
00042 size_t line;
00043 Symbol getSym(char*& p, VariableScope* scope);
00044 #ifdef STREAMING
00045 enum {
00046 START,
00047 IN_COMMENT
00048 GOT_UNDERLINE,
00049 IN_URI,
00050 IN_VAR,
00051 IN_STRING,
00052 IN_STRING_BACKSLASH,
00053 AFTER_EMPTY_STRING,
00054 IN_STRONG_STRING,
00055 IN_STRONG_STRING_AFTER_QUOTE,
00056 IN_STRONG_STRING_AFTER_TWO_QUOTES
00057 } state;
00058
00059
00060 #endif
00061 };
00062
00063
00064 STANDARD_EXTERNAL(NTriplesParser)
00065
00066 #endif