Qizx/Open v0.4p2

net.xfra.qizxopen.xquery
Interface StaticContext

All Known Implementing Classes:
net.xfra.qizxopen.xquery.impl.Module

public interface StaticContext

Context for static analysis.


Method Summary
 boolean check(net.xfra.qizxopen.xquery.fn.Prototype proto, int rank, net.xfra.qizxopen.xquery.op.Expression actualArgument)
          Checks an expression against a prototype argument, raises an error if no match.
 void checkType(net.xfra.qizxopen.xquery.op.Expression expr, Type expected, java.lang.String message)
          Checks an expression against a type, raises an error if no match.
 net.xfra.qizxopen.xquery.op.LocalVariable defineLocalVariable(QName name, Type type, net.xfra.qizxopen.xquery.op.Expression declaring)
          Adds a local variable definition during compilation.
 void error(net.xfra.qizxopen.xquery.op.Expression place, java.lang.String msg, java.lang.String argument1, java.lang.String arg2)
          Convenience.
 net.xfra.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)
           
 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.
 ItemType getDotType()
           
 net.xfra.qizxopen.xquery.op.Expression getEnclosing(int levels)
          Returns the enclosing expression 'levels' above, returns null if none.
 NSPrefixMapping getInScopeNS()
          Returns the declared namespaces.
 Log getLog()
          Returns the current message log.
 net.xfra.qizxopen.xquery.op.GlobalVariable lookforGlobalVariable(QName name)
          Returns a global variable (null if not defined)
 net.xfra.qizxopen.xquery.op.LocalVariable lookforLocalVariable(QName name)
          Returns the declaration of a local variable
 net.xfra.qizxopen.xquery.op.LocalVariable markLocalVariables()
          Returns the previous local variable definition (used for pop).
 void popDotType()
           
 void popLocalVariables(net.xfra.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(Type type)
          Defines the type of '.' for the enclosed expression.
 net.xfra.qizxopen.xquery.op.Expression resolve(net.xfra.qizxopen.xquery.fn.Prototype[] protos, net.xfra.qizxopen.xquery.op.Expression[] actualArguments, net.xfra.qizxopen.xquery.op.Expression call)
          Finds the prototype that matches arguments, else emits an error.
 net.xfra.qizxopen.xquery.op.Expression staticCheck(net.xfra.qizxopen.xquery.op.Expression expr, int flags)
          Wraps the static type checking of a subexpression.
 

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.


functionLookup

public net.xfra.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).

lookforLocalVariable

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


defineLocalVariable

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


markLocalVariables

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


popLocalVariables

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


lookforGlobalVariable

public net.xfra.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)

getLog

public Log getLog()
Returns the current message log.


error

public void error(net.xfra.qizxopen.xquery.op.Expression place,
                  java.lang.String msg,
                  java.lang.String argument1,
                  java.lang.String arg2)
Convenience. Short form for getLog().error(...)


staticCheck

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


getEnclosing

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


checkType

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


check

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


resolve

public net.xfra.qizxopen.xquery.op.Expression resolve(net.xfra.qizxopen.xquery.fn.Prototype[] protos,
                                                      net.xfra.qizxopen.xquery.op.Expression[] actualArguments,
                                                      net.xfra.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(Type type)
Defines the type of '.' for the enclosed expression.


popDotType

public void popDotType()

getDotType

public ItemType getDotType()

 Copyright Xavier FRANC 2003-2004