From 694f6eb984c8f22fe042e210b0671062accba8c7 Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Thu, 8 Jun 2006 21:23:29 +0000 Subject: code polishing for the literal category support --- src/GF/Parsing/FCFG/PInfo.hs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 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 43e729e31..9cc0975b2 100644 --- a/src/GF/Parsing/FCFG/PInfo.hs +++ b/src/GF/Parsing/FCFG/PInfo.hs @@ -29,7 +29,10 @@ import Data.Maybe type FCFParser c n t = FCFPInfo c n t -> [c] -> Input t - -> [SyntaxForest n] + -> SyntaxChart n (c,RangeRec) + +makeFinalEdge cat 0 0 = (cat, [EmptyRange]) +makeFinalEdge cat i j = (cat, [makeRange i j]) ------------------------------------------------------------ -- parser information @@ -48,7 +51,7 @@ data FCFPInfo c n t -- ^ used in 'GF.Parsing.MCFG.Active' (Kilbury): , grammarCats :: SList c , grammarToks :: SList t - , grammarLexer :: t -> (c,SyntaxTree RuleId) + , grammarLexer :: t -> (c,SyntaxNode RuleId RangeRec) } @@ -68,7 +71,7 @@ getLeftCornerCat lins where syms = lins ! 0 -buildFCFPInfo :: (Ord c, Ord n, Ord t) => (t -> (c,SyntaxTree RuleId)) -> FCFGrammar c n t -> FCFPInfo c n t +buildFCFPInfo :: (Ord c, Ord n, Ord t) => (t -> (c,SyntaxNode RuleId RangeRec)) -> FCFGrammar c n t -> FCFPInfo c n t buildFCFPInfo lexer grammar = traceCalcFirst grammar $ tracePrt "MCFG.PInfo - parser info" (prt) $ -- cgit v1.2.3