add ref expression
store generated code for later use