Started the parser.

This commit is contained in:
Jesse Beder 2008-06-30 06:51:22 +00:00
parent ed6c294749
commit b6a0ef207b
12 changed files with 143 additions and 276 deletions

View file

@ -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();
}
}