OSDN Git Service

Implement --use-network option parser
[happyabc/happyabc.git] / swflib / lowInst.mlp
1 open Base
2 open BytesOut
3
4 exception Unknown of int
5
6 #include "low.type.h"
7 type t = [
8 #include "type.inst.h"
9 ]
10
11 let to_bytes : t -> BytesOut.t list =
12   function
13 #include "asm.inst.h"
14
15 let op n stream =
16   match Stream.peek stream with
17       Some m when m = n ->
18         Stream.next stream
19     | _ ->
20         raise Stream.Failure
21
22 let of_bytes : int Stream.t -> t =
23     parser
24 #include "disasm.inst.h"
25     | [< op = Stream.next >] ->
26         raise (Unknown op)
27