1 16 19 20 package org.apache.xalan.xsltc.compiler; 21 22 import org.apache.bcel.generic.ConstantPoolGen; 23 import org.apache.bcel.generic.InstructionList; 24 import org.apache.bcel.generic.PUSH; 25 import org.apache.xalan.xsltc.compiler.util.ClassGenerator; 26 import org.apache.xalan.xsltc.compiler.util.MethodGenerator; 27 import org.apache.xalan.xsltc.compiler.util.Type; 28 import org.apache.xalan.xsltc.compiler.util.TypeCheckError; 29 30 34 final class SimpleAttributeValue extends AttributeValue { 35 36 private String _value; 38 42 public SimpleAttributeValue(String value) { 43 _value = value; 44 } 45 46 50 public Type typeCheck(SymbolTable stable) throws TypeCheckError { 51 return _type = Type.String; 52 } 53 54 public String toString() { 55 return _value; 56 } 57 58 protected boolean contextDependent() { 59 return false; 60 } 61 62 68 public void translate(ClassGenerator classGen, MethodGenerator methodGen) { 69 final ConstantPoolGen cpg = classGen.getConstantPool(); 70 final InstructionList il = methodGen.getInstructionList(); 71 il.append(new PUSH(cpg, _value)); 72 } 73 } 74 | Popular Tags |