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

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

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.

RBS:

  • (green: GreenNode, lhs: Integer, left_state: Integer, left_states: Array[Integer?], previous_trailing: Array[GreenTrivia]) -> void

Parameters:

  • green: (GreenNode)
  • lhs: (Integer)
  • left_state: (Integer)
  • left_states: (Array[Integer?])
  • previous_trailing: (Array[GreenTrivia])


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

#greenGreenNode (readonly)

Signature:

  • GreenNode

Returns:



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

def green
  @green
end

#left_stateInteger (readonly)

Signature:

  • Integer

Returns:

  • (Integer)


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

def left_state
  @left_state
end

#left_statesArray[Integer?] (readonly)

Signature:

  • Array[Integer?]

Returns:

  • (Array[Integer?])


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

def left_states
  @left_states
end

#lhsInteger (readonly)

Signature:

  • Integer

Returns:

  • (Integer)


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

def lhs
  @lhs
end

#previous_trailingArray[GreenTrivia] (readonly)

Signature:

  • Array[GreenTrivia]

Returns:



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

def previous_trailing
  @previous_trailing
end