summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoraarne <unknown>2004-05-27 08:28:43 +0000
committeraarne <unknown>2004-05-27 08:28:43 +0000
commit244307ca3765c784cf3cb7d572eb08751a2ba74c (patch)
tree39e133febbdbcd7a06eff083fbc26446542500cd /src
parenta4c388374f402121cdab3a9379e405501afe29a8 (diff)
MyParser: hook for external parser
Diffstat (limited to 'src')
-rw-r--r--src/GF/API/MyParser.hs13
-rw-r--r--src/GF/UseGrammar/Custom.hs3
-rw-r--r--src/Today.hs2
3 files changed, 17 insertions, 1 deletions
diff --git a/src/GF/API/MyParser.hs b/src/GF/API/MyParser.hs
new file mode 100644
index 000000000..3bb749a20
--- /dev/null
+++ b/src/GF/API/MyParser.hs
@@ -0,0 +1,13 @@
+module MyParser where
+
+import ShellState
+import CFIdent
+import CF
+import Operations
+
+-- template to define your own parser
+
+-- type CFParser = [CFTok] -> ([(CFTree,[CFTok])],String)
+
+myParser :: StateGrammar -> CFCat -> CFParser
+myParser gr cat toks = ([],"Would you like to add your own parser?")
diff --git a/src/GF/UseGrammar/Custom.hs b/src/GF/UseGrammar/Custom.hs
index e5e59fc05..952f6dc07 100644
--- a/src/GF/UseGrammar/Custom.hs
+++ b/src/GF/UseGrammar/Custom.hs
@@ -44,6 +44,8 @@ import NewerChartParser
-- see also customGrammarPrinter
import qualified ConvertGrammar as Cnv
+import MyParser
+
import MoreCustom -- either small/ or big/. The one in Small is empty.
import UseIO
@@ -257,6 +259,7 @@ customParser =
customData "Parsers, selected by option -parser=x" $
[
(strCI "chart", chartParser . stateCF)
+ ,(strCI "myparser", myParser)
-- add your own parsers here
]
-- 21/5-04, peb:
diff --git a/src/Today.hs b/src/Today.hs
index da911717b..f3613eba0 100644
--- a/src/Today.hs
+++ b/src/Today.hs
@@ -1 +1 @@
-module Today where today = "Wed May 26 22:36:42 CEST 2004"
+module Today where today = "Thu May 27 11:01:26 CEST 2004"