
class
compiler::ShortcutExpr
sys::Obj compiler::Node compiler::Expr compiler::NameExpr compiler::CallExpr compiler::ShortcutExpr
ShortcutExpr is used for operator expressions which are a shortcut to a method call:
a + b => a.plus(b) a - b => a.minus(b) a * b => a.mult(b) a / b => a.div(b) a % b => a.mod(b) a[b] => a.get(b) a[b] = c => a.set(b, c) a[b] => a.slice(b) if b is Range a[b] = c => a.splice(b, c) if b is Range a << b => a.lshift(b) a >> b => a.rshift(b) a & b => a.and(b) a | b => a.or(b) a ^ b => a.xor(b) ~a => a.inverse() -a => a.negate() ++a, a++ => a.increment() --a, a-- => a.decrement() a == b => a.equals(b) a != b => ! a.equals(b) a <=> => a.compare(b) a > b => a.compare(b) > 0 a >= b => a.compare(b) >= 0 a < b => a.compare(b) < 0 a <= b => a.compare(b) <= 0
Slots
- assignRequiresTempVar
-
override Bool assignRequiresTempVar()
Assignments to instance fields require a temporary local variable.
- isAssign
-
Bool isAssign()
- isAssignable
-
override Bool isAssignable()
Return if this expression can be used as the left hand side of an assignment expression.
- isPostfixLeave
-
Bool isPostfixLeave := false
- isStmt
-
override 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.
- isStrConcat
-
Bool isStrConcat()
- makeBinary
- makeFrom
-
new makeFrom(ShortcutExpr from)
- makeGet
- makeUnary
- op
-
ShortcutOp op
- opToken
-
Token opToken
-
override Void print(AstWriter out)
Pretty print this node and it's descendants.
- tempVar
-
MethodVar tempVar
- toStr
-
override Str toStr()
Return a string representation of this object.