mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 05:51:27 +12:00
Started the parser.
This commit is contained in:
parent
ed6c294749
commit
b6a0ef207b
12 changed files with 143 additions and 276 deletions
33
document.cpp
33
document.cpp
|
@ -1,12 +1,5 @@
|
|||
#include "document.h"
|
||||
#include "node.h"
|
||||
#include "parser.h"
|
||||
#include "scanner.h"
|
||||
#include "exceptions.h"
|
||||
#include <fstream>
|
||||
|
||||
#include <iostream>
|
||||
#include "token.h"
|
||||
|
||||
namespace YAML
|
||||
{
|
||||
|
@ -14,11 +7,6 @@ namespace YAML
|
|||
{
|
||||
}
|
||||
|
||||
Document::Document(const std::string& fileName): m_pRoot(0)
|
||||
{
|
||||
Load(fileName);
|
||||
}
|
||||
|
||||
Document::~Document()
|
||||
{
|
||||
Clear();
|
||||
|
@ -29,25 +17,4 @@ namespace YAML
|
|||
delete m_pRoot;
|
||||
m_pRoot = 0;
|
||||
}
|
||||
|
||||
void Document::Load(const std::string& fileName)
|
||||
{
|
||||
Clear();
|
||||
|
||||
std::ifstream fin(fileName.c_str());
|
||||
Scanner scanner(fin);
|
||||
|
||||
// scan and output, for now
|
||||
while(1) {
|
||||
Token *pToken = scanner.GetNextToken();
|
||||
if(!pToken)
|
||||
break;
|
||||
|
||||
std::cout << typeid(*pToken).name() << ": " << *pToken << std::endl;
|
||||
delete pToken;
|
||||
}
|
||||
getchar();
|
||||
|
||||
// m_pRoot = parser.ReadNextNode();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue