Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
LabComm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tommy Olofsson
LabComm
Commits
92f98cf6
Commit
92f98cf6
authored
11 years ago
by
Sven Gestegård Robertz
Browse files
Options
Downloads
Patches
Plain Diff
added listing of indirect dependencies and cleaned up a bit
parent
3978f22a
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
compiler/Java_CodeGen.jrag
+30
-14
30 additions, 14 deletions
compiler/Java_CodeGen.jrag
with
30 additions
and
14 deletions
compiler/Java_CodeGen.jrag
+
30
−
14
View file @
92f98cf6
...
@@ -347,21 +347,34 @@ aspect Java_Class {
...
@@ -347,21 +347,34 @@ aspect Java_Class {
" not declared");
" not declared");
}
}
public void
Type
Decl.Java_emit
Class
(Java_env env
, String pack
) {
public void Decl.Java_emit
DeclPP
(Java_env env) {
// Hackish prettyprint preamble
// Hackish prettyprint preamble
env.println("/* ");
env.println("/* ");
pp(env.getPrintStream());
pp(env.getPrintStream());
// temporary experiment with listing user type dependencies
// This should generate actual register(...) code
if( !references().isEmpty() ) {
if( !references().isEmpty() ) {
Iterator<Decl> it = references().iterator();
Iterator<Decl> it = references().iterator();
while(it.hasNext()) {
while(it.hasNext()) {
Decl t = it.next();
Decl t = it.next();
env.println(" //Depends on "+t.getName() + " (" + t +") " );
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 {
} else {
env.println(" //no
more dep
s ");
env.println(" //no
user type dependencie
s ");
}
}
env.println("*/");
env.println("*/");
}
public void TypeDecl.Java_emitClass(Java_env env, String pack) {
Java_emitDeclPP(env);
if (pack != null && pack.length() > 0) {
if (pack != null && pack.length() > 0) {
env.println("package " + pack + ";");
env.println("package " + pack + ";");
}
}
...
@@ -390,9 +403,7 @@ aspect Java_Class {
...
@@ -390,9 +403,7 @@ aspect Java_Class {
public void SampleDecl.Java_emitClass(Java_env env, String pack) {
public void SampleDecl.Java_emitClass(Java_env env, String pack) {
env.println("/* ");
Java_emitDeclPP(env);
pp(env.getPrintStream());
env.println("*/");
if (pack != null && pack.length() > 0) {
if (pack != null && pack.length() > 0) {
env.println("package " + pack + ";");
env.println("package " + pack + ";");
...
@@ -440,7 +451,12 @@ aspect Java_Class {
...
@@ -440,7 +451,12 @@ aspect Java_Class {
Iterator<Decl> it = references().iterator();
Iterator<Decl> it = references().iterator();
while(it.hasNext()) {
while(it.hasNext()) {
Decl t = it.next();
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 {
} else {
env.println(" //no more deps ");
env.println(" //no more deps ");
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment