summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoraarne <unknown>2004-09-28 19:44:02 +0000
committeraarne <unknown>2004-09-28 19:44:02 +0000
commit01f872bf5db46863565c44c7f40b337217d35e8e (patch)
tree6ea7ddb450efdd4e8da5aec6631da7b22b5911a9 /src
parent422b626a361c08b911471c04159931756887335c (diff)
gfcc report
Diffstat (limited to 'src')
-rw-r--r--src/GF.hs2
-rw-r--r--src/GF/CF/PrLBNF.hs8
-rw-r--r--src/HelpFile7
-rw-r--r--src/HelpFile.hs7
4 files changed, 17 insertions, 7 deletions
diff --git a/src/GF.hs b/src/GF.hs
index 451a519a7..c573e0e1c 100644
--- a/src/GF.hs
+++ b/src/GF.hs
@@ -75,7 +75,7 @@ welcomeMsg =
"Welcome to " ++ authorMsg ++++ welcomeArch ++ "\n\nType 'h' for help."
authorMsg = unlines [
- "Grammatical Framework, Version 2.0+",
+ "Grammatical Framework, Version 2.1 beta",
"Compiled " ++ today,
"Copyright (c)",
"Björn Bringert, Markus Forsberg, Thomas Hallgren, Harald Hammarström,",
diff --git a/src/GF/CF/PrLBNF.hs b/src/GF/CF/PrLBNF.hs
index fe06cbf9e..a0b33de87 100644
--- a/src/GF/CF/PrLBNF.hs
+++ b/src/GF/CF/PrLBNF.hs
@@ -22,7 +22,7 @@ import List (nub)
prLBNF :: Bool -> StateGrammar -> String
prLBNF new gr = unlines $ pragmas ++ (map (prCFRule cs) rules)
where
- cs = map IC ["Int","String"] ++ [catId c | (_,(c,_)) <- rules]
+ cs = map IC ["Int","String"] ++ [catIdPlus c | (_,(c,_)) <- rules]
cf = stateCF gr
(pragmas,rules) = if new -- tries to treat precedence levels
then mkLBNF (stateGrammarST gr) $ rulesOfCF cf
@@ -82,6 +82,10 @@ mkLBNF gr rules = (coercions, nub $ concatMap mkRule rules) where
catId ((CFCat ((CIQ _ c),l))) = c
+catIdPlus ((CFCat ((CIQ _ c@(IC s)),l))) = case reverse s of
+ '+':cs -> IC $ reverse $ dropWhile isDigit cs
+ _ -> c
+
prCFRule :: [Ident] -> CFRule -> String
prCFRule cs (fun,(cat,its)) =
prCFFun cat fun ++ "." +++ prCFCat True cat +++ "::=" +++ --- err in cat -> in syntax
@@ -121,7 +125,7 @@ prCFCat :: Bool -> CFCat -> String
prCFCat b (CFCat ((CIQ _ c),l)) = prId b c ++ prLab l ----
-- if a category does not have a production of its own, we replace it by Ident
-prCFItem cs (CFNonterm c) = if elem (catId c) cs then prCFCat False c else "Ident"
+prCFItem cs (CFNonterm c) = if elem (catIdPlus c) cs then prCFCat False c else "Ident"
prCFItem _ (CFTerm a) = prRegExp a
prRegExp (RegAlts tt) = case tt of
diff --git a/src/HelpFile b/src/HelpFile
index 85b39c8d9..af09b5e01 100644
--- a/src/HelpFile
+++ b/src/HelpFile
@@ -435,8 +435,11 @@ q, quit: q
-printer=gfc GFC grammar
-printer=gf GF grammar
-printer=old old GF grammar
- -printer=cf context-free grammar
- *-printer=happy source file for Happy parser generator
+ -printer=cf context-free grammar, with profiles
+ -printer=bnf context-free grammar, without profiles
+ -printer=lbnf labelled context-free grammar for BNF Converter
+ -printer=plbnf grammar for BNF Converter, with precedence levels
+ *-printer=happy source file for Happy parser generator (use lbnf!)
-printer=srg speech recognition grammar
-printer=haskell abstract syntax in Haskell, with transl to/from GF
-printer=morpho full-form lexicon, long format
diff --git a/src/HelpFile.hs b/src/HelpFile.hs
index 3cc6b2ada..742279fc4 100644
--- a/src/HelpFile.hs
+++ b/src/HelpFile.hs
@@ -448,8 +448,11 @@ txtHelpFile =
"\n -printer=gfc GFC grammar" ++
"\n -printer=gf GF grammar" ++
"\n -printer=old old GF grammar" ++
- "\n -printer=cf context-free grammar" ++
- "\n *-printer=happy source file for Happy parser generator" ++
+ "\n -printer=cf context-free grammar, with profiles" ++
+ "\n -printer=bnf context-free grammar, without profiles" ++
+ "\n -printer=lbnf labelled context-free grammar for BNF Converter" ++
+ "\n -printer=plbnf grammar for BNF Converter, with precedence levels" ++
+ "\n *-printer=happy source file for Happy parser generator (use lbnf!)" ++
"\n -printer=srg speech recognition grammar" ++
"\n -printer=haskell abstract syntax in Haskell, with transl to/from GF" ++
"\n -printer=morpho full-form lexicon, long format" ++