1 31 package org.jruby.ast; 32 33 import java.util.List ; 34 35 import org.jruby.ast.visitor.NodeVisitor; 36 import org.jruby.evaluator.Instruction; 37 import org.jruby.lexer.yacc.ISourcePosition; 38 import org.jruby.parser.StaticScope; 39 40 49 public class ClassNode extends Node implements IScopingNode { 50 static final long serialVersionUID = -1369424045737867587L; 51 52 private final Colon3Node cpath; 53 private final StaticScope scope; 54 private final Node bodyNode; 55 private final Node superNode; 56 57 public ClassNode(ISourcePosition position, Colon3Node cpath, StaticScope scope, Node bodyNode, Node superNode) { 58 super(position, NodeTypes.CLASSNODE); 59 this.cpath = cpath; 60 this.scope = scope; 61 this.bodyNode = bodyNode; 62 this.superNode = superNode; 63 } 64 65 69 public Instruction accept(NodeVisitor iVisitor) { 70 return iVisitor.visitClassNode(this); 71 } 72 73 78 public Node getBodyNode() { 79 return bodyNode; 80 } 81 82 87 public StaticScope getScope() { 88 return scope; 89 } 90 91 95 public Colon3Node getCPath() { 96 return cpath; 97 } 98 99 103 public Node getSuperNode() { 104 return superNode; 105 } 106 107 public List childNodes() { 108 return Node.createList(cpath, bodyNode, superNode); 109 } 110 111 public String toString() { 112 return "ClassNode [" + cpath + "]"; 113 } 114 115 } 116 | Popular Tags |