summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Grammar/Grammar.hs
diff options
context:
space:
mode:
authoraarne <aarne@chalmers.se>2011-09-20 14:58:27 +0000
committeraarne <aarne@chalmers.se>2011-09-20 14:58:27 +0000
commita2ccf1ce6965e93eff9a3d7bef064cb3cab448f5 (patch)
treea1263d24bd22711dfdb58578d049bf5a6d72e8a3 /src/compiler/GF/Grammar/Grammar.hs
parent209ec0d7fea6371c3d6c0bf5a21d7501a961c0a6 (diff)
command ss to show source (including gfo) in text; to be extended
Diffstat (limited to 'src/compiler/GF/Grammar/Grammar.hs')
-rw-r--r--src/compiler/GF/Grammar/Grammar.hs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/compiler/GF/Grammar/Grammar.hs b/src/compiler/GF/Grammar/Grammar.hs
index 0234bdcb8..2c84351af 100644
--- a/src/compiler/GF/Grammar/Grammar.hs
+++ b/src/compiler/GF/Grammar/Grammar.hs
@@ -16,6 +16,7 @@
module GF.Grammar.Grammar (SourceGrammar,
emptySourceGrammar,mGrammar,
+ stripSourceGrammar,
SourceModInfo,
SourceModule,
mapSourceModule,
@@ -239,3 +240,20 @@ ident2label c = LIdent (ident2bs c)
label2ident :: Label -> Ident
label2ident (LIdent s) = identC s
label2ident (LVar i) = identC (BS.pack ('$':show i))
+
+
+stripSourceGrammar :: SourceGrammar -> SourceGrammar
+stripSourceGrammar sgr = sgr --mGrammar [(i, m{jments = Map.map }) | (i,m) <- modules sgr]
+
+stripInfo :: Info -> Info
+stripInfo i = case i of
+ AbsCat _ -> i
+ AbsFun mt mi me mb -> AbsFun mt mi Nothing mb
+ ResParam mp mt -> ResParam mp Nothing
+ ResValue lt -> i ----
+ ResOper mt md -> ResOper mt Nothing
+ ResOverload is fs -> ResOverload is [(lty, L loc (EInt 0)) | (lty,L loc _) <- fs]
+ CncCat mty mte mtf -> CncCat mty Nothing Nothing
+ CncFun mict mte mtf -> CncFun mict Nothing Nothing
+ AnyInd b f -> i
+