summaryrefslogtreecommitdiff
path: root/tool/lrama/lib/lrama/counterexamples/triple.rb
blob: e802beccf4cffc8b914f3b600e96e7c8c0cf2061 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
module Lrama
  class Counterexamples
    # s: state
    # itm: item within s
    # l: precise lookahead set
    class Triple < Struct.new(:s, :itm, :l)
      alias :state :s
      alias :item :itm
      alias :precise_lookahead_set :l

      def state_item
        StateItem.new(state, item)
      end

      def inspect
        "#{state.inspect}. #{item.display_name}. #{l.map(&:id).map(&:s_value)}"
      end
      alias :to_s :inspect
    end
  end
end