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

Dialog for filling and submitting an LL(1) parsing table. More...

#include <lltabledialog.h>

Inheritance diagram for LLTableDialog:
Collaboration diagram for LLTableDialog:

Signals

void submitted (const QVector< QVector< QString > > &data)
 Signal emitted when the user submits the table.
 

Public Member Functions

 LLTableDialog (const QStringList &rowHeaders, const QStringList &colHeaders, QWidget *parent, QVector< QVector< QString > > *initialData=nullptr)
 Constructs the LL(1) table dialog with given headers and optional initial data.
 
QVector< QVector< QString > > getTableData () const
 Returns the contents of the table filled by the user.
 
void setInitialData (const QVector< QVector< QString > > &data)
 Pre-fills the table with existing user data.
 
void highlightIncorrectCells (const QList< QPair< int, int > > &coords)
 Highlights cells that are incorrect based on provided coordinates.
 

Detailed Description

Dialog for filling and submitting an LL(1) parsing table.

This class represents a dialog window that displays a table for users to complete the LL(1) parsing matrix. It provides functionality to initialize the table with data, retrieve the user's input, and highlight incorrect answers.

Constructor & Destructor Documentation

◆ LLTableDialog()

LLTableDialog::LLTableDialog ( const QStringList & rowHeaders,
const QStringList & colHeaders,
QWidget * parent,
QVector< QVector< QString > > * initialData = nullptr )

Constructs the LL(1) table dialog with given headers and optional initial data.

Parameters
rowHeadersRow labels (non-terminal symbols).
colHeadersColumn labels (terminal symbols).
parentParent widget.
initialDataOptional initial table data to pre-fill cells.
Here is the call graph for this function:

Member Function Documentation

◆ getTableData()

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

Returns the contents of the table filled by the user.

Returns
A 2D vector representing the LL(1) table.
Here is the caller graph for this function:

◆ highlightIncorrectCells()

void LLTableDialog::highlightIncorrectCells ( const QList< QPair< int, int > > & coords)

Highlights cells that are incorrect based on provided coordinates.

Parameters
coordsA list of (row, column) pairs to highlight as incorrect.

◆ setInitialData()

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

Pre-fills the table with existing user data.

This is used to populate the table with a previous (possibly incorrect) answer when retrying a task or providing feedback.

Parameters
dataA 2D vector of strings representing the initial cell values.
Here is the caller graph for this function:

◆ submitted

void LLTableDialog::submitted ( const QVector< QVector< QString > > & data)
signal

Signal emitted when the user submits the table.

Parameters
dataThe filled table data submitted by the user.
Here is the caller graph for this function:

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