Kimwitu: demo: initialization code

to make sure the argument to Const is non-zero, we can add a check which will be executed when an expr is created. (this differs from C++ !!)

The $0 in this code refers to the term under construction.


expr: {{ /* this block contains expr initialization code */ with( $0 ) { Const( i ): { if (i < 0) fatal("negative expr constant: %d\n", i); } default: {/*EMPTY*/} } }};

next back overview