Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

NTriplesParser.h

00001 // See the file LICENSE in the some directory as this file for legal
00002 // notices about this software.   
00003 // $Id: NTriplesParser_8h-source.html,v 1.9 2001/10/10 20:40:58 sandro Exp $
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 // #include "ByteSink.h"
00009 // #include "TripleAdder.h"
00010 #include "Parser.h"
00011 #include "ByteFIFO.h"
00012 
00016 class NTriplesParser : public Parser {
00017       
00018 public:
00019 
00020     // STANDARD MEMBER FUNCTIONS
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     // INHERITED INTERFACE (AS NEEDED)
00032     virtual void write(const void* byteBuffer, size_t numBytes);
00033     virtual void close();
00034 
00035     // CLASS-SPECIFIC PUBLIC INTERFACE
00036     std::string inputName;  // for error messages
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     // in streaming mode, fifo is used to hold text of symbol
00059     // we're reading, if we reach the end of the buffer.
00060 #endif
00061 };     
00062 
00063 
00064 STANDARD_EXTERNAL(NTriplesParser)
00065 
00066 #endif   /* NTRIPLESPARSER */  // -*-C++-*-

Home to blindfold. This page generated via doxygen 1.2.11.1 Wed Oct 10 16:40:33 2001.