PDA

Click to See Complete Forum and Search --> : C interpreter in C


jim mcnamara
Oct 11th, 2001, 09:05 AM
This is snotc (its-not-c). It is an interpreter of C written in C.
Like smallC, and some others. It might be fun to look at.

It has a lot of limitations -

You feed it source code as a file; it's not interactive,
pass the filename as a command line parm.

All{ if, while, do else } code has to be a code block (curly brackets), you can't do one liners.

if(a==0){ b=0; }


string & int types only are supported.

Anyway, you can extend it as much as you like. This code works correctly under Turbo C, compiles and runs under VC++, but has NOT been tested. Note the getche gotcha.

And if plenderj is around: jamie, note the use of stacks.

niwradz
Sep 3rd, 2011, 01:31 PM
will you show how to do that the feeding and passing the filename as a command line parameter because im trying and i can't do it alone....im too far in mastering c language...hope you consider...tnx