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 44 public class ModuleNode extends Node implements IScopingNode { 45 static final long serialVersionUID = 4938115602547834310L; 46 47 private final Colon3Node cpath; 48 private final StaticScope scope; 49 private final Node bodyNode; 50 51 public ModuleNode(ISourcePosition position, Colon3Node cpath, StaticScope scope, Node bodyNode) { 52 super(position, NodeTypes.MODULENODE); 53 this.cpath = cpath; 54 this.scope = scope; 55 this.bodyNode = bodyNode; 56 } 57 58 62 public Instruction accept(NodeVisitor iVisitor) { 63 return iVisitor.visitModuleNode(this); 64 } 65 66 71 public Node getBodyNode() { 72 return bodyNode; 73 } 74 75 80 public StaticScope getScope() { 81 return scope; 82 } 83 84 88 public Colon3Node getCPath() { 89 return cpath; 90 } 91 92 public List childNodes() { 93 return Node.createList(cpath, bodyNode); 94 } 95 } 96 | Popular Tags |