1
0
forked from GitHub/gf-core

Morphological analysis and glueing.

This commit is contained in:
aarne
2003-11-10 07:55:45 +00:00
parent 4c99687f21
commit 249d506f58
13 changed files with 84 additions and 34 deletions

View File

@@ -62,15 +62,20 @@ prContext co = unwords $ map prParenth [prt x +++ ":" +++ prt t | (x,t) <- co]
instance Print A.Exp where prt = C.printTree
instance Print A.Term where prt = C.printTree
instance Print A.Patt where prt = C.printTree
instance Print A.Case where prt = C.printTree
instance Print A.Atom where prt = C.printTree
instance Print A.CIdent where prt = C.printTree
instance Print A.CType where prt = C.printTree
instance Print A.Label where prt = C.printTree
instance Print A.Module where prt = C.printTree
instance Print A.Sort where prt = C.printTree
instance Print A.Patt where
prt = C.printTree
prt_ = prPatt
instance Print A.CIdent where
prt = C.printTree
prt_ (A.CIQ _ c) = prt c
-- printing values and trees in editing
@@ -183,6 +188,15 @@ prExp e = case e of
App _ _ -> prParenth $ prExp e
_ -> pr1 e
prPatt :: A.Patt -> String
prPatt p = case p of
A.PC c ps -> prt_ c +++ unwords (map pr1 ps)
_ -> prt p --- PR
where
pr1 p = case p of
A.PC _ (_:_) -> prParenth $ prPatt p
_ -> prPatt p
-- option -strip strips qualifications
prTermOpt opts = if oElem nostripQualif opts then prt else prExp