diff options
| author | krasimir <krasimir@chalmers.se> | 2010-01-05 07:05:41 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2010-01-05 07:05:41 +0000 |
| commit | 3ed19a482e796b0a62d234ec9ffd1981d5fee64e (patch) | |
| tree | 93e3cf1a0643480f704bd5243585a090678b04b2 /src/runtime | |
| parent | 354269e17c63d6e750fb5626adac43b92479506a (diff) | |
printnames are now kept as String instead of Term in PGF
Diffstat (limited to 'src/runtime')
| -rw-r--r-- | src/runtime/haskell/PGF.hs | 5 | ||||
| -rw-r--r-- | src/runtime/haskell/PGF/Data.hs | 2 | ||||
| -rw-r--r-- | src/runtime/haskell/PGF/Linearize.hs | 6 | ||||
| -rw-r--r-- | src/runtime/haskell/PGF/Macros.hs | 4 |
4 files changed, 6 insertions, 11 deletions
diff --git a/src/runtime/haskell/PGF.hs b/src/runtime/haskell/PGF.hs index 2b521e8f7..14e157bb6 100644 --- a/src/runtime/haskell/PGF.hs +++ b/src/runtime/haskell/PGF.hs @@ -155,9 +155,6 @@ linearizeAll :: PGF -> Tree -> [String] -- available in the grammar. linearizeAllLang :: PGF -> Tree -> [(Language,String)] --- | Show the printname of a type -showPrintName :: PGF -> Language -> Type -> String - -- | The same as 'parseAllLang' but does not return -- the language. parseAll :: PGF -> Type -> String -> [[Tree]] @@ -260,8 +257,6 @@ linearizeAll mgr = map snd . linearizeAllLang mgr linearizeAllLang mgr t = [(lang,PGF.linearize mgr lang t) | lang <- languages mgr] -showPrintName pgf lang (DTyp _ c _) = realize $ lookPrintName pgf lang c - parseAll mgr typ = map snd . parseAllLang mgr typ parseAllLang mgr typ s = diff --git a/src/runtime/haskell/PGF/Data.hs b/src/runtime/haskell/PGF/Data.hs index 38027e96e..dcdf38dcb 100644 --- a/src/runtime/haskell/PGF/Data.hs +++ b/src/runtime/haskell/PGF/Data.hs @@ -35,7 +35,7 @@ data Concr = Concr { opers :: Map.Map CId Term, -- oper generated by subex elim lincats :: Map.Map CId Term, -- lin type of a cat lindefs :: Map.Map CId Term, -- lin default of a cat - printnames :: Map.Map CId Term, -- printname of a cat or a fun + printnames :: Map.Map CId String, -- printname of a cat or a fun paramlincats :: Map.Map CId Term, -- lin type of cat, with printable param names parser :: Maybe ParserInfo -- parser } diff --git a/src/runtime/haskell/PGF/Linearize.hs b/src/runtime/haskell/PGF/Linearize.hs index 80d1f1acf..de3daf11d 100644 --- a/src/runtime/haskell/PGF/Linearize.hs +++ b/src/runtime/haskell/PGF/Linearize.hs @@ -1,6 +1,6 @@ {-# LANGUAGE ParallelListComp #-} module PGF.Linearize - (linearizes,realize,realizes,linTree, linTreeMark,linearizesMark) where + (linearizes,showPrintName,realize,realizes,linTree, linTreeMark,linearizesMark) where import PGF.CId import PGF.Data @@ -164,3 +164,7 @@ linTreeMark pgf lang = lin [] . expr2tree bracket p ts = [kks ("("++show p)] ++ ts ++ [kks ")"] sub p i = p ++ [i] + +-- | Show the printname of function or category +showPrintName :: PGF -> Language -> CId -> String +showPrintName pgf lang id = lookMap "?" id $ printnames $ lookMap (error "no lang") lang $ concretes pgf diff --git a/src/runtime/haskell/PGF/Macros.hs b/src/runtime/haskell/PGF/Macros.hs index af25de025..2f6282aa3 100644 --- a/src/runtime/haskell/PGF/Macros.hs +++ b/src/runtime/haskell/PGF/Macros.hs @@ -29,10 +29,6 @@ lookParamLincat :: PGF -> CId -> CId -> Term lookParamLincat pgf lang fun = lookMap tm0 fun $ paramlincats $ lookMap (error "no lang") lang $ concretes pgf -lookPrintName :: PGF -> CId -> CId -> Term -lookPrintName pgf lang fun = - lookMap tm0 fun $ printnames $ lookMap (error "no lang") lang $ concretes pgf - lookType :: PGF -> CId -> Type lookType pgf f = case lookMap (error $ "lookType " ++ show f) f (funs (abstract pgf)) of |
