| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
Sutori.Parser.Definitions
Description
- whenSymbolIsNew :: SutSymbol a => (SutID -> SymTable -> [a]) -> SutID -> SutMonad () -> SutMonad ()
- defVariable :: SutID -> SutTypeID -> (SutID, Maybe SutExpression) -> SutMonad (Maybe SutInstruction)
- insertType :: SutID -> SutID -> SutMonad SutID
- defineType :: SutID -> SutTypeID -> SutMonad ()
- defPerson :: SutID -> SutMonad ()
- defParams :: [SutParam] -> SutMonad [SutInstruction]
- defVariables :: SutID -> SutTypeID -> [(SutID, Maybe SutExpression)] -> SutMonad [SutInstruction]
- defModule :: SutID -> SutAST -> SutMonad ()
- defineFunction :: SutID -> SutAST -> SutMonad ()
- insertFunction :: SutID -> SutTypeID -> [SutParam] -> SutMonad SutID
Documentation
whenSymbolIsNew :: SutSymbol a => (SutID -> SymTable -> [a]) -> SutID -> SutMonad () -> SutMonad () Source #
Decides on whether the given SutID was used for a different symbol in the same scope
defVariable :: SutID -> SutTypeID -> (SutID, Maybe SutExpression) -> SutMonad (Maybe SutInstruction) Source #
Defines a new variable of given type and optionally assigns it an initial value.
defineType :: SutID -> SutTypeID -> SutMonad () Source #
Associates the SutID to the newly constructed type
defParams :: [SutParam] -> SutMonad [SutInstruction] Source #
Defines a new parameter into a function's scope.
defVariables :: SutID -> SutTypeID -> [(SutID, Maybe SutExpression)] -> SutMonad [SutInstruction] Source #
Defined a list of variables and returns a list of instructions, if any definition included an assigment
defineFunction :: SutID -> SutAST -> SutMonad () Source #
Defines a AST-able function (updates the top function with this ID's AST)
Note: We are now in the scope the function is being defined
insertFunction :: SutID -> SutTypeID -> [SutParam] -> SutMonad SutID Source #
Inserts a new function symbol with a given name, type and parameters, if none is present (no body yet)
Is this action's job to build the initial function symbol (and that includes the PreAST)
Note: We are inside the function's scope, so we need to insert the symbol in the second-to-last scope