summaryrefslogtreecommitdiff
path: root/tool/lrama/lib/lrama/counterexamples/triple.rb
diff options
context:
space:
mode:
Diffstat (limited to 'tool/lrama/lib/lrama/counterexamples/triple.rb')
-rw-r--r--tool/lrama/lib/lrama/counterexamples/triple.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/tool/lrama/lib/lrama/counterexamples/triple.rb b/tool/lrama/lib/lrama/counterexamples/triple.rb
new file mode 100644
index 0000000000..e802beccf4
--- /dev/null
+++ b/tool/lrama/lib/lrama/counterexamples/triple.rb
@@ -0,0 +1,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