mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 05:51:27 +12:00
Finished parsing of basic data types (scalar, sequence, map).
This commit is contained in:
parent
c1966ba3fc
commit
121c2e577f
20 changed files with 434 additions and 221 deletions
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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue