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

pack-priv final Class LogicalExpr

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

Authors
Jacek Ambroziak, Santiago Pericas-Geertsen, Morten Jorgensen

Field Summary

Modifier and TypeField and Description
private Expression
private final int
private Expression
public static final int
private static final String[]
public static final int
Inherited from com.sun.org.apache.xalan.internal.xsltc.compiler.Expression:
_falseList_trueList_type

Constructor Summary

AccessConstructor and Description
public
LogicalExpr(int op, Expression left, Expression right)

Creates a new logical expression - either OR or AND.

Method Summary

Modifier and TypeMethod and Description
public Object
evaluateAtCompileTime()

Overrides com.sun.org.apache.xalan.internal.xsltc.compiler.Expression.evaluateAtCompileTime.

Returns an object representing the compile-time evaluation of an expression.

public int
getOp()

Returns this logical expression's operator - OR or AND represented by 0 and 1 respectively.

public boolean
hasLastCall()

Overrides com.sun.org.apache.xalan.internal.xsltc.compiler.Expression.hasLastCall.

Returns true if this expressions contains a call to last()

public boolean
hasPositionCall()

Overrides com.sun.org.apache.xalan.internal.xsltc.compiler.Expression.hasPositionCall.

Returns true if this expressions contains a call to position().

public void
setParser(Parser parser)

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

Override the SyntaxTreeNode.setParser() method to make sure that the parser is set for sub-expressions

public String
toString()

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

Returns a string describing this expression

public void
translate(ClassGenerator classGen, MethodGenerator methodGen)

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

Compile the expression - leave boolean expression on stack

public void
public Type
typeCheck(SymbolTable stable)

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

Type-check this expression, and possibly child expressions.

Inherited from com.sun.org.apache.xalan.internal.xsltc.compiler.Expression:
backPatchFalseListbackPatchTrueListcompiledesynthesizegetFalseListgetTrueListgetTypelookupPrimopstartIteratorsynthesize

Field Detail

_leftback to summary
private Expression _left
_opback to summary
private final int _op
_rightback to summary
private Expression _right
ANDback to summary
public static final int AND
Opsback to summary
private static final String[] Ops
ORback to summary
public static final int OR

Constructor Detail

LogicalExprback to summary
public LogicalExpr(int op, Expression left, Expression right)

Creates a new logical expression - either OR or AND. Note that the left- and right-hand side expressions can also be logical expressions, thus creating logical trees representing structures such as (a and (b or c) and d), etc...

Method Detail

evaluateAtCompileTimeback to summary
public Object evaluateAtCompileTime()

Overrides com.sun.org.apache.xalan.internal.xsltc.compiler.Expression.evaluateAtCompileTime.

Returns an object representing the compile-time evaluation of an expression. We are only using this for function-available and element-available at this time.

getOpback to summary
public int getOp()

Returns this logical expression's operator - OR or AND represented by 0 and 1 respectively.

hasLastCallback to summary
public boolean hasLastCall()

Overrides com.sun.org.apache.xalan.internal.xsltc.compiler.Expression.hasLastCall.

Returns true if this expressions contains a call to last()

hasPositionCallback to summary
public boolean hasPositionCall()

Overrides com.sun.org.apache.xalan.internal.xsltc.compiler.Expression.hasPositionCall.

Returns true if this expressions contains a call to position(). This is needed for context changes in node steps containing multiple predicates.

setParserback to summary
public void setParser(Parser parser)

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

Override the SyntaxTreeNode.setParser() method to make sure that the parser is set for sub-expressions

toStringback to summary
public String toString()

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

Returns a string describing this expression

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

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

Compile the expression - leave boolean expression on stack

translateDesynthesizedback to summary
public void translateDesynthesized(ClassGenerator classGen, MethodGenerator methodGen)

Overrides com.sun.org.apache.xalan.internal.xsltc.compiler.Expression.translateDesynthesized.

Compile expression and update true/false-lists

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

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

Type-check this expression, and possibly child expressions.