packages feed

Grempa 0.1.3 → 0.2.0

raw patch · 3 files changed

+15/−15 lines, 3 files

Files

Data/Parser/Grempa/Grammar.hs view
@@ -62,13 +62,13 @@ -- | Return a new rule which consists of 1 or more of the argument symbol. --   Example: @several x@ matches @x x ... x@ -----   Creates two new rules.+--   Creates one new rule. several :: (ToSym s x, ToSymT s x ~ a, Typeable a, Typeable s)         => x -> Grammar s [a] several x = do     rec-      xs0 <- several0 x-      xs  <- x `cons` xs0+      xs <- rule [(:[]) <@> x+                 ,(:)   <@> x <#> xs ]     return xs  -- | Create a new rule which consists of a list of size 0 or more interspersed@@ -76,32 +76,32 @@ --   Example: @severalInter0 ';' x@ matches @x ';' x ';' ... ';' x@ --   If @x :: a@ then the result is of type @[a]@. -----   Creates one new rule.+--   Creates two new rules. severalInter0 :: ( ToSym s x, ToSymT s x ~ a                  , ToSym s t, ToSymT s t ~ s                  , Typeable a, Typeable s)              => t -> x -> Grammar s [a] severalInter0 tok x = do   rec-    xs <- rule [epsilon []-               ,(:[]) <@> x-               ,(:)   <@> x <# tok <#> xs]-  return xs+    xs  <- rule [(:[]) <@> x+                ,(:)   <@> x <# tok <#> xs]+    res <- rule [epsilon []+                ,id <@> xs]+  return res  -- | Return a new rule which consists of a list of size 1 or more interspersed --   with a symbol. --   Example: @severalInter ';' x@ matches @x ';' x ';' ... ';' x@ -----   Creates two new rules.+--   Creates one new rule. severalInter :: ( ToSym s x, ToSymT s x ~ a                 , ToSym s t, ToSymT s t ~ s                 , Typeable a, Typeable s)              => t -> x -> Grammar s [a] severalInter tok x = do   rec-    xs0 <- severalInter0 tok x-    --xs  <- (x <# tok) `cons` xs0-    xs  <- rule [(:) <@> x <# tok <#> xs0]+    xs <- rule [ (:[]) <@> x+               , (:)   <@> x <# tok <#> xs]   return xs  -- | Takes two symbols and combines them with @(:)@.
Grempa.cabal view
@@ -1,5 +1,5 @@ Name:                Grempa-Version:             0.1.3+Version:             0.2.0 Synopsis:            Embedded grammar DSL and LALR parser generator Description:     A library for expressing programming language grammars in a form similar@@ -14,7 +14,7 @@ License-file:        LICENSE Author:              Olle Fredriksson Maintainer:          fredriksson.olle@gmail.com-Copyright:           (c) 2010 Olle Fredriksson+Copyright:           (c) 2011 Olle Fredriksson Stability:           Experimental Category:            Parsing Build-type:          Simple
README view
@@ -1,4 +1,4 @@-Grempa 0.1.0+Grempa Embedded grammar DSL and LALR parser generator Author: Olle Fredriksson