mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 05:51:27 +12:00
33 lines
518 B
C++
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;
|
|
}
|
|
}
|
|
}
|