index 277940ce17b58fb18f46ee630aa162c2a250c62a..1757cb6221fe49317bb5336c9ff136ed7572ffde 100644 (file)
return '!';
}
+char *
+jvm_get_name(oberon_object_t * x)
+{
+ switch(x -> class)
+ {
+ case OBERON_CLASS_VAR:
+ case OBERON_CLASS_VAR_PARAM:
+ case OBERON_CLASS_PARAM:
+ case OBERON_CLASS_FIELD:
+ return new_string(x -> name);
+ case OBERON_CLASS_PROC:
+ if(x -> parent)
+ {
+ return new_string("%s$%s", jvm_get_name(x -> parent), x -> name);
+ }
+ else
+ {
+ return new_string(x -> name);
+ }
+ default:
+ gen_error("jvm_get_name: wat");
+ }
+
+ return NULL;
+}
+
char *
jvm_get_field_full_name(oberon_object_t * x)
{
+ char * parent;
switch(x -> class)
{
case OBERON_CLASS_VAR:
+ return new_string("%s/%s", x -> module -> name, jvm_get_name(x));
case OBERON_CLASS_PROC:
- return new_string("%s/%s", x -> module -> name, x -> name);
- case OBERON_CLASS_FIELD:;
- char * rec_name = jvm_get_class_full_name(x -> parent_type);
- return new_string("%s/%s", rec_name, x -> name);
+ return new_string("%s/%s", x -> module -> name, jvm_get_name(x));
+ case OBERON_CLASS_FIELD:
+ parent = jvm_get_class_full_name(x -> parent_type);
+ return new_string("%s/%s", parent, jvm_get_name(x));
case OBERON_CLASS_MODULE:
return new_string(x -> module -> name);
default: