Happy.Tabular.LALR

happy-lib-2.2: Happy is a parser generator for Haskell implemented using this library

Safe Haskell | None
Language | Haskell98

Happy.Tabular.LALR

# Documentation

genActionTable :: Grammar e -> ([Name] -> NameSet) -> [Lr1State] -> ActionTable #

genGotoTable :: Grammar e -> [ItemSetWithGotos] -> GotoTable #

genLR0items :: Grammar e -> (Name -> RuleList) -> [ItemSetWithGotos] #

precalcClosure0 :: Grammar e -> Name -> RuleList #

propLookaheads #

Arguments

:: Grammar e |
-> [ItemSetWithGotos] | LR(0) kernel sets
-> ([Name] -> NameSet) | First function
-> ([(Int, Lr0Item, NameSet)], Array Int [(Lr0Item, Int, Lr0Item)]) |

calcLookaheads :: Int -> [(Int, Lr0Item, NameSet)] -> Array Int [(Lr0Item, Int, Lr0Item)] -> Array Int [(Lr0Item, NameSet)] #

mergeLookaheadInfo #

Arguments

:: Array Int [(Lr0Item, NameSet)] | lookahead info
-> [ItemSetWithGotos] | state table
-> [Lr1State] |

countConflicts :: ActionTable -> (Array Int (Int, Int), (Int, Int)) #

data Lr0Item #

Constructors

Lr0 !Int !Int |

#### Instances

Instances details

Show Lr0Item # |
Instance details Defined in Happy.Tabular.LALR Methods showsPrec :: Int -> Lr0Item -> ShowS # show :: Lr0Item -> String # showList :: [Lr0Item] -> ShowS #
Eq Lr0Item # |
Instance details Defined in Happy.Tabular.LALR Methods (==) :: Lr0Item -> Lr0Item -> Bool # (/=) :: Lr0Item -> Lr0Item -> Bool #
Ord Lr0Item # |
Instance details Defined in Happy.Tabular.LALR Methods compare :: Lr0Item -> Lr0Item -> Ordering # (<) :: Lr0Item -> Lr0Item -> Bool # (<=) :: Lr0Item -> Lr0Item -> Bool # (>) :: Lr0Item -> Lr0Item -> Bool # (>=) :: Lr0Item -> Lr0Item -> Bool # max :: Lr0Item -> Lr0Item -> Lr0Item # min :: Lr0Item -> Lr0Item -> Lr0Item #

data Lr1Item #

Constructors

Lr1 !Int !Int NameSet |

#### Instances

Instances details

Show Lr1Item # |
Instance details Defined in Happy.Tabular.LALR Methods showsPrec :: Int -> Lr1Item -> ShowS # show :: Lr1Item -> String # showList :: [Lr1Item] -> ShowS #

type ItemSetWithGotos = (Set Lr0Item, [(Name, Int)]) #

data LRAction #

Constructors

LR'Shift Int Priority |
LR'Reduce Int Priority |
LR'Accept |
LR'Fail |
LR'MustFail |
LR'Multiple [LRAction] LRAction |

#### Instances

Instances details

Show LRAction # |
Instance details Defined in Happy.Tabular.LALR Methods showsPrec :: Int -> LRAction -> ShowS # show :: LRAction -> String # showList :: [LRAction] -> ShowS #
Eq LRAction # |
Instance details Defined in Happy.Tabular.LALR Methods (==) :: LRAction -> LRAction -> Bool # (/=) :: LRAction -> LRAction -> Bool #

type Lr1State = ([Lr1Item], [(Name, Int)]) #

type ActionTable = Array Int (Array Name LRAction) #

type GotoTable = Array Int (Array Name Goto) #

data Goto #

Constructors

Goto Int |
NoGoto |

#### Instances

Instances details

Show Goto # |
Instance details Defined in Happy.Tabular.LALR Methods showsPrec :: Int -> Goto -> ShowS # show :: Goto -> String # showList :: [Goto] -> ShowS #
Eq Goto # |
Instance details Defined in Happy.Tabular.LALR Methods (==) :: Goto -> Goto -> Bool # (/=) :: Goto -> Goto -> Bool #