drasil-gool-0.1.1.0: A framework for code and document generation for scientific software - GOOL SubPackage
Safe HaskellNone
LanguageGHC2024

Drasil.Shared.LanguageRenderer.Macros

Description

Language-polymorphic functions that are defined by GOOL code

Synopsis

Documentation

ifExists :: (ControlStatement r stmt bod, ValueExpression r) => SValue r -> MS (r bod) -> MS (r bod) -> MS (r stmt) Source #

decrement1 :: (AssignStatement r stmt, Literal r) => SVariable r -> MS (r stmt) Source #

increment1 :: (AssignStatement r stmt, Literal r) => SVariable r -> MS (r stmt) Source #

runStrategy :: (EmptyStatement r stmt, AssignStatement r stmt, BodyElim r bod, Monad r, RenderStatement r stmt, StatementElim r stmt) => Label -> [(Label, MS (r bod))] -> Maybe (SValue r) -> Maybe (SVariable r) -> MS (r Doc) Source #

listSlice :: (BodySym r bod block, BlockSym r block stmt, EmptyStatement r stmt, DeclStatement r stmt bod, AssignStatement r stmt, ControlStatement r stmt bod, Literal r, BooleanExpression r, Comparison r, NumericExpression r, ValueExpression r, VariableValue r, List r, ListStatement r stmt, ValueElim r, VariableElim r) => Maybe (SValue r) -> Maybe (SValue r) -> Maybe (SValue r) -> SVariable r -> SValue r -> MS (r block) Source #

makeSetterVal :: (EmptyStatement r stmt, DeclStatement r stmt bod, Comparison r, IndexTranslator r, Literal r, ValueExpression r, VariableValue r) => Label -> SValue r -> Maybe Integer -> Maybe (SValue r) -> SValue r -> SValue r -> r ScopeData -> (MS (r stmt), SValue r) Source #

Gets the expression and code for setting bounds in a list slice Input: - String: Variable name for bound (to be created if necessary), - SValue: step value - Maybe Integer: literal value of step, if exists - Maybe SValue: given value of bound - SValue: value of bound if bound not given and step is positive - SValue: value of bound if bound not given and step is negative Output: (SValue): (setter, value) of bound

stringListLists :: (BodySym r bod block, BlockSym r block stmt, ControlStatement r stmt bod, Literal r, NumericExpression r, VariableValue r, List r, ListStatement r stmt, TypeElim r, VariableElim r, RenderValue r) => [SVariable r] -> SValue r -> MS (r stmt) Source #

forRange :: (DeclStatement r stmt bod, AssignStatement r stmt, ControlStatement r stmt bod, Comparison r, VariableValue r) => SVariable r -> SValue r -> SValue r -> SValue r -> MS (r bod) -> MS (r stmt) Source #

notifyObservers :: (BodySym r bod block, BlockSym r block stmt, Literal r, VariableValue r, Comparison r, List r, ValueStatement r stmt, DeclStatement r stmt bod, AssignStatement r stmt, ControlStatement r stmt bod, OOFunctionSym r) => VS (r FuncData) -> VS (r TypeData) -> MS (r stmt) Source #

notifyObservers' :: (BodySym r bod block, BlockSym r block stmt, ValueStatement r stmt, Literal r, VariableValue r, List r, ControlStatement r stmt bod, OOFunctionSym r) => VS (r FuncData) -> VS (r TypeData) -> MS (r stmt) Source #

arrayDecAsList :: (BodySym r bod block, BlockSym r block stmt, MultiStatement r stmt, DeclStatement r stmt bod, ControlStatement r stmt bod, Literal r, VariableValue r, ListStatement r stmt, VariableElim r) => Integer -> SValue r -> SVariable r -> r ScopeData -> MS (r stmt) Source #