|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.xalan.xsltc.compiler.SyntaxTreeNode org.apache.xalan.xsltc.compiler.TopLevelElement org.apache.xalan.xsltc.compiler.Whitespace
final class Whitespace
Nested Class Summary | |
---|---|
private static class |
Whitespace.WhitespaceRule
Auxillary class for encapsulating a single strip/preserve rule |
Field Summary | |
---|---|
private int |
_action
|
private java.lang.String |
_elementList
|
private int |
_importPrecedence
|
static int |
PRESERVE_SPACE
|
static int |
RULE_ALL
|
static int |
RULE_ELEMENT
|
static int |
RULE_NAMESPACE
|
static int |
RULE_NONE
|
static int |
STRIP_SPACE
|
static int |
USE_PREDICATE
|
Fields inherited from class org.apache.xalan.xsltc.compiler.TopLevelElement |
---|
_dependencies |
Fields inherited from class org.apache.xalan.xsltc.compiler.SyntaxTreeNode |
---|
_attributes, _parent, _qname, Dummy, IndentIncrement, UNKNOWN_STYLESHEET_NODE_ID |
Constructor Summary | |
---|---|
Whitespace()
|
Method Summary | |
---|---|
private static void |
compileDefault(int defaultAction,
ClassGenerator classGen)
Compiles the predicate method |
private static void |
compilePredicate(java.util.Vector rules,
int defaultAction,
ClassGenerator classGen)
Compiles the predicate method |
static void |
compilePreserveSpace(BranchHandle[] preserve,
int pCount,
InstructionList il)
|
static void |
compileStripSpace(BranchHandle[] strip,
int sCount,
InstructionList il)
|
private static Whitespace.WhitespaceRule |
findContradictingRule(java.util.Vector rules,
Whitespace.WhitespaceRule rule)
Scans through the rules vector and looks for a rule of higher priority that contradicts the current rule. |
java.util.Vector |
getRules()
De-tokenize the elements listed in the 'elements' attribute and instanciate a set of strip/preserve rules. |
void |
parseContents(Parser parser)
Parse the attributes of the xsl:strip/preserve-space element. |
private static int |
partition(java.util.Vector rules,
int p,
int r)
Used with quicksort method above |
private static int |
prioritizeRules(java.util.Vector rules)
Orders a set or rules by priority, removes redundant rules and rules that are shadowed by stronger, contradicting rules. |
private static void |
quicksort(java.util.Vector rules,
int p,
int r)
Sorts a range of rules with regard to PRIORITY only |
void |
translate(ClassGenerator classGen,
MethodGenerator methodGen)
This method should not produce any code |
static int |
translateRules(java.util.Vector rules,
ClassGenerator classGen)
Takes a vector of WhitespaceRule objects and generates a predicate method. |
Type |
typeCheck(SymbolTable stable)
Type-check contents/attributes - nothing to do... |
Methods inherited from class org.apache.xalan.xsltc.compiler.TopLevelElement |
---|
addDependency, compile, display, getDependencies |
Methods inherited from class org.apache.xalan.xsltc.compiler.SyntaxTreeNode |
---|
addAttribute, addElement, addPrefixMapping, compileResultTree, contextDependent, dependentContents, displayContents, elementAt, elementCount, elements, getAttribute, getAttribute, getAttributes, getContents, getImportPrecedence, getLineNumber, getNodeIDForStylesheetNSLookup, getParent, getParser, getPrefixMapping, getQName, getStylesheet, getSymbolTable, getTemplate, getXSLTC, hasAttribute, hasContents, indent, isDummy, lastChild, lookupNamespace, lookupPrefix, parseChildren, removeElement, reportError, reportWarning, setAttributes, setFirstElement, setLineNumber, setParent, setParser, setPrefixMapping, setQName, setQName, translateContents, typeCheckContents, updateScope |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int USE_PREDICATE
public static final int STRIP_SPACE
public static final int PRESERVE_SPACE
public static final int RULE_NONE
public static final int RULE_ELEMENT
public static final int RULE_NAMESPACE
public static final int RULE_ALL
private java.lang.String _elementList
private int _action
private int _importPrecedence
Constructor Detail |
---|
Whitespace()
Method Detail |
---|
public void parseContents(Parser parser)
parseContents
in class SyntaxTreeNode
parser
- reference to the XSLT parserpublic java.util.Vector getRules()
private static Whitespace.WhitespaceRule findContradictingRule(java.util.Vector rules, Whitespace.WhitespaceRule rule)
private static int prioritizeRules(java.util.Vector rules)
public static void compileStripSpace(BranchHandle[] strip, int sCount, InstructionList il)
public static void compilePreserveSpace(BranchHandle[] preserve, int pCount, InstructionList il)
private static void compilePredicate(java.util.Vector rules, int defaultAction, ClassGenerator classGen)
private static void compileDefault(int defaultAction, ClassGenerator classGen)
public static int translateRules(java.util.Vector rules, ClassGenerator classGen)
private static void quicksort(java.util.Vector rules, int p, int r)
private static int partition(java.util.Vector rules, int p, int r)
public Type typeCheck(SymbolTable stable) throws TypeCheckError
typeCheck
in class TopLevelElement
stable
- The compiler/parser's symbol table
TypeCheckError
public void translate(ClassGenerator classGen, MethodGenerator methodGen)
translate
in class TopLevelElement
classGen
- BCEL Java class generatormethodGen
- BCEL Java method generator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |