ewe 0.1.0.43 → 0.1.0.44
raw patch · 3 files changed
+94/−48 lines, 3 files
Files
- dist/build/ewe/ewe-tmp/Language/EWE/Parser.hs +27/−19
- dist/build/ewe/ewe-tmp/Language/EWE/Scanner.hs +66/−28
- ewe.cabal +1/−1
dist/build/ewe/ewe-tmp/Language/EWE/Parser.hs view
@@ -9,8 +9,9 @@ import qualified Data.Array as Happy_Data_Array import qualified GHC.Exts as Happy_GHC_Exts import Control.Applicative(Applicative(..))+import Control.Monad (ap) --- parser produced by Happy Version 1.19.4+-- parser produced by Happy Version 1.19.5 newtype HappyAbsSyn t4 t5 t6 t7 t8 t9 t10 = HappyAbsSyn HappyAny #if __GLASGOW_HASKELL__ >= 607@@ -585,11 +586,30 @@ pEWE s = runAlex s parse {-# LINE 1 "templates/GenericTemplate.hs" #-} {-# LINE 1 "templates/GenericTemplate.hs" #-}-{-# LINE 1 "<built-in>" #-}+{-# LINE 1 "<command-line>" #-}+{-# LINE 11 "<command-line>" #-}+{-# LINE 1 "/home/ghc/hp/build/ghc-bindist/local/lib/ghc-7.10.2/include/ghcversion.h" #-}++++++++++++++++++{-# LINE 11 "<command-line>" #-} {-# LINE 1 "templates/GenericTemplate.hs" #-} -- Id: GenericTemplate.hs,v 1.26 2005/01/14 14:47:22 simonmar Exp - {-# LINE 13 "templates/GenericTemplate.hs" #-} @@ -606,7 +626,6 @@ #define GTE(n,m) (n Happy_GHC_Exts.>=# m) #define EQ(n,m) (n Happy_GHC_Exts.==# m) #endif- {-# LINE 46 "templates/GenericTemplate.hs" #-} @@ -616,20 +635,11 @@ - {-# LINE 67 "templates/GenericTemplate.hs" #-} - {-# LINE 77 "templates/GenericTemplate.hs" #-} --------+{-# LINE 86 "templates/GenericTemplate.hs" #-} infixr 9 `HappyStk` data HappyStk a = HappyStk a (HappyStk a)@@ -657,20 +667,20 @@ happyDoAction i tk st = {- nothing -}- + case action of 0# -> {- nothing -} happyFail i tk st -1# -> {- nothing -} happyAccept i tk st n | LT(n,(0# :: Happy_GHC_Exts.Int#)) -> {- nothing -}- + (happyReduceArr Happy_Data_Array.! rule) i tk st where rule = (Happy_GHC_Exts.I# ((Happy_GHC_Exts.negateInt# ((n Happy_GHC_Exts.+# (1# :: Happy_GHC_Exts.Int#)))))) n -> {- nothing -}- + happyShift new_state i tk st where new_state = (n Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#)) where off = indexShortOffAddr happyActOffsets st@@ -703,7 +713,6 @@ ----------------------------------------------------------------------------- -- HappyState data type (not arrays) - {-# LINE 170 "templates/GenericTemplate.hs" #-} -----------------------------------------------------------------------------@@ -868,4 +877,3 @@ {-# NOINLINE happyFail #-} -- end of Happy Template.-
dist/build/ewe/ewe-tmp/Language/EWE/Scanner.hs view
@@ -32,7 +32,27 @@ #endif {-# LINE 1 "templates/wrappers.hs" #-} {-# LINE 1 "templates/wrappers.hs" #-}-{-# LINE 1 "<built-in>" #-}+{-# LINE 1 "<command-line>" #-}+{-# LINE 9 "<command-line>" #-}+{-# LINE 1 "/home/ghc/hp/build/ghc-bindist/local/lib/ghc-7.10.2/include/ghcversion.h" #-}++++++++++++++++++{-# LINE 9 "<command-line>" #-} {-# LINE 1 "templates/wrappers.hs" #-} -- ----------------------------------------------------------------------------- -- Alex wrapper code.@@ -40,9 +60,9 @@ -- This code is in the PUBLIC DOMAIN; you may copy it freely and use -- it for any purpose whatsoever. +import Control.Applicative (Applicative (..)) import Data.Word (Word8)--{-# LINE 22 "templates/wrappers.hs" #-}+{-# LINE 23 "templates/wrappers.hs" #-} import qualified Data.Bits @@ -94,14 +114,11 @@ in p' `seq` Just (b, (p', c, bs, s)) --{-# LINE 92 "templates/wrappers.hs" #-}---{-# LINE 106 "templates/wrappers.hs" #-}+{-# LINE 93 "templates/wrappers.hs" #-} +{-# LINE 107 "templates/wrappers.hs" #-} -{-# LINE 121 "templates/wrappers.hs" #-}+{-# LINE 122 "templates/wrappers.hs" #-} -- ----------------------------------------------------------------------------- -- Token positions@@ -157,6 +174,19 @@ newtype Alex a = Alex { unAlex :: AlexState -> Either String (AlexState, a) } +instance Functor Alex where+ fmap f a = Alex $ \s -> case unAlex a s of+ Left msg -> Left msg+ Right (s', a') -> Right (s', f a')++instance Applicative Alex where+ pure a = Alex $ \s -> Right (s, a)+ fa <*> a = Alex $ \s -> case unAlex fa s of+ Left msg -> Left msg+ Right (s', f) -> case unAlex a s' of+ Left msg -> Left msg+ Right (s'', b) -> Right (s'', f b)+ instance Monad Alex where m >>= k = Alex $ \s -> case unAlex m s of Left msg -> Left msg@@ -228,41 +258,35 @@ -- ----------------------------------------------------------------------------- -- Monad (with ByteString input) --{-# LINE 333 "templates/wrappers.hs" #-}+{-# LINE 347 "templates/wrappers.hs" #-} -- ----------------------------------------------------------------------------- -- Basic wrapper --{-# LINE 360 "templates/wrappers.hs" #-}+{-# LINE 374 "templates/wrappers.hs" #-} -- ----------------------------------------------------------------------------- -- Basic wrapper, ByteString version --{-# LINE 378 "templates/wrappers.hs" #-}-- {-# LINE 392 "templates/wrappers.hs" #-} +{-# LINE 406 "templates/wrappers.hs" #-} + -- ----------------------------------------------------------------------------- -- Posn wrapper -- Adds text positions to the basic model. --{-# LINE 409 "templates/wrappers.hs" #-}+{-# LINE 423 "templates/wrappers.hs" #-} -- ----------------------------------------------------------------------------- -- Posn wrapper, ByteString version --{-# LINE 424 "templates/wrappers.hs" #-}+{-# LINE 438 "templates/wrappers.hs" #-} -- -----------------------------------------------------------------------------@@ -270,7 +294,6 @@ -- For compatibility with previous versions of Alex, and because we can. - alex_base :: AlexAddr alex_base = AlexA# "\xf8\xff\xff\xff\xf3\xff\xff\xff\x73\x00\x00\x00\xb4\x00\x00\x00\x00\x00\x00\x00\x25\x01\x00\x00\x00\x00\x00\x00\xa5\x01\x00\x00\x25\x02\x00\x00\x00\x00\x00\x00\x96\x02\x00\x00\x96\x03\x00\x00\x56\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x97\x03\x00\x00\x8d\x04\x00\x00\x8d\x05\x00\x00\xf0\x03\x00\x00\x00\x00\x00\x00\xfe\xff\xff\xff\x03\x06\x00\x00\x00\x00\x00\x00\xc9\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xcf\xff\xff\xff\xd0\xff\xff\xff\x00\x00\x00\x00\xde\x05\x00\x00\xd3\x06\x00\x00\x1e\x07\x00\x00\x69\x07\x00\x00\xb4\x07\x00\x00\xff\x07\x00\x00\x4a\x08\x00\x00\x95\x08\x00\x00\xe0\x08\x00\x00\x2b\x09\x00\x00\x76\x09\x00\x00\xc1\x09\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x68\x04\x00\x00\x0c\x0a\x00\x00\x57\x0a\x00\x00\xa2\x0a\x00\x00\xed\x0a\x00\x00\x38\x0b\x00\x00\x83\x0b\x00\x00\xce\x0b\x00\x00\x19\x0c\x00\x00\x64\x0c\x00\x00\xaf\x0c\x00\x00\xfa\x0c\x00\x00\x45\x0d\x00\x00\x90\x0d\x00\x00\xdb\x0d\x00\x00\x26\x0e\x00\x00\x71\x0e\x00\x00\xbc\x0e\x00\x00\x07\x0f\x00\x00\x52\x0f\x00\x00\x9d\x0f\x00\x00\xe8\x0f\x00\x00\x33\x10\x00\x00\x7e\x10\x00\x00\xc9\x10\x00\x00\x14\x11\x00\x00\x5f\x11\x00\x00\xaa\x11\x00\x00\xf5\x11\x00\x00\x40\x12\x00\x00\x8b\x12\x00\x00\xd6\x12\x00\x00\x21\x13\x00\x00\x6c\x13\x00\x00\xb7\x13\x00\x00\x02\x14\x00\x00"# @@ -380,7 +403,27 @@ alex_action_26 = returnId {-# LINE 1 "templates/GenericTemplate.hs" #-} {-# LINE 1 "templates/GenericTemplate.hs" #-}-{-# LINE 1 "<built-in>" #-}+{-# LINE 1 "<command-line>" #-}+{-# LINE 10 "<command-line>" #-}+{-# LINE 1 "/home/ghc/hp/build/ghc-bindist/local/lib/ghc-7.10.2/include/ghcversion.h" #-}++++++++++++++++++{-# LINE 10 "<command-line>" #-} {-# LINE 1 "templates/GenericTemplate.hs" #-} -- ----------------------------------------------------------------------------- -- ALEX TEMPLATE@@ -391,7 +434,6 @@ -- ----------------------------------------------------------------------------- -- INTERNALS and main scanner engine - {-# LINE 21 "templates/GenericTemplate.hs" #-} @@ -406,7 +448,6 @@ #define GTE(n,m) (n >=# m) #define EQ(n,m) (n ==# m) #endif- {-# LINE 51 "templates/GenericTemplate.hs" #-} @@ -543,7 +584,6 @@ check_accs (AlexAccNone) = last_acc check_accs (AlexAcc a ) = AlexLastAcc a input (I# (len)) check_accs (AlexAccSkip) = AlexLastSkip input (I# (len))- {-# LINE 198 "templates/GenericTemplate.hs" #-} data AlexLastAcc a@@ -560,9 +600,7 @@ = AlexAccNone | AlexAcc a | AlexAccSkip- {-# LINE 242 "templates/GenericTemplate.hs" #-} -- used by wrappers iUnbox (I# (i)) = i-
ewe.cabal view
@@ -2,7 +2,7 @@ -- see http://haskell.org/cabal/users-guide/ name: ewe-version: 0.1.0.43+version: 0.1.0.44 synopsis: An language using in Programming Languages teaching description: Another implemention of the EWE programming language originally created and developed by Kent D. Lee. EWE is an extension of the RAM programming language. RAM was created by Sethi. homepage: http://github.com/jfcmacro/ewe