Analyzing a C++ library with a diagram [closed]


When I want to read an entire library in C++ I start with class A. Then I realize class A is using function B. Function B is using class C and C2 and class C uses class D.

I am aware that this referencing can also be circular.

Is there any application for drawing the following diagram for me:

A -> B -> C -> D
       -> C2

In order to start reading a library?

Apt Unmet dependecies: libefl-bin


I am encountering an error when I run apt-get upgrade. It appears I have a package installed that has unmet dependencies.

uname -a output:

Linux kbu 3.19.0-56-generic #62~14.04.1-Ubuntu SMP Fri Mar 11 11:03:15 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Here is the output from apt-get upgrade:

Reading package lists...
Building dependency tree...
Reading state information...
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 libefl-bin : Depends: libefl (= 201604022131-32022~ubuntu14.04.1) but 201603242131-31876~ubuntu14.04.1 is installed
E: Unmet dependencies. Try using -f.

Here is the output from running apt-get -f install:

Reading package lists...
Building dependency tree...
Reading state information...
Correcting dependencies... Done
The following extra packages will be installed:
  libefl
The following packages will be upgraded:
  libefl
1 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
1 not fully installed or removed.
Need to get 3,032 kB of archives.
After this operation, 3,278 kB of additional disk space will be used.
Get:1 http://ppa.launchpad.net/enlightenment-git/ppa/ubuntu/ trusty/main libefl amd64 201604022131-32022~ubuntu14.04.1 [3,032 kB]
Fetched 2,873 kB in 14s (193 kB/s)
(Reading database ... 217178 files and directories currently installed.)
Preparing to unpack .../libefl_201604022131-32022~ubuntu14.04.1_amd64.deb ...
Unpacking libefl (201604022131-32022~ubuntu14.04.1) over (201603242131-31876~ubuntu14.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/libefl_201604022131-32022~ubuntu14.04.1_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/libelementary.so.1.17.99', which is also in package libelementary 201603242216-12490~ubuntu14.04.1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/libefl_201604022131-32022~ubuntu14.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

…and the output from apt-cache showpkg libefl:

Package: libefl
Versions: 
201604022131-32022~ubuntu14.04.1 (/var/lib/apt/lists/ppa.launchpad.net_enlightenment-git_ppa_ubuntu_dists_trusty_main_binary-amd64_Packages)
 Description Language: 
                 File: /var/lib/apt/lists/ppa.launchpad.net_enlightenment-git_ppa_ubuntu_dists_trusty_main_binary-amd64_Packages
                  MD5: c3762b13d2835617f77263b388ba31ad
 Description Language: en
                 File: /var/lib/apt/lists/ppa.launchpad.net_enlightenment-git_ppa_ubuntu_dists_trusty_main_i18n_Translation-en
                  MD5: c3762b13d2835617f77263b388ba31ad

201603242131-31876~ubuntu14.04.1 (/var/lib/dpkg/status)
 Description Language: 
                 File: /var/lib/dpkg/status
                  MD5: cc1a6fd5b0ea2294658de3cd7b486a53


Reverse Depends: 
  libefl:i386,libefl
  e20,libefl
  libefl-dbg,libefl 201604022131-32022~ubuntu14.04.1
  libefl-dev,libefl 201604022131-32022~ubuntu14.04.1
  libefl-bin,libefl 201604022131-32022~ubuntu14.04.1
  terminology,libefl
  evas-loaders,libefl
  emodule-comp-scale,libefl
  ecomorph,libefl
  emodule-exebuf,libefl
  emodule-everything-websearch,libefl
  emodule-everything-wallpaper,libefl
  emodule-everything-tracker,libefl
  emodule-everything-places,libefl
  emodule-everything-pidgin,libefl
  emodule-everything-mpris,libefl
  emodule-everything-aspell,libefl
  emodule-engage,libefl
  emodule-empris,libefl
  emodule-elfe,libefl
  libelementary,libefl
  libedbus1,libefl
  emodule-wlan,libefl
  emodule-winselector,libefl
  emodule-winlist-ng,libefl
  emodule-weather,libefl
  emodule-uptime,libefl
  emodule-taskbar,libefl
  emodule-snow,libefl
  emodule-slideshow,libefl
  emodule-rain,libefl
  emodule-moon,libefl
  emodule-mem,libefl
  emodule-mail,libefl
  emodule-itask,libefl
  emodule-flame,libefl
  emodule-execwatch,libefl
  emodule-diskio,libefl
  emodule-deskshow,libefl
  emodule-cpu,libefl
  emodule-alarm,libefl
  ecomorph-core,libefl
  libelementary-bin,libefl
  e17,libefl
Dependencies: 
201604022131-32022~ubuntu14.04.1 - libbulletcollision2.81 (0 (null)) libbulletdynamics2.81 (0 (null)) libbulletsoftbody2.81 (0 (null)) libc6 (2 2.17) libdbus-1-3 (2 1.5.12) libfontconfig1 (2 2.9.0) libfreetype6 (2 2.2.1) libfribidi0 (2 0.19.2) libgcc1 (2 1:4.1.1) libgif4 (2 4.1.4) libgl1-mesa-glx (16 (null)) libgl1 (0 (null)) libglib2.0-0 (2 2.37.3) libgstreamer-plugins-base1.0-0 (2 1.0.0) libgstreamer1.0-0 (2 1.0.0) libharfbuzz0b (2 0.9.4) libjpeg8 (2 8c) liblinearmath2.81 (0 (null)) libluajit-5.1-2 (0 (null)) libmount1 (2 2.20.1) libpng12-0 (2 1.2.13-4) libpulse0 (2 1:0.99.1) libsndfile1 (2 1.0.20) libssl1.0.0 (2 1.0.0) libstdc++6 (2 4.1.1) libtiff5 (2 4.0.3) libudev1 (2 199) libwebp5 (0 (null)) libx11-6 (2 2:1.2.99.901) libxcomposite1 (2 1:0.3-1) libxcursor1 (4 1.1.2) libxdamage1 (2 1:1.1) libxext6 (0 (null)) libxfixes3 (0 (null)) libxi6 (2 2:1.2.99.4) libxinerama1 (0 (null)) libxrandr2 (2 2:1.2.99.3) libxrender1 (0 (null)) libxss1 (0 (null)) libxtst6 (0 (null)) zlib1g (2 1:1.1.4) libecore-con1 (0 (null)) libecore-con1:i386 (0 (null)) libecore-evas1 (0 (null)) libecore-evas1:i386 (0 (null)) libecore-fb1 (0 (null)) libecore-fb1:i386 (0 (null)) libecore-file1 (0 (null)) libecore-file1:i386 (0 (null)) libecore-imf1 (0 (null)) libecore-imf1:i386 (0 (null)) libecore-ipc1 (0 (null)) libecore-ipc1:i386 (0 (null)) libecore-x1 (0 (null)) libecore-x1:i386 (0 (null)) libecore0 (0 (null)) libecore0:i386 (0 (null)) libecore1 (0 (null)) libecore1:i386 (0 (null)) libedbus2 (0 (null)) libedbus2:i386 (0 (null)) libedje1 (0 (null)) libedje1:i386 (0 (null)) libeet0 (0 (null)) libeet0:i386 (0 (null)) libeet1 (0 (null)) libeet1:i386 (0 (null)) libeeze1 (0 (null)) libeeze1:i386 (0 (null)) libefreet1 (0 (null)) libefreet1:i386 (0 (null)) libeina0 (0 (null)) libeina0:i386 (0 (null)) libeina1 (0 (null)) libeina1:i386 (0 (null)) libeio0 (0 (null)) libeio0:i386 (0 (null)) libembryo0 (0 (null)) libembryo0:i386 (0 (null)) libemotion1 (0 (null)) libemotion1:i386 (0 (null)) libevas0 (0 (null)) libevas0:i386 (0 (null)) libevas1 (0 (null)) libevas1:i386 (0 (null)) libefl:i386 (0 (null)) 
201603242131-31876~ubuntu14.04.1 - libbulletcollision2.81 (0 (null)) libbulletdynamics2.81 (0 (null)) libbulletsoftbody2.81 (0 (null)) libc6 (2 2.17) libdbus-1-3 (2 1.5.12) libfontconfig1 (2 2.9.0) libfreetype6 (2 2.2.1) libfribidi0 (2 0.19.2) libgcc1 (2 1:4.1.1) libgif4 (2 4.1.4) libgl1-mesa-glx (16 (null)) libgl1 (0 (null)) libglib2.0-0 (2 2.37.3) libgstreamer-plugins-base1.0-0 (2 1.0.0) libgstreamer1.0-0 (2 1.0.0) libharfbuzz0b (2 0.9.4) libjpeg8 (2 8c) liblinearmath2.81 (0 (null)) libluajit-5.1-2 (0 (null)) libmount1 (2 2.20.1) libpng12-0 (2 1.2.13-4) libpulse0 (2 1:0.99.1) libsndfile1 (2 1.0.20) libssl1.0.0 (2 1.0.0) libstdc++6 (2 4.1.1) libtiff5 (2 4.0.3) libudev1 (2 199) libwebp5 (0 (null)) libx11-6 (2 2:1.2.99.901) libxcomposite1 (2 1:0.3-1) libxcursor1 (4 1.1.2) libxdamage1 (2 1:1.1) libxext6 (0 (null)) libxfixes3 (0 (null)) libxi6 (2 2:1.2.99.4) libxinerama1 (0 (null)) libxrandr2 (2 2:1.2.99.3) libxrender1 (0 (null)) libxss1 (0 (null)) libxtst6 (0 (null)) zlib1g (2 1:1.1.4) libecore-con1 (0 (null)) libecore-con1:i386 (0 (null)) libecore-evas1 (0 (null)) libecore-evas1:i386 (0 (null)) libecore-fb1 (0 (null)) libecore-fb1:i386 (0 (null)) libecore-file1 (0 (null)) libecore-file1:i386 (0 (null)) libecore-imf1 (0 (null)) libecore-imf1:i386 (0 (null)) libecore-ipc1 (0 (null)) libecore-ipc1:i386 (0 (null)) libecore-x1 (0 (null)) libecore-x1:i386 (0 (null)) libecore0 (0 (null)) libecore0:i386 (0 (null)) libecore1 (0 (null)) libecore1:i386 (0 (null)) libedbus2 (0 (null)) libedbus2:i386 (0 (null)) libedje1 (0 (null)) libedje1:i386 (0 (null)) libeet0 (0 (null)) libeet0:i386 (0 (null)) libeet1 (0 (null)) libeet1:i386 (0 (null)) libeeze1 (0 (null)) libeeze1:i386 (0 (null)) libefreet1 (0 (null)) libefreet1:i386 (0 (null)) libeina0 (0 (null)) libeina0:i386 (0 (null)) libeina1 (0 (null)) libeina1:i386 (0 (null)) libeio0 (0 (null)) libeio0:i386 (0 (null)) libembryo0 (0 (null)) libembryo0:i386 (0 (null)) libemotion1 (0 (null)) libemotion1:i386 (0 (null)) libevas0 (0 (null)) libevas0:i386 (0 (null)) libevas1 (0 (null)) libevas1:i386 (0 (null)) libefl:i386 (0 (null)) 
Provides: 
201604022131-32022~ubuntu14.04.1 - 
201603242131-31876~ubuntu14.04.1 - 
Reverse Provides: 

My knowledge of the apt package manager is pretty limited, and my searches for more info have not turned up anything useful for dealing with this issue.

I have also tried some of the common solutions for fixing unmet dependecies (such as apt-get clean and attempting to upgrade again). Any more insight into what the output of some of these commands mean is very much appreciated if a specific solution is not obvious.

Edit

Output of apt-cache policy libefl-bin libefl:

libefl-bin:
  Installed: 201604022131-32022~ubuntu14.04.1
  Candidate: 201604022131-32022~ubuntu14.04.1
  Version table:
 *** 201604022131-32022~ubuntu14.04.1 0
        500 http://ppa.launchpad.net/enlightenment-git/ppa/ubuntu/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status
libefl:
  Installed: 201603242131-31876~ubuntu14.04.1
  Candidate: 201604022131-32022~ubuntu14.04.1
  Version table:
     201604022131-32022~ubuntu14.04.1 0
        500 http://ppa.launchpad.net/enlightenment-git/ppa/ubuntu/ trusty/main amd64 Packages
 *** 201603242131-31876~ubuntu14.04.1 0
        100 /var/lib/dpkg/status

The output of sudo apt-get purge libefl:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 libefl-bin : Depends: libefl (= 201604022131-32022~ubuntu14.04.1) but it is not going to be installed
 libelementary : Depends: libefl but it is not going to be installed
 terminology : Depends: libefl but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

Package Interfaces – Coupling & Re-Usability


Intent

Packages should be designed to perform a single function well.

Ideally this means that they should be highly modular and different packages should be able to be ‘plugged-in’ simply by ensuring that they share a common interface.

However, I’m unsure how to do this without creating some kind of dependency between the packages or creating ugly ‘integration classes’ or a ‘common interfaces’ package.

An Example Concept

I don’t want to get too bogged down in domain-level symantics, so I’ll use the simple, though slightly contrived, example of an event logger.

Package A

Does XYZ and allows for a custom logging object to be provided.

To ensure that the logger is valid, Package A contains a PackageALog interface. When a logging object is provided to the classX constructor, it throws an exception if the logger object does not implement PackageALog.

Package B

Does ABC and allows for a custom logging object to be provided.

To ensure that the logger is valid, Package B contains a PackageBLog interface. When a logging object is provided to the classA constructor, it throws an exception if the logger object does not implement PackageBLog.

Package C

A unified logger that provides logging for Package A and Package B… et al.

Contains Log object that is built to provide a generic logger for all packages in the application.

Current Sub-optimal Ideas:

1. Implement neither of the interfaces in the class PackageCLog but extend the class for each interface variation (e.g. PackageCLoggersPackageA extends PackageCLog).

Problem: Requires more maintenance and means that PackageC will have to be modified for every new package that it interfaces with.

2. Implement the interfaces PackageALog and PackageBLog directly in the class PackageCLog.

Problem: If PackageC is re-used in another project, errors will be thrown if either PackageA or PackageB are not present.

3. Create a Common Interfaces package and have all packages implement/require those interfaces for their public interfaces.

Problem: Massively impractical, would only work for integrating packages that you created; no third party interaction.

Question

How can PackageCLog fulfill the requirements of both PackageAClassX and PackageBClassA?

In reality this question is usually more complex since the interfaces required by PackageA and PackageB are probably not the same. So is option 1 (defined above) the only way to solve this? i.e. the package that implements the interface has to write integration classes?

systemd: how to require and effect mounting a specific file system?


I would like to create a service file that, when started, causes a specified filesystem to be mounted before the action of the service file is performed (as it needs that file system to be available). Furthermore, I would like this service file to fail gracefully in case the file system cannot be mounted (e.g., because it is located on a sometimes unplugged external hard drive).

My first try was simple and partly successful: add x-systemd.automount as an option in the filesystem’s fstab line. Then the filesystem is automatically mounted when the service file causes its mountpoint to be accessed. However, it does not fail gracefully in the sense that there is a long timeout and it is logged as an ERROR.

My second try was not as successful, I added BindsTo=path-to-mountpoint.mount and After=path-to-mountpoint.mount to the service file (x-systemd.automount was removed): the path-to-mountpoint.mount is not found. I guess it only is created upon successful mount, so it is not meant for what I want to do.

How to use maven to generate 3rd party dependency license documentation


I am working on an open source project that will ship as a binary. I want to include an “About” page in the program that includes information about all 3rd party libraries and licenses used by my project.

This question discusses about best practices:

What is the best practice for arranging third-party library licenses “paperwork”?

Other questions discuss about how to update source files with license notice. Neither of these addresses my question.

I want to use the dependency information in Maven to generate the LICENSE-3RD-PARTY.txt described in the above linked question. Specifically, I want it to create a single text file that includes:

  • Library name
  • URL
  • LICENSE name
  • License URL
  • Full License Text

The above should be included in this file for all dependencies and transitive dependencies in the pom.xml. An HTML output or json/xml parsable version of this would be acceptable as well.

The command ‘mvn project-info-reports:dependencies’ produces something similar to what I’m asking for but it’s got way too data to actually include in a binary and show to an end user on an about page.

Good examples of what I’m trying to achieve are the chrome://credits/ page in Chrome or the ‘about:license’ page in Firefox. Though I’m more hoping for a text-only version the simple html of these examples would also work.

It seems like this would be a common requirement, but I’ve had no luck searching for how to achieve this with maven.

Can't perform apt-get because of dependencies


I’m trying to install some packages on my server (Debian8) and for some of they, I always have dependencies problems.

For example, I have executed this command:

apt-get install jetty9

And It answer that I’ve asked impossible things and say that the dependency libjetty9-extra-java is not satisfied . I can’t understand why.

Can someone tell me why I get such errors?

Here is the error :

Some packages could not be installed. This may mean that you have  
requested an impossible situation or if you are using the unstable                                                                                             
distribution that some required packages have not yet been created                                                                                             
or been moved out of Incoming.                                                                                                                                 
The following information may help to resolve the situation:                                                                                                   

The following packages have unmet dependencies:                                                                                                                
 jetty9 : Depends: libjetty9-extra-java (>= 9.2.14-1~bpo8+1) but it is not going to be installed                                                               
E: Unable to correct problems, you have held broken packages.

And this is my sources.list :

#de://debian.mirrors.ovh.neb httpt/debian/ jessie main                                                                                                         
#deb-src http://debian.mirrors.ovh.net/debian/ jessie main                                                                                                     

deb http://security.debian.org/ jessie/updates main                                                                                                            
deb-src http://security.debian.org/ jessie/updates main                                                                                                        

# jessie-updates, previously known as 'volatile'                                                                                                               
deb http://debian.mirrors.ovh.net/debian/ jessie-updates main                                                                                                  
deb-src http://debian.mirrors.ovh.net/debian/ jessie-updates main                                                                                              

# jessie-backports, previously on backports.debian.org                                                                                                         
deb http://debian.mirrors.ovh.net/debian/ jessie-backports main                                                                                                
deb-src http://debian.mirrors.ovh.net/debian/ jessie-backports main                                                                                            

deb http://debian.mirrors.ovh.net/debian/ jessie main contrib non-free                                                                                         
deb-src http://debian.mirrors.ovh.net/debian/ jessie main contrib non-free

Cannot install some packages using apt-get or aptitude


It seems all the problems started when I used katoolin (a setup script for installing kali pentesting tools on ubuntu). Since using it and installing a few packages from it, I have gotten these errors on every package I have tried to install:

The following packages have unmet dependencies:
wine : Depends: wine1.6 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

The following packages have unmet dependencies:
software-properties-common : Depends: python3-software-properties (=0.92.37.7) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Some things I have tried:

  • Delete my sources.list and all PPA’s (no effect)
  • apt-get -f install returns: 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
  • apt-get update && apt-get upgrade && sudo apt-get autoremove which give a similar result to the one above.
  • dpkg --get-selections | grep hold shows nothing
  • and finally, trying to install with aptitude or aptitude -f seems to work, but then says, 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

What can I do besides reinstalling? I have spent a lot of time building some particularly complex packages from source, and would not like to lose that time and effort.

EDIT: I ended up reinstalling, and can’t give any more info on the issue, and I’m certainly not about to reproduce the problem.

How to bootstrap a new dependency configuration on a cluster?


I have access to a cluster running a CentOS 6, which have not been updated. For that reason, the glibc, ld-linux and other dependencies that, I think, are kernel-based are all out-of-date.

I have no root access (and that wouldn’t help much I think, as the configurations I would have made made would have to be spread to all cluster nodes).

Is there a way for me to bootstrap a new libc and build my dependencies upon it? I have tried Gentoo Prefix, but it have failed on stage3, and would like to try GoboLinux Rootless but I can’t download it from their website (http://gobolinux.org/?page=rootless) because it have now a password on their SVN (which may indicate that this is not a good solution anymore).

Is there a way to solve this, without having to rely on the cluster admins to update the system? What do people do when they get access to a HPC server without root privileges and want to build their dependencies?

If it’s of any help, the cluster is based on PBS Pro.

cmake: Failing to satisfy build dependencies while cross-compiling


I have been trying to cross compile OpenCV 3.0 with CUDA support on a NVidia Jetson TK1 (which supports CUDA) using Yocto Project. According to the OpenCV docs:

To enable CUDA support, configure OpenCV using CMake with WITH_CUDA=ON
. When the flag is set and if CUDA is installed, the full-featured
OpenCV CUDA module is built. Otherwise, the module is still built but
at runtime all functions from the module throw Exception …

So CUDA is a build time dependency for OpenCV. CUDA libraries are provided by Nvidia in binary form via .deb files. So what I did was to make recipes(found here) that installs the binaries from the .deb files. I wrote them in such a way that all other binaries are dependencies (DEPENDS) of cuda-toolkit-6-5 so that when I install cuda-toolkit-6-5, every library associated with CUDA gets installed.

I then made cuda-toolkit-6-5 a build dependency (DEPENDS) of OpenCV, and added the -WITH_CUDA=ON cmake flag. CMake finds the binary nvcc, and tries to execute it, but fails because it is of a different architecture. Here are the logs:

run/media/fury/storage/yocto/poky/build/tmp/sysroots/jetson-tk1-l4t/usr/local/cuda/bin/nvcc: /run/media/fury/storage/yocto/poky/build/tmp/sysroots/jetson-tk1-l4t/usr/local/cuda/bin/nvcc: cannot execute binary file
CMake Error at cmake/FindCUDA.cmake:604 (string):
  string sub-command REGEX, mode REPLACE needs at least 6 arguments total to
  command.
Call Stack (most recent call first):
  cmake/OpenCVUtils.cmake:24 (find_package)
  cmake/OpenCVDetectCUDA.cmake:16 (find_host_package)
  cmake/OpenCVFindLibsPerf.cmake:32 (include)
  CMakeLists.txt:526 (include)


CMake Error at cmake/FindCUDA.cmake:605 (string):
  string sub-command REGEX, mode REPLACE needs at least 6 arguments total to
  command.
Call Stack (most recent call first):
  cmake/OpenCVUtils.cmake:24 (find_package)
  cmake/OpenCVDetectCUDA.cmake:16 (find_host_package)
  cmake/OpenCVFindLibsPerf.cmake:32 (include)
  CMakeLists.txt:526 (include)

What I did was to override this in FindCUDA.cmake and hardcode the version. But still cmake does not configure openCV to compile with CUDA. I believe all other binaries and libraries also are in the right location. How do I find why cmake is not finding OpenCV correctly?

Here is the recipe that I used for OpenCV which is a modification of the one from meta-oe.

Here is the toolchain file that I used with cmake.

Dependency ordering algorithm of a compiler


Let’s say, hypothetically, I’m writing a Java compiler. And we assume that in my case a class can’t be fully compiled until all signatures of dependencies (imports and other used classes) are known. Because I don’t want to keep the source code and AST of all classes in memory at the same time, I’ll need an algorithm to manage those dependencies and process them all in the right order.

What would be a good algorithm for ordering all dependencies?
That:

  • is not recursive
  • does not keep all source code and/or ast nodes in memory
  • is linear in both space and time
  • can handle cyclical dependencies

Or maybe more general, how is this normally done?

My approach looks like the following:

abstract class Compiler {

    TypeSystem ts;


    Type compile(String className) {

        if (ts.containsType(className)) {
            return ts.getType(className);
        }

        // Create skeleton type for this class:
        Type type = ts.createType(className);

        // Parse the class file:
        Node ast = parse(className);

        // Create signature:
        for (Node attribute : ast.findAll("AttributeDeclaration")) {

            // Get the text value of the name of the attribute:
            String attributeName = attribute.find("Identifier").text();

            // Get the text value of the type of the attribute:
            String attributeTypeName = attribute.find("Type").text();

            // Call compile recursive!
            Type attributeType = compile(attributeTypeName);

            type.createAttribute(attributeName, attributeType);
        }

        return type;
    }

    abstract Node parse(String className); // This method can find the file by class name.
}                

For sake of simplicity, does this code only process attributes and simple structs.
Note that this algorithm is recursive!

Question and Answer is proudly powered by WordPress.
Theme "The Fundamentals of Graphic Design" by Arjuna
Icons by FamFamFam