merge total remake

This commit is contained in:
Eduardo Bart
2011-08-13 23:09:11 -03:00
parent 0af7856475
commit 55862b07ad
253 changed files with 6777 additions and 8463 deletions

View File

@@ -1,37 +1,33 @@
#ifndef OTMLPARSER_H
#define OTMLPARSER_H
#include <otml/otmlnode.h>
#include <istream>
#include "otmldeclarations.h"
class OTMLParser
{
public:
OTMLParser(std::istream& in, std::string what = "");
~OTMLParser();
OTMLParser(OTMLDocumentPtr doc, std::istream& in);
OTMLNode* getDocument() const { return m_rootNode; }
std::string what() { return m_rootNode->what(); }
void throwError(const std::string& message, int line);
protected:
/// Parse the entire document
void parse();
void parseLine(std::string line);
void parseNode(OTMLNode* node, std::string data);
void parseNodeValue(OTMLNode* node, std::string value);
void parseTextValue(std::string& value);
void parseTokens(std::string data, std::vector<std::string>& out);
private:
int m_currentDepth;
int m_currentLine;
OTMLNode* m_rootNode;
OTMLNode* m_currentParent;
OTMLNode* m_previousNode;
std::istream& m_in;
/// Retrieve next line from the input stream
std::string getNextLine();
/// Counts depth of a line (every 2 spaces increments one depth)
int getLineDepth(const std::string& line, bool multilining = false);
/// Parse each line of the input stream
void parseLine(std::string line);
/// Parse nodes tag and value
void parseNode(const std::string& data);
int currentDepth;
int currentLine;
OTMLDocumentPtr doc;
OTMLNodePtr currentParent;
OTMLNodePtr previousNode;
std::istream& in;
};
#endif // OTMLPARSER_H
#endif