Changes between Version 21 and Version 22 of IR2


Ignore:
Timestamp:
04/26/21 15:08:15 (5 years ago)
Author:
siegel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • IR2

    v21 v22  
    1515  | 'typedef' type-specifier declarator ';'
    1616  ;
    17 decl: type-qualifier? type-specifier declarator ';' ;
    18 fundef: type-specifier declarator block ; 
    19 block: '{' typedef* vardecl* fundef* statement* '}' ;
     17decl: qualifier? type-specifier declarator contract-clause* ';' ;
     18qualifier: '$input' | '$output' | '$abstract' | '$system' '<' STRING ',' STRING '>' ;
     19function-definition: '$atomic_f'? type-specifier declarator contract-clause* block ;
     20block: '{' typedef* decl* function-definition* statement* '}' ;
    2021statement: block | simpleStmt | chooseStmt ;
    2122simpleStmt: label? guard? primitiveStmt gotoStmt? ;
     
    2425guard: '$when' '(' expr ')' ; 
    2526gotoStmt: 'goto' ID ;
    26 expr:
    27 simpleStmt:
    28 INT /* integer constant */
    29 ID /* identifier */
    30 conclause : 'assigns' expr ';'
    31           | 'requires' expr ';'
    32           | 'ensures' expr ';'
    33           ...
     27INT: ... /* integer constant */
     28ID: ... /* identifier */
     29contract-clause :
     30    '$assigns' expr ';'
     31  | '$requires' expr ';'
     32  | '$ensures' expr ';'
     33   ...
    3434
    3535}}}
     
    6060  | '$rel' '<' type-list '>'  /* relation: set of n-tuples with specified component types */
    6161  ;
    62 type-qualifier: '$input' | '$output' ;
    6362declarator: '*'* ID ('[' ']' | '(' type-list? ')')* ;
    6463type-name: type-specifier '*'* ('[' ']' | '(' type-list? ')')* ;
     
    8281
    8382{{{
    84 simple-statement:
     83primitiveStmt:
    8584    ';'  /* noop */
    8685  | lvalue '=' expr ';'  /* assignment */
     
    103102}}}
    104103
     104=== Expressions ===
     105
     106{{{
     107  expr:
     108
     109}}}
     110
     111
     112