Research Article
Extracting UML Class Diagrams from Object-Oriented Fortran: ForUML
Algorithm 1
Samples code snippet of OOP constructs supported by Fortran 2003.
(1) module example | (2) type shape_ | (3) real :: area | (4) integer :: m | (5) end type | (6) ! Inheritance | (7) type, extends (shape_) :: circle | (8) ! Data abstraction | (9) private | (10) ! Encapsulation | (11) real :: radius | (12) contains | (13) procedure :: set_radius | (14) procedure :: add | (15) procedure :: area | (16) ! Polymorphism | (17) generic :: total => area | (18) generic :: operator(+) => add | (19) end type | (20) ! Overloads intrinsic constructor | (21) interface circle | (22) module procedure new_circle | (23) end interface | (24) ! … | (25) end module |
|