recursive_compiler.c
changeset 48 b94d657a9acb
parent 31 c95a6a7e305c
child 77 49e0babccb23
equal deleted inserted replaced
47:63adb261de90 48:b94d657a9acb
     1 /**
     1 /**
     2  * Ein-Pass-Compiler
     2  * Ein-Pass-Compiler
     3  * Adapted from: http://de.wikipedia.org/wiki/Compiler
     3  * Adapted from: http://de.wikipedia.org/wiki/Compiler
     4  */
     4  */
     5 
     5 
       
     6 #include <stdio.h>
     6 #include <stdlib.h>
     7 #include <stdlib.h>
     7 #include <stdio.h>
       
     8 #include <string.h>
     8 #include <string.h>
     9 
     9 
    10 #define MODE_POSTFIX   0
    10 #define MODE_POSTFIX   0
    11 #define MODE_ASSEMBLY  1
    11 #define MODE_ASSEMBLY  1
    12 #define MAX           20
    12 #define MAX           20
   108     compile_mode = MODE_ASSEMBLY;
   108     compile_mode = MODE_ASSEMBLY;
   109     pos = 0;
   109     pos = 0;
   110     lookahead = *expression;
   110     lookahead = *expression;
   111     expr ();
   111     expr ();
   112 
   112 
   113     return 0;
   113     return EXIT_SUCCESS;
   114 }
   114 }