MyParser: hook for external parser

This commit is contained in:
aarne
2004-05-27 08:28:43 +00:00
parent c672653231
commit 0f8955da68
3 changed files with 17 additions and 1 deletions

13
src/GF/API/MyParser.hs Normal file
View File

@@ -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?")

View File

@@ -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:

View File

@@ -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"