Humboldt-Universität zu Berlin - Mathematisch-Naturwissenschaftliche Fakultät - Systemanalyse

Syntax der Sprache C0

Syntax der Sprache C0

 program ::= ( declassignment ";" | functiondefinition )* functiondefinition ::= type id "(" ( parameterlist )? ")" "{" statementlist "}" parameterlist ::= type id ( "," type id )* functioncall ::= id "(" ( assignment ( "," assignment )* )? ")" statementlist ::= ( block )* block ::= "{" statementlist "}" | statement block2 ::= "{" statementlist "}" | statement statement ::= ifstatement | forstatement | whilestatement | returnstatement ";" | dowhilestatement ";" | printf ";" | declassignment ";" | statassignment ";" | functioncall ";" ifstatement ::= "(" assignment ")" block2 ( block2 )? forstatement ::= "(" ( statassignment | declassignment ) ";" expr ";" statassignment ")" block2 dowhilestatement ::= block2 "(" assignment ")" whilestatement ::= "(" assignment ")" block2 returnstatement ::= ( assignment )? printf ::= "(" assignment ")" declassignment ::= type id ( "=" assignment )? type ::= | | | statassignment ::= id "=" assignment assignment ::= id "=" assignment | expr expr ::= simpexpr ( "==" simpexpr | "!=" simpexpr | "<=" simpexpr | ">=" simpexpr | "<" simpexpr | ">" simpexpr )? simpexpr ::= ( "-" term | term ) ( "+" term | "-" term | "||" term )* term ::= factor ( "*" factor | "/" factor | "&&" factor )* factor ::= | | | functioncall | id | "(" assignment ")" id ::=