Class: Ibex::LALR::BuildMetrics

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

Overview

Optional measurements are kept explicit for schema stability. rubocop:disable Metrics/ParameterLists 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:, lr0_states: nil, lr0_items: nil, canonical_items: nil, final_items: nil, final_lookahead_items: nil, propagation_edges: nil, ielr_initial_partitions: nil, ielr_final_partitions: nil, ielr_annotations: nil, ielr_annotated_states: nil, ielr_inadequacies: nil, ielr_split_stable_discarded: nil, ielr_lalr_states: nil, ielr_split_states: nil, ielr_unreachable_removed: nil, ielr_remergeable_candidates: nil) ⇒ BuildMetrics

Returns a new instance of BuildMetrics.

RBS:

  • (construction_states: Integer, canonical_states: Integer?, final_states: Integer, strategy: Symbol, ?lr0_states: Integer?, ?lr0_items: Integer?, ?canonical_items: Integer?, ?final_items: Integer?, ?final_lookahead_items: Integer?, ?propagation_edges: Integer?, ?ielr_initial_partitions: Integer?, ?ielr_final_partitions: Integer?, ?ielr_annotations: Integer?, ?ielr_annotated_states: Integer?, ?ielr_inadequacies: Integer?, ?ielr_split_stable_discarded: Integer?, ?ielr_lalr_states: Integer?, ?ielr_split_states: Integer?, ?ielr_unreachable_removed: Integer?, ?ielr_remergeable_candidates: Integer?) -> void

Parameters:

  • construction_states: (Integer)
  • canonical_states: (Integer, nil)
  • final_states: (Integer)
  • strategy: (Symbol)
  • lr0_states: (Integer, nil) (defaults to: nil)
  • lr0_items: (Integer, nil) (defaults to: nil)
  • canonical_items: (Integer, nil) (defaults to: nil)
  • final_items: (Integer, nil) (defaults to: nil)
  • final_lookahead_items: (Integer, nil) (defaults to: nil)
  • propagation_edges: (Integer, nil) (defaults to: nil)
  • ielr_initial_partitions: (Integer, nil) (defaults to: nil)
  • ielr_final_partitions: (Integer, nil) (defaults to: nil)
  • ielr_annotations: (Integer, nil) (defaults to: nil)
  • ielr_annotated_states: (Integer, nil) (defaults to: nil)
  • ielr_inadequacies: (Integer, nil) (defaults to: nil)
  • ielr_split_stable_discarded: (Integer, nil) (defaults to: nil)
  • ielr_lalr_states: (Integer, nil) (defaults to: nil)
  • ielr_split_states: (Integer, nil) (defaults to: nil)
  • ielr_unreachable_removed: (Integer, nil) (defaults to: nil)
  • ielr_remergeable_candidates: (Integer, nil) (defaults to: nil)


39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/ibex/lalr/build_metrics.rb', line 39

def initialize(construction_states:, canonical_states:, final_states:, strategy:, lr0_states: nil, lr0_items: nil,
               canonical_items: nil, final_items: nil, final_lookahead_items: nil, propagation_edges: nil,
               ielr_initial_partitions: nil, ielr_final_partitions: nil, ielr_annotations: nil,
               ielr_annotated_states: nil, ielr_inadequacies: nil, ielr_split_stable_discarded: nil,
               ielr_lalr_states: nil, ielr_split_states: nil, ielr_unreachable_removed: nil,
               ielr_remergeable_candidates: nil)
  @construction_states = construction_states
  @canonical_states = canonical_states
  @final_states = final_states
  @strategy = strategy
  @lr0_states = lr0_states
  @lr0_items = lr0_items
  @canonical_items = canonical_items
  @final_items = final_items
  @final_lookahead_items = final_lookahead_items
  @propagation_edges = propagation_edges
  @ielr_initial_partitions = ielr_initial_partitions
  @ielr_final_partitions = ielr_final_partitions
  @ielr_annotations = ielr_annotations
  @ielr_annotated_states = ielr_annotated_states
  @ielr_inadequacies = ielr_inadequacies
  @ielr_split_stable_discarded = ielr_split_stable_discarded
  @ielr_lalr_states = ielr_lalr_states
  @ielr_split_states = ielr_split_states
  @ielr_unreachable_removed = ielr_unreachable_removed
  @ielr_remergeable_candidates = ielr_remergeable_candidates
  freeze
end

Instance Attribute Details

#canonical_itemsInteger? (readonly)

Signature:

  • Integer?

Returns:

  • (Integer, nil)


17
18
19
# File 'lib/ibex/lalr/build_metrics.rb', line 17

def canonical_items
  @canonical_items
end

#canonical_statesInteger? (readonly)

Signature:

  • Integer?

Returns:

  • (Integer, nil)


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

def canonical_states
  @canonical_states
end

#construction_statesInteger (readonly)

Signature:

  • Integer

Returns:

  • (Integer)


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

def construction_states
  @construction_states
end

#final_itemsInteger? (readonly)

Signature:

  • Integer?

Returns:

  • (Integer, nil)


18
19
20
# File 'lib/ibex/lalr/build_metrics.rb', line 18

def final_items
  @final_items
end

#final_lookahead_itemsInteger? (readonly)

Signature:

  • Integer?

Returns:

  • (Integer, nil)


19
20
21
# File 'lib/ibex/lalr/build_metrics.rb', line 19

def final_lookahead_items
  @final_lookahead_items
end

#final_statesInteger (readonly)

Signature:

  • Integer

Returns:

  • (Integer)


13
14
15
# File 'lib/ibex/lalr/build_metrics.rb', line 13

def final_states
  @final_states
end

#ielr_annotated_statesInteger? (readonly)

Signature:

  • Integer?

Returns:

  • (Integer, nil)


24
25
26
# File 'lib/ibex/lalr/build_metrics.rb', line 24

def ielr_annotated_states
  @ielr_annotated_states
end

#ielr_annotationsInteger? (readonly)

Signature:

  • Integer?

Returns:

  • (Integer, nil)


23
24
25
# File 'lib/ibex/lalr/build_metrics.rb', line 23

def ielr_annotations
  @ielr_annotations
end

#ielr_final_partitionsInteger? (readonly)

Signature:

  • Integer?

Returns:

  • (Integer, nil)


22
23
24
# File 'lib/ibex/lalr/build_metrics.rb', line 22

def ielr_final_partitions
  @ielr_final_partitions
end

#ielr_inadequaciesInteger? (readonly)

Signature:

  • Integer?

Returns:

  • (Integer, nil)


25
26
27
# File 'lib/ibex/lalr/build_metrics.rb', line 25

def ielr_inadequacies
  @ielr_inadequacies
end

#ielr_initial_partitionsInteger? (readonly)

Signature:

  • Integer?

Returns:

  • (Integer, nil)


21
22
23
# File 'lib/ibex/lalr/build_metrics.rb', line 21

def ielr_initial_partitions
  @ielr_initial_partitions
end

#ielr_lalr_statesInteger? (readonly)

Signature:

  • Integer?

Returns:

  • (Integer, nil)


27
28
29
# File 'lib/ibex/lalr/build_metrics.rb', line 27

def ielr_lalr_states
  @ielr_lalr_states
end

#ielr_remergeable_candidatesInteger? (readonly)

Signature:

  • Integer?

Returns:

  • (Integer, nil)


30
31
32
# File 'lib/ibex/lalr/build_metrics.rb', line 30

def ielr_remergeable_candidates
  @ielr_remergeable_candidates
end

#ielr_split_stable_discardedInteger? (readonly)

Signature:

  • Integer?

Returns:

  • (Integer, nil)


26
27
28
# File 'lib/ibex/lalr/build_metrics.rb', line 26

def ielr_split_stable_discarded
  @ielr_split_stable_discarded
end

#ielr_split_statesInteger? (readonly)

Signature:

  • Integer?

Returns:

  • (Integer, nil)


28
29
30
# File 'lib/ibex/lalr/build_metrics.rb', line 28

def ielr_split_states
  @ielr_split_states
end

#ielr_unreachable_removedInteger? (readonly)

Signature:

  • Integer?

Returns:

  • (Integer, nil)


29
30
31
# File 'lib/ibex/lalr/build_metrics.rb', line 29

def ielr_unreachable_removed
  @ielr_unreachable_removed
end

#lr0_itemsInteger? (readonly)

Signature:

  • Integer?

Returns:

  • (Integer, nil)


16
17
18
# File 'lib/ibex/lalr/build_metrics.rb', line 16

def lr0_items
  @lr0_items
end

#lr0_statesInteger? (readonly)

Signature:

  • Integer?

Returns:

  • (Integer, nil)


15
16
17
# File 'lib/ibex/lalr/build_metrics.rb', line 15

def lr0_states
  @lr0_states
end

#propagation_edgesInteger? (readonly)

Signature:

  • Integer?

Returns:

  • (Integer, nil)


20
21
22
# File 'lib/ibex/lalr/build_metrics.rb', line 20

def propagation_edges
  @propagation_edges
end

#strategySymbol (readonly)

Signature:

  • Symbol

Returns:

  • (Symbol)


14
15
16
# File 'lib/ibex/lalr/build_metrics.rb', line 14

def strategy
  @strategy
end