BNFC-meta 0.2.0.1 → 0.2.0.2
raw patch · 3 files changed
+51/−62 lines, 3 files
Files
- BNFC-meta.cabal +49/−49
- Language/LBNF/CFtoHappy.hs +1/−12
- Language/LBNF/Grammar.hs +1/−1
BNFC-meta.cabal view
@@ -1,49 +1,49 @@-Name: BNFC-meta -version: 0.2.0.1 -cabal-Version: >= 1.6 -build-type: Simple -license: GPL-2 -license-file: LICENSE -author: Jonas Duregård -maintainer: Jonas Duregård (jonas.duregard@chalmers.se) -category: Development -synopsis: Deriving Quasi-Quoters from BNF Grammars -description: This package provides a comfortable way of defining quasi-quoters. - Specifically, given a quasi-quoted LBNF grammar (as used by the BNF Converter) - it generates (using Template Haskell) an LALR parser and pretty pretty printer - for the language. The parser is then used to define a quasi-quoter. With a simple - pragma, the user can define a universal syntax for anti-quoting. This means that - any grammar non-terminal can be replaced by a quoted Haskell expression of the - appropriate type. A few examples are included in the source tarball. - -extra-source-files: - examples/GHC7/jll/JavaletteLight.hs - examples/GHC7/jll/UseJll.hs - examples/GHC6/jll/JavaletteLight.hs - examples/GHC6/jll/UseJll.hs - Bootstrap/Bootstrap.hs - -Library - Build-Depends: - base>=4.2&&<5 - , array==0.3.0.* - , template-haskell >=2.4&&<2.6 - , haskell-src-meta >= 0.3 && < 1.0 - , happy-meta >= 0.2.0.2 - , alex-meta >= 0.2.0.1 - Exposed-modules: - Language.LBNF - , Language.LBNF.Runtime - , Language.LBNF.Compiletime - , Language.LBNF.Grammar - Other-modules: - Language.LBNF.CF - , Language.LBNF.CFtoAbstract - , Language.LBNF.CFtoAlex2 - , Language.LBNF.CFtoHappy - , Language.LBNF.CFtoPrinter - , Language.LBNF.CFtoQQ - , Language.LBNF.GetCF - , Language.LBNF.TypeChecker - , Language.LBNF.Utils - , Language.Haskell.TH.Hide +Name: BNFC-meta+version: 0.2.0.2+cabal-Version: >= 1.6+build-type: Simple+license: GPL-2+license-file: LICENSE+author: Jonas Duregård+maintainer: Jonas Duregård (jonas.duregard@chalmers.se)+category: Development+synopsis: Deriving Quasi-Quoters from BNF Grammars+description: This package provides a comfortable way of defining quasi-quoters. + Specifically, given a quasi-quoted LBNF grammar (as used by the BNF Converter) + it generates (using Template Haskell) an LALR parser and pretty pretty printer + for the language. The parser is then used to define a quasi-quoter. With a simple+ pragma, the user can define a universal syntax for anti-quoting. This means that + any grammar non-terminal can be replaced by a quoted Haskell expression of the + appropriate type. A few examples are included in the source tarball.++extra-source-files:+ examples/GHC7/jll/JavaletteLight.hs+ examples/GHC7/jll/UseJll.hs+ examples/GHC6/jll/JavaletteLight.hs+ examples/GHC6/jll/UseJll.hs+ Bootstrap/Bootstrap.hs++Library+ Build-Depends: + base>=4.2&&<5+ , array==0.3.0.*+ , template-haskell >=2.4&&<2.6+ , haskell-src-meta >= 0.3 && < 1.0+ , happy-meta >= 0.2.0.2+ , alex-meta >= 0.2.0.1+ Exposed-modules:+ Language.LBNF+ , Language.LBNF.Runtime+ , Language.LBNF.Compiletime+ , Language.LBNF.Grammar+ Other-modules:+ Language.LBNF.CF+ , Language.LBNF.CFtoAbstract+ , Language.LBNF.CFtoAlex2+ , Language.LBNF.CFtoHappy + , Language.LBNF.CFtoPrinter+ , Language.LBNF.CFtoQQ+ , Language.LBNF.GetCF+ , Language.LBNF.TypeChecker+ , Language.LBNF.Utils+ , Language.Haskell.TH.Hide
Language/LBNF/CFtoHappy.hs view
@@ -108,7 +108,7 @@ prTokens tk oneTok t = "PT _ (TS " ++ show t ++ ")" --- Happy doesn't allow characters such as åäö to occur in the happy file. This +-- Happy doesnt allow certain characters such to occur in the happy file. This -- is however not a restriction, just a naming paradigm in the happy source file. convert :: String -> String convert "\\" = concat ['\'':"\\\\","\'"] @@ -281,9 +281,6 @@ | otherwise = App x $ map underscore es underscore e = e --- aarne's modifs 8/1/2002: --- Markus's modifs 11/02/2002 - -- GF literals specialToks :: CF -> String specialToks cf = unlines $ @@ -304,16 +301,8 @@ specialRules l cf = unlines $ map aux (typed_literals cf) where - -- m = loc_module l aux (fun,cat) = case cat of --- "Ident" -> "Ident :: { (Ident } : L_ident { (Ident $1,fromToken \"Ident\" $1) }" --- "String" -> "String :: { (String,BNFC_QQType) } : L_quoted { fromString $1 }" -- FIXME: Why not read? --- "Integer" -> "Integer :: { (Integer,BNFC_QQType) } \nInteger : "++iaq++"L_integ { fromLit (read $1) }" --- "Double" -> "Double :: { (Double,BNFC_QQType) } : L_doubl { fromLit (read $1) }" --- "Char" -> "Char :: { (Char,BNFC_QQType) } : L_charac { fromLit (read $1) }" --- own -> own ++ " :: { (" ++ own ++ ",BNFC_QQType) } : L_" ++ own ++ --- " { (" ++ own ++ " ("++ posn ++ "$1),fromToken \""++own++"\" $1)}" "Ident" -> unlines [ "Ident :: { Ident } : L_ident { Ident $1 }" , "QQ_Ident :: { BNFC_QQType } : L_ident { "++fromToken ++"\"Ident\" $1 }"
Language/LBNF/Grammar.hs view
@@ -5444,7 +5444,7 @@ myLexer = tokens -myLocation = ("BNFC-meta-0.2","Language.LBNF.Grammar") +myLocation = ("BNFC-meta-0.2.0.2","Language.LBNF.Grammar") {-# LINE 1 "templates\GenericTemplate.hs" #-} {-# LINE 1 "templates\\GenericTemplate.hs" #-}