|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.xalan.xsltc.compiler.SyntaxTreeNode
org.apache.xalan.xsltc.compiler.Pattern
public abstract class Pattern
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.apache.bcel.generic.InstructionConstants |
---|
org.apache.bcel.generic.InstructionConstants.Clinit |
Field Summary |
---|
Fields inherited from interface org.apache.bcel.generic.InstructionConstants |
---|
AALOAD, AASTORE, ACONST_NULL, ALOAD_0, ALOAD_1, ALOAD_2, ARETURN, ARRAYLENGTH, ASTORE_0, ASTORE_1, ASTORE_2, ATHROW, BALOAD, BASTORE, bla, CALOAD, CASTORE, D2F, D2I, D2L, DADD, DALOAD, DASTORE, DCMPG, DCMPL, DCONST_0, DCONST_1, DDIV, DMUL, DNEG, DREM, DRETURN, DSUB, DUP, DUP_X1, DUP_X2, DUP2, DUP2_X1, DUP2_X2, F2D, F2I, F2L, FADD, FALOAD, FASTORE, FCMPG, FCMPL, FCONST_0, FCONST_1, FCONST_2, FDIV, FMUL, FNEG, FREM, FRETURN, FSUB, I2B, I2C, I2D, I2F, I2L, I2S, IADD, IALOAD, IAND, IASTORE, ICONST_0, ICONST_1, ICONST_2, ICONST_3, ICONST_4, ICONST_5, ICONST_M1, IDIV, ILOAD_0, ILOAD_1, ILOAD_2, IMUL, INEG, INSTRUCTIONS, IOR, IREM, IRETURN, ISHL, ISHR, ISTORE_0, ISTORE_1, ISTORE_2, ISUB, IUSHR, IXOR, L2D, L2F, L2I, LADD, LALOAD, LAND, LASTORE, LCMP, LCONST_0, LCONST_1, LDIV, LMUL, LNEG, LOR, LREM, LRETURN, LSHL, LSHR, LSUB, LUSHR, LXOR, MONITORENTER, MONITOREXIT, NOP, POP, POP2, RETURN, SALOAD, SASTORE, SWAP, THIS |
Constructor Summary | |
---|---|
Pattern()
|
Method Summary | |
---|---|
void |
backPatchFalseList(org.apache.bcel.generic.InstructionHandle ih)
|
void |
backPatchTrueList(org.apache.bcel.generic.InstructionHandle ih)
|
org.apache.bcel.generic.InstructionList |
compile(ClassGenerator classGen,
MethodGenerator methodGen)
Translate this node into a fresh instruction list. |
void |
desynthesize(ClassGenerator classGen,
MethodGenerator methodGen)
|
java.lang.Object |
evaluateAtCompileTime()
Returns an object representing the compile-time evaluation of an expression. |
FlowList |
getFalseList()
|
abstract double |
getPriority()
Returns the priority of this pattern (section 5.5 in the XSLT spec). |
FlowList |
getTrueList()
|
Type |
getType()
|
boolean |
hasLastCall()
|
boolean |
hasPositionCall()
|
MethodType |
lookupPrimop(org.apache.xalan.xsltc.compiler.SymbolTable stable,
java.lang.String op,
MethodType ctype)
Search for a primop in the symbol table that matches the method type ctype . |
void |
startIterator(ClassGenerator classGen,
MethodGenerator methodGen)
If this expression is of type node-set and it is not a variable reference, then call setStartNode() passing the context node. |
void |
synthesize(ClassGenerator classGen,
MethodGenerator methodGen)
Synthesize a boolean expression, i.e., either push a 0 or 1 onto the operand stack for the next statement to succeed. |
abstract java.lang.String |
toString()
|
abstract void |
translate(ClassGenerator classGen,
MethodGenerator methodGen)
Translate this node into JVM bytecodes. |
void |
translateDesynthesized(ClassGenerator classGen,
MethodGenerator methodGen)
Redefined by expressions of type boolean that use flow lists. |
abstract Type |
typeCheck(org.apache.xalan.xsltc.compiler.SymbolTable stable)
Returns the type of a pattern, which is always a NodeType . |
Methods inherited from class org.apache.xalan.xsltc.compiler.SyntaxTreeNode |
---|
display, getLineNumber, getParser, getStylesheet, parseContents |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Pattern()
Method Detail |
---|
public abstract Type typeCheck(org.apache.xalan.xsltc.compiler.SymbolTable stable) throws TypeCheckError
NodeType
.
A NodeType
has a number of subtypes defined by
NodeType._type
corresponding to each type of node.
stable
- The compiler/parser's symbol table
TypeCheckError
public abstract void translate(ClassGenerator classGen, MethodGenerator methodGen)
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
AlternativePattern.translate(org.apache.xalan.xsltc.compiler.util.ClassGenerator, org.apache.xalan.xsltc.compiler.util.MethodGenerator)
)
then a GOTO must be appended to the instruction list after calling
translate
.
classGen
- BCEL Java class generatormethodGen
- BCEL Java method generatorpublic abstract double getPriority()
public Type getType()
public abstract java.lang.String toString()
toString
in class java.lang.Object
public boolean hasPositionCall()
public boolean hasLastCall()
public java.lang.Object evaluateAtCompileTime()
public final org.apache.bcel.generic.InstructionList compile(ClassGenerator classGen, MethodGenerator methodGen)
public void translateDesynthesized(ClassGenerator classGen, MethodGenerator methodGen)
public void startIterator(ClassGenerator classGen, MethodGenerator methodGen)
public void synthesize(ClassGenerator classGen, MethodGenerator methodGen)
public void desynthesize(ClassGenerator classGen, MethodGenerator methodGen)
public FlowList getFalseList()
public FlowList getTrueList()
public void backPatchFalseList(org.apache.bcel.generic.InstructionHandle ih)
public void backPatchTrueList(org.apache.bcel.generic.InstructionHandle ih)
public MethodType lookupPrimop(org.apache.xalan.xsltc.compiler.SymbolTable stable, java.lang.String op, MethodType ctype)
ctype
. Two methods match if they have the same arity.
If a primop is overloaded then the "closest match" is returned. The
first entry in the vector of primops that has the right arity is
considered to be the default one.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |