Dialog window for completing and submitting an SLR(1) parsing table. More...
#include <slrtabledialog.h>
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. | |
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.
SLRTableDialog::SLRTableDialog | ( | int | rowCount, |
int | colCount, | ||
const QStringList & | colHeaders, | ||
QWidget * | parent = nullptr, | ||
QVector< QVector< QString > > * | initialData = nullptr ) |
Constructs the SLR(1) table dialog.
rowCount | Number of rows (usually equal to number of LR(0) states). |
colCount | Number of columns (symbols = terminals + non-terminals). |
colHeaders | Header labels for the columns. |
parent | Parent widget. |
initialData | Optional initial data to pre-fill the table. |
QVector< QVector< QString > > SLRTableDialog::getTableData | ( | ) | const |
Retrieves the content of the table after user interaction.
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).
data | 2D vector containing the table data to display. |