1
0
forked from GitHub/gf-core

a dialogue-like editor loop

This commit is contained in:
aarne
2008-12-11 15:36:40 +00:00
parent 7c1fc268e9
commit bd21e6e1a0
2 changed files with 45 additions and 11 deletions

View File

@@ -42,7 +42,8 @@ module PGF(
-- * Operations
-- ** Linearization
linearize, linearizeAllLang, linearizeAll,
showPrintName,
-- ** Parsing
parse, canParse, parseAllLang, parseAll,
@@ -126,6 +127,9 @@ 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]]
@@ -237,6 +241,8 @@ 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 =