mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-10 04:51:17 +00:00
Finished parsing of basic data types (scalar, sequence, map).
This commit is contained in:
20
parser.cpp
20
parser.cpp
@@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user