Next:
- C and
Up: The
- C or
Previous: Properties and Restrictions
Let us now turns to the specification of the processor instructions
we want to use. We use here a minimal set of instructions, of three kinds:
- The operators to access an array element or the component of a
struct or an union :
Syntax :
- The Arithmetic and Logic Operators :
- Affectation Operator : =
Syntax :
- Arithmetic Operators :
- Logical Operators : they return either 1 when true or 0 when false.
Syntax :
Comparing to the standard C-language several aspects have been restrained
here:
- No implicit cast is allowed, since -in practice- this sometimes
depends on the compiler implementation, although or should not.
- When an undefined evaluation occurs, overflow, division by zero,
cast to undefined value, etc.. an exception or signal will be
issued, because undefined values are not acceptable here.
- Arithmetic and comparison operators apply on int and
float operands, but logic operators apply on int operands
only. Implicit casts, defined in standard-C, allows such extensions.
- The conditional, switch and particular loop instruction :\
Here we consider the following operators :
- conditional operator :
if(expr){ ... } else { ... } - switch operator :
switch name { case val1 :
;
default: } - particular form of the loop operator :
for(int i = a; i
b; i = i
c).
Syntax :
The main feature here is that we allow either conditional statements
though the if and switch constructs, or a very particular
kind of loop for which we can verify if it finishes and how many
iterations will be performed.
Soraya Arias
Mon Aug 5 17:38:44 MET DST 1996