mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-10 04:51:17 +00:00
Started the parser.
This commit is contained in:
33
document.cpp
33
document.cpp
@@ -1,12 +1,5 @@
|
||||
#include "document.h"
|
||||
#include "node.h"
|
||||
#include "parser.h"
|
||||
#include "scanner.h"
|
||||
#include "exceptions.h"
|
||||
#include <fstream>
|
||||
|
||||
#include <iostream>
|
||||
#include "token.h"
|
||||
|
||||
namespace YAML
|
||||
{
|
||||
@@ -14,11 +7,6 @@ namespace YAML
|
||||
{
|
||||
}
|
||||
|
||||
Document::Document(const std::string& fileName): m_pRoot(0)
|
||||
{
|
||||
Load(fileName);
|
||||
}
|
||||
|
||||
Document::~Document()
|
||||
{
|
||||
Clear();
|
||||
@@ -29,25 +17,4 @@ namespace YAML
|
||||
delete m_pRoot;
|
||||
m_pRoot = 0;
|
||||
}
|
||||
|
||||
void Document::Load(const std::string& fileName)
|
||||
{
|
||||
Clear();
|
||||
|
||||
std::ifstream fin(fileName.c_str());
|
||||
Scanner scanner(fin);
|
||||
|
||||
// scan and output, for now
|
||||
while(1) {
|
||||
Token *pToken = scanner.GetNextToken();
|
||||
if(!pToken)
|
||||
break;
|
||||
|
||||
std::cout << typeid(*pToken).name() << ": " << *pToken << std::endl;
|
||||
delete pToken;
|
||||
}
|
||||
getchar();
|
||||
|
||||
// m_pRoot = parser.ReadNextNode();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user