Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
katef committed Sep 3, 2024
1 parent d60c6b2 commit fbd1636
Show file tree
Hide file tree
Showing 8 changed files with 410 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/fsm/print.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ enum fsm_print_lang {
FSM_PRINT_SH, /* Shell script (bash dialect) */
FSM_PRINT_VMC, /* ISO C90 code, VM style */
FSM_PRINT_VMDOT, /* Graphviz Dot format, showing VM opcodes */
FSM_PRINT_WASM, /* Wasm text */

FSM_PRINT_VMOPS_C, /* VM opcodes as a datastructure */
FSM_PRINT_VMOPS_H,
Expand Down
1 change: 1 addition & 0 deletions src/fsm/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ lang_name(const char *name)
{ "llvm", FSM_PRINT_LLVM },
{ "sh", FSM_PRINT_SH },
{ "go", FSM_PRINT_GO },
{ "wasm", FSM_PRINT_WASM },

{ "amd64", FSM_PRINT_AMD64_NASM },
{ "amd64_att", FSM_PRINT_AMD64_ATT },
Expand Down
1 change: 1 addition & 0 deletions src/libfsm/print.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ fsm_print(FILE *f, const struct fsm *fsm,
case FSM_PRINT_SH: print_vm = fsm_print_sh; break;
case FSM_PRINT_VMC: print_vm = fsm_print_vmc; break;
case FSM_PRINT_VMDOT: print_vm = fsm_print_vmdot; break;
case FSM_PRINT_WASM: print_ir = fsm_print_wasm; break;

case FSM_PRINT_VMOPS_C: print_vm = fsm_print_vmops_c; break;
case FSM_PRINT_VMOPS_H: print_vm = fsm_print_vmops_h; break;
Expand Down
1 change: 1 addition & 0 deletions src/libfsm/print.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ vm_print_f fsm_print_llvm;
vm_print_f fsm_print_rust;
vm_print_f fsm_print_sh;
vm_print_f fsm_print_vmc;
ir_print_f fsm_print_wasm;

vm_print_f fsm_print_vmdot;
vm_print_f fsm_print_vmops_c;
Expand Down
1 change: 1 addition & 0 deletions src/libfsm/print/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ SRC += src/libfsm/print/vmasm.c
SRC += src/libfsm/print/vmc.c
SRC += src/libfsm/print/vmdot.c
SRC += src/libfsm/print/vmops.c
SRC += src/libfsm/print/wasm.c

.for src in ${SRC:Msrc/libfsm/print/*.c}
CFLAGS.${src} += -I src # XXX: for internal.h
Expand Down
Loading

0 comments on commit fbd1636

Please sign in to comment.