Logo Search packages:      
Sourcecode: aspectj version File versions  Download package

void org::aspectj::ajdt::internal::core::builder::EmacsStructureModelManager::SExpressionPrinter::printDecl ( IProgramElement  node,
boolean  recurse 
) [inline, private]

Parameters:
structureNode can be a ProgramElementNode or a LinkNode

Definition at line 133 of file EmacsStructureModelManager.java.

References org::aspectj::asm::IProgramElement::getChildren(), org::aspectj::bridge::ISourceLocation::getColumn(), org::aspectj::asm::IProgramElement::getDeclaringType(), org::aspectj::asm::IProgramElement::getKind(), org::aspectj::bridge::ISourceLocation::getLine(), org::aspectj::asm::IProgramElement::getName(), org::aspectj::bridge::ISourceLocation::getSourceFile(), org::aspectj::asm::IProgramElement::getSourceLocation(), and org::aspectj::asm::IProgramElement::toString().

                                                                          {
                  if (node == null || node.getSourceLocation() == null)
                        return;
                  String kind = node.getKind().toString().toLowerCase();
                  print("(");
                  print("(" + node.getSourceLocation().getLine() + " . " + node.getSourceLocation().getColumn() + ") ");
                  print("(" + node.getSourceLocation().getLine() + " . " + node.getSourceLocation().getColumn() + ") ");
                  print(kind + " "); // 2

                  // HACK:
                  String displayName = node.toString().replace('\"', ' ');

                  print("\"" + displayName + "\" ");
                  if (node.getSourceLocation().getSourceFile().getAbsolutePath() != null) {
                        print("\"" + fixFilename(node.getSourceLocation().getSourceFile().getAbsolutePath()) + "\""); // 4
                  } else {
                        print("nil");
                  }
                  if (node.getName() != null) {
                        print("\"" + node.getDeclaringType() + "\" "); // 5
                  } else {
                        print("nil");
                  }

                  if (!recurse) {
                        print("nil");
                        print("nil");
                        print("nil");
                  } else {
                        print("(");
                        // if (node instanceof IProgramElement) {
                        // java.util.List relations = ((IProgramElement)node).getRelations();
                        // if (relations != null) {
                        // for (Iterator it = relations.iterator(); it.hasNext(); ) {
                        // IRelationship relNode = (IRelationship)it.next();
                        // if (relNode.getKind() == IRelationship.Kind.ADVICE ||
                        // relNode.getKind() == IRelationship.Kind.DECLARE) {
                        // printDecls(relNode); // 6
                        // }
                        // }
                        // }
                        // }
                        print(") ");
                        print("(");
                        print(") ");
                        print("(");
                        Iterator it3 = node.getChildren().iterator();
                        if (it3.hasNext()) {
                              while (it3.hasNext()) {
                                    // this ignores relations on the compile unit
                                    Object nodeObject = it3.next();
                                    if (nodeObject instanceof IProgramElement) {
                                          IProgramElement currNode = (IProgramElement) nodeObject;
                                          if (// !currNode.isStmntKind() &&
                                          !currNode.getKind().equals("<undefined>")) {
                                                printDecl(currNode, true);
                                          }
                                    }
                              }
                        }
                        print(") ");
                  }

                  print(node.getKind().equals("class") ? "t " : "nil "); // 9
                  // print(node.getKind().equals("introduction") ? "t " : "nil "); // 10
                  print(node.getKind().equals("introduction") ? "nil " : "nil "); // 10
                  print("nil "); // 11
                  print("nil "); // 12
                  print(")");
            }


Generated by  Doxygen 1.6.0   Back to index