tool: EiC


Language:
ANSI/ISO C
Version:
4.x
Parts:
Documentation, interactive byte-code interpreter, header files, C preprocessor and examples
Author:
Ed. Breen (Ed.Breen@Altavista.net)
Location:
http://www.pobox.com/~eic
Description:
EiC is a pointer-safe, byte-code C interpreter. It is an LL(N) parser, where N is defined at compile time and is currently set to 3. It was developed from a perceived need for a complete interactive C interpreter, which can also run non-interactively in typical interpreter/compiler batch mode style.

EiC is suitable as: an aid in teaching C, for fast prototype of new programs and as a research tool - as it allows the user to quickly interface and call compiled C routines, experiment with user supplied code, standard ISO C and POSIX.1 functions, and all via immediate statements, which are statements that are executed immediately, and it has its own built in ISO style C preprocessor.

It is also pointer safe, which means that EiC catches most types of array bound violations. It can also be run non-interactively or in batch mode, where it is possible to write programs that take command line arguments in the usual C way. And it is a scripting language allowing the development of CGI scripts. EiC supports the concept of modules, which are related groups of EiC/C functions that get interpreter'd by EiC or builtin to EiC. It is also possible for compiled code to make calls (callbacks) to interpreter'd code. And EiC has builtin functionality that generates interfaces to C libraries.

Conformance:
EiC attempts to be compliant ISO C, but see features.
Features:
Although, EiC can parse almost all of the C programming language, right up front it is best to mention what is currently lacking or different:

  1. <signal.h> is not fully supported.

  2. Structure _bit_ fields are not supported.

  3. While structures and unions can be returned from and passed by value to functions, it is illegal in EiC to pass a structure or a union to a variadic function (that is, a function that takes a variable number of arguments):

    EiC 1> struct stag {int x; double y[5];} ss;
    EiC 2> void foo(const char *fmt, ...);
    EiC 3> foo("",ss);
    Error: passing a struct/union to variadic function `foo'

  4. The C concept of linkage is not supported. This is because, EiC does not export identifiers to a linker - as does a true C compiler. EiC works from the concept of a single translation unit. However, static variables or or functions defined in one file are kept private to that file.

  5. EiC does not parse preprocessor numbers, which aren't valid numeric constants.

  1. EiC supports both standard C like comments /* ... */ and C++ style comments.

  1. There are no default type specifiers for function return values. In EiC it is illegal to not explicitly state the return type of a function:

    foo() { ... } /* error: missing return type*/
    int foo() { ... } /* correct, return type specified*/

  1. In addition to function definitions and declarations with an empty parameter list, EiC only supports prototype declarations and definitions:

    int foo(); /* Empty parameter list allowed */ int f(value) int value { ... } /* Illegal: old style C*/ int f(int); /* Allowed, prototype declaration */ int f(int value); /*Allowed, full prototype declaration*/

  2. EiC does not support trigraph sequences, wide characters or wide strings: nor does it support the standard header <locale.h>.

  1. EiC's preprocessor lacks the #line directive.

  2. For convenience, EiC allows the #include directive to have an extra form, which permits the parsing of a token-sequence in the form ``#include filename''; that is, without enclosing double quotes or angled brackets.

  3. Besides parsing preprocessor directives or C statements, EiC also parses its own internal house keeping language. House keeping commands start with a colon.
Restriction:
Source code is available under the Artistic Licence.
Ports:
Linux (elf) SUN SPARC SOLARIS 2.x SUN SOLARIS/i386 SUN OS 4.1.x ALPHA OSF 3.x and 4.x IRIX 6.x HP-UX B.10.20 NetBSD FreeBSD WIN32
Portability:
Should be portable to any system running gcc, and gnu make.
Status:
actively supported
Announcements:
http://www.pobox.com/~eic
Contact:
Ed.Breen@Altavista.net
Updated:
2000/1/04

Related Items

category: C variants summary, or expanded.

category: compiled, imperative languages summary, or expanded.

category: graphic user interface support summary, or expanded.

category: terminal graphics support summary, or expanded.


This site is supported by David Sharnoff and Bryan Miller with some help from Google Adwords.

Please send updates to free-compilers@sharnoff.org

The HTML is maintained by David Muir Sharnoff and the entries themselves are currently maintained by Bryan Miller.

Copyright (c) 1992-1998 David Muir Sharnoff, All Rights Reserved
Copyright (c) 1994-1996, Steven Allen Robenalt, All Rights Reserved
Copyright (c) 1999-2010 David Muir Sharnoff, Bryan Miller, All Rights Reserved