From 7db4b641ce6abe90dd404459cd5eccb6e67f618c Mon Sep 17 00:00:00 2001 From: krasimir Date: Wed, 20 May 2009 21:03:56 +0000 Subject: refactor the PGF.Expr type and the evaluation of abstract expressions --- src/PGF.hs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/PGF.hs') diff --git a/src/PGF.hs b/src/PGF.hs index bd5627668..7eb79cd8a 100644 --- a/src/PGF.hs +++ b/src/PGF.hs @@ -48,7 +48,7 @@ module PGF( parse, canParse, parseAllLang, parseAll, -- ** Evaluation - tree2expr, expr2tree, compute, paraphrase, typecheck, + tree2expr, PGF.expr2tree, paraphrase, typecheck, -- ** Word Completion (Incremental Parsing) complete, @@ -62,7 +62,6 @@ module PGF( import PGF.CId import PGF.Linearize import PGF.Generate -import PGF.AbsCompute import PGF.TypeCheck import PGF.Paraphrase import PGF.Macros @@ -287,3 +286,10 @@ complete pgf from typ input = | null ws = ([],"") | otherwise = (init ws, last ws) where ws = words s + +-- | Converts an expression to tree. The expression +-- is first reduced to beta-eta-alfa normal form and +-- after that converted to tree. The function definitions +-- are used in the computation. +expr2tree :: PGF -> Expr -> Tree +expr2tree pgf = PGF.Data.expr2tree (funs (abstract pgf)) -- cgit v1.2.3