MysoreScript
Public Attributes | Protected Member Functions | List of all members
AST::Call Struct Reference

A call expression. More...

#include <ast.hh>

Inheritance diagram for AST::Call:
Inheritance graph
[legend]
Collaboration diagram for AST::Call:
Collaboration graph
[legend]

Public Attributes

ASTPtr< Expressioncallee
 The callee, if this is calling a closure, or the object that is having a method invoked on it if it is a method invocation. More...
 
ASTPtr< Identifier, true > method
 The name of the method, if this is a method invocation. More...
 
ASTPtr< ArgListarguments
 The arguments to this call. More...
 

Protected Member Functions

Obj evaluateExpr (Interpreter::Context &c) override
 Call the relevant method or closure. More...
 
llvm::Value * compileExpression (Compiler::Context &c) override
 Generate code to call the relevant object. More...
 
void collectVarUses (std::unordered_set< std::string > &decls, std::unordered_set< std::string > &uses) override
 Collect the variables referenced by this call. More...
 

Additional Inherited Members

- Public Member Functions inherited from AST::Expression
virtual bool isConstantExpression ()
 Returns true if the expression is constant and therefore doesn't need interpreting every time. More...
 
Obj evaluate (Interpreter::Context &c)
 Evaluate the expression, caching the result if it's a constant expression. More...
 
void interpret (Interpreter::Context &c) override final
 Interpret this expression as if it were a statement. More...
 
void compile (Compiler::Context &c) override final
 Compile this expression as if it were a statement. More...
 
- Protected Attributes inherited from AST::Expression
Interpreter::Value cache
 Cached result for constant expression. More...
 

Detailed Description

A call expression.

This either invokes a closure or a method.

Definition at line 650 of file ast.hh.

Member Function Documentation

§ collectVarUses()

void AST::Call::collectVarUses ( std::unordered_set< std::string > &  decls,
std::unordered_set< std::string > &  uses 
)
inlineoverrideprotectedvirtual

Collect the variables referenced by this call.

Implements AST::Statement.

Definition at line 677 of file ast.hh.

§ compileExpression()

Value * Call::compileExpression ( Compiler::Context c)
overrideprotectedvirtual

Generate code to call the relevant object.

Implements AST::Expression.

Definition at line 436 of file compiler.cc.

Here is the call graph for this function:

§ evaluateExpr()

Obj Call::evaluateExpr ( Interpreter::Context c)
overrideprotectedvirtual

Call the relevant method or closure.

Implements AST::Expression.

Definition at line 416 of file interpreter.cc.

Here is the call graph for this function:

Member Data Documentation

§ arguments

ASTPtr<ArgList> AST::Call::arguments

The arguments to this call.

Definition at line 664 of file ast.hh.

§ callee

ASTPtr<Expression> AST::Call::callee

The callee, if this is calling a closure, or the object that is having a method invoked on it if it is a method invocation.

Definition at line 656 of file ast.hh.

§ method

ASTPtr<Identifier, true> AST::Call::method

The name of the method, if this is a method invocation.

Definition at line 660 of file ast.hh.


The documentation for this struct was generated from the following files: