Humboldt-Universität zu Berlin ZE Rechenzentrum (CMS) Abt. Systemsoftware und Kommunikation Dr. rer. nat. Andreas Kunert |
program | ::= | ( functiondefinition )* <EOF> |
functiondefinition | ::= | type <ID> "(" ")" "{" statementlist "}" |
functioncall | ::= | <ID> "(" ")" |
statementlist | ::= | ( block )* |
block | ::= | "{" statementlist "}" |
| | statement | |
statement | ::= | ifstatement |
| | returnstatement ";" | |
| | printf ";" | |
| | statassignment ";" | |
| | functioncall ";" | |
ifstatement | ::= | <KW_IF> "(" assignment ")" block |
returnstatement | ::= | <KW_RETURN> ( assignment )? |
printf | ::= | <KW_PRINTF> "(" assignment ")" |
type | ::= | <KW_BOOLEAN> |
| | <KW_FLOAT> | |
| | <KW_INT> | |
| | <KW_VOID> | |
statassignment | ::= | <ID> "=" assignment |
assignment | ::= | ( ( <ID> "=" assignment ) | expr ) |
expr | ::= | simpexpr ( ( "==" | "!=" | "<=" | ">=" | "<" | ">" ) simpexpr )? |
simpexpr | ::= | ( "-" )? term ( ( "+" | "-" | "||" ) term )* |
term | ::= | factor ( ( "*" | "/" | "&&" ) factor )* |
factor | ::= | <CONST_INT> |
| | <CONST_FLOAT> | |
| | <CONST_BOOLEAN> | |
| | functioncall | |
| | <ID> | |
| | "(" assignment ")" |
Page created: Wednesday, 08-Apr-2003 14:35:00 MEST Last update: Friday, 14-February-2014 17:53:48 CET Datenschutzerklärung |