Copyright | (c) Petr Penzin 2015 |
---|---|
License | BSD2 |
Maintainer | penzin.dev@gmail.com |
Stability | experimental |
Portability | cross-platform |
Safe Haskell | Safe |
Language | Haskell98 |
Primitives to emit and parse Binary.Neko bytecode, including instruction definitions.
- data Module = N {}
- readModule :: ByteString -> Either String Module
- data ModuleHeader = ModuleHeader {}
- getModuleHeader :: Get ModuleHeader
- getModule :: Get Module
- getModuleContents :: Word32 -> Word32 -> Word32 -> Get Module
- getMagicCheck :: Get Bool
- getField :: Get String
- getFields :: Word32 -> Get Hashtbl
- prepStrings :: [String] -> ByteString
- putFields :: Hashtbl -> Put
- putModule :: Module -> Put
Documentation
A Binary.Neko module. Consists of global entities and a list of instructions
readModule :: ByteString -> Either String Module Source #
Parse module from ByteString. Return module or return an error string
data ModuleHeader Source #
Internal type for module header (counts of entities in the module)
getModuleHeader :: Get ModuleHeader Source #
Pick module header fields from a bytestring. Requires bytestring to start with the first field.
Parse insides of a module from a bytestring. Bytesting is expected to start with the first section of the module.
getMagicCheck :: Get Bool Source #
A check for next four bytes matching neko magic value
getFields :: Word32 -> Get Hashtbl Source #
Get a list of fields into a hashtable indexed by their hash values
prepStrings :: [String] -> ByteString Source #
Produce a sequence of null-terminated strings