diff --git a/src/LR0.cpp b/src/LR0.cpp index 7951a342..9fdbe6d1 100644 --- a/src/LR0.cpp +++ b/src/LR0.cpp @@ -26,6 +26,7 @@ #include #include +#include #include #include #include @@ -233,7 +234,23 @@ void LR0::createParseTable (States& states) //////////////////////////////////////////////////////////////////////////////// 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 + + } } ////////////////////////////////////////////////////////////////////////////////