OEP

0160

Title

INLINE blocks

Summary

Allow the inclusion of code in other languages.

Owner

Adam Sampson <ats@offog.org>

Status

Proposed

Date-Proposed

2007-05-04

Keywords

language compiler inline asm

occam 2 allows the inclusion of Transputer assembly code using ASM (or GUY) blocks. In the future, we will have targets for occam code other than Transputer bytecode, and it would be useful to be able to include chunks of other target languages in occam source in a similar manner.

The proposed syntax is similar to that permitted for ASM blocks, reusing the existing INLINE keyword in a process context:

PROC P (VAL REAL32 f)
  INLINE "C"
    printf ("%f", f);
:
PROC Q (INT x, y)
  INLINE "ETC"
    LD x
    ST y
:

The meaning of the contents of a block will necessarily be specific to the occam compiler and backend being used.

OEP/160 (last edited 2007-09-27 01:40:13 by ats1)