1
0

activation.hpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef AFUN_ACTIVATION_HPP
  2. #define AFUN_ACTIVATION_HPP
  3. #include "tool.hpp"
  4. #include "aFunCoreExport.h"
  5. namespace aFuncore {
  6. class Activation;
  7. class TopActivation;
  8. }
  9. #include "msg.hpp"
  10. #include "code.hpp"
  11. #include "inter.hpp"
  12. #include "var.hpp"
  13. namespace aFuncore {
  14. class Activation {
  15. protected:
  16. Activation *prev;
  17. VarList *varlist;
  18. VarList *old_varlist;
  19. UpMessage *up;
  20. DownMessage *down;
  21. public:
  22. Inter *const inter;
  23. StringFilePath path;
  24. FileLine line;
  25. explicit Activation(Inter *inter_);
  26. virtual ~Activation();
  27. virtual Code *getCode()=0;
  28. virtual bool onTail()=0;
  29. [[nodiscard]] VarList *getVarlist() const {return varlist;}
  30. [[nodiscard]] Activation *toPrev() const {return prev;}
  31. [[nodiscard]] UpMessage *getUpStream() const {return up;}
  32. [[nodiscard]] DownMessage *getDownStream() const {return down;}
  33. };
  34. class TopActivation : public Activation {
  35. Code *start;
  36. Code *next;
  37. public:
  38. explicit TopActivation(Code *code, Inter *inter_);
  39. ~TopActivation() override;
  40. Code *getCode() override;
  41. bool onTail() override {return false;}
  42. };
  43. }
  44. #endif //AFUN_ACTIVATION_HPP