G
Gibsonist
Hi
I am working on my final year project in Computer Science - a simple
programming language that the compierl translates into a program for a
Turing Machine.
I got my compiler working more or less but would like to add a feature
so that that macros can be used &&|| the user can add his own macros
e.g. the language does only now +1 so a macro for a +b would something
ala tmp =0; while(tmp !=b) a + 1;tmp +1;
These macros should be in a file and then specified by the user in a
form like
#include FullAddition.macro at the beginning of the file.
I thought about using a streaming editor that loads the file and
replaces all occurances of say add(a,b) with the acctual code, but this
doesn't seem an elegant method.
Any suggestions?
Cheers Gibsonist
I am working on my final year project in Computer Science - a simple
programming language that the compierl translates into a program for a
Turing Machine.
I got my compiler working more or less but would like to add a feature
so that that macros can be used &&|| the user can add his own macros
e.g. the language does only now +1 so a macro for a +b would something
ala tmp =0; while(tmp !=b) a + 1;tmp +1;
These macros should be in a file and then specified by the user in a
form like
#include FullAddition.macro at the beginning of the file.
I thought about using a streaming editor that loads the file and
replaces all occurances of say add(a,b) with the acctual code, but this
doesn't seem an elegant method.
Any suggestions?
Cheers Gibsonist