Commit 92f98cf6 authored by Sven Gestegård Robertz's avatar Sven Gestegård Robertz
Browse files

added listing of indirect dependencies and cleaned up a bit

parent 3978f22a
......@@ -347,21 +347,34 @@ aspect Java_Class {
" not declared");
}
public void TypeDecl.Java_emitClass(Java_env env, String pack) {
public void Decl.Java_emitDeclPP(Java_env env) {
// Hackish prettyprint preamble
env.println("/* ");
pp(env.getPrintStream());
if( !references().isEmpty() ) {
Iterator<Decl> it = references().iterator();
while(it.hasNext()) {
Decl t = it.next();
env.println(" //Depends on "+t.getName() + " (" + t +") " );
}
} else {
env.println(" //no more deps ");
}
// temporary experiment with listing user type dependencies
// This should generate actual register(...) code
if( !references().isEmpty() ) {
Iterator<Decl> it = references().iterator();
while(it.hasNext()) {
Decl t = it.next();
env.println(" //Depends (directly) on "+t.getName() + " (" + t +") " );
//TODO: traverse AST to find indirect dependencies
Iterator<Decl> iit = t.references().iterator();
while(iit.hasNext()) {
Decl tt = iit.next();
env.println(" //Depends (indirectly) on "+tt.getName() + " (" + tt +") " );
}
}
} else {
env.println(" //no user type dependencies ");
}
env.println("*/");
}
public void TypeDecl.Java_emitClass(Java_env env, String pack) {
Java_emitDeclPP(env);
if (pack != null && pack.length() > 0) {
env.println("package " + pack + ";");
}
......@@ -390,9 +403,7 @@ aspect Java_Class {
public void SampleDecl.Java_emitClass(Java_env env, String pack) {
env.println("/* ");
pp(env.getPrintStream());
env.println("*/");
Java_emitDeclPP(env);
if (pack != null && pack.length() > 0) {
env.println("package " + pack + ";");
......@@ -440,7 +451,12 @@ aspect Java_Class {
Iterator<Decl> it = references().iterator();
while(it.hasNext()) {
Decl t = it.next();
env.println(" //Depends on "+t.getName() + " (" + t +") " );
env.println(" //Depends (directly) on "+t.getName() + " (" + t +") " );
Iterator<Decl> iit = t.references().iterator();
while(iit.hasNext()) {
Decl tt = iit.next();
env.println(" //Depends (indirectly) on "+tt.getName() + " (" + tt +") " );
}
}
} else {
env.println(" //no more deps ");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment