{-# LANGUAGE TypeFamilies, Rank2Types #-}

-- Performs code analysis on the GOOL code
module Drasil.GOOL.CodeInfoProc (CodeInfoProc(..)) where

import Drasil.GOOL.InterfaceCommon (MSBody, SValue, MSStatement, SMethod,
  SharedProg, BodySym(..), BlockSym(..), TypeSym(..), TypeElim(..),
  ScopeSym(..), VariableSym(..), VariableElim(..), ValueSym(..), Argument(..),
  Literal(..), MathConstant(..), VariableValue(..), CommandLineArgs(..),
  NumericExpression(..), BooleanExpression(..), Comparison(..),
  ValueExpression(..), List(..), Set(..), InternalList(..), ThunkSym(..), VectorType(..),
  VectorDecl(..), VectorThunk(..), VectorExpression(..), ThunkAssign(..),
  StatementSym(..), AssignStatement(..), DeclStatement(..), IOStatement(..),
  StringStatement(..), FunctionSym(..), FuncAppStatement(..),
  CommentStatement(..), ControlStatement(..), VisibilitySym(..),
  ParameterSym(..), MethodSym(..))
import Drasil.GOOL.InterfaceProc (ProcProg, ProgramSym(..), FileSym(..),
  ModuleSym(..))
import Drasil.GOOL.CodeType (CodeType(Void))
import Drasil.GOOL.AST (VisibilityTag(..), qualName)
import Drasil.GOOL.CodeAnalysis (ExceptionType(..))
import Drasil.GOOL.Helpers (toCode, toState)
import Drasil.GOOL.State (GOOLState, VS, lensGStoFS, lensFStoMS, lensMStoVS,
  lensVStoFS, modifyReturn, setModuleName, getModuleName, updateClassMap,
  addException, updateMethodExcMap, updateCallMap, addCall, callMapTransClosure,
  updateMEMWithCalls)

import Control.Monad.State (State, modify)
import qualified Control.Monad.State as S (get)
import Control.Lens.Zoom (zoom)
import Data.Maybe (fromMaybe)

newtype CodeInfoProc a = CI {forall a. CodeInfoProc a -> a
unCI :: a} deriving CodeInfoProc a -> CodeInfoProc a -> Bool
(CodeInfoProc a -> CodeInfoProc a -> Bool)
-> (CodeInfoProc a -> CodeInfoProc a -> Bool)
-> Eq (CodeInfoProc a)
forall a. Eq a => CodeInfoProc a -> CodeInfoProc a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall a. Eq a => CodeInfoProc a -> CodeInfoProc a -> Bool
== :: CodeInfoProc a -> CodeInfoProc a -> Bool
$c/= :: forall a. Eq a => CodeInfoProc a -> CodeInfoProc a -> Bool
/= :: CodeInfoProc a -> CodeInfoProc a -> Bool
Eq

-- FIXME: Use DerivingVia language extension (and maybe DeriveFunctor) to 
-- derive the Functor, Applicative, Monad instances for this 
-- (and for JavaCode, PythonCode, etc.)
instance Functor CodeInfoProc where
  fmap :: forall a b. (a -> b) -> CodeInfoProc a -> CodeInfoProc b
fmap a -> b
f (CI a
x) = b -> CodeInfoProc b
forall a. a -> CodeInfoProc a
CI (a -> b
f a
x)

instance Applicative CodeInfoProc where
  pure :: forall a. a -> CodeInfoProc a
pure = a -> CodeInfoProc a
forall a. a -> CodeInfoProc a
CI
  (CI a -> b
f) <*> :: forall a b.
CodeInfoProc (a -> b) -> CodeInfoProc a -> CodeInfoProc b
<*> (CI a
x) = b -> CodeInfoProc b
forall a. a -> CodeInfoProc a
CI (a -> b
f a
x)

instance Monad CodeInfoProc where
  CI a
x >>= :: forall a b.
CodeInfoProc a -> (a -> CodeInfoProc b) -> CodeInfoProc b
>>= a -> CodeInfoProc b
f = a -> CodeInfoProc b
f a
x

instance SharedProg CodeInfoProc

instance ProcProg CodeInfoProc

instance ProgramSym CodeInfoProc where
  type Program CodeInfoProc = GOOLState
  prog :: String -> String -> [SFile CodeInfoProc] -> GSProgram CodeInfoProc
prog String
_ String
_ [SFile CodeInfoProc]
fs = do
    (StateT FileState Identity (CodeInfoProc ())
 -> StateT GOOLState Identity (CodeInfoProc ()))
-> [StateT FileState Identity (CodeInfoProc ())]
-> StateT GOOLState Identity ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ (LensLike'
  (Zoomed (StateT FileState Identity) (CodeInfoProc ()))
  GOOLState
  FileState
-> StateT FileState Identity (CodeInfoProc ())
-> StateT GOOLState Identity (CodeInfoProc ())
forall c.
LensLike'
  (Zoomed (StateT FileState Identity) c) GOOLState FileState
-> StateT FileState Identity c -> StateT GOOLState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT FileState Identity) (CodeInfoProc ()))
  GOOLState
  FileState
(FileState -> Focusing Identity (CodeInfoProc ()) FileState)
-> GOOLState -> Focusing Identity (CodeInfoProc ()) GOOLState
Lens' GOOLState FileState
lensGStoFS) [StateT FileState Identity (CodeInfoProc ())]
[SFile CodeInfoProc]
fs
    (GOOLState -> GOOLState) -> StateT GOOLState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (GOOLState -> GOOLState
updateMEMWithCalls (GOOLState -> GOOLState)
-> (GOOLState -> GOOLState) -> GOOLState -> GOOLState
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GOOLState -> GOOLState
callMapTransClosure)
    GOOLState
s <- StateT GOOLState Identity GOOLState
forall s (m :: * -> *). MonadState s m => m s
S.get
    CodeInfoProc GOOLState -> State GOOLState (CodeInfoProc GOOLState)
forall a s. a -> State s a
toState (CodeInfoProc GOOLState
 -> State GOOLState (CodeInfoProc GOOLState))
-> CodeInfoProc GOOLState
-> State GOOLState (CodeInfoProc GOOLState)
forall a b. (a -> b) -> a -> b
$ GOOLState -> CodeInfoProc GOOLState
forall (r :: * -> *) a. Monad r => a -> r a
toCode GOOLState
s

instance FileSym CodeInfoProc where
  type File CodeInfoProc = ()
  fileDoc :: FSModule CodeInfoProc -> SFile CodeInfoProc
fileDoc = StateT FileState Identity (CodeInfoProc ())
-> StateT FileState Identity (CodeInfoProc ())
FSModule CodeInfoProc -> SFile CodeInfoProc
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1
  
  docMod :: String
-> [String] -> String -> SFile CodeInfoProc -> SFile CodeInfoProc
docMod String
_ [String]
_ String
_ = StateT FileState Identity (CodeInfoProc ())
-> StateT FileState Identity (CodeInfoProc ())
SFile CodeInfoProc -> SFile CodeInfoProc
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1

instance BodySym CodeInfoProc where
  type Body CodeInfoProc = ()
  body :: [MSBlock CodeInfoProc] -> MSBody CodeInfoProc
body = [State MethodState (CodeInfoProc ())]
-> State MethodState (CodeInfoProc ())
[MSBlock CodeInfoProc] -> MSBody CodeInfoProc
forall a. [State a (CodeInfoProc ())] -> State a (CodeInfoProc ())
executeList

  addComments :: String -> MSBody CodeInfoProc -> MSBody CodeInfoProc
addComments String
_ MSBody CodeInfoProc
_ = State MethodState (CodeInfoProc ())
MSBody CodeInfoProc
forall s. State s (CodeInfoProc ())
noInfo

instance BlockSym CodeInfoProc where
  type Block CodeInfoProc = ()
  block :: [MSStatement CodeInfoProc] -> MSBlock CodeInfoProc
block = [State MethodState (CodeInfoProc ())]
-> State MethodState (CodeInfoProc ())
[MSStatement CodeInfoProc] -> MSBlock CodeInfoProc
forall a. [State a (CodeInfoProc ())] -> State a (CodeInfoProc ())
executeList

instance TypeSym CodeInfoProc where
  type Type CodeInfoProc = String
  bool :: VSType CodeInfoProc
bool              = State ValueState (CodeInfoProc String)
VSType CodeInfoProc
forall s. State s (CodeInfoProc String)
noInfoType
  int :: VSType CodeInfoProc
int               = State ValueState (CodeInfoProc String)
VSType CodeInfoProc
forall s. State s (CodeInfoProc String)
noInfoType
  float :: VSType CodeInfoProc
float             = State ValueState (CodeInfoProc String)
VSType CodeInfoProc
forall s. State s (CodeInfoProc String)
noInfoType
  double :: VSType CodeInfoProc
double            = State ValueState (CodeInfoProc String)
VSType CodeInfoProc
forall s. State s (CodeInfoProc String)
noInfoType
  char :: VSType CodeInfoProc
char              = State ValueState (CodeInfoProc String)
VSType CodeInfoProc
forall s. State s (CodeInfoProc String)
noInfoType
  string :: VSType CodeInfoProc
string            = State ValueState (CodeInfoProc String)
VSType CodeInfoProc
forall s. State s (CodeInfoProc String)
noInfoType
  infile :: VSType CodeInfoProc
infile            = State ValueState (CodeInfoProc String)
VSType CodeInfoProc
forall s. State s (CodeInfoProc String)
noInfoType
  outfile :: VSType CodeInfoProc
outfile           = State ValueState (CodeInfoProc String)
VSType CodeInfoProc
forall s. State s (CodeInfoProc String)
noInfoType
  listType :: VSType CodeInfoProc -> VSType CodeInfoProc
listType      VSType CodeInfoProc
_   = State ValueState (CodeInfoProc String)
VSType CodeInfoProc
forall s. State s (CodeInfoProc String)
noInfoType
  setType :: VSType CodeInfoProc -> VSType CodeInfoProc
setType      VSType CodeInfoProc
_   = State ValueState (CodeInfoProc String)
VSType CodeInfoProc
forall s. State s (CodeInfoProc String)
noInfoType
  arrayType :: VSType CodeInfoProc -> VSType CodeInfoProc
arrayType     VSType CodeInfoProc
_   = State ValueState (CodeInfoProc String)
VSType CodeInfoProc
forall s. State s (CodeInfoProc String)
noInfoType
  listInnerType :: VSType CodeInfoProc -> VSType CodeInfoProc
listInnerType VSType CodeInfoProc
_   = State ValueState (CodeInfoProc String)
VSType CodeInfoProc
forall s. State s (CodeInfoProc String)
noInfoType
  funcType :: [VSType CodeInfoProc] -> VSType CodeInfoProc -> VSType CodeInfoProc
funcType      [VSType CodeInfoProc]
_ VSType CodeInfoProc
_ = State ValueState (CodeInfoProc String)
VSType CodeInfoProc
forall s. State s (CodeInfoProc String)
noInfoType
  void :: VSType CodeInfoProc
void              = State ValueState (CodeInfoProc String)
VSType CodeInfoProc
forall s. State s (CodeInfoProc String)
noInfoType

instance TypeElim CodeInfoProc where
  getType :: CodeInfoProc (Type CodeInfoProc) -> CodeType
getType CodeInfoProc (Type CodeInfoProc)
_     = CodeType
Void
  getTypeString :: CodeInfoProc (Type CodeInfoProc) -> String
getTypeString = CodeInfoProc String -> String
CodeInfoProc (Type CodeInfoProc) -> String
forall a. CodeInfoProc a -> a
unCI

instance ScopeSym CodeInfoProc where
  type Scope CodeInfoProc = ()
  global :: CodeInfoProc (Scope CodeInfoProc)
global = () -> CodeInfoProc ()
forall (r :: * -> *) a. Monad r => a -> r a
toCode ()
  mainFn :: CodeInfoProc (Scope CodeInfoProc)
mainFn = () -> CodeInfoProc ()
forall (r :: * -> *) a. Monad r => a -> r a
toCode ()
  local :: CodeInfoProc (Scope CodeInfoProc)
local = () -> CodeInfoProc ()
forall (r :: * -> *) a. Monad r => a -> r a
toCode ()

instance VariableSym CodeInfoProc where
  type Variable CodeInfoProc = ()
  var :: String -> VSType CodeInfoProc -> SVariable CodeInfoProc
var       String
_ VSType CodeInfoProc
_ = State ValueState (CodeInfoProc ())
SVariable CodeInfoProc
forall s. State s (CodeInfoProc ())
noInfo
  constant :: String -> VSType CodeInfoProc -> SVariable CodeInfoProc
constant  String
_ VSType CodeInfoProc
_ = State ValueState (CodeInfoProc ())
SVariable CodeInfoProc
forall s. State s (CodeInfoProc ())
noInfo
  extVar :: String -> String -> VSType CodeInfoProc -> SVariable CodeInfoProc
extVar  String
_ String
_ VSType CodeInfoProc
_ = State ValueState (CodeInfoProc ())
SVariable CodeInfoProc
forall s. State s (CodeInfoProc ())
noInfo
  arrayElem :: Integer -> SVariable CodeInfoProc -> SVariable CodeInfoProc
arrayElem Integer
_ SVariable CodeInfoProc
_ = State ValueState (CodeInfoProc ())
SVariable CodeInfoProc
forall s. State s (CodeInfoProc ())
noInfo

instance VariableElim CodeInfoProc where
  variableName :: CodeInfoProc (Variable CodeInfoProc) -> String
variableName CodeInfoProc (Variable CodeInfoProc)
_ = String
""
  variableType :: CodeInfoProc (Variable CodeInfoProc)
-> CodeInfoProc (Type CodeInfoProc)
variableType CodeInfoProc (Variable CodeInfoProc)
_ = String -> CodeInfoProc String
forall (r :: * -> *) a. Monad r => a -> r a
toCode String
""

instance ValueSym CodeInfoProc where
  type Value CodeInfoProc = ()
  valueType :: CodeInfoProc (Value CodeInfoProc)
-> CodeInfoProc (Type CodeInfoProc)
valueType CodeInfoProc (Value CodeInfoProc)
_ = String -> CodeInfoProc String
forall (r :: * -> *) a. Monad r => a -> r a
toCode String
""

instance Argument CodeInfoProc where
  pointerArg :: SValue CodeInfoProc -> SValue CodeInfoProc
pointerArg = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc
forall a. a -> a
id

instance Literal CodeInfoProc where
  litTrue :: SValue CodeInfoProc
litTrue     = State ValueState (CodeInfoProc ())
SValue CodeInfoProc
forall s. State s (CodeInfoProc ())
noInfo
  litFalse :: SValue CodeInfoProc
litFalse    = State ValueState (CodeInfoProc ())
SValue CodeInfoProc
forall s. State s (CodeInfoProc ())
noInfo
  litChar :: Char -> SValue CodeInfoProc
litChar   Char
_ = State ValueState (CodeInfoProc ())
SValue CodeInfoProc
forall s. State s (CodeInfoProc ())
noInfo
  litDouble :: Double -> SValue CodeInfoProc
litDouble Double
_ = State ValueState (CodeInfoProc ())
SValue CodeInfoProc
forall s. State s (CodeInfoProc ())
noInfo
  litFloat :: Float -> SValue CodeInfoProc
litFloat  Float
_ = State ValueState (CodeInfoProc ())
SValue CodeInfoProc
forall s. State s (CodeInfoProc ())
noInfo
  litInt :: Integer -> SValue CodeInfoProc
litInt    Integer
_ = State ValueState (CodeInfoProc ())
SValue CodeInfoProc
forall s. State s (CodeInfoProc ())
noInfo
  litString :: String -> SValue CodeInfoProc
litString String
_ = State ValueState (CodeInfoProc ())
SValue CodeInfoProc
forall s. State s (CodeInfoProc ())
noInfo
  litArray :: VSType CodeInfoProc -> [SValue CodeInfoProc] -> SValue CodeInfoProc
litArray  VSType CodeInfoProc
_ = [State ValueState (CodeInfoProc ())]
-> State ValueState (CodeInfoProc ())
[SValue CodeInfoProc] -> SValue CodeInfoProc
forall a. [State a (CodeInfoProc ())] -> State a (CodeInfoProc ())
executeList
  litList :: VSType CodeInfoProc -> [SValue CodeInfoProc] -> SValue CodeInfoProc
litList   VSType CodeInfoProc
_ = [State ValueState (CodeInfoProc ())]
-> State ValueState (CodeInfoProc ())
[SValue CodeInfoProc] -> SValue CodeInfoProc
forall a. [State a (CodeInfoProc ())] -> State a (CodeInfoProc ())
executeList
  litSet :: VSType CodeInfoProc -> [SValue CodeInfoProc] -> SValue CodeInfoProc
litSet   VSType CodeInfoProc
_ = [State ValueState (CodeInfoProc ())]
-> State ValueState (CodeInfoProc ())
[SValue CodeInfoProc] -> SValue CodeInfoProc
forall a. [State a (CodeInfoProc ())] -> State a (CodeInfoProc ())
executeList

instance MathConstant CodeInfoProc where
  pi :: SValue CodeInfoProc
pi = State ValueState (CodeInfoProc ())
SValue CodeInfoProc
forall s. State s (CodeInfoProc ())
noInfo

instance VariableValue CodeInfoProc where
  valueOf :: SVariable CodeInfoProc -> SValue CodeInfoProc
valueOf SVariable CodeInfoProc
_ = State ValueState (CodeInfoProc ())
SValue CodeInfoProc
forall s. State s (CodeInfoProc ())
noInfo

instance CommandLineArgs CodeInfoProc where
  arg :: Integer -> SValue CodeInfoProc
arg       Integer
_ = State ValueState (CodeInfoProc ())
SValue CodeInfoProc
forall s. State s (CodeInfoProc ())
noInfo
  argsList :: SValue CodeInfoProc
argsList    = State ValueState (CodeInfoProc ())
SValue CodeInfoProc
forall s. State s (CodeInfoProc ())
noInfo
  argExists :: Integer -> SValue CodeInfoProc
argExists Integer
_ = State ValueState (CodeInfoProc ())
SValue CodeInfoProc
forall s. State s (CodeInfoProc ())
noInfo

instance NumericExpression CodeInfoProc where
  #~ :: SValue CodeInfoProc -> SValue CodeInfoProc
(#~)  = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1
  #/^ :: SValue CodeInfoProc -> SValue CodeInfoProc
(#/^) = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1
  #| :: SValue CodeInfoProc -> SValue CodeInfoProc
(#|)  = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1
  #+ :: SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
(#+)  = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute2
  #- :: SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
(#-)  = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute2
  #* :: SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
(#*)  = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute2
  #/ :: SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
(#/)  = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute2
  #% :: SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
(#%)  = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute2
  #^ :: SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
(#^)  = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute2

  log :: SValue CodeInfoProc -> SValue CodeInfoProc
log    = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1
  ln :: SValue CodeInfoProc -> SValue CodeInfoProc
ln     = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1
  exp :: SValue CodeInfoProc -> SValue CodeInfoProc
exp    = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1
  sin :: SValue CodeInfoProc -> SValue CodeInfoProc
sin    = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1
  cos :: SValue CodeInfoProc -> SValue CodeInfoProc
cos    = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1
  tan :: SValue CodeInfoProc -> SValue CodeInfoProc
tan    = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1
  csc :: SValue CodeInfoProc -> SValue CodeInfoProc
csc    = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1
  sec :: SValue CodeInfoProc -> SValue CodeInfoProc
sec    = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1
  cot :: SValue CodeInfoProc -> SValue CodeInfoProc
cot    = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1
  arcsin :: SValue CodeInfoProc -> SValue CodeInfoProc
arcsin = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1
  arccos :: SValue CodeInfoProc -> SValue CodeInfoProc
arccos = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1
  arctan :: SValue CodeInfoProc -> SValue CodeInfoProc
arctan = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1
  floor :: SValue CodeInfoProc -> SValue CodeInfoProc
floor  = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1
  ceil :: SValue CodeInfoProc -> SValue CodeInfoProc
ceil   = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1

instance BooleanExpression CodeInfoProc where
  ?! :: SValue CodeInfoProc -> SValue CodeInfoProc
(?!)  = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1
  ?&& :: SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
(?&&) = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute2
  ?|| :: SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
(?||) = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute2

instance Comparison CodeInfoProc where
  ?< :: SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
(?<)  = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute2
  ?<= :: SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
(?<=) = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute2
  ?> :: SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
(?>)  = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute2
  ?>= :: SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
(?>=) = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute2
  ?== :: SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
(?==) = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute2
  ?!= :: SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
(?!=) = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute2
    
instance ValueExpression CodeInfoProc where
  inlineIf :: SValue CodeInfoProc
-> SValue CodeInfoProc
-> SValue CodeInfoProc
-> SValue CodeInfoProc
inlineIf = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc
-> SValue CodeInfoProc
-> SValue CodeInfoProc
-> SValue CodeInfoProc
forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ())
-> State a (CodeInfoProc ())
-> State a (CodeInfoProc ())
execute3
  funcAppMixedArgs :: MixedCall CodeInfoProc
funcAppMixedArgs String
n VSType CodeInfoProc
_ = String
-> [State ValueState (CodeInfoProc ())]
-> [(State ValueState (CodeInfoProc ()),
     State ValueState (CodeInfoProc ()))]
-> State ValueState (CodeInfoProc ())
currModCall String
n
  extFuncAppMixedArgs :: String -> MixedCall CodeInfoProc
extFuncAppMixedArgs String
l String
n VSType CodeInfoProc
_ [SValue CodeInfoProc]
vs [(SVariable CodeInfoProc, SValue CodeInfoProc)]
ns = do
    [State ValueState (CodeInfoProc ())]
-> StateT ValueState Identity ()
forall (t :: * -> *) (m :: * -> *) a.
(Foldable t, Monad m) =>
t (m a) -> m ()
sequence_ [State ValueState (CodeInfoProc ())]
[SValue CodeInfoProc]
vs
    [(State ValueState (CodeInfoProc ()),
  State ValueState (CodeInfoProc ()))]
-> State ValueState (CodeInfoProc ())
forall a.
[(State a (CodeInfoProc ()), State a (CodeInfoProc ()))]
-> State a (CodeInfoProc ())
executePairList [(State ValueState (CodeInfoProc ()),
  State ValueState (CodeInfoProc ()))]
[(SVariable CodeInfoProc, SValue CodeInfoProc)]
ns
    String -> String -> SValue CodeInfoProc
addExternalCall String
l String
n  
  libFuncAppMixedArgs :: String -> MixedCall CodeInfoProc
libFuncAppMixedArgs = String -> MixedCall CodeInfoProc
forall (r :: * -> *). ValueExpression r => String -> MixedCall r
extFuncAppMixedArgs

  lambda :: [SVariable CodeInfoProc]
-> SValue CodeInfoProc -> SValue CodeInfoProc
lambda [SVariable CodeInfoProc]
_ = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1

  notNull :: SValue CodeInfoProc -> SValue CodeInfoProc
notNull = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1

instance FunctionSym CodeInfoProc where
  type Function CodeInfoProc = ()

instance List CodeInfoProc where
  intToIndex :: SValue CodeInfoProc -> SValue CodeInfoProc
intToIndex = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1
  indexToInt :: SValue CodeInfoProc -> SValue CodeInfoProc
indexToInt = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1
  listSize :: SValue CodeInfoProc -> SValue CodeInfoProc
listSize   = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1
  listAdd :: SValue CodeInfoProc
-> SValue CodeInfoProc
-> SValue CodeInfoProc
-> SValue CodeInfoProc
listAdd    = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc
-> SValue CodeInfoProc
-> SValue CodeInfoProc
-> SValue CodeInfoProc
forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ())
-> State a (CodeInfoProc ())
-> State a (CodeInfoProc ())
execute3
  listAppend :: SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
listAppend = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute2
  listAccess :: SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
listAccess = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute2
  listSet :: SValue CodeInfoProc
-> SValue CodeInfoProc
-> SValue CodeInfoProc
-> SValue CodeInfoProc
listSet    = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc
-> SValue CodeInfoProc
-> SValue CodeInfoProc
-> SValue CodeInfoProc
forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ())
-> State a (CodeInfoProc ())
-> State a (CodeInfoProc ())
execute3
  indexOf :: SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
indexOf    = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute2

instance Set CodeInfoProc where
 contains :: SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
contains = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute2
 setAdd :: SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
setAdd = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute2
 setRemove :: SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
setRemove = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute2
 setUnion :: SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
setUnion = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> SValue CodeInfoProc -> SValue CodeInfoProc
forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute2

instance InternalList CodeInfoProc where
  listSlice' :: Maybe (SValue CodeInfoProc)
-> Maybe (SValue CodeInfoProc)
-> Maybe (SValue CodeInfoProc)
-> SVariable CodeInfoProc
-> SValue CodeInfoProc
-> MSBlock CodeInfoProc
listSlice' Maybe (SValue CodeInfoProc)
b Maybe (SValue CodeInfoProc)
e Maybe (SValue CodeInfoProc)
s SVariable CodeInfoProc
_ SValue CodeInfoProc
vl = LensLike'
  (Zoomed
     (StateT ValueState Identity) (CodeInfoProc (Block CodeInfoProc)))
  MethodState
  ValueState
-> StateT ValueState Identity (CodeInfoProc (Block CodeInfoProc))
-> MSBlock CodeInfoProc
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed
     (StateT ValueState Identity) (CodeInfoProc (Block CodeInfoProc)))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS (StateT ValueState Identity (CodeInfoProc (Block CodeInfoProc))
 -> MSBlock CodeInfoProc)
-> StateT ValueState Identity (CodeInfoProc (Block CodeInfoProc))
-> MSBlock CodeInfoProc
forall a b. (a -> b) -> a -> b
$ do
    (Maybe (State ValueState (CodeInfoProc ()))
 -> State ValueState (CodeInfoProc ()))
-> [Maybe (State ValueState (CodeInfoProc ()))]
-> StateT ValueState Identity ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ (State ValueState (CodeInfoProc ())
-> Maybe (State ValueState (CodeInfoProc ()))
-> State ValueState (CodeInfoProc ())
forall a. a -> Maybe a -> a
fromMaybe State ValueState (CodeInfoProc ())
forall s. State s (CodeInfoProc ())
noInfo) [Maybe (State ValueState (CodeInfoProc ()))
Maybe (SValue CodeInfoProc)
b,Maybe (State ValueState (CodeInfoProc ()))
Maybe (SValue CodeInfoProc)
e,Maybe (State ValueState (CodeInfoProc ()))
Maybe (SValue CodeInfoProc)
s]
    CodeInfoProc ()
_ <- State ValueState (CodeInfoProc ())
SValue CodeInfoProc
vl
    State ValueState (CodeInfoProc ())
forall s. State s (CodeInfoProc ())
noInfo

instance ThunkSym CodeInfoProc where
  type Thunk CodeInfoProc = ()

instance ThunkAssign CodeInfoProc where
  thunkAssign :: SVariable CodeInfoProc
-> VSThunk CodeInfoProc -> MSStatement CodeInfoProc
thunkAssign SVariable CodeInfoProc
_ = LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS (State ValueState (CodeInfoProc ())
 -> State MethodState (CodeInfoProc ()))
-> (State ValueState (CodeInfoProc ())
    -> State ValueState (CodeInfoProc ()))
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1

instance VectorType CodeInfoProc where
  vecType :: VSType CodeInfoProc -> VSType CodeInfoProc
vecType VSType CodeInfoProc
_ = State ValueState (CodeInfoProc String)
VSType CodeInfoProc
forall s. State s (CodeInfoProc String)
noInfoType

instance VectorDecl CodeInfoProc where
  vecDec :: Integer
-> SVariable CodeInfoProc
-> CodeInfoProc (Scope CodeInfoProc)
-> MSStatement CodeInfoProc
vecDec  Integer
_ SVariable CodeInfoProc
_ CodeInfoProc (Scope CodeInfoProc)
_ = State MethodState (CodeInfoProc ())
MSStatement CodeInfoProc
forall s. State s (CodeInfoProc ())
noInfo
  vecDecDef :: SVariable CodeInfoProc
-> CodeInfoProc (Scope CodeInfoProc)
-> [SValue CodeInfoProc]
-> MSStatement CodeInfoProc
vecDecDef SVariable CodeInfoProc
_ CodeInfoProc (Scope CodeInfoProc)
_ = LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS (State ValueState (CodeInfoProc ())
 -> State MethodState (CodeInfoProc ()))
-> ([State ValueState (CodeInfoProc ())]
    -> State ValueState (CodeInfoProc ()))
-> [State ValueState (CodeInfoProc ())]
-> State MethodState (CodeInfoProc ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [State ValueState (CodeInfoProc ())]
-> State ValueState (CodeInfoProc ())
forall a. [State a (CodeInfoProc ())] -> State a (CodeInfoProc ())
executeList

instance VectorThunk CodeInfoProc where
  vecThunk :: SVariable CodeInfoProc -> VSThunk CodeInfoProc
vecThunk SVariable CodeInfoProc
_ = State ValueState (CodeInfoProc ())
VSThunk CodeInfoProc
forall s. State s (CodeInfoProc ())
noInfo

instance VectorExpression CodeInfoProc where
  vecScale :: SValue CodeInfoProc -> VSThunk CodeInfoProc -> VSThunk CodeInfoProc
vecScale = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> VSThunk CodeInfoProc -> VSThunk CodeInfoProc
forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute2
  vecAdd :: VSThunk CodeInfoProc
-> VSThunk CodeInfoProc -> VSThunk CodeInfoProc
vecAdd = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
VSThunk CodeInfoProc
-> VSThunk CodeInfoProc -> VSThunk CodeInfoProc
forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute2
  vecIndex :: SValue CodeInfoProc -> VSThunk CodeInfoProc -> SValue CodeInfoProc
vecIndex = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
SValue CodeInfoProc -> VSThunk CodeInfoProc -> SValue CodeInfoProc
forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute2
  vecDot :: VSThunk CodeInfoProc
-> VSThunk CodeInfoProc -> VSThunk CodeInfoProc
vecDot = State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
VSThunk CodeInfoProc
-> VSThunk CodeInfoProc -> VSThunk CodeInfoProc
forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute2

instance StatementSym CodeInfoProc where
  type Statement CodeInfoProc = ()
  valStmt :: SValue CodeInfoProc -> MSStatement CodeInfoProc
valStmt = LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS (State ValueState (CodeInfoProc ())
 -> State MethodState (CodeInfoProc ()))
-> (State ValueState (CodeInfoProc ())
    -> State ValueState (CodeInfoProc ()))
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1
  emptyStmt :: MSStatement CodeInfoProc
emptyStmt = State MethodState (CodeInfoProc ())
MSStatement CodeInfoProc
forall s. State s (CodeInfoProc ())
noInfo
  multi :: [MSStatement CodeInfoProc] -> MSStatement CodeInfoProc
multi    = [State MethodState (CodeInfoProc ())]
-> State MethodState (CodeInfoProc ())
[MSStatement CodeInfoProc] -> MSStatement CodeInfoProc
forall a. [State a (CodeInfoProc ())] -> State a (CodeInfoProc ())
executeList
  
instance AssignStatement CodeInfoProc where
  assign :: SVariable CodeInfoProc
-> SValue CodeInfoProc -> MSStatement CodeInfoProc
assign SVariable CodeInfoProc
_ = LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS (State ValueState (CodeInfoProc ())
 -> State MethodState (CodeInfoProc ()))
-> (State ValueState (CodeInfoProc ())
    -> State ValueState (CodeInfoProc ()))
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1
  &-= :: SVariable CodeInfoProc
-> SValue CodeInfoProc -> MSStatement CodeInfoProc
(&-=)  SVariable CodeInfoProc
_ = LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS (State ValueState (CodeInfoProc ())
 -> State MethodState (CodeInfoProc ()))
-> (State ValueState (CodeInfoProc ())
    -> State ValueState (CodeInfoProc ()))
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1
  &+= :: SVariable CodeInfoProc
-> SValue CodeInfoProc -> MSStatement CodeInfoProc
(&+=)  SVariable CodeInfoProc
_ = LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS (State ValueState (CodeInfoProc ())
 -> State MethodState (CodeInfoProc ()))
-> (State ValueState (CodeInfoProc ())
    -> State ValueState (CodeInfoProc ()))
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1
  &++ :: SVariable CodeInfoProc -> MSStatement CodeInfoProc
(&++)  SVariable CodeInfoProc
_ = State MethodState (CodeInfoProc ())
MSStatement CodeInfoProc
forall s. State s (CodeInfoProc ())
noInfo
  &-- :: SVariable CodeInfoProc -> MSStatement CodeInfoProc
(&--)  SVariable CodeInfoProc
_ = State MethodState (CodeInfoProc ())
MSStatement CodeInfoProc
forall s. State s (CodeInfoProc ())
noInfo

instance DeclStatement CodeInfoProc where
  varDec :: SVariable CodeInfoProc
-> CodeInfoProc (Scope CodeInfoProc) -> MSStatement CodeInfoProc
varDec               SVariable CodeInfoProc
_ CodeInfoProc (Scope CodeInfoProc)
_ = State MethodState (CodeInfoProc ())
MSStatement CodeInfoProc
forall s. State s (CodeInfoProc ())
noInfo
  varDecDef :: SVariable CodeInfoProc
-> CodeInfoProc (Scope CodeInfoProc)
-> SValue CodeInfoProc
-> MSStatement CodeInfoProc
varDecDef            SVariable CodeInfoProc
_ CodeInfoProc (Scope CodeInfoProc)
_ = LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS (State ValueState (CodeInfoProc ())
 -> State MethodState (CodeInfoProc ()))
-> (State ValueState (CodeInfoProc ())
    -> State ValueState (CodeInfoProc ()))
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1
  setDec :: SVariable CodeInfoProc
-> CodeInfoProc (Scope CodeInfoProc) -> MSStatement CodeInfoProc
setDec               SVariable CodeInfoProc
_ CodeInfoProc (Scope CodeInfoProc)
_ = State MethodState (CodeInfoProc ())
MSStatement CodeInfoProc
forall s. State s (CodeInfoProc ())
noInfo
  setDecDef :: SVariable CodeInfoProc
-> CodeInfoProc (Scope CodeInfoProc)
-> SValue CodeInfoProc
-> MSStatement CodeInfoProc
setDecDef            SVariable CodeInfoProc
_ CodeInfoProc (Scope CodeInfoProc)
_ = LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS (State ValueState (CodeInfoProc ())
 -> State MethodState (CodeInfoProc ()))
-> (State ValueState (CodeInfoProc ())
    -> State ValueState (CodeInfoProc ()))
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1
  listDec :: Integer
-> SVariable CodeInfoProc
-> CodeInfoProc (Scope CodeInfoProc)
-> MSStatement CodeInfoProc
listDec            Integer
_ SVariable CodeInfoProc
_ CodeInfoProc (Scope CodeInfoProc)
_ = State MethodState (CodeInfoProc ())
MSStatement CodeInfoProc
forall s. State s (CodeInfoProc ())
noInfo
  listDecDef :: SVariable CodeInfoProc
-> CodeInfoProc (Scope CodeInfoProc)
-> [SValue CodeInfoProc]
-> MSStatement CodeInfoProc
listDecDef           SVariable CodeInfoProc
_ CodeInfoProc (Scope CodeInfoProc)
_ = LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS (State ValueState (CodeInfoProc ())
 -> State MethodState (CodeInfoProc ()))
-> ([State ValueState (CodeInfoProc ())]
    -> State ValueState (CodeInfoProc ()))
-> [State ValueState (CodeInfoProc ())]
-> State MethodState (CodeInfoProc ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [State ValueState (CodeInfoProc ())]
-> State ValueState (CodeInfoProc ())
forall a. [State a (CodeInfoProc ())] -> State a (CodeInfoProc ())
executeList
  arrayDec :: Integer
-> SVariable CodeInfoProc
-> CodeInfoProc (Scope CodeInfoProc)
-> MSStatement CodeInfoProc
arrayDec           Integer
_ SVariable CodeInfoProc
_ CodeInfoProc (Scope CodeInfoProc)
_ = State MethodState (CodeInfoProc ())
MSStatement CodeInfoProc
forall s. State s (CodeInfoProc ())
noInfo
  arrayDecDef :: SVariable CodeInfoProc
-> CodeInfoProc (Scope CodeInfoProc)
-> [SValue CodeInfoProc]
-> MSStatement CodeInfoProc
arrayDecDef          SVariable CodeInfoProc
_ CodeInfoProc (Scope CodeInfoProc)
_ = LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS (State ValueState (CodeInfoProc ())
 -> State MethodState (CodeInfoProc ()))
-> ([State ValueState (CodeInfoProc ())]
    -> State ValueState (CodeInfoProc ()))
-> [State ValueState (CodeInfoProc ())]
-> State MethodState (CodeInfoProc ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [State ValueState (CodeInfoProc ())]
-> State ValueState (CodeInfoProc ())
forall a. [State a (CodeInfoProc ())] -> State a (CodeInfoProc ())
executeList
  constDecDef :: SVariable CodeInfoProc
-> CodeInfoProc (Scope CodeInfoProc)
-> SValue CodeInfoProc
-> MSStatement CodeInfoProc
constDecDef          SVariable CodeInfoProc
_ CodeInfoProc (Scope CodeInfoProc)
_ = LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS (State ValueState (CodeInfoProc ())
 -> State MethodState (CodeInfoProc ()))
-> (State ValueState (CodeInfoProc ())
    -> State ValueState (CodeInfoProc ()))
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1
  funcDecDef :: SVariable CodeInfoProc
-> CodeInfoProc (Scope CodeInfoProc)
-> [SVariable CodeInfoProc]
-> MSBody CodeInfoProc
-> MSStatement CodeInfoProc
funcDecDef         SVariable CodeInfoProc
_ CodeInfoProc (Scope CodeInfoProc)
_ [SVariable CodeInfoProc]
_ = State MethodState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
MSBody CodeInfoProc -> MSStatement CodeInfoProc
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1

instance IOStatement CodeInfoProc where
  print :: SValue CodeInfoProc -> MSStatement CodeInfoProc
print        = LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS (State ValueState (CodeInfoProc ())
 -> State MethodState (CodeInfoProc ()))
-> (State ValueState (CodeInfoProc ())
    -> State ValueState (CodeInfoProc ()))
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1
  printLn :: SValue CodeInfoProc -> MSStatement CodeInfoProc
printLn      = LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS (State ValueState (CodeInfoProc ())
 -> State MethodState (CodeInfoProc ()))
-> (State ValueState (CodeInfoProc ())
    -> State ValueState (CodeInfoProc ()))
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1
  printStr :: String -> MSStatement CodeInfoProc
printStr   String
_ = State MethodState (CodeInfoProc ())
MSStatement CodeInfoProc
forall s. State s (CodeInfoProc ())
noInfo
  printStrLn :: String -> MSStatement CodeInfoProc
printStrLn String
_ = State MethodState (CodeInfoProc ())
MSStatement CodeInfoProc
forall s. State s (CodeInfoProc ())
noInfo

  printFile :: SValue CodeInfoProc
-> SValue CodeInfoProc -> MSStatement CodeInfoProc
printFile      SValue CodeInfoProc
v   = LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS (State ValueState (CodeInfoProc ())
 -> State MethodState (CodeInfoProc ()))
-> (State ValueState (CodeInfoProc ())
    -> State ValueState (CodeInfoProc ()))
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute2 State ValueState (CodeInfoProc ())
SValue CodeInfoProc
v
  printFileLn :: SValue CodeInfoProc
-> SValue CodeInfoProc -> MSStatement CodeInfoProc
printFileLn    SValue CodeInfoProc
v   = LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS (State ValueState (CodeInfoProc ())
 -> State MethodState (CodeInfoProc ()))
-> (State ValueState (CodeInfoProc ())
    -> State ValueState (CodeInfoProc ()))
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute2 State ValueState (CodeInfoProc ())
SValue CodeInfoProc
v
  printFileStr :: SValue CodeInfoProc -> String -> MSStatement CodeInfoProc
printFileStr   SValue CodeInfoProc
v String
_ = LensLike'
  (Zoomed
     (StateT ValueState Identity)
     (CodeInfoProc (Statement CodeInfoProc)))
  MethodState
  ValueState
-> StateT
     ValueState Identity (CodeInfoProc (Statement CodeInfoProc))
-> MSStatement CodeInfoProc
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed
     (StateT ValueState Identity)
     (CodeInfoProc (Statement CodeInfoProc)))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS (StateT ValueState Identity (CodeInfoProc (Statement CodeInfoProc))
 -> MSStatement CodeInfoProc)
-> StateT
     ValueState Identity (CodeInfoProc (Statement CodeInfoProc))
-> MSStatement CodeInfoProc
forall a b. (a -> b) -> a -> b
$ State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1 State ValueState (CodeInfoProc ())
SValue CodeInfoProc
v
  printFileStrLn :: SValue CodeInfoProc -> String -> MSStatement CodeInfoProc
printFileStrLn SValue CodeInfoProc
v String
_ = LensLike'
  (Zoomed
     (StateT ValueState Identity)
     (CodeInfoProc (Statement CodeInfoProc)))
  MethodState
  ValueState
-> StateT
     ValueState Identity (CodeInfoProc (Statement CodeInfoProc))
-> MSStatement CodeInfoProc
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed
     (StateT ValueState Identity)
     (CodeInfoProc (Statement CodeInfoProc)))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS (StateT ValueState Identity (CodeInfoProc (Statement CodeInfoProc))
 -> MSStatement CodeInfoProc)
-> StateT
     ValueState Identity (CodeInfoProc (Statement CodeInfoProc))
-> MSStatement CodeInfoProc
forall a b. (a -> b) -> a -> b
$ State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1 State ValueState (CodeInfoProc ())
SValue CodeInfoProc
v

  getInput :: SVariable CodeInfoProc -> MSStatement CodeInfoProc
getInput       SVariable CodeInfoProc
_ = State MethodState (CodeInfoProc ())
MSStatement CodeInfoProc
forall s. State s (CodeInfoProc ())
noInfo
  discardInput :: MSStatement CodeInfoProc
discardInput     = State MethodState (CodeInfoProc ())
MSStatement CodeInfoProc
forall s. State s (CodeInfoProc ())
noInfo
  getFileInput :: SValue CodeInfoProc
-> SVariable CodeInfoProc -> MSStatement CodeInfoProc
getFileInput SValue CodeInfoProc
v SVariable CodeInfoProc
_ = LensLike'
  (Zoomed
     (StateT ValueState Identity)
     (CodeInfoProc (Statement CodeInfoProc)))
  MethodState
  ValueState
-> StateT
     ValueState Identity (CodeInfoProc (Statement CodeInfoProc))
-> MSStatement CodeInfoProc
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed
     (StateT ValueState Identity)
     (CodeInfoProc (Statement CodeInfoProc)))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS (StateT ValueState Identity (CodeInfoProc (Statement CodeInfoProc))
 -> MSStatement CodeInfoProc)
-> StateT
     ValueState Identity (CodeInfoProc (Statement CodeInfoProc))
-> MSStatement CodeInfoProc
forall a b. (a -> b) -> a -> b
$ State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1 State ValueState (CodeInfoProc ())
SValue CodeInfoProc
v
  discardFileInput :: SValue CodeInfoProc -> MSStatement CodeInfoProc
discardFileInput = LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS (State ValueState (CodeInfoProc ())
 -> State MethodState (CodeInfoProc ()))
-> (State ValueState (CodeInfoProc ())
    -> State ValueState (CodeInfoProc ()))
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1

  openFileR :: SVariable CodeInfoProc
-> SValue CodeInfoProc -> MSStatement CodeInfoProc
openFileR SVariable CodeInfoProc
_ SValue CodeInfoProc
v = (MethodState -> MethodState) -> StateT MethodState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ExceptionType -> MethodState -> MethodState
addException ExceptionType
FileNotFound) StateT MethodState Identity ()
-> State MethodState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall a b.
StateT MethodState Identity a
-> StateT MethodState Identity b -> StateT MethodState Identity b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> 
    State MethodState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1 (LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS State ValueState (CodeInfoProc ())
SValue CodeInfoProc
v)
  openFileW :: SVariable CodeInfoProc
-> SValue CodeInfoProc -> MSStatement CodeInfoProc
openFileW SVariable CodeInfoProc
_ SValue CodeInfoProc
v = (MethodState -> MethodState) -> StateT MethodState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ExceptionType -> MethodState -> MethodState
addException ExceptionType
IO) StateT MethodState Identity ()
-> State MethodState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall a b.
StateT MethodState Identity a
-> StateT MethodState Identity b -> StateT MethodState Identity b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> State MethodState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1 (LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS State ValueState (CodeInfoProc ())
SValue CodeInfoProc
v)
  openFileA :: SVariable CodeInfoProc
-> SValue CodeInfoProc -> MSStatement CodeInfoProc
openFileA SVariable CodeInfoProc
_ SValue CodeInfoProc
v = (MethodState -> MethodState) -> StateT MethodState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ExceptionType -> MethodState -> MethodState
addException ExceptionType
IO) StateT MethodState Identity ()
-> State MethodState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall a b.
StateT MethodState Identity a
-> StateT MethodState Identity b -> StateT MethodState Identity b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> State MethodState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1 (LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS State ValueState (CodeInfoProc ())
SValue CodeInfoProc
v)
  closeFile :: SValue CodeInfoProc -> MSStatement CodeInfoProc
closeFile     = LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS (State ValueState (CodeInfoProc ())
 -> State MethodState (CodeInfoProc ()))
-> (State ValueState (CodeInfoProc ())
    -> State ValueState (CodeInfoProc ()))
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1

  getFileInputLine :: SValue CodeInfoProc
-> SVariable CodeInfoProc -> MSStatement CodeInfoProc
getFileInputLine SValue CodeInfoProc
v SVariable CodeInfoProc
_ = LensLike'
  (Zoomed
     (StateT ValueState Identity)
     (CodeInfoProc (Statement CodeInfoProc)))
  MethodState
  ValueState
-> StateT
     ValueState Identity (CodeInfoProc (Statement CodeInfoProc))
-> MSStatement CodeInfoProc
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed
     (StateT ValueState Identity)
     (CodeInfoProc (Statement CodeInfoProc)))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS (StateT ValueState Identity (CodeInfoProc (Statement CodeInfoProc))
 -> MSStatement CodeInfoProc)
-> StateT
     ValueState Identity (CodeInfoProc (Statement CodeInfoProc))
-> MSStatement CodeInfoProc
forall a b. (a -> b) -> a -> b
$ State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1 State ValueState (CodeInfoProc ())
SValue CodeInfoProc
v
  discardFileLine :: SValue CodeInfoProc -> MSStatement CodeInfoProc
discardFileLine      = LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS (State ValueState (CodeInfoProc ())
 -> State MethodState (CodeInfoProc ()))
-> (State ValueState (CodeInfoProc ())
    -> State ValueState (CodeInfoProc ()))
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1
  getFileInputAll :: SValue CodeInfoProc
-> SVariable CodeInfoProc -> MSStatement CodeInfoProc
getFileInputAll  SValue CodeInfoProc
v SVariable CodeInfoProc
_ = State MethodState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1 (LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS State ValueState (CodeInfoProc ())
SValue CodeInfoProc
v)

instance StringStatement CodeInfoProc where
  stringSplit :: Char
-> SVariable CodeInfoProc
-> SValue CodeInfoProc
-> MSStatement CodeInfoProc
stringSplit Char
_ SVariable CodeInfoProc
_ = LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS (State ValueState (CodeInfoProc ())
 -> State MethodState (CodeInfoProc ()))
-> (State ValueState (CodeInfoProc ())
    -> State ValueState (CodeInfoProc ()))
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1

  stringListVals :: [SVariable CodeInfoProc]
-> SValue CodeInfoProc -> MSStatement CodeInfoProc
stringListVals  [SVariable CodeInfoProc]
_ = LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS (State ValueState (CodeInfoProc ())
 -> State MethodState (CodeInfoProc ()))
-> (State ValueState (CodeInfoProc ())
    -> State ValueState (CodeInfoProc ()))
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1
  stringListLists :: [SVariable CodeInfoProc]
-> SValue CodeInfoProc -> MSStatement CodeInfoProc
stringListLists [SVariable CodeInfoProc]
_ = LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS (State ValueState (CodeInfoProc ())
 -> State MethodState (CodeInfoProc ()))
-> (State ValueState (CodeInfoProc ())
    -> State ValueState (CodeInfoProc ()))
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1

instance FuncAppStatement CodeInfoProc where
  inOutCall :: InOutCall CodeInfoProc
inOutCall String
n [SValue CodeInfoProc]
vs [SVariable CodeInfoProc]
_ [SVariable CodeInfoProc]
_ = LensLike'
  (Zoomed
     (StateT ValueState Identity)
     (CodeInfoProc (Statement CodeInfoProc)))
  MethodState
  ValueState
-> StateT
     ValueState Identity (CodeInfoProc (Statement CodeInfoProc))
-> MSStatement CodeInfoProc
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed
     (StateT ValueState Identity)
     (CodeInfoProc (Statement CodeInfoProc)))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS (StateT ValueState Identity (CodeInfoProc (Statement CodeInfoProc))
 -> MSStatement CodeInfoProc)
-> StateT
     ValueState Identity (CodeInfoProc (Statement CodeInfoProc))
-> MSStatement CodeInfoProc
forall a b. (a -> b) -> a -> b
$ do
    [State ValueState (CodeInfoProc ())]
-> StateT ValueState Identity ()
forall (t :: * -> *) (m :: * -> *) a.
(Foldable t, Monad m) =>
t (m a) -> m ()
sequence_ [State ValueState (CodeInfoProc ())]
[SValue CodeInfoProc]
vs
    String -> SValue CodeInfoProc
addCurrModCall String
n
  extInOutCall :: String -> InOutCall CodeInfoProc
extInOutCall String
l String
n [SValue CodeInfoProc]
vs [SVariable CodeInfoProc]
_ [SVariable CodeInfoProc]
_ = LensLike'
  (Zoomed
     (StateT ValueState Identity)
     (CodeInfoProc (Statement CodeInfoProc)))
  MethodState
  ValueState
-> StateT
     ValueState Identity (CodeInfoProc (Statement CodeInfoProc))
-> MSStatement CodeInfoProc
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed
     (StateT ValueState Identity)
     (CodeInfoProc (Statement CodeInfoProc)))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS (StateT ValueState Identity (CodeInfoProc (Statement CodeInfoProc))
 -> MSStatement CodeInfoProc)
-> StateT
     ValueState Identity (CodeInfoProc (Statement CodeInfoProc))
-> MSStatement CodeInfoProc
forall a b. (a -> b) -> a -> b
$ do
    [State ValueState (CodeInfoProc ())]
-> StateT ValueState Identity ()
forall (t :: * -> *) (m :: * -> *) a.
(Foldable t, Monad m) =>
t (m a) -> m ()
sequence_ [State ValueState (CodeInfoProc ())]
[SValue CodeInfoProc]
vs
    String -> String -> SValue CodeInfoProc
addExternalCall String
l String
n

instance CommentStatement CodeInfoProc where
  comment :: String -> MSStatement CodeInfoProc
comment String
_ = State MethodState (CodeInfoProc ())
MSStatement CodeInfoProc
forall s. State s (CodeInfoProc ())
noInfo

instance ControlStatement CodeInfoProc where
  break :: MSStatement CodeInfoProc
break    = State MethodState (CodeInfoProc ())
MSStatement CodeInfoProc
forall s. State s (CodeInfoProc ())
noInfo
  continue :: MSStatement CodeInfoProc
continue = State MethodState (CodeInfoProc ())
MSStatement CodeInfoProc
forall s. State s (CodeInfoProc ())
noInfo

  returnStmt :: SValue CodeInfoProc -> MSStatement CodeInfoProc
returnStmt = LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS (State ValueState (CodeInfoProc ())
 -> State MethodState (CodeInfoProc ()))
-> (State ValueState (CodeInfoProc ())
    -> State ValueState (CodeInfoProc ()))
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1

  throw :: String -> MSStatement CodeInfoProc
throw String
_ = (MethodState -> MethodState)
-> CodeInfoProc () -> State MethodState (CodeInfoProc ())
forall s a. (s -> s) -> a -> State s a
modifyReturn (ExceptionType -> MethodState -> MethodState
addException ExceptionType
Standard) (() -> CodeInfoProc ()
forall (r :: * -> *) a. Monad r => a -> r a
toCode ())

  ifCond :: [(SValue CodeInfoProc, MSBody CodeInfoProc)]
-> MSBody CodeInfoProc -> MSStatement CodeInfoProc
ifCond = [(SValue CodeInfoProc, MSBody CodeInfoProc)]
-> MSBody CodeInfoProc -> MSStatement CodeInfoProc
evalConds
  switch :: SValue CodeInfoProc
-> [(SValue CodeInfoProc, MSBody CodeInfoProc)]
-> MSBody CodeInfoProc
-> MSStatement CodeInfoProc
switch SValue CodeInfoProc
v [(SValue CodeInfoProc, MSBody CodeInfoProc)]
cs MSBody CodeInfoProc
b = do
    CodeInfoProc ()
_ <- LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS State ValueState (CodeInfoProc ())
SValue CodeInfoProc
v
    [(SValue CodeInfoProc, MSBody CodeInfoProc)]
-> MSBody CodeInfoProc -> MSStatement CodeInfoProc
evalConds [(SValue CodeInfoProc, MSBody CodeInfoProc)]
cs MSBody CodeInfoProc
b

  ifExists :: SValue CodeInfoProc
-> MSBody CodeInfoProc
-> MSBody CodeInfoProc
-> MSStatement CodeInfoProc
ifExists SValue CodeInfoProc
v = State MethodState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ())
-> State a (CodeInfoProc ())
-> State a (CodeInfoProc ())
execute3 (LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS State ValueState (CodeInfoProc ())
SValue CodeInfoProc
v)

  for :: MSStatement CodeInfoProc
-> SValue CodeInfoProc
-> MSStatement CodeInfoProc
-> MSBody CodeInfoProc
-> MSStatement CodeInfoProc
for MSStatement CodeInfoProc
dec SValue CodeInfoProc
v = State MethodState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ())
-> State a (CodeInfoProc ())
-> State a (CodeInfoProc ())
-> State a (CodeInfoProc ())
execute4 State MethodState (CodeInfoProc ())
MSStatement CodeInfoProc
dec (LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS State ValueState (CodeInfoProc ())
SValue CodeInfoProc
v)
  forRange :: SVariable CodeInfoProc
-> SValue CodeInfoProc
-> SValue CodeInfoProc
-> SValue CodeInfoProc
-> MSBody CodeInfoProc
-> MSStatement CodeInfoProc
forRange SVariable CodeInfoProc
_ SValue CodeInfoProc
b SValue CodeInfoProc
e SValue CodeInfoProc
s = State MethodState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ())
-> State a (CodeInfoProc ())
-> State a (CodeInfoProc ())
-> State a (CodeInfoProc ())
execute4 (LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS State ValueState (CodeInfoProc ())
SValue CodeInfoProc
b) (LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS State ValueState (CodeInfoProc ())
SValue CodeInfoProc
e) 
    (LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS State ValueState (CodeInfoProc ())
SValue CodeInfoProc
s)
  forEach :: SVariable CodeInfoProc
-> SValue CodeInfoProc
-> MSBody CodeInfoProc
-> MSStatement CodeInfoProc
forEach SVariable CodeInfoProc
_ SValue CodeInfoProc
v = State MethodState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute2 (LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS State ValueState (CodeInfoProc ())
SValue CodeInfoProc
v)
  while :: SValue CodeInfoProc
-> MSBody CodeInfoProc -> MSStatement CodeInfoProc
while SValue CodeInfoProc
v = State MethodState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute2 (LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS State ValueState (CodeInfoProc ())
SValue CodeInfoProc
v)

  tryCatch :: MSBody CodeInfoProc
-> MSBody CodeInfoProc -> MSStatement CodeInfoProc
tryCatch MSBody CodeInfoProc
_ MSBody CodeInfoProc
cb = do
    CodeInfoProc ()
_ <- State MethodState (CodeInfoProc ())
MSBody CodeInfoProc
cb
    State MethodState (CodeInfoProc ())
forall s. State s (CodeInfoProc ())
noInfo
  
  assert :: SValue CodeInfoProc
-> SValue CodeInfoProc -> MSStatement CodeInfoProc
assert SValue CodeInfoProc
cond SValue CodeInfoProc
msg = do
    CodeInfoProc ()
_ <- LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS State ValueState (CodeInfoProc ())
SValue CodeInfoProc
cond
    CodeInfoProc ()
_ <- LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS State ValueState (CodeInfoProc ())
SValue CodeInfoProc
msg
    State MethodState (CodeInfoProc ())
forall s. State s (CodeInfoProc ())
noInfo

instance VisibilitySym CodeInfoProc where
  type Visibility CodeInfoProc = VisibilityTag
  private :: CodeInfoProc (Visibility CodeInfoProc)
private = VisibilityTag -> CodeInfoProc VisibilityTag
forall (r :: * -> *) a. Monad r => a -> r a
toCode VisibilityTag
Priv
  public :: CodeInfoProc (Visibility CodeInfoProc)
public  = VisibilityTag -> CodeInfoProc VisibilityTag
forall (r :: * -> *) a. Monad r => a -> r a
toCode VisibilityTag
Pub

instance ParameterSym CodeInfoProc where
  type Parameter CodeInfoProc = ()
  param :: SVariable CodeInfoProc -> MSParameter CodeInfoProc
param        SVariable CodeInfoProc
_ = State MethodState (CodeInfoProc ())
MSParameter CodeInfoProc
forall s. State s (CodeInfoProc ())
noInfo
  pointerParam :: SVariable CodeInfoProc -> MSParameter CodeInfoProc
pointerParam SVariable CodeInfoProc
_ = State MethodState (CodeInfoProc ())
MSParameter CodeInfoProc
forall s. State s (CodeInfoProc ())
noInfo

instance MethodSym CodeInfoProc where
  type Method CodeInfoProc = ()
  docMain :: MSBody CodeInfoProc -> SMethod CodeInfoProc
docMain = String -> MSBody CodeInfoProc -> SMethod CodeInfoProc
updateMEMandCM String
"main"
  function :: String
-> CodeInfoProc (Visibility CodeInfoProc)
-> VSType CodeInfoProc
-> [MSParameter CodeInfoProc]
-> MSBody CodeInfoProc
-> SMethod CodeInfoProc
function String
n CodeInfoProc (Visibility CodeInfoProc)
_ VSType CodeInfoProc
_ [MSParameter CodeInfoProc]
_ = String -> MSBody CodeInfoProc -> SMethod CodeInfoProc
updateMEMandCM String
n
  mainFunction :: MSBody CodeInfoProc -> SMethod CodeInfoProc
mainFunction = String -> MSBody CodeInfoProc -> SMethod CodeInfoProc
updateMEMandCM String
"main"
  docFunc :: String
-> [String]
-> Maybe String
-> SMethod CodeInfoProc
-> SMethod CodeInfoProc
docFunc String
_ [String]
_ Maybe String
_ SMethod CodeInfoProc
f = do
    CodeInfoProc ()
_ <- State MethodState (CodeInfoProc ())
SMethod CodeInfoProc
f
    State MethodState (CodeInfoProc ())
forall s. State s (CodeInfoProc ())
noInfo

  inOutFunc :: String
-> CodeInfoProc (Visibility CodeInfoProc) -> InOutFunc CodeInfoProc
inOutFunc      String
n CodeInfoProc (Visibility CodeInfoProc)
_ [SVariable CodeInfoProc]
_ [SVariable CodeInfoProc]
_ [SVariable CodeInfoProc]
_     = String -> MSBody CodeInfoProc -> SMethod CodeInfoProc
updateMEMandCM String
n
  docInOutFunc :: String
-> CodeInfoProc (Visibility CodeInfoProc)
-> DocInOutFunc CodeInfoProc
docInOutFunc   String
n CodeInfoProc (Visibility CodeInfoProc)
_ String
_ [(String, SVariable CodeInfoProc)]
_ [(String, SVariable CodeInfoProc)]
_ [(String, SVariable CodeInfoProc)]
_   = String -> MSBody CodeInfoProc -> SMethod CodeInfoProc
updateMEMandCM String
n

instance ModuleSym CodeInfoProc where
  type Module CodeInfoProc = ()
  buildModule :: String
-> [String] -> [SMethod CodeInfoProc] -> FSModule CodeInfoProc
buildModule String
n [String]
_ [SMethod CodeInfoProc]
funcs = do
    (FileState -> FileState) -> StateT FileState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (String -> FileState -> FileState
setModuleName String
n)
    (State MethodState (CodeInfoProc ())
 -> StateT FileState Identity (CodeInfoProc ()))
-> [State MethodState (CodeInfoProc ())]
-> StateT FileState Identity ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ (LensLike'
  (Zoomed (StateT MethodState Identity) (CodeInfoProc ()))
  FileState
  MethodState
-> State MethodState (CodeInfoProc ())
-> StateT FileState Identity (CodeInfoProc ())
forall c.
LensLike'
  (Zoomed (StateT MethodState Identity) c) FileState MethodState
-> StateT MethodState Identity c -> StateT FileState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT MethodState Identity) (CodeInfoProc ()))
  FileState
  MethodState
(MethodState -> Focusing Identity (CodeInfoProc ()) MethodState)
-> FileState -> Focusing Identity (CodeInfoProc ()) FileState
Lens' FileState MethodState
lensFStoMS) [State MethodState (CodeInfoProc ())]
[SMethod CodeInfoProc]
funcs
    (FileState -> FileState)
-> CodeInfoProc () -> StateT FileState Identity (CodeInfoProc ())
forall s a. (s -> s) -> a -> State s a
modifyReturn (String -> FileState -> FileState
updateClassMap String
n) (() -> CodeInfoProc ()
forall (r :: * -> *) a. Monad r => a -> r a
toCode ())

-- Helpers

noInfo :: State s (CodeInfoProc ())
noInfo :: forall s. State s (CodeInfoProc ())
noInfo = CodeInfoProc () -> State s (CodeInfoProc ())
forall a s. a -> State s a
toState (CodeInfoProc () -> State s (CodeInfoProc ()))
-> CodeInfoProc () -> State s (CodeInfoProc ())
forall a b. (a -> b) -> a -> b
$ () -> CodeInfoProc ()
forall (r :: * -> *) a. Monad r => a -> r a
toCode ()

noInfoType :: State s (CodeInfoProc String)
noInfoType :: forall s. State s (CodeInfoProc String)
noInfoType = CodeInfoProc String -> State s (CodeInfoProc String)
forall a s. a -> State s a
toState (CodeInfoProc String -> State s (CodeInfoProc String))
-> CodeInfoProc String -> State s (CodeInfoProc String)
forall a b. (a -> b) -> a -> b
$ String -> CodeInfoProc String
forall (r :: * -> *) a. Monad r => a -> r a
toCode String
""

updateMEMandCM :: String -> MSBody CodeInfoProc -> SMethod CodeInfoProc
updateMEMandCM :: String -> MSBody CodeInfoProc -> SMethod CodeInfoProc
updateMEMandCM String
n MSBody CodeInfoProc
b = do
  CodeInfoProc ()
_ <- State MethodState (CodeInfoProc ())
MSBody CodeInfoProc
b
  (MethodState -> MethodState) -> StateT MethodState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (String -> MethodState -> MethodState
updateCallMap String
n (MethodState -> MethodState)
-> (MethodState -> MethodState) -> MethodState -> MethodState
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> MethodState -> MethodState
updateMethodExcMap String
n)
  State MethodState (CodeInfoProc ())
forall s. State s (CodeInfoProc ())
noInfo

evalConds :: [(SValue CodeInfoProc, MSBody CodeInfoProc)] -> MSBody CodeInfoProc -> 
  MSStatement CodeInfoProc
evalConds :: [(SValue CodeInfoProc, MSBody CodeInfoProc)]
-> MSBody CodeInfoProc -> MSStatement CodeInfoProc
evalConds [(SValue CodeInfoProc, MSBody CodeInfoProc)]
cs MSBody CodeInfoProc
def = do
  ((State ValueState (CodeInfoProc ()),
  State MethodState (CodeInfoProc ()))
 -> State MethodState (CodeInfoProc ()))
-> [(State ValueState (CodeInfoProc ()),
     State MethodState (CodeInfoProc ()))]
-> StateT MethodState Identity ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ (LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
-> State ValueState (CodeInfoProc ())
-> State MethodState (CodeInfoProc ())
forall c.
LensLike'
  (Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT ValueState Identity) (CodeInfoProc ()))
  MethodState
  ValueState
(ValueState -> Focusing Identity (CodeInfoProc ()) ValueState)
-> MethodState -> Focusing Identity (CodeInfoProc ()) MethodState
Lens' MethodState ValueState
lensMStoVS (State ValueState (CodeInfoProc ())
 -> State MethodState (CodeInfoProc ()))
-> ((State ValueState (CodeInfoProc ()),
     State MethodState (CodeInfoProc ()))
    -> State ValueState (CodeInfoProc ()))
-> (State ValueState (CodeInfoProc ()),
    State MethodState (CodeInfoProc ()))
-> State MethodState (CodeInfoProc ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (State ValueState (CodeInfoProc ()),
 State MethodState (CodeInfoProc ()))
-> State ValueState (CodeInfoProc ())
forall a b. (a, b) -> a
fst) [(State ValueState (CodeInfoProc ()),
  State MethodState (CodeInfoProc ()))]
[(SValue CodeInfoProc, MSBody CodeInfoProc)]
cs
  ((State ValueState (CodeInfoProc ()),
  State MethodState (CodeInfoProc ()))
 -> State MethodState (CodeInfoProc ()))
-> [(State ValueState (CodeInfoProc ()),
     State MethodState (CodeInfoProc ()))]
-> StateT MethodState Identity ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ (State ValueState (CodeInfoProc ()),
 State MethodState (CodeInfoProc ()))
-> State MethodState (CodeInfoProc ())
forall a b. (a, b) -> b
snd [(State ValueState (CodeInfoProc ()),
  State MethodState (CodeInfoProc ()))]
[(SValue CodeInfoProc, MSBody CodeInfoProc)]
cs
  CodeInfoProc ()
_ <- State MethodState (CodeInfoProc ())
MSBody CodeInfoProc
def
  State MethodState (CodeInfoProc ())
forall s. State s (CodeInfoProc ())
noInfo

addCurrModCall :: String -> SValue CodeInfoProc
addCurrModCall :: String -> SValue CodeInfoProc
addCurrModCall String
n = do
  String
mn <- LensLike'
  (Zoomed (StateT FileState Identity) String) ValueState FileState
-> StateT FileState Identity String
-> StateT ValueState Identity String
forall c.
LensLike'
  (Zoomed (StateT FileState Identity) c) ValueState FileState
-> StateT FileState Identity c -> StateT ValueState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
  (Zoomed (StateT FileState Identity) String) ValueState FileState
(FileState -> Focusing Identity String FileState)
-> ValueState -> Focusing Identity String ValueState
Lens' ValueState FileState
lensVStoFS StateT FileState Identity String
getModuleName 
  (ValueState -> ValueState) -> StateT ValueState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (QualifiedName -> ValueState -> ValueState
addCall (String -> String -> QualifiedName
qualName String
mn String
n)) 
  State ValueState (CodeInfoProc ())
forall s. State s (CodeInfoProc ())
noInfo

addExternalCall :: String -> String -> SValue CodeInfoProc
addExternalCall :: String -> String -> SValue CodeInfoProc
addExternalCall String
l String
n = (ValueState -> ValueState) -> StateT ValueState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (QualifiedName -> ValueState -> ValueState
addCall (String -> String -> QualifiedName
qualName String
l String
n)) StateT ValueState Identity ()
-> State ValueState (CodeInfoProc ())
-> State ValueState (CodeInfoProc ())
forall a b.
StateT ValueState Identity a
-> StateT ValueState Identity b -> StateT ValueState Identity b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> State ValueState (CodeInfoProc ())
forall s. State s (CodeInfoProc ())
noInfo

execute1 :: State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1 :: forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1 State a (CodeInfoProc ())
s = do
  CodeInfoProc ()
_ <- State a (CodeInfoProc ())
s
  State a (CodeInfoProc ())
forall s. State s (CodeInfoProc ())
noInfo

executeList :: [State a (CodeInfoProc ())] -> State a (CodeInfoProc ())
executeList :: forall a. [State a (CodeInfoProc ())] -> State a (CodeInfoProc ())
executeList [State a (CodeInfoProc ())]
l = do
  [State a (CodeInfoProc ())] -> StateT a Identity ()
forall (t :: * -> *) (m :: * -> *) a.
(Foldable t, Monad m) =>
t (m a) -> m ()
sequence_ [State a (CodeInfoProc ())]
l
  State a (CodeInfoProc ())
forall s. State s (CodeInfoProc ())
noInfo

executePairList :: [(State a (CodeInfoProc ()), State a (CodeInfoProc ()))] -> 
  State a (CodeInfoProc ())
executePairList :: forall a.
[(State a (CodeInfoProc ()), State a (CodeInfoProc ()))]
-> State a (CodeInfoProc ())
executePairList [(State a (CodeInfoProc ()), State a (CodeInfoProc ()))]
ps = do
  ((State a (CodeInfoProc ()), State a (CodeInfoProc ()))
 -> State a (CodeInfoProc ()))
-> [(State a (CodeInfoProc ()), State a (CodeInfoProc ()))]
-> StateT a Identity ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ (State a (CodeInfoProc ()), State a (CodeInfoProc ()))
-> State a (CodeInfoProc ())
forall a b. (a, b) -> a
fst [(State a (CodeInfoProc ()), State a (CodeInfoProc ()))]
ps
  ((State a (CodeInfoProc ()), State a (CodeInfoProc ()))
 -> State a (CodeInfoProc ()))
-> [(State a (CodeInfoProc ()), State a (CodeInfoProc ()))]
-> StateT a Identity ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ (State a (CodeInfoProc ()), State a (CodeInfoProc ()))
-> State a (CodeInfoProc ())
forall a b. (a, b) -> b
snd [(State a (CodeInfoProc ()), State a (CodeInfoProc ()))]
ps
  State a (CodeInfoProc ())
forall s. State s (CodeInfoProc ())
noInfo

execute2 :: State a (CodeInfoProc ()) -> State a (CodeInfoProc ()) -> 
  State a (CodeInfoProc ())
execute2 :: forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute2 State a (CodeInfoProc ())
s1 State a (CodeInfoProc ())
s2 = do
  CodeInfoProc ()
_ <- State a (CodeInfoProc ())
s1
  State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
forall a. State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute1 State a (CodeInfoProc ())
s2

execute3 :: State a (CodeInfoProc ()) -> State a (CodeInfoProc ()) -> 
  State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute3 :: forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ())
-> State a (CodeInfoProc ())
-> State a (CodeInfoProc ())
execute3 State a (CodeInfoProc ())
s1 State a (CodeInfoProc ())
s2 State a (CodeInfoProc ())
s3 = do
  CodeInfoProc ()
_ <- State a (CodeInfoProc ())
s1
  State a (CodeInfoProc ())
-> State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute2 State a (CodeInfoProc ())
s2 State a (CodeInfoProc ())
s3

execute4 :: State a (CodeInfoProc ()) -> State a (CodeInfoProc ()) -> 
  State a (CodeInfoProc ()) -> State a (CodeInfoProc ()) -> State a (CodeInfoProc ())
execute4 :: forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ())
-> State a (CodeInfoProc ())
-> State a (CodeInfoProc ())
-> State a (CodeInfoProc ())
execute4 State a (CodeInfoProc ())
s1 State a (CodeInfoProc ())
s2 State a (CodeInfoProc ())
s3 State a (CodeInfoProc ())
s4 = do
  CodeInfoProc ()
_ <- State a (CodeInfoProc ())
s1
  State a (CodeInfoProc ())
-> State a (CodeInfoProc ())
-> State a (CodeInfoProc ())
-> State a (CodeInfoProc ())
forall a.
State a (CodeInfoProc ())
-> State a (CodeInfoProc ())
-> State a (CodeInfoProc ())
-> State a (CodeInfoProc ())
execute3 State a (CodeInfoProc ())
s2 State a (CodeInfoProc ())
s3 State a (CodeInfoProc ())
s4

currModCall :: String -> [VS (CodeInfoProc ())] -> 
  [(VS (CodeInfoProc ()), VS (CodeInfoProc ()))] -> VS (CodeInfoProc ())
currModCall :: String
-> [State ValueState (CodeInfoProc ())]
-> [(State ValueState (CodeInfoProc ()),
     State ValueState (CodeInfoProc ()))]
-> State ValueState (CodeInfoProc ())
currModCall String
n [State ValueState (CodeInfoProc ())]
ps [(State ValueState (CodeInfoProc ()),
  State ValueState (CodeInfoProc ()))]
ns = do
  [State ValueState (CodeInfoProc ())]
-> StateT ValueState Identity ()
forall (t :: * -> *) (m :: * -> *) a.
(Foldable t, Monad m) =>
t (m a) -> m ()
sequence_ [State ValueState (CodeInfoProc ())]
ps
  [(State ValueState (CodeInfoProc ()),
  State ValueState (CodeInfoProc ()))]
-> State ValueState (CodeInfoProc ())
forall a.
[(State a (CodeInfoProc ()), State a (CodeInfoProc ()))]
-> State a (CodeInfoProc ())
executePairList [(State ValueState (CodeInfoProc ()),
  State ValueState (CodeInfoProc ()))]
ns
  String -> SValue CodeInfoProc
addCurrModCall String
n