diff options
| author | bringert <unknown> | 2005-06-17 13:15:16 +0000 |
|---|---|---|
| committer | bringert <unknown> | 2005-06-17 13:15:16 +0000 |
| commit | 2c48a10236bb19d8b04382cb1e957ce18b9d29fd (patch) | |
| tree | 1194fc1981b5cd2a144b72f4fff261edfeb1af2e /src/GF/OldParsing/ConvertGFCtoMCFG | |
| parent | 05b5ffe5bf03a870f6fe0728ace6c0d8de69b89e (diff) | |
Changed name of Con constructor in GFC.cf to avoid errors on Windows when generating Java code with BNFC for the GFC grammar. CON is a reserved filename on Windows. Con was changed to Par, and all the code using was changed too.
Diffstat (limited to 'src/GF/OldParsing/ConvertGFCtoMCFG')
| -rw-r--r-- | src/GF/OldParsing/ConvertGFCtoMCFG/Nondet.hs | 8 | ||||
| -rw-r--r-- | src/GF/OldParsing/ConvertGFCtoMCFG/Old.hs | 12 | ||||
| -rw-r--r-- | src/GF/OldParsing/ConvertGFCtoMCFG/Strict.hs | 8 |
3 files changed, 14 insertions, 14 deletions
diff --git a/src/GF/OldParsing/ConvertGFCtoMCFG/Nondet.hs b/src/GF/OldParsing/ConvertGFCtoMCFG/Nondet.hs index ef9265d91..7727aa15f 100644 --- a/src/GF/OldParsing/ConvertGFCtoMCFG/Nondet.hs +++ b/src/GF/OldParsing/ConvertGFCtoMCFG/Nondet.hs @@ -5,9 +5,9 @@ -- Stability : (stable) -- Portability : (portable) -- --- > CVS $Date: 2005/04/21 16:22:55 $ +-- > CVS $Date: 2005/06/17 14:15:18 $ -- > CVS $Author: bringert $ --- > CVS $Revision: 1.2 $ +-- > CVS $Revision: 1.3 $ -- -- Converting GFC grammars to MCFG grammars, nondeterministically. -- @@ -98,7 +98,7 @@ simplTerm env = simplifyTerm where simplifyTerm :: Term -> CnvMonad STerm simplifyTerm (Arg (A cat nr)) = return (SArg (fromInteger nr) cat emptyPath) - simplifyTerm (Con con terms) = liftM (SCon con) $ mapM simplifyTerm terms + simplifyTerm (Par con terms) = liftM (SCon con) $ mapM simplifyTerm terms simplifyTerm (R record) = liftM SRec $ mapM simplifyAssign record simplifyTerm (P term lbl) = liftM (+. lbl) $ simplifyTerm term simplifyTerm (T ct table) = liftM STbl $ sequence $ concatMap simplifyCase table @@ -277,5 +277,5 @@ cTypeForArg env (SArg nr cat (Path path)) " results in " ++ show err term2spattern (R rec) = SRec [ (lbl, term2spattern term) | Ass lbl term <- rec ] -term2spattern (Con con terms) = SCon con $ map term2spattern terms +term2spattern (Par con terms) = SCon con $ map term2spattern terms diff --git a/src/GF/OldParsing/ConvertGFCtoMCFG/Old.hs b/src/GF/OldParsing/ConvertGFCtoMCFG/Old.hs index b9fbf3b8c..8b9b4a9ec 100644 --- a/src/GF/OldParsing/ConvertGFCtoMCFG/Old.hs +++ b/src/GF/OldParsing/ConvertGFCtoMCFG/Old.hs @@ -5,9 +5,9 @@ -- Stability : (stable) -- Portability : (portable) -- --- > CVS $Date: 2005/04/21 16:22:56 $ +-- > CVS $Date: 2005/06/17 14:15:18 $ -- > CVS $Author: bringert $ --- > CVS $Revision: 1.2 $ +-- > CVS $Revision: 1.3 $ -- -- Converting GFC grammars to MCFG grammars. (Old variant) -- @@ -66,7 +66,7 @@ cnvXMCFLin (Lin lbl lin) = Lin (cnvXMCFLabel lbl) $ cnvTerm (R rec) = SRec [ (lbl, cnvTerm term) | Ass lbl term <- rec ] cnvTerm (T _ tbl) = STbl [ (cnvPattern pat, cnvTerm term) | Cas pats term <- tbl, pat <- pats ] -cnvTerm (Con con terms) = SCon con $ map cnvTerm terms +cnvTerm (Par con terms) = SCon con $ map cnvTerm terms cnvTerm term | isArgPath term = cnvArgPath term @@ -208,7 +208,7 @@ strPaths gr l ctype term = [ (path, evalFV values) | (path, values) <- groupPair -- Substitute each instantiated parameter path for its instantiation substitutePaths :: CanonGrammar -> Ident -> [Term] -> Term -> Term substitutePaths gr l arguments trm = subst trm - where subst (con `Con` terms) = con `Con` map subst terms + where subst (con `Par` terms) = con `Par` map subst terms subst (R record) = R $ map substAss record subst (term `P` lbl) = subst term `evalP` lbl subst (T ptype table) = T ptype $ map substCas table @@ -264,11 +264,11 @@ matchesPats term patterns = or [ term == pattern2term pattern | pattern <- patte pattern2term :: Patt -> Term term2pattern :: Term -> Patt -pattern2term (con `PC` patterns) = con `Con` map pattern2term patterns +pattern2term (con `PC` patterns) = con `Par` map pattern2term patterns pattern2term (PR record) = R [ lbl `Ass` pattern2term pattern | lbl `PAss` pattern <- record ] -term2pattern (con `Con` terms) = con `PC` map term2pattern terms +term2pattern (con `Par` terms) = con `PC` map term2pattern terms term2pattern (R record) = PR [ lbl `PAss` term2pattern term | lbl `Ass` term <- record ] diff --git a/src/GF/OldParsing/ConvertGFCtoMCFG/Strict.hs b/src/GF/OldParsing/ConvertGFCtoMCFG/Strict.hs index d1e5c5b20..d088bdebc 100644 --- a/src/GF/OldParsing/ConvertGFCtoMCFG/Strict.hs +++ b/src/GF/OldParsing/ConvertGFCtoMCFG/Strict.hs @@ -5,9 +5,9 @@ -- Stability : (stable) -- Portability : (portable) -- --- > CVS $Date: 2005/04/21 16:22:56 $ +-- > CVS $Date: 2005/06/17 14:15:18 $ -- > CVS $Author: bringert $ --- > CVS $Revision: 1.2 $ +-- > CVS $Revision: 1.3 $ -- -- Converting GFC grammars to MCFG grammars, nondeterministically. -- @@ -106,7 +106,7 @@ enumerateArg env (A cat nr) = let ctype = lookupCType env cat -- Substitute each instantiated parameter path for its instantiation substitutePaths :: Env -> [STerm] -> Term -> STerm substitutePaths env arguments trm = subst trm - where subst (con `Con` terms) = con `SCon` map subst terms + where subst (con `Par` terms) = con `SCon` map subst terms subst (R record) = SRec [ (lbl, subst term) | lbl `Ass` term <- record ] subst (term `P` lbl) = subst term +. lbl subst (T ptype table) = STbl [ (pattern2sterm pat, subst term) | @@ -180,7 +180,7 @@ groundTerms env ctype = err error (map term2spattern) $ allParamValues (fst env) ctype term2spattern (R rec) = SRec [ (lbl, term2spattern term) | Ass lbl term <- rec ] -term2spattern (Con con terms) = SCon con $ map term2spattern terms +term2spattern (Par con terms) = SCon con $ map term2spattern terms pattern2sterm :: Patt -> STerm pattern2sterm (con `PC` patterns) = con `SCon` map pattern2sterm patterns |
