diff options
| author | krasimir <krasimir@chalmers.se> | 2009-05-20 21:03:56 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2009-05-20 21:03:56 +0000 |
| commit | 7db4b641ce6abe90dd404459cd5eccb6e67f618c (patch) | |
| tree | f708d2e7ed970d71655b66cac78c8b525b010cd9 /src/PGF.hs | |
| parent | 401dfc28d62584178c1187c92dece8dd0832dcb4 (diff) | |
refactor the PGF.Expr type and the evaluation of abstract expressions
Diffstat (limited to 'src/PGF.hs')
| -rw-r--r-- | src/PGF.hs | 10 |
1 files changed, 8 insertions, 2 deletions
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)) |
