/**
  * Given the root {@link Node} in a JRuby AST will locate the name of the class defined by that
  * AST.
  *
  * @throws IllegalArgumentException if no class is defined by the supplied AST
  */
 private static String findClassName(Node rootNode) {
   ClassNode classNode = findClassNode(rootNode);
   if (classNode == null) {
     throw new IllegalArgumentException(
         "Unable to determine class name for root node '" + rootNode + "'");
   }
   Colon2Node node = (Colon2Node) classNode.getCPath();
   return node.getName();
 }
예제 #2
0
파일: SexpMaker.java 프로젝트: xb/jruby
 private void colon2Node(Colon2Node node) {
   sb.append(" ").append(node.getName());
 }