Class LocationPathPattern

All Implemented Interfaces:
org.apache.bcel.generic.InstructionConstants, Constants

public abstract class LocationPathPattern extends Pattern
Author:
Jacek Ambroziak, Santiago Pericas-Geertsen, Morten Jorgensen
  • Constructor Details

    • LocationPathPattern

      public LocationPathPattern()
  • Method Details

    • typeCheck

      public Type typeCheck(org.apache.xalan.xsltc.compiler.SymbolTable stable) throws TypeCheckError
      Description copied from class: Pattern
      Returns the type of a pattern, which is always a NodeType. A NodeType has a number of subtypes defined by NodeType._type corresponding to each type of node.
      Specified by:
      typeCheck in class Pattern
      Parameters:
      stable - The compiler/parser's symbol table
      Throws:
      TypeCheckError
    • translate

      public void translate(ClassGenerator classGen, MethodGenerator methodGen)
      Description copied from class: Pattern
      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 Pattern.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.
      Specified by:
      translate in class Pattern
      Parameters:
      classGen - BCEL Java class generator
      methodGen - BCEL Java method generator
    • setTemplate

      public void setTemplate(Template template)
    • getTemplate

      public Template getTemplate()
    • getPriority

      public final double getPriority()
      Description copied from class: Pattern
      Returns the priority of this pattern (section 5.5 in the XSLT spec).
      Specified by:
      getPriority in class Pattern
    • getDefaultPriority

      public double getDefaultPriority()
    • noSmallerThan

      public boolean noSmallerThan(LocationPathPattern other)
      This method is used by the Mode class to prioritise patterns and template. This method is called for templates that are in the same mode and that match on the same core pattern. The rules used are: o) first check precedence - highest precedence wins o) then check priority - highest priority wins o) then check the position - the template that occured last wins
    • getKernelPattern

      public abstract org.apache.xalan.xsltc.compiler.StepPattern getKernelPattern()
    • reduceKernelPattern

      public abstract void reduceKernelPattern()
    • isWildcard

      public abstract boolean isWildcard()
    • getAxis

      public int getAxis()
    • toString

      public String toString()
    • getType

      public Type getType()
    • hasPositionCall

      public boolean hasPositionCall()
    • hasLastCall

      public boolean hasLastCall()
    • evaluateAtCompileTime

      public Object 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.
    • compile

      public final org.apache.bcel.generic.InstructionList compile(ClassGenerator classGen, MethodGenerator methodGen)
      Translate this node into a fresh instruction list. The original instruction list is saved and restored.
    • translateDesynthesized

      public void translateDesynthesized(ClassGenerator classGen, MethodGenerator methodGen)
      Redefined by expressions of type boolean that use flow lists.
    • startIterator

      public 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.
    • synthesize

      public 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. Returns the handle of the instruction to be backpatched.
    • desynthesize

      public void desynthesize(ClassGenerator classGen, MethodGenerator methodGen)
    • getFalseList

      public FlowList getFalseList()
    • getTrueList

      public FlowList getTrueList()
    • backPatchFalseList

      public void backPatchFalseList(org.apache.bcel.generic.InstructionHandle ih)
    • backPatchTrueList

      public void backPatchTrueList(org.apache.bcel.generic.InstructionHandle ih)
    • lookupPrimop

      public MethodType lookupPrimop(org.apache.xalan.xsltc.compiler.SymbolTable stable, String op, MethodType ctype)
      Search for a primop in the symbol table that matches the method type 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.