APIdia Launch Partner
Top Fields Constructors Methods
com.sun.org.apache.xalan.internal.xsltc.compiler

pack-priv Class VariableBase

extends TopLevelElement
Class Inheritance
Known Direct Subclasses
com.sun.org.apache.xalan.internal.xsltc.compiler.Param, com.sun.org.apache.xalan.internal.xsltc.compiler.Variable
Imports
com.sun.org.apache.bcel.internal.generic.CHECKCAST, .ConstantPoolGen, .INVOKEINTERFACE, .INVOKESPECIAL, .INVOKEVIRTUAL, .Instruction, .InstructionList, .LocalVariableGen, .NEW, .PUSH, com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator, .ErrorMsg, .MethodGenerator, .NodeSetType, .ResultTreeType, .Type, .Util, com.sun.org.apache.xml.internal.utils.XML11Char, java.util.ArrayList, .List

Authors
Jacek Ambroziak, Santiago Pericas-Geertsen, Morten Jorgensen, Erwin Bolwidt , John Howard

Field Summary

Modifier and TypeField and Description
protected String
protected boolean
protected boolean
protected Instruction
protected LocalVariableGen
protected QName
protected List<VariableRefBase>
protected Expression
protected Instruction
protected Type
protected String
Inherited from com.sun.org.apache.xalan.internal.xsltc.compiler.TopLevelElement:
_dependencies

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
addReference(VariableRefBase vref)

Add a reference to this variable.

public void
copyReferences(VariableBase var)

When a variable is overriden by another, e.g. via xsl:import, its references need to be copied or otherwise it may be compiled away as dead code.

public void
disable()

Disable this variable/parameter

public void
display(int indent)

Overrides com.sun.org.apache.xalan.internal.xsltc.compiler.TopLevelElement.display.

Display variable in a full AST dump

public String
getEscapedName()

Returns the escaped qname of the variable or parameter

public Expression
getExpression()

Returns the expression from this variable's select attribute (if any)

public QName
getName()

Returns the name of the variable or parameter as it will occur in the compiled translet.

public Type
getType()

Returns the type of the variable

public boolean
isLocal()

Returns the true if the variable is local

public Instruction
loadInstruction()

Returns an instruction for loading the value of this variable onto the JVM stack.

public void
mapRegister(MethodGenerator methodGen)

Map this variable to a register

public void
parseContents(Parser parser)

Overrides com.sun.org.apache.xalan.internal.xsltc.compiler.SyntaxTreeNode.parseContents.

Parse the contents of the <xsl:decimal-format> element.

public void
setName(QName name)

Set the name of the variable or paremeter.

public Instruction
storeInstruction()

Returns an instruction for storing a value from the JVM stack into this variable.

public String
toString()

Overrides java.lang.Object.toString.

Display variable as single string

public void
translateValue(ClassGenerator classGen, MethodGenerator methodGen)

Compile the value of the variable, which is either in an expression in a 'select' attribute, or in the variable elements body

public void
unmapRegister(ClassGenerator classGen, MethodGenerator methodGen)

Remove the mapping of this variable to a register.

Inherited from com.sun.org.apache.xalan.internal.xsltc.compiler.TopLevelElement:
addDependencycompilegetDependenciestranslatetypeCheck

Field Detail

_escapedNameback to summary
protected String _escapedName
_ignoreback to summary
protected boolean _ignore
_isLocalback to summary
protected boolean _isLocal
_loadInstructionback to summary
protected Instruction _loadInstruction
_localback to summary
protected LocalVariableGen _local
_nameback to summary
protected QName _name
_refsback to summary
protected List<VariableRefBase> _refs
_selectback to summary
protected Expression _select
_storeInstructionback to summary
protected Instruction _storeInstruction
_typeback to summary
protected Type _type
selectback to summary
protected String select

Constructor Detail

VariableBaseback to summary
pack-priv VariableBase()

Method Detail

addReferenceback to summary
public void addReference(VariableRefBase vref)

Add a reference to this variable. Called by VariableRef when an expression contains a reference to this variable.

copyReferencesback to summary
public void copyReferences(VariableBase var)

When a variable is overriden by another, e.g. via xsl:import, its references need to be copied or otherwise it may be compiled away as dead code. This method can be used for that purpose.

disableback to summary
public void disable()

Disable this variable/parameter

displayback to summary
public void display(int indent)

Overrides com.sun.org.apache.xalan.internal.xsltc.compiler.TopLevelElement.display.

Display variable in a full AST dump

getEscapedNameback to summary
public String getEscapedName()

Returns the escaped qname of the variable or parameter

getExpressionback to summary
public Expression getExpression()

Returns the expression from this variable's select attribute (if any)

getNameback to summary
public QName getName()

Returns the name of the variable or parameter as it will occur in the compiled translet.

getTypeback to summary
public Type getType()

Returns the type of the variable

isLocalback to summary
public boolean isLocal()

Returns the true if the variable is local

loadInstructionback to summary
public Instruction loadInstruction()

Returns an instruction for loading the value of this variable onto the JVM stack.

mapRegisterback to summary
public void mapRegister(MethodGenerator methodGen)

Map this variable to a register

parseContentsback to summary
public void parseContents(Parser parser)

Overrides com.sun.org.apache.xalan.internal.xsltc.compiler.SyntaxTreeNode.parseContents.

Parse the contents of the <xsl:decimal-format> element.

setNameback to summary
public void setName(QName name)

Set the name of the variable or paremeter. Escape all special chars.

storeInstructionback to summary
public Instruction storeInstruction()

Returns an instruction for storing a value from the JVM stack into this variable.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Display variable as single string

translateValueback to summary
public void translateValue(ClassGenerator classGen, MethodGenerator methodGen)

Compile the value of the variable, which is either in an expression in a 'select' attribute, or in the variable elements body

unmapRegisterback to summary
public void unmapRegister(ClassGenerator classGen, MethodGenerator methodGen)

Remove the mapping of this variable to a register. Called when we leave the AST scope of the variable's declaration