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

Dialog window for completing and submitting an SLR(1) parsing table. More...

#include <slrtabledialog.h>

Inheritance diagram for SLRTableDialog:
Collaboration diagram for SLRTableDialog:

Public Member Functions

 SLRTableDialog (int rowCount, int colCount, const QStringList &colHeaders, QWidget *parent=nullptr, QVector< QVector< QString > > *initialData=nullptr)
 Constructs the SLR(1) table dialog.
 
QVector< QVector< QString > > getTableData () const
 Retrieves the content of the table after user interaction.
 
void setInitialData (const QVector< QVector< QString > > &data)
 Fills the table with existing data.
 

Detailed Description

Dialog window for completing and submitting an SLR(1) parsing table.

This class displays a table-based UI for students to fill in the ACTION and GOTO parts of the SLR(1) parsing table. It supports initializing the table with data, retrieving user input, and integrating with correction logic in tutorial or challenge mode.

Constructor & Destructor Documentation

◆ SLRTableDialog()

SLRTableDialog::SLRTableDialog ( int rowCount,
int colCount,
const QStringList & colHeaders,
QWidget * parent = nullptr,
QVector< QVector< QString > > * initialData = nullptr )

Constructs the SLR(1) table dialog.

Parameters
rowCountNumber of rows (usually equal to number of LR(0) states).
colCountNumber of columns (symbols = terminals + non-terminals).
colHeadersHeader labels for the columns.
parentParent widget.
initialDataOptional initial data to pre-fill the table.
Here is the call graph for this function:

Member Function Documentation

◆ getTableData()

QVector< QVector< QString > > SLRTableDialog::getTableData ( ) const

Retrieves the content of the table after user interaction.

Returns
A 2D vector representing the current table values.

◆ setInitialData()

void SLRTableDialog::setInitialData ( const QVector< QVector< QString > > & data)

Fills the table with existing data.

This method is used to show a previous user submission (e.g., during retries or feedback).

Parameters
data2D vector containing the table data to display.
Here is the caller graph for this function:

The documentation for this class was generated from the following files: