KSGSExpressionEvaluator.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #pragma once
  2. #include "../Include/KSGScript.h"
  3. #include "../Befehl/KSGSFunktion.h"
  4. #include <Trie.h>
  5. namespace KSGScript
  6. {
  7. class KSGSKlasse;
  8. class KSGSVariable;
  9. class KSGSFunktion;
  10. class KSGSExpressionEvaluatorImpl : public KSGSExpressionEvaluator
  11. {
  12. private:
  13. Framework::RCArray<KSGSVariable> *params;
  14. Framework::RCArray<Text> *paramNames;
  15. Framework::Text expression;
  16. RCArray< KSGSFunktion > *functions;
  17. RCArray< KSGSKlasse > *classes;
  18. RCArray< KSGSVariable > *variables;
  19. private:
  20. void compile();
  21. public:
  22. KSGSExpressionEvaluatorImpl();
  23. ~KSGSExpressionEvaluatorImpl();
  24. KSGSVariable *createParameter( Framework::Text name, int type ) override;
  25. KSGSVariable *getParameter( Framework::Text name ) override;
  26. void setExpression( Framework::Text expression ) override;
  27. KSGSVariable *evaluate() override;
  28. void logNachricht( char *n ) override;
  29. Framework::Text *convertPfad( char *pf ) override;
  30. void setVariable( int id, KSGSVariable *var ) override;
  31. KSGSVariable *startFunktion( int id, Framework::RCArray< KSGSVariable > *parameter ) override;
  32. KSGSVariable *erstellKlassenInstanz( int id ) override;
  33. KSGSVariable *getVariable( int id ) const override;
  34. int getScriptId() const override;
  35. Framework::Bildschirm *zBildschirm() const override;
  36. Framework::Schrift *zSchrift() const override;
  37. int getFunktionId( const char *name ) const override;
  38. bool istBeendet( int scrId ) const override;
  39. KSGSVariable *rückruf( Framework::RCArray< KSGSVariable > *parameter ) const override;
  40. };
  41. }