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

pack-priv final Class AlternativePattern

extends Pattern
Class Inheritance
Imports
com.sun.org.apache.bcel.internal.generic.GOTO, .InstructionHandle, .InstructionList, com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator, .MethodGenerator, .Type, .TypeCheckError

Authors
Jacek Ambroziak, Santiago Pericas-Geertsen

Field Summary

Modifier and TypeField and Description
private final Pattern
private final Pattern

Constructor Summary

AccessConstructor and Description
public
AlternativePattern(Pattern left, Pattern right)

Construct an alternative pattern.

Method Summary

Modifier and TypeMethod and Description
public Pattern
public double
getPriority()

Implements abstract com.sun.org.apache.xalan.internal.xsltc.compiler.Pattern.getPriority.

Returns the priority of this pattern (section 5.5 in the XSLT spec).
public Pattern
public void
setParser(Parser
The XSLT parser.
parser
)

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

Set this node's parser.
public String
toString()

Implements abstract com.sun.org.apache.xalan.internal.xsltc.compiler.Expression.toString.

Returns a string representation of the object.
public void
translate(ClassGenerator
BCEL Java class generator
classGen
,
MethodGenerator
BCEL Java method generator
methodGen
)

Implements abstract com.sun.org.apache.xalan.internal.xsltc.compiler.Pattern.translate.

Translate this node into JVM bytecodes.
public Type
typeCheck(SymbolTable
The compiler/parser's symbol table
stable
)

Implements abstract com.sun.org.apache.xalan.internal.xsltc.compiler.Pattern.typeCheck.

The type of an '|' is not really defined, hence null is returned.

Field Detail

_leftback to summary
private final Pattern _left
_rightback to summary
private final Pattern _right

Constructor Detail

AlternativePatternback to summary
public AlternativePattern(Pattern left, Pattern right)

Construct an alternative pattern. The method setParent should not be called in this case.

Method Detail

getLeftback to summary
public Pattern getLeft()
getPriorityback to summary
public double getPriority()

Implements abstract com.sun.org.apache.xalan.internal.xsltc.compiler.Pattern.getPriority.

Doc from com.sun.org.apache.xalan.internal.xsltc.compiler.Pattern.getPriority.

Returns the priority of this pattern (section 5.5 in the XSLT spec).

getRightback to summary
public Pattern getRight()
setParserback to summary
public void setParser(Parser parser)

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

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

Set this node's parser. The parser (the XSLT parser) gives this syntax tree node access to the symbol table and XPath parser.

Parameters
parser:Parser

The XSLT parser.

toStringback to summary
public String toString()

Implements abstract com.sun.org.apache.xalan.internal.xsltc.compiler.Expression.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

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

Implements abstract com.sun.org.apache.xalan.internal.xsltc.compiler.Pattern.translate.

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

Translate this node into JVM bytecodes. Patterns are translated as boolean expressions with true/false lists. Before calling translate on a pattern, make sure that the node being matched is on top of the stack. After calling translate, make sure to backpatch both true and false lists. True lists are the default, in the sense that they always "fall through". If this is not the intended semantics (e.g., see com.sun.org.apache.xalan.internal.xsltc.compiler.AlternativePattern#translate) then a GOTO must be appended to the instruction list after calling translate.

Parameters
classGen:ClassGenerator

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

BCEL Java class generator

methodGen:MethodGenerator

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

BCEL Java method generator

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

Implements abstract com.sun.org.apache.xalan.internal.xsltc.compiler.Pattern.typeCheck.

The type of an '|' is not really defined, hence null is returned.

Parameters
stable:SymbolTable

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

The compiler/parser's symbol table