You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

StructureUtilities.java 3.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /* *******************************************************************
  2. * Copyright (c) 1999-2001 Xerox Corporation,
  3. * 2002 Palo Alto Research Center, Incorporated (PARC).
  4. * All rights reserved.
  5. * This program and the accompanying materials are made available
  6. * under the terms of the Eclipse Public License v1.0
  7. * which accompanies this distribution and is available at
  8. * http://www.eclipse.org/legal/epl-v10.html
  9. *
  10. * Contributors:
  11. * Xerox/PARC initial implementation
  12. * ******************************************************************/
  13. package org.aspectj.ajde.internal;
  14. //import org.aspectj.ajde.compiler.AjdeCompiler;
  15. //import org.aspectj.compiler.structure.*;
  16. //import org.aspectj.compiler.structure.associations.*;
  17. /**
  18. * Utility class for building a structure model for a given compile. Typical command-line usage: <BR>
  19. * &nbsp;&nbsp;&gt; {@code java org.aspectj.tools.ajde.StructureManager @&lt;config-file&gt;.lst}
  20. */
  21. public class StructureUtilities {
  22. // private static StructureManager structureManager = new StructureManager();
  23. /**
  24. * Usage is the same as <CODE>org.aspectj.tools.ajc.Main</CODE>.
  25. */
  26. // public static void main(String[] args) throws IOException {
  27. // StructureNode model = buildStructureModel(args);
  28. // if (model == null) {
  29. // } else {
  30. // dumpStructure(model, "");
  31. // }
  32. // }
  33. /**
  34. * Compiles and builds a structure model.
  35. *
  36. * @return the node representing the root for the structure model
  37. */
  38. // public static StructureNode buildStructureModel(String[] args) {
  39. // new StructureBuilder().buildStructure(args);
  40. // return structureManager.getStructureModel();
  41. // }
  42. /**
  43. * Dumps the structure model by walking the
  44. * corresponding tree.
  45. * * @param node node to start traversal at, typically the root
  46. * @param indent whitespace accumulator for pretty-printing
  47. */
  48. // public static void dumpStructure(StructureNode node, String indent) {
  49. // if (node == null) return;
  50. // Syste.println(indent + node);
  51. // if (node.getChildren() != null) {
  52. // for (Iterator it = node.getChildren().iterator(); it.hasNext(); ) {
  53. // dumpStructure((StructureNode)it.next(), indent + " ");
  54. // }
  55. // }
  56. // if (node instanceof ProgramElementNode) {
  57. // if (((ProgramElementNode)node).getRelations() != null) {
  58. // for (Iterator it = ((ProgramElementNode)node).getRelations().iterator(); it.hasNext(); ) {
  59. // dumpStructure((StructureNode)it.next(), indent + " ");
  60. // }
  61. // }
  62. // }
  63. // }
  64. //
  65. // private static class StructureBuilder extends org.aspectj.tools.ajc.Main {
  66. // public void buildStructure(String[] args) {
  67. // compile(args);
  68. // }
  69. //
  70. // public JavaCompiler getCompiler() {
  71. // if (compiler != null) return compiler;
  72. // if (compiler == null) {
  73. // if (errorHandler == null) {
  74. // compiler = new AjdeCompiler(structureManager);
  75. // }
  76. // }
  77. // return compiler;
  78. // }
  79. // }
  80. }