+ /*** Make type information for the class (PRIMA). ***/
+ /* The type of the class */
+ class_prima = new_type_class(id_from_str ("PRIMA", 5));
+ /* We need type information for pointers to the class: */
+ class_p_ptr = new_type_pointer (id_from_str ("class_prima_ptr", 15),
+ class_prima);
+ /* An entity for the field (a). The entity constructor automatically adds
+ the entity as member of the owner. */
+ a_e = new_entity(class_prima, id_from_str ("a", 1), prim_t_int);
+ /* An entity for the method set_a. But first we need type information
+ for the method. */
+ proc_set_a = new_type_method(id_from_str("set_a", 5), 2, 0);
+ set_method_param_type(proc_set_a, 0, class_p_ptr);
+ set_method_param_type(proc_set_a, 1, prim_t_int);
+ proc_set_a_e = new_entity(class_prima, id_from_str ("set_a", 5), proc_set_a);
+ /* An entity for the method c. Implicit argument "self" must be modeled
+ explicit! */
+ proc_c = new_type_method(id_from_str("c", 1 ), 2, 1);
+ set_method_param_type(proc_c, 0, class_p_ptr);
+ set_method_param_type(proc_c, 1, prim_t_int);
+ set_method_res_type(proc_c, 0, prim_t_int);
+ proc_c_e = new_entity(class_prima, id_from_str ("c", 1), proc_c);
+
+ /*** Now build procedure main. ***/
+ /** Type information for main. **/