rpcs3/parser.cpp

34 lines
585 B
C++
Raw Normal View History

#include "parser.h"
#include "node.h"
2008-06-30 06:51:22 +00:00
#include "token.h"
#include <iostream>
namespace YAML
{
2008-06-30 06:51:22 +00:00
Parser::Parser(std::istream& in): m_scanner(in)
{
2008-06-30 06:51:22 +00:00
// eat the stream start token
// TODO: check?
Token *pToken = m_scanner.GetNextToken();
}
Parser::~Parser()
{
}
2008-06-30 06:51:22 +00:00
void Parser::GetNextDocument(Document& document)
{
2008-06-30 06:51:22 +00:00
// scan and output, for now
while(1) {
Token *pToken = m_scanner.GetNextToken();
if(!pToken)
break;
2008-06-30 06:51:22 +00:00
std::cout << typeid(*pToken).name() << ": " << *pToken << std::endl;
delete pToken;
}
2008-06-30 06:51:22 +00:00
getchar();
}
}