| 1 | package SMOP::Boilerplate; | ||
| 2 | BEGIN { | ||
| 3 | $SMOP::Boilerplate::VERSION = '0.6'; | ||
| 4 | } | ||
| 5 | |||
| 6 | our $BOILERPLATE = <<'END'; | ||
| 7 | #include <smop/base.h> | ||
| 8 | #include <smop/s0native.h> | ||
| 9 | #include <smop/nagc.h> | ||
| 10 | #include <smop/interpreter.h> | ||
| 11 | #include <smop/capture.h> | ||
| 12 | #include <smop/native.h> | ||
| 13 | #include <smop/mold.h> | ||
| 14 | #include <smop/s1p.h> | ||
| 15 | #include <smop/lost.h> | ||
| 16 | #include <smop/p6opaque.h> | ||
| 17 | #include <smop/s1p-oo.h> | ||
| 18 | #include <smop/yeast.h> | ||
| 19 | #include <smop/profile.h> | ||
| 20 | #include <smop/dump.h> | ||
| 21 | #include <smop/nagc.h> | ||
| 22 | #include <stdio.h> | ||
| 23 | |||
| 24 | void smop_p5_init(SMOP__Object* interpreter); | ||
| 25 | void smop_p5_destr(SMOP__Object* interpreter); | ||
| 26 | |||
| 27 | /* Your helper function go here */ | ||
| 28 | %%FUNCS%% | ||
| 29 | |||
| 30 | int main(int argc, char** argv) { | ||
| 31 | smop_s0native_init(); | ||
| 32 | smop_dump_init(); | ||
| 33 | smop_nagc_init(); | ||
| 34 | smop_capture_init(); | ||
| 35 | smop_interpreter_init(); | ||
| 36 | smop_mold_init(); | ||
| 37 | smop_yeast_init(); | ||
| 38 | |||
| 39 | SMOP__Object* interpreter = SMOP_interpreter_create(SMOP__EmptyInterpreter); | ||
| 40 | |||
| 41 | smop_native_init(interpreter); | ||
| 42 | smop_s1p_init(interpreter); | ||
| 43 | |||
| 44 | smop_lost_init(interpreter); | ||
| 45 | smop_p6opaque_init(interpreter); | ||
| 46 | smop_s1p_oo_init(interpreter); | ||
| 47 | |||
| 48 | smop_p5_init(interpreter); | ||
| 49 | |||
| 50 | smop_mold_message_init(interpreter); | ||
| 51 | |||
| 52 | |||
| 53 | /* The frame creation code goes here */ | ||
| 54 | %%BODY%% | ||
| 55 | |||
| 56 | SMOP_DISPATCH(interpreter, SMOP_RI(interpreter), | ||
| 57 | SMOP__NATIVE__idconst_create("goto"), | ||
| 58 | SMOP__NATIVE__capture_create(interpreter, | ||
| 59 | (SMOP__Object*[]) {SMOP_REFERENCE(interpreter,interpreter),frame,NULL}, | ||
| 60 | (SMOP__Object*[]) {NULL}) | ||
| 61 | ); | ||
| 62 | |||
| 63 | SMOP_DISPATCH(interpreter, SMOP_RI(interpreter), | ||
| 64 | SMOP__NATIVE__idconst_create("loop"), | ||
| 65 | SMOP__NATIVE__capture_create( | ||
| 66 | interpreter, | ||
| 67 | (SMOP__Object*[]) {SMOP_REFERENCE(interpreter,interpreter),NULL} | ||
| 68 | ,(SMOP__Object*[]) {NULL})); | ||
| 69 | |||
| 70 | SMOP_DISPATCH(interpreter, SMOP_RI(interpreter), | ||
| 71 | SMOP__NATIVE__idconst_create("goto"), | ||
| 72 | SMOP__NATIVE__capture_create( | ||
| 73 | interpreter, | ||
| 74 | (SMOP__Object*[]) {SMOP_REFERENCE(interpreter,interpreter),SMOP__NATIVE__bool_false,NULL} | ||
| 75 | ,(SMOP__Object*[]) {NULL})); | ||
| 76 | |||
| 77 | SMOP_DISPATCH(interpreter, SMOP_RI(interpreter), | ||
| 78 | SMOP__NATIVE__idconst_create("loop") , SMOP__NATIVE__capture_create( | ||
| 79 | interpreter, | ||
| 80 | (SMOP__Object*[]) {SMOP_REFERENCE(interpreter,interpreter),NULL}, | ||
| 81 | (SMOP__Object*[]) {NULL})); | ||
| 82 | |||
| 83 | |||
| 84 | |||
| 85 | smop_mold_message_destr(interpreter); | ||
| 86 | smop_p5_destr(interpreter); | ||
| 87 | smop_s1p_oo_destr(interpreter); | ||
| 88 | smop_p6opaque_destr(interpreter); | ||
| 89 | smop_lost_destr(interpreter); | ||
| 90 | smop_s1p_destr(interpreter); | ||
| 91 | smop_native_destr(interpreter); | ||
| 92 | |||
| 93 | SMOP_DISPATCH(interpreter, SMOP_RI(interpreter), | ||
| 94 | SMOP__NATIVE__idconst_create("loop"), | ||
| 95 | SMOP__NATIVE__capture_create( | ||
| 96 | interpreter, | ||
| 97 | (SMOP__Object*[]) {SMOP_REFERENCE(interpreter,interpreter),NULL} | ||
| 98 | ,(SMOP__Object*[]) {NULL})); | ||
| 99 | |||
| 100 | SMOP_DISPATCH(interpreter, SMOP_RI(interpreter), | ||
| 101 | SMOP__NATIVE__idconst_create("goto"), | ||
| 102 | SMOP__NATIVE__capture_create( | ||
| 103 | interpreter, | ||
| 104 | (SMOP__Object*[]) {SMOP_REFERENCE(interpreter,interpreter),SMOP__NATIVE__bool_false,NULL} | ||
| 105 | ,(SMOP__Object*[]) {NULL})); | ||
| 106 | |||
| 107 | SMOP_DISPATCH(interpreter, SMOP_RI(interpreter), | ||
| 108 | SMOP__NATIVE__idconst_create("loop") , SMOP__NATIVE__capture_create( | ||
| 109 | interpreter, | ||
| 110 | (SMOP__Object*[]) {SMOP_REFERENCE(interpreter,interpreter),NULL}, | ||
| 111 | (SMOP__Object*[]) {NULL})); | ||
| 112 | |||
| 113 | SMOP_RELEASE(SMOP__EmptyInterpreter,interpreter); | ||
| 114 | |||
| 115 | |||
| 116 | smop_yeast_destr(); | ||
| 117 | smop_mold_destr(); | ||
| 118 | smop_interpreter_destr(); | ||
| 119 | smop_capture_destr(); | ||
| 120 | smop_nagc_destr(); | ||
| 121 | smop_dump_destr(); | ||
| 122 | smop_s0native_destr(); | ||
| 123 | smop_s1p_close_dlhandles(); | ||
| 124 | |||
| 125 | return 0; | ||
| 126 | } | ||
| 127 | END | ||
| 128 | 1; |