123456789101112131415161718 |
- #include "main.h"
-
- int main(int argc, char* argv[]) {
- struct State state;
- struct CmdList* cmds;
- if ( argc != 2 ) {
- fprintf(stderr, "Usage: ./main 'instructions'\n");
- exit(1);
- }
-
- initCmds(&cmds);
- state.prog = lexer(argv[1]);
- state.instructionPointer = 0;
- init(&(state.pile));
- state.mode = EXECUTE;
- execute(&state, cmds);
- endCmds(&cmds);
- }
|