first full mupp version allowing variables on scripting level, interactively still missing.

This commit is contained in:
2020-04-30 17:11:57 +02:00
parent f4ac06cb20
commit d81a10e450
6 changed files with 284 additions and 24 deletions

View File

@@ -36,24 +36,32 @@
#include <QString>
#include "Pmupp.h"
#include <PAst.hpp>
#include "PAst.hpp"
#include "PProgram.hpp"
class PVarHandler {
public:
PVarHandler(PmuppCollection *coll, std::string parse_str);
PVarHandler(PmuppCollection *coll, std::string parse_str, std::string var_name);
bool isValid() { return fIsValid; }
QString getVarName() { return QString(fVarName.c_str()); }
std::vector<double> getValues();
std::vector<double> getErrors();
private:
PmuppCollection *fColl; ///< collection need for parsing and evaluation
std::string fParseStr; ///< the variable input to be parsed
std::string fVarName; ///< variable name
mupp::prog::PVarHandler fVar; ///< values of the evaluation
bool fIsValid;
mupp::ast::statement_list fAst; ///< the AST
void injectPredefVariables();
std::string getVarName(int idx);
std::vector<double> getData(int idx);
std::vector<double> getDataErr(int idx);
};
#endif //_PVARHANDLER_H_