Modify gen_expr() to return a location and code

- This allows the implementation of the expression AST_ID without using
  a temporary variable.