X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fparser.h;h=0989bd9d2d1fe378920c469c845f71435d799b28;hb=29fafaa2c570b0cf92f41eeb534cfb65a841a892;hp=814fd2771b1240ccb14a86c4c8d5576f26c99d4b;hpb=6dd94a7fe90c6467024685fbac769067ddb74688;p=libs%2Fdatafile.git diff --git a/source/parser.h b/source/parser.h index 814fd27..0989bd9 100644 --- a/source/parser.h +++ b/source/parser.h @@ -1,10 +1,3 @@ -/* $Id$ - -This file is part of libmspdatafile -Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #ifndef MSP_DATAFILE_PARSER_H_ #define MSP_DATAFILE_PARSER_H_ @@ -16,7 +9,6 @@ namespace DataFile { class ParserMode; class Statement; -struct Token; /** Frontend for loading datafiles. Handles switching between text and binary @@ -26,10 +18,11 @@ statements may be read. class Parser { private: - Input in; + Input in; + std::string main_src; std::string src; - bool good; - ParserMode *mode; + bool good; + ParserMode *mode; public: Parser(IO::Base &i, const std::string &s); @@ -41,8 +34,12 @@ public: marked as bad and no more statements may be read, even if the exception was caught. */ - Statement parse(); + Statement parse(bool raw = false); +private: + void process_control_statement(const Statement &); + +public: operator bool() const { return good && in; } };