From be81ac50a9ecf2b6457d4594a4b67972a1b0dd75 Mon Sep 17 00:00:00 2001 From: aarne Date: Thu, 2 Oct 2003 06:37:34 +0000 Subject: Added dir for parsing. --- src/GF/Compile/ShellState.hs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/GF/Compile/ShellState.hs') diff --git a/src/GF/Compile/ShellState.hs b/src/GF/Compile/ShellState.hs index 661e1bedd..85bc24ae0 100644 --- a/src/GF/Compile/ShellState.hs +++ b/src/GF/Compile/ShellState.hs @@ -187,13 +187,23 @@ optionsOfLang st = stateOptions . stateGrammarOfLang st -- the last introduced grammar, stored in options, is the default for operations firstStateGrammar :: ShellState -> StateGrammar -firstStateGrammar st = errVal emptyStateGrammar $ do +firstStateGrammar st = errVal (stateAbstractGrammar st) $ do concr <- maybeErr "no concrete syntax" $ concrete st return $ stateGrammarOfLang st concr mkStateGrammar :: ShellState -> Language -> StateGrammar mkStateGrammar = stateGrammarOfLang +stateAbstractGrammar :: ShellState -> StateGrammar +stateAbstractGrammar st = StGr { + absId = maybe (identC "Abs") id (abstract st), --- + cncId = identC "#Cnc", --- + grammar = canModules st, ---- only abstarct ones + cf = emptyCF, + morpho = emptyMorpho + } + + -- analysing shell state into parts globalOptions = gloptions allLanguages = map fst . concretes -- cgit v1.2.3