MyParser: hook for external parser

This commit is contained in:
aarne
2004-05-27 08:28:43 +00:00
parent a4c388374f
commit 244307ca37
3 changed files with 17 additions and 1 deletions
+13
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?")
+3
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: