19 lines
398 B
C
19 lines
398 B
C
|
#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);
|
||
|
}
|