Class: Ibex::LALR::BuildMetrics

Inherits:
Object
  • Object
show all
Defined in:
lib/ibex/lalr/build_metrics.rb,
sig/ibex/lalr/build_metrics.rbs

Overview

Immutable structural measurements from one automaton build. These counts are intended for diagnostics and benchmarks, not parser behavior.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(construction_states:, canonical_states:, final_states:, strategy:) ⇒ BuildMetrics

Returns a new instance of BuildMetrics.

RBS:

  • (construction_states: Integer, canonical_states: Integer?, final_states: Integer, strategy: Symbol) -> void

Parameters:

  • construction_states: (Integer)
  • canonical_states: (Integer, nil)
  • final_states: (Integer)
  • strategy: (Symbol)


14
15
16
17
18
19
20
# File 'lib/ibex/lalr/build_metrics.rb', line 14

def initialize(construction_states:, canonical_states:, final_states:, strategy:)
  @construction_states = construction_states
  @canonical_states = canonical_states
  @final_states = final_states
  @strategy = strategy
  freeze
end

Instance Attribute Details

#canonical_statesInteger? (readonly)

Signature:

  • Integer?

Returns:

  • (Integer, nil)


9
10
11
# File 'lib/ibex/lalr/build_metrics.rb', line 9

def canonical_states
  @canonical_states
end

#construction_statesInteger (readonly)

Signature:

  • Integer

Returns:

  • (Integer)


8
9
10
# File 'lib/ibex/lalr/build_metrics.rb', line 8

def construction_states
  @construction_states
end

#final_statesInteger (readonly)

Signature:

  • Integer

Returns:

  • (Integer)


10
11
12
# File 'lib/ibex/lalr/build_metrics.rb', line 10

def final_states
  @final_states
end

#strategySymbol (readonly)

Signature:

  • Symbol

Returns:

  • (Symbol)


11
12
13
# File 'lib/ibex/lalr/build_metrics.rb', line 11

def strategy
  @strategy
end