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

pack-priv final Class ForEach

extends Instruction
Class Inheritance
Imports
com.sun.org.apache.bcel.internal.generic.BranchHandle, .ConstantPoolGen, .GOTO, .IFGT, .InstructionHandle, .InstructionList, com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator, .ErrorMsg, .MethodGenerator, .NodeSetType, .NodeType, .ReferenceType, .ResultTreeType, .Type, .TypeCheckError, .Util, java.util.ArrayList, .Iterator, .List

Authors
Jacek Ambroziak, Santiago Pericas-Geertsen, Morten Jorgensen

Field Summary

Modifier and TypeField and Description
private Expression
private Type

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
display(int indent)

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

Displays the contents of this syntax tree node (to stdout).

public void
initializeVariables(ClassGenerator classGen, MethodGenerator methodGen)

The code that is generated by nested for-each loops can appear to some JVMs as if it is accessing un-initialized variables.

public void
parseContents(Parser parser)

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

Parse the contents of this syntax tree nodes (child nodes, XPath expressions, patterns and functions).

public void
translate(ClassGenerator classGen, MethodGenerator methodGen)

Overrides com.sun.org.apache.xalan.internal.xsltc.compiler.Instruction.translate.

Translate this node into JVM bytecodes.

public Type
typeCheck(SymbolTable stable)

Overrides com.sun.org.apache.xalan.internal.xsltc.compiler.Instruction.typeCheck.

Type check all the children of this node.

Field Detail

_selectback to summary
private Expression _select
_typeback to summary
private Type _type

Constructor Detail

ForEachback to summary
pack-priv ForEach()

Method Detail

displayback to summary
public void display(int indent)

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

Doc from com.sun.org.apache.xalan.internal.xsltc.compiler.SyntaxTreeNode.display.

Displays the contents of this syntax tree node (to stdout). This method is intended for debugging _only_, and should be overridden by all syntax tree node implementations.

initializeVariablesback to summary
public void initializeVariables(ClassGenerator classGen, MethodGenerator methodGen)

The code that is generated by nested for-each loops can appear to some JVMs as if it is accessing un-initialized variables. We must add some code that pushes the default variable value on the stack and pops it into the variable slot. This is done by the Variable.initialize() method. The code that we compile for this loop looks like this: initialize iterator initialize variables <-- HERE!!! goto Iterate Loop: : : (code for <xsl:for-each> contents) : Iterate: node = iterator.next(); if (node != END) goto Loop

parseContentsback to summary
public void parseContents(Parser parser)

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

Doc from com.sun.org.apache.xalan.internal.xsltc.compiler.SyntaxTreeNode.parseContents.

Parse the contents of this syntax tree nodes (child nodes, XPath expressions, patterns and functions). The default behaviour is to parser the syntax tree node's children (since there are no common expressions, patterns, etc. that can be handled in this base class.

translateback to summary
public void translate(ClassGenerator classGen, MethodGenerator methodGen)

Overrides com.sun.org.apache.xalan.internal.xsltc.compiler.Instruction.translate.

Doc from com.sun.org.apache.xalan.internal.xsltc.compiler.Instruction.translate.

Translate this node into JVM bytecodes.

typeCheckback to summary
public Type typeCheck(SymbolTable stable) throws TypeCheckError

Overrides com.sun.org.apache.xalan.internal.xsltc.compiler.Instruction.typeCheck.

Doc from com.sun.org.apache.xalan.internal.xsltc.compiler.Instruction.typeCheck.

Type check all the children of this node.