Class: Rampi::UnaryExpr
Instance Attribute Summary collapse
-
#op ⇒ Object
Returns the value of attribute op.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
-
#initialize(op, value) ⇒ UnaryExpr
constructor
A new instance of UnaryExpr.
- #to_s ⇒ Object (also: #inspect)
Methods inherited from Node
#!=, #%, #&, #*, #**, #+, #-, #-@, #/, #<, #<<, #<=, #==, #>, #>=, #>>, #^, #|, #~
Constructor Details
#initialize(op, value) ⇒ UnaryExpr
Returns a new instance of UnaryExpr.
47 48 49 50 |
# File 'lib/rampi/node.rb', line 47 def initialize(op, value) @op = op @value = value end |
Instance Attribute Details
#op ⇒ Object
Returns the value of attribute op.
45 46 47 |
# File 'lib/rampi/node.rb', line 45 def op @op end |
#value ⇒ Object
Returns the value of attribute value.
45 46 47 |
# File 'lib/rampi/node.rb', line 45 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
57 58 59 |
# File 'lib/rampi/node.rb', line 57 def accept(visitor) visitor.visit_unary_expr(self) end |
#to_s ⇒ Object Also known as: inspect
52 53 54 |
# File 'lib/rampi/node.rb', line 52 def to_s "#{@op}#{@value}" end |