3+O      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN  Safe-Inferred#  !"#  !"#" !     !" Safe-Inferred#OP$#$#$#OP$ Safe-Inferred%%%% Safe-Inferred &'()*+,-.Q/ &'()*+,-./ ,.-&'()*+/&'()*+,.-Q/portable experimentaltanaka.hideyuki@gmail.comNone:Parsing function ;&Parsing function with only input name <Parse from file $0123456789:parser input information  input string result ;parser  input name  input string result <parser input filename result RS=>?T@ABCDEUFGVHWXYZ[\0123456789:;<=>?@ABCDEFGH:;<7894652301=>?@ABCDEFGH0123465789:;<RS=>?T@ABCDEUFGVHWXYZ[\NoneIJ]^_IJJIIJ]^_None9`abcdefghijklmnopqrstuvwxyz{|}K~KK`abcdefghijklmnopqrstuvwxyz{|}K~portable experimentaltanaka.hideyuki@gmail.comNoneLquasi-quoter for peggy syntax . When it is used at top-level of source code, ' definitions of parsers are generated.  A {-# LANGUAGE TemplateHaskell, QuasiQuotes, FlexibleContexts #-}  import Text.Peggy   [peggy|  foo :: [Int]  = num*  num ::: Int  = [0-9]+ { read $1 }  |]   main :: IO () : main = print . parseString foo "<stdin>" =<< getContents When it is used as expression,  the result value is ".   main = print [peggy|  num :: Int  = [0-9]+ { read $1 }  |] The result is:  $ runhaskell Test.hs  [Definition "num" "Int\n " (Choice [Semantic (Sequence [Some (TerminalSet [CharRange '0' '9'])]) [Snippet "read ",Argument 1,Snippet " "]])] MParse peggy syntax from File ( Parse a peggy syntax file and return a " as a result value.   $ cat test.peggy  num :: Int  = [0-9]+ { return $1 }  ( main = print $(peggyFile "test.peggy") The result is:  [Definition "num" "Int\n " (Choice [Semantic (Sequence [Some (TerminalSet [CharRange '0' '9'])]) [Snippet "read ",Argument 1,Snippet " "]])] N%Generates parsers and quasi-quoters. G First argument is a list of names of quasi-quoter you want to define.  For example:  & genParser [("fooqq", "foo")] [peggy|  foo :: [Int]  = num*  num ::: Int  = [0-9]+ { read $1 }  |]  this code defines parsers named foo, num and  quasi-quoter named fooqq. It can use it as follow:  main :: IO () # main = print [fooqq| 1 2 3 4 5 |] LMNa list of pair of name of * quasi-quoter and its start nonterminal syntax )definitions of parsers and quasi-quoters LMNLMNLMN NoneI  !"&'()*+,-./0123456789:;<=>?@ABCDEFGHLMN     !"#$%&'())*+,-../01234567899:;<==>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ peggy-0.3.2Text.Peggy.SyntaxText.Peggy.NormalizeText.Peggy.LeftRecText.Peggy.SrcLocText.Peggy.PrimText.Peggy.CodeGen.THText.Peggy.ParserText.Peggy.Quote Text.PeggyTermType IdentifierCodePartArgSpanArgPos AntiArgumentArgumentSnippet CodeFragment CharRangeCharOneExprSemanticTokenSepBy1SepByNotAndOptionalSomeManyChoiceSequenceNamedEmpty Primitive NonTerminal TerminalAny TerminalCmp TerminalSet Terminals DefinitionSyntax normalize shouldBindremoveLeftRecursionSrcPoslocFilelocAbslocLinelocColSrcLocLocSpanLocPosadvance MemoTablenewTable ParseErrorResultFailedParsedParserunParserparse parseString parseFilememogetPossetPosanyCharsatisfycharstringexpectunexpectspacedefaultDelimitertokengenQQgenDecssyntaxpeggy peggyFile genParser addSkipDelim desugarDeftabWidth nullErrorerrMerge parseErrortest getPrevChar$fAlternativeParser$fMonadErrorParseErrorParser$fApplicativeParser$fFunctorParser $fMonadParser$fErrorParseErrorgenerate parseExp' parseType' MemoTable_0 MemoTable_3 tbl_delimiter tbl_syntaxtbl_definitiontbl_exprtbl_choiceExprtbl_semanticExprtbl_sequenceExpr tbl_namedExprtbl_suffixExprtbl_suffixExpr_tailtbl_prefixExpr tbl_primExpr tbl_charLit tbl_escChar tbl_range tbl_rchartbl_haskellTypetbl_codeFragment tbl_codePart tbl_argument tbl_digit tbl_hexDigit tbl_identtbl_skip tbl_commenttbl_lineCommenttbl_regionComment delimiter definitionexpr choiceExpr semanticExpr sequenceExpr namedExpr suffixExprsuffixExpr_tail prefixExprprimExprcharLitescCharrangerchar haskellType codeFragmentcodePartargumentdigithexDigitidentskipcomment lineComment regionComment$fMemoTableMemoTable_0qDecsqExp parseSyntaxlocToPos