Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_ELEMENT_PREFIX
Pseudo-namespace "prefix" for the default element namespace.
|
static java.lang.String |
DEFAULT_FUNCTION_PREFIX
Pseudo-namespace "prefix" for the default function namespace.
|
static Namespace[] |
defaultFunctionNamespacePath |
static Environment |
extensionsEnvEnv
Environment of pre-defined non-standard Qexo/Kawa functions.
|
static QuoteExp |
falseExp |
static ConstantFunction0 |
falseFunction |
static XQuery |
instance |
static java.lang.String |
KAWA_FUNCTION_NAMESPACE |
static Namespace |
kawaFunctionNamespace |
static java.lang.String |
LOCAL_NAMESPACE |
static int |
PARSE_WITH_FOCUS
Special parser flag used by
evalToFocusProc . |
static java.lang.String |
QEXO_FUNCTION_NAMESPACE |
static Namespace |
qexoFunctionNamespace |
static java.lang.String |
SCHEMA_INSTANCE_NAMESPACE |
static java.lang.String |
SCHEMA_NAMESPACE |
static QuoteExp |
trueExp |
static ConstantFunction0 |
trueFunction |
static int |
VARIADIC_FUNCTION_NAMESPACE |
static java.lang.String |
XHTML_NAMESPACE |
static Environment |
xqEnvironment |
static java.lang.String |
XQUERY_FUNCTION_NAMESPACE |
static Namespace |
xqueryFunctionNamespace |
current, environ, FUNCTION_NAMESPACE, global, NAMESPACE_PREFIX_NAMESPACE, PARSE_CURRENT_NAMES, PARSE_EMIT_MAIN, PARSE_EXPLICIT, PARSE_FOR_APPLET, PARSE_FOR_EVAL, PARSE_FOR_LINT, PARSE_FOR_SERVLET, PARSE_IMMEDIATE, PARSE_INTERACTIVE_MODULE, PARSE_ONE_LINE, PARSE_PROLOG, requirePedantic, userEnv, VALUE_NAMESPACE
Constructor and Description |
---|
XQuery() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
applyWithFocus(Procedure proc,
java.lang.Object values)
Call a procedure with each item in a sequence as the context item.
|
void |
applyWithFocus(Procedure proc,
java.lang.Object values,
Consumer out)
Call a procedure with each item in a sequence as the context item.
|
java.lang.Object |
applyWithFocus(Procedure proc,
java.lang.Object item,
int position,
int size)
Call a procedure with a given focus (context).
|
void |
applyWithFocus(Procedure proc,
java.lang.Object item,
int position,
int size,
Consumer out)
Call a procedure with a given focus (context).
|
void |
applyWithFocus$X(Procedure proc,
java.lang.Object values,
CallContext ctx)
Call a procedure with each item in a sequence as the context item.
|
static char |
asChar(java.lang.Object x) |
static Numeric |
asNumber(java.lang.Object arg) |
protected void |
define_method(java.lang.String name,
java.lang.String cname,
java.lang.String mname) |
void |
define(java.lang.String name,
java.lang.Object value)
Enter a value into the current environment.
|
void |
eval_with_focus$X(java.lang.String expr,
java.lang.Object values,
CallContext ctx)
Evaluate an expression with a given focus (context).
|
void |
eval_with_focus$X(java.lang.String expr,
java.lang.Object item,
int position,
int size,
CallContext ctx)
Evaluate an expression with a given focus (context).
|
Procedure |
evalToFocusProc(java.io.Reader in,
SourceMessages messages)
Parse an XQuery expression from a
Reader that is the body of a procedure. |
Procedure |
evalToFocusProc(java.lang.String expr)
Parse an XQuery expression that is the body of a procedure.
|
void |
evalWithFocus(java.io.Reader in,
SourceMessages messages,
java.lang.Object values,
Consumer out)
Evaluate an expression with each item in a sequence as the context item.
|
void |
evalWithFocus(java.io.Reader in,
SourceMessages messages,
java.lang.Object item,
int position,
int size,
Consumer out)
Evaluate an expression with a given focus (context).
|
java.lang.Object |
evalWithFocus(java.lang.String expr,
java.lang.Object values)
Evaluate an expression with each item in a sequence as the context item.
|
java.lang.Object |
evalWithFocus(java.lang.String expr,
java.lang.Object item,
int position,
int size)
Evaluate an expression with a given focus (context).
|
java.lang.String |
formatType(Type type) |
Compilation |
getCompilation(Lexer lexer,
SourceMessages messages,
NameLookup lexical) |
static java.lang.Object |
getExternal(Symbol name,
java.lang.Object type) |
static XQuery |
getInstance() |
Lexer |
getLexer(gnu.kawa.io.InPort inp,
SourceMessages messages) |
java.lang.String |
getName() |
int |
getNamespaceOf(Declaration decl)
Return the namespace (e.g value or function) of a Declaration.
|
Consumer |
getOutputConsumer(java.io.Writer out) |
java.lang.String |
getPrimaryPrompt() |
java.lang.String |
getSecondaryPrompt() |
Type |
getStandardType(java.lang.String name) |
Symbol |
getSymbol(java.lang.String name) |
Type |
getTypeFor(java.lang.Class clas) |
Type |
getTypeFor(java.lang.String name) |
boolean |
hasNamespace(Declaration decl,
int namespace)
True if a Declaration is in the specified namespace.
|
boolean |
hasSeparateFunctionNamespace()
True if functions are in a separate name space from variable.
|
boolean |
isTrue(java.lang.Object value)
Test if a value is considered "true" in this language.
|
static java.lang.String |
makeClassName(java.lang.String source) |
static java.lang.String |
mangle(java.lang.String name) |
static int |
namespaceForFunctions(int argCount) |
boolean |
parse(Compilation tr,
int options) |
static void |
registerEnvironment()
The compiler insert calls to this method for applications and applets.
|
void |
resolve(Compilation comp)
Perform any need post-processing after we've read all the modules
to be compiled.
|
asType, booleanObject, booleanValue, coerceFromObject, coerceToObject, declFromField, decodeType, defAliasStFld, defineFunction, defineFunction, defProcStFld, defProcStFld, defProcStFld, defProcStFldAs, detect, detect, detect, encodeType, eval, eval, eval, eval, eval, eval, eval, eval, eval, getCompilation, getCompilation, getCompilationClass, getDefaultLanguage, getEnvironment, getEnvPropertyFor, getEnvPropertyFor, getExtensions, getFormat, getInstance, getInstance, getInstanceFromFilenameExtension, getLangEnvironment, getLangTypeFor, getLanguages, getNamedType, getNewEnvironment, getTypeFor, getTypeFor, getTypeFor, isValidJavaName, loadClass, lookup, lookupBuiltin, mangleName, noValue, parse, parse, parse, parse, registerLanguage, restoreCurrent, runAsApplication, setCurrentLanguage, setDefaults, setSaveCurrent, unionType
public static final java.lang.String XQUERY_FUNCTION_NAMESPACE
public static final java.lang.String KAWA_FUNCTION_NAMESPACE
public static final java.lang.String QEXO_FUNCTION_NAMESPACE
public static final java.lang.String LOCAL_NAMESPACE
public static final java.lang.String SCHEMA_NAMESPACE
public static final java.lang.String SCHEMA_INSTANCE_NAMESPACE
public static final java.lang.String XHTML_NAMESPACE
public static final Namespace xqueryFunctionNamespace
public static final Namespace kawaFunctionNamespace
public static final Namespace qexoFunctionNamespace
public static final Namespace[] defaultFunctionNamespacePath
public static final java.lang.String DEFAULT_ELEMENT_PREFIX
public static final java.lang.String DEFAULT_FUNCTION_PREFIX
public static final int PARSE_WITH_FOCUS
evalToFocusProc
.public static final int VARIADIC_FUNCTION_NAMESPACE
public static Environment extensionsEnvEnv
public static final Environment xqEnvironment
public static final XQuery instance
public static QuoteExp falseExp
public static QuoteExp trueExp
public static final ConstantFunction0 falseFunction
public static final ConstantFunction0 trueFunction
public boolean hasSeparateFunctionNamespace()
Language
hasSeparateFunctionNamespace
in class Language
public static Numeric asNumber(java.lang.Object arg)
public static char asChar(java.lang.Object x)
public boolean isTrue(java.lang.Object value)
Language
public Lexer getLexer(gnu.kawa.io.InPort inp, SourceMessages messages)
public Compilation getCompilation(Lexer lexer, SourceMessages messages, NameLookup lexical)
public boolean parse(Compilation tr, int options) throws java.io.IOException, SyntaxException
parse
in class Language
java.io.IOException
SyntaxException
public void resolve(Compilation comp)
Language
public static int namespaceForFunctions(int argCount)
public int getNamespaceOf(Declaration decl)
Language
getNamespaceOf
in class Language
public boolean hasNamespace(Declaration decl, int namespace)
Language
hasNamespace
in class Language
namespace
- normally a bitmask as returned by getNamespaceOf.public void define(java.lang.String name, java.lang.Object value)
Language
protected void define_method(java.lang.String name, java.lang.String cname, java.lang.String mname)
public void applyWithFocus(Procedure proc, java.lang.Object item, int position, int size, Consumer out) throws java.lang.Throwable
proc
- a 3-operand Procedure
as returned by
evalToFocusProc
item
- the context item, passed as the first argument to proc
position
- the context position, passed as the second argumentsize
- the context size, passed as the second argumentout
- where to send the result of proc
java.lang.Throwable
public java.lang.Object applyWithFocus(Procedure proc, java.lang.Object item, int position, int size) throws java.lang.Throwable
proc
- a 3-operand Procedure
as returned by
evalToFocusProc
item
- the context item, passed as the first argument to proc
position
- the context position, passed as the second argumentsize
- the context size, passed as the second argumentproc
java.lang.Throwable
public void applyWithFocus(Procedure proc, java.lang.Object values, Consumer out) throws java.lang.Throwable
proc
- a 3-operand Procedure
as returned by
evalToFocusProc
values
- a sequence. The proc
is called once for each
item, with the item as the first argument, a 1-based index as the
second argument, and the sequence size as the third argument.out
- where to send the result of proc
java.lang.Throwable
public java.lang.Object applyWithFocus(Procedure proc, java.lang.Object values) throws java.lang.Throwable
proc
- a 3-operand Procedure
as returned by
evalToFocusProc
values
- a sequence. The proc
is called once for each
item, with the item as the first argument, a 1-based index as the
second argument, and the sequence size as the third argument.proc
java.lang.Throwable
public void applyWithFocus$X(Procedure proc, java.lang.Object values, CallContext ctx) throws java.lang.Throwable
proc
- a 3-operand Procedure
as returned by
evalToFocusProc
values
- a sequence. The proc
is called once for each
item, with the item as the first argument, a 1-based index as the
second argument, and the sequence size as the third argument.ctx
- the CallContext
. The $X
in the
method name tells Kawa that this argument is implicit when invoked
from XQuery.java.lang.Throwable
public Procedure evalToFocusProc(java.lang.String expr) throws java.lang.Throwable
evalWithFocus
methods.expr
- an XQuery expression (query) to evaluatejava.lang.Throwable
public Procedure evalToFocusProc(java.io.Reader in, SourceMessages messages) throws java.lang.Throwable
Reader
that is the body of a procedure.
Helper method used by evalWithFocus
methods.in
- where we read the expression frommessages
- where to write syntax errorsjava.lang.Throwable
public void evalWithFocus(java.io.Reader in, SourceMessages messages, java.lang.Object values, Consumer out) throws java.lang.Throwable
in
- where we read the expression frommessages
- where to write syntax errorsvalues
- becomes the context sequence while
evaluating expr
.out
- where to send the result of the expressionjava.lang.Throwable
public java.lang.Object evalWithFocus(java.lang.String expr, java.lang.Object values) throws java.lang.Throwable
expr
- an XQuery expression (query) to evaluatevalues
- becomes the context sequence while
evaluating the expressionjava.lang.Throwable
public java.lang.Object evalWithFocus(java.lang.String expr, java.lang.Object item, int position, int size) throws java.lang.Throwable
expr
- an XQuery expression (query) to evaluateitem
- becomes the context item while evaluating expr
.position
- becomes the context positionsize
- becomes the context sizeexpr
java.lang.Throwable
public void evalWithFocus(java.io.Reader in, SourceMessages messages, java.lang.Object item, int position, int size, Consumer out) throws java.lang.Throwable
in
- where we read the expression frommessages
- where to write syntax errorsitem
- becomes the context item while evaluating the expressionposition
- becomes the context positionsize
- becomes the context sizeout
- where to send the result of the expressionjava.lang.Throwable
public void eval_with_focus$X(java.lang.String expr, java.lang.Object values, CallContext ctx) throws java.lang.Throwable
evalWithFocus(String, Object, Consumer)
.
The "$X" in the method name tells the Kawa compiler that the CallContext
argument is implicit, so it can be invoked from XQuery code thus:
XQuery:eval-with-focus($xquery, "expr", $sequence)
java.lang.Throwable
public void eval_with_focus$X(java.lang.String expr, java.lang.Object item, int position, int size, CallContext ctx) throws java.lang.Throwable
evalWithFocus(String, Object, int, int, Consumer)
.
The "$X" in the method name tells the Kawa compiler that the CallContext
argument is implicit, so it can be invoked from XQuery code thus:
XQuery:eval-with-focus($xquery, "expr", $item, $pos, $size)
java.lang.Throwable
public static XQuery getInstance()
public static void registerEnvironment()
public Consumer getOutputConsumer(java.io.Writer out)
getOutputConsumer
in class Language
public Type getStandardType(java.lang.String name)
public Type getTypeFor(java.lang.String name)
getTypeFor
in class Language
public java.lang.String formatType(Type type)
formatType
in class Language
public Type getTypeFor(java.lang.Class clas)
getTypeFor
in class Language
public java.lang.String getPrimaryPrompt()
getPrimaryPrompt
in class Language
public java.lang.String getSecondaryPrompt()
getSecondaryPrompt
in class Language
public static java.lang.String mangle(java.lang.String name)
public static java.lang.String makeClassName(java.lang.String source)
public static java.lang.Object getExternal(Symbol name, java.lang.Object type)