rpcs3/parser.cpp
Jesse Beder 8180a85a3b Added parsing of anchors, aliases, and tags (still no semantics yet).
Fixed a silly bug in the simple key pushing (queues are FIFO!).
2008-07-01 01:17:10 +00:00

33 lines
518 B
C++

#include "parser.h"
#include "scanner.h"
#include "token.h"
#include <iostream>
namespace YAML
{
Parser::Parser(std::istream& in): m_pScanner(0)
{
m_pScanner = new Scanner(in);
}
Parser::~Parser()
{
delete m_pScanner;
}
void Parser::GetNextDocument(Document& document)
{
document.Parse(m_pScanner);
}
void Parser::PrintTokens()
{
while(1) {
Token *pToken = m_pScanner->GetNextToken();
if(!pToken)
break;
std::cout << *pToken << std::endl;
}
}
}