|mixed c and occam compiler email@example.com (Andrew Woolley) (2001-02-12)|
|Re: mixed c and occam compiler firstname.lastname@example.org (2001-02-15)|
|Re: mixed c and occam compiler email@example.com (2001-02-17)|
|From:||firstname.lastname@example.org (Roger Peppé)|
|Date:||17 Feb 2001 01:30:03 -0500|
|Posted-Date:||17 Feb 2001 01:30:03 EST|
Andrew Woolley <email@example.com> schreibt:
> For part of my third year Uni project I have to allow for a mixture of
> c and occam source.
One of your principal difficulties will be the fact that occam has a
lexically nested procedure scope, whereas C does not.
In occam you can say something like (dredging from my extremely rusty
a := 99
PROC z(INT c)
a := 88
a := a + c
This sort of thing means that nested functions need some sort of
dynamic pointer chain back up the lexically nested scopes, as variables
outside the innermost scope are not available as fixed offsets from the
current stack frame.
As I recall, the Inmos occam compiler does pass such a pointer around.
this means that although calling C from occam would be doable, and
indeed calling occam from C wouldn't be hard (just pretend you're at
the outermost scope), intermingling C and occam in such a way that the
occam can call C and the C can then call the occam again would be
Return to the
Search the comp.compilers archives again.