mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
LR0: Stubbed ::parse functionality
This commit is contained in:
parent
6558f8422d
commit
8cd6fd2a5f
1 changed files with 18 additions and 1 deletions
19
src/LR0.cpp
19
src/LR0.cpp
|
@ -26,6 +26,7 @@
|
|||
|
||||
#include <cmake.h>
|
||||
#include <LR0.h>
|
||||
#include <Lexer.h>
|
||||
#include <Table.h>
|
||||
#include <Color.h>
|
||||
#include <text.h>
|
||||
|
@ -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
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue