From 6993118eab6699182738ffcbddf03731ec41e1db Mon Sep 17 00:00:00 2001 From: peb Date: Wed, 28 Apr 2004 09:37:10 +0000 Subject: [PATCH] peb (28/4-04): - added directory 'conversions' for grammar conversions - added some grammar printers in 'Custom.hs' - added option 'ghci' in 'Makefile' --- src/GF/UseGrammar/Custom.hs | 11 +++++++++++ src/Makefile | 21 +++++++++++++++------ src/Today.hs | 2 +- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/src/GF/UseGrammar/Custom.hs b/src/GF/UseGrammar/Custom.hs index 8cde78c59..03e66837d 100644 --- a/src/GF/UseGrammar/Custom.hs +++ b/src/GF/UseGrammar/Custom.hs @@ -37,6 +37,10 @@ import Morphology -- the cf parsing algorithms import ChartParser -- or some other CF Parser +-- grammar conversions -- peb 19/4-04 +-- see also customGrammarPrinter +import ConvertGrammar + import MoreCustom -- either small/ or big/. The one in Small is empty. import UseIO @@ -162,6 +166,13 @@ customGrammarPrinter = ,(strCI "canonOpt",showCanonOpt "Lang" . stateGrammarST) -} -- add your own grammar printers here +-- grammar conversions, (peb) + ,(strCI "gfc_show", show . grammar2canon . stateGrammarST) + ,(strCI "gfc_raw", prRaw . stateGrammarST) + ,(strCI "mcfg", prMCFG . convertCanonToMCFG . stateGrammarST) + ,(strCI "mcfg_cf", prCF . convertCanonToCF . stateGrammarST) + ,(strCI "mcfg_canon", prCanon . convertCanonToMCFG . stateGrammarST) + ,(strCI "mcfg_raw", prRaw . convertCanonToMCFG . stateGrammarST) --- also include printing via grammar2syntax! ] ++ moreCustomGrammarPrinter diff --git a/src/Makefile b/src/Makefile index ea5dabebd..899152df7 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,11 +1,16 @@ -GHMAKE=ghc + +GHMAKE=ghc +GHCI=ghci GHCFLAGS=-package lang -package util -fglasgow-exts GHCOPTFLAGS=-O -package lang -package util -fglasgow-exts GHCFUDFLAG=-package Fudgets -GHCINCLUDE=-iapi -icompile -igrammar -iinfra -ishell -isource -icanonical -iuseGrammar -icf -ifor-ghc -iparsing -iparsers -GHCINCLUDENOFUD=-iapi -icompile -igrammar -iinfra -ishell -isource -icanonical -iuseGrammar -icf -ifor-ghc-nofud -iparsing -iparsers -GHCINCLUDEGFT=-iapi -icompile -igrammar -iinfra -ishell -isource -icanonical -iuseGrammar -icf -ifor-gft -iparsing -iparsers -WINDOWSINCLUDE=-ifor-windows -iapi -icompile -igrammar -iinfra -ishell -isource -icanonical -iuseGrammar -icf -iparsing -iparsers + +HUGSINCLUDE =.:for-hugs:api:source:canonical:cf:grammar:infra:shell:useGrammar:compile:parsing:conversions: +BASICINCLUDE =-iapi -icompile -igrammar -iinfra -ishell -isource -icanonical -iuseGrammar -icf -iparsing -iparsers -iconversions +GHCINCLUDE =-ifor-ghc $(BASICINCLUDE) +GHCINCLUDENOFUD=-ifor-ghc-nofud $(BASICINCLUDE) +GHCINCLUDEGFT =-ifor-gft $(BASICINCLUDE) +WINDOWSINCLUDE =-ifor-windows $(BASICINCLUDE) all: make today ; make ghc @@ -20,6 +25,8 @@ opt: ghc: make nofud +ghci: + make nofud-links ; make ghci-nofud fud: $(GHMAKE) $(GHCFLAGS) $(GHCINCLUDE) $(GHCFUDFLAG) --make GF.hs -o gf2+ ; strip gf2+ ; mv gf2+ ../bin/ gft: @@ -39,7 +46,9 @@ shell: clean: rm -rf */*.o */*.hi *.o *.hi */*.ghi *.ghi *~ */*~ hugs: - hugs -P.:for-hugs:api:source:canonical:cf:grammar:infra:shell:useGrammar:compile:parsing: GF + hugs -E"open -a emacs" -P$(HUGSINCLUDE) +ghci-nofud: + $(GHCI) $(GHCFLAGS) $(GHCINCLUDENOFUD) today: runhugs util/MkToday javac: diff --git a/src/Today.hs b/src/Today.hs index c74a9df8b..49afb85f8 100644 --- a/src/Today.hs +++ b/src/Today.hs @@ -1 +1 @@ -module Today where today = "Tue Apr 27 22:17:25 CEST 2004" +module Today where today = "Ons Apr 28 09:03:36 CEST 2004"