| 7 | | Types: |
| | 9 | {{{ |
| | 10 | program: typedef* vardecl* fundef+ ; |
| | 11 | block: '{' typedef* vardecl* fundef* statement* '}' ; |
| | 12 | statement: block | basicStmt ; |
| | 13 | basicStmt: (ID ':')? (simpleStmt | chooseStmt | gotoStmt) ; |
| | 14 | gotoStmt: 'goto' ID ; |
| | 15 | simpleStmt: (guardedStmt | primitiveStmt) gotoStmt? ; |
| | 16 | guardedStmt: 'when' expr 'do' primitiveStmt ; |
| | 17 | chooseStmt: 'begin choose' simpleStmt+ 'end choose' ; |
| | 18 | typedef: 'type' ID '=' typeName ';' ; |
| | 19 | vardecl: 'var' varopts? ID ':' typeName ';' ; |
| | 20 | varopts: '[' varopt+ ']' ; |
| | 21 | varopt: 'input' | 'output' ; |
| | 22 | fundef: 'fun' funopts? ID '(' paramlist ')' (':' typeName)? conclause* block ; |
| | 23 | funopts: '[' funopt+ ']' ; |
| | 24 | conclause : 'assigns' expr ';' |
| | 25 | | 'requires' expr ';' |
| | 26 | | 'ensures' expr ';' |
| | 27 | ... |
| | 28 | }}} |
| | 29 | |
| | 30 | |
| | 31 | === Types === |