Vespucci  1.0.0
macroparser.h
Go to the documentation of this file.
1 /*******************************************************************************
2  Copyright (C) 2014-2016 Wright State University - All Rights Reserved
3  Daniel P. Foose - Maintainer/Lead Developer
4 
5  This file is part of Vespucci.
6 
7  Vespucci is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  Vespucci is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with Vespucci. If not, see <http://www.gnu.org/licenses/>.
19 *******************************************************************************/
20 #ifndef MACROPARSER_H
21 #define MACROPARSER_H
22 
25 {
26 public:
27  MacroParser(QSharedPointer<VespucciDataset> dataset);
28  bool LoadMacro(QString macro);
29  bool ExecuteMacro();
30  void Error(int &error_line, int &error_param);
31 private:
32  void ExecuteCommand(QString command, QStringList params);
33  bool ValidateCommand(QString command, QStringList params, int &param_error);
34  bool ToBool(const QString &param);
35 
40  QList<QPair<QString, QStringList> > commands_;
41 
45  QMap<QString, QStringList> valid_commands_;
46 
50  QSharedPointer<VespucciDataset> dataset_;
51 
55  int error_line_;
56 
61  int error_param_;
62 };
63 
64 #endif // MACROPARSER_H
MacroParser(QSharedPointer< VespucciDataset > dataset)
Definition: macroparser.cpp:22
bool LoadMacro(QString macro)
MacroParser::LoadMacro.
Definition: macroparser.cpp:68
void Error(int &error_line, int &error_param)
bool ExecuteMacro()
MacroParser::ExecuteMacro Iteratively executes the commands in commands_. Each command is first valid...