Replaced the queue of Token pointers with values.

We were getting memory leaks (as told by the CRT detectors, which I also added), and there's really no reason (as long as we're careful) to use pointers there.
This commit is contained in:
beder
2008-07-20 05:02:01 +00:00
parent f4e522490f
commit 557f81e622
25 changed files with 297 additions and 251 deletions

View File

@@ -6,21 +6,19 @@
#include <stack>
#include <set>
#include "stream.h"
#include "token.h"
namespace YAML
{
struct Token;
class Scanner
{
public:
Scanner(std::istream& in);
~Scanner();
Token *GetNextToken();
void EatNextToken();
void PopNextToken();
Token *PeekNextToken();
bool IsEmpty();
void PopToken();
Token& PeekToken();
private:
// scanning
@@ -72,7 +70,7 @@ namespace YAML
Stream INPUT;
// the output (tokens)
std::queue <Token *> m_tokens;
std::queue <Token> m_tokens;
// state info
bool m_startedStream, m_endedStream;