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.runtime.Arity; 39 40 44 public class MultipleAsgnNode extends AssignableNode { 45 static final long serialVersionUID = 5016291105152162748L; 46 47 private final ListNode headNode; 48 private final Node argsNode; 49 50 public MultipleAsgnNode(ISourcePosition position, ListNode headNode, Node argsNode) { 51 super(position, NodeTypes.MULTIPLEASGNNODE); 52 this.headNode = headNode; 53 this.argsNode = argsNode; 54 } 55 56 60 public Instruction accept(NodeVisitor iVisitor) { 61 return iVisitor.visitMultipleAsgnNode(this); 62 } 63 64 68 public Node getArgsNode() { 69 return argsNode; 70 } 71 72 76 public ListNode getHeadNode() { 77 return headNode; 78 } 79 80 83 public Arity getArity() { 84 if (argsNode != null) { 85 return Arity.required(headNode == null ? 0 : headNode.size()); 86 } 87 88 return Arity.fixed(headNode.size()); 89 } 90 91 public List childNodes() { 92 return Node.createList(headNode, argsNode, getValueNode()); 93 } 94 95 } 96 | Popular Tags |