drasil-gool-0.1.1.0: A framework for code and document generation for scientific software - GOOL SubPackage
Safe HaskellSafe-Inferred
LanguageHaskell2010

Drasil.Shared.LanguageRenderer.CommonPseudoOO

Description

Implementations defined here are valid in some, but not all, language renderers

Synopsis

Documentation

int :: Monad r => VS (r TypeData) Source #

constructor :: (OORenderSym r vis smt md svr att, OOStatement r smt) => Label -> [MS (r ParamData)] -> Initializers r -> MS (r Body) -> MS (r md) Source #

doxFunc :: RenderMethod r md => String -> [String] -> Maybe String -> MS (r md) -> MS (r md) Source #

doxClass :: RenderClass r vis md svr => String -> CS (r Class) -> CS (r Class) Source #

doxMod :: RenderFile r => String -> String -> String -> [String] -> String -> FS (r File) -> FS (r File) Source #

modDoc' :: ModuleDocRenderer Source #

Generates Markdown/DocC style module doc comment. Useful for Swift, which follows DocC, Julia, which uses Markdown, and any other language that doesn't have Support for a document generator.

functionDoc :: FuncDocRenderer Source #

Generates Markdown/DocC style function doc comment.

extVar :: VariableSym r => Library -> Label -> VS (r TypeData) -> SVariable r Source #

An instance- or module-level variable from an external library. Given library Lib, variable name v, and variable type t, it performs the necessary imports and creates v

intClass :: (MethodElim r md, Monad r, StateVarElim r svr, VisibilityElim r vis) => (Label -> Doc -> Doc -> Doc -> Doc -> Doc) -> Label -> r vis -> r ParentSpec -> [CSStateVar r svr] -> [MS (r md)] -> [MS (r md)] -> CS (r Doc) Source #

An internal function for creating a class. Parameters: render function, class name, scope, parent, class variables, constructor(s), methods

funcType :: TypeSym r => [VS (r TypeData)] -> VS (r TypeData) -> VS (r TypeData) Source #

buildModule :: (ClassElim r, MethodElim r md, RenderMod r) => Label -> FS Doc -> FS Doc -> FS Doc -> [MS (r md)] -> [CS (r Class)] -> FS (r Module) Source #

printSt :: (RenderStatement r smt, ValueElim r) => SValue r -> SValue r -> MS (r smt) Source #

arrayDecDef :: (DeclStatement r smt, RenderStatement r smt, StatementElim r smt, ValueElim r) => SVariable r -> r ScopeData -> [SValue r] -> MS (r smt) Source #

openFileA :: (AssignStatement r smt, Literal r) => (SValue r -> VS (r TypeData) -> SValue r -> SValue r) -> SVariable r -> SValue r -> MS (r smt) Source #

forEach :: (BodyElim r, InternalVarElim r, RenderStatement r smt, UnRepr r TypeData, ValueElim r, VariableElim r) => Doc -> Doc -> Doc -> Doc -> SVariable r -> SValue r -> MS (r Body) -> MS (r smt) Source #

docMain :: OORenderSym r vis smt md svr att => MS (r Body) -> MS (r md) Source #

mainFunction :: (AttachmentSym r att, OORenderMethod r vis md att, ParameterSym r, UnRepr r TypeData, Monad r, VisibilitySym r vis) => VS (r TypeData) -> Label -> MS (r Body) -> MS (r md) Source #

buildModule' :: (OORenderSym r vis smt md svr att, UnRepr r Doc) => Label -> (String -> r Doc) -> [Label] -> [MS (r md)] -> [CS (r Class)] -> FS (r Module) Source #

Used by the language renderers to build the module. n is the module name inc is the include is is the import statements ms is the class methods cs is the classes

call' :: (InternalVarElim r, RenderValue r, ValueElim r) => String -> Maybe Library -> Maybe Doc -> MixedCall r Source #

First parameter is language name, rest similar to call from RendererClassesCommon

docInOutFunc :: RenderMethod r md => ([SVariable r] -> [SVariable r] -> [SVariable r] -> MS (r Body) -> MS (r md)) -> String -> [(String, SVariable r)] -> [(String, SVariable r)] -> [(String, SVariable r)] -> MS (r Body) -> MS (r md) Source #

listDecDef :: (DeclStatement r smt, Literal r, VariableElim r) => SVariable r -> r ScopeData -> [SValue r] -> MS (r smt) Source #

stateVarDef :: (OORenderSym r vis smt md svr att, Monad r) => r vis -> r att -> SVariable r -> SValue r -> CS (r Doc) Source #

constVar :: (CommonRenderSym r vis smt md, Monad r) => Doc -> r vis -> SVariable r -> SValue r -> CS (r Doc) Source #

litArray :: (RenderValue r, TypeSym r, ValueElim r) => (Doc -> Doc) -> VS (r TypeData) -> [SValue r] -> SValue r Source #

litSet :: (RenderValue r, TypeSym r, ValueElim r) => (Doc -> Doc) -> (Doc -> Doc) -> VS (r TypeData) -> [SValue r] -> SValue r Source #

extraClass :: (RenderClass r vis md svr, VisibilitySym r vis) => Label -> Maybe Label -> [CSStateVar r svr] -> [MS (r md)] -> [MS (r md)] -> CS (r Class) Source #

openFileR :: AssignStatement r smt => (SValue r -> VS (r TypeData) -> SValue r) -> SVariable r -> SValue r -> MS (r smt) Source #

openFileW :: (AssignStatement r smt, Literal r) => (SValue r -> VS (r TypeData) -> SValue r -> SValue r) -> SVariable r -> SValue r -> MS (r smt) Source #

stateVar :: (Monad r, OORenderSym r vis smt md svr att) => r vis -> r att -> SVariable r -> CS (r Doc) Source #

multiReturn :: (ControlStatement r smt, RenderValue r, ValueElim r) => (Doc -> Doc) -> [SValue r] -> MS (r smt) Source #

listDec :: (DeclStatement r smt, Literal r, VariableElim r) => SVariable r -> r ScopeData -> MS (r smt) Source #

funcDecDef :: OORenderSym r vis smt md svr att => SVariable r -> r ScopeData -> [SVariable r] -> MS (r Body) -> MS (r smt) Source #

inOutCall :: (InternalAssignStmt r smt, StatementSym r smt, VariableValue r) => (Label -> VS (r TypeData) -> [SValue r] -> SValue r) -> Label -> [SValue r] -> [SVariable r] -> [SVariable r] -> MS (r smt) Source #

mainBody :: (BodyElim r, RenderMethod r md) => MS (r Body) -> MS (r md) Source #

inOutFunc :: (InternalControlStmt r smt, SharedStatement r smt, RenderBody r, RenderType r, VariableElim r) => (VS (r TypeData) -> [MS (r ParamData)] -> MS (r Body) -> MS (r md)) -> [SVariable r] -> [SVariable r] -> [SVariable r] -> MS (r Body) -> MS (r md) Source #

docInOutFunc' :: RenderMethod r md => FuncDocRenderer -> ([SVariable r] -> [SVariable r] -> [SVariable r] -> MS (r Body) -> MS (r md)) -> String -> [(String, SVariable r)] -> [(String, SVariable r)] -> [(String, SVariable r)] -> MS (r Body) -> MS (r md) Source #

listSize :: List r smt => SValue r -> SValue r Source #

setDecDef :: (DeclStatement r smt, Literal r, VariableElim r) => SVariable r -> r ScopeData -> [SValue r] -> MS (r smt) Source #

setDec :: (DeclStatement r smt, RenderStatement r smt, StatementElim r smt) => (r Value -> Doc) -> SValue r -> SVariable r -> r ScopeData -> MS (r smt) Source #

intToIndex :: SValue r -> SValue r Source #

Convert an integer to an index in a 0-indexed language Since GOOL is 0-indexed, no adjustments need be made

indexToInt :: SValue r -> SValue r Source #

Convert an index to an integer in a 0-indexed language Since GOOL is 0-indexed, no adjustments need be made

intToIndex' :: (Literal r, NumericExpression r, RenderValue r, ValueElim r) => SValue r -> SValue r Source #

Convert an integer to an index in a 1-indexed language Since GOOL is 0-indexed, we need to add 1

indexToInt' :: (Literal r, NumericExpression r, RenderValue r, ValueElim r) => SValue r -> SValue r Source #

Convert an index to an integer in a 1-indexed language Since GOOL is 0-indexed, we need to subtract 1

varDecDef :: DeclStatement r smt => SVariable r -> r ScopeData -> SValue r -> MS (r smt) Source #

Declare a variable and give it a value. Not for use with arrays; use arrayDecDef instead.