wiki synchronisation
authorMarkus Bröker <mbroeker@largo.dyndns.tv>
Thu, 16 Apr 2009 12:49:11 +0200
changeset 31 c95a6a7e305c
parent 30 d037c433ec3e
child 32 9b56360ec64e
wiki synchronisation committer: Markus Bröker <mbroeker@largo.homelinux.org>
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 <stdlib.h>
@@ -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;