| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Drasil.GOOL
Description
re-export smart constructors for external code writing
Synopsis
- type Label = String
- type GSProgram (a :: k -> Type) (prg :: k) = GS (a prg)
- type Body = Doc
- type CS = State ClassState
- type FS = State FileState
- type MS = State MethodState
- type VS = State ValueState
- type SVariable (a :: Type -> Type) = VS (a Variable)
- type SValue (a :: Type -> Type) = VS (a Value)
- type CSStateVar (r :: k -> Type) (stvr :: k) = CS (r stvr)
- type Class = Doc
- type NamedArgs (r :: Type -> Type) = [(SVariable r, SValue r)]
- type Initializers (r :: Type -> Type) = [(SVariable r, SValue r)]
- class (UnRepr r TypeData, Argument r, BodySym r bod block, BlockSym r block stmt, CommandLineArgs r, Literal r, MathConstant r, OOVariableValue r, BooleanExpression r, Comparison r, NumericExpression r, InternalValueExp r, OOValueExpression r, Array r, List r, ListStatement r stmt, Reference r, Set r, OOFunctionSym r, ParameterSym r, VariableValue r, ScopeSym r, BinderSym r, InternalList r block, MethodSym r vis mthd bod, OOMethodSym r vis mthd attch bod, ClassSym r vis mthd stvr attch, TypeElim r, VariableElim r, EmptyStatement r stmt, MultiStatement r stmt, ValueStatement r stmt, CommentStatement r stmt, OODeclStatement r stmt bod, AssignStatement r stmt, OOFuncAppStatement r stmt, ControlStatement r stmt bod, StringStatement r stmt, PrintConsole r stmt, ReadConsole r stmt, FileHandling r stmt, PrintFile r stmt, ReadFile r stmt, ModuleSym r mod mthd, FileSym r file mod, ProgramSym r prg file) => OOProg (r :: Type -> Type) vis stmt mthd stvr attch prg file mod bod block
- class ProgramSym (r :: k -> Type) (prg :: k) (file :: k) | r -> prg file where
- class FileSym (r :: k -> Type) (file :: k) (mod :: k) | r -> file mod where
- class AttachmentSym (r :: k -> Type) (attch :: k) | r -> attch where
- classLevel :: r attch
- instanceLevel :: r attch
- class BodySym (r :: k -> Type) (bod :: k) (block :: k) | r -> bod block where
- bodyStatements :: forall {k} r (block :: k) (stmt :: k) (bod :: k). (BlockSym r block stmt, BodySym r bod block) => [MS (r stmt)] -> MS (r bod)
- oneLiner :: forall {k} r (block :: k) (stmt :: k) (bod :: k). (BlockSym r block stmt, BodySym r bod block) => MS (r stmt) -> MS (r bod)
- class BlockSym (r :: k -> Type) (block :: k) (stmt :: k) | r -> block stmt where
- class TypeSym (r :: Type -> Type) where
- bool :: VS (r TypeData)
- int :: VS (r TypeData)
- float :: VS (r TypeData)
- double :: VS (r TypeData)
- char :: VS (r TypeData)
- string :: VS (r TypeData)
- infile :: VS (r TypeData)
- outfile :: VS (r TypeData)
- referenceType :: VS (r TypeData) -> VS (r TypeData)
- listType :: VS (r TypeData) -> VS (r TypeData)
- setType :: VS (r TypeData) -> VS (r TypeData)
- arrayType :: VS (r TypeData) -> VS (r TypeData)
- innerType :: VS (r TypeData) -> VS (r TypeData)
- funcType :: [VS (r TypeData)] -> VS (r TypeData) -> VS (r TypeData)
- void :: VS (r TypeData)
- class TypeSym r => OOTypeSym (r :: Type -> Type) where
- class TypeSym r => BinderSym (r :: Type -> Type) where
- class EmptyStatement (r :: k -> Type) (stmt :: k) | r -> stmt where
- class MultiStatement (r :: k -> Type) (stmt :: k) | r -> stmt where
- class ValueStatement (r :: Type -> Type) stmt | r -> stmt where
- class VariableSym r => AssignStatement (r :: Type -> Type) stmt | r -> stmt where
- (&=) :: AssignStatement r stmt => SVariable r -> SValue r -> MS (r stmt)
- class (VariableSym r, ScopeSym r) => DeclStatement (r :: Type -> Type) stmt bod | r -> stmt bod where
- varDec :: SVariable r -> r ScopeData -> MS (r stmt)
- varDecDef :: SVariable r -> r ScopeData -> SValue r -> MS (r stmt)
- listDec :: Integer -> SVariable r -> r ScopeData -> MS (r stmt)
- listDecDef :: SVariable r -> r ScopeData -> [SValue r] -> MS (r stmt)
- setDec :: SVariable r -> r ScopeData -> MS (r stmt)
- setDecDef :: SVariable r -> r ScopeData -> SValue r -> MS (r stmt)
- arrayDec :: Integer -> SValue r -> SVariable r -> r ScopeData -> MS (r stmt)
- arrayDecDef :: SVariable r -> r ScopeData -> [SValue r] -> MS (r stmt)
- constDecDef :: SVariable r -> r ScopeData -> SValue r -> MS (r stmt)
- funcDecDef :: SVariable r -> r ScopeData -> [SVariable r] -> MS (r bod) -> MS (r stmt)
- class (DeclStatement r stmt bod, OOVariableSym r) => OODeclStatement (r :: Type -> Type) stmt bod where
- objDecNewNoParams :: OODeclStatement r stmt bod => SVariable r -> r ScopeData -> MS (r stmt)
- extObjDecNewNoParams :: OODeclStatement r stmt bod => Library -> SVariable r -> r ScopeData -> MS (r stmt)
- class VariableSym r => PrintConsole (r :: Type -> Type) stmt | r -> stmt where
- class VariableSym r => ReadConsole (r :: Type -> Type) stmt | r -> stmt where
- getInput :: SVariable r -> MS (r stmt)
- discardInput :: MS (r stmt)
- class VariableSym r => FileHandling (r :: Type -> Type) stmt | r -> stmt where
- class VariableSym r => PrintFile (r :: Type -> Type) stmt | r -> stmt where
- class VariableSym r => ReadFile (r :: Type -> Type) stmt | r -> stmt where
- getFileInput :: SValue r -> SVariable r -> MS (r stmt)
- discardFileInput :: SValue r -> MS (r stmt)
- getFileInputLine :: SValue r -> SVariable r -> MS (r stmt)
- discardFileLine :: SValue r -> MS (r stmt)
- getFileInputAll :: SValue r -> SVariable r -> MS (r stmt)
- class VariableSym r => StringStatement (r :: Type -> Type) stmt | r -> stmt where
- stringSplit :: Char -> SVariable r -> SValue r -> MS (r stmt)
- stringListVals :: [SVariable r] -> SValue r -> MS (r stmt)
- stringListLists :: [SVariable r] -> SValue r -> MS (r stmt)
- class VariableSym r => FuncAppStatement (r :: Type -> Type) stmt | r -> stmt where
- inOutCall :: InOutCall r stmt
- extInOutCall :: Library -> InOutCall r stmt
- class (FuncAppStatement r stmt, OOVariableSym r) => OOFuncAppStatement (r :: Type -> Type) stmt where
- selfInOutCall :: InOutCall r stmt
- class CommentStatement (r :: k -> Type) (stmt :: k) | r -> stmt where
- initObserverList :: DeclStatement r stmt bod => VS (r TypeData) -> [SValue r] -> r ScopeData -> MS (r stmt)
- addObserver :: (OOVariableValue r, List r, ListStatement r stmt) => SValue r -> MS (r stmt)
- class VariableSym r => ControlStatement (r :: Type -> Type) stmt bod | r -> stmt bod where
- break :: MS (r stmt)
- continue :: MS (r stmt)
- returnStmt :: SValue r -> MS (r stmt)
- throw :: Label -> MS (r stmt)
- ifCond :: [(SValue r, MS (r bod))] -> MS (r bod) -> MS (r stmt)
- switch :: SValue r -> [(SValue r, MS (r bod))] -> MS (r bod) -> MS (r stmt)
- ifExists :: SValue r -> MS (r bod) -> MS (r bod) -> MS (r stmt)
- for :: MS (r stmt) -> SValue r -> MS (r stmt) -> MS (r bod) -> MS (r stmt)
- forRange :: SVariable r -> SValue r -> SValue r -> SValue r -> MS (r bod) -> MS (r stmt)
- forEach :: SVariable r -> SValue r -> MS (r bod) -> MS (r stmt)
- while :: SValue r -> MS (r bod) -> MS (r stmt)
- tryCatch :: MS (r bod) -> MS (r bod) -> MS (r stmt)
- assert :: SValue r -> SValue r -> MS (r stmt)
- ifNoElse :: (BodySym r bod block, ControlStatement r stmt bod) => [(SValue r, MS (r bod))] -> MS (r stmt)
- switchAsIf :: (ControlStatement r stmt bod, Comparison r) => SValue r -> [(SValue r, MS (r bod))] -> MS (r bod) -> MS (r stmt)
- class TypeSym r => VariableSym (r :: Type -> Type) where
- class ScopeSym (r :: Type -> Type) where
- data ScopeData
- class (VariableSym r, OOTypeSym r) => OOVariableSym (r :: Type -> Type) where
- class OOVariableSym r => SelfSym (r :: Type -> Type) where
- instanceVarSelf :: (SelfSym r, VariableValue r) => SVariable r -> SVariable r
- class VariableSym r => VariableElim (r :: Type -> Type) where
- variableName :: r Variable -> String
- variableType :: r Variable -> r TypeData
- ($->) :: OOVariableSym r => SValue r -> SVariable r -> SVariable r
- listOf :: VariableSym r => Label -> VS (r TypeData) -> SVariable r
- listVar :: VariableSym r => Label -> VS (r TypeData) -> SVariable r
- class TypeSym r => ValueSym (r :: Type -> Type) where
- class ValueSym r => Argument (r :: Type -> Type) where
- pointerArg :: SValue r -> SValue r
- class ValueSym r => Literal (r :: Type -> Type) where
- litTrue :: SValue r
- litFalse :: SValue r
- litChar :: Char -> SValue r
- litDouble :: Double -> SValue r
- litFloat :: Float -> SValue r
- litInt :: Integer -> SValue r
- litString :: String -> SValue r
- litArray :: VS (r TypeData) -> [SValue r] -> SValue r
- litList :: VS (r TypeData) -> [SValue r] -> SValue r
- litSet :: VS (r TypeData) -> [SValue r] -> SValue r
- class ValueSym r => MathConstant (r :: Type -> Type) where
- class (VariableSym r, ValueSym r) => VariableValue (r :: Type -> Type) where
- class (VariableValue r, OOVariableSym r, SelfSym r) => OOVariableValue (r :: Type -> Type)
- class ValueSym r => CommandLineArgs (r :: Type -> Type) where
- class ValueSym r => NumericExpression (r :: Type -> Type) where
- (#~) :: SValue r -> SValue r
- (#/^) :: SValue r -> SValue r
- (#|) :: SValue r -> SValue r
- (#+) :: SValue r -> SValue r -> SValue r
- (#-) :: SValue r -> SValue r -> SValue r
- (#*) :: SValue r -> SValue r -> SValue r
- (#/) :: SValue r -> SValue r -> SValue r
- (#%) :: SValue r -> SValue r -> SValue r
- (#^) :: SValue r -> SValue r -> SValue r
- log :: SValue r -> SValue r
- ln :: SValue r -> SValue r
- exp :: SValue r -> SValue r
- sin :: SValue r -> SValue r
- cos :: SValue r -> SValue r
- tan :: SValue r -> SValue r
- csc :: SValue r -> SValue r
- sec :: SValue r -> SValue r
- cot :: SValue r -> SValue r
- arcsin :: SValue r -> SValue r
- arccos :: SValue r -> SValue r
- arctan :: SValue r -> SValue r
- floor :: SValue r -> SValue r
- ceil :: SValue r -> SValue r
- class ValueSym r => BooleanExpression (r :: Type -> Type) where
- class ValueSym r => Comparison (r :: Type -> Type) where
- class (VariableSym r, ValueSym r) => ValueExpression (r :: Type -> Type) where
- class ValueSym r => InternalValueExp (r :: Type -> Type)
- class (ValueExpression r, OOVariableSym r, OOValueSym r) => OOValueExpression (r :: Type -> Type) where
- newObjMixedArgs :: MixedCtorCall r
- extNewObjMixedArgs :: Library -> MixedCtorCall r
- libNewObjMixedArgs :: Library -> MixedCtorCall r
- funcApp :: ValueExpression r => PosCall r
- funcAppNamedArgs :: ValueExpression r => Label -> VS (r TypeData) -> NamedArgs r -> SValue r
- selfMethodCall :: (InternalValueExp r, VariableValue r, SelfSym r) => PosCall r
- extFuncApp :: ValueExpression r => Library -> PosCall r
- libFuncApp :: ValueExpression r => Library -> PosCall r
- newObj :: OOValueExpression r => PosCtorCall r
- extNewObj :: OOValueExpression r => Library -> PosCtorCall r
- libNewObj :: OOValueExpression r => Library -> PosCtorCall r
- exists :: ValueExpression r => SValue r -> SValue r
- objMethodCall :: InternalValueExp r => VS (r TypeData) -> SValue r -> Label -> [SValue r] -> SValue r
- objMethodCallNamedArgs :: InternalValueExp r => VS (r TypeData) -> SValue r -> Label -> NamedArgs r -> SValue r
- objMethodCallMixedArgs :: InternalValueExp r => VS (r TypeData) -> SValue r -> Label -> [SValue r] -> NamedArgs r -> SValue r
- objMethodCallNoParams :: InternalValueExp r => VS (r TypeData) -> SValue r -> Label -> SValue r
- classMethodCall :: InternalValueExp r => VS (r TypeData) -> VS (r TypeData) -> Label -> [SValue r] -> SValue r
- classMethodCallNamedArgs :: InternalValueExp r => VS (r TypeData) -> VS (r TypeData) -> Label -> NamedArgs r -> SValue r
- classMethodCallMixedArgs :: InternalValueExp r => VS (r TypeData) -> VS (r TypeData) -> Label -> [SValue r] -> NamedArgs r -> SValue r
- classMethodCallNoParams :: InternalValueExp r => VS (r TypeData) -> VS (r TypeData) -> Label -> SValue r
- class ValueSym r => FunctionSym (r :: Type -> Type)
- class FunctionSym r => OOFunctionSym (r :: Type -> Type) where
- ($.) :: OOFunctionSym r => SValue r -> VS (r FuncData) -> SValue r
- selfAccess :: (OOVariableValue r, OOFunctionSym r) => VS (r FuncData) -> SValue r
- class (ValueSym r, VariableSym r) => GetSet (r :: Type -> Type) where
- class (TypeSym r, ValueSym r) => Reference (r :: Type -> Type) where
- class IndexTranslator r => Array (r :: Type -> Type) where
- class IndexTranslator r => List (r :: Type -> Type) where
- class ListStatement (r :: Type -> Type) stmt | r -> stmt where
- class ValueSym r => InternalList (r :: Type -> Type) block | r -> block
- listSlice :: InternalList r block => SVariable r -> SValue r -> Maybe (SValue r) -> Maybe (SValue r) -> Maybe (SValue r) -> MS (r block)
- class ValueSym r => Set (r :: Type -> Type) where
- listIndexExists :: (List r, Comparison r) => SValue r -> SValue r -> SValue r
- at :: List r => SValue r -> SValue r -> SValue r
- class OOFunctionSym r => ObserverPattern (r :: Type -> Type) stmt | r -> stmt where
- class VariableSym r => StrategyPattern (r :: Type -> Type) bod block | r -> bod block where
- class VisibilitySym (r :: k -> Type) (vis :: k) | r -> vis where
- class VariableSym r => ParameterSym (r :: Type -> Type) where
- class (ParameterSym r, VisibilitySym r vis) => MethodSym (r :: Type -> Type) vis mthd bod | r -> mthd bod where
- docMain :: MS (r bod) -> MS (r mthd)
- function :: Label -> r vis -> VS (r TypeData) -> [MS (r ParamData)] -> MS (r bod) -> MS (r mthd)
- mainFunction :: MS (r bod) -> MS (r mthd)
- docFunc :: String -> [String] -> Maybe String -> MS (r mthd) -> MS (r mthd)
- inOutFunc :: Label -> r vis -> InOutFunc r mthd bod
- docInOutFunc :: Label -> r vis -> DocInOutFunc r mthd bod
- class AttachmentSym r attch => OOMethodSym (r :: Type -> Type) vis mthd attch bod | r -> vis mthd bod where
- method :: Label -> r vis -> r attch -> VS (r TypeData) -> [MS (r ParamData)] -> MS (r bod) -> MS (r mthd)
- getMethod :: SVariable r -> MS (r mthd)
- setMethod :: SVariable r -> MS (r mthd)
- constructor :: [MS (r ParamData)] -> Initializers r -> MS (r bod) -> MS (r mthd)
- inOutMethod :: Label -> r vis -> r attch -> InOutFunc r mthd bod
- docInOutMethod :: Label -> r vis -> r attch -> DocInOutFunc r mthd bod
- privMethod :: (OOMethodSym r vis mthd attch bod, VisibilitySym r vis) => Label -> VS (r TypeData) -> [MS (r ParamData)] -> MS (r bod) -> MS (r mthd)
- pubMethod :: (OOMethodSym r vis mthd attch bod, VisibilitySym r vis) => Label -> VS (r TypeData) -> [MS (r ParamData)] -> MS (r bod) -> MS (r mthd)
- initializer :: (OOMethodSym r vis mthd attch bod, BodySym r bod block) => [MS (r ParamData)] -> Initializers r -> MS (r mthd)
- nonInitConstructor :: OOMethodSym r vis mthd attch bod => [MS (r ParamData)] -> MS (r bod) -> MS (r mthd)
- class (VisibilitySym r vis, AttachmentSym r attch, VariableSym r) => StateVarSym (r :: Type -> Type) vis stvr attch | r -> stvr where
- stateVar :: r vis -> r attch -> SVariable r -> CSStateVar r stvr
- stateVarDef :: r vis -> r attch -> SVariable r -> SValue r -> CSStateVar r stvr
- constVar :: r vis -> SVariable r -> SValue r -> CSStateVar r stvr
- privDVar :: StateVarSym r vis stvr attch => SVariable r -> CSStateVar r stvr
- pubDVar :: StateVarSym r vis stvr attch => SVariable r -> CSStateVar r stvr
- pubSVar :: StateVarSym r vis stvr attch => SVariable r -> CSStateVar r stvr
- class StateVarSym r vis stvr attch => ClassSym (r :: Type -> Type) vis mthd stvr attch | r -> mthd where
- buildClass :: Maybe Label -> [CSStateVar r stvr] -> [MS (r mthd)] -> [MS (r mthd)] -> CS (r Class)
- extraClass :: Label -> Maybe Label -> [CSStateVar r stvr] -> [MS (r mthd)] -> [MS (r mthd)] -> CS (r Class)
- implementingClass :: Label -> [Label] -> [CSStateVar r stvr] -> [MS (r mthd)] -> [MS (r mthd)] -> CS (r Class)
- docClass :: String -> CS (r Class) -> CS (r Class)
- class ModuleSym (r :: Type -> Type) mod mthd | r -> mod mthd where
- convType :: TypeSym r => CodeType -> VS (r TypeData)
- convTypeOO :: OOTypeSym r => CodeType -> VS (r TypeData)
- data ProgData
- data FileData
- data ModData
- data TypeData
- data VisibilityTag
- data ParamData
- data CodeType
- data GOOLState = GS {}
- lensMStoVS :: Lens' MethodState ValueState
- headers :: Lens' GOOLState [FilePath]
- sources :: Lens' GOOLState [FilePath]
- mainMod :: Lens' GOOLState (Maybe FilePath)
- initialState :: GOOLState
- onStateValue :: (a -> b) -> State s a -> State s b
- onCodeList :: Monad m => ([a] -> b) -> [m a] -> m b
- unCI :: CodeInfoOO a -> a
- unPC :: PythonCode a -> a
- unJC :: JavaCode a -> a
- unCSC :: CSharpCode a -> a
- unCPPC :: CppCode CppSrcCode CppHdrCode a -> a
- unSC :: SwiftCode a -> a
- pyName :: String
- pyVersion :: String
- jName :: String
- jVersion :: String
- csName :: String
- csVersion :: String
- cppName :: String
- cppVersion :: String
- swiftName :: String
- swiftVersion :: String
- newtype LoggingFor (r :: Type -> Type) a = LC {
- unLC :: r a
- class TypeSym r => TypeElim (r :: Type -> Type) where
- getCodeType :: r TypeData -> CodeType
- getTypeString :: UnRepr r TypeData => r TypeData -> String
Documentation
type CSStateVar (r :: k -> Type) (stvr :: k) = CS (r stvr) Source #
class (UnRepr r TypeData, Argument r, BodySym r bod block, BlockSym r block stmt, CommandLineArgs r, Literal r, MathConstant r, OOVariableValue r, BooleanExpression r, Comparison r, NumericExpression r, InternalValueExp r, OOValueExpression r, Array r, List r, ListStatement r stmt, Reference r, Set r, OOFunctionSym r, ParameterSym r, VariableValue r, ScopeSym r, BinderSym r, InternalList r block, MethodSym r vis mthd bod, OOMethodSym r vis mthd attch bod, ClassSym r vis mthd stvr attch, TypeElim r, VariableElim r, EmptyStatement r stmt, MultiStatement r stmt, ValueStatement r stmt, CommentStatement r stmt, OODeclStatement r stmt bod, AssignStatement r stmt, OOFuncAppStatement r stmt, ControlStatement r stmt bod, StringStatement r stmt, PrintConsole r stmt, ReadConsole r stmt, FileHandling r stmt, PrintFile r stmt, ReadFile r stmt, ModuleSym r mod mthd, FileSym r file mod, ProgramSym r prg file) => OOProg (r :: Type -> Type) vis stmt mthd stvr attch prg file mod bod block Source #
Wrapper typeclass that bundles everything essential for generating an object-oriented program.
Instances
| OOProg CodeInfoOO () () () () () GOOLState () () () () Source # | |
Defined in Drasil.GOOL.CodeInfoOO | |
| OOProg CSharpCode Doc (Doc, Terminator) MethodData StateVar Doc ProgData FileData ModData Body Block Source # | |
Defined in Drasil.GOOL.LanguageRenderer.CSharpRenderer | |
| OOProg JavaCode Doc (Doc, Terminator) MethodData StateVar Doc ProgData FileData ModData Body Block Source # | |
Defined in Drasil.GOOL.LanguageRenderer.JavaRenderer | |
| OOProg PythonCode Doc (Doc, Terminator) MethodData StateVar AttachmentData ProgData FileData ModData Body Block Source # | |
Defined in Drasil.GOOL.LanguageRenderer.PythonRenderer | |
| OOProg SwiftCode Doc (Doc, Terminator) MethodData StateVar Doc ProgData FileData ModData Body Block Source # | |
Defined in Drasil.GOOL.LanguageRenderer.SwiftRenderer | |
| OOProg r vis stmt mthd stvr attch prg file mod bod block => OOProg (LoggingFor r) vis stmt mthd stvr attch prg file mod bod block Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor | |
class ProgramSym (r :: k -> Type) (prg :: k) (file :: k) | r -> prg file where Source #
Class for representing a program.
Usually ProgData is used for the representation.
Methods
prog :: Label -> Label -> [FS (r file)] -> GSProgram r prg Source #
Given program name, program purpose, and list of files, Generates a representation of a program.
Instances
class FileSym (r :: k -> Type) (file :: k) (mod :: k) | r -> file mod where Source #
Class for representing a file.
Methods
fileDoc :: FS (r mod) -> FS (r file) Source #
Given a module, generates a representation of a file. (Implicit assumption: exactly one module per file)
docMod :: String -> String -> [String] -> String -> FS (r file) -> FS (r file) Source #
Given module description, watermark, list of author names, date as a String, and file to comment, creates a documented module (i.e. module with a header comment)
Instances
class AttachmentSym (r :: k -> Type) (attch :: k) | r -> attch where Source #
Used to differentiate whether a member is attached to the class or the instance
Instances
class BodySym (r :: k -> Type) (bod :: k) (block :: k) | r -> bod block where Source #
Class for representing a Body, which is basically a lexical scope of code.
Examples include a function body, the branch(es) of an `if`-statement, etc.
Methods
body :: [MS (r block)] -> MS (r bod) Source #
addComments :: Label -> MS (r bod) -> MS (r bod) Source #
Given a comment and a body, add the comment as a header for the body.
Instances
bodyStatements :: forall {k} r (block :: k) (stmt :: k) (bod :: k). (BlockSym r block stmt, BodySym r bod block) => [MS (r stmt)] -> MS (r bod) Source #
oneLiner :: forall {k} r (block :: k) (stmt :: k) (bod :: k). (BlockSym r block stmt, BodySym r bod block) => MS (r stmt) -> MS (r bod) Source #
class BlockSym (r :: k -> Type) (block :: k) (stmt :: k) | r -> block stmt where Source #
Class for representing a block of code.
A block is a series of statements grouped together,
not for use by the compiler/interpreter
but to improve readability of the generated code.
See the bottom of page 2 of Brook's GOOL paper from 2020 for more details.
Instances
class TypeSym (r :: Type -> Type) where Source #
Class for representing a type.
Methods
bool :: VS (r TypeData) Source #
int :: VS (r TypeData) Source #
float :: VS (r TypeData) Source #
double :: VS (r TypeData) Source #
char :: VS (r TypeData) Source #
string :: VS (r TypeData) Source #
infile :: VS (r TypeData) Source #
outfile :: VS (r TypeData) Source #
referenceType :: VS (r TypeData) -> VS (r TypeData) Source #
listType :: VS (r TypeData) -> VS (r TypeData) Source #
setType :: VS (r TypeData) -> VS (r TypeData) Source #
arrayType :: VS (r TypeData) -> VS (r TypeData) Source #
innerType :: VS (r TypeData) -> VS (r TypeData) Source #
funcType :: [VS (r TypeData)] -> VS (r TypeData) -> VS (r TypeData) Source #
Instances
class TypeSym r => OOTypeSym (r :: Type -> Type) where Source #
Instances
| OOTypeSym CodeInfoOO Source # | |
Defined in Drasil.GOOL.CodeInfoOO | |
| OOTypeSym CSharpCode Source # | |
Defined in Drasil.GOOL.LanguageRenderer.CSharpRenderer | |
| OOTypeSym CppHdrCode Source # | |
Defined in Drasil.GOOL.LanguageRenderer.CppRenderer | |
| OOTypeSym CppSrcCode Source # | |
Defined in Drasil.GOOL.LanguageRenderer.CppRenderer | |
| OOTypeSym JavaCode Source # | |
| OOTypeSym PythonCode Source # | |
Defined in Drasil.GOOL.LanguageRenderer.PythonRenderer | |
| OOTypeSym SwiftCode Source # | |
| OOTypeSym r => OOTypeSym (LoggingFor r) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor | |
| Pair p => OOTypeSym (p CppSrcCode CppHdrCode) Source # | |
Defined in Drasil.GOOL.LanguageRenderer.CppRenderer Methods obj :: ClassName -> VS (p CppSrcCode CppHdrCode TypeData) Source # | |
class TypeSym r => BinderSym (r :: Type -> Type) where Source #
A class for representing a binder, i.e. the binding of a variable name to a type, scope, etc. As of July 2026, integration of this typeclass is still WIP, blocked by issues with our variable map.
Instances
class EmptyStatement (r :: k -> Type) (stmt :: k) | r -> stmt where Source #
Instances
class MultiStatement (r :: k -> Type) (stmt :: k) | r -> stmt where Source #
Methods
multi :: [MS (r stmt)] -> MS (r stmt) Source #
Consolidates a list of statements into a single statement
Instances
class ValueStatement (r :: Type -> Type) stmt | r -> stmt where Source #
Instances
class VariableSym r => AssignStatement (r :: Type -> Type) stmt | r -> stmt where Source #
Methods
(&-=) :: SVariable r -> SValue r -> MS (r stmt) infixl 1 Source #
(&+=) :: SVariable r -> SValue r -> MS (r stmt) infixl 1 Source #
(&++) :: SVariable r -> MS (r stmt) infixl 8 Source #
Instances
class (VariableSym r, ScopeSym r) => DeclStatement (r :: Type -> Type) stmt bod | r -> stmt bod where Source #
Methods
varDec :: SVariable r -> r ScopeData -> MS (r stmt) Source #
Declare a variable without giving it a value.
Not for use with arrays; use arrayDec instead.
varDecDef :: SVariable r -> r ScopeData -> SValue r -> MS (r stmt) Source #
Declare a variable and give it a value.
Not for use with arrays; use arrayDecDef instead.
listDec :: Integer -> SVariable r -> r ScopeData -> MS (r stmt) Source #
Given the size of the list, the variable to store the list in, and the scope of the variable, declare a list of the given size.
listDecDef :: SVariable r -> r ScopeData -> [SValue r] -> MS (r stmt) Source #
setDec :: SVariable r -> r ScopeData -> MS (r stmt) Source #
setDecDef :: SVariable r -> r ScopeData -> SValue r -> MS (r stmt) Source #
arrayDec :: Integer -> SValue r -> SVariable r -> r ScopeData -> MS (r stmt) Source #
Given the size of the aray, the default value to fill the array with, the variable to store the array in, and the scope of the variable, declare an array of the given size.
arrayDecDef :: SVariable r -> r ScopeData -> [SValue r] -> MS (r stmt) Source #
constDecDef :: SVariable r -> r ScopeData -> SValue r -> MS (r stmt) Source #
funcDecDef :: SVariable r -> r ScopeData -> [SVariable r] -> MS (r bod) -> MS (r stmt) Source #
Instances
class (DeclStatement r stmt bod, OOVariableSym r) => OODeclStatement (r :: Type -> Type) stmt bod where Source #
Methods
objDecDef :: SVariable r -> r ScopeData -> SValue r -> MS (r stmt) Source #
objDecNew :: SVariable r -> r ScopeData -> [SValue r] -> MS (r stmt) Source #
extObjDecNew :: Library -> SVariable r -> r ScopeData -> [SValue r] -> MS (r stmt) Source #
Instances
objDecNewNoParams :: OODeclStatement r stmt bod => SVariable r -> r ScopeData -> MS (r stmt) Source #
extObjDecNewNoParams :: OODeclStatement r stmt bod => Library -> SVariable r -> r ScopeData -> MS (r stmt) Source #
class VariableSym r => PrintConsole (r :: Type -> Type) stmt | r -> stmt where Source #
Methods
print :: SValue r -> MS (r stmt) Source #
printLn :: SValue r -> MS (r stmt) Source #
printStr :: String -> MS (r stmt) Source #
printStrLn :: String -> MS (r stmt) Source #
Instances
class VariableSym r => ReadConsole (r :: Type -> Type) stmt | r -> stmt where Source #
Instances
class VariableSym r => FileHandling (r :: Type -> Type) stmt | r -> stmt where Source #
Methods
openFileR :: SVariable r -> SValue r -> MS (r stmt) Source #
openFileW :: SVariable r -> SValue r -> MS (r stmt) Source #
openFileA :: SVariable r -> SValue r -> MS (r stmt) Source #
Instances
class VariableSym r => PrintFile (r :: Type -> Type) stmt | r -> stmt where Source #
Methods
printFile :: SValue r -> SValue r -> MS (r stmt) Source #
Given the file handle and value to print, print the value to the file.
printFileLn :: SValue r -> SValue r -> MS (r stmt) Source #
printFileStr :: SValue r -> String -> MS (r stmt) Source #
printFileStrLn :: SValue r -> String -> MS (r stmt) Source #
Instances
class VariableSym r => ReadFile (r :: Type -> Type) stmt | r -> stmt where Source #
Methods
getFileInput :: SValue r -> SVariable r -> MS (r stmt) Source #
discardFileInput :: SValue r -> MS (r stmt) Source #
getFileInputLine :: SValue r -> SVariable r -> MS (r stmt) Source #
discardFileLine :: SValue r -> MS (r stmt) Source #
getFileInputAll :: SValue r -> SVariable r -> MS (r stmt) Source #
Instances
class VariableSym r => StringStatement (r :: Type -> Type) stmt | r -> stmt where Source #
Methods
stringSplit :: Char -> SVariable r -> SValue r -> MS (r stmt) Source #
Given a char to split on, variable to store result in, and string to split, generates a statement splitting the string into a list of strings delimited by the char.
stringListVals :: [SVariable r] -> SValue r -> MS (r stmt) Source #
stringListLists :: [SVariable r] -> SValue r -> MS (r stmt) Source #
Given a list of variables and a value containing a list of strings, assign the ith element of the list of strings into the ith variable
Instances
class VariableSym r => FuncAppStatement (r :: Type -> Type) stmt | r -> stmt where Source #
Instances
class (FuncAppStatement r stmt, OOVariableSym r) => OOFuncAppStatement (r :: Type -> Type) stmt where Source #
Methods
selfInOutCall :: InOutCall r stmt Source #
Instances
class CommentStatement (r :: k -> Type) (stmt :: k) | r -> stmt where Source #
Instances
initObserverList :: DeclStatement r stmt bod => VS (r TypeData) -> [SValue r] -> r ScopeData -> MS (r stmt) Source #
addObserver :: (OOVariableValue r, List r, ListStatement r stmt) => SValue r -> MS (r stmt) Source #
class VariableSym r => ControlStatement (r :: Type -> Type) stmt bod | r -> stmt bod where Source #
Methods
continue :: MS (r stmt) Source #
returnStmt :: SValue r -> MS (r stmt) Source #
throw :: Label -> MS (r stmt) Source #
ifCond :: [(SValue r, MS (r bod))] -> MS (r bod) -> MS (r stmt) Source #
String of if-else statements. Arguments: List of predicates and bodies (if this then that), Body for else branch
switch :: SValue r -> [(SValue r, MS (r bod))] -> MS (r bod) -> MS (r stmt) Source #
ifExists :: SValue r -> MS (r bod) -> MS (r bod) -> MS (r stmt) Source #
for :: MS (r stmt) -> SValue r -> MS (r stmt) -> MS (r bod) -> MS (r stmt) Source #
forRange :: SVariable r -> SValue r -> SValue r -> SValue r -> MS (r bod) -> MS (r stmt) Source #
forEach :: SVariable r -> SValue r -> MS (r bod) -> MS (r stmt) Source #
while :: SValue r -> MS (r bod) -> MS (r stmt) Source #
tryCatch :: MS (r bod) -> MS (r bod) -> MS (r stmt) Source #
Instances
ifNoElse :: (BodySym r bod block, ControlStatement r stmt bod) => [(SValue r, MS (r bod))] -> MS (r stmt) Source #
switchAsIf :: (ControlStatement r stmt bod, Comparison r) => SValue r -> [(SValue r, MS (r bod))] -> MS (r bod) -> MS (r stmt) Source #
class TypeSym r => VariableSym (r :: Type -> Type) where Source #
Class for representing variables.
Methods
var :: Label -> VS (r TypeData) -> SVariable r Source #
An instance- or function-level variable, separate from its instance (i.e. v, not `o.v`)
constant :: Label -> VS (r TypeData) -> SVariable r Source #
An instance- or function-level constant, separate from its instance (i.e. v, not `o.v`)
extVar :: 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
Instances
class ScopeSym (r :: Type -> Type) where Source #
Class for representing the lexical scope of a variable.
Currently only differentiates global and local,
allowing individual renderers to define which of them the main function is.
Instances
| ScopeSym CodeInfoOO Source # | |
Defined in Drasil.GOOL.CodeInfoOO | |
| ScopeSym CSharpCode Source # | |
Defined in Drasil.GOOL.LanguageRenderer.CSharpRenderer | |
| ScopeSym CppHdrCode Source # | |
Defined in Drasil.GOOL.LanguageRenderer.CppRenderer | |
| ScopeSym CppSrcCode Source # | |
Defined in Drasil.GOOL.LanguageRenderer.CppRenderer | |
| ScopeSym JavaCode Source # | |
| ScopeSym PythonCode Source # | |
Defined in Drasil.GOOL.LanguageRenderer.PythonRenderer | |
| ScopeSym SwiftCode Source # | |
| ScopeSym JuliaCode Source # | |
| ScopeSym MatlabCode Source # | |
Defined in Drasil.GProc.LanguageRenderer.MatlabRenderer | |
| ScopeSym r => ScopeSym (LoggingFor r) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods global :: LoggingFor r ScopeData Source # mainFn :: LoggingFor r ScopeData Source # local :: LoggingFor r ScopeData Source # | |
| Pair p => ScopeSym (p CppSrcCode CppHdrCode) Source # | |
Defined in Drasil.GOOL.LanguageRenderer.CppRenderer Methods global :: p CppSrcCode CppHdrCode ScopeData Source # | |
class (VariableSym r, OOTypeSym r) => OOVariableSym (r :: Type -> Type) where Source #
Methods
classVar :: Label -> VS (r TypeData) -> SVariable r Source #
A class-level variable, separate from its class (i.e. v, not v)
classConst :: Label -> VS (r TypeData) -> SVariable r Source #
A class-level constant, separate from its class (i.e. v, not v)
classVarAccess :: VS (r TypeData) -> SVariable r -> SVariable r Source #
Given a class C and a class-level variable v, creates v
extClassVarAccess :: VS (r TypeData) -> SVariable r -> SVariable r Source #
Given a class C from an external module and a class-level variable v,
performs any necessary imports and creates v
instanceVarAccess :: SValue r -> SVariable r -> SVariable r Source #
Given an instance i and an instance-level variable v, creates `i.v`
Instances
class OOVariableSym r => SelfSym (r :: Type -> Type) where Source #
Instances
| SelfSym CodeInfoOO Source # | |
Defined in Drasil.GOOL.CodeInfoOO Methods | |
| SelfSym CSharpCode Source # | |
Defined in Drasil.GOOL.LanguageRenderer.CSharpRenderer Methods | |
| SelfSym CppHdrCode Source # | |
Defined in Drasil.GOOL.LanguageRenderer.CppRenderer Methods | |
| SelfSym CppSrcCode Source # | |
Defined in Drasil.GOOL.LanguageRenderer.CppRenderer Methods | |
| SelfSym JavaCode Source # | |
| SelfSym PythonCode Source # | |
Defined in Drasil.GOOL.LanguageRenderer.PythonRenderer Methods | |
| SelfSym SwiftCode Source # | |
| SelfSym r => SelfSym (LoggingFor r) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods self :: SVariable (LoggingFor r) Source # | |
| Pair p => SelfSym (p CppSrcCode CppHdrCode) Source # | |
Defined in Drasil.GOOL.LanguageRenderer.CppRenderer Methods self :: SVariable (p CppSrcCode CppHdrCode) Source # | |
instanceVarSelf :: (SelfSym r, VariableValue r) => SVariable r -> SVariable r Source #
Given a variable v, creates `self.v`
class VariableSym r => VariableElim (r :: Type -> Type) where Source #
Methods
variableName :: r Variable -> String Source #
variableType :: r Variable -> r TypeData Source #
Instances
class TypeSym r => ValueSym (r :: Type -> Type) where Source #
Class for representing a value.
Instances
class ValueSym r => Argument (r :: Type -> Type) where Source #
Methods
pointerArg :: SValue r -> SValue r Source #
Instances
class ValueSym r => Literal (r :: Type -> Type) where Source #
Methods
litChar :: Char -> SValue r Source #
litDouble :: Double -> SValue r Source #
litFloat :: Float -> SValue r Source #
litInt :: Integer -> SValue r Source #
litString :: String -> SValue r Source #
litArray :: VS (r TypeData) -> [SValue r] -> SValue r Source #
litList :: VS (r TypeData) -> [SValue r] -> SValue r Source #
litSet :: VS (r TypeData) -> [SValue r] -> SValue r Source #
Instances
class ValueSym r => MathConstant (r :: Type -> Type) where Source #
Instances
class (VariableSym r, ValueSym r) => VariableValue (r :: Type -> Type) where Source #
Instances
class (VariableValue r, OOVariableSym r, SelfSym r) => OOVariableValue (r :: Type -> Type) Source #
Instances
class ValueSym r => CommandLineArgs (r :: Type -> Type) where Source #
Instances
class ValueSym r => NumericExpression (r :: Type -> Type) where Source #
Methods
(#~) :: SValue r -> SValue r infixl 8 Source #
(#/^) :: SValue r -> SValue r infixl 7 Source #
(#|) :: SValue r -> SValue r infixl 7 Source #
(#+) :: SValue r -> SValue r -> SValue r infixl 5 Source #
(#-) :: SValue r -> SValue r -> SValue r infixl 5 Source #
(#*) :: SValue r -> SValue r -> SValue r infixl 6 Source #
(#/) :: SValue r -> SValue r -> SValue r infixl 6 Source #
(#%) :: SValue r -> SValue r -> SValue r infixl 6 Source #
(#^) :: SValue r -> SValue r -> SValue r infixl 7 Source #
log :: SValue r -> SValue r Source #
ln :: SValue r -> SValue r Source #
exp :: SValue r -> SValue r Source #
sin :: SValue r -> SValue r Source #
cos :: SValue r -> SValue r Source #
tan :: SValue r -> SValue r Source #
csc :: SValue r -> SValue r Source #
sec :: SValue r -> SValue r Source #
cot :: SValue r -> SValue r Source #
arcsin :: SValue r -> SValue r Source #
arccos :: SValue r -> SValue r Source #
arctan :: SValue r -> SValue r Source #
Instances
class ValueSym r => BooleanExpression (r :: Type -> Type) where Source #
Methods
(?!) :: SValue r -> SValue r infixr 6 Source #
Instances
class ValueSym r => Comparison (r :: Type -> Type) where Source #
Methods
(?<) :: SValue r -> SValue r -> SValue r infixl 4 Source #
(?<=) :: SValue r -> SValue r -> SValue r infixl 4 Source #
(?>) :: SValue r -> SValue r -> SValue r infixl 4 Source #
(?>=) :: SValue r -> SValue r -> SValue r infixl 4 Source #
Instances
class (VariableSym r, ValueSym r) => ValueExpression (r :: Type -> Type) where Source #
A class for representing values that can include expressions
Methods
inlineIf :: SValue r -> SValue r -> SValue r -> SValue r Source #
funcAppMixedArgs :: MixedCall r Source #
extFuncAppMixedArgs :: Library -> MixedCall r Source #
libFuncAppMixedArgs :: Library -> MixedCall r Source #
Instances
class ValueSym r => InternalValueExp (r :: Type -> Type) Source #
A class for representing method calls, both instance- and class-level
Minimal complete definition
Instances
class (ValueExpression r, OOVariableSym r, OOValueSym r) => OOValueExpression (r :: Type -> Type) where Source #
Methods
newObjMixedArgs :: MixedCtorCall r Source #
extNewObjMixedArgs :: Library -> MixedCtorCall r Source #
libNewObjMixedArgs :: Library -> MixedCtorCall r Source #
Instances
funcApp :: ValueExpression r => PosCall r Source #
funcAppNamedArgs :: ValueExpression r => Label -> VS (r TypeData) -> NamedArgs r -> SValue r Source #
selfMethodCall :: (InternalValueExp r, VariableValue r, SelfSym r) => PosCall r Source #
extFuncApp :: ValueExpression r => Library -> PosCall r Source #
libFuncApp :: ValueExpression r => Library -> PosCall r Source #
newObj :: OOValueExpression r => PosCtorCall r Source #
extNewObj :: OOValueExpression r => Library -> PosCtorCall r Source #
libNewObj :: OOValueExpression r => Library -> PosCtorCall r Source #
objMethodCall :: InternalValueExp r => VS (r TypeData) -> SValue r -> Label -> [SValue r] -> SValue r Source #
Calling a method. t is the return type of the method, o is the object, f is the method name, and ps is a list of positional arguments.
objMethodCallNamedArgs :: InternalValueExp r => VS (r TypeData) -> SValue r -> Label -> NamedArgs r -> SValue r Source #
Calling a method with named arguments.
objMethodCallMixedArgs :: InternalValueExp r => VS (r TypeData) -> SValue r -> Label -> [SValue r] -> NamedArgs r -> SValue r Source #
Calling a method with a mix of positional and named arguments.
objMethodCallNoParams :: InternalValueExp r => VS (r TypeData) -> SValue r -> Label -> SValue r Source #
Calling a method with no parameters.
classMethodCall :: InternalValueExp r => VS (r TypeData) -> VS (r TypeData) -> Label -> [SValue r] -> SValue r Source #
Calling a class method. t is the return type of the method, c is the class, f is the method name, and ps is a list of positional arguments.
classMethodCallNamedArgs :: InternalValueExp r => VS (r TypeData) -> VS (r TypeData) -> Label -> NamedArgs r -> SValue r Source #
Calling a class method with named arguments.
classMethodCallMixedArgs :: InternalValueExp r => VS (r TypeData) -> VS (r TypeData) -> Label -> [SValue r] -> NamedArgs r -> SValue r Source #
Calling a class method with a mix of positional and named arguments.
classMethodCallNoParams :: InternalValueExp r => VS (r TypeData) -> VS (r TypeData) -> Label -> SValue r Source #
Calling a class method with no parameters.
class ValueSym r => FunctionSym (r :: Type -> Type) Source #
Instances
| FunctionSym CodeInfoOO Source # | |
Defined in Drasil.GOOL.CodeInfoOO | |
| FunctionSym CSharpCode Source # | |
Defined in Drasil.GOOL.LanguageRenderer.CSharpRenderer | |
| FunctionSym CppHdrCode Source # | |
Defined in Drasil.GOOL.LanguageRenderer.CppRenderer | |
| FunctionSym CppSrcCode Source # | |
Defined in Drasil.GOOL.LanguageRenderer.CppRenderer | |
| FunctionSym JavaCode Source # | |
Defined in Drasil.GOOL.LanguageRenderer.JavaRenderer | |
| FunctionSym PythonCode Source # | |
Defined in Drasil.GOOL.LanguageRenderer.PythonRenderer | |
| FunctionSym SwiftCode Source # | |
Defined in Drasil.GOOL.LanguageRenderer.SwiftRenderer | |
| FunctionSym JuliaCode Source # | |
Defined in Drasil.GProc.LanguageRenderer.JuliaRenderer | |
| FunctionSym MatlabCode Source # | |
Defined in Drasil.GProc.LanguageRenderer.MatlabRenderer | |
| FunctionSym r => FunctionSym (LoggingFor r) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor | |
| Pair p => FunctionSym (p CppSrcCode CppHdrCode) Source # | |
Defined in Drasil.GOOL.LanguageRenderer.CppRenderer | |
class FunctionSym r => OOFunctionSym (r :: Type -> Type) where Source #
Methods
func :: Label -> VS (r TypeData) -> [SValue r] -> VS (r FuncData) Source #
objAccess :: SValue r -> VS (r FuncData) -> SValue r Source #
Instances
selfAccess :: (OOVariableValue r, OOFunctionSym r) => VS (r FuncData) -> SValue r Source #
class (ValueSym r, VariableSym r) => GetSet (r :: Type -> Type) where Source #
Methods
get :: SValue r -> SVariable r -> SValue r Source #
set :: SValue r -> SVariable r -> SValue r -> SValue r Source #
Instances
class (TypeSym r, ValueSym r) => Reference (r :: Type -> Type) where Source #
A class for representing references. By "reference" we basically mean "C++ pointer" or "OCaml reference".
Methods
makeRef :: SValue r -> SValue r Source #
Given a value, convert it to a reference to that value
maybeDeref :: SValue r -> SValue r Source #
Given a value that may be a reference type, apply any necessary dereference operation.
Instances
class IndexTranslator r => Array (r :: Type -> Type) where Source #
Methods
arrayElem :: SValue r -> SValue r -> SVariable r Source #
Given array a and index i, creates `a[i]`
arrayLength :: SValue r -> SValue r Source #
Given an array, return its length
arrayCopy :: SValue r -> SValue r Source #
Given a source array, create a (shallow) copy of it
Instances
class IndexTranslator r => List (r :: Type -> Type) where Source #
Methods
listSize :: SValue r -> SValue r Source #
Finds the size of a list. Arguments are: List
listAccess :: SValue r -> SValue r -> SValue r Source #
Gets the value of an index of a list. Arguments are: List, Index
indexOf :: SValue r -> SValue r -> SValue r Source #
Finds the index of the first occurrence of a value in a list. Arguments are: List, Value
Instances
class ListStatement (r :: Type -> Type) stmt | r -> stmt where Source #
Methods
listAdd :: SValue r -> SValue r -> SValue r -> MS (r stmt) Source #
Inserts a value into a list. Arguments are: List, Index, Value
listAppend :: SValue r -> SValue r -> MS (r stmt) Source #
Appens a value to a list. Arguments are: List, Value
listSet :: SValue r -> SValue r -> SValue r -> MS (r stmt) Source #
Sets the value of an index of a list. Arguments are: List, Index, Value
Instances
class ValueSym r => InternalList (r :: Type -> Type) block | r -> block Source #
Minimal complete definition
Instances
listSlice :: InternalList r block => SVariable r -> SValue r -> Maybe (SValue r) -> Maybe (SValue r) -> Maybe (SValue r) -> MS (r block) Source #
Creates a slice of a list and assigns it to a variable. Arguments are: Variable to assign List to read from (optional) Start index inclusive. (if Nothing, then list start if step > 0, list end if step < 0) (optional) End index exclusive. (if Nothing, then list end if step > 0, list start if step > 0) (optional) Step (if Nothing, then defaults to 1)
class ValueSym r => Set (r :: Type -> Type) where Source #
Methods
contains :: SValue r -> SValue r -> SValue r Source #
Checks membership Arguments are: Set, Value
setAdd :: SValue r -> SValue r -> SValue r Source #
Inserts a value into a set Arguments are: Set, Value
setRemove :: SValue r -> SValue r -> SValue r Source #
Removes a value from a set Arguments are: Set, Value
setUnion :: SValue r -> SValue r -> SValue r Source #
Removes a value from a set Arguments are: Set, Set
Instances
listIndexExists :: (List r, Comparison r) => SValue r -> SValue r -> SValue r Source #
class OOFunctionSym r => ObserverPattern (r :: Type -> Type) stmt | r -> stmt where Source #
Instances
class VariableSym r => StrategyPattern (r :: Type -> Type) bod block | r -> bod block where Source #
Methods
runStrategy :: Label -> [(Label, MS (r bod))] -> Maybe (SValue r) -> Maybe (SVariable r) -> MS (r block) Source #
Instances
class VisibilitySym (r :: k -> Type) (vis :: k) | r -> vis where Source #
A class for representing Visibility, of a class member, i.e. whether it is public or private.
Instances
class VariableSym r => ParameterSym (r :: Type -> Type) where Source #
A class for representing function/method parameters.
Methods
param :: SVariable r -> MS (r ParamData) Source #
pointerParam :: SVariable r -> MS (r ParamData) Source #
A parameter that is an "alias" type, e.g. a C++ reference. This is a minor hack, to get around us not having/wanting "alias types" in GOOL.
Instances
class (ParameterSym r, VisibilitySym r vis) => MethodSym (r :: Type -> Type) vis mthd bod | r -> mthd bod where Source #
A class for representing functions/methods.
Usually MethodData is used for the representation.
Methods
docMain :: MS (r bod) -> MS (r mthd) Source #
function :: Label -> r vis -> VS (r TypeData) -> [MS (r ParamData)] -> MS (r bod) -> MS (r mthd) Source #
mainFunction :: MS (r bod) -> MS (r mthd) Source #
docFunc :: String -> [String] -> Maybe String -> MS (r mthd) -> MS (r mthd) Source #
inOutFunc :: Label -> r vis -> InOutFunc r mthd bod Source #
docInOutFunc :: Label -> r vis -> DocInOutFunc r mthd bod Source #
Instances
class AttachmentSym r attch => OOMethodSym (r :: Type -> Type) vis mthd attch bod | r -> vis mthd bod where Source #
Methods
method :: Label -> r vis -> r attch -> VS (r TypeData) -> [MS (r ParamData)] -> MS (r bod) -> MS (r mthd) Source #
getMethod :: SVariable r -> MS (r mthd) Source #
setMethod :: SVariable r -> MS (r mthd) Source #
constructor :: [MS (r ParamData)] -> Initializers r -> MS (r bod) -> MS (r mthd) Source #
inOutMethod :: Label -> r vis -> r attch -> InOutFunc r mthd bod Source #
docInOutMethod :: Label -> r vis -> r attch -> DocInOutFunc r mthd bod Source #
Instances
privMethod :: (OOMethodSym r vis mthd attch bod, VisibilitySym r vis) => Label -> VS (r TypeData) -> [MS (r ParamData)] -> MS (r bod) -> MS (r mthd) Source #
pubMethod :: (OOMethodSym r vis mthd attch bod, VisibilitySym r vis) => Label -> VS (r TypeData) -> [MS (r ParamData)] -> MS (r bod) -> MS (r mthd) Source #
initializer :: (OOMethodSym r vis mthd attch bod, BodySym r bod block) => [MS (r ParamData)] -> Initializers r -> MS (r mthd) Source #
nonInitConstructor :: OOMethodSym r vis mthd attch bod => [MS (r ParamData)] -> MS (r bod) -> MS (r mthd) Source #
class (VisibilitySym r vis, AttachmentSym r attch, VariableSym r) => StateVarSym (r :: Type -> Type) vis stvr attch | r -> stvr where Source #
Class for representing class variables, both instance- and class-level.
Used when creating a class, to hold extra information about Attachment
and Visibility.
Usually Doc is used for the representation.
Methods
stateVar :: r vis -> r attch -> SVariable r -> CSStateVar r stvr Source #
Given a visibility, attachment, and variable, represent the declaration of a state variable with no initial value.
stateVarDef :: r vis -> r attch -> SVariable r -> SValue r -> CSStateVar r stvr Source #
Given a visibility, attachment, variable, and initial value, represent the declaration of a state variable with the given initial value.
constVar :: r vis -> SVariable r -> SValue r -> CSStateVar r stvr Source #
Given a visibility, variable, and value, represent the declaration of a state constant with the given value.
Instances
privDVar :: StateVarSym r vis stvr attch => SVariable r -> CSStateVar r stvr Source #
pubDVar :: StateVarSym r vis stvr attch => SVariable r -> CSStateVar r stvr Source #
pubSVar :: StateVarSym r vis stvr attch => SVariable r -> CSStateVar r stvr Source #
class StateVarSym r vis stvr attch => ClassSym (r :: Type -> Type) vis mthd stvr attch | r -> mthd where Source #
Class for representing an OO class.
Methods
buildClass :: Maybe Label -> [CSStateVar r stvr] -> [MS (r mthd)] -> [MS (r mthd)] -> CS (r Class) Source #
Main external method for creating a class. Inputs: parent class, variables, constructor(s), methods
extraClass :: Label -> Maybe Label -> [CSStateVar r stvr] -> [MS (r mthd)] -> [MS (r mthd)] -> CS (r Class) Source #
Creates an extra class, i.e. with a different name than the module name. Inputs: class name, the rest are the same as buildClass.
implementingClass :: Label -> [Label] -> [CSStateVar r stvr] -> [MS (r mthd)] -> [MS (r mthd)] -> CS (r Class) Source #
Creates a class implementing a list of interfaces. Inputs: class name, interface names, variables, constructor(s), methods
Instances
class ModuleSym (r :: Type -> Type) mod mthd | r -> mod mthd where Source #
Class for representing a module.
Methods
buildModule :: Label -> [Label] -> [MS (r mthd)] -> [CS (r Class)] -> FS (r mod) Source #
Given module name, list of import names, list of module functions, and list of module classes, generates a representation of a module.
Instances
Instances
Instances
Instances
data VisibilityTag Source #
Instances
Constructors
| Boolean | |
| Integer | |
| Float | |
| Double | |
| Char | |
| String | |
| InFile | |
| OutFile | |
| Reference CodeType | |
| List CodeType | |
| Set CodeType | |
| Array CodeType | |
| Object ClassName | |
| Func [CodeType] CodeType | |
| Void |
Constructors
| GS | |
Fields
| |
Instances
| ProgramSym CodeInfoOO GOOLState () Source # | |
Defined in Drasil.GOOL.CodeInfoOO Methods prog :: Label -> Label -> [FS (CodeInfoOO ())] -> GSProgram CodeInfoOO GOOLState Source # | |
| OOProg CodeInfoOO () () () () () GOOLState () () () () Source # | |
Defined in Drasil.GOOL.CodeInfoOO | |
lensMStoVS :: Lens' MethodState ValueState Source #
onStateValue :: (a -> b) -> State s a -> State s b Source #
onCodeList :: Monad m => ([a] -> b) -> [m a] -> m b Source #
unCI :: CodeInfoOO a -> a Source #
unPC :: PythonCode a -> a Source #
unCSC :: CSharpCode a -> a Source #
unCPPC :: CppCode CppSrcCode CppHdrCode a -> a Source #
cppVersion :: String Source #
newtype LoggingFor (r :: Type -> Type) a Source #
Instances
class TypeSym r => TypeElim (r :: Type -> Type) where Source #
Methods
getCodeType :: r TypeData -> CodeType Source #