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

Inherits:
Object
  • Object
show all
Defined in:
lib/json5/generated_parser.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.

RBS:

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



3058
3059
3060
3061
3062
3063
3064
3065
# File 'lib/json5/generated_parser.rb', line 3058

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)

Signature:

  • GreenNode



3050
3051
3052
# File 'lib/json5/generated_parser.rb', line 3050

def green
  @green
end

#left_stateObject (readonly)

Signature:

  • Integer



3052
3053
3054
# File 'lib/json5/generated_parser.rb', line 3052

def left_state
  @left_state
end

#left_statesObject (readonly)

Signature:

  • Array[Integer?]



3053
3054
3055
# File 'lib/json5/generated_parser.rb', line 3053

def left_states
  @left_states
end

#lhsObject (readonly)

Signature:

  • Integer



3051
3052
3053
# File 'lib/json5/generated_parser.rb', line 3051

def lhs
  @lhs
end

#previous_trailingObject (readonly)

Signature:

  • Array[GreenTrivia]



3054
3055
3056
# File 'lib/json5/generated_parser.rb', line 3054

def previous_trailing
  @previous_trailing
end