org.apache.xalan.xsltc.compiler
Class SymbolTable

java.lang.Object
  extended by org.apache.xalan.xsltc.compiler.SymbolTable

final class SymbolTable
extends java.lang.Object


Field Summary
private  java.util.Hashtable _aliases
           
private  java.util.Hashtable _attributeSets
           
private  SyntaxTreeNode _current
          Use a namespace prefix to lookup a namespace URI
private  java.util.Hashtable _decimalFormats
           
private  java.util.Hashtable _excludedURI
           
private  java.util.Stack _excludedURIStack
           
private  java.util.Hashtable _keys
           
private  int _nsCounter
          This is used for xsl:attribute elements that have a "namespace" attribute that is currently not defined using xmlns:
private  java.util.Hashtable _primops
           
private  java.util.Hashtable _stylesheets
           
private  java.util.Hashtable _templates
           
private  java.util.Hashtable _variables
           
 
Constructor Summary
SymbolTable()
           
 
Method Summary
 AttributeSet addAttributeSet(AttributeSet atts)
           
 void addDecimalFormatting(QName name, DecimalFormatting symbols)
           
 void addKey(QName name, Key key)
           
 Param addParam(Param parameter)
           
 void addPrefixAlias(java.lang.String prefix, java.lang.String alias)
          Adds an alias for a namespace prefix
 void addPrimop(java.lang.String name, MethodType mtype)
          Add a primitive operator or function to the symbol table.
 Stylesheet addStylesheet(QName name, Stylesheet node)
           
 Template addTemplate(Template template)
           
 Variable addVariable(Variable variable)
           
 void excludeNamespaces(java.lang.String prefixes)
          Exclude a series of namespaces given by a list of whitespace separated namespace prefixes.
 void excludeURI(java.lang.String uri)
          Register a namespace URI so that it will not be declared in the output unless it is actually referenced in the output.
 java.lang.String generateNamespacePrefix()
           
 DecimalFormatting getDecimalFormatting(QName name)
           
 Key getKey(QName name)
           
 boolean isExcludedNamespace(java.lang.String uri)
          Check if a namespace should not be declared in the output (unless used)
 AttributeSet lookupAttributeSet(QName name)
           
 SyntaxTreeNode lookupName(QName qname)
           
 java.lang.String lookupNamespace(java.lang.String prefix)
           
 Param lookupParam(QName qname)
           
 java.lang.String lookupPrefixAlias(java.lang.String prefix)
          Retrieves any alias for a given namespace prefix
 java.util.Vector lookupPrimop(java.lang.String name)
          Lookup a primitive operator or function in the symbol table by prepending the prefix PrimopPrefix.
 Stylesheet lookupStylesheet(QName name)
           
 Template lookupTemplate(QName name)
           
 Variable lookupVariable(QName qname)
           
 void popExcludedNamespacesContext()
          Exclusion of namespaces by a stylesheet does not extend to any stylesheet imported or included by the stylesheet.
 void pushExcludedNamespacesContext()
          Exclusion of namespaces by a stylesheet does not extend to any stylesheet imported or included by the stylesheet.
 void setCurrentNode(SyntaxTreeNode node)
           
 void unExcludeNamespaces(java.lang.String prefixes)
          Turn of namespace declaration exclusion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_stylesheets

private final java.util.Hashtable _stylesheets

_primops

private final java.util.Hashtable _primops

_variables

private java.util.Hashtable _variables

_templates

private java.util.Hashtable _templates

_attributeSets

private java.util.Hashtable _attributeSets

_aliases

private java.util.Hashtable _aliases

_excludedURI

private java.util.Hashtable _excludedURI

_excludedURIStack

private java.util.Stack _excludedURIStack

_decimalFormats

private java.util.Hashtable _decimalFormats

_keys

private java.util.Hashtable _keys

_nsCounter

private int _nsCounter
This is used for xsl:attribute elements that have a "namespace" attribute that is currently not defined using xmlns:


_current

private SyntaxTreeNode _current
Use a namespace prefix to lookup a namespace URI

Constructor Detail

SymbolTable

SymbolTable()
Method Detail

getDecimalFormatting

public DecimalFormatting getDecimalFormatting(QName name)

addDecimalFormatting

public void addDecimalFormatting(QName name,
                                 DecimalFormatting symbols)

getKey

public Key getKey(QName name)

addKey

public void addKey(QName name,
                   Key key)

addStylesheet

public Stylesheet addStylesheet(QName name,
                                Stylesheet node)

lookupStylesheet

public Stylesheet lookupStylesheet(QName name)

addTemplate

public Template addTemplate(Template template)

lookupTemplate

public Template lookupTemplate(QName name)

addVariable

public Variable addVariable(Variable variable)

addParam

public Param addParam(Param parameter)

lookupVariable

public Variable lookupVariable(QName qname)

lookupParam

public Param lookupParam(QName qname)

lookupName

public SyntaxTreeNode lookupName(QName qname)

addAttributeSet

public AttributeSet addAttributeSet(AttributeSet atts)

lookupAttributeSet

public AttributeSet lookupAttributeSet(QName name)

addPrimop

public void addPrimop(java.lang.String name,
                      MethodType mtype)
Add a primitive operator or function to the symbol table. To avoid name clashes with user-defined names, the prefix PrimopPrefix is prepended.


lookupPrimop

public java.util.Vector lookupPrimop(java.lang.String name)
Lookup a primitive operator or function in the symbol table by prepending the prefix PrimopPrefix.


generateNamespacePrefix

public java.lang.String generateNamespacePrefix()

setCurrentNode

public void setCurrentNode(SyntaxTreeNode node)

lookupNamespace

public java.lang.String lookupNamespace(java.lang.String prefix)

addPrefixAlias

public void addPrefixAlias(java.lang.String prefix,
                           java.lang.String alias)
Adds an alias for a namespace prefix


lookupPrefixAlias

public java.lang.String lookupPrefixAlias(java.lang.String prefix)
Retrieves any alias for a given namespace prefix


excludeURI

public void excludeURI(java.lang.String uri)
Register a namespace URI so that it will not be declared in the output unless it is actually referenced in the output.


excludeNamespaces

public void excludeNamespaces(java.lang.String prefixes)
Exclude a series of namespaces given by a list of whitespace separated namespace prefixes.


isExcludedNamespace

public boolean isExcludedNamespace(java.lang.String uri)
Check if a namespace should not be declared in the output (unless used)


unExcludeNamespaces

public void unExcludeNamespaces(java.lang.String prefixes)
Turn of namespace declaration exclusion


pushExcludedNamespacesContext

public void pushExcludedNamespacesContext()
Exclusion of namespaces by a stylesheet does not extend to any stylesheet imported or included by the stylesheet. Upon entering the context of a new stylesheet, a call to this method is needed to clear the current set of excluded namespaces temporarily. Every call to this method requires a corresponding call to popExcludedNamespacesContext().


popExcludedNamespacesContext

public void popExcludedNamespacesContext()
Exclusion of namespaces by a stylesheet does not extend to any stylesheet imported or included by the stylesheet. Upon exiting the context of a stylesheet, a call to this method is needed to restore the set of excluded namespaces that was in effect prior to entering the context of the current stylesheet.