feldspar-compiler-0.6.0.2: Compiler for the Feldspar language

Safe Haskell | None

Feldspar.Compiler.Compiler

Synopsis

- data SomeCompilable = forall a internal . Compilable a internal => SomeCompilable a
- type Position = (Int, Int)
- data SplitModuleDescriptor = SplitModuleDescriptor {
  - smdSource :: Module ()
  - smdHeader :: Module ()
  }
- data CompToCCoreResult = CompToCCoreResult {
  - sourceCode :: String
  - endPosition :: Position
  - debugModule :: Module DebugToCSemanticInfo
  }
- data SplitCompToCCoreResult = SplitCompToCCoreResult {
  - sctccrSource :: CompToCCoreResult
  - sctccrHeader :: CompToCCoreResult
  }
- data IncludesNeeded
  - = IncludesNeeded
  - | NoIncludesNeeded {
    - incneedLineNum :: Int
    }
- moduleSplitter :: Module () -> SplitModuleDescriptor
- separateAndCompileToCCore :: Compilable t internal => (Module () -> [Module ()]) -> CompilationMode -> t -> IncludesNeeded -> OriginalFunctionSignature -> Options -> [(CompToCCoreResult, Module ())]
- moduleToCCore :: IncludesNeeded -> Options -> Module () -> CompToCCoreResult
- compileToCCore :: Compilable t internal => CompilationMode -> t -> Maybe String -> IncludesNeeded -> OriginalFunctionSignature -> Options -> SplitCompToCCoreResult
- genIncludeLinesCore :: [String] -> (String, Int)
- genIncludeLines :: Options -> Maybe String -> (String, Int)
- defaultOptions :: Options
- c99PlatformOptions :: Options
- tic64xPlatformOptions :: Options
- unrollOptions :: Options
- noPrimitiveInstructionHandling :: Options
- noMemoryInformation :: Options
- pluginChain :: ExternalInfoCollection -> Module () -> Module ()
- data ExternalInfoCollection = ExternalInfoCollection {
  - precompilationExternalInfo :: ExternalInfo Precompilation
  - unrollExternalInfo :: ExternalInfo UnrollPlugin
  - primitivesExternalInfo :: ExternalInfo RulePlugin
  - ruleExternalInfo :: ExternalInfo RulePlugin
  - typeDefinitionGeneratorExternalInfo :: ExternalInfo TypeDefinitionGenerator
  - variableRoleAssignerExternalInfo :: ExternalInfo VariableRoleAssigner
  - typeCorrectorExternalInfo :: ExternalInfo TypeCorrector
  }
- executePluginChain' :: Compilable c internal => CompilationMode -> c -> OriginalFunctionSignature -> Options -> Module ()
- executePluginChain :: Compilable c internal => CompilationMode -> c -> OriginalFunctionSignature -> Options -> SplitModuleDescriptor

# Documentation

data SomeCompilable

Constructors

forall a internal . Compilable a internal => SomeCompilable a |

Instances

Typeable SomeCompilable |

type Position = (Int, Int)

data SplitModuleDescriptor

Constructors

SplitModuleDescriptor |

Fields

smdSource :: Module ()
smdHeader :: Module ()

data CompToCCoreResult

Constructors

CompToCCoreResult |

Fields

sourceCode :: String
endPosition :: Position
debugModule :: Module DebugToCSemanticInfo

data SplitCompToCCoreResult

Constructors

SplitCompToCCoreResult |

Fields

sctccrSource :: CompToCCoreResult
sctccrHeader :: CompToCCoreResult

data IncludesNeeded

Constructors

IncludesNeeded |
NoIncludesNeeded |

Fields

incneedLineNum :: Int

moduleSplitter :: Module () -> SplitModuleDescriptor

separateAndCompileToCCore :: Compilable t internal => (Module () -> [Module ()]) -> CompilationMode -> t -> IncludesNeeded -> OriginalFunctionSignature -> Options -> [(CompToCCoreResult, Module ())]

moduleToCCore :: IncludesNeeded -> Options -> Module () -> CompToCCoreResult

compileToCCore :: Compilable t internal => CompilationMode -> t -> Maybe String -> IncludesNeeded -> OriginalFunctionSignature -> Options -> SplitCompToCCoreResult

Compiler core This functionality should not be duplicated. Instead, everything should call this and only do a trivial interface adaptation.

genIncludeLinesCore :: [String] -> (String, Int)

genIncludeLines :: Options -> Maybe String -> (String, Int)

defaultOptions :: Options

Predefined options

c99PlatformOptions :: Options

tic64xPlatformOptions :: Options

unrollOptions :: Options

noPrimitiveInstructionHandling :: Options

noMemoryInformation :: Options

pluginChain :: ExternalInfoCollection -> Module () -> Module ()

Plugin system

data ExternalInfoCollection

Constructors

ExternalInfoCollection |

Fields

precompilationExternalInfo :: ExternalInfo Precompilation
unrollExternalInfo :: ExternalInfo UnrollPlugin
primitivesExternalInfo :: ExternalInfo RulePlugin
ruleExternalInfo :: ExternalInfo RulePlugin
typeDefinitionGeneratorExternalInfo :: ExternalInfo TypeDefinitionGenerator
variableRoleAssignerExternalInfo :: ExternalInfo VariableRoleAssigner
typeCorrectorExternalInfo :: ExternalInfo TypeCorrector

executePluginChain' :: Compilable c internal => CompilationMode -> c -> OriginalFunctionSignature -> Options -> Module ()

executePluginChain :: Compilable c internal => CompilationMode -> c -> OriginalFunctionSignature -> Options -> SplitModuleDescriptor