FileDocCategorySizeDatePackage
LangCall.javaAPI DocJava SE 5 API2858Fri Aug 26 14:55:36 BST 2005com.sun.org.apache.xalan.internal.xsltc.compiler

LangCall

public final class LangCall extends FunctionCall
author
Morten Jorgensen

Fields Summary
private Expression
_lang
private Type
_langType
Constructors Summary
public LangCall(QName fname, Vector arguments)
Get the parameters passed to function: lang(string)

	super(fname, arguments);
	_lang = argument(0);
    
Methods Summary
public com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypegetType()

	return(Type.Boolean);
    
public voidtranslate(com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator classGen, com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator methodGen)
This method is called when the constructor is compiled in Stylesheet.compileConstructor() and not as the syntax tree is traversed.

	final ConstantPoolGen cpg = classGen.getConstantPool();
	final InstructionList il = methodGen.getInstructionList();

	final int tst = cpg.addMethodref(BASIS_LIBRARY_CLASS,
					 "testLanguage",
					 "("+STRING_SIG+DOM_INTF_SIG+"I)Z");
	_lang.translate(classGen,methodGen);
	il.append(methodGen.loadDOM());
	if (classGen instanceof FilterGenerator)
	    il.append(new ILOAD(1));
	else
	    il.append(methodGen.loadContextNode());
	il.append(new INVOKESTATIC(tst));
    
public com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypetypeCheck(com.sun.org.apache.xalan.internal.xsltc.compiler.SymbolTable stable)

	_langType = _lang.typeCheck(stable);
	if (!(_langType instanceof StringType)) {
	    _lang = new CastExpr(_lang, Type.String);
	}
	return Type.Boolean;