Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kwanghoon committed Sep 30, 2021
1 parent 06d5386 commit 91673a9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/parserlib/CommonParserUtil.hs
Original file line number Diff line number Diff line change
Expand Up @@ -510,14 +510,18 @@ compGammasDfs ccOption level symbols state stk history =
return (if null symbols then [] else [symbols])
else
checkCycle flag False level state stk "" history
(\history ->
(\history ->
{- 1. Reduce -}
case nub [prnum | ((s,lookahead),Reduce prnum) <- actionTable, state==s] of
[] ->
{- 2. Goto table -}
case nub [(nonterminal,toState) | ((fromState,nonterminal),toState) <- gotoTable, state==fromState] of
[] ->
{- 3. Accept -}
if length [True | ((s,lookahead),Accept) <- actionTable, state==s] >= 1
then do
return []
{- 4. Shift -}
else let cand2 = nub [(terminal,snext) | ((s,terminal),Shift snext) <- actionTable, state==s] in
let len = length cand2 in
case cand2 of
Expand Down

0 comments on commit 91673a9

Please sign in to comment.