MysoreScript
Public Member Functions | List of all members
AST::Multiply Struct Reference

Multiply operation. More...

#include <ast.hh>

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

Public Member Functions

const char * methodName () override
 Multiply operations become the mul() method invocations on non-integer objects. More...
 
llvm::Value * compileBinOp (Compiler::Context &c, llvm::Value *LHS, llvm::Value *RHS) override
 Compile the multiply expression. More...
 
- Public Member Functions inherited from AST::BinOp< std::multiplies< intptr_t > >
intptr_t evaluateWithIntegers (intptr_t lhs, intptr_t rhs) override
 Evaluate (interpret) this expression, having already determined that the two sides are integer values. More...
 
- Public Member Functions inherited from AST::BinOpBase
virtual bool isComparison ()
 Returns whether this operation is a comparison. More...
 
bool isConstantExpression () override
 A binary operation is a constant expression if both of its operands are binary expressions. More...
 
Obj evaluateExpr (Interpreter::Context &c) override
 Evaluates the expression, either invoking a subclass evaluateWithIntegers method or by calling the relevant method on the left-hand side. More...
 
llvm::Value * compileExpression (Compiler::Context &c) override
 Compile the expression by compiling the two sides and then calling compileBinOp (implemented in subclasses) to compile the operation. More...
 
void collectVarUses (std::unordered_set< std::string > &decls, std::unordered_set< std::string > &uses) override
 Collect the uses and declarations in this expression. More...
 
- Public Member Functions inherited from AST::Expression
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...
 

Additional Inherited Members

- Public Attributes inherited from AST::BinOpBase
ASTPtr< Expressionlhs
 The left-hand side of the operation. More...
 
ASTPtr< Expressionrhs
 The right-hand side of the operation. More...
 
- Protected Attributes inherited from AST::Expression
Interpreter::Value cache
 Cached result for constant expression. More...
 

Detailed Description

Multiply operation.

Definition at line 304 of file ast.hh.

Member Function Documentation

§ compileBinOp()

Value * Multiply::compileBinOp ( Compiler::Context c,
llvm::Value *  LHS,
llvm::Value *  RHS 
)
overridevirtual

Compile the multiply expression.

Implements AST::BinOpBase.

Definition at line 759 of file compiler.cc.

Here is the call graph for this function:

§ methodName()

const char* AST::Multiply::methodName ( )
inlineoverridevirtual

Multiply operations become the mul() method invocations on non-integer objects.

Implements AST::BinOpBase.

Definition at line 310 of file ast.hh.


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