Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Defines the design language for SCS.
Synopsis
- data Choices = Choices {
- lang :: [Lang]
- architecture :: Architecture
- dataInfo :: DataInfo
- maps :: Maps
- optFeats :: OptionalFeatures
- srsConstraints :: Constraints
- extLibs :: [ExtLib]
- folderVal :: Int
- data Architecture = Archt {}
- makeArchit :: Modularity -> ImplementationType -> Architecture
- data DataInfo = DataInfo {}
- makeData :: Structure -> ConstantStructure -> ConstantRepr -> DataInfo
- data Maps = Maps {}
- makeMaps :: ConceptMatchMap -> SpaceMatch -> Maps
- spaceToCodeType :: Space -> [CodeType]
- data Constraints = Constraints {}
- makeConstraints :: ConstraintBehaviour -> ConstraintBehaviour -> Constraints
- data ODE = ODE {
- odeInfo :: [ODEInfo]
- odeLib :: [ODELibPckg]
- makeODE :: [ODEInfo] -> [ODELibPckg] -> ODE
- data DocConfig = DocConfig {
- comments :: [Comments]
- doxVerbosity :: Verbosity
- dates :: Visibility
- makeDocConfig :: [Comments] -> Verbosity -> Visibility -> DocConfig
- data LogConfig = LogConfig {}
- makeLogConfig :: [Logging] -> FilePath -> LogConfig
- data OptionalFeatures = OptFeats {}
- makeOptFeats :: DocConfig -> LogConfig -> [AuxFile] -> OptionalFeatures
- newtype ExtLib = Math ODE
- data Modularity
- data InputModule
- inputModule :: Choices -> InputModule
- data Structure
- data ConstantStructure
- data ConstantRepr
- type ConceptMatchMap = Map UID [CodeConcept]
- type MatchedConceptMap = Map UID CodeConcept
- data CodeConcept = Pi
- matchConcepts :: HasUID c => [(c, [CodeConcept])] -> ConceptMatchMap
- type SpaceMatch = Space -> [CodeType]
- matchSpaces :: [(Space, [CodeType])] -> SpaceMatch
- data ImplementationType
- data ConstraintBehaviour
- data Comments
- data Verbosity
- data Visibility
- data Logging
- data AuxFile
- getSampleData :: Choices -> Maybe FilePath
- hasSampleInput :: [AuxFile] -> Bool
- defaultChoices :: Choices
- choicesSent :: Choices -> [Sentence]
- showChs :: RenderChoices a => a -> Sentence
Documentation
The instruction indicates how the generated program should be written down. Full details of Choices documentation https://github.com/JacquesCarette/Drasil/wiki/The-Code-Generator
Choices | |
|
data Architecture Source #
Architecture of a program
Archt | |
|
makeArchit :: Modularity -> ImplementationType -> Architecture Source #
Constructor to create a Architecture
Data of a program - how information should be encoded.
DataInfo | |
|
makeData :: Structure -> ConstantStructure -> ConstantRepr -> DataInfo Source #
Constructor to create a DataInfo
Maps for Concepts and Space
makeMaps :: ConceptMatchMap -> SpaceMatch -> Maps Source #
Constructor to create a Maps
data Constraints Source #
SRS Constraints
makeConstraints :: ConstraintBehaviour -> ConstraintBehaviour -> Constraints Source #
Constructor to create a Constraints
All Information needed to solve an ODE
ODE | |
|
Configuration for Doxygen documentation
DocConfig | |
|
makeDocConfig :: [Comments] -> Verbosity -> Visibility -> DocConfig Source #
Constructor to create a DocConfig
Log Configuration
data OptionalFeatures Source #
makeOptFeats :: DocConfig -> LogConfig -> [AuxFile] -> OptionalFeatures Source #
Constructor to create a OptionalFeatures
data Modularity Source #
Modularity of a program.
Modular InputModule | Different modules. For controller, input, calculations, output. |
Unmodular | All generated code is in one module/file. |
data InputModule Source #
Options for input modules.
inputModule :: Choices -> InputModule Source #
Variable structure options.
data ConstantStructure Source #
Constants options.
Inline | Inline values for constants. |
WithInputs | Store constants with inputs. |
Store Structure | Store constants separately from inputs, whether bundled or unbundled. |
data ConstantRepr Source #
Options for representing constants in a program.
type ConceptMatchMap = Map UID [CodeConcept] Source #
Specifies matches between chunks and CodeConcept
s, meaning the target
language's pre-existing definition of the concept should be used instead of
defining a new variable for the concept in the generated code.
[CodeConcept
] is preferentially-ordered, generator concretizes a
ConceptMatchMap
to a MatchedConceptMap
by checking user's other choices.
type MatchedConceptMap = Map UID CodeConcept Source #
Concrete version of ConceptMatchMap dependent on user choices.
data CodeConcept Source #
Code concepts. For now, just pi.
Instances
Eq CodeConcept Source # | |
Defined in Language.Drasil.Choices (==) :: CodeConcept -> CodeConcept -> Bool # (/=) :: CodeConcept -> CodeConcept -> Bool # |
matchConcepts :: HasUID c => [(c, [CodeConcept])] -> ConceptMatchMap Source #
Builds a ConceptMatchMap
from an association list of chunks and CodeConcepts
.
type SpaceMatch = Space -> [CodeType] Source #
matchSpaces :: [(Space, [CodeType])] -> SpaceMatch Source #
Builds a SpaceMatch
from an association list of Spaces
and CodeTypes
.
data ImplementationType Source #
Program implementation options.
data ConstraintBehaviour Source #
Constraint behaviour options within program.
Comment implementation options.
CommentFunc | Function/method-level comments. |
CommentClass | Class-level comments. |
CommentMod | File/Module-level comments. |
Logging options for function calls and variable assignments. Eq instances required for Logging and Comments because generator needs to check membership of these elements in lists
Currently we only support two kind of auxiliary files: sample input file, readme.
To generate a sample input file compatible with the generated program,
FilePath
is the path to the user-provided file containing a sample set of input data.
getSampleData :: Choices -> Maybe FilePath Source #
Gets the file path to a sample input data set from a Choices
structure, if
the user chose to generate a sample input file.
hasSampleInput :: [AuxFile] -> Bool Source #
Predicate that returns true if the list of AuxFile
s includes a SampleInput
.
defaultChoices :: Choices Source #
Default choices to be used as the base from which design specifications can be built.