1 32 package org.jruby.ast; 33 34 import java.util.List ; 35 36 import org.jruby.ast.types.ILiteralNode; 37 import org.jruby.ast.visitor.NodeVisitor; 38 import org.jruby.evaluator.Instruction; 39 import org.jruby.lexer.yacc.ISourcePosition; 40 import org.jruby.util.ByteList; 41 42 46 public class StrNode extends Node implements ILiteralNode { 47 static final long serialVersionUID = 4544779503072130759L; 48 49 private final ByteList value; 50 51 public StrNode(ISourcePosition position, ByteList value) { 52 super(position, NodeTypes.STRNODE); 53 this.value = value; 54 } 55 56 public StrNode(ISourcePosition position, StrNode head, StrNode tail) { 57 super(position, NodeTypes.STRNODE); 58 59 this.value = (ByteList) head.getValue().clone(); 61 62 value.append(tail.getValue()); 63 } 64 68 public Instruction accept(NodeVisitor iVisitor) { 69 return iVisitor.visitStrNode(this); 70 } 71 72 76 public ByteList getValue() { 77 return value; 78 } 79 80 public List childNodes() { 81 return EMPTY_LIST; 82 } 83 84 } 85 | Popular Tags |