Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Defines an AST to be paired with an ExternalLibrary for a specific use-case
Synopsis
- type ExternalLibraryCall = [StepGroupFill]
- data StepGroupFill = SGF Int [StepFill]
- data StepFill
- newtype FunctionIntFill = FIF [ArgumentFill]
- data ArgumentFill
- data ParameterFill
- data ClassInfoFill
- data MethodInfoFill
- = CIF [ParameterFill] [Initializer] [StepFill]
- | MIF [ParameterFill] (NonEmpty StepFill)
- externalLibCall :: [StepGroupFill] -> ExternalLibraryCall
- choiceStepsFill :: Int -> [StepFill] -> StepGroupFill
- choiceStepFill :: Int -> StepFill -> StepGroupFill
- mandatoryStepFill :: StepFill -> StepGroupFill
- mandatoryStepsFill :: [StepFill] -> StepGroupFill
- callStepFill :: FunctionIntFill -> StepFill
- libCallFill :: [ArgumentFill] -> FunctionIntFill
- userDefinedArgFill :: CodeExpr -> ArgumentFill
- basicArgFill :: CodeExpr -> ArgumentFill
- functionArgFill :: [ParameterFill] -> StepFill -> ArgumentFill
- customObjArgFill :: [StateVariable] -> ClassInfoFill -> ArgumentFill
- recordArgFill :: [CodeExpr] -> ArgumentFill
- unnamedParamFill :: CodeVarChunk -> ParameterFill
- unnamedParamPBVFill :: CodeVarChunk -> ParameterFill
- userDefinedParamFill :: CodeVarChunk -> ParameterFill
- customClassFill :: [MethodInfoFill] -> ClassInfoFill
- implementationFill :: [MethodInfoFill] -> ClassInfoFill
- constructorInfoFill :: [ParameterFill] -> [Initializer] -> [StepFill] -> MethodInfoFill
- methodInfoFill :: [ParameterFill] -> [StepFill] -> MethodInfoFill
- appendCurrSolFill :: CodeVarChunk -> StepFill
- populateSolListFill :: CodeVarChunk -> [StepFill]
- assignArrayIndexFill :: CodeVarChunk -> [CodeExpr] -> StepFill
- assignSolFromObjFill :: CodeVarChunk -> StepFill
- initSolListFromArrayFill :: CodeVarChunk -> StepFill
- initSolListWithValFill :: CodeVarChunk -> CodeExpr -> StepFill
- solveAndPopulateWhileFill :: FunctionIntFill -> CodeExpr -> FunctionIntFill -> CodeVarChunk -> StepFill
- returnExprListFill :: [CodeExpr] -> StepFill
- fixedStatementFill :: StepFill
- fixedStatementFill' :: CodeExpr -> StepFill
- initSolWithValFill :: CodeVarChunk -> CodeExpr -> StepFill
Documentation
type ExternalLibraryCall = [StepGroupFill] Source #
External library call holds a group of step groups.
data StepGroupFill Source #
Holds a group of steps (StepFill
s). The
Int is to "choose" from the options in ExternalLibrary
.
Mirrors ExternalLibrary's Step
. A StepFill can be a call to an external library function or method.
data ArgumentFill Source #
Mirrors ExternalLibrary's ArgumentInfo
. Determines the context needed for an argument to work.
UserDefinedArgF (Maybe NamedArgument) CodeExpr | For arguments that are completely dependent on use case. |
BasicF CodeExpr | A basic function. |
FnF [ParameterFill] StepFill | Fills in the names for the unnamed parameters. |
ClassF [StateVariable] ClassInfoFill | List of CodeChunk for state variables. |
RecordF [CodeExpr] | Fills in the field values. |
data ParameterFill Source #
Mirrors ExternalLibrary's Parameter
.
data ClassInfoFill Source #
Mirrors ExternalLibrary's ClassInfo
.
data MethodInfoFill Source #
Mirrors ExternalLibrary's MethodInfo
.
CIF [ParameterFill] [Initializer] [StepFill] | |
MIF [ParameterFill] (NonEmpty StepFill) |
externalLibCall :: [StepGroupFill] -> ExternalLibraryCall Source #
Constructs an ExternalLibraryCall specification.
choiceStepsFill :: Int -> [StepFill] -> StepGroupFill Source #
Corresponds to ExternalLibrary's choiceSteps
. Provides the index of the
steps that should be used for the current use case.
choiceStepFill :: Int -> StepFill -> StepGroupFill Source #
Corresponds to ExternalLibrary's choiceStep
. Provides the index of the
step that should be used for the current use case.
mandatoryStepFill :: StepFill -> StepGroupFill Source #
Corresponds to ExternalLibrary's mandatorySteps
.
mandatoryStepsFill :: [StepFill] -> StepGroupFill Source #
Corresponds to ExternalLibrary's mandatoryStep
.
callStepFill :: FunctionIntFill -> StepFill Source #
Corresponds to ExternalLibrary's callStep
.
libCallFill :: [ArgumentFill] -> FunctionIntFill Source #
Corresponds to any of ExternalLibrary's FunctionInterface
constructors.
userDefinedArgFill :: CodeExpr -> ArgumentFill Source #
Does not correspond to anything in ExternalLibrary. To be used when the presence of an argument is only a consequence of the use case.
basicArgFill :: CodeExpr -> ArgumentFill Source #
Corresponds to ExternalLibrary's inlineArg
, inlineNamedArg
, preDefinedArg
,
and preDefinedNamedArg
. Provides the CodeExpr
for the argument's value.
functionArgFill :: [ParameterFill] -> StepFill -> ArgumentFill Source #
Corresponds to ExternalLibrary's functionArg
.
customObjArgFill :: [StateVariable] -> ClassInfoFill -> ArgumentFill Source #
Corresponds to ExternalLibrary's customObjArg
. Provides the list of state
variables for the class that must be written in the calling program.
recordArgFill :: [CodeExpr] -> ArgumentFill Source #
Corresponds to ExternalLibrary's recordArg
. Provides the list of CodeExpr
s for
the values of the fields that must be set by the calling program.
unnamedParamFill :: CodeVarChunk -> ParameterFill Source #
Corresponds to ExternalLibrary's unnamedParam
. Provides the CodeVarChunk
representing the parameter.
unnamedParamPBVFill :: CodeVarChunk -> ParameterFill Source #
Corresponds to ExternalLibrary's unnamedParam
. Provides the CodeVarChunk
representing the parameter. Specifies that the parameter is passed by value.
userDefinedParamFill :: CodeVarChunk -> ParameterFill Source #
Does not correspond to anything in ExternalLibrary. To be used when the presence of a parameter is only a consequence of the use case.
customClassFill :: [MethodInfoFill] -> ClassInfoFill Source #
Corresponds to ExternalLibrary's customClass
.
implementationFill :: [MethodInfoFill] -> ClassInfoFill Source #
Corresponds to ExternalLibrary's implementation
.
constructorInfoFill :: [ParameterFill] -> [Initializer] -> [StepFill] -> MethodInfoFill Source #
Corresponds to ExternalLibrary's constructorInfo
. Provides Variable-Value
pairs for variables initialized by the constructor.
methodInfoFill :: [ParameterFill] -> [StepFill] -> MethodInfoFill Source #
Corresponds to ExternalLibrary's methodInfo
.
appendCurrSolFill :: CodeVarChunk -> StepFill Source #
Corresponds to ExternalLibrary's appendCurrSol
. Provides the CodeVarChunk
for the solution list.
populateSolListFill :: CodeVarChunk -> [StepFill] Source #
Corresponds to ExternalLibrary's populateSolList
. Provides the CodeVarChunk
for the solution list.
assignArrayIndexFill :: CodeVarChunk -> [CodeExpr] -> StepFill Source #
Corresponds to ExternalLibrary's assignArrayIndex
. Provides the CodeVarChunk
for the array variable. Provides the CodeExpr
s for the values to assign to each
array index.
assignSolFromObjFill :: CodeVarChunk -> StepFill Source #
Corresponds to ExternalLibrary's assignSolFromObj
. Provides the CodeVarChunk
for the variable that the solution should be assigned to.
initSolListFromArrayFill :: CodeVarChunk -> StepFill Source #
Corresponds to ExternalLibrary's initSolListFromArray
. Provides the
CodeVarChunk
for the solution list.
initSolListWithValFill :: CodeVarChunk -> CodeExpr -> StepFill Source #
Corresponds to ExternalLibrary's initSolListWithVal
. Provides the
CodeVarChunk
for the solution list and the CodeExpr
for the initial element of
the solution list
solveAndPopulateWhileFill :: FunctionIntFill -> CodeExpr -> FunctionIntFill -> CodeVarChunk -> StepFill Source #
Corresponds to ExternalLibrary's solveAndPopulateWhile
. Provides the CodeExpr
for the upper bound in the while loop condition and the CodeVarChunk
for the
solution list.
returnExprListFill :: [CodeExpr] -> StepFill Source #
Corresponds to ExternalLibrary's returnExprList
. Provides the list of CodeExpr
s
to return.
fixedStatementFill :: StepFill Source #
Corresponds to ExternalLibrary's fixedReturn
.
No parameters because the statement is not use-case-dependent.
fixedStatementFill' :: CodeExpr -> StepFill Source #
Corresponds to ExternalLibrary's fixedReturn'
.
use-case-specific a CodeExpr
that parameterize the statement.
initSolWithValFill :: CodeVarChunk -> CodeExpr -> StepFill Source #
Corresponds to ExternalLibrary's initSolWithVal
. Provides the
CodeVarChunk
for one solution and one CodeExpr
for the initial element of
the solution list