EMethods

A collection of methods that operate on Expression nodes.

Constructors

this
this(Diagnostics diag = null)

Constructs an EMethods object.

Members

Functions

addressOf
Expression addressOf(Expression e)

Returns the expression &e.

error
void error(Node n, cstring msg, ...)

Issues an error.

errorExpectedIntOrFloat
void errorExpectedIntOrFloat(Expression e)

Reports an error.

toComplex
Complex toComplex(Expression e)

Returns Re(e) + Im(e).

toImag
Float toImag(Expression e)

Returns Im(e).

toInt
long toInt(Expression e)

Converts the expression to an integer. Reports an error if impossible.

toLValue
Expression toLValue(Expression e)

Returns the lvalue of e.

toReal
Float toReal(Expression e)

Returns Re(e).

toRealOrImag
Float toRealOrImag(Expression e)

Returns the Float value of e.

toUInt
ulong toUInt(Expression e)

Converts the expression to an integer. Reports an error if impossible.

Static functions

arrayLength
Expression arrayLength(Expression e)

Returns the length of a string/array/assocarray.

isBool
int isBool(Expression e)

Checks if e has a boolean value.

isConst
bool isConst(Expression e)

Returns true if e is a constant expression.

isFalse
bool isFalse(Expression e)

Returns true if e has a boolean value and if it is false.

isTrue
bool isTrue(Expression e)

Returns true if e has a boolean value and if it is true.

toBool
Expression toBool(Expression e)

Returns a boolean IntExpr if e has a boolean value, otherwise NAR.

Variables

diag
Diagnostics diag;

For error messages.

Meta