| 10 | | program: typedef* vardecl* fundef+ ; |
| | 10 | program: typedef* decl* fundef+ ; |
| | 11 | typedef: |
| | 12 | enum ID '{' idnetifier-list '}' ';' |
| | 13 | | struct ID '{' decl* '}' ';' |
| | 14 | | union ID '{' decl* '}' ';' |
| | 15 | | 'typedef' type-specifier declarator ';' |
| | 16 | ; |
| | 17 | decl: type-qualifier? type-specifier declarator ';' ; |
| | 18 | type-qualifier: '$input' | '$output' ; |
| | 19 | type-specifier: |
| | 20 | ID |
| | 21 | | '$int' |
| | 22 | | '$bool' |
| | 23 | | '$char' |
| | 24 | | '$int' |
| | 25 | | '$real' |
| | 26 | | '$float' '<' INT ',' INT '>' |
| | 27 | | '$herbrand' '<' type-name '>' |
| | 28 | | '$proc' |
| | 29 | | '$bundle' |
| | 30 | | '$heap' |
| | 31 | | '$range' |
| | 32 | | '$domain' |
| | 33 | | '$mem' |
| | 34 | | 'enum' ID |
| | 35 | | 'struct' ID |
| | 36 | | 'union' ID |
| | 37 | | 'void' |
| | 38 | | '$seq' '<' type-name '>' |
| | 39 | | '$set' '<' type-name '>' |
| | 40 | | '$map' '<' type-name ',' type-name '>' |
| | 41 | | '$rel' '<' type-list '>' |
| | 42 | ; |
| | 43 | declarator: '*'* ID ('[' ']' | '(' type-list? ')')* ; |
| | 44 | type-name: type-specifier '*'* ('[' ']' | '(' type-list? ')')* ; |
| | 45 | type-list: type-name (',' type-name)* ; |
| | 46 | complete-type-name: type-specifier '*'* ('[' expr ']' | '(' type-list? ')')* ; |
| | 47 | fundef: type-specifier declarator block ; |