logo

abstract class

compiler::Expr

sys::Obj
  compiler::Node
    compiler::Expr

Expr

Slots

asTableSwitchCase

virtual Int asTableSwitchCase()

Return this expression as an Int literal usable in a tableswitch, or null if this Expr doesn't represent a constant Int. Expressions which work as table switch cases: int literals and enum constants

Source

assignRequiresTempVar

virtual Bool assignRequiresTempVar()

Assignments to instance fields require a temporary local variable.

Source

commonType

static CType commonType(CNamespace ns, Expr[] exprs)

Given a list of Expr instances, find the common base type they all share. This method does not take into account the null literal. It is used for type inference for lists and maps.

Source

ctype

CType ctype

Source

ctypes

static CType[] ctypes(Expr[] exprs)

Map the list of expressions into their list of types

Source

fits

Bool fits(CType expected)

Return if this expression matches the expected type.

Source

id

readonly ExprId id

Source

isAssignable

virtual Bool isAssignable()

Return if this expression can be used as the left hand side of an assignment expression.

Source

isCond

virtual Bool isCond()

Is this a boolean conditional (boolOr/boolAnd)

Source

isStmt

virtual Bool isStmt()

Does this expression make up a complete statement. If you override this to true, then you must make sure the expr is popped in CodeAsm.

Source

leave

Bool leave := true { protected set }

Source

make

new make(Location location, ExprId id)

Source

noLeave

Expr noLeave()

Set this expression to not be left on the stack.

Source

print

override Void print(AstWriter out)

Pretty print this node and it's descendants.

Source

serialize

virtual Str serialize()

Return this expression as serialization text or throw exception if not serializable.

Source

toDocStr

Str toDocStr()

Get this expression as a string suitable for documentation.

Source

toStmt

ExprStmt toStmt()

Return this expression as an ExprStmt

Source

toStr

abstract Str toStr()

Return a string representation of this object.

Source

walk

Expr walk(Visitor v)

Source

walkChildren

virtual Void walkChildren(Visitor v)

Source

walkExpr

static Expr walkExpr(Visitor v, Expr expr)

Source

walkExprs

static Expr[] walkExprs(Visitor v, Expr[] exprs)

Source