1 28 package org.jruby.ast; 29 30 35 import org.jruby.ast.types.INameNode; 36 import org.jruby.lexer.yacc.ISourcePosition; 37 import org.jruby.parser.StaticScope; 38 39 public abstract class MethodDefNode extends Node implements INameNode { 40 41 protected final ArgumentNode nameNode; 42 protected final ArgsNode argsNode; 43 protected final StaticScope scope; 44 protected final Node bodyNode; 45 46 public MethodDefNode(ISourcePosition position, ArgumentNode nameNode, ArgsNode argsNode, StaticScope scope, Node bodyNode, int id) { 47 super(position, id); 48 this.nameNode = nameNode; 49 this.argsNode = argsNode; 50 this.scope = scope; 51 this.bodyNode = bodyNode; 52 } 53 54 58 public ArgsNode getArgsNode() { 59 return argsNode; 60 } 61 62 67 public StaticScope getScope() { 68 return scope; 69 } 70 71 76 public Node getBodyNode() { 77 return bodyNode; 78 } 79 80 84 public ArgumentNode getNameNode() { 85 return nameNode; 86 } 87 88 92 public String getName() { 93 return nameNode.getName(); 94 } 95 } | Popular Tags |