| Safe Haskell | None |
|---|
DDC.Core.Tetra
- profile :: Profile Name
- data Name
- data TyConPrim
- data OpPrimArith
- = OpPrimArithNeg
- | OpPrimArithAdd
- | OpPrimArithSub
- | OpPrimArithMul
- | OpPrimArithDiv
- | OpPrimArithMod
- | OpPrimArithRem
- | OpPrimArithEq
- | OpPrimArithNeq
- | OpPrimArithGt
- | OpPrimArithGe
- | OpPrimArithLt
- | OpPrimArithLe
- | OpPrimArithAnd
- | OpPrimArithOr
- | OpPrimArithShl
- | OpPrimArithShr
- | OpPrimArithBAnd
- | OpPrimArithBOr
- | OpPrimArithBXOr
- data OpPrimRef
- readName :: String -> Maybe Name
- lexModuleString :: String -> Int -> String -> [Token (Tok Name)]
- lexExpString :: String -> Int -> String -> [Token (Tok Name)]
Language profile
Names
Names of things used in Disciple Core Tetra.
Constructors
| NameVar String | User defined variables. |
| NameCon String | A user defined constructor. |
| NameTyConPrim TyConPrim | A primitive type constructor. |
| NameOpPrimArith OpPrimArith | Primitive arithmetic, logic, comparison and bit-wise operators. |
| NameOpPrimRef OpPrimRef | Mutable references. |
| NameLitBool Bool | A boolean literal. |
| NameLitNat Integer | A natural literal. |
| NameLitInt Integer | An integer literal. |
| NameLitWord Integer Int | A word literal. |
Primitive type constructors.
Constructors
| TyConPrimBool |
|
| TyConPrimNat |
|
| TyConPrimInt |
|
| TyConPrimWord Int |
|
| TyConPrimRef | A mutable reference. |
data OpPrimArith Source
Primitive arithmetic, logic, and comparison opretors. We expect the backend/machine to be able to implement these directly.
For the Shift Right operator, the type that it is used at determines whether it is an arithmetic (with sign-extension) or logical (no sign-extension) shift.
Constructors
| OpPrimArithNeg | Negation |
| OpPrimArithAdd | Addition |
| OpPrimArithSub | Subtraction |
| OpPrimArithMul | Multiplication |
| OpPrimArithDiv | Division |
| OpPrimArithMod | Modulus |
| OpPrimArithRem | Remainder |
| OpPrimArithEq | Equality |
| OpPrimArithNeq | Negated Equality |
| OpPrimArithGt | Greater Than |
| OpPrimArithGe | Greater Than or Equal |
| OpPrimArithLt | Less Than |
| OpPrimArithLe | Less Than or Equal |
| OpPrimArithAnd | Boolean And |
| OpPrimArithOr | Boolean Or |
| OpPrimArithShl | Shift Left |
| OpPrimArithShr | Shift Right |
| OpPrimArithBAnd | Bit-wise And |
| OpPrimArithBOr | Bit-wise Or |
| OpPrimArithBXOr | Bit-wise eXclusive Or |
Mutable References.
Constructors
| OpPrimRefAllocRef | Allocate a reference. |
| OpPrimRefReadRef | Read a reference. |
| OpPrimRefWriteRef | Write to a reference. |