Class: CFG::SliceNode

Inherits:
ASTNode show all
Defined in:
lib/CFG/config.rb

Instance Attribute Summary collapse

Attributes inherited from ASTNode

#end, #kind, #start

Instance Method Summary collapse

Constructor Details

#initialize(start_index, stop_index, step) ⇒ SliceNode

Returns a new instance of SliceNode.



807
808
809
810
811
812
# File 'lib/CFG/config.rb', line 807

def initialize(start_index, stop_index, step)
  super(:COLON)
  @start_index = start_index
  @stop_index = stop_index
  @step = step
end

Instance Attribute Details

#start_indexObject (readonly)

Returns the value of attribute start_index.



803
804
805
# File 'lib/CFG/config.rb', line 803

def start_index
  @start_index
end

#stepObject (readonly)

Returns the value of attribute step.



805
806
807
# File 'lib/CFG/config.rb', line 805

def step
  @step
end

#stop_indexObject (readonly)

Returns the value of attribute stop_index.



804
805
806
# File 'lib/CFG/config.rb', line 804

def stop_index
  @stop_index
end

Instance Method Details

#==(other) ⇒ Object



818
819
820
821
# File 'lib/CFG/config.rb', line 818

def ==(other)
  @kind == other.kind && @start_index == other.start_index &&
    @stop_index == other.stop_index && @step == other.step
end

#to_sObject



814
815
816
# File 'lib/CFG/config.rb', line 814

def to_s
  "SliceNode(#{@start_index}:#{@stop_index}:#{@step})"
end