Added a peek token command (for the parser to use).

This commit is contained in:
Jesse Beder 2008-06-30 06:21:12 +00:00
parent 07d4cac48f
commit ed6c294749
6 changed files with 109 additions and 113 deletions

View file

@ -5,6 +5,9 @@
#include "exceptions.h"
#include <fstream>
#include <iostream>
#include "token.h"
namespace YAML
{
Document::Document(): m_pRoot(0)
@ -34,10 +37,16 @@ namespace YAML
std::ifstream fin(fileName.c_str());
Scanner scanner(fin);
scanner.Scan();
// 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();
// if(!scanner)
// return;
// m_pRoot = parser.ReadNextNode();
}