mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 05:51:27 +12:00
Removed the document class (since it's really just a root node, and that's it).
This commit is contained in:
parent
2be40919de
commit
ed488e5197
7 changed files with 27 additions and 103 deletions
24
parser.cpp
24
parser.cpp
|
@ -22,15 +22,35 @@ namespace YAML
|
|||
return m_pScanner->PeekNextToken() != 0;
|
||||
}
|
||||
|
||||
void Parser::GetNextDocument(Document& document)
|
||||
// GetNextDocument
|
||||
// . Reads the next document in the queue (of tokens).
|
||||
// . Throws (ScannerException|ParserException)s on errors.
|
||||
void Parser::GetNextDocument(Node& document)
|
||||
{
|
||||
// clear node
|
||||
document.Clear();
|
||||
|
||||
// first read directives
|
||||
ParseDirectives();
|
||||
|
||||
// then parse the document
|
||||
// we better have some tokens in the queue
|
||||
if(!m_pScanner->PeekNextToken())
|
||||
return;
|
||||
|
||||
// first eat doc start (optional)
|
||||
if(m_pScanner->PeekNextToken()->type == TT_DOC_START)
|
||||
m_pScanner->EatNextToken();
|
||||
|
||||
// now parse our root node
|
||||
document.Parse(m_pScanner, m_state);
|
||||
|
||||
// and finally eat any doc ends we see
|
||||
while(m_pScanner->PeekNextToken() && m_pScanner->PeekNextToken()->type == TT_DOC_END)
|
||||
m_pScanner->EatNextToken();
|
||||
}
|
||||
|
||||
// ParseDirectives
|
||||
// . Reads any directives that are next in the queue.
|
||||
void Parser::ParseDirectives()
|
||||
{
|
||||
bool readDirective = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue