Finished parsing of basic data types (scalar, sequence, map).

This commit is contained in:
Jesse Beder 2008-06-30 23:57:58 +00:00
parent c1966ba3fc
commit 121c2e577f
20 changed files with 434 additions and 221 deletions

View file

@ -1,30 +1,20 @@
#include "parser.h"
#include "node.h"
#include "token.h"
#include <iostream>
#include "scanner.h"
namespace YAML
{
Parser::Parser(std::istream& in): m_scanner(in)
Parser::Parser(std::istream& in): m_pScanner(0)
{
m_pScanner = new Scanner(in);
}
Parser::~Parser()
{
delete m_pScanner;
}
void Parser::GetNextDocument(Document& document)
{
// scan and output, for now
while(1) {
Token *pToken = m_scanner.GetNextToken();
if(!pToken)
break;
std::cout << *pToken << std::endl;
delete pToken;
}
getchar();
document.Parse(m_pScanner);
}
}