Skip to content

Commit

Permalink
WIP: CDATA codegen mode
Browse files Browse the repository at this point in the history
  • Loading branch information
silentbicycle committed Sep 27, 2024
1 parent a8229c2 commit 456652b
Show file tree
Hide file tree
Showing 6 changed files with 862 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/fsm/print.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ enum fsm_print_lang {
FSM_PRINT_VMC, /* ISO C90 code, VM style */
FSM_PRINT_VMDOT, /* Graphviz Dot format, showing VM opcodes */

FSM_PRINT_CDATA, /* C data tables and small interpreter */

FSM_PRINT_VMOPS_C, /* VM opcodes as a datastructure */
FSM_PRINT_VMOPS_H,
FSM_PRINT_VMOPS_MAIN
Expand Down
2 changes: 2 additions & 0 deletions src/libfsm/print.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,8 @@ fsm_print(FILE *f, const struct fsm *fsm,
case FSM_PRINT_VMC: print_vm = fsm_print_vmc; break;
case FSM_PRINT_VMDOT: print_vm = fsm_print_vmdot; break;

case FSM_PRINT_CDATA: print_ir = fsm_print_cdata; 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;
case FSM_PRINT_VMOPS_MAIN: print_vm = fsm_print_vmops_main; 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 @@ -88,6 +88,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_cdata;

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 @@ -11,6 +11,7 @@ SRC += src/libfsm/print/irdot.c
SRC += src/libfsm/print/irjson.c
SRC += src/libfsm/print/json.c
SRC += src/libfsm/print/llvm.c
SRC += src/libfsm/print/cdata.c
SRC += src/libfsm/print/rust.c
SRC += src/libfsm/print/sh.c
SRC += src/libfsm/print/vmasm.c
Expand Down
Loading

0 comments on commit 456652b

Please sign in to comment.