Copyright | 2018 Simon Shine |
---|---|
License | MIT |
Maintainer | Simon Shine <shreddedglory@gmail.com> |
Safe Haskell | None |
Language | Haskell2010 |
This module exposes a generic method of traversing Opcode'
s.
Synopsis
- data OpcodeMapper m a b = OpcodeMapper {
- mapOnJump :: a -> m (Opcode' b)
- mapOnJumpi :: a -> m (Opcode' b)
- mapOnJumpdest :: a -> m (Opcode' b)
- mapOnOther :: Opcode' a -> m (Maybe (Opcode' b))
- mapOpcodeM :: forall m a b. Monad m => OpcodeMapper m a b -> Opcode' a -> m (Opcode' b)
Documentation
data OpcodeMapper m a b Source #
An OpcodeMapper
is a collection of four mapping functions that can
map any
to an Opcode'
a
. For each of the three opcodes
that are annotated, Opcode'
bJUMP
, JUMPI
and JUMPDEST
, a separate mapping
function is specified, and for any other opcode, a general mapping function
is specified that falls back to the same opcode of type
.Opcode'
b
See translate
for an example of usage.
OpcodeMapper | |
|
mapOpcodeM :: forall m a b. Monad m => OpcodeMapper m a b -> Opcode' a -> m (Opcode' b) Source #
Given an OpcodeMapper
and an
, produce Opcode'
am (
.Opcode'
b)