🛰️航天仿真算法库 SpaceAST
0.0.1
载入中...
搜索中...
未找到
ExprCall.hpp
1
20
21
#pragma once
22
23
#include "AstGlobal.h"
24
#include "
Expr.hpp
"
25
#include "AstUtil/SharedPtr.hpp"
26
#include <vector>
27
28
29
AST_NAMESPACE_BEGIN
30
31
34
class
ExprCall
:
public
Expr
35
{
36
public
:
37
AST_EXPR(
ExprCall
)
38
39
ExprCall
() =
default
;
40
~ExprCall
() =
default
;
41
45
ExprCall
(
Expr
* func,
const
std::vector<
SharedPtr<Expr>
>& args)
46
: func_(func), args_(args)
47
{}
48
51
Value
* eval()
const override
;
52
56
std::string getExpression(
Object
* context=
nullptr
)
const override
;
57
60
Expr
*
getFunc
()
const
{
return
func_.get(); }
61
64
const
std::vector<SharedPtr<Expr>>&
getArgs
()
const
{
return
args_; }
65
66
private
:
67
SharedPtr<Expr>
func_;
68
std::vector<SharedPtr<Expr>> args_;
69
};
70
71
AST_NAMESPACE_END
Expr.hpp
~
ast::ExprCall
函数调用表达式
定义
ExprCall.hpp:35
ast::ExprCall::getFunc
Expr * getFunc() const
获取被调用的函数表达式
定义
ExprCall.hpp:60
ast::ExprCall::getArgs
const std::vector< SharedPtr< Expr > > & getArgs() const
获取调用参数列表
定义
ExprCall.hpp:64
ast::ExprCall::ExprCall
ExprCall(Expr *func, const std::vector< SharedPtr< Expr > > &args)
构造函数
定义
ExprCall.hpp:45
ast::Expr
表达式基类
定义
Expr.hpp:39
ast::Object
对象基类,继承自该类的对象可以使用运行时类型信息相关功能,实现强弱引用计数、运行时元信息(属性访问、序列化等)等基础功能
定义
Object.hpp:81
ast::SharedPtr
共享指针
定义
SharedPtr.hpp:33
ast::Value
值对象基类
定义
Value.hpp:36
src
AstScript
Expression
ExprCall.hpp
制作者
1.12.0