logo
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.star(b)
a / b    -> a.slash(b)
a % b    -> a.percent(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.amp(b)
a | b    -> a.pipe(b)
a ^ b    -> a.caret(b)
~a       -> a.tilde()
-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

virtual Bool assignRequiresTempVar()

isAssign

Bool isAssign()

isAssignable

virtual Bool isAssignable()

isPostfixLeave

Bool isPostfixLeave

isStmt

virtual Bool isStmt()

isStrConcat

Bool isStrConcat()

makeBinary

new makeBinary(Expr lhs, Token opToken, Expr rhs)

makeFrom

new makeFrom(ShortcutExpr from)

makeGet

new makeGet(Location loc, Expr target, Expr index)

makeUnary

new makeUnary(Location loc, Token opToken, Expr operand)

op

ShortcutOp op

opToken

Token opToken

print

virtual Void print(AstWriter out)

tempVar

MethodVar tempVar

toStr

virtual Str toStr()