MYCE Langauge Specification

Goals

The goal of the MYCE compiler is to show IL instructions and the EE in action.

Overview

The compiler itself is a simple recursive descent parser with a single pass code generator. It generates an assembler source file which is then used as input to the IL Assembler (ILASM.EXE).

Language Specification

The language is a subset of the C language with simplified declarations, both external and local.

Data Types

The only supported data types are "int" and "void". Limiting these choices (for now) allows a simpler compiler design.

Data Declaration

Variables can be declared "static" or local. Implicit "static" declarations occur outside of function declarations. Local declarations can occur only at the beginnings of functions prior to statements. For example:
int foo()
  {
  int y;
  }
int x;

int bar()
  {
  static int z;
  };

In this example the variable "x" is a static declaration (by default) and the variable "y" is a local variable in function "foo". The variable "z" is actually a static even though it is declared within a function.

Flow Control

Restrictions

Formal Definition