KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > aspectj > ajde > internal > StructureUtilities


1
2 /* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
3  *
4  * This file is part of the IDE support for the AspectJ(tm)
5  * programming language; see http://aspectj.org
6  *
7  * The contents of this file are subject to the Mozilla Public License
8  * Version 1.1 (the "License"); you may not use this file except in
9  * compliance with the License. You may obtain a copy of the License at
10  * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/.
11  *
12  * Software distributed under the License is distributed on an "AS IS" basis,
13  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
14  * for the specific language governing rights and limitations under the
15  * License.
16  *
17  * The Original Code is AspectJ.
18  *
19  * The Initial Developer of the Original Code is Xerox Corporation. Portions
20  * created by Xerox Corporation are Copyright (C) 1999-2002 Xerox Corporation.
21  * All Rights Reserved.
22  *
23  * Contributor(s):
24  */

25  
26 package org.aspectj.ajde.internal;
27
28 import java.util.*;
29 import java.io.*;
30 import org.aspectj.compiler.base.*;
31 import org.aspectj.compiler.crosscuts.*;
32 //import org.aspectj.ajde.compiler.AjdeCompiler;
33
//import org.aspectj.compiler.structure.*;
34
//import org.aspectj.compiler.structure.associations.*;
35

36 /**
37  * Utility class for building a structure model for a given compile. Typical command-line usage: <BR>
38  * &nbsp;&nbsp;&gt; <TT>java org.aspectj.tools.ajde.StructureManager @&lt;config-file&gt;.lst</TT>
39  */

40 public class StructureUtilities {
41
42 // private static StructureManager structureManager = new StructureManager();
43

44     /**
45      * Usage is the same as <CODE>org.aspectj.tools.ajc.Main</CODE>.
46      */

47 // public static void main(String[] args) throws IOException {
48
// StructureNode model = buildStructureModel(args);
49
// if (model == null) {
50

51 // } else {
52
// dumpStructure(model, "");
53
// }
54
// }
55

56     /**
57      * Compiles and builds a structure model.
58      *
59      * @return the node representing the root for the structure model
60      */

61 // public static StructureNode buildStructureModel(String[] args) {
62
// new StructureBuilder().buildStructure(args);
63
// return structureManager.getStructureModel();
64
// }
65

66     /**
67      * Dumps the structure model by walking the
68      * corresponding tree.
69      * * @param node node to start traversal at, typically the root
70      * @param indent whitespace accumulator for pretty-printing
71      */

72 // public static void dumpStructure(StructureNode node, String indent) {
73
// if (node == null) return;
74
// Syste.println(indent + node);
75
// if (node.getChildren() != null) {
76
// for (Iterator it = node.getChildren().iterator(); it.hasNext(); ) {
77
// dumpStructure((StructureNode)it.next(), indent + " ");
78
// }
79
// }
80
// if (node instanceof ProgramElementNode) {
81
// if (((ProgramElementNode)node).getRelations() != null) {
82
// for (Iterator it = ((ProgramElementNode)node).getRelations().iterator(); it.hasNext(); ) {
83
// dumpStructure((StructureNode)it.next(), indent + " ");
84
// }
85
// }
86
// }
87
// }
88
//
89
// private static class StructureBuilder extends org.aspectj.tools.ajc.Main {
90
// public void buildStructure(String[] args) {
91
// compile(args);
92
// }
93
//
94
// public JavaCompiler getCompiler() {
95
// if (compiler != null) return compiler;
96
// if (compiler == null) {
97
// if (errorHandler == null) {
98
// compiler = new AjdeCompiler(structureManager);
99
// }
100
// }
101
// return compiler;
102
// }
103
// }
104
}
105
Popular Tags