LR0: Stubbed ::parse functionality

This commit is contained in:
Paul Beckingham 2016-01-09 22:06:26 -05:00
parent 6558f8422d
commit 8cd6fd2a5f

View file

@ -26,6 +26,7 @@
#include <cmake.h> #include <cmake.h>
#include <LR0.h> #include <LR0.h>
#include <Lexer.h>
#include <Table.h> #include <Table.h>
#include <Color.h> #include <Color.h>
#include <text.h> #include <text.h>
@ -233,7 +234,23 @@ void LR0::createParseTable (States& states)
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
void LR0::parse (const std::string& input) void LR0::parse (const std::string& input)
{ {
// TODO Implement parser DFA here. Lexer l (input);
std::string token;
Lexer::Type type;
while (l.token (token, type))
{
std::cout << "# token '" << token << "' " << Lexer::typeToString (type) << "\n";
// TODO Done
// TODO Shift
// TODO Reduce
// TODO Error
}
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////