Sorry for being unclear. I'll try to give you a decent example.
Say a text file contains the following code:
Code:
func<int> Add(int x, int y)
{ return (x + y); }
structure Container
{ int i; };
func<int> main()
{
Container c;
c.i = Add(20, 22);
}
This should translate to something like the following code:
Code:
int Add(int x, int y)
{ return (x + y); }
typedef struct
{ int i; } Container;
int main()
{
Container c;
c.i = Add(20, 22);
}
Simply converting the text file's contents into proper C code and exporting it into a new .c file is not what I want to do - I want to have the text interpreted and executed at loading time.
Either that, or I want to compile it right away - for example, if I have an executable with my C program, if I drag a text file containing "code" for my "new language", I want it to export another executable, rather than having to manually compile the new .c file. Is there some sort of C compiler written in C which I can use in such a manner?
Hopefully this is somewhat understandable.