mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 14:01:25 +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
21
scalar.cpp
21
scalar.cpp
|
@ -1,12 +1,31 @@
|
|||
#include "scalar.h"
|
||||
#include "scanner.h"
|
||||
#include "token.h"
|
||||
|
||||
namespace YAML
|
||||
{
|
||||
Scalar::Scalar(const std::string& data): m_data(data)
|
||||
Scalar::Scalar()
|
||||
{
|
||||
}
|
||||
|
||||
Scalar::~Scalar()
|
||||
{
|
||||
}
|
||||
|
||||
void Scalar::Parse(Scanner *pScanner)
|
||||
{
|
||||
Token *pToken = pScanner->GetNextToken();
|
||||
m_data = pToken->value;
|
||||
delete pToken;
|
||||
}
|
||||
|
||||
void Scalar::Write(std::ostream& out, int indent)
|
||||
{
|
||||
for(int i=0;i<indent;i++)
|
||||
out << " ";
|
||||
out << "{scalar}\n";
|
||||
for(int i=0;i<indent;i++)
|
||||
out << " ";
|
||||
out << m_data << std::endl;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue