Changes between Version 14 and Version 15 of CIVLite


Ignore:
Timestamp:
09/28/23 11:20:51 (3 years ago)
Author:
siegel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CIVLite

    v14 v15  
    2727vardecl: typedvar ';'
    2828formallist: typedvar (',' typedvar)*
    29 function: type ID '(' formallist? ')' '{' (typedvar ';')* labelnode* '}'
    30 labelnode: (ID ':')? node
    31 node: transition ('or' transition)* // multiple transitions may depart a node
    32 transition: ((expr | 'else') '->')? action ('goto' ID ';')?
    33 // if guard is missing, guard is 1 (true)
    34 // else guard holds when all other guards are false
    35 // if goto is missing, goto the next location
    36 action: assignment call spawn noop return wait begin_atomic end_atomic assertion print
    37 assignment: lval '=' expr ';'
     29function: type ID '(' formallist? ')' '{' (typedvar ';')* labelnode* label? '}'
     30label: ID ':'
     31labelnode: label? node
     32node: transition | block
     33transition: action ('goto' ID)? ';'
     34block: 'choose' '{' guardedaction+ '}'
     35guardedaction: (expr | 'else') '->' transition
     36action: 'noop' assign call spawn return wait begin_atomic end_atomic assert print
     37assign: lval '=' expr
    3838invocation: ID '(' exprlist? ')'
    39 call: (lval '=')? 'call' invocation ';'
    40 spawn: (lval '=')? 'spawn' invocation ';'
    41 noop: ';'
    42 return: 'return' expr? ';'
    43 wait : 'wait' expr ';'
    44 begin_atomic: 'begin_atomic' ';'
    45 end_atomic: 'end_atomic' ';'
    46 assertion: 'assert' expr ';'
    47 print: 'print' exprstrlst ';'
     39call: (lval '=')? 'call' invocation
     40spawn: (lval '=')? 'spawn' invocation
     41return: 'return' expr?
     42wait : 'wait' expr
     43begin_atomic: 'begin_atomic'
     44end_atomic: 'end_atomic'
     45assert: 'assert' expr
     46print: 'print' exprstrlst
    4847exprstrlst: exprstr (',' exprstr)*
    4948exprstr: expr | string
     
    9089  print "t0 is before the barrier\n";
    9190  %s0 = 1;
    92   %s1 -> %s1 = 0;
     91  choose {
     92    %s1 -> %s1 = 0;
     93  }
    9394  print "t0 is after the barrier\n";
    9495}
     
    9697void %t1() {
    9798  print "t1 is before the barrier\n";
    98   %s0 -> %s0 = 0;
     99  choose {
     100    %s0 -> %s0 = 0;
     101  }
    99102  %s1 = 1;
    100103  print "t1 is after the barrier\n";
     
    126129int %y;
    127130void %main() {
    128   %x>0 -> ;
    129   or
    130   else -> ; goto @L1;
     131  choose {
     132    %x>0 -> noop;
     133    else -> noop goto @L1;
     134  }
    131135  %y=1;
    132   %z=2; goto @L2;
     136  %z=2 goto @L2;
    133137@L1:
    134138  %y=0;
    135139  %z=3;
    136 @L2: ;
     140@L2:
    137141}
    138142}}}