2005-10-18  Per Bothner  <per@bothner.com>

	* XQParser.java (parseMaybePrimaryExpr): Catch DFloNum
	parsing exception.

2005-10-06  Per Bothner  <per@bothner.com>

	* XQParser.java (parseMaybePrimaryExpr): For text and comment
	parse an ExprSequence, yielding a single argument.
	* XQParser.java (parseContent): Various tweaks to fix/improve
	handing of text content, including fixing whitespace insertion.

	* XQParser.java (parse): Set line number for 'external' variable.

	* XQParser.java (parseFLWRInner): Fix thinko in growing array.

	* XQParser.java (parseTypeSwitch): Number of parameters to LambdaExp
	for a case is 1, not 0.

	* XQResolveNames.java (push): If namespaceResolve returned null,
	skip this Declaration.

2005-09-26  Per Bothner  <per@bothner.com>

	* XQParser.java (parseFLWRExpression): Get next token after comma
	separating 'order by' specifiers.

2005-09-25  Per Bothner  <per@bothner.com>

	* XQParser.java: Re-do FLWOR parsing to handle 'order by'.
	(parseFLWRInner): New method.
	(parseFLWRExpression): Use parseFLWRInner.

	* XQParser.java (parseSortExpr): Remove obsolete method.
	(parseExp): Call parseExprSingle instead of parseSortExpr.

	* XQParser.java (parse): Move error for duplicate declare collation.

	* XQuery.java (initXQuery): Define 'reverse' function.

	* XQParser.java (parse): Fix 'declare variable' parse bug.

2005-08-22  Per Bothner  <per@bothner.com>

	* XQParser.java (parseNodeTest): Return ErrorExp if focus is
	undefined, to prevent confusion later, in XQResolveNames.

	* XQParser.java: Fix various places where we only accepted an
	ExprSingle rather than a (comma-separated) Expr.
	(parseStepQualifiers): Use parseExprSequence rather than parseExpr.
	(parseParenExpr): New method.
	(parseTypeSwitch, parseMaybePrimaryExpr, parseIfExpr):
	Use parseParenExpr.
	(parse): Handle DECLARE_BASE_URI_TOKEN - i.e 'declare base-uri'.

2005-08-18  Per Bothner  <per@bothner.com>

	* XQParser.java: Implement 'declare base-uri' statement.
	(vaseURI): New field.
	(parseURILiteral): New method.
	(parse): Use new method for both 'declare base-uri' and for
	'declare default collation' statements.
	* XQResolveNames.java (DOC_BUILTIN, DOC_AVAILABLE_BUILTIN): New values.
	(walkApplyExp): Handle new macros.
	* XQuery.java (initXQuery): Remove declarations for fn:doc and
	deprecated fn:document since now handled by XQResolveNames constructor.

2005-08-16  Per Bothner  <per@bothner.com>

	* XQResolveNames.java (NAMESPACE_URI_BUILTIN, DISTINCT_VALUES_BUILTIN,
	LOCAL_NAME_BUILTIN, ROOT_BUILTIN, COMPARE_BUILTIN): New constants.
	(positionDecl): Remove unneded static field.
	(pushBuiltin): New convenience method.
	(<init>): Push various builtin functions.
	(getCollator, withCollator, withContext): New methods.
	(walkApplyExp): Implement support for various xxx_BUILTIN functions.
	* XQuery.java (initXQuery): Remove declaration for fn:root, since
	it is now handled by XQResolveNames constructor.

	* XQuery.java (initXQuery): Declare prefix-from-QName.

2005-08-03  Per Bothner  <per@bothner.com>

	* XQResolveNames.java (flookup): Change to take single argument.
	(lookup): Merge/inline into walkReferenceExp.
	(walkReferenceExp): Call ClassMethodProc's makeExp rather than make.

	* XQuery.java (instance): Make final.
	(xqEnvironment): New final field.
	(initXQuery): New private method, called from static constructor.
	(<init>): Just set two fields.

2005-07-27  Per Bothner  <per@bothner.com>

	* XQParser.java (parse): Pass external variable's type to getExternal.
	Don't set IS_UNKNOWN.
	* XQuery.java (getExternal): Cast external value if type is specified
	as a number.

2005-07-21  Per Bothner  <per@bothner.com>

	* XQuery.java (<init>): Comment out unused variable.

	* XQuery.java (getExternal): New method.

	* XQParser.java (parse): Implement external variables.

2005-06-26  Per Bothner  <per@bothner.com>

	* XQParser.java (priority): Use a switch statement instead of a shift.
	Also fix some errors in the precedence hierarchy, compared to the
	current draft.
	(OP_OR...OP_INSTANCEOF): Re-order to be plain sequential.
	(OP_IDIV): New operator.
	(peekOperator): Use switch statement for presuambly better performance.
	Map 'idiv' to OP_IDIV.
	(makeBinary): Handle OP_IDIV.
	(parseBinaryExpr): Remove now-bogus test.

2005-06-04  Per Bothner  <per@bothner.com>

	* XQuery.java: Update for AbstractFormat move to gnu.lists.

	* XQuery.java (getFormat): Change return type.

2005-05-27  Per Bothner  <per@bothner.com>

	* XQuery.java (evalToFocusProc): Also set PARSE_IMMEDIATE flag.

2005-05-18  Per Bothner  <per@bothner.com>

	* XQResolveNames.java (lookup): Use new getLangEnvironment method.

2005-05-17  Per Bothner  <per@bothner.com>

	* XQuery.java (evalToFocusProc): Pass current Environment, rather than
	language Environment, to evalModule.

2005-03-16  Per Bothner  <per@bothner.com>

	* XQParser.java: Now extends Lexer rather than LispReader.
	(getReadTable): Remove unused method.
	(xqlReadTable): Remove unused field.

2005-03-07  Per Bothner  <per@bothner.com>

	* XQParser.java: Update Interpreter -> Language:
	* XQResolveNames.java: Likewise.

2005-03-03  Per Bothner  <per@bothner.com>

	* XQuery.java: Function 'children' has been moved.

2005-02-12  Per Bothner  <per@bothner.com>

	* XQuery.java: Use different SetExp constructor,
	to avoid setting the 'binding' field, which will become private.
	* XQResolveNames.java: Use SetExp's setBinding method.

2005-01-25  Per Bothner  <per@bothner.com>

	* XQuery.java (registerEnvironment): Update Interpreter -> Language.

	* XQuery.java: Put gnu.kawa.slib.HTTP function in qexo namespace.

2005-01-22  Per Bothner  <per@bothner.com>

	* XQuery.java: Inherit from Language instead of Interpreter.

	* XQuery.java (<init>): Declare functions from gnu.kawa.slib.HTTP.

	* XQParser.java (parseMaybePrimaryExpr): Fix column number handling.

2004-12-27  Per Bothner  <per@bothner.com>

	* XQParser.java (parseFunctionDefinition): Use new isStatic method.

2004-12-22  Per Bothner  <per@bothner.com>

	* XQParser.java (prologNamespaces): New field.
	(pushNamespace): Add to prologNamespaces.
	(parseNameSpec): Simplify, thanks to use of new SName type.
	(castQName): New helper method.
	(parseElementConstructor): Use MakeElement and MakeAttribute classes
	rather than ElementConstructor and AttributeConstructor.
	(parseMaybePrimaryExpr): Handle in-scope namespace nodes.
	* XQuery.java: Define fn:QName function and xs:QName type/cast.

	* XQResolveNames.java (walkApplyExp): Implement xs:Name cast.
	Update for changes to use MakeElement and MakeAttribute classes
	rather than ElementConstructor and AttributeConstructor.

	* XQParser.java (parsePrimaryExpr): If missing expression, call
	getRawToken to avoid the risk of an infinite loop.

	* XQParser.java (parser); Field renamed to comp.
	* XQuery.java (parse): Set resolver's parser field.

	* XQuery.java (SCHEMA_NAMESPACE): New constant.

2004-12-21  Per Bothner  <per@bothner.com>

	* XQuery.java (define_method): Set name of Procedure, for better
	error messages.

	* XQResolveNames (flookup): New helper method.
	(lookup): Use it.  Fix bug where 'fn:true()' wasn't found.

2004-12-12  Per Bothner  <per@bothner.com>

	* XQParser.java: Implement line/column and error handling.
	(curLine, curColumn): New fields.
	(getrawToken): Set curLine and curColumn.
	(skipOldComment, oldComment, getRawToken): Set position before error.
	(COLON_COLON_TOKEN): Change spelling.  Have getRawToken return it.
	(getAxis): New helper method.  Use it in peekOperand.
	(parseMaybePrimaryExpr):  Set startLine from curLine etc.
	(parseSeparator): Change so error refers to end of declaration.
	(error, syntaxError, tokenWidth): Remove and simplify.

2004-12-10  Per Bothner  <per@bothner.com>

	* XQParser.java: Implement 'declare default collation'.
	(warnOldVersion): Change to true. Add soem extra tests/warnings.
	(defaultCollator): New field.
	(skipToSemicolon, error, declError): New helper methods.
	(parseEnclosedExpr): Handle missing comma errors better.
	* XQuery.java(<init>): Declare fn:exists.  Update fn:empty.

2004-12-07  Per Bothner  <per@bothner.com>

	Update for new Symbol/Namespace handling.
	* XQParser.java (lookupNamespace, resolveQName): Removed methods.
	(parseName): Renamed to parseQName and noted as deprecated.
	(parseNameTest): Change return type.
	(parseNodeTest): Rewrite to use parseNameTest.
	* XQResolveNames.java (LASTBUILTIN, POSITION_BUILTIN): New constants.
	(lastDecl, positionDecl, functionNamespacePath): New static fields.
	(makeBuiltin, walkSetExp, procToDecl): New methods.
	(<init>): Push lastDecl and positionDecl.
	(namespaceResolve): Map classname prefix to a "class:" namespace.
	(push): Search NCName  in functionNamespacePath.
	(walkSetExp): New method.
	(walkApplyExp): Special handling of lastDecl and positionDecl.
	* XQuery.java (parse): Stash resolver in XQParser.
	(getSymbol): New method.
	(define, define_method): Update.
	(<init>): Update.  Use defProcStFld.
	For now, don't import most Kawa functions.

2004-11-16  Per Bothner  <per@bothner.com>

	* XQuery.java (XQuery): Use defProcStFld instead of define_field.

2004-11-06  Per Bothner  <per@bothner.com>

	* XQuery.java (<init>): Add definitions for local-name-from-QName,
	namespace-uri-from-QName, namespace-uri-for-prefix.

2004-08-11  Per Bothner  <per@bothner.com>

	* XQParser.java (DOT_VARNAME, POSITION_VARNAME, LAST_VARNAME):
	Change to uninterned Symbols.
	* XQResolveNames.java (push):  Warn about shadowing declarations.

2004-08-08  Per Bothner  <per@bothner.com>

	* XQuery.java (applyWithFocus, applyWithFocus$X, eval_with_focus$X):
	Use new check3 method.

2004-07-20  Per Bothner  <per@bothner.com>

	* XQParser.java:  Remove unused import statements.

2004-06-12  Per Bothner  <per@bothner.com>

	* XQParser.java (nesting, pushNesting, popNesting):  Moved to Lexer.

2004-05-29  Per Bothner  <per@bothner.com>

	* XQParser.java (getDelimited):  Reset tokenBufferLength.

	* XQParser.java (parseXMLConstructor):  Unread before PI content.

2004-05-28  Per Bothner  <per@bothner.com>

	* XQParser.java (parseContent):  Changes to fix space handling.
	* XQParser.java (parseXMLConstructor):  Use MakeCData for CDATA.
	Handle direct processing instruction constructor.

	* XQParser.java (parseMaybePrimaryExpr):  Update for TextConstructor
	being renamed to MakeText.

2004-05-08  Per Bothner  <per@bothner.com>

	* XQParser.java (OP_COMMENT, OP_PI, OP_DOCUMENT):  New token codes.
	(peekOperand):  Recognize these new token kinds.
	(getDelimited):  New method.
	(parseItemType):  Recognize comment and processing-instruction.
	(parseXMLConstructor):  New method.
	(parseContent, parseMaybePrimaryExpr):  Use parseXMLConstructor.
	(matchConstructorKeyword):  Recognize 'comment {'.
	(parseMaybePrimaryExpr):  Use CommentConstructor for 'comment {'.
	(commentNodeTest, piNodeTest):  New static NodeType fields.

2004-05-08  Per Bothner  <per@bothner.com>

	* XQuery.java (mangle):  Two new static methods - currently unused.

2004-03-09  Per Bothner  <per@bothner.com>

	* XQParser.java (parseItemTime):  Handle 'document-node()'.
	(documentNodeTest):  New constant.

	* XQParser.java (peekOperator):  Handle 'instance' like 'instanceof'.
	(parseBinaryExp):  Recognize 'instance' followed by 'of'.
	If warnOldVersion compain about 'instanceof'.

2004-01-09  Per Bothner  <per@bothner.com>

	* XQuery.java (registerEnvironment):  Update setCurrent to setGlobal.

2003-12-26  Per Bothner  <per@bothner.com>

	* XQParser.java (parseElementConstructor):  Set line/column for
	attribute.
	* XQResolveNames.java (maybeAddNamespace):  Avoid NullPointerException.
	(walkApplyExp):  Adjust column number if ElementConstructor.

	* XQResolveNames.java (walkReferenceExp):  Fix $request/$response
	handling.

2003-12-25  Per Bothner  <per@bothner.com>

	* XQParser.java (parseRelativePathExpr, parseFLWRExpression):  last(),
	position() and and 'for' 'at' index should be LangPrimType.intType,
	so arithmetic works as it should.

2003-12-25  Per Bothner  <per@bothner.com>

	Handle namespace declaration attributes.
	* XQResolveNames.java:  New class, extends gnu.expr.ResolveNames.
	* Makefile.am (java_sources):  Add XQResolveNames.java.
	* XQParser.java (lexical):  New field.
	(<init>):  New XQuery pamameter.  Allocate and set lexical field.
	(pushNamespace, lookupNamespace, makeNamespaceDecl):  New methods.
	(pushStandardNamespaces):  Use pushNamespace.
	(parseElementConstructor):  Recognize namespace declaration
	attributes.  Defer namespace resolution until XQResolveNames.
	Remove support here for calculated element/attribute names.
	(parseVariableDeclaration):  New method.
	(parseTypeSwitch, parseFLWRExpression, parseQuantifiedExpr,
	parseFunctionDefinition, parse):  Use parseVariableDeclaration.
	(namespaces):  Remove field.
	(namespaceBindings):  New field.
	(parse):  Don't checks for "$request" or $reply" (for servlets) here.
	Instead use ne XQResolveNames's new walkReferenceExp method.
	* XQuery.java (getLexer):  Use new XQParser constructor.
	(DEFAULT_ELEMENT_PREFIX, DEFAULT_FUNCTION_PREFIX):  New constants.
	(parse):  Use new Compilation constructor, passing it lexer's lexical.
	Do mustCompileHere after pushing ModuleExp, or it has no effect.
	Use new XQResolveNames constructor and new resolveModule method.
	(getNamespaceOf):  Also check if decl isNamespaceDecl.

	* XQuery.java (read):  Remove unused method.
	* XQParser.java (readObject):  Likewise.

2003-11-14  Per Bothner  <per@bothner.com>

	* XQuery.java (<init>):  New use StringValue.concat$V.

2003-11-09  Per Bothner  <per@bothner.com>

	* XQuery.java (PARSE_WITH_FOCUS):  New flag.
	(parse):  Check for PARSE_WITH_FOCUS.
	(applyWithFocus, applyWithFocus$X, evalToFocusProc, evalWithFocus,
	eval_with_focus$X):  New methods.

2003-11-08  Per Bothner  <per@bothner.com>

	* XQuery.java (parse):  Update to take a Lexer rather than an InPort.

2003-11-02  Per Bothner  <per@bothner.com>

	* XQParser.java (peekOperator):  Return if EOL_TOKEN and 0 nesting.
	This fixes parseUnionExpr and parseIntersectExceptExpr.
	(parseBinaryExpr):  Trivial tweak.

	* XQuery.java (parse, parseFile):  Combined to single 'parse' method.

2003-10-30  Per Bothner  <per@bothner.com>

	* XQuery.java (typeMap):  New static field.
	(getTypeFor):  Use typeMap for standard Schema types.

	* XQParser.java (IMPORT_SCHEMA_TOKEN):  New constant.
	(parse):  Report that 'import schema' is unimplemented.

2003-10-29  Per Bothner  <per@bothner.com>

	* XQParser.java (parse):  Use BeginExp.canonicalize(Expression[])).

2003-10-19  Per Bothner  <per@bothner.com>

	* XQuery.java (parse, parseFile):  Pass this to Compilation.

2003-10-16  Per Bothner  <per@bothner.com>

	* XQParser.java (peekOperator):  Recognize 'except' and 'intersect'.
	(makeBinary):  Handle OP_EXCEPT and OP_INTERSECT.
	(parseUnionExpr, parseIntersectExceptExpr):  Call peekOperator.

	* XQParser.java (parseExprSingle):  New method.
	Use it where appropriate.

	* XQParser.java (parseMaybePrimaryExpr):  Handle 'every' and 'some'.
	(parseQuantifiedExpr):  New method.

	* XQParser.java (setType):  New helper method
	(parseFLWRExpression):  Call parseOptionalTypeDeclaration and setType.
	(parseFLWRExpression):  Handle subsequence 'for/let' clauses.
	(parseFLWRExpression):  Detect 'order' and print "not implemented".

	* XQParser.java (tokenString):  New debug helper method.

2003-10-12  Per Bothner  <per@bothner.com>

	* XQParser.java (parse):  Use Compilation.mangleURI for namespaces
	of library module declaration and import.

2003-10-11  Per Bothner  <per@bothner.com>

	* XQParser.java (resolveQName, parserVariable):  New methods.
	(parseMaybePrimaryExpr):  Use parseVariable for '$' VarName.
	Set curToken before parseFLWRExpression.
	(parseFLWRExpression):  Use parseVariable.
	(parseFLWRExpression):  Use resolveQName and parseVariable.
	(parse):  For 'declare variable' use parseVariable.
	Check if 'local:' prefix and set privacy flag appropriately.
	(parseTypeSwitch):  Update typeswitch syntax - handling of 'as'.

2003-10-09  Per Bothner  <per@bothner.com>

	* XQParser.java	(parseFLWRExpression/3):  Inline into single caller.
	(parseFunctionDefinition):  make function static only if module is.
	* XQuery.java (parse, parseFile):  Revert change making modules static.

2003-10-08  Per Bothner  <per@bothner.com>

	* XQParser.java (peekOperator):  Handle ValueComp operators 'eq' ...
	by mapping them to GeneralComp operators '=' ... .

	* XQParser.java (parseUnaryExpr):  Provide implementation.

	* XQParser.java:  Initial support for modules.
	(IMPORT_MODULE_TOKEN, MODULE_NAMESPACE_TOKEN):  New constant.
	(peekOperand):  Recognize new compound tokens.
	(pushStandardNamespaces):  Define kawa and qexo prefixes.
	(parseMaybePrimaryExpr):  Better handling of function names.
	(parseFunctionDefinition):  Likewise.  Make functions static.
	'local' prefix sets private flag.
	(parse):  Recognize module declaration and module import.
	'declare function namespace' is now supported.
	(getRawToken):  Recognize ';'.
	* XQuery.java (KAWA_FUNCTION_NAMESPACE):  New constant.
	(parse):  XQuery modules are now static.
	(define, define_method):  New method overrides.
	(<init>):  Initialize qexo namespace.
	Don't define 'define'.

2003-09-28  Per Bothner  <per@bothner.com>

	* XQParser.java (getRawToken):  Add missing tokenBufferAppend.
	Fixes bug reported 09-28 by Weiqi Gao <weiqigao@networkusa.net>.

2003-09-18  Per Bothner  <per@bothner.com>

	* XQuery.java (<init>):  Add root function.
	* XQParser.java (parsePathExpr):  Handle non-relative path expressions.
	(parseRelativePathExpr):  Caller now does the parseStepExpr.
	* XQParser.java:  Add import of ClassType.

2003-09-14  Per Bothner  <per@bothner.com>

	* XQParser.java (parseNodeTest):  Support other axes.

	* XQParser.java (funcNamedChildren, funcNamedDescendants,
	funcNamedDescendantsOrSelf):  Remove no-longer-used static fields.

2003-09-11  Per Bothner  <per@bothner.com>

	* XQParser.java (skipSpaceOrComment):  Rename to skipSpace, taking
	an extra argument to indicate skipping past new line.
	(parseFLWRExpression):  Use renamed skipSpace.
	(skipSpace):  Use new skipSpace(true).
	(skipHSpace):  Replaced by skipSpace(false).
	(peekNonSpace, peekOperand, parseMaybePrimaryExpr, parse):
	Use new unary skipSpace.
	(parseSeparator):  Provide implementation.
	(parse):  Add missing parseSeparator calls.
	(parse):  Update to new xmlspace syntax.

2003-09-10  Per Bothner  <per@bothner.com>

	* XQParser.java (warnOldVersion):  New static variable.
	(DEFINE_FUNCTION_TOKEN):  Rename to DEFINE_VARIABLE_TOKEN.
	(DECLARE_FUNCTION_TOKEN):  Rename to DECLARE_VARIABLE_TOKEN.
	(peekOperand):  Recognize <declare function> amd <declare variable>.
	Also recognize (and if warnOldVersion warn) the <define ...> syntax.
	(parse):  Update to handle new syntax as well as old syntax.

	* XQParser.java (DOT_VARNAME, POSITION_VARNAME, LAST_VARNAME):  Change
	values to names don't need to be mangled.

	* XQParser.java (pushStandardNamespaces):  Define 'local' prefix.

	* XQParser.java (parseNodeTest, parseRelativePathExpr):  Simplify
	using ApplyExp constructor that takes a method or Procedure..

	* XQParser.java (parseMaybePrimaryExpr):  Do syntaxError instead of
	throw on syntax confusion.

	* XQParser.java (parseFLWRExpression):  Re-organize methods so we
	can parse and handle 'at' clause.

2003-09-04  Per Bothner  <per@bothner.com>

	* XQuery.java (parse, parseFile):  Change defaultCallConvention
	to new CALL_WITH_CONSUMER.

2003-08-03  Per Bothner  <per@bothner.com>

	* XQParser.java (parseNodeTest):  Handle self:: and parent:: axies.
	(parseNodeTest):  Handle '.' and '..' abbreviated steps.

	* XQParser.java (focusDefined):  Remove field.  Instead, just check
	whether DOT_VARNAME is in scope.
	(parseRelativePathExpr, parseStepQualifiers,
	parseFunctionDefinition):  Don't set/unset focusDefined.
	(DOT_VARNAME, POSITION_VARNAME, LAST_VARNAME):  New constants.
	(parseNodeTest):  Look for DOT_VARNAME to see if context is defined.
	(parseCheckNodeTest):  Remove - just use parseNodeTest directly.
	(parseMaybePrimaryExpr):  Re-write position() and last() to
	RerefenceExps using POSITION_VARNAME and LAST_VARNAME.
	(parseNodeTest):  Use new xxxAxis classes.
	(parseRelativePathExpr):  Second expression is now a 3-argument
	LambdaExp.  Pass it DOT_VARNAME, POSITION_VARNAME, and LAST_VARNAME.
	Handle '//' now exactly as specified in standard.
	Comment out some optimizations for now.
	Use new RelativeStep class instead of ValuesMap.
	(parseStepQualifiers):  Pass axis parameter, since handling of
	qualifiers depends on type of axis (forward, reverse, or none).
	Second expression is also now a 3-argument LambdaExp.
	Pass it DOT_VARNAME, POSITION_VARNAME, and LAST_VARNAME.

	* XQuery.java (<init>):  Don't define position() - it is now
	re-written at parse time to POSITION_VARNAME.

2003-08-01  Per Bothner  <per@bothner.com>

	* XQuery.java (XQUERY_FUNCTION_NAMESPACE):  Update URL.

	* XQParser.java (peekOperator):  Map 'union' to OP_UNION.
	(makeBinary):  Implement OP_UNION using UnionNodes class.

	* XQParserjava (makeBinary):  Return syntaxError if unimplemented op.
	Updates throws specifier to allow this.

	* XQParser.java (preserveBoundarySpace):  New field.
	(DECLARE_XMLSPACE_TOKEN):  New constant.
	(peekOperand):  Map 'declare' 'xmlspace' to DECLARE_XMLSPACE_TOKEN.
	(parseContent):  Skip boundary whitespace if appropriate.
	(parse):  Parse xmlspace declaration.

	* XQParser.java (parseFunctionDefinition):  Handle optional return
	type declaration using Convert.setCoercedReturnValue.

2003-07-26  Per Bothner  <per@bothner.com>

	* XQuery.java (<init>):  Add distinct-nodes function.

2003-07-23  Terje Pedersen  <terje@brassforum.com>

	* XQuery.java (<init>):  Define string-length, substring-before,
	substring-after, translate, string-pad, contains, starts-with,
	ends-with, string-join):  New standard functions.

2003-07-23  Per Bothner  <per@bothner.com>

	* XQParser.java (OP_IS, OP_ISNOT, OP_GRTGRT, OP_LSSLSS):  New tokens.
	(OP_xxx):  Renumber, at least for now.
	(getRawToken):  Recognize '>>' as OP_GRTGRT and '<<' as OP_LSSLSS.
	(peekOperator):  Recognis 'is' and 'isnot'.
	(makeBinary):  Handle new tokens.

	* XQParser.java (parseMaybePrimaryExpr):  Intern string literal.

2003-07-17  Per Bothner  <per@bothner.com>

	* XQParser.java (matchConstructorKeyword):  Fix bug reported
	07-17 by Craig.Munday@ecard.com.au.

2003-07-10  Per Bothner  <per@bothner.com>

	* XQParser.java (matchConstructorKeyword):  Add extra unread/read
	pair, in case 'next' is the only character of a name.

2003-06-27  Per Bothner  <per@bothner.com>

	* XQParser.java (XQParser):  Error handling improvements:  Better
	messages, plus special case for 'define QName ('.

2003-06-05  Per Bothner  <per@bothner.com>

	* XQuery.java (Prompter.apply1):  Prettier prompt format.

2003-05-31  Per Bothner  <per@bothner.com>

	* XQuery.java (getOutputConsumer):  Update return type.

2003-05-30  Per Bothner  <per@bothner.com>

	* XQParser.java (DEFINE_VARIABLE_TOKEN): New token constant.
	(peekOperand):  Recognize 'define variable'.
	(parse):  Handle DEFINE_VARIABLE_TOKEN.

2003-05-13  Per Bothner  <per@bothner.com>

	* XQParser.java:  Handle new KindType syntax of May '03 draft.
	(parseSimpleKindType, warnOldStyleKindTest. parseItemtype):  New.
	(parseElementType):  Handle new syntax.
	(parseDataType):  Handle new syntax.  Use OccurrenceType.

2003-05-10  Per Bothner  <per@bothner.com>

	* XQParser.java (checkNext):  Moved to Lexer, and made public.

	* XQParser.java (getrawToken):  In string literals, handle
	character and entity references, and doubled delimters.
	(appendNamedEntity):  Removed StringBuffer parameter; write to
	tokenBuffer instead.
	(parseEntityOrCharRef):  New method.
	(parseContent):  Use tokenBuffer instead of a new StringBuffer.
	Handle double-quated attributes delimiters.  Use parseEntityOrCharRef.

2003-05-08  Per Bothner  <per@bothner.com>

	* XQParser.java (skipComment):  Now handles (:new-style:) comments.
	(skipOldComment):  New method to handle {--old-style--} comments.
	(skipSpaceOrComment, getRawToken):  Handle either style of comment.
	(peekOperand): A NAME '(' followed by ':' is not an FNAME.
	* XQuery.java (Prompter.apply1):  Use new-style comment syntax.

	* XQParser.java (COLON_EQUAL_TOKEN):  New constant.
	(getRawToken):  If ':' is followed by '=' return COLON_EQUAL_TOKEN.
	If NCNAME ':' is followed by '=' return NCNAME_TOKEN, and back up.
	(parseFLWRExpression):  No need to check for NCNAME_COLON_TOKEN.

	* XQParser.java (parseEnclosedExpr):  More error-tolerant parsing.
	(parseIfExp):  Recover from missing 'then' or 'else'.
	(parseFLWRExpression):  Recover from ':=' / 'in' confusion.

	* XQuery.java (<init>):  Allow 'doc' as synonym for 'document'.
	New 'trace' method.

2003-04-21  Per Bothner  <per@bothner.com>

	* XQuery.java (parse, parseFile):  Do ResolveNames.
	* XQParser.java (parseMaybePrimaryExpr):  Remove now-redundant
	function-name lookup; the rewriteToInvocation call appears redundant
	given following Inlinecalls.

2003-04-19  Per Bothner  <per@bothner.com>

	* XQParser.java:  Update to use NameLookup.
	(parseStepQualifiers):  Defer NameLookup's push after addDeclaration.
	(parseFunctionDefinition):  Explicitly push declarations.

2003-04-18  Per Bothner  <per@bothner.com>

	* XQParser.java (mark, reset):  New methods.
	(matchConstructorKeyword):  Now handles context dependency correctly,
	parsing ahead using mark and reset if needed.
	(parseMaybePrimaryExpr):  Let matchConstructorKeyword check context.

2003-03-29  Per Bothner  <per@bothner.com>

	* XQParser.java (interpreter):  New field.
	* XQuery.java (getLexer):  Set XQParser's interpreter field.

	* XQuery.java (<init>):  Define lower-case, upper-case, substring.

	* XQuery.java (getTypeFor):  Handle type "string".
	* XQParser.java (parseDataType):  Use getTypeFor.

2003-03-15  Per Bothner  <per@bothner.com>

	* XQParser.java (parseElementConstructor):  The default namespace
	for an attribute is "", not null.

	* XQParser.java (parseNameSpec):  Don't bother passing the
	defaultNamespaceUri to parseNameTest as it isn't used.

2003-03-04  Per Bothner  <per@bothner.com>

	* XQParser.java (<init>):  New function node-name.

	* XQParser.java (matchConstructorKeyword):  New helper method.
	(parseMaybePrimaryExpr):  Implement computed constructors.

2003-03-02  Per Bothner  <per@bothner.com>

	* XQuery.java (<init>):  BaseUri moved to gnu.kawa.functions.

2003-02-26  Per Bothner  <per@bothner.com>

	* XQuery.java (<init>):  Explicitly specify field names for
	iterator-items and list-items.

2003-02-20  Per Bothner  <per@bothner.com>

	* XQParser.java (parseMaybePrimaryExpr):  Servlet handling of $request
	and $response even if Compilation.generateServletDefault isn't set.

2003-02-13  Per Bothner  <per@bothner.com>

	* XQuery.java (<init>):  Define base-uri function.

2003-02-11  Per Bothner  <per@bothner.com>

	* XQuery.java (getInstance): Move save/restore of current Environment
	from here ...
	(<init>):  .. to here.
	(registerEnvironment):  Add call to Environment.setCurrent.

2003-01-12  Per Bothner  <per@bothner.com>

	* XQuery.java (Prompter.apply1): Always emit readState character.
	* XQParser.java (pushNesting, popNesting):  New methods.
	(getRawRoken):  Push/pop nesting around string literal.
	(parseBinaryExpr):  Push/pop nesting around binary operator.
	(parseEnclosedExpr, parseTypeSwitch, parseMaybePrimaryExpr,
	parseIfExpr, parseFLWRExpression, parse):  Call pushNesting/popNesting.
	(parseElementConstructor):  Remove increment/decrement of nesting here.
	(syntaxError):  Read port's readState.

	* XQParser.java (syntaxError):  New overload takes paramter indicating
	number of columns to subtract from current position.
	(tokenWidth):  Return number of chars taken by curToken,
	(syntaxError):  Call tokenWidth.

	* XQParser.java (getRawRoken): Use syntaxError rather than error
	on seeing unrecognized character.

	* XQParser.java (parseMaybePrimaryExpr):  Do setProcedureName
	on function name in call.

	* XQParser,java (parseExprSequence):  Take new rightToken parameter
	so we can emit error on un-matched ')'.

	* XQParser.java (pushStandardNamespaces):  New method.
	(<init>(InPort)):  Call <init>(InPort,SourceMessages).
	(<init>(InPort,SourceMessage):  Call pushStandardNamespaces.

	* XQParser.java (parseOptionalTypeDeclaration):  New method.
	(parseDataType):  Make ClassType if unrecognized type name.
	(parseFunctionDefinition):  Call parseOptionalTypeDeclaration.

	* XQParser.java (parseFLWRExpression):  Remove unused sc local.

2002-11-23  Per Bothner  <per@bothner.com>

	* XQuery.java (<init>):  Declare iterator-items and list-items.

2002-11-20  Per Bothner  <bothner@bothner.com>

	* XQparser.java (parseMaybePrimaryExpr):  Check if function names
	a method invocation.

	* XQuery.java (<init>):  Recover from missing servlet classes.

2002-11-16  Per Bothner  <per@bothner.com>

	* XQParser.java (parseFunctionDefinition):  Parse QName function name.

	* XQParser.java, XQuery.java:  Use gnu.mapping.Symbol instead of
	gnu.xml.QName.

	* XQuery.java (XQUERY_FUNCTION_NAMESPACE):  New constant.
	* XQParser.java (defaultFunctionNamespace):  New field.
	(defaultNamespace):  Rename field to defaultElementNamespace.

2002-11-10  Per Bothner  <per@bothner.com>

	* XQParser.java (focusDefined):  New field.
	(parseCheckNodeTest):  New method, checks focusDefined.
	(parseStepExpr, parseMaybePrimaryExpr):  Call parseCheckNodeTest.
	(parseFunctionDefinition):  Clear and restore focusDefined.
	(parseRelativePathExpr, parseStepQualifiers):  Set focusDefined.

2002-11-05  Per Bothner  <per@bothner.com>

	* XQuery.java (parseFile): Take and use new 'immediate' parameter.

2002-10-22  Per Bothner  <per@bothner.com>

	* XQParser.java (DEFINE_TOKEN):  Remove constant.
	(DECLARE_NAMESPACE_TOKEN, DEFAULT_ELEMENT_TOKEN,
	DEFAULT_FUNCTION_TOKEN, DEFINE_FUNCTION_TOKEN):  New constants.
	(lookingAt):  New helper method to handle double-lexeme tokens.
	(peekOperand):  Use lookingAt.
	(parse):  Handle new tokens - and updated syntax.
	Warn about old syntax.

2002-07-28  Per Bothner  <per@bothner.com>

	* XQParser.java (parseDataType):  Handle 'text' and 'node'.
	(anyNodeTest, textNodeTest):  New static fields.
	(parseNodeTest):  Use anyNodeTest and textNodeTest.

2002-07-24  Per Bothner  <per@bothner.com>

	* XQuery.java (parse, parseFile0:  Update for Interpreter changed API.
	* XQParser.java (parser, parser):  Update Parser -> Compilation.

2002-07-02  Per Bothner  <per@bothner.com>

	* XQuery.java (<init>):  Define "index-of" and "last-index-of".

2002-06-26  Per Bothner  <per@bothner.com>

	* XQParser.java (parseFLWRExpression):  Add missing parser.pop.

2002-06-10  Per Bothner  <per@bothner.com>

	* XQParser.java (parseNodeTest):  Support descdendant-or-self axis.

2002-05-28  Per Bothner  <per@bothner.com>

	* XQuery.java (Prompter.appl1):  State-dependent comment syntax.
	* XQParser.java (parseMaybePrimaryExpr):  Change state around call to
	parseElementConstructor, so we get appropriate prompt syntax.

	* XQParser.java (parseFLWRExpression):  Increment/decrement nesting,
	around where expression, to force reading past eol.

2002-05-18  Per Bothner  <per@bothner.com>

	* XQuery.java (<init>):  Also load XStrings.

	* XQParser.java (skipSpaceOrComment):  New method.
	(peekNonSpace):  Call skipSpaceOrComment instead of skipSpace.
	(parseFLWRExpression):  Likewise.

2002-05-06  Per Bothner  <per@bothner.com>

	* XQuery.java (parseFile):  Remove unused variable.

	* XQParser.java (stringValue, booleanValue):  Make public.

	* XQParser.java (parseFLWRExpression):  Fix typo "let" -> "for".

2002-04-19  Per Bothner  <per@bothner.com>

	* XQuery.java (<init>):  Define "avg" and "sum".

2002-04-18  Per Bothner  <per@bothner.com>

	* XQParser.java (booleanValue):  New method.
	(parseBinaryExpr, parseIfExpr, parseFLWRExpression):
	Call booleanValue.

	* XQuery.java (isTrue):  New method.

2002-04-08  Per Bothner  <per@bothner.com>

	* XQParser.java (OP_NODE, OP_TEXT):  New constants.
	(peekOperand):  Check for "node(" and "text(".

	* XQParser.java (parseBinaryExpr):  Handle OP_OR.

	* XQParser.java (parseNodeTest):  Merge overloaded methods.
	Process OP_NODE and OP_TEXT.
	(parseMaybePrimaryExpr):  Process OP_NODE and OP_TEXT.

2002-03-07  Per Bothner  <per@bothner.com>

	* XQParser.java (parseNodeTest):  NamedChildren and NamedDescendant
	now take a single ElementType, not a namespace+localname pair.
	(parseRelativePathExpr):  Handle // followed by name and predicates.

	* XQuery.java (<init>):  Declare min, max, and position.

2002-03-02  Per Bothner  <per@bothner.com>

	* XQuery.java (parseFile):  Now throws IOException and SyntaxException.

	* XQuery.java (<init>):  HTTP module moved to slib package.

2002-02-16  Per Bothner  <per@bothner.com>

	* XQuery.java (<init>):  Don't print error if library class not found.

2002-02-05  Per Bothner  <per@bothner.com>

	* XQParser.java (parseNodeTest):  Take axis parameter.
	Handle child::, attribute::NAME, and descendant::NAME; else error.
	(parseRelativePathExpr):  Handle EXPR//NAME.
	(parseStepExpr):  Pass axis to parseNodeTest.

	* XQParser.java (parseFLWRExpression):  Allow ellding of 'return'
	if body is another 'let' or 'for'.

2002-01-31  Per Bothner  <per@bothner.com>

	* XQuery (<init>):  Also do loadClass of gnu.kawa.servlet.HTTP.

2002-01-29  Per Bothner  <per@bothner.com>

	* XQParser.java (stringValue):  New method.
	(parseContent, parseElementConstructor):  Coerce attributes to string.

	* XQuery.java (defineAll, loadClass):  Moved to Interpreter, and
	make non-static.
	(<init>):  Update to no longer explicitly pass environ to loadClass.

2002-01-24  Per Bothner  <per@bothner.com>

	* XQParser.java (parseElementConstructor):  Handle ATTR={EXPR} syntax.

2002-01-23  Per Bothner  <per@bothner.com>

	* XQParser.java (interactive): Moved to super-class Lexer.
	(<init>):  Don't aet interactive - let Shell do it instead.

	* XQParser.java (makeExprSequence):  AppendValues has moved.

2002-01-21  Per Bothner  <per@bothner.com>

	* XQuery.java (<init>):  Update for moved of class Document.
	Add definition for "unescaped-data".

2002-01-19  Per Bothner  <per@bothner.com>

	* XQuery.java:  Update for move of WriteTo class.

2002-01-13  Per Bothner  <per@bothner.com>

	* XQParser.java (parse):  Skip initial Unix script header #!/PROGRAM.

2002-01-07  Per Bothner  <per@bothner.com>

	* XQParser.java (parseContent):  Handle '{{' and '}}'.

2002-01-02  Per Bothner  <per@bothner.com>

	* XQuery.java (<init>):  Define 'number' and 'concat'.

2001-12-24  Per Bothner  <per@bothner.com>

	* XQuery.java (<init>):  Add new pre-defined functions.

	* XQParser.java: Add support for XQuery comments.
	(skipComment):  New method.
	(getRawToken):  Check for and skip comments.

	* XQParser.java (parseDataType):  Parse 'element' type.
	(parseElementType):  New method.

	* XQParser.java (parseTypeSwitch):  New method handle 'typeswitch'.
	(parseMaybePrimaryExpr):  Call it.

	* XQParser.java:  Fix parsing for 'where' in FLWR-expression.
	(OP_WHERE):  New constant.
	(peekOperator):  Recognize 'where'.
	(parseFLWRExpression):  Fix handling of 'where'.

	* XQParser.java (parseContent):  Handle char references.
	(appendNamedEntity):  New method to resolve char references.

	& XQParser.java (parseElementConstructor):  Handle abbreviated element.

	* XQParser.java:  Use case-sentive matching for keywords etc.
	* XQParser.java:  Use LambdaExp constructor taking a parameter count.

2001-11-24  Per Bothner  <per@bothner.com>

	* XQParser.java:  Set line number information various places.

	* XQParser.java (parseStepQualifiers, parseRelativePathExpr,
	parseFLWRExpression):  Add various optimizations.

2001-11-18  Per Bothner  <per@bothner.com>

	* XQParser.java:  Many changes to add line-and-column to expressions.
	(peekNonSpace):  New method.

	* XQParser.java (parseMaybePrimaryExpr):  Special handling for
	$request and $response.

	* XQuery.java (<init>):  Force Compilation.usingTailCalls to true.

2001-11-12  Per Bothner  <per@bothner.com>

	* XQParser.java:  Handle namespaces better.
	(NCNAME_COLON_TOKEN):  New token kind - NCNAME followed by ':'.
	(getrawtoken):  Improve parsing - can return NCNAME_COLON_TOKEN.
	(peekOperand):  Handle NCNAME_COLON_TOKEN.
	(parseNameTest):  New method.
	(parse):  Handle namespace declarations.

2001-11-06  Per Bothner  <per@bothner.com>

	* XQParser.java (interactive):  New flag.
	(syntaxError):  If interactive, skip to eol and throw SYnatxException

	* XQParser.java (makeBinary):  Redefine comparisons to use
	gnu.xquery.util.Compare, with new support for '=' and '!='.

	* XQuery.java:  Implement XQuery string using String, not FString.

	* XQPsrser.java (parseElementConstructor):  Better parsing of end tags.
	Handle end tag immediately followed by '=', not reading it as '>='.
	Complain if end tag name doesn't match start tag.
	(parseExprSequence):  Return syntaxError instead of throing Error.

	* XQuery.java (<init>):  Define "string" function.

2001-11-01  Per Bothner  <per@bothner.com>

	* XQParser.java (peekOperand):  Don't unread after EOF.

	* XQParser.java (parseNodeTest):  New method.
	(parseRelativePathExpr):  Don't check node-tests here.
	(parseStepQualifiers):  New method.
	(parseMaybePrimaryExpr):  Now handles node tests.

	* XQParser.java (parseMaybePrimaryExpr):  Fix indexes when checking
	for "let" or "for".

	* XQuery.java (<init>):  Define "true" and "false".

2001-10-17  Per Bothner  <per@bothner.com>

	* XQParser.java (parseRelativePathExpr):  Handle PATH/*, PATH/@ATTR,
	PATH/ATTR.  Update for changed/moved implementation.
	(parseNameSpec):  Intern name.

2001-10-02  Per Bothner  <per@bothner.com>

	* XQuery.java (parseFile):  Handle multiple top-level "statements".

	* XQuery.java (getNamespaceOf):  New method.

	* XQuery.java (<init>):  Define function "empty".

	* XQuery.java (registerEnvironment):  Explicitly setting current
	Environment is redundant, so don't.

	* XQParser.java (DEFINE_TOKEN):  New constant.
	(peekOperand):  Recognize 'define'.
	(parseMaybePrimaryExpr):  Search for matching function Declaration.
	(parseFunctionDefinition):  New method.
	(parse):  Handle 'define function'.

2001-09-29  Per Bothner  <per@bothner.com>

	* XQParser.java (parseContent):  Use Vector's 'addElement' method
	instead of 'add', for JDK 1.1.x compatibility.

2001-09-25  Per Bothner  <per@bothner.com>

	* XQParser.java (parseExprSequence):  New method.
	(parseMaybePrimaryExpr):  Call parseExprSequence after '('.
	(parse):  Call parseExprSequence.

2001-09-24  Per Bothner  <per@bothner.com>

	* XQParser.java (OP_INSTANCEOF, OP_RANGE_TO):  New constants.
	(instanceOf):  New static field.
	(peekOperator):  Map 'to', 'mul' and 'instanceof'.
	(peekOperand):  Special case for 'if' followed by '('.
	(makeFunctionExp):  Add overloads.
	(makeBinary):  Add implementations for OP_MUL, OP_DIV, OP_MOD,
	OP_LSS. OP_LEQ, OP_GRT, OP_GEQ and OP_RANGE_TO.
	(parseDataType):  New method.
	(parseBinarOp):  Special case for OP_INSTANCEOF and OP_AND.
	(parseMaybePrimaryExpr):  Handle 'if' expressions.
	(parseIfExpr):  New method.
	(parseFLWRExpression):  Call parseExpr instead of parsePrimaryExpr.

2001-08-16  Per Bothner  <per@bothner.com>

	* XQParser.java (FNAME_TOKEN):  New constant.
	(peekOperand):  Check for FuncName here.
	(parseMaybePrimaryExpr):  This we no longer check for FuncName here.
	Instead, we recognize FNAME_TOKEN.

	* XQParser.java (makeBinary):  Make static.
	(makeExprSequence):  New static helper method.
	(parseBinaryExpr):  Return on unexpected '</'.
	(parseRelativePathExpr):  Handle EXP/name.
	(parseContent):  Add missing getRawToken.
	(parseEnclosedExpr):  Handle an ExprSequence.
	(parseMaybePrimaryExpr):  Use makeExprSequence.
	Add explicit check for eof.
	Emit error message if we saw '</'.

	* XQParser.java (parseFLWRExpression):  Re-write to make 'for' work.
	* XQuery.java (parse):  Lexer's parse methods return null on eof.
	(<init>): Define new function string-value.

	* XQuery.java (<init>):  Set flag so module body will print values.
	(registerEnvironment): No longer need to do so here.

2001-07-18  Per Bothner  <per@bothner.com>

	New package gnu.xquery.lang.
	* XQuery.java:  New class, extends Interpreter.
	* XQParser.java:  New class, extends LispReader (for now).

