Skip to content

Commit

Permalink
nitcc: Gram do the state analysis in a 2nd step
Browse files Browse the repository at this point in the history
Signed-off-by: Jean Privat <[email protected]>
  • Loading branch information
privat committed Jul 18, 2024
1 parent da4205e commit a0f93d9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions contrib/nitcc/src/grammar.nit
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,10 @@ class Gram

#print state
automaton.states.add(state)
state.analysis
# Extends the core
for i in state.items.to_a do
state.extends(i)
end

var nexts = new HashMap[Element, LRState]
for i in state.items do
Expand Down Expand Up @@ -198,6 +201,9 @@ class Gram
next.ins.add t
end
end
for state in automaton.states do
state.analysis
end
return automaton
end

Expand Down Expand Up @@ -1020,10 +1026,6 @@ class LRState
# Compute guards and conflicts
fun analysis
do
# Extends the core
for i in items.to_a do
extends(i)
end

# Collect action and conflicts
for i in items do
Expand Down

0 comments on commit a0f93d9

Please sign in to comment.