Changes between Version 12 and Version 13 of IR2


Ignore:
Timestamp:
04/19/21 20:56:18 (5 years ago)
Author:
siegel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • IR2

    v12 v13  
    11== CIVL IR ==
    22
    3 Language principles:
     3=== Language principles ===
     4
    45* CIVL-IR is a subset of CIVL-C.  A CIVL-IR program is a CIVL-C program, and has the same semantics.
    56
     7=== Grammar ===
    68
    7 Types:
     9{{{
     10program: typedef* vardecl* fundef+ ;
     11block: '{' typedef* vardecl* fundef* statement* '}' ;
     12statement: block | basicStmt ;
     13basicStmt:  (ID ':')? (simpleStmt | chooseStmt | gotoStmt) ;
     14gotoStmt: 'goto' ID ;
     15simpleStmt: (guardedStmt | primitiveStmt) gotoStmt? ;
     16guardedStmt: 'when' expr 'do' primitiveStmt ;
     17chooseStmt: 'begin choose' simpleStmt+ 'end choose' ;
     18typedef: 'type' ID '=' typeName ';' ;
     19vardecl: 'var' varopts? ID ':' typeName ';' ;
     20varopts: '[' varopt+ ']' ;
     21varopt: 'input' | 'output' ;
     22fundef:  'fun' funopts? ID '(' paramlist ')' (':' typeName)? conclause* block ;
     23funopts: '[' funopt+ ']' ;
     24conclause : 'assigns' expr ';'
     25          | 'requires' expr ';'
     26          | 'ensures' expr ';'
     27          ...
     28}}}
     29
     30
     31=== Types ===
    832* `$bool` : boolean type ($true and $false, unrelated to integers)
    933* `$char` : character type (Unicode characters, unrelated to integers)