Changes between Version 18 and Version 19 of CIVLite
- Timestamp:
- 10/03/23 14:52:00 (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CIVLite
v18 v19 20 20 21 21 {{{ 22 constant: INT | 'null' | '{' (constant (',' constant)*)? '}'22 constant: INT | 'null' 23 23 string: '"' .* '"' 24 24 type: 'int' | 'proc' | type[] 25 25 typedvar: type ID 26 paramdecl: 'param' typedvar ('=' constant)? ';'26 paramdecl: 'param' typedvar ('=' expr)? ';' 27 27 vardecl: typedvar ';' 28 28 formallist: typedvar (',' typedvar)* … … 51 51 expr: lval | constant | '(' expr ')' | expr '+' expr | ... // + - * / mod - == != >= > < <= && || ! 52 52 | 'ite' '(' expr ',' expr ',' expr ')' 53 | 'array' '(' type ',' expr ',' expr ')' // array(element-type, length, value) 53 | '(' type ')' 'array' '(' expr ',' expr ')' // (T[])array(length, value) 54 | '(' type ')' '{' (expr (',' expr)*)? '}' // (T[]){x1, ..., xn} 54 55 55 56 program: paramdecl* vardecl* function* … … 60 61 int[][] %zero2d(int %n, int %m) { 61 62 int[][] %a; 62 %a = array(int[], %n, array(int,%m, 0));63 %a = (int[][])array(%n, (int[])array(%m, 0)); 63 64 return %a; 64 65 }
