code generator for check expressions