summaryrefslogtreecommitdiff
path: root/src/GF/Formalism/Symbol.hs
diff options
context:
space:
mode:
authorpeb <unknown>2005-04-12 09:49:44 +0000
committerpeb <unknown>2005-04-12 09:49:44 +0000
commitfa6ba9a5318640778040e86268e9003216f3636e (patch)
treefdbafb9713893bfb978d3c18f0fc7fc778bc763e /src/GF/Formalism/Symbol.hs
parent5f25c828178281ed8f8b77abc0b599d740c797b0 (diff)
"Committed_by_peb"
Diffstat (limited to 'src/GF/Formalism/Symbol.hs')
-rw-r--r--src/GF/Formalism/Symbol.hs46
1 files changed, 0 insertions, 46 deletions
diff --git a/src/GF/Formalism/Symbol.hs b/src/GF/Formalism/Symbol.hs
deleted file mode 100644
index 184dd1023..000000000
--- a/src/GF/Formalism/Symbol.hs
+++ /dev/null
@@ -1,46 +0,0 @@
-----------------------------------------------------------------------
--- |
--- Maintainer : PL
--- Stability : (stable)
--- Portability : (portable)
---
--- > CVS $Date: 2005/04/11 13:52:50 $
--- > CVS $Author: peb $
--- > CVS $Revision: 1.1 $
---
--- Basic type declarations and functions to be used in grammar formalisms
------------------------------------------------------------------------------
-
-
-module GF.Formalism.Symbol where
-
-import GF.Infra.Print
-
-------------------------------------------------------------
--- symbols
-
-data Symbol c t = Cat c | Tok t
- deriving (Eq, Ord, Show)
-
-symbol :: (c -> a) -> (t -> a) -> Symbol c t -> a
-symbol fc ft (Cat cat) = fc cat
-symbol fc ft (Tok tok) = ft tok
-
-mapSymbol :: (c -> d) -> (t -> u) -> Symbol c t -> Symbol d u
-mapSymbol fc ft = symbol (Cat . fc) (Tok . ft)
-
-------------------------------------------------------------
--- pretty-printing
-
-instance (Print c, Print t) => Print (Symbol c t) where
- prt = symbol prt (simpleShow . prt)
- where simpleShow str = "\"" ++ concatMap mkEsc str ++ "\""
- mkEsc '\\' = "\\\\"
- mkEsc '\"' = "\\\""
- mkEsc '\n' = "\\n"
- mkEsc '\t' = "\\t"
- mkEsc chr = [chr]
- prtList = prtSep " "
-
-
-