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).

