Class: Baba::Expr::Unary

Inherits:
Object
  • Object
show all
Defined in:
lib/baba/expr.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(operator, right) ⇒ Unary

Returns a new instance of Unary.



138
139
140
# File 'lib/baba/expr.rb', line 138

def initialize(operator, right)
  @operator = operator; @right = right
end

Instance Attribute Details

#operatorObject (readonly)

Returns the value of attribute operator.



136
137
138
# File 'lib/baba/expr.rb', line 136

def operator
  @operator
end

#rightObject (readonly)

Returns the value of attribute right.



136
137
138
# File 'lib/baba/expr.rb', line 136

def right
  @right
end

Instance Method Details

#accept(visitor) ⇒ Object



142
143
144
# File 'lib/baba/expr.rb', line 142

def accept(visitor)
  visitor.visit_unary_expr(self)
end