mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-22 17:42:51 -06:00
pre-release adjustments
This commit is contained in:
@@ -5,9 +5,9 @@
|
|||||||
-- Stability : (stability)
|
-- Stability : (stability)
|
||||||
-- Portability : (portability)
|
-- Portability : (portability)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/04/28 16:42:48 $
|
-- > CVS $Date: 2005/05/12 10:03:33 $
|
||||||
-- > CVS $Author: aarne $
|
-- > CVS $Author: aarne $
|
||||||
-- > CVS $Revision: 1.23 $
|
-- > CVS $Revision: 1.24 $
|
||||||
--
|
--
|
||||||
-- The Main module of GF program.
|
-- The Main module of GF program.
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
@@ -92,8 +92,8 @@ authorMsg = unlines [
|
|||||||
"Grammatical Framework, Version " ++ version,
|
"Grammatical Framework, Version " ++ version,
|
||||||
"Compiled " ++ today,
|
"Compiled " ++ today,
|
||||||
"Copyright (c)",
|
"Copyright (c)",
|
||||||
"Björn Bringert, Markus Forsberg, Thomas Hallgren, Harald Hammarström,",
|
"Björn Bringert, Håkan Burden, Markus Forsberg, Thomas Hallgren, Harald Hammarström,",
|
||||||
"Kristofer Johannisson, Janna Khegai, Peter Ljunglöf, Petri Mäenpää,",
|
"Kristofer Johannisson, Janna Khegai, Peter Ljunglöf, Petri Mäenpää,",
|
||||||
"and Aarne Ranta, 1998-2004, under GNU General Public License (GPL)",
|
"and Aarne Ranta, 1998-2005, under GNU General Public License (GPL)",
|
||||||
"Bug reports to aarne@cs.chalmers.se"
|
"Bug reports to aarne@cs.chalmers.se"
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/05/10 12:49:13 $
|
-- > CVS $Date: 2005/05/12 10:03:33 $
|
||||||
-- > CVS $Author: aarne $
|
-- > CVS $Author: aarne $
|
||||||
-- > CVS $Revision: 1.34 $
|
-- > CVS $Revision: 1.35 $
|
||||||
--
|
--
|
||||||
-- Application Programmer's Interface to GF; also used by Shell. AR 10/11/2001
|
-- Application Programmer's Interface to GF; also used by Shell. AR 10/11/2001
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
@@ -50,6 +50,7 @@ import qualified GF.Grammar.Grammar as G
|
|||||||
import GF.Infra.Modules
|
import GF.Infra.Modules
|
||||||
import GF.Grammar.PrGrammar
|
import GF.Grammar.PrGrammar
|
||||||
import qualified GF.Grammar.Compute as Co
|
import qualified GF.Grammar.Compute as Co
|
||||||
|
import qualified GF.Grammar.AbsCompute as AC
|
||||||
import qualified GF.Infra.Ident as I
|
import qualified GF.Infra.Ident as I
|
||||||
import qualified GF.Compile.GrammarToCanon as GC
|
import qualified GF.Compile.GrammarToCanon as GC
|
||||||
import qualified GF.Canon.CanonToGrammar as CG
|
import qualified GF.Canon.CanonToGrammar as CG
|
||||||
@@ -335,23 +336,24 @@ optTermCommand opts st =
|
|||||||
customOrDefault opts termCommand customTermCommand st
|
customOrDefault opts termCommand customTermCommand st
|
||||||
|
|
||||||
|
|
||||||
{-
|
|
||||||
-- wraps term in a function and optionally computes the result
|
-- wraps term in a function and optionally computes the result
|
||||||
|
|
||||||
wrapByFun :: Options -> GFGrammar -> Ident -> Tree -> Tree
|
wrapByFun :: Options -> GFGrammar -> Ident -> Tree -> Tree
|
||||||
wrapByFun opts gr f t =
|
wrapByFun opts gr f t =
|
||||||
if oElem doCompute opts
|
if oElem doCompute opts
|
||||||
then err (const t) id $ computeAbsTerm (stateAbstract g) (appCons f' [t])
|
then err (const t) id $ AC.computeAbsTerm (grammar gr) t' >>= annotate g
|
||||||
else appCons f' [t]
|
else err (const t) id $ annotate g t'
|
||||||
where
|
where
|
||||||
qualifTerm (absId gr) $
|
t' = qualifTerm (absId gr) $ M.appCons f [tree2exp t]
|
||||||
|
g = grammar gr
|
||||||
|
|
||||||
|
{-
|
||||||
optTransfer :: Options -> StateGrammar -> Term -> Term
|
optTransfer :: Options -> StateGrammar -> G.Term -> G.Term
|
||||||
optTransfer opts g = case getOptVal opts transferFun of
|
optTransfer opts g = case getOptVal opts transferFun of
|
||||||
Just f -> wrapByFun (addOption doCompute opts) g (string2id f)
|
Just f -> wrapByFun (addOption doCompute opts) g (M.zIdent f)
|
||||||
_ -> id
|
_ -> id
|
||||||
-}
|
-}
|
||||||
|
|
||||||
optTokenizer :: Options -> GFGrammar -> String -> String
|
optTokenizer :: Options -> GFGrammar -> String -> String
|
||||||
optTokenizer opts gr = show . customOrDefault opts useTokenizer customTokenizer gr
|
optTokenizer opts gr = show . customOrDefault opts useTokenizer customTokenizer gr
|
||||||
|
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/04/21 16:21:04 $
|
-- > CVS $Date: 2005/05/12 10:03:33 $
|
||||||
-- > CVS $Author: bringert $
|
-- > CVS $Author: aarne $
|
||||||
-- > CVS $Revision: 1.35 $
|
-- > CVS $Revision: 1.36 $
|
||||||
--
|
--
|
||||||
-- GF shell command interpreter.
|
-- GF shell command interpreter.
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
@@ -205,7 +205,7 @@ execC co@(comm, opts0) sa@((st,(h,_)),a) = checkOptions st co >> case comm of
|
|||||||
|
|
||||||
CPutTerm -> changeArg (opTT2CommandArg (optTermCommand opts gro) . s2t) sa
|
CPutTerm -> changeArg (opTT2CommandArg (optTermCommand opts gro) . s2t) sa
|
||||||
|
|
||||||
---- CWrapTerm f -> changeArg (opTT2CommandArg (return . wrapByFun opts gro f)) sa
|
CWrapTerm f -> changeArg (opTT2CommandArg (return . wrapByFun opts gro f)) sa
|
||||||
CMorphoAnalyse -> changeArg (AString . morphoAnalyse opts gro . prCommandArg) sa
|
CMorphoAnalyse -> changeArg (AString . morphoAnalyse opts gro . prCommandArg) sa
|
||||||
CTestTokenizer -> changeArg (AString . optTokenizer opts gro . prCommandArg) sa
|
CTestTokenizer -> changeArg (AString . optTokenizer opts gro . prCommandArg) sa
|
||||||
|
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/04/21 16:23:20 $
|
-- > CVS $Date: 2005/05/12 10:03:33 $
|
||||||
-- > CVS $Author: bringert $
|
-- > CVS $Author: aarne $
|
||||||
-- > CVS $Revision: 1.2 $
|
-- > CVS $Revision: 1.3 $
|
||||||
--
|
--
|
||||||
-- Help on shell commands. Generated from HelpFile by 'make help'.
|
-- Help on shell commands. Generated from HelpFile by 'make help'.
|
||||||
-- PLEASE DON'T EDIT THIS FILE.
|
-- PLEASE DON'T EDIT THIS FILE.
|
||||||
@@ -297,13 +297,16 @@ txtHelpFile =
|
|||||||
"\n examples:" ++
|
"\n examples:" ++
|
||||||
"\n p \"zero is even\" | pt -transform=solve -- solve ?'s in parse result" ++
|
"\n p \"zero is even\" | pt -transform=solve -- solve ?'s in parse result" ++
|
||||||
"\n" ++
|
"\n" ++
|
||||||
"\n" ++
|
|
||||||
"\n* st, show_tree: st Tree" ++
|
"\n* st, show_tree: st Tree" ++
|
||||||
"\n Prints the tree as a string. Unlike pt, this command cannot be" ++
|
"\n Prints the tree as a string. Unlike pt, this command cannot be" ++
|
||||||
"\n used in a pipe to produce a tree, since its output is a string." ++
|
"\n used in a pipe to produce a tree, since its output is a string." ++
|
||||||
"\n flags:" ++
|
"\n flags:" ++
|
||||||
"\n -printer show the tree in a special format (-printer=xml supported)" ++
|
"\n -printer show the tree in a special format (-printer=xml supported)" ++
|
||||||
"\n" ++
|
"\n" ++
|
||||||
|
"\nwt, wrap_tree: wt Fun" ++
|
||||||
|
"\n Wraps the tree as the sole argument of Fun." ++
|
||||||
|
"\n flags:" ++
|
||||||
|
"\n -c compute the resulting new tree to normal form" ++
|
||||||
"\n" ++
|
"\n" ++
|
||||||
"\n-- subshells" ++
|
"\n-- subshells" ++
|
||||||
"\n" ++
|
"\n" ++
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/04/21 16:46:12 $
|
-- > CVS $Date: 2005/05/12 10:03:33 $
|
||||||
-- > CVS $Author: bringert $
|
-- > CVS $Author: aarne $
|
||||||
-- > CVS $Revision: 1.20 $
|
-- > CVS $Revision: 1.21 $
|
||||||
--
|
--
|
||||||
-- parsing GF shell commands. AR 11\/11\/2001
|
-- parsing GF shell commands. AR 11\/11\/2001
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
@@ -97,7 +97,7 @@ pCommand ws = case ws of
|
|||||||
"gt" : [] -> aUnit CGenerateTrees
|
"gt" : [] -> aUnit CGenerateTrees
|
||||||
"gt" : t -> aTerm CGenerateTrees t
|
"gt" : t -> aTerm CGenerateTrees t
|
||||||
"pt" : s -> aTerm CPutTerm s
|
"pt" : s -> aTerm CPutTerm s
|
||||||
----- "wt" : f : s -> aTerm (CWrapTerm (string2id f)) s
|
"wt" : f : s -> aTerm (CWrapTerm (pzIdent f)) s
|
||||||
"ma" : s -> aString CMorphoAnalyse s
|
"ma" : s -> aString CMorphoAnalyse s
|
||||||
"tt" : s -> aString CTestTokenizer s
|
"tt" : s -> aString CTestTokenizer s
|
||||||
"cc" : s -> aUnit $ CComputeConcrete $ unwords s
|
"cc" : s -> aUnit $ CComputeConcrete $ unwords s
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/05/11 10:28:16 $
|
-- > CVS $Date: 2005/05/12 10:03:33 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: aarne $
|
||||||
-- > CVS $Revision: 1.32 $
|
-- > CVS $Revision: 1.33 $
|
||||||
--
|
--
|
||||||
-- The datatype of shell commands and the list of their options.
|
-- The datatype of shell commands and the list of their options.
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
@@ -173,7 +173,7 @@ optionsOfCommand co = case co of
|
|||||||
CGenerateRandom -> flags "cat lang number depth"
|
CGenerateRandom -> flags "cat lang number depth"
|
||||||
CGenerateTrees -> both "metas" "depth alts cat lang number"
|
CGenerateTrees -> both "metas" "depth alts cat lang number"
|
||||||
CPutTerm -> flags "transform number"
|
CPutTerm -> flags "transform number"
|
||||||
CWrapTerm _ -> none
|
CWrapTerm _ -> opts "c"
|
||||||
CMorphoAnalyse -> both "short" "lang"
|
CMorphoAnalyse -> both "short" "lang"
|
||||||
CTestTokenizer -> flags "lexer"
|
CTestTokenizer -> flags "lexer"
|
||||||
CComputeConcrete _ -> flags "res"
|
CComputeConcrete _ -> flags "res"
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/05/11 10:28:16 $
|
-- > CVS $Date: 2005/05/12 10:03:33 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: aarne $
|
||||||
-- > CVS $Revision: 1.60 $
|
-- > CVS $Revision: 1.61 $
|
||||||
--
|
--
|
||||||
-- A database for customizable GF shell commands.
|
-- A database for customizable GF shell commands.
|
||||||
--
|
--
|
||||||
@@ -349,13 +349,13 @@ customStringCommand =
|
|||||||
customParser =
|
customParser =
|
||||||
customData "Parsers, selected by option -parser=x" $
|
customData "Parsers, selected by option -parser=x" $
|
||||||
[
|
[
|
||||||
(strCI "bottomup", PCF.parse "gb" . stateCF)
|
(strCI "chart", PCFOld.parse "ibn" . stateCF) -- DEPRECATED
|
||||||
|
,(strCI "bottomup", PCF.parse "gb" . stateCF)
|
||||||
,(strCI "topdown", PCF.parse "gt" . stateCF)
|
,(strCI "topdown", PCF.parse "gt" . stateCF)
|
||||||
-- commented for now, since there's a bug in the incremental algorithm:
|
-- commented for now, since there's a bug in the incremental algorithm:
|
||||||
-- ,(strCI "incremental", PCF.parse "ib" . stateCF)
|
-- ,(strCI "incremental", PCF.parse "ib" . stateCF)
|
||||||
-- ,(strCI "incremental-bottomup", PCF.parse "ib" . stateCF)
|
-- ,(strCI "incremental-bottomup", PCF.parse "ib" . stateCF)
|
||||||
-- ,(strCI "incremental-topdown", PCF.parse "it" . stateCF)
|
-- ,(strCI "incremental-topdown", PCF.parse "it" . stateCF)
|
||||||
,(strCI "chart", PCFOld.parse "ibn" . stateCF) -- DEPRECATED
|
|
||||||
,(strCI "old", chartParser . stateCF) -- DEPRECATED
|
,(strCI "old", chartParser . stateCF) -- DEPRECATED
|
||||||
,(strCI "myparser", myParser)
|
,(strCI "myparser", myParser)
|
||||||
-- add your own parsers here
|
-- add your own parsers here
|
||||||
|
|||||||
@@ -268,13 +268,16 @@ pt, put_tree: pt Tree
|
|||||||
examples:
|
examples:
|
||||||
p "zero is even" | pt -transform=solve -- solve ?'s in parse result
|
p "zero is even" | pt -transform=solve -- solve ?'s in parse result
|
||||||
|
|
||||||
|
|
||||||
* st, show_tree: st Tree
|
* st, show_tree: st Tree
|
||||||
Prints the tree as a string. Unlike pt, this command cannot be
|
Prints the tree as a string. Unlike pt, this command cannot be
|
||||||
used in a pipe to produce a tree, since its output is a string.
|
used in a pipe to produce a tree, since its output is a string.
|
||||||
flags:
|
flags:
|
||||||
-printer show the tree in a special format (-printer=xml supported)
|
-printer show the tree in a special format (-printer=xml supported)
|
||||||
|
|
||||||
|
wt, wrap_tree: wt Fun
|
||||||
|
Wraps the tree as the sole argument of Fun.
|
||||||
|
flags:
|
||||||
|
-c compute the resulting new tree to normal form
|
||||||
|
|
||||||
-- subshells
|
-- subshells
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,8 @@ include config.mk
|
|||||||
|
|
||||||
GHMAKE=$(GHC) --make
|
GHMAKE=$(GHC) --make
|
||||||
GHCXMAKE=ghcxmake
|
GHCXMAKE=ghcxmake
|
||||||
GHCFLAGS= -package util -fglasgow-exts -optP'$(CPPFLAGS)' -optl'$(LDFLAGS)'
|
#GHCFLAGS= -package util -fglasgow-exts -optP'$(CPPFLAGS)' -optl'$(LDFLAGS)'
|
||||||
|
GHCFLAGS= -package util -fglasgow-exts
|
||||||
GHCOPTFLAGS=-O2
|
GHCOPTFLAGS=-O2
|
||||||
GHCFUDFLAG=
|
GHCFUDFLAG=
|
||||||
JAVAFLAGS=-target 1.4 -source 1.4
|
JAVAFLAGS=-target 1.4 -source 1.4
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/04/21 11:38:24 $
|
-- > CVS $Date: 2005/05/12 10:03:34 $
|
||||||
-- > CVS $Author: bringert $
|
-- > CVS $Author: aarne $
|
||||||
-- > CVS $Revision: 1.8 $
|
-- > CVS $Revision: 1.9 $
|
||||||
--
|
--
|
||||||
-- Compile @HelpFile.hs@ from the text file @HelpFile@.
|
-- Compile @HelpFile.hs@ from the text file @HelpFile@.
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
@@ -21,7 +21,7 @@ main = do
|
|||||||
mkHsFile ss =
|
mkHsFile ss =
|
||||||
helpHeader ++
|
helpHeader ++
|
||||||
"module GF.Shell.HelpFile where\n\n" ++
|
"module GF.Shell.HelpFile where\n\n" ++
|
||||||
"import Operations\n\n" ++
|
"import GF.Data.Operations\n\n" ++
|
||||||
"txtHelpFileSummary =\n" ++
|
"txtHelpFileSummary =\n" ++
|
||||||
" unlines $ map (concat . take 1 . lines) $ paragraphs txtHelpFile\n\n" ++
|
" unlines $ map (concat . take 1 . lines) $ paragraphs txtHelpFile\n\n" ++
|
||||||
"txtHelpCommand c =\n" ++
|
"txtHelpCommand c =\n" ++
|
||||||
@@ -48,9 +48,9 @@ helpHeader = unlines [
|
|||||||
"-- Stability : (stable)",
|
"-- Stability : (stable)",
|
||||||
"-- Portability : (portable)",
|
"-- Portability : (portable)",
|
||||||
"--",
|
"--",
|
||||||
"-- > CVS $Date: 2005/04/21 11:38:24 $",
|
"-- > CVS $Date: 2005/05/12 10:03:34 $",
|
||||||
"-- > CVS $Author: bringert $",
|
"-- > CVS $Author: aarne $",
|
||||||
"-- > CVS $Revision: 1.8 $",
|
"-- > CVS $Revision: 1.9 $",
|
||||||
"--",
|
"--",
|
||||||
"-- Help on shell commands. Generated from HelpFile by 'make help'.",
|
"-- Help on shell commands. Generated from HelpFile by 'make help'.",
|
||||||
"-- PLEASE DON'T EDIT THIS FILE.",
|
"-- PLEASE DON'T EDIT THIS FILE.",
|
||||||
|
|||||||
Reference in New Issue
Block a user