Class: Ibex::Runtime::CST::ReusableSubtree

Inherits:
Object
  • Object
show all
Defined in:
lib/ibex/runtime/cst/incremental/blender.rb

Overview

A Green nonterminal that can replace its old LR shift/reduce sequence.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(green:, lhs:, left_state:, left_states:, previous_trailing:) ⇒ ReusableSubtree

Returns a new instance of ReusableSubtree.



17
18
19
20
21
22
23
24
# File 'lib/ibex/runtime/cst/incremental/blender.rb', line 17

def initialize(green:, lhs:, left_state:, left_states:, previous_trailing:)
  @green = green
  @lhs = lhs
  @left_state = left_state
  @left_states = left_states.dup.freeze
  @previous_trailing = previous_trailing.dup.freeze
  freeze
end

Instance Attribute Details

#greenObject (readonly)

: GreenNode



9
10
11
# File 'lib/ibex/runtime/cst/incremental/blender.rb', line 9

def green
  @green
end

#left_stateObject (readonly)

: Integer



11
12
13
# File 'lib/ibex/runtime/cst/incremental/blender.rb', line 11

def left_state
  @left_state
end

#left_statesObject (readonly)

: Array



12
13
14
# File 'lib/ibex/runtime/cst/incremental/blender.rb', line 12

def left_states
  @left_states
end

#lhsObject (readonly)

: Integer



10
11
12
# File 'lib/ibex/runtime/cst/incremental/blender.rb', line 10

def lhs
  @lhs
end

#previous_trailingObject (readonly)

: Array



13
14
15
# File 'lib/ibex/runtime/cst/incremental/blender.rb', line 13

def previous_trailing
  @previous_trailing
end