Skip to content

Enhancement request to support nested classes #198

@e-dana

Description

@e-dana

I'm working on a project to bring in existing code to model and refactor. I'm mostly interested in the structural model.
The source code (C/C++) structure is translated to TextUML and them imported into a UML editor/modeler.
The issue I'm having is that nested classes are not supported. Flattening a nested class is time consuming and not realistic, given
the number of lines of code I'm working with. I've tried writing code to auto-flatten the class, but there too many issues to do this
cleanly. UML does support nested classes. While I understand the undesirability of nesting a class, having this capability supported would save a great deal of time and effort.

Examples I'm looking to support (based on real C/C++ code):

  1. Simple 'typedef'.
import mdd_types;

class beta
    attribute prime : Integer;
end;

class foo
    class myType specializes some_other_type;
        attribute something_special : String;
    end;
    attribute alpha : myType;
end;
  1. Nested enumeration.
class bar
    enumeration DeviceState
        ON;
        OFF;
    end;
    attribute power_switch : DeviceState;
end;

While these are simple examples, the code base is more complex.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions