happy-lib-2.0.2: Happy is a parser generator for Haskell implemented using this library
Safe HaskellSafe-Inferred
LanguageHaskell98

Happy.Tabular.LALR

Documentation

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

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

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

propLookaheads Source #

Arguments

:: Grammar 
-> [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

show :: Lr0Item -> String

showList :: [Lr0Item] -> ShowS

Eq Lr0Item Source # 
Instance details

Defined in Happy.Tabular.LALR

Methods

(==) :: Lr0Item -> Lr0Item -> Bool

(/=) :: Lr0Item -> Lr0Item -> Bool

Ord Lr0Item Source # 
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 Source #

Constructors

Lr1 !Int !Int NameSet 

Instances

Instances details
Show Lr1Item Source # 
Instance details

Defined in Happy.Tabular.LALR

Methods

showsPrec :: Int -> Lr1Item -> ShowS

show :: Lr1Item -> String

showList :: [Lr1Item] -> ShowS

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

show :: LRAction -> String

showList :: [LRAction] -> ShowS

Eq LRAction Source # 
Instance details

Defined in Happy.Tabular.LALR

Methods

(==) :: LRAction -> LRAction -> Bool

(/=) :: LRAction -> LRAction -> Bool

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

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

type GotoTable = Array Int (Array Int 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

show :: Goto -> String

showList :: [Goto] -> ShowS

Eq Goto Source # 
Instance details

Defined in Happy.Tabular.LALR

Methods

(==) :: Goto -> Goto -> Bool

(/=) :: Goto -> Goto -> Bool