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

assignRequiresTempVar

virtual Bool assignRequiresTempVar()

Assignments to instance fields require a temporary local variable.

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.

ctype

CType ctype

ctypes

static CType[] ctypes(Expr[] exprs)

Map the list of expressions into their list of types

fits

Bool fits(CType expected)

Return if this expression matches the expected type.

id

readonly ExprId id

isAssignable

virtual Bool isAssignable()

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

isCond

virtual Bool isCond()

Is this a boolean conditional (boolOr/boolAnd)

isStmt

virtual Bool isStmt()

Does this expression make up a complete statement

leave

Bool leave

make

new make(Location location, ExprId id)

print

override Void print(AstWriter out)

serialize

virtual Str serialize()

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

toStmt

ExprStmt toStmt()

Return this expression as an ExprStmt

toStr

abstract Str toStr()

walk

Expr walk(Visitor v)

walkChildren

virtual Void walkChildren(Visitor v)

walkExpr

static Expr walkExpr(Visitor v, Expr expr)

walkExprs

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