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

Drasil.GOOL.LanguageRenderer.CommonPseudoOO

Description

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

Synopsis

Documentation

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.

intClass :: (OORenderSym r, Monad r) => (Label -> Doc -> Doc -> Doc -> Doc -> Doc) -> Label -> r (Visibility r) -> r ParentSpec -> [CSStateVar r] -> [SMethod r] -> [SMethod r] -> CS (r Doc) Source #

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

buildModule :: OORenderSym r => Label -> FS Doc -> FS Doc -> FS Doc -> [SMethod r] -> [SClass r] -> FSModule r Source #

forEach' :: CommonRenderSym r => (r (Variable r) -> r (Value r) -> r (Body r) -> Doc) -> SVariable r -> SValue r -> MSBody r -> MSStatement r Source #

buildModule' :: OORenderSym r => Label -> (String -> r (Import r)) -> [Label] -> [SMethod r] -> [SClass r] -> FSModule r 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' :: CommonRenderSym r => String -> Maybe Library -> Maybe Doc -> MixedCall r Source #

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

docInOutFunc :: CommonRenderSym r => ([SVariable r] -> [SVariable r] -> [SVariable r] -> MSBody r -> SMethod r) -> String -> [(String, SVariable r)] -> [(String, SVariable r)] -> [(String, SVariable r)] -> MSBody r -> SMethod r Source #

stateVarDef :: (OORenderSym r, Monad r) => r (Visibility r) -> r (Permanence r) -> SVariable r -> SValue r -> CS (r Doc) Source #

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

litArray :: CommonRenderSym r => (Doc -> Doc) -> VSType r -> [SValue r] -> SValue r Source #

litSet :: CommonRenderSym r => (Doc -> Doc) -> (Doc -> Doc) -> VSType r -> [SValue r] -> SValue r Source #

stateVar :: (OORenderSym r, Monad r) => r (Visibility r) -> r (Permanence r) -> SVariable r -> CS (r Doc) Source #

inOutCall :: CommonRenderSym r => (Label -> VSType r -> [SValue r] -> SValue r) -> Label -> [SValue r] -> [SVariable r] -> [SVariable r] -> MSStatement r Source #

inOutFunc :: CommonRenderSym r => (VSType r -> [MSParameter r] -> MSBody r -> SMethod r) -> [SVariable r] -> [SVariable r] -> [SVariable r] -> MSBody r -> SMethod r Source #

listSize :: CommonRenderSym r => SValue r -> SValue r Source #

Call to get the size of a list in a language where this is not a method.

setDec :: OORenderSym r => (r (Value r) -> Doc) -> SValue r -> SVariable r -> r (Scope r) -> MSStatement r Source #

listAdd :: CommonRenderSym r => SValue r -> SValue r -> SValue r -> SValue r Source #

Call to insert a value into a list in a language where this is not a method.

listAppend :: CommonRenderSym r => SValue r -> SValue r -> SValue r Source #

Call to append a value to a list in a language where this is not a method.

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' :: CommonRenderSym 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' :: CommonRenderSym 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 :: CommonRenderSym r => SVariable r -> r (Scope r) -> Maybe (SValue r) -> MSStatement r Source #

For declaring and optionally defining a variable in a language where declaring a variable before defining it is not required. v is the variable to declare, and e is Nothing if we are not defining it, and (Just d) if d is the value we are defining it as.