From 6aacec3591e0e6e1d3ddca4605f6467e302cb65f Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Mon, 24 Sep 2007 08:12:11 +0000 Subject: remove FTypes module and move all definitions to Formalism.FCFG --- src/GF/Parsing/FCFG/PInfo.hs | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/GF/Parsing/FCFG/PInfo.hs') diff --git a/src/GF/Parsing/FCFG/PInfo.hs b/src/GF/Parsing/FCFG/PInfo.hs index e463cf65a..8a45b651a 100644 --- a/src/GF/Parsing/FCFG/PInfo.hs +++ b/src/GF/Parsing/FCFG/PInfo.hs @@ -23,10 +23,10 @@ import Data.Maybe -- type declarations -- | the list of categories = possible starting categories -type FCFParser c n t = FCFPInfo c n t - -> [c] - -> Input t - -> SyntaxChart n (c,RangeRec) +type FCFParser = FCFPInfo + -> [FCat] + -> Input FToken + -> SyntaxChart FName (FCat,RangeRec) makeFinalEdge cat 0 0 = (cat, [EmptyRange]) makeFinalEdge cat i j = (cat, [makeRange i j]) @@ -36,19 +36,19 @@ makeFinalEdge cat i j = (cat, [makeRange i j]) type RuleId = Int -data FCFPInfo c n t - = FCFPInfo { allRules :: Array RuleId (FCFRule c n t) - , topdownRules :: Assoc c (SList RuleId) +data FCFPInfo + = FCFPInfo { allRules :: Array RuleId FRule + , topdownRules :: Assoc FCat (SList RuleId) -- ^ used in 'GF.Parsing.MCFG.Active' (Earley): - -- , emptyRules :: [RuleId] + -- , emptyRules :: [RuleId] , epsilonRules :: [RuleId] -- ^ used in 'GF.Parsing.MCFG.Active' (Kilbury): - , leftcornerCats :: Assoc c (SList RuleId) - , leftcornerTokens :: Assoc t (SList RuleId) + , leftcornerCats :: Assoc FCat (SList RuleId) + , leftcornerTokens :: Assoc FToken (SList RuleId) -- ^ used in 'GF.Parsing.MCFG.Active' (Kilbury): - , grammarCats :: SList c - , grammarToks :: SList t - , grammarLexer :: t -> (c,SyntaxNode RuleId RangeRec) + , grammarCats :: SList FCat + , grammarToks :: SList FToken + , grammarLexer :: FToken -> (FCat,SyntaxNode RuleId RangeRec) } @@ -68,7 +68,7 @@ getLeftCornerCat lins where syms = lins ! 0 -buildFCFPInfo :: (Ord c, Ord n, Ord t) => (t -> (c,SyntaxNode RuleId RangeRec)) -> FCFGrammar c n t -> FCFPInfo c n t +buildFCFPInfo :: (FToken -> (FCat,SyntaxNode RuleId RangeRec)) -> FGrammar -> FCFPInfo buildFCFPInfo lexer grammar = FCFPInfo { allRules = allrules , topdownRules = topdownrules @@ -98,7 +98,7 @@ buildFCFPInfo lexer grammar = ---------------------------------------------------------------------- -- pretty-printing of statistics -instance (Ord c, Ord n, Ord t) => Print (FCFPInfo c n t) where +instance Print FCFPInfo where prt pI = "[ allRules=" ++ sl (elems . allRules) ++ "; tdRules=" ++ sla topdownRules ++ -- "; emptyRules=" ++ sl emptyRules ++ -- cgit v1.2.3