1 31 package org.jruby.ast; 32 33 import java.util.List ; 34 35 import org.jruby.ast.types.INameNode; 36 import org.jruby.ast.visitor.NodeVisitor; 37 import org.jruby.evaluator.Instruction; 38 import org.jruby.lexer.yacc.ISourcePosition; 39 import org.jruby.parser.StaticScope; 40 41 45 public class DefsNode extends MethodDefNode implements INameNode { 46 static final long serialVersionUID = -4472719020304670080L; 47 48 private final Node receiverNode; 49 public DefsNode(ISourcePosition position, Node receiverNode, ArgumentNode nameNode, ArgsNode argsNode, 50 StaticScope scope, Node bodyNode) { 51 super(position, nameNode, argsNode, scope, bodyNode, NodeTypes.DEFSNODE); 52 53 this.receiverNode = receiverNode; 54 } 55 56 60 public Instruction accept(NodeVisitor iVisitor) { 61 return iVisitor.visitDefsNode(this); 62 } 63 64 68 public Node getReceiverNode() { 69 return receiverNode; 70 } 71 72 75 public String getName() { 76 return nameNode.getName(); 77 } 78 79 public List childNodes() { 80 return Node.createList(receiverNode, nameNode, argsNode, bodyNode); 81 } 82 83 } 84 | Popular Tags |