drasil-code-0.1.9.0: A framework for code and document generation for scientific software - Code SubPackage
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.Drasil.Choices

Description

Defines the design language for SCS.

Synopsis

Documentation

data Choices Source #

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

Constructors

Choices 

Fields

data Architecture Source #

Architecture of a program

Constructors

Archt 

Fields

makeArchit :: Modularity -> ImplementationType -> Architecture Source #

Constructor to create a Architecture

data DataInfo Source #

Data of a program - how information should be encoded.

Constructors

DataInfo 

Fields

makeData :: Structure -> ConstantStructure -> ConstantRepr -> DataInfo Source #

Constructor to create a DataInfo

data Maps Source #

Maps for Concepts and Space

Constructors

Maps 

Fields

makeMaps :: ConceptMatchMap -> SpaceMatch -> Maps Source #

Constructor to create a Maps

spaceToCodeType :: Space -> [CodeType] Source #

Default mapping between Space and CodeType.

makeConstraints :: ConstraintBehaviour -> ConstraintBehaviour -> Constraints Source #

Constructor to create a Constraints

data ODE Source #

All Information needed to solve an ODE

Constructors

ODE 

Fields

makeODE :: [ODEInfo] -> [ODELibPckg] -> ODE Source #

Constructor to create an ODE

data DocConfig Source #

Configuration for Doxygen documentation

Constructors

DocConfig 

Fields

makeDocConfig :: [Comments] -> Verbosity -> Visibility -> DocConfig Source #

Constructor to create a DocConfig

data LogConfig Source #

Log Configuration

Constructors

LogConfig 

Fields

makeLogConfig :: [Logging] -> FilePath -> LogConfig Source #

Constructor to create a LogConfig

data OptionalFeatures Source #

Constructors

OptFeats 

Fields

makeOptFeats :: DocConfig -> LogConfig -> [AuxFile] -> OptionalFeatures Source #

Constructor to create a OptionalFeatures

newtype ExtLib Source #

External Library Options

Constructors

Math ODE 

data Modularity Source #

Modularity of a program.

Constructors

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.

Constructors

Combined

Input-related functions combined in one module.

Separated

Input-related functions each in own module.

inputModule :: Choices -> InputModule Source #

Determines whether there is a Combined input module or many Separated input modules, based on a Choices structure. An Unmodular design implicitly means that input modules are Combined.

data Structure Source #

Variable structure options.

Constructors

Unbundled

Individual variables

Bundled

Variables bundled in a class

data ConstantStructure Source #

Constants options.

Constructors

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.

Constructors

Var

Constants represented as regular variables.

Const

Use target language's mechanism for defining constants.

type ConceptMatchMap = Map UID [CodeConcept] Source #

Specifies matches between chunks and CodeConcepts, 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.

Constructors

Pi 

Instances

Instances details
Eq CodeConcept Source # 
Instance details

Defined in Language.Drasil.Choices

matchConcepts :: HasUID c => [(c, [CodeConcept])] -> ConceptMatchMap Source #

Builds a ConceptMatchMap from an association list of chunks and CodeConcepts.

type SpaceMatch = Space -> [CodeType] Source #

Specifies which CodeType should be used to represent each mathematical Space. [CodeType] is preferentially-ordered, first CodeType that does not conflict with other choices will be selected.

matchSpaces :: [(Space, [CodeType])] -> SpaceMatch Source #

Builds a SpaceMatch from an association list of Spaces and CodeTypes.

data ImplementationType Source #

Program implementation options.

Constructors

Library

Generated code does not include Controller.

Program

Generated code includes Controller.

data ConstraintBehaviour Source #

Constraint behaviour options within program.

Constructors

Warning

Print warning when constraint violated.

Exception

Throw exception when constraint violated.

data Comments Source #

Comment implementation options.

Constructors

CommentFunc

Function/method-level comments.

CommentClass

Class-level comments.

CommentMod

File/Module-level comments.

Instances

Instances details
Eq Comments Source # 
Instance details

Defined in Language.Drasil.Choices

data Verbosity Source #

Doxygen file verbosity options.

Constructors

Verbose 
Quiet 

data Visibility Source #

Doxygen date-field visibility options.

Constructors

Show 
Hide 

data Logging Source #

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

Constructors

LogFunc

Log messages generated for function calls.

LogVar

Log messages generated for variable assignments.

Instances

Instances details
Eq Logging Source # 
Instance details

Defined in Language.Drasil.Choices

Methods

(==) :: Logging -> Logging -> Bool #

(/=) :: Logging -> Logging -> Bool #

data AuxFile Source #

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.

Constructors

SampleInput FilePath 
ReadME 

Instances

Instances details
Eq AuxFile Source # 
Instance details

Defined in Language.Drasil.Choices

Methods

(==) :: AuxFile -> AuxFile -> Bool #

(/=) :: AuxFile -> AuxFile -> Bool #

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 AuxFiles includes a SampleInput.

defaultChoices :: Choices Source #

Default choices to be used as the base from which design specifications can be built.

showChs :: RenderChoices a => a -> Sentence Source #