Résultat du TP en C sur Forth
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

main.c 398B

123456789101112131415161718
  1. #include "main.h"
  2. int main(int argc, char* argv[]) {
  3. struct State state;
  4. struct CmdList* cmds;
  5. if ( argc != 2 ) {
  6. fprintf(stderr, "Usage: ./main 'instructions'\n");
  7. exit(1);
  8. }
  9. initCmds(&cmds);
  10. state.prog = lexer(argv[1]);
  11. state.instructionPointer = 0;
  12. init(&(state.pile));
  13. state.mode = EXECUTE;
  14. execute(&state, cmds);
  15. endCmds(&cmds);
  16. }