Skip to content

Commit

Permalink
Lrama v0.5.10
Browse files Browse the repository at this point in the history
  • Loading branch information
yui-knk committed Nov 18, 2023
1 parent f479e62 commit c56dd94
Show file tree
Hide file tree
Showing 37 changed files with 1,317 additions and 890 deletions.
4 changes: 1 addition & 3 deletions tool/lrama/lib/lrama/context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,8 @@ def compute_yydefgoto
# Index is sequence number of nterm, value is state id
# of a default nterm transition destination.
@yydefgoto = Array.new(@states.nterms.count, 0)
h = {}
# Mapping from nterm to next_states
nterm_to_next_states = {}
terms_count = @states.terms.count

@states.states.each do |state|
state.nterm_transitions.each do |shift, next_state|
Expand Down Expand Up @@ -369,7 +367,7 @@ def sort_actions
end

j = @sorted_actions.count - 1
state_id, froms_and_tos, count, width = action
_state_id, _froms_and_tos, count, width = action

while (j >= 0) do
case
Expand Down
3 changes: 3 additions & 0 deletions tool/lrama/lib/lrama/counterexamples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
require "lrama/counterexamples/derivation"
require "lrama/counterexamples/example"
require "lrama/counterexamples/path"
require "lrama/counterexamples/production_path"
require "lrama/counterexamples/start_path"
require "lrama/counterexamples/state_item"
require "lrama/counterexamples/transition_path"
require "lrama/counterexamples/triple"

module Lrama
Expand Down
46 changes: 0 additions & 46 deletions tool/lrama/lib/lrama/counterexamples/path.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,51 +19,5 @@ def to_s
end
alias :inspect :to_s
end

class StartPath < Path
def initialize(to_state_item)
super nil, to_state_item
end

def type
:start
end

def transition?
false
end

def production?
false
end
end

class TransitionPath < Path
def type
:transition
end

def transition?
true
end

def production?
false
end
end

class ProductionPath < Path
def type
:production
end

def transition?
false
end

def production?
true
end
end
end
end
17 changes: 17 additions & 0 deletions tool/lrama/lib/lrama/counterexamples/production_path.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module Lrama
class Counterexamples
class ProductionPath < Path
def type
:production
end

def transition?
false
end

def production?
true
end
end
end
end
21 changes: 21 additions & 0 deletions tool/lrama/lib/lrama/counterexamples/start_path.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module Lrama
class Counterexamples
class StartPath < Path
def initialize(to_state_item)
super nil, to_state_item
end

def type
:start
end

def transition?
false
end

def production?
false
end
end
end
end
17 changes: 17 additions & 0 deletions tool/lrama/lib/lrama/counterexamples/transition_path.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module Lrama
class Counterexamples
class TransitionPath < Path
def type
:transition
end

def transition?
true
end

def production?
false
end
end
end
end
Loading

0 comments on commit c56dd94

Please sign in to comment.