I am going to play with the idea we can embed C directly in Felix as so:

extern "C" typedef int fred;

At present, the grammar does nothing other than a syntax check.

The idea is: if it's a declaration in C, it declares a C entity to Felix.
If it's a definition in C, Felix calculates its interface, and also emits it.

For example if you write:

extern "C" long f(int);

it is the same as:
 
fun f:  int --> long = "f($1)";

But if you write

extern "C" long f(int a) { return a + 1; }

then it is the same as:

fun f:  int --> long = "f($1)";
body "long f(int a) { return a + 1; }";

The purpose of this feature is to make interfacing to C easier,
NOT non-existant, that is, you can't just plug in a C file and
expect it to work. Macros aren't allowed. GNU or MS extensions
aren't allowed. Not all weird C will be allowed. We'll start with
a nice subset of C89.

[Hmm now I have to try to find a C grammar somewhere .. anyone know
where I can find one? My copy of the C standard is lost .. :]



--
john skaller
skal...@users.sourceforge.net





------------------------------------------------------------------------------
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to