Class: Rubinius::AST::And

Inherits:
Node
  • Object
show all
Defined in:
lib/compiler/ast/operators.rb

Direct Known Subclasses

Or

Instance Attribute Summary collapse

Attributes inherited from Node

#line

Instance Method Summary collapse

Methods inherited from Node

#ascii_graph, #attributes, #children, match_arguments?, match_send?, #new_block_generator, #new_generator, #node_name, node_name, #pos, #set_child, transform, #transform, transform_comment, transform_kind, transform_kind=, transform_name, #visit, #walk

Constructor Details

#initialize(line, left, right) ⇒ And

Returns a new instance of And.



8
9
10
11
12
# File 'lib/compiler/ast/operators.rb', line 8

def initialize(line, left, right)
  @line = line
  @left = left
  @right = right
end

Instance Attribute Details

#leftObject

Returns the value of attribute left.



6
7
8
# File 'lib/compiler/ast/operators.rb', line 6

def left
  @left
end

#rightObject

Returns the value of attribute right.



6
7
8
# File 'lib/compiler/ast/operators.rb', line 6

def right
  @right
end

Instance Method Details

#sexp_nameObject



14
15
16
# File 'lib/compiler/ast/operators.rb', line 14

def sexp_name
  :and
end

#to_sexpObject



18
19
20
# File 'lib/compiler/ast/operators.rb', line 18

def to_sexp
  [sexp_name, @left.to_sexp, @right.to_sexp]
end