happy-lib-2.1.7: 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 Source #

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

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

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

propLookaheads Source #

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)] Source #

mergeLookaheadInfo Source #

Arguments

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

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

data Lr0Item Source #

Constructors

Lr0 !Int !Int |

#### Instances

Instances details

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

data Lr1Item Source #

Constructors

Lr1 !Int !Int NameSet |

#### Instances

Instances details

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

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

data LRAction Source #

Constructors

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

#### Instances

Instances details

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

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

type ActionTable = Array Int (Array Name LRAction) Source #

type GotoTable = Array Int (Array Name Goto) Source #

data Goto Source #

Constructors

Goto Int |
NoGoto |

#### Instances

Instances details

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