ddc-build-0.4.1.3: Disciplined Disciple Compiler build framework.

Safe HaskellNone

DDC.Build.Language

Synopsis

Documentation

data Language Source

Existential container for a language fragment, and the dictionaries we need to work with its type parameters.

Constructors

forall s n err . (Typeable n, Ord n, Show n, Pretty n, Pretty (err (AnTEC SourcePos n)), Pretty (err (AnTEC () n)), NFData n) => Language (Bundle s n err) 

data Bundle s n err Source

Existential container for a language fragment, the simplifier for it, and the dictionaries we need to work with its type parameters.

Constructors

Bundle 

Fields

bundleFragment :: Fragment n err

Language fragment definition.

bundleModules :: Map ModuleName (Module (AnTEC () n) n)

Modules being used for inliner templates.

bundleStateInit :: s

Initial simplifier state.

bundleSimplifier :: Simplifier s (AnTEC () n) n

Current simplifier to apply to module.

bundleMakeNamifierT :: Env n -> Namifier s n

Make a namifier for level-1 names.

bundleMakeNamifierX :: Env n -> Namifier s n

Make a namifier for level-0 names.

bundleRewriteRules :: Map String (RewriteRule (AnTEC () n) n)

Current rewrite rules to apply to module.

data Fragment n err

Carries all the information we need to work on a particular fragment of the Disciple Core language.

Constructors

Fragment 

Fields

fragmentProfile :: Profile n

Language profile for this fragment.

fragmentExtension :: String

File extension to use when dumping modules in this fragment.

fragmentReadName :: String -> Maybe n

Read a name.

fragmentLexModule :: String -> Int -> String -> [Token (Tok n)]

Lex module source into tokens, given the source name and starting line number.

fragmentLexExp :: String -> Int -> String -> [Token (Tok n)]

Lex expression source into tokens, given the source name and starting line number.

fragmentCheckModule :: forall a. Module a n -> Maybe (err a)

Perform language fragment specific checks on a module.

fragmentCheckExp :: forall a. Exp a n -> Maybe (err a)

Perform language fragment specific checks on an expression.

Instances

Show (Fragment n err) 

languages :: [(String, Language)]Source

Supported language profiles.

One of Tetra, Lite, Salt, Eval, Flow, Zero.

languageOfExtension :: String -> Maybe LanguageSource

Return the language fragment definition corresponding to the given file extension. eg dcl gives the definition of the Lite language.