1 32 package org.jruby.ast; 33 34 import java.io.IOException ; 35 import java.util.List ; 36 37 import org.jruby.ast.types.INameNode; 38 import org.jruby.ast.visitor.NodeVisitor; 39 import org.jruby.evaluator.Instruction; 40 import org.jruby.lexer.yacc.ISourcePosition; 41 42 45 public class FCallNode extends Node implements INameNode, IArgumentNode, BlockAcceptingNode { 46 static final long serialVersionUID = 3590332973770104094L; 47 48 private String name; 49 private Node argsNode; 50 private Node iterNode; 51 52 public FCallNode(ISourcePosition position, String name, Node argsNode) { 53 this(position, name, argsNode, null); 54 } 55 56 public FCallNode(ISourcePosition position, String name, Node argsNode, Node iterNode) { 57 super(position, NodeTypes.FCALLNODE); 58 this.name = name.intern(); 59 this.argsNode = argsNode; 60 this.iterNode = iterNode; 61 } 62 63 private void readObject(java.io.ObjectInputStream in) throws IOException , ClassNotFoundException { 64 in.defaultReadObject(); 65 66 name = name.intern(); 68 } 69 70 74 public Instruction accept(NodeVisitor iVisitor) { 75 return iVisitor.visitFCallNode(this); 76 } 77 78 81 public Node getIterNode() { 82 return iterNode; 83 } 84 85 public void setIterNode(Node iterNode) { 86 this.iterNode = iterNode; 87 } 88 89 93 public Node getArgsNode() { 94 return argsNode; 95 } 96 97 102 public void setArgsNode(Node argsNode) { 103 this.argsNode = argsNode; 104 } 105 106 110 public String getName() { 111 return name; 112 } 113 114 public List childNodes() { 115 return createList(argsNode, iterNode); 116 } 117 118 public String toString() { 119 return "FCallNode: " + getName(); 120 } 121 } 122 | Popular Tags |