#ifndef __PARSER_H
#define __PARSER_H

/* $Id: parser.h,v 1.4 2001/05/21 20:15:35 sandro Exp $ */

#include <string>

class TupleStream {
 public:
  virtual void write(string subject, string property, string value) = 0;
  virtual void close() { } ;
};

// switch to this, so  lit->data:,etc can be out of the parser
class Symbol { 
 public:
  string getStr() { return ""; };
}; 
class SymbolAllocator {
 public:
  virtual Symbol get_new() = 0;
  virtual Symbol get_utf8_literal(string) = 0;
  virtual Symbol get_by_global_name(string) = 0;
};
//    TupleStream& tups, SymbolAllocator& syms
//    and make it parse_n3(....)
//    ... or have that just give us the start state, from
//        one parser...???
//  OR this will all be in prolog anyway?
//  or do the data structure querying in C++ anyway?

Symbol* parse(TupleStream& sot, char* expr);
Symbol* parse(TupleStream& sot, string expr); 
Symbol* parse_stdin(TupleStream& sot);
Symbol* parse_file(TupleStream& sot, const char* filename);

// extern "C" void yyerror(char *errmsg);
// extern int yylex();

extern char* vocab[];
enum { AN_INSTANCE, THE_EQUIVALENT, 
       HEAD, TAIL, NIL, 
       SUBJECT, PROPERTY, VALUE,
       ENUMERATION, FOR_SOME
};
extern char* genid_prefix;
extern bool flag_anons;
extern bool parse_as_condition;

#endif /* __ROADS_PROTO16_PARSER_H */
