| #pragma once |
| |
| #ifndef TEXPRESSION_INCLUDED |
| #define TEXPRESSION_INCLUDED |
| |
| #include <memory> |
| |
| |
| #include "tcommon.h" |
| |
| #undef DVAPI |
| #undef DVVAR |
| #ifdef TNZBASE_EXPORTS |
| #define DVAPI DV_EXPORT_API |
| #define DVVAR DV_EXPORT_VAR |
| #else |
| #define DVAPI DV_IMPORT_API |
| #define DVVAR DV_IMPORT_VAR |
| #endif |
| |
| |
| |
| |
| |
| class TUnit; |
| class TDoubleParam; |
| |
| namespace TSyntax { |
| class Grammar; |
| class CalculatorNodeVisitor; |
| class Calculator; |
| } |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| class DVAPI TExpression { |
| class Imp; |
| std::unique_ptr<Imp> m_imp; |
| |
| public: |
| TExpression(); |
| ~TExpression(); |
| |
| TExpression(const TExpression &); |
| TExpression &operator=(TExpression); |
| |
| |
| void setGrammar(const TSyntax::Grammar *grammar); |
| const TSyntax::Grammar *getGrammar() const; |
| |
| |
| |
| |
| |
| |
| void setText(std::string text); |
| std::string getText() const; |
| |
| TSyntax::Calculator *getCalculator(); |
| |
| |
| |
| |
| |
| bool isValid(); |
| |
| std::string getError() const; |
| std::pair<int, int> getErrorPos() const; |
| |
| void accept(TSyntax::CalculatorNodeVisitor &visitor); |
| |
| void setOwnerParameter(TDoubleParam *param); |
| TDoubleParam *getOwnerParameter() const; |
| |
| bool isCycling() const; |
| |
| private: |
| |
| |
| void parse(); |
| }; |
| |
| #endif |