ewe 0.1.0.44 → 0.1.0.46
raw patch · 5 files changed
+43/−72 lines, 5 files
Files
- dist/build/ewe/ewe-tmp/Language/EWE/Parser.hs +18/−25
- dist/build/ewe/ewe-tmp/Language/EWE/Scanner.hs +18/−42
- ewe.cabal +3/−3
- src/Language/EWE/TokenUtils.hs +2/−0
- src/Language/EWE/VM.hs +2/−2
dist/build/ewe/ewe-tmp/Language/EWE/Parser.hs view
@@ -586,30 +586,11 @@ pEWE s = runAlex s parse {-# LINE 1 "templates/GenericTemplate.hs" #-} {-# LINE 1 "templates/GenericTemplate.hs" #-}-{-# 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 "<built-in>" #-} {-# LINE 1 "templates/GenericTemplate.hs" #-} -- Id: GenericTemplate.hs,v 1.26 2005/01/14 14:47:22 simonmar Exp + {-# LINE 13 "templates/GenericTemplate.hs" #-} @@ -626,6 +607,7 @@ #define GTE(n,m) (n Happy_GHC_Exts.>=# m) #define EQ(n,m) (n Happy_GHC_Exts.==# m) #endif+ {-# LINE 46 "templates/GenericTemplate.hs" #-} @@ -635,12 +617,21 @@ + {-# 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) @@ -667,7 +658,7 @@ happyDoAction i tk st = {- nothing -}-+ case action of 0# -> {- nothing -}@@ -675,11 +666,11 @@ -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#))@@ -713,6 +704,7 @@ ----------------------------------------------------------------------------- -- HappyState data type (not arrays) + {-# LINE 170 "templates/GenericTemplate.hs" #-} -----------------------------------------------------------------------------@@ -877,3 +869,4 @@ {-# NOINLINE happyFail #-} -- end of Happy Template.+
dist/build/ewe/ewe-tmp/Language/EWE/Scanner.hs view
@@ -32,27 +32,7 @@ #endif {-# LINE 1 "templates/wrappers.hs" #-} {-# LINE 1 "templates/wrappers.hs" #-}-{-# 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 "<built-in>" #-} {-# LINE 1 "templates/wrappers.hs" #-} -- ----------------------------------------------------------------------------- -- Alex wrapper code.@@ -62,6 +42,7 @@ import Control.Applicative (Applicative (..)) import Data.Word (Word8)+ {-# LINE 23 "templates/wrappers.hs" #-} import qualified Data.Bits@@ -114,10 +95,13 @@ in p' `seq` Just (b, (p', c, bs, s)) + {-# LINE 93 "templates/wrappers.hs" #-} + {-# LINE 107 "templates/wrappers.hs" #-} + {-# LINE 122 "templates/wrappers.hs" #-} -- -----------------------------------------------------------------------------@@ -258,20 +242,24 @@ -- ----------------------------------------------------------------------------- -- Monad (with ByteString input) + {-# LINE 347 "templates/wrappers.hs" #-} -- ----------------------------------------------------------------------------- -- Basic wrapper + {-# LINE 374 "templates/wrappers.hs" #-} -- ----------------------------------------------------------------------------- -- Basic wrapper, ByteString version + {-# LINE 392 "templates/wrappers.hs" #-} + {-# LINE 406 "templates/wrappers.hs" #-} @@ -280,12 +268,14 @@ -- Adds text positions to the basic model. + {-# LINE 423 "templates/wrappers.hs" #-} -- ----------------------------------------------------------------------------- -- Posn wrapper, ByteString version + {-# LINE 438 "templates/wrappers.hs" #-} @@ -294,6 +284,7 @@ -- 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"# @@ -403,27 +394,7 @@ alex_action_26 = returnId {-# LINE 1 "templates/GenericTemplate.hs" #-} {-# LINE 1 "templates/GenericTemplate.hs" #-}-{-# 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 "<built-in>" #-} {-# LINE 1 "templates/GenericTemplate.hs" #-} -- ----------------------------------------------------------------------------- -- ALEX TEMPLATE@@ -434,6 +405,7 @@ -- ----------------------------------------------------------------------------- -- INTERNALS and main scanner engine + {-# LINE 21 "templates/GenericTemplate.hs" #-} @@ -448,6 +420,7 @@ #define GTE(n,m) (n >=# m) #define EQ(n,m) (n ==# m) #endif+ {-# LINE 51 "templates/GenericTemplate.hs" #-} @@ -584,6 +557,7 @@ 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@@ -600,7 +574,9 @@ = AlexAccNone | AlexAcc a | AlexAccSkip+ {-# LINE 242 "templates/GenericTemplate.hs" #-} -- used by wrappers iUnbox (I# (i)) = i+
ewe.cabal view
@@ -2,9 +2,9 @@ -- see http://haskell.org/cabal/users-guide/ name: ewe-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.+version: 0.1.0.46+synopsis: A language for teaching simple programming languages+description: Another implemention of the EWE programming language originally created and designed by Kent D. Lee. EWE is an extension of the RAM programming language (Ravin Sethi). homepage: http://github.com/jfcmacro/ewe license: BSD3 license-file: LICENSE
src/Language/EWE/TokenUtils.hs view
@@ -20,6 +20,7 @@ ppTkn_ (TknId s) = text "Id:" <+> text s ppTkn_ (TknAssgn) = text "Operator:" <+> text ":=" ppTkn_ (TknColon) = text "Operator:" <+> text ":"+ppTkn_ (TknComma) = text "Separator:" <+> text "," ppTkn_ (TknLPar) = text "Separator:" <+> text "(" ppTkn_ (TknRPar) = text "Separator:" <+> text ")" ppTkn_ (TknLBrk) = text "Separator:" <+> text "["@@ -29,3 +30,4 @@ ppTkn_ (TknResWrd s) = text "Reserved Word:" <+> text s ppTkn_ (TknEOL) = text "<EOL>" ppTkn_ (TknEOF) = text "<EOF>"+-- ppTkn_ last = error ("Token: " ++ (show last))
src/Language/EWE/VM.hs view
@@ -84,7 +84,7 @@ if (hasSideEffects ci) then case (ci) of (IRI _) -> do- i <- lift $ readInt "Enter an integer:"+ i <- lift $ readInt "Enter an integer: " let st'' = execIRI i ci st put st'' evalInstr@@ -94,7 +94,7 @@ put st'' evalInstr (IRS _ _) -> do- s <- lift $ readStr "Enter an string:"+ s <- lift $ readStr "Enter a string: " let st'' = execIRS s ci st put st'' evalInstr