Qizx/open API

net.axyana.qizxopen.xquery
Interface StaticContext


public interface StaticContext

Context for static analysis.


Field Summary
static int NS_INHERIT
           
static int NS_PRESERVE
           
static int NS_XML11
           
static int SP_PRESERVE
           
static int TY_PRESERVE
           
 
Method Summary
 int allocateLocalAddress(net.axyana.qizxopen.xquery.op.LocalVariable first)
          Allocates addresses from root (first declared).
 boolean check(net.axyana.qizxopen.xquery.fn.Prototype proto, int rank, net.axyana.qizxopen.xquery.op.Expression actualArgument)
          Checks an expression against a prototype argument, raises an error if no match.
 void checkType(net.axyana.qizxopen.xquery.op.Expression expr, XQType expected, java.lang.String message)
          Checks an expression against a type, raises an error if no match.
 net.axyana.qizxopen.xquery.op.LocalVariable defineLocalVariable(QName name, XQType type, net.axyana.qizxopen.xquery.op.Expression declaring)
          Adds a local variable definition during compilation.
 void error(net.axyana.qizxopen.xquery.op.Expression place, java.lang.String msg)
          for static checking.
 net.axyana.qizxopen.xquery.fn.Function functionLookup(QName name)
          Looks for a function (user or predefined) in the static context: successively in current module, imported modules, predefined context.
 java.lang.String getBaseURI()
          Returns the default element namespace.
 java.text.Collator getCollator(java.lang.String uri)
           
 int getConstrFlags()
          Returns a mask of flags for constructors.
 java.lang.String getDefaultCollation()
          Gets the implementation-defined or query-defined default collation
 Namespace getDefaultElementNS()
          Returns the default element namespace.
 Namespace getDefaultFunctionNS()
          Returns the default function namespace.
 XQItemType getDotType()
           
 net.axyana.qizxopen.xquery.op.Expression getEnclosing(int levels)
          Returns the enclosing expression 'levels' above, returns null if none.
 NSPrefixMapping getInScopeNS()
          Returns the declared namespaces.
 net.axyana.qizxopen.xquery.op.GlobalVariable lookforGlobalVariable(QName name)
          Returns a global variable (null if not defined)
 net.axyana.qizxopen.xquery.op.LocalVariable lookforLocalVariable(QName name)
          Returns the declaration of a local variable
 net.axyana.qizxopen.xquery.op.LocalVariable markLocalVariables()
          Returns the previous local variable definition (used for pop).
 void popDotType()
           
 void popLocalVariables(net.axyana.qizxopen.xquery.op.LocalVariable mark)
          Pops local variable definitions during compilation.
 java.lang.String prefixedName(QName name)
          Converts a QName to prefix:ncname using the declared namespaces.
 void pushDotType(XQType type)
          Defines the type of '.' for the enclosed expression.
 void resetLocals()
          Initializes local variables and related info.
 net.axyana.qizxopen.xquery.op.Expression resolve(net.axyana.qizxopen.xquery.fn.Prototype[] protos, net.axyana.qizxopen.xquery.op.Expression[] actualArguments, net.axyana.qizxopen.xquery.op.Expression call)
          Finds the prototype that matches arguments, else emits an error.
 boolean sObs()
          Returns true if aiming at "Strict Observance" of the W3C recommendation.
 net.axyana.qizxopen.xquery.op.Expression staticCheck(net.axyana.qizxopen.xquery.op.Expression expr, int flags)
          Wraps the static type checking of a subexpression.
 

Field Detail

TY_PRESERVE

public static final int TY_PRESERVE
See Also:
Constant Field Values

NS_PRESERVE

public static final int NS_PRESERVE
See Also:
Constant Field Values

NS_INHERIT

public static final int NS_INHERIT
See Also:
Constant Field Values

SP_PRESERVE

public static final int SP_PRESERVE
See Also:
Constant Field Values

NS_XML11

public static final int NS_XML11
See Also:
Constant Field Values
Method Detail

getDefaultFunctionNS

public Namespace getDefaultFunctionNS()
Returns the default function namespace.


getDefaultElementNS

public Namespace getDefaultElementNS()
Returns the default element namespace.


getInScopeNS

public NSPrefixMapping getInScopeNS()
Returns the declared namespaces.


getConstrFlags

public int getConstrFlags()
Returns a mask of flags for constructors. Combination of flags TY_PRESERVE, NS_PRESERVE, NS_INHERIT


functionLookup

public net.axyana.qizxopen.xquery.fn.Function functionLookup(QName name)
                                                      throws XQueryException
Looks for a function (user or predefined) in the static context: successively in current module, imported modules, predefined context.

Returns:
a user-, predefined-, or extension function, or null if not resolved.
Throws:
XQueryException - only when the access to an existing function is explicitly denied (e.g. security).

resetLocals

public void resetLocals()
Initializes local variables and related info.


lookforLocalVariable

public net.axyana.qizxopen.xquery.op.LocalVariable lookforLocalVariable(QName name)
Returns the declaration of a local variable


defineLocalVariable

public net.axyana.qizxopen.xquery.op.LocalVariable defineLocalVariable(QName name,
                                                                       XQType type,
                                                                       net.axyana.qizxopen.xquery.op.Expression declaring)
Adds a local variable definition during compilation.


markLocalVariables

public net.axyana.qizxopen.xquery.op.LocalVariable markLocalVariables()
Returns the previous local variable definition (used for pop).


popLocalVariables

public void popLocalVariables(net.axyana.qizxopen.xquery.op.LocalVariable mark)
Pops local variable definitions during compilation.


allocateLocalAddress

public int allocateLocalAddress(net.axyana.qizxopen.xquery.op.LocalVariable first)
Allocates addresses from root (first declared).


lookforGlobalVariable

public net.axyana.qizxopen.xquery.op.GlobalVariable lookforGlobalVariable(QName name)
Returns a global variable (null if not defined)


prefixedName

public java.lang.String prefixedName(QName name)
Converts a QName to prefix:ncname using the declared namespaces.


getBaseURI

public java.lang.String getBaseURI()
Returns the default element namespace.


getDefaultCollation

public java.lang.String getDefaultCollation()
Gets the implementation-defined or query-defined default collation


getCollator

public java.text.Collator getCollator(java.lang.String uri)

error

public void error(net.axyana.qizxopen.xquery.op.Expression place,
                  java.lang.String msg)
for static checking.


staticCheck

public net.axyana.qizxopen.xquery.op.Expression staticCheck(net.axyana.qizxopen.xquery.op.Expression expr,
                                                            int flags)
Wraps the static type checking of a subexpression. Flags can be Expression.UNORDERED, ...


getEnclosing

public net.axyana.qizxopen.xquery.op.Expression getEnclosing(int levels)
Returns the enclosing expression 'levels' above, returns null if none.


checkType

public void checkType(net.axyana.qizxopen.xquery.op.Expression expr,
                      XQType expected,
                      java.lang.String message)
Checks an expression against a type, raises an error if no match.


check

public boolean check(net.axyana.qizxopen.xquery.fn.Prototype proto,
                     int rank,
                     net.axyana.qizxopen.xquery.op.Expression actualArgument)
Checks an expression against a prototype argument, raises an error if no match.


resolve

public net.axyana.qizxopen.xquery.op.Expression resolve(net.axyana.qizxopen.xquery.fn.Prototype[] protos,
                                                        net.axyana.qizxopen.xquery.op.Expression[] actualArguments,
                                                        net.axyana.qizxopen.xquery.op.Expression call)
Finds the prototype that matches arguments, else emits an error.

Parameters:
protos - list of applicable prototypes
actualArguments - argument list to match
call - concerned expression, for error message.
Returns:
an expression instantiated from the class found in the matched prototype

pushDotType

public void pushDotType(XQType type)
Defines the type of '.' for the enclosed expression.


popDotType

public void popDotType()

getDotType

public XQItemType getDotType()

sObs

public boolean sObs()
Returns true if aiming at "Strict Observance" of the W3C recommendation. By default set to false to benefit from a few extensions.


© 2005 Axyana Software