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 40 44 public class Colon2Node extends Colon3Node implements INameNode { 45 static final long serialVersionUID = -3250593470034657352L; 46 47 private final Node leftNode; 48 49 public Colon2Node(ISourcePosition position, Node leftNode, String name) { 50 super(position, NodeTypes.COLON2NODE, name); 51 this.leftNode = leftNode; 52 } 53 54 58 public Instruction accept(NodeVisitor iVisitor) { 59 return iVisitor.visitColon2Node(this); 60 } 61 62 66 public Node getLeftNode() { 67 return leftNode; 68 } 69 70 public List childNodes() { 71 return Node.createList(leftNode); 72 } 73 74 public String toString() { 75 String result = "Colon2Node ["; 76 if (leftNode != null) result += leftNode; 77 result += getName(); 78 return result + "]"; 79 } 80 } 81 | Popular Tags |