2014-04-28 21:09:25 +04:00
|
|
|
#pragma once
|
2013-04-09 08:28:16 +04:00
|
|
|
|
|
|
|
#include "context.h"
|
|
|
|
|
|
|
|
/*!
|
|
|
|
This hold the evaluation context (the parameters actually sent
|
|
|
|
when calling a module or function, including the children).
|
|
|
|
*/
|
|
|
|
class EvalContext : public Context
|
|
|
|
{
|
|
|
|
public:
|
2013-04-19 05:42:33 +04:00
|
|
|
typedef std::vector<class ModuleInstantiation *> InstanceList;
|
|
|
|
|
|
|
|
EvalContext(const Context *parent,
|
2014-11-17 08:57:36 +03:00
|
|
|
const AssignmentList &args, const class LocalScope *const scope = NULL);
|
2013-04-09 08:28:16 +04:00
|
|
|
virtual ~EvalContext() {}
|
|
|
|
|
2013-04-19 05:42:33 +04:00
|
|
|
size_t numArgs() const { return this->eval_arguments.size(); }
|
|
|
|
const std::string &getArgName(size_t i) const;
|
2014-11-23 08:59:17 +03:00
|
|
|
ValuePtr getArgValue(size_t i, const Context *ctx = NULL) const;
|
2013-04-19 05:42:33 +04:00
|
|
|
|
2013-04-20 01:52:01 +04:00
|
|
|
size_t numChildren() const;
|
|
|
|
ModuleInstantiation *getChild(size_t i) const;
|
2013-04-09 08:28:16 +04:00
|
|
|
|
|
|
|
#ifdef DEBUG
|
2014-04-05 08:40:23 +04:00
|
|
|
virtual std::string dump(const class AbstractModule *mod, const ModuleInstantiation *inst);
|
2013-04-09 08:28:16 +04:00
|
|
|
#endif
|
2013-04-19 05:42:33 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
const AssignmentList &eval_arguments;
|
2013-04-20 01:52:01 +04:00
|
|
|
const LocalScope *const scope;
|
2013-04-09 08:28:16 +04:00
|
|
|
};
|