drasil-code-0.1.9.0: A framework for code and document generation for scientific software - Code SubPackage
Safe HaskellNone
LanguageGHC2024

Language.Drasil.Code.Imperative.Import

Synopsis

Documentation

codeType :: HasSpace c => c -> GenState CodeType Source #

Gets a chunk's CodeType, by checking which CodeType the user has chosen to match the chunk's Space to.

spaceCodeType :: Space -> GenState CodeType Source #

Gets the CodeType for a Space, based on the user's choice.

publicFunc :: OOProg r vis stmt mthd stvr attch prg file mod bod block => Label -> VS (r TypeData) -> Description -> [ParameterChunk] -> Maybe Description -> [MS (r block)] -> GenState (MS (r mthd)) Source #

Generates a public function.

publicFuncProc :: (Literal r, VariableValue r, MultiStatement r stmt, DeclStatement r stmt bod, FileHandling r stmt, PrintFile r stmt, BlockSym r block stmt, BodySym r bod block, MethodSym r vis mthd bod, VariableElim r) => Label -> VS (r TypeData) -> Description -> [ParameterChunk] -> Maybe Description -> [MS (r block)] -> GenState (MS (r mthd)) Source #

Generates a public function.

privateMethod :: OOProg r vis stmt mthd stvr attch prg file mod bod block => Label -> VS (r TypeData) -> Description -> [ParameterChunk] -> Maybe Description -> [MS (r block)] -> GenState (MS (r mthd)) Source #

Generates a private method.

privateFuncProc :: (Literal r, VariableValue r, MultiStatement r stmt, DeclStatement r stmt bod, FileHandling r stmt, PrintFile r stmt, BlockSym r block stmt, BodySym r bod block, MethodSym r vis mthd bod, VariableElim r) => Label -> VS (r TypeData) -> Description -> [ParameterChunk] -> Maybe Description -> [MS (r block)] -> GenState (MS (r mthd)) Source #

Generates a private function.

publicInOutFunc :: OOProg r vis stmt mthd stvr attch prg file mod bod block => Label -> Description -> [CodeVarChunk] -> [CodeVarChunk] -> [MS (r block)] -> GenState (MS (r mthd)) Source #

Generates a public function, defined by its inputs and outputs.

publicInOutFuncProc :: (BlockSym r block stmt, BodySym r bod block, Literal r, VariableValue r, MultiStatement r stmt, DeclStatement r stmt bod, FileHandling r stmt, PrintFile r stmt, MethodSym r vis mthd bod, VariableElim r) => Label -> Description -> [CodeVarChunk] -> [CodeVarChunk] -> [MS (r block)] -> GenState (MS (r mthd)) Source #

Generates a public function, defined by its inputs and outputs.

privateInOutMethod :: OOProg r vis stmt mthd stvr attch prg file mod bod block => Label -> Description -> [CodeVarChunk] -> [CodeVarChunk] -> [MS (r block)] -> GenState (MS (r mthd)) Source #

Generates a private method, defined by its inputs and outputs.

privateInOutFuncProc :: (BlockSym r block stmt, BodySym r bod block, Literal r, VariableValue r, MultiStatement r stmt, DeclStatement r stmt bod, FileHandling r stmt, PrintFile r stmt, MethodSym r vis mthd bod, VariableElim r) => Label -> Description -> [CodeVarChunk] -> [CodeVarChunk] -> [MS (r block)] -> GenState (MS (r mthd)) Source #

Generates a private function, defined by its inputs and outputs.

genConstructor :: OOProg r vis stmt mthd stvr attch prg file mod bod block => Label -> Description -> [ParameterChunk] -> [MS (r block)] -> GenState (MS (r mthd)) Source #

Generates a constructor.

mkVar :: (SelfSym r, VariableElim r, VariableValue r) => CodeVarChunk -> GenState (SVariable r) Source #

Generates a GOOL Variable for a variable represented by a CodeVarChunk.

mkVarProc :: VariableSym r => CodeVarChunk -> GenState (SVariable r) Source #

Generates a GOOL Variable for a variable represented by a CodeVarChunk.

mkValProc :: (NativeVector r, MathConstant r, VariableValue r, BooleanExpression r, Comparison r, NumericExpression r, ValueExpression r, Argument r, List r, Reference r, Set r, TypeElim r) => CodeVarChunk -> GenState (SValue r) Source #

Generates a GOOL Value for a variable represented by a CodeVarChunk.

convStmt :: (BlockSym r block stmt, BodySym r bod block, Argument r, MathConstant r, VariableValue r, Literal r, BooleanExpression r, Comparison r, NumericExpression r, SelfSym r, InternalValueExp r, OOValueExpression r, Array r, List r, ListStatement r stmt, Reference r, Set r, MultiStatement r stmt, ValueStatement r stmt, AssignStatement r stmt, ControlStatement r stmt bod, DeclStatement r stmt bod, TypeElim r, VariableElim r) => FuncStmt -> GenState (MS (r stmt)) Source #

Converts a FuncStmt to a GOOL Statement.

convStmtProc :: (BlockSym r block stmt, BodySym r bod block, MathConstant r, VariableValue r, BooleanExpression r, NumericExpression r, ValueExpression r, Comparison r, Argument r, Array r, List r, ListStatement r stmt, NativeVector r, Reference r, Set r, MultiStatement r stmt, ValueStatement r stmt, DeclStatement r stmt bod, AssignStatement r stmt, ControlStatement r stmt bod, TypeElim r, VariableElim r) => FuncStmt -> GenState (MS (r stmt)) Source #

Converts a FuncStmt to a GOOL Statement.

genModDef :: OOProg r vis stmt mthd stvr attch prg file mod bod block => Mod -> GenState (FS (r file)) Source #

Converts a Mod to GOOL.

genModDefProc :: (NativeVector r, MathConstant r, BooleanExpression r, Comparison r, NumericExpression r, ValueExpression r, VariableValue r, DeclStatement r stmt bod, AssignStatement r stmt, ControlStatement r stmt bod, StringStatement r stmt, FileHandling r stmt, ReadFile r stmt, PrintFile r stmt, Argument r, Array r, List r, Reference r, Set r, ProcProg r vis stmt mthd prg file mod bod block, TypeElim r) => Mod -> GenState (FS (r file)) Source #

Converts a Mod to GOOL.

genModFuncs :: OOProg r vis stmt mthd stvr attch prg file mod bod block => Mod -> [GenState (MS (r mthd))] Source #

Converts a Mod's functions to GOOL.

genModFuncsProc :: (BlockSym r block stmt, BodySym r bod block, NativeVector r, MathConstant r, BooleanExpression r, Comparison r, NumericExpression r, ValueExpression r, VariableValue r, MultiStatement r stmt, ValueStatement r stmt, DeclStatement r stmt bod, AssignStatement r stmt, ControlStatement r stmt bod, StringStatement r stmt, FileHandling r stmt, ReadFile r stmt, PrintFile r stmt, Argument r, Array r, List r, ListStatement r stmt, Reference r, MethodSym r vis mthd bod, Set r, TypeElim r, VariableElim r) => Mod -> [GenState (MS (r mthd))] Source #

Converts a Mod's functions to GOOL.

genModClasses :: OOProg r vis stmt mthd stvr attch prg file mod bod block => Mod -> [GenState (CS (r Class))] Source #

Converts a Mod's classes to GOOL.

readData :: (BlockSym r block stmt, BodySym r bod block, Argument r, Literal r, MathConstant r, OOVariableValue r, BooleanExpression r, Comparison r, NumericExpression r, SelfSym r, InternalValueExp r, OOValueExpression r, List r, ListStatement r stmt, Reference r, Set r, OODeclStatement r stmt bod, ControlStatement r stmt bod, StringStatement r stmt, FileHandling r stmt, ReadFile r stmt, TypeElim r, VariableElim r) => DataDesc -> GenState [MS (r block)] Source #

Read from a data description into an 'MS block' of 'MS Statement's.

readDataProc :: (BlockSym r block stmt, BodySym r bod block, NativeVector r, MathConstant r, BooleanExpression r, Comparison r, NumericExpression r, ValueExpression r, VariableValue r, DeclStatement r stmt bod, ControlStatement r stmt bod, StringStatement r stmt, FileHandling r stmt, ReadFile r stmt, Argument r, List r, ListStatement r stmt, Reference r, Set r, TypeElim r) => DataDesc -> GenState [MS (r block)] Source #

Read from a data description into an 'MS block' of 'MS Statement's.