 Mdef Example
Mdef ExampleHere is a code generation example using MDef (http://mdef.sourceforge.net):
  mdef program
      program-headers
      program-main
  mend
  mdef program-headers
      #include <stdio.h>
  mend
  mdef program-main
      int main(int argc, char* argv[])
      {
          program-body
      }
  mend
  mdef program-body
      printf("hello world\n");
      return 0;
  mend
  program
Save this to hello.m. Then type 
perl mdef.pl hello.m > hello.c gcc hello.c ./a.outThis will print "hello world".
Note that everything here is reusable except for the program-body.
 EditText of this page
(last edited August 24, 2012)
or FindPage with title or text search
 EditText of this page
(last edited August 24, 2012)
or FindPage with title or text search