mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
LR0: Created data strcuture to represent intermediate parsing table
This commit is contained in:
parent
a3260246bf
commit
26e0a472ac
1 changed files with 18 additions and 0 deletions
18
src/LR0.h
18
src/LR0.h
|
@ -40,6 +40,24 @@ public:
|
|||
void debug (bool);
|
||||
std::string dump () const;
|
||||
|
||||
protected:
|
||||
class Item
|
||||
{
|
||||
public:
|
||||
Item (int rule, int cursor) : _rule (rule), _cursor (cursor) {}
|
||||
|
||||
int _rule;
|
||||
int _cursor;
|
||||
};
|
||||
|
||||
class Closure : public std::vector <Item>
|
||||
{
|
||||
};
|
||||
|
||||
class States : public std::vector <Closure>
|
||||
{
|
||||
};
|
||||
|
||||
private:
|
||||
bool expandNonTerminals (std::vector <std::vector <std::string>>&, std::vector <std::pair <int, int>>&);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue