SyntaxTutor
Educational app designed to help compiler students understand LL(1) and SLR(1) parsing algorithms.
 
Loading...
Searching...
No Matches
state Struct Reference

Represents a state in the LR(0) automaton. More...

#include <state.hpp>

Public Member Functions

bool operator== (const state &other) const
 Equality operator for comparing states based on their items.
 

Public Attributes

std::unordered_set< Lr0Itemitems_
 The set of LR(0) items that make up this state.
 
unsigned int id_
 Unique identifier of the state.
 

Detailed Description

Represents a state in the LR(0) automaton.

Each state consists of a unique identifier and a set of LR(0) items that define its core. States are used to build the SLR(1) parsing table.

Member Function Documentation

◆ operator==()

bool state::operator== ( const state & other) const
inline

Equality operator for comparing states based on their items.

Parameters
otherThe state to compare with.
Returns
true if both states have the same item set; false otherwise.

Member Data Documentation

◆ id_

unsigned int state::id_

Unique identifier of the state.

◆ items_

std::unordered_set<Lr0Item> state::items_

The set of LR(0) items that make up this state.


The documentation for this struct was generated from the following file: