Prints interface-like node, prints id, typeParameters, extends, and body.
338646
function _interfaceish(node, print) {
  print.plain(node.id);
  print.plain(node.typeParameters);
  if (node["extends"].length) {
    this.push(" extends ");
    print.join(node["extends"], { separator: ", " });
  }
  if (node.mixins && node.mixins.length) {
    this.push(" mixins ");
    print.join(node.mixins, { separator: ", " });
  }
  this.space();
  print.plain(node.body);
}
1296461
function showInterfaceIdlMethod(method, html) {
    var line = "\n   "

    var allParameters = method.parameters.concat(method.callbackParameters)

    line += getIdlType(method.returns)
    line += " <span class='methodName'>" + method.name + "</span> (" + getIdlParameterList(allParameters) + ");"
    html.push(line)
}
754144
def template_engine(self, entry, startnode):
        

        # self.println("-----")
        # print("XXX", startnode)

        fmt = entry[0]
        arg = 1
        i = 0

        m = escape.search(fmt)
        while m:
            i = m.end()
            self.write(m.group('prefix'))

            typ = m.group('kind') or '{'
            node = startnode
            try:
                if m.group('child'):
                    node = node[int(m.group('child'))]
            except:
                print(node.__dict__)
                raise

            if   typ == '%':	self.write('%')
            elif typ == '+':	self.indentMore()
            elif typ == '-':	self.indentLess()
            elif typ == '|':	self.write(self.indent)
            elif typ == 'c':
                index = entry[arg]
                if isinstance(index, tuple):
                    assert node[index[0]] == index[1], (
                        "at %s[%d], %s vs %s" % (
                            node.kind, arg, node[index[0]].kind, index[1])
                        )
                    index = index[0]
                if isinstance(index, int):
                    self.preorder(node[index])
                arg += 1
            elif typ == 'p':
                p = self.prec
                length = len(entry)
                if length == 3:
                    (index, self.prec, name) = entry[arg]
                    assert node[index] == name, (
                        "at %s[%d], %s vs %s" % (
                            node.kind, arg, node[index[0]].kind, index[1])
                        )
                elif length == 2:
                    (index, self.prec) = entry[arg]
                else:
                    raise RuntimeError("Invalid %%p tuple length %d; length should be 1 or 2"
                                       % length)

                self.preorder(node[index])
                self.prec = p
                arg += 1
            elif typ == 'C':
                low, high, sep = entry[arg]
                remaining = len(node[low:high])
                for subnode in node[low:high]:
                    self.preorder(subnode)
                    remaining -= 1
                    if remaining > 0:
                        self.write(sep)
                arg += 1
            elif typ == 'D':
                low, high, sep = entry[arg]
                remaining = len(node[low:high])
                for subnode in node[low:high]:
                    remaining -= 1
                    if len(subnode) > 0:
                        self.preorder(subnode)
                        if remaining > 0:
                            self.write(sep)
                            pass
                        pass
                    pass
                arg += 1
            elif typ == 'x':
                # This code is only used in fragments
                assert isinstance(entry[arg], tuple)
                arg += 1
            elif typ == 'P':
                p = self.prec
                low, high, sep, self.prec = entry[arg]
                remaining = len(node[low:high])
                # remaining = len(node[low:high])
                for subnode in node[low:high]:
                    self.preorder(subnode)
                    remaining -= 1
                    if remaining > 0:
                        self.write(sep)
                self.prec = p
                arg += 1
            elif typ == '{':
                d = node.__dict__
                expr = m.group('expr')
                try:
                    self.write(eval(expr, d, d))
                except:
                    print(node)
                    raise
            m = escape.search(fmt, i)
        self.write(fmt[i:])
1336022
public static <T extends GraphNode<T>> String printTree(T node, Formatter<T> formatter) {
        checkArgNotNull(formatter, "formatter");
        return printTree(node, formatter, Predicates.<T>alwaysTrue(), Predicates.<T>alwaysTrue());
    }
1017864
private void printChildDeclaration(NodeDefinitionData nodeDefinition, OutputStreamWriter out) throws IOException,
      RepositoryException
   {
      out.write("\r\n  ");
      out.write("+ " + qNameToString(nodeDefinition.getName()) + " ");

      InternalQName[] requiredTypes = nodeDefinition.getRequiredPrimaryTypes();
      if (requiredTypes != null && requiredTypes.length > 0)
      {
         /** if there is only 1 element and it is NT_BASE then avoid printing it */
         if (requiredTypes.length > 1 || !requiredTypes[0].equals(Constants.NT_BASE))
         {
            out.write("(" + qNameToString(requiredTypes[0]));
            for (int i = 1; i < requiredTypes.length; i++)
            {
               out.write(", " + qNameToString(requiredTypes[i]));
            }
            out.write(")");
         }
      }

      if (nodeDefinition.getDefaultPrimaryType() != null)
      {
         out.write("\r\n    = " + qNameToString(nodeDefinition.getDefaultPrimaryType()));
      }

      StringBuilder attributes = new StringBuilder();

      if (nodeDefinition.isAutoCreated())
      {
         attributes.append("autocreated ");
      }
      if (nodeDefinition.isMandatory())
      {
         attributes.append("mandatory ");
      }
      if (nodeDefinition.isProtected())
      {
         attributes.append("protected ");
      }
      if (nodeDefinition.isAllowsSameNameSiblings())
      {
         attributes.append("sns ");
      }

      if (nodeDefinition.getOnParentVersion() != OnParentVersionAction.COPY)
      {
         attributes.append("\r\n    " + OnParentVersionAction.nameFromValue(nodeDefinition.getOnParentVersion()) + " ");
      }

      if (attributes.length() > 0)
      {
         out.write("\r\n    ");
         out.write(attributes.toString());
      }

   }
180379
def print_tree(current_node, childattr='children', nameattr='name', indent='', last='updown'):

    if hasattr(current_node, nameattr):
        name = lambda node: getattr(node, nameattr)
    else:
        name = lambda node: str(node)

    children = lambda node: getattr(node, childattr)
    nb_children = lambda node: sum(nb_children(child) for child in children(node)) + 1
    size_branch = {child: nb_children(child) for child in children(current_node)}

    
    up = sorted(children(current_node), key=lambda node: nb_children(node))
    down = []
    while up and sum(size_branch[node] for node in down) < sum(size_branch[node] for node in up):
        down.append(up.pop())

    """ Printing of "up" branch. """
    for child in up:     
        next_last = 'up' if up.index(child) is 0 else ''
        next_indent = '{0}{1}{2}'.format(indent, ' ' if 'up' in last else '│', ' ' * len(name(current_node)))
        print_tree(child, childattr, nameattr, next_indent, next_last)

    """ Printing of current node. """
    if last == 'up': start_shape = '┌'
    elif last == 'down': start_shape = '└'
    elif last == 'updown': start_shape = ' '
    else: start_shape = '├'

    if up: end_shape = '┤'
    elif down: end_shape = '┐'
    else: end_shape = ''

    print('{0}{1}{2}{3}'.format(indent, start_shape, name(current_node), end_shape))

    """ Printing of "down" branch. """
    for child in down:
        next_last = 'down' if down.index(child) is len(down) - 1 else ''
        next_indent = '{0}{1}{2}'.format(indent, ' ' if 'down' in last else '│', ' ' * len(name(current_node)))
        print_tree(child, childattr, nameattr, next_indent, next_last)
559775
def printSkosTree(self, element = None, showids=False, labels=False, showtype=False):
        
        TYPE_MARGIN = 13 # length for skos:concept

        if not element:	 # first time
            for x in self.toplayerSkosConcepts:
                printGenericTree(x, 0, showids, labels, showtype, TYPE_MARGIN)

        else:
            printGenericTree(element, 0, showids, labels, showtype, TYPE_MARGIN)
231854
private final void renderXMLRecurs(
        PrintWriter out,
        Node node,
        String aloneTags[]
    ) {
        if (node.getNodeType() == Node.DOCUMENT_TYPE_NODE) {
            DocumentType dc = (DocumentType) node;

            if ((dc.getPublicId() != null) && (dc.getSystemId() != null)) {
                out.println(
                    "<!DOCTYPE " + dc.getName() + " PUBLIC \""
                    + dc.getPublicId() + "\" \"" + dc.getSystemId() + "\">"
                );
            } else {
                String entityDecl = "";
                NamedNodeMap nnm = dc.getEntities();

                for (int i = (nnm.getLength() - 1); i >= 0; i--) {
                    if (i == (nnm.getLength() - 1))
                        out.print(" ");

                    Entity ent = (Entity) nnm.item(i);

                    if (ent.getNotationName() != null) {
                        entityDecl =
                            "<!ENTITY " + ent.getNodeName() + " '"
                            + ent.getNotationName() + "'>\n";
                    }
                }

                if (entityDecl.length() > 0)
                    out.println(
                        "<!DOCTYPE " + dc.getName() + " [\n" + entityDecl
                        + "]>"
                    );
            }
        } else if (node.getNodeType() == Node.ELEMENT_NODE) {
            out.print("<");
            out.print(node.getNodeName());

            NamedNodeMap nnm = ((Element) node).getAttributes();

            for (int i = (nnm.getLength() - 1); i >= 0; i--) {
                if (i == (nnm.getLength() - 1))
                    out.print(" ");

                Attr attr = (Attr) nnm.item(i);
                out.print(attr.getName());
                out.print("=\"");
                out.print(escapeAttribute(attr.getValue()));

                if (i > 0)
                    out.print("\" ");
                else
                    out.print("\"");
            }

            if (isAlone(
                        node.getNodeName(),
                        aloneTags
                    )) {
                out.print("/>");

                return;
            }

            out.print(">");
        } else if (node.getNodeType() == Node.TEXT_NODE) {
            try {
                out.print(escape(node.getNodeValue()));
            } catch (Exception ignore) {
            }
        }

        boolean booCDATAopen = false;
        boolean booCOMMENTopen = false;
        NodeList nl = node.getChildNodes();

        for (int i = 0; i < nl.getLength(); i++) {
            Node child = nl.item(i);

            if (child.getNodeType() == Node.CDATA_SECTION_NODE) {
                if (!booCDATAopen) {
                    booCDATAopen = true;
                    out.print("<![CDATA[");
                }

                out.print(
                    (child.getNodeValue() == null)
                    ? ""
                    : child.getNodeValue().trim()
                );

                continue;
            }

            if (child.getNodeType() == Node.COMMENT_NODE) {
                if (!booCOMMENTopen) {
                    booCOMMENTopen = true;

                    if (node.getNodeName()
                                .equals("script"))
                        out.print("//<!--");
                    else
                        out.print("<!--");
                }

                out.print(
                    (child.getNodeValue() == null)
                    ? ""
                    : child.getNodeValue()
                );

                continue;
            }

            if (booCDATAopen) {
                booCDATAopen = false;
                out.print("]]>");
            }

            if (booCOMMENTopen) {
                booCOMMENTopen = false;

                if (node.getNodeName()
                            .equals("script"))
                    out.print("//-->");
                else
                    out.print("-->");
            }

            renderXMLRecurs(
                out,
                child,
                aloneTags
            );
        }

        if (booCDATAopen) {
            out.print("]]>");
        }

        if (booCOMMENTopen) {
            if (node.getNodeName()
                        .equals("script"))
                out.print("//-->\n");
            else
                out.print("-->\n");
        }

        if (node.getNodeType() == Node.ELEMENT_NODE) {
            out.print("</");
            out.print(node.getNodeName());
            out.print(">");
        }
    }
975626
private void getInterfaceInfo(NetworkInterface networkInterface, PrintWriter out) throws IOException {
        final String indent = "    ";

        // Basic information from the interface
        out.println();
        out.append("Interface: ").append(networkInterface.getDisplayName()).println();
        out.append(indent).append("          loopback: ").append(Boolean.toString(networkInterface.isLoopback())).println();
        out.append(indent).append("               mtu: ").append(Integer.toString(networkInterface.getMTU())).println();
        out.append(indent).append("    point-to-point: ").append(Boolean.toString(networkInterface.isPointToPoint())).println();
        out.append(indent).append("supports multicast: ").append(Boolean.toString(networkInterface.supportsMulticast())).println();
        out.append(indent).append("                up: ").append(Boolean.toString(networkInterface.isUp())).println();
        out.append(indent).append("           virtual: ").append(Boolean.toString(networkInterface.isVirtual())).println();

        // Interface address information
        List<InterfaceAddress> intfAddresses = networkInterface.getInterfaceAddresses();
        for (int i = 0; i < intfAddresses.size(); i++) {
            out.append(indent).append("InterfaceAddress #").append(Integer.toString(i + 1)).append(": ").append(String.valueOf(intfAddresses.get(i))).println();
        }

        // Network interface information
        Enumeration<InetAddress> inetAddresses = networkInterface.getInetAddresses();
        for (int i = 1; inetAddresses.hasMoreElements(); i++) {
            InetAddress inetAddress = inetAddresses.nextElement();
            out.append(indent).append("InetAddress #").append(Integer.toString(i)).println(":");
            out.append(indent).append(indent).append("    IP address: ").append(inetAddress.getHostAddress()).println();
            out.append(indent).append(indent).append("     host name: ").append(inetAddress.getHostName()).println();
            out.append(indent).append(indent).append("FQDN host name: ").append(inetAddress.getCanonicalHostName()).println();
        }
    }
307563
@Override public void visitTypeApply(JCTypeApply tree) {
		print(tree.clazz);
		print("<");
		print(tree.arguments, ", ");
		print(">");
	}
1356460
function ClassProperty(node, print) {
  print.list(node.decorators, { separator: "" });

  if (node["static"]) this.push("static ");
  print.plain(node.key);
  print.plain(node.typeAnnotation);
  if (node.value) {
    this.space();
    this.push("=");
    this.space();
    print.plain(node.value);
  }
  this.semicolon();
}
1192128
StringBuilder printLine(StringBuilder sb ) {
      if( _pid== NO_PARENT) return sb.append("[root]");
      DecidedNode parent = _tree.decided(_pid);
      parent.printLine(sb).append(" to ");
      return parent.printChild(sb,_nid);
    }
522109
function printResultFor(node, op) {
        return function printResult(err, res) {
            if (err) node.error(op + ' error: ' + err.toString());
            if (res) node.log(op + ' status: ' + res.constructor.name);
        };
    }
433625
public static String print(Node<PluralType> node) {
    StringBuilder buf = new StringBuilder();
    print(buf, node);
    return buf.toString();
  }
784189
public void printMethodsDetails(ClassDoc classDoc) {
        MethodDoc[] methodDocs = TestAPIDoclet.getTestAPIComponentMethods(classDoc);
        if (methodDocs.length > 0) {
            mOut.println("&nbsp;<P>");
            mOut.println("<TABLE BORDER=\"1\" WIDTH=\"100%\" CELLPADDING=\"3\" CELLSPACING=\"0\" SUMMARY=\"\">");
            mOut.println("<TR BGCOLOR=\"#CCCCFF\"><TH ALIGN=\"left\" COLSPAN=\"2\"><FONT SIZE=\"+2\"><B>Methods "
                  + "Detail</B></FONT></TH></TR>");
            mOut.println("</TABLE>");
            for (int m = 0; m < methodDocs.length; m++) {
                MethodDoc methodDoc = methodDocs[m];
                String methodName = methodDoc.name();

                // get return type
                String returnTypeString = getTypeString(methodDoc.returnType());
                int returnTypeLength = returnTypeString.replaceAll("<.*?>", "").replace("&lt;", "<").replace("&gt;", ">")
                      .length(); // length without HTML tags and &gt;/&lt; entities

                Parameter[] parameters = methodDoc.parameters();
                String[] parameterSignatures = new String[parameters.length];
                for (int i = 0; i < parameterSignatures.length; i++) {
                    Parameter parameter = parameters[i];
                    parameterSignatures[i] = getTypeString(parameter.type()) + " " + parameter.name();
                }
                String parameterSeparator = ",\n";
                for (int i = 0; i < returnTypeLength + methodName.length() + 2; i++) {
                    parameterSeparator += " ";
                }

                // begin output
                mOut.println("<A NAME=\"" + methodName + "\"><A NAME=\"" + methodName + methodDoc.flatSignature() + "\"> <H3>"
                      + methodName + "</H3></A></A>");
                mOut.print("<PRE>" + returnTypeString + " <B>" + methodName + "</B>(" + Strings
                      .join(parameterSignatures, parameterSeparator) + ")");

                Type[] exceptions = methodDoc.thrownExceptionTypes();
                if (exceptions.length > 0) {
                    String[] exceptionNames = new String[exceptions.length];
                    for (int i = 0; i < exceptions.length; i++) {
                        exceptionNames[i] = getTypeString(exceptions[i]);
                    }
                    mOut.print(parameterSeparator.substring(1, parameterSeparator.length() - 7) + "throws " + Strings
                          .join(exceptionNames, parameterSeparator));
                }
                mOut.println("</PRE>");
                mOut.print("<DL><DD>");
                printInlineTags(methodDoc.inlineTags(), classDoc);

                mOut.println("<P><DD><DL>");

                // param tags
                ParamTag[] paramTags = methodDoc.paramTags();
                if (parameters.length > 0) {
                    mOut.println("<DT><B>Parameters:</B></DT>");
                    for (Parameter parameter : parameters) {
                        ParamTag paramTag = null;
                        for (ParamTag tag : paramTags) {
                            if (tag.parameterName().equals(parameter.name())) {
                                paramTag = tag;
                            }
                        }
                        mOut.println("<DD><CODE>" + parameter.name() + "</CODE> - ");
                        if (paramTag != null) {
                            if (!paramTag.parameterComment().isEmpty()) {
                                printInlineTags(paramTag.inlineTags(), classDoc);
                            } else {
                                System.out.println(
                                      "No description in @param tag for " + parameter.name() + " in " + classDoc.name() + "."
                                            + methodDoc.name());
                            }
                        } else {
                            System.out.println(
                                  "No @param tag for " + parameter.name() + " in " + classDoc.name() + "." + methodDoc.name());
                        }
                        mOut.println("</DD>");
                    }
                }

                // return tag
                Tag[] returnTags = methodDoc.tags("@return");
                if (returnTags.length > 0) {
                    mOut.println("<DT><B>Returns:</B></DT>");
                    mOut.println("<DD>" + returnTags[0].text() + "</DD>");
                }

                // throws tag
                ThrowsTag[] throwsTags = methodDoc.throwsTags();
                if (throwsTags.length > 0) {
                    mOut.println("<DT><B>Throws:</B></DT>");
                    for (ThrowsTag throwsTag : throwsTags) {
                        String exceptionName = throwsTag.exceptionName();
                        // remove "com.qspin.qtaste.testsuite." prefix if any
                        if (exceptionName.startsWith("com.qspin.qtaste.testsuite.")) {
                            exceptionName = exceptionName.substring("com.qspin.qtaste.testsuite.".length());
                        }
                        mOut.println("<DD><CODE>" + exceptionName + "</CODE> - ");
                        printInlineTags(throwsTag.inlineTags(), classDoc);
                        mOut.println("</DD>");
                    }
                }

                mOut.println("</DL></DD></DL>");

                if (m != methodDocs.length - 1) {
                    mOut.println("<HR>");
                }
            }
        }
    }
87194
def parse_interface_type_definition(lexer: Lexer) -> Node:
    """"""
    start = lexer.token
    description = parse_description(lexer)
    expect_keyword(lexer, "interface")
    name = parse_name(lexer)
    directives = parse_directives(lexer, True)
    fields = parse_fields_definition(lexer)
    return Node(
        description=description,
        name=name,
        directives=directives,
        fields=fields,
        loc=loc(lexer, start),
    )
250895
def print_node(node, detailed=False):
    """"""
    nodename = node['name']
    print(colors.yellow("\n" + nodename))
    # Roles
    if detailed:
        for role in get_roles_in_node(node):
            print_role(_get_role(role), detailed=False)
    else:
        print('  Roles: {0}'.format(", ".join(get_roles_in_node(node))))
    # Recipes
    if detailed:
        for recipe in get_recipes_in_node(node):
            print "  Recipe:", recipe
            print "    attributes: {0}".format(node.get(recipe, ""))
    else:
        print('  Recipes: {0}'.format(", ".join(get_recipes_in_node(node))))
    # Node attributes
    print "  Node attributes:"
    for attribute in node.keys():
        if attribute == "run_list" or attribute == "name":
            continue
        print "    {0}: {1}".format(attribute, node[attribute])