Interpreter

Used for compile-time evaluation of D code.

Constructors

this
this(Diagnostics diag)

Constructs an Interpreter object.

Members

Functions

complexPlusOrMinus
ComplexExpr complexPlusOrMinus(BinaryExpr e, bool minusOp)

Calculates z1 + z2 or z1 - z2. Returns a new ComplexExpr.

eval
Expression eval(Expression e)

Start evaluation.

eval
Expression eval(FunctionDecl fd, Expression[] args)

Start evaluation of a function.

Static functions

interpret
Expression interpret(Expression e, Diagnostics diag)

Evaluates the expression e.

interpret
Expression interpret(FunctionDecl fd, Expression[] args, Diagnostics diag)

Executes the function at compile-time with the given arguments.

Inherited Members

From Visitor

dispatch
Node dispatch(Node n)

Calls the appropriate visit() method for a node.

dispatch
Node dispatch(Node n, NodeKind k)

Allows calling the visit() method with a null node.

unhandled
Node unhandled(Node n)

Called by visit() methods that were not overridden.

Meta