diff --git a/recursive_compiler.c b/recursive_compiler.c --- a/recursive_compiler.c +++ b/recursive_compiler.c @@ -1,6 +1,6 @@ /** * Ein-Pass-Compiler - * + * Adapted from: http://de.wikipedia.org/wiki/Compiler */ #include @@ -9,11 +9,12 @@ #define MODE_POSTFIX 0 #define MODE_ASSEMBLY 1 +#define MAX 20 char lookahead; int pos; int compile_mode; -char expression[20 + 1]; +char expression[MAX + 1]; void error () { @@ -95,7 +96,7 @@ int main (int argc, char **argv) { printf ("Bitte geben Sie einen Ausdruck in Infix-Notation ein:\n\n\t"); - fgets (expression, 20, stdin); + fgets (expression, MAX, stdin); printf ("\nCompilierter Ausdruck in Postfix-Notation:\n\n\t"); compile_mode = MODE_POSTFIX;