SyntaxTutor
Educational app designed to help compiler students understand LL(1) and SLR(1) parsing algorithms.
Loading...
Searching...
No Matches
slrtabledialog.h
Go to the documentation of this file.
1/*
2 * SyntaxTutor - Interactive Tutorial About Syntax Analyzers
3 * Copyright (C) 2025 Jose R. (jose-rzm)
4 *
5 * This program is free software: you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 */
18
19#ifndef SLRTABLEDIALOG_H
20#define SLRTABLEDIALOG_H
21
22#include <QDialog>
23#include <QGuiApplication>
24#include <QHeaderView>
25#include <QPushButton>
26#include <QScreen>
27#include <QTableWidget>
28#include <QVBoxLayout>
29
39class SLRTableDialog : public QDialog {
40 Q_OBJECT
41 public:
51 SLRTableDialog(int rowCount, int colCount, const QStringList& colHeaders,
52 QWidget* parent = nullptr,
53 QVector<QVector<QString>>* initialData = nullptr);
54
59 QVector<QVector<QString>> getTableData() const;
60
69 void setInitialData(const QVector<QVector<QString>>& data);
70
71 private:
72 QTableWidget* table;
73 QPushButton* submitButton;
74};
75
76#endif // SLRTABLEDIALOG_H
SLRTableDialog(int rowCount, int colCount, const QStringList &colHeaders, QWidget *parent=nullptr, QVector< QVector< QString > > *initialData=nullptr)
Constructs the SLR(1) table dialog.
Definition slrtabledialog.cpp:34
QVector< QVector< QString > > getTableData() const
Retrieves the content of the table after user interaction.
Definition slrtabledialog.cpp:103
void setInitialData(const QVector< QVector< QString > > &data)
Fills the table with existing data.
Definition slrtabledialog.cpp:116