Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C Interpreter (Not Compiler)? [duplicate]

Possible Duplicate:
Is there an interpreter for C?

Is there a "C implementation" which acts the same as the "C abstract machine" when executing a C program? That is, a simple interpreter for C as it is described in a C standard such as C99.

There are many implementations of the C programming language that are compilers (Clang, GCC, MSVC). I'm looking for an open source implementation of a C interpreter.

like image 932
Sh'mu'el Lowenstein Avatar asked May 12 '11 15:05

Sh'mu'el Lowenstein


3 Answers

CINT - http://root.cern.ch/drupal/content/cint But it is not C99 AFAIK.

like image 115
c-smile Avatar answered Sep 20 '22 07:09

c-smile


google "cint", "ch".

I like tcc (also there are some links that my prove fruitful in there). tcc is basically a compiler, but you call it with a shebang line

#!/usr/local/bin/tcc -run
#include <stdio.h>
int main(void) { puts("Hello, World!"); return 0; }
like image 36
pmg Avatar answered Sep 22 '22 07:09

pmg


Ch is "an embeddable C/C++ interpreter and scripting language for cross-platform scripting, numerical computing, shell programming, 2D/3D plotting, quick animation, and embedded scripting."

like image 41
nmichaels Avatar answered Sep 19 '22 07:09

nmichaels