mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-12 01:38:37 +12:00
Instead of deriving different tokens from a base Token class, we now use an enumerated TOKEN_TYPE to distinguish types. This is so we don't have to cast all the time when parsing the resulting token stream.
Also, removed start/end stream tokens.
This commit is contained in:
parent
b6a0ef207b
commit
852e5b63e5
6 changed files with 201 additions and 214 deletions
23
scanner.h
23
scanner.h
|
@ -23,6 +23,8 @@ namespace YAML
|
|||
|
||||
private:
|
||||
// scanning
|
||||
void StartStream();
|
||||
void EndStream();
|
||||
void ScanNextToken();
|
||||
void ScanToNextToken();
|
||||
Token *PushIndentTo(int column, bool sequence);
|
||||
|
@ -46,8 +48,24 @@ namespace YAML
|
|||
Token *pMapStart, *pKey;
|
||||
};
|
||||
|
||||
template <typename T> void ScanAndEnqueue(T *pToken);
|
||||
template <typename T> T *ScanToken(T *pToken);
|
||||
// and the tokens
|
||||
void ScanDirective();
|
||||
void ScanDocStart();
|
||||
void ScanDocEnd();
|
||||
void ScanBlockSeqStart();
|
||||
void ScanBlockMapSTart();
|
||||
void ScanBlockEnd();
|
||||
void ScanBlockEntry();
|
||||
void ScanFlowStart();
|
||||
void ScanFlowEnd();
|
||||
void ScanFlowEntry();
|
||||
void ScanKey();
|
||||
void ScanValue();
|
||||
void ScanAnchorOrAlias();
|
||||
void ScanTag();
|
||||
void ScanPlainScalar();
|
||||
void ScanQuotedScalar();
|
||||
void ScanBlockScalar();
|
||||
|
||||
private:
|
||||
// the stream
|
||||
|
@ -55,7 +73,6 @@ namespace YAML
|
|||
|
||||
// the output (tokens)
|
||||
std::queue <Token *> m_tokens;
|
||||
std::set <Token *> m_limboTokens;
|
||||
|
||||
// state info
|
||||
bool m_startedStream, m_endedStream;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue