Syntax |
|
| |
Blöcke |
|
Syntax |
Block ::= { { Declaration }
{ Stmt }
}
|
| |
Beispiel |
{
int x, y;
...
{
int t;
t = x;
x = y;
y = t;
}
...
}
|
| |
Funktionen |
|
Syntax für ANSI-C |
FunctionDefinition
::= Type FctName ( FormalParamList )
Block
Type ::= void
| int
| float
| ...
FormalParamList
::= void
| Type ParamName { , Type ParamName }
|
| |
Beispiel |
int max (int x, int y)
{
return
x >= y
? x
: y;
}
|
|
void spoilTime (void)
{
while (1);
}
|
| |
Syntax für K&R C |
FunctionDefinition
::= Type FctName ( FormalParamNames )
FormalParamSpecs
Block
FormalParamNames
::= [ ParamName { , ParamName } ]
FormalParamSpecs
::= { Declaration }
|
| |
Beispiel |
int max (x, y)
int x;
int y;
{
return
x >= y
? x
: y;
}
|