From vxquery-dev-returncrystalalvarado@example.com Fri Feb 05 22:41:31 2010 Return-Path: <vxquery-dev-returncrystalalvarado@example.com> Delivered-To: crystalalvarado@example.com Received: (qmail 45910 invoked from network); 5 Feb 2010 22:41:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 5 Feb 2010 22:41:31 -0000 Received: (qmail 10888 invoked by uid 500); 5 Feb 2010 22:41:31 -0000 Delivered-To: crystalalvarado@example.com Received: (qmail 10875 invoked by uid 500); 5 Feb 2010 22:41:31 -0000 Mailing-List: contact crystalalvarado@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:crystalalvarado@example.com> List-Unsubscribe: <mailto:crystalalvarado@example.com> List-Post: <mailto:crystalalvarado@example.com> List-Id: <vxquery-dev.incubator.apache.org> Reply-To: crystalalvarado@example.com Delivered-To: mailing list crystalalvarado@example.com Received: (qmail 10850 invoked by uid 99); 5 Feb 2010 22:41:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Feb 2010 22:41:31 +0000 X-ASF-Spam-Status: No, hits=1.8 required=10.0 tests=MIME_QP_LONG_LINE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [83.161.120.155] (HELO mail.gmx.net) (83.161.120.155) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 05 Feb 2010 22:41:23 +0000 Received: (qmail invoked by alias); 05 Feb 2010 22:40:59 -0000 Received: from HSI-KBW-078-042-088-187.hsi3.kabel-badenwuerttemberg.de (EHLO [83.161.120.155]) [83.161.120.155] by mail.gmx.net (mp007) with SMTP; 05 Feb 2010 23:40:59 +0100 X-Authenticated: #651556 X-Provags-ID: V01U2FsdGVkX19BVbo61ohBobQ3jchWN4c6ae2zRtL8T6M/mgmA+O r6/uq4mbUF8Ds5 Subject: Re: svn commit: r906965 [1/3] - in /incubator/vxquery/trunk/vxquery/src: main/java/org/apache/vxquery/api/ main/java/org/apache/vxquery/compiler/expression/ main/java/org/apache/vxquery/compiler/rewriter/ main/java/org/apache/vxquery/compiler/rewriter/fram... Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=us-ascii From: Till Westmann <crystalalvarado@example.com> In-Reply-To: <crystalalvarado@example.com> Date: Fri, 5 Feb 2010 23:40:58 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <crystalalvarado@example.com> References: <crystalalvarado@example.com> To: crystalalvarado@example.com X-Mailer: Apple Mail (2.1077) X-Y-GMX-Trusted: 0 X-FuHaFi: 0.46000000000000002 Very nice, one submission and we've got an optimizer :) It seems that we got rid of the OOM in the XQTS with these = optimizations. Is that right? Thanks, Till On Feb 5, 2010, at 4:19 PM, crystalalvarado@example.com wrote: > Author: vinayakb > Date: Fri Feb 5 15:19:44 2010 > New Revision: 906965 >=20 > URL: http://svn.apache.org/viewvc?rev=3D906965&view=3Drev > Log: > Added optimization. >=20 > Added: > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/MutableExpressionVisitor.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= rewriter/ > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= rewriter/framework/ > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= rewriter/framework/AbstractRewriteRule.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= rewriter/framework/RewriteRule.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= rewriter/framework/RulesetDriver.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= rewriter/framework/RulesetProvider.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= rewriter/rules/ > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= rewriter/rules/EliminateIfThenElseDeadCode.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= rewriter/rules/EliminateUnusedLetVariables.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= rewriter/rules/EvaluateInvariantInstanceofExpressions.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= rewriter/rulesets/ > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= rewriter/rulesets/DefaultRulesetProviderImpl.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= tools/ExpressionTypeInferringVisitor.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= tools/FreeVariableMaintainer.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/xmlquery/= query/XMLQueryOptimizer.java > Modified: > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/api/Inter= nalAPI.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/AttributeNodeConstructorExpression.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/CastExpression.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/CastableExpression.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/CommentNodeConstructorExpression.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/ConstantExpression.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/DocumentNodeConstructorExpression.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/ElementNodeConstructorExpression.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/ElementOrAttributeNodeConstructorExpression.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/Expression.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/ExpressionHandle.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/ExpressionPrinter.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/ExtensionExpression.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/FLWORExpression.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/ForLetVariable.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/FunctionCallExpression.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/IfThenElseExpression.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/InstanceofExpression.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/PINodeConstructorExpression.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/PathStepExpression.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/PromoteExpression.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/QuantifiedExpression.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/TextNodeConstructorExpression.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/TreatExpression.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/TypeExpression.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/TypeswitchExpression.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/ValidateExpression.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/VariableReferenceExpression.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= tools/ExpressionUtils.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= tools/FreeVariableFinder.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/drivers/V= XQuery.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/functions= /UserDefinedXQueryFunction.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/Typ= eOperations.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/xmlquery/= query/Module.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/xmlquery/= query/NoopXQueryCompilationListener.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/xmlquery/= query/XMLQueryCodeGenerator.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/xmlquery/= query/XMLQueryCompiler.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/xmlquery/= query/XMLQueryTranslator.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/xmlquery/= query/XMLQueryTypeChecker.java > = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/xmlquery/= query/XQueryCompilationListener.java > = incubator/vxquery/trunk/vxquery/src/test/java/org/apache/vxquery/xmlquery/= query/SimpleXQueryTest.java > = incubator/vxquery/trunk/vxquery/src/test/java/org/apache/vxquery/xtest/Tes= tRunnerFactory.java > = incubator/vxquery/trunk/vxquery/src/test/java/org/apache/vxquery/xtest/XTe= stOptions.java >=20 > Modified: = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/api/Inter= nalAPI.java > URL: = http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/src/main/java= /org/apache/vxquery/api/InternalAPI.java?rev=3D906965&r1=3D906964&r2=3D906= 965&view=3Ddiff > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/api/Inter= nalAPI.java (original) > +++ = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/api/Inter= nalAPI.java Fri Feb 5 15:19:44 2010 > @@ -1,13 +1,11 @@ > /* > * Licensed to the Apache Software Foundation (ASF) under one or more > - * contributor license agreements. See the NOTICE file distributed = with > + * contributor license agreements. See the NOTICE file distributed = with > * this work for additional information regarding copyright ownership. > * The ASF licenses this file to You under the Apache License, Version = 2.0 > * (the "License"); you may not use this file except in compliance = with > - * the License. You may obtain a copy of the License at > - * > - * http://www.apache.org/licenses/LICENSE-2.0 > - * > + * the License. You may obtain a copy of the License at > + * http://www.apache.org/licenses/LICENSE-2.0 > * Unless required by applicable law or agreed to in writing, software > * distributed under the License is distributed on an "AS IS" BASIS, > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or = implied. > @@ -61,8 +59,9 @@ > return XMLQueryParser.parse(name, query); > } >=20 > - public Module compile(XQueryCompilationListener listener, = ModuleNode ast) throws SystemException { > - return XMLQueryCompiler.compile(listener, ast, ccb); > + public Module compile(XQueryCompilationListener listener, = ModuleNode ast, int optimizationLevel) > + throws SystemException { > + return XMLQueryCompiler.compile(listener, ast, ccb, = optimizationLevel); > } >=20 > public StaticContext getStaticContext() { >=20 > Modified: = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/AttributeNodeConstructorExpression.java > URL: = http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/src/main/java= /org/apache/vxquery/compiler/expression/AttributeNodeConstructorExpression= .java?rev=3D906965&r1=3D906964&r2=3D906965&view=3Ddiff > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/AttributeNodeConstructorExpression.java (original) > +++ = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/AttributeNodeConstructorExpression.java Fri Feb 5 15:19:44 = 2010 > @@ -1,21 +1,21 @@ > /* > -* Licensed to the Apache Software Foundation (ASF) under one or more > -* contributor license agreements. See the NOTICE file distributed = with > -* this work for additional information regarding copyright ownership. > -* The ASF licenses this file to You under the Apache License, Version = 2.0 > -* (the "License"); you may not use this file except in compliance = with > -* the License. You may obtain a copy of the License at > -* > -* http://www.apache.org/licenses/LICENSE-2.0 > -* > -* Unless required by applicable law or agreed to in writing, software > -* distributed under the License is distributed on an "AS IS" BASIS, > -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or = implied. > -* See the License for the specific language governing permissions and > -* limitations under the License. > -*/ > + * Licensed to the Apache Software Foundation (ASF) under one or more > + * contributor license agreements. See the NOTICE file distributed = with > + * this work for additional information regarding copyright = ownership. > + * The ASF licenses this file to You under the Apache License, = Version 2.0 > + * (the "License"); you may not use this file except in compliance = with > + * the License. You may obtain a copy of the License at > + * http://www.apache.org/licenses/LICENSE-2.0 > + * Unless required by applicable law or agreed to in writing, = software > + * distributed under the License is distributed on an "AS IS" BASIS, > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or = implied. > + * See the License for the specific language governing permissions = and > + * limitations under the License. > + */ > package org.apache.vxquery.compiler.expression; >=20 > +import java.util.Map; > + > import org.apache.vxquery.context.StaticContext; > import org.apache.vxquery.types.NodeKind; >=20 > @@ -33,4 +33,15 @@ > public <T> T accept(ExpressionVisitor<T> visitor) { > return visitor.visitAttributeNodeConstructorExpression(this); > } > + > + @Override > + public <T> T accept(MutableExpressionVisitor<T> visitor, = ExpressionHandle handle) { > + return = visitor.visitAttributeNodeConstructorExpression(handle); > + } > + > + @Override > + public Expression copy(Map<Variable, Expression> substitution) { > + return new AttributeNodeConstructorExpression(ctx, = name.get().copy(substitution), content.get().copy( > + substitution)); > + } > } > \ No newline at end of file >=20 > Modified: = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/CastExpression.java > URL: = http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/src/main/java= /org/apache/vxquery/compiler/expression/CastExpression.java?rev=3D906965&r= 1=3D906964&r2=3D906965&view=3Ddiff > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/CastExpression.java (original) > +++ = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/CastExpression.java Fri Feb 5 15:19:44 2010 > @@ -1,21 +1,21 @@ > /* > -* Licensed to the Apache Software Foundation (ASF) under one or more > -* contributor license agreements. See the NOTICE file distributed = with > -* this work for additional information regarding copyright ownership. > -* The ASF licenses this file to You under the Apache License, Version = 2.0 > -* (the "License"); you may not use this file except in compliance = with > -* the License. You may obtain a copy of the License at > -* > -* http://www.apache.org/licenses/LICENSE-2.0 > -* > -* Unless required by applicable law or agreed to in writing, software > -* distributed under the License is distributed on an "AS IS" BASIS, > -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or = implied. > -* See the License for the specific language governing permissions and > -* limitations under the License. > -*/ > + * Licensed to the Apache Software Foundation (ASF) under one or more > + * contributor license agreements. See the NOTICE file distributed = with > + * this work for additional information regarding copyright = ownership. > + * The ASF licenses this file to You under the Apache License, = Version 2.0 > + * (the "License"); you may not use this file except in compliance = with > + * the License. You may obtain a copy of the License at > + * http://www.apache.org/licenses/LICENSE-2.0 > + * Unless required by applicable law or agreed to in writing, = software > + * distributed under the License is distributed on an "AS IS" BASIS, > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or = implied. > + * See the License for the specific language governing permissions = and > + * limitations under the License. > + */ > package org.apache.vxquery.compiler.expression; >=20 > +import java.util.Map; > + > import org.apache.vxquery.context.StaticContext; > import org.apache.vxquery.types.SequenceType; >=20 > @@ -33,4 +33,14 @@ > public <T> T accept(ExpressionVisitor<T> visitor) { > return visitor.visitCastExpression(this); > } > + > + @Override > + public <T> T accept(MutableExpressionVisitor<T> visitor, = ExpressionHandle handle) { > + return visitor.visitCastExpression(handle); > + } > + > + @Override > + public Expression copy(Map<Variable, Expression> substitution) { > + return new CastExpression(ctx, = input.get().copy(substitution), type); > + } > } > \ No newline at end of file >=20 > Modified: = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/CastableExpression.java > URL: = http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/src/main/java= /org/apache/vxquery/compiler/expression/CastableExpression.java?rev=3D9069= 65&r1=3D906964&r2=3D906965&view=3Ddiff > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/CastableExpression.java (original) > +++ = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/CastableExpression.java Fri Feb 5 15:19:44 2010 > @@ -1,21 +1,21 @@ > /* > -* Licensed to the Apache Software Foundation (ASF) under one or more > -* contributor license agreements. See the NOTICE file distributed = with > -* this work for additional information regarding copyright ownership. > -* The ASF licenses this file to You under the Apache License, Version = 2.0 > -* (the "License"); you may not use this file except in compliance = with > -* the License. You may obtain a copy of the License at > -* > -* http://www.apache.org/licenses/LICENSE-2.0 > -* > -* Unless required by applicable law or agreed to in writing, software > -* distributed under the License is distributed on an "AS IS" BASIS, > -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or = implied. > -* See the License for the specific language governing permissions and > -* limitations under the License. > -*/ > + * Licensed to the Apache Software Foundation (ASF) under one or more > + * contributor license agreements. See the NOTICE file distributed = with > + * this work for additional information regarding copyright = ownership. > + * The ASF licenses this file to You under the Apache License, = Version 2.0 > + * (the "License"); you may not use this file except in compliance = with > + * the License. You may obtain a copy of the License at > + * http://www.apache.org/licenses/LICENSE-2.0 > + * Unless required by applicable law or agreed to in writing, = software > + * distributed under the License is distributed on an "AS IS" BASIS, > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or = implied. > + * See the License for the specific language governing permissions = and > + * limitations under the License. > + */ > package org.apache.vxquery.compiler.expression; >=20 > +import java.util.Map; > + > import org.apache.vxquery.context.StaticContext; > import org.apache.vxquery.types.SequenceType; >=20 > @@ -33,4 +33,14 @@ > public <T> T accept(ExpressionVisitor<T> visitor) { > return visitor.visitCastableExpression(this); > } > + > + @Override > + public <T> T accept(MutableExpressionVisitor<T> visitor, = ExpressionHandle handle) { > + return visitor.visitCastableExpression(handle); > + } > + > + @Override > + public Expression copy(Map<Variable, Expression> substitution) { > + return new CastableExpression(ctx, = input.get().copy(substitution), type); > + } > } > \ No newline at end of file >=20 > Modified: = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/CommentNodeConstructorExpression.java > URL: = http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/src/main/java= /org/apache/vxquery/compiler/expression/CommentNodeConstructorExpression.j= ava?rev=3D906965&r1=3D906964&r2=3D906965&view=3Ddiff > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/CommentNodeConstructorExpression.java (original) > +++ = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/CommentNodeConstructorExpression.java Fri Feb 5 15:19:44 = 2010 > @@ -1,30 +1,30 @@ > /* > -* Licensed to the Apache Software Foundation (ASF) under one or more > -* contributor license agreements. See the NOTICE file distributed = with > -* this work for additional information regarding copyright ownership. > -* The ASF licenses this file to You under the Apache License, Version = 2.0 > -* (the "License"); you may not use this file except in compliance = with > -* the License. You may obtain a copy of the License at > -* > -* http://www.apache.org/licenses/LICENSE-2.0 > -* > -* Unless required by applicable law or agreed to in writing, software > -* distributed under the License is distributed on an "AS IS" BASIS, > -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or = implied. > -* See the License for the specific language governing permissions and > -* limitations under the License. > -*/ > + * Licensed to the Apache Software Foundation (ASF) under one or more > + * contributor license agreements. See the NOTICE file distributed = with > + * this work for additional information regarding copyright = ownership. > + * The ASF licenses this file to You under the Apache License, = Version 2.0 > + * (the "License"); you may not use this file except in compliance = with > + * the License. You may obtain a copy of the License at > + * http://www.apache.org/licenses/LICENSE-2.0 > + * Unless required by applicable law or agreed to in writing, = software > + * distributed under the License is distributed on an "AS IS" BASIS, > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or = implied. > + * See the License for the specific language governing permissions = and > + * limitations under the License. > + */ > package org.apache.vxquery.compiler.expression; >=20 > +import java.util.Map; > + > import org.apache.vxquery.context.StaticContext; > import org.apache.vxquery.types.NodeKind; >=20 > public class CommentNodeConstructorExpression extends = NodeConstructorExpression { > - private Expression content; > + private ExpressionHandle content; >=20 > public CommentNodeConstructorExpression(StaticContext ctx, = Expression content) { > super(ctx); > - this.content =3D content; > + this.content =3D new ExpressionHandle(content); > } >=20 > @Override > @@ -32,16 +32,22 @@ > return NodeKind.COMMENT; > } >=20 > - public Expression getContent() { > + public ExpressionHandle getContent() { > return content; > } >=20 > - public void setContent(Expression content) { > - this.content =3D content; > - } > - > @Override > public <T> T accept(ExpressionVisitor<T> visitor) { > return visitor.visitCommentNodeConstructorExpression(this); > } > + > + @Override > + public <T> T accept(MutableExpressionVisitor<T> visitor, = ExpressionHandle handle) { > + return visitor.visitCommentNodeConstructorExpression(handle); > + } > + > + @Override > + public Expression copy(Map<Variable, Expression> substitution) { > + return new CommentNodeConstructorExpression(ctx, = content.get().copy(substitution)); > + } > } > \ No newline at end of file >=20 > Modified: = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/ConstantExpression.java > URL: = http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/src/main/java= /org/apache/vxquery/compiler/expression/ConstantExpression.java?rev=3D9069= 65&r1=3D906964&r2=3D906965&view=3Ddiff > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/ConstantExpression.java (original) > +++ = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/ConstantExpression.java Fri Feb 5 15:19:44 2010 > @@ -1,21 +1,21 @@ > /* > -* Licensed to the Apache Software Foundation (ASF) under one or more > -* contributor license agreements. See the NOTICE file distributed = with > -* this work for additional information regarding copyright ownership. > -* The ASF licenses this file to You under the Apache License, Version = 2.0 > -* (the "License"); you may not use this file except in compliance = with > -* the License. You may obtain a copy of the License at > -* > -* http://www.apache.org/licenses/LICENSE-2.0 > -* > -* Unless required by applicable law or agreed to in writing, software > -* distributed under the License is distributed on an "AS IS" BASIS, > -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or = implied. > -* See the License for the specific language governing permissions and > -* limitations under the License. > -*/ > + * Licensed to the Apache Software Foundation (ASF) under one or more > + * contributor license agreements. See the NOTICE file distributed = with > + * this work for additional information regarding copyright = ownership. > + * The ASF licenses this file to You under the Apache License, = Version 2.0 > + * (the "License"); you may not use this file except in compliance = with > + * the License. You may obtain a copy of the License at > + * http://www.apache.org/licenses/LICENSE-2.0 > + * Unless required by applicable law or agreed to in writing, = software > + * distributed under the License is distributed on an "AS IS" BASIS, > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or = implied. > + * See the License for the specific language governing permissions = and > + * limitations under the License. > + */ > package org.apache.vxquery.compiler.expression; >=20 > +import java.util.Map; > + > import org.apache.vxquery.context.StaticContext; > import org.apache.vxquery.types.SequenceType; >=20 > @@ -54,4 +54,14 @@ > public <T> T accept(ExpressionVisitor<T> visitor) { > return visitor.visitConstantExpression(this); > } > + > + @Override > + public <T> T accept(MutableExpressionVisitor<T> visitor, = ExpressionHandle handle) { > + return visitor.visitConstantExpression(handle); > + } > + > + @Override > + public Expression copy(Map<Variable, Expression> substitution) { > + return new ConstantExpression(ctx, value, type); > + } > } > \ No newline at end of file >=20 > Modified: = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/DocumentNodeConstructorExpression.java > URL: = http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/src/main/java= /org/apache/vxquery/compiler/expression/DocumentNodeConstructorExpression.= java?rev=3D906965&r1=3D906964&r2=3D906965&view=3Ddiff > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/DocumentNodeConstructorExpression.java (original) > +++ = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/DocumentNodeConstructorExpression.java Fri Feb 5 15:19:44 = 2010 > @@ -1,33 +1,33 @@ > /* > -* Licensed to the Apache Software Foundation (ASF) under one or more > -* contributor license agreements. See the NOTICE file distributed = with > -* this work for additional information regarding copyright ownership. > -* The ASF licenses this file to You under the Apache License, Version = 2.0 > -* (the "License"); you may not use this file except in compliance = with > -* the License. You may obtain a copy of the License at > -* > -* http://www.apache.org/licenses/LICENSE-2.0 > -* > -* Unless required by applicable law or agreed to in writing, software > -* distributed under the License is distributed on an "AS IS" BASIS, > -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or = implied. > -* See the License for the specific language governing permissions and > -* limitations under the License. > -*/ > + * Licensed to the Apache Software Foundation (ASF) under one or more > + * contributor license agreements. See the NOTICE file distributed = with > + * this work for additional information regarding copyright = ownership. > + * The ASF licenses this file to You under the Apache License, = Version 2.0 > + * (the "License"); you may not use this file except in compliance = with > + * the License. You may obtain a copy of the License at > + * http://www.apache.org/licenses/LICENSE-2.0 > + * Unless required by applicable law or agreed to in writing, = software > + * distributed under the License is distributed on an "AS IS" BASIS, > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or = implied. > + * See the License for the specific language governing permissions = and > + * limitations under the License. > + */ > package org.apache.vxquery.compiler.expression; >=20 > +import java.util.Map; > + > import org.apache.vxquery.context.StaticContext; > import org.apache.vxquery.types.NodeKind; >=20 > public class DocumentNodeConstructorExpression extends = NodeConstructorExpression { > - private Expression content; > + private ExpressionHandle content; >=20 > public DocumentNodeConstructorExpression(StaticContext ctx, = Expression content) { > super(ctx); > - this.content =3D content; > + this.content =3D new ExpressionHandle(content); > } >=20 > - public Expression getContent() { > + public ExpressionHandle getContent() { > return content; > } >=20 > @@ -40,4 +40,14 @@ > public <T> T accept(ExpressionVisitor<T> visitor) { > return visitor.visitDocumentNodeConstructorExpression(this); > } > + > + @Override > + public <T> T accept(MutableExpressionVisitor<T> visitor, = ExpressionHandle handle) { > + return = visitor.visitDocumentNodeConstructorExpression(handle); > + } > + > + @Override > + public Expression copy(Map<Variable, Expression> substitution) { > + return new DocumentNodeConstructorExpression(ctx, = content.get().copy(substitution)); > + } > } > \ No newline at end of file >=20 > Modified: = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/ElementNodeConstructorExpression.java > URL: = http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/src/main/java= /org/apache/vxquery/compiler/expression/ElementNodeConstructorExpression.j= ava?rev=3D906965&r1=3D906964&r2=3D906965&view=3Ddiff > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/ElementNodeConstructorExpression.java (original) > +++ = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/ElementNodeConstructorExpression.java Fri Feb 5 15:19:44 = 2010 > @@ -1,21 +1,21 @@ > /* > -* Licensed to the Apache Software Foundation (ASF) under one or more > -* contributor license agreements. See the NOTICE file distributed = with > -* this work for additional information regarding copyright ownership. > -* The ASF licenses this file to You under the Apache License, Version = 2.0 > -* (the "License"); you may not use this file except in compliance = with > -* the License. You may obtain a copy of the License at > -* > -* http://www.apache.org/licenses/LICENSE-2.0 > -* > -* Unless required by applicable law or agreed to in writing, software > -* distributed under the License is distributed on an "AS IS" BASIS, > -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or = implied. > -* See the License for the specific language governing permissions and > -* limitations under the License. > -*/ > + * Licensed to the Apache Software Foundation (ASF) under one or more > + * contributor license agreements. See the NOTICE file distributed = with > + * this work for additional information regarding copyright = ownership. > + * The ASF licenses this file to You under the Apache License, = Version 2.0 > + * (the "License"); you may not use this file except in compliance = with > + * the License. You may obtain a copy of the License at > + * http://www.apache.org/licenses/LICENSE-2.0 > + * Unless required by applicable law or agreed to in writing, = software > + * distributed under the License is distributed on an "AS IS" BASIS, > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or = implied. > + * See the License for the specific language governing permissions = and > + * limitations under the License. > + */ > package org.apache.vxquery.compiler.expression; >=20 > +import java.util.Map; > + > import org.apache.vxquery.context.StaticContext; > import org.apache.vxquery.types.NodeKind; >=20 > @@ -33,4 +33,15 @@ > public <T> T accept(ExpressionVisitor<T> visitor) { > return visitor.visitElementNodeConstructorExpression(this); > } > + > + @Override > + public <T> T accept(MutableExpressionVisitor<T> visitor, = ExpressionHandle handle) { > + return visitor.visitElementNodeConstructorExpression(handle); > + } > + > + @Override > + public Expression copy(Map<Variable, Expression> substitution) { > + return new ElementNodeConstructorExpression(ctx, = name.get().copy(substitution), content.get() > + .copy(substitution)); > + } > } > \ No newline at end of file >=20 > Modified: = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/ElementOrAttributeNodeConstructorExpression.java > URL: = http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/src/main/java= /org/apache/vxquery/compiler/expression/ElementOrAttributeNodeConstructorE= xpression.java?rev=3D906965&r1=3D906964&r2=3D906965&view=3Ddiff > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/ElementOrAttributeNodeConstructorExpression.java (original) > +++ = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/ElementOrAttributeNodeConstructorExpression.java Fri Feb 5 = 15:19:44 2010 > @@ -1,46 +1,36 @@ > /* > -* Licensed to the Apache Software Foundation (ASF) under one or more > -* contributor license agreements. See the NOTICE file distributed = with > -* this work for additional information regarding copyright ownership. > -* The ASF licenses this file to You under the Apache License, Version = 2.0 > -* (the "License"); you may not use this file except in compliance = with > -* the License. You may obtain a copy of the License at > -* > -* http://www.apache.org/licenses/LICENSE-2.0 > -* > -* Unless required by applicable law or agreed to in writing, software > -* distributed under the License is distributed on an "AS IS" BASIS, > -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or = implied. > -* See the License for the specific language governing permissions and > -* limitations under the License. > -*/ > + * Licensed to the Apache Software Foundation (ASF) under one or more > + * contributor license agreements. See the NOTICE file distributed = with > + * this work for additional information regarding copyright = ownership. > + * The ASF licenses this file to You under the Apache License, = Version 2.0 > + * (the "License"); you may not use this file except in compliance = with > + * the License. You may obtain a copy of the License at > + * http://www.apache.org/licenses/LICENSE-2.0 > + * Unless required by applicable law or agreed to in writing, = software > + * distributed under the License is distributed on an "AS IS" BASIS, > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or = implied. > + * See the License for the specific language governing permissions = and > + * limitations under the License. > + */ > package org.apache.vxquery.compiler.expression; >=20 > import org.apache.vxquery.context.StaticContext; >=20 > public abstract class ElementOrAttributeNodeConstructorExpression = extends NodeConstructorExpression { > - protected Expression name; > - protected Expression content; > + protected ExpressionHandle name; > + protected ExpressionHandle content; >=20 > public ElementOrAttributeNodeConstructorExpression(StaticContext = ctx, Expression name, Expression content) { > super(ctx); > - this.name =3D name; > - this.content =3D content; > + this.name =3D new ExpressionHandle(name); > + this.content =3D new ExpressionHandle(content); > } >=20 > - public Expression getName() { > + public ExpressionHandle getName() { > return name; > } >=20 > - public void setName(Expression name) { > - this.name =3D name; > - } > - > - public Expression getContent() { > + public ExpressionHandle getContent() { > return content; > } > - > - public void setContent(Expression content) { > - this.content =3D content; > - } > } > \ No newline at end of file >=20 > Modified: = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/Expression.java > URL: = http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/src/main/java= /org/apache/vxquery/compiler/expression/Expression.java?rev=3D906965&r1=3D= 906964&r2=3D906965&view=3Ddiff > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/Expression.java (original) > +++ = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/Expression.java Fri Feb 5 15:19:44 2010 > @@ -1,21 +1,22 @@ > /* > -* Licensed to the Apache Software Foundation (ASF) under one or more > -* contributor license agreements. See the NOTICE file distributed = with > -* this work for additional information regarding copyright ownership. > -* The ASF licenses this file to You under the Apache License, Version = 2.0 > -* (the "License"); you may not use this file except in compliance = with > -* the License. You may obtain a copy of the License at > -* > -* http://www.apache.org/licenses/LICENSE-2.0 > -* > -* Unless required by applicable law or agreed to in writing, software > -* distributed under the License is distributed on an "AS IS" BASIS, > -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or = implied. > -* See the License for the specific language governing permissions and > -* limitations under the License. > -*/ > + * Licensed to the Apache Software Foundation (ASF) under one or more > + * contributor license agreements. See the NOTICE file distributed = with > + * this work for additional information regarding copyright = ownership. > + * The ASF licenses this file to You under the Apache License, = Version 2.0 > + * (the "License"); you may not use this file except in compliance = with > + * the License. You may obtain a copy of the License at > + * http://www.apache.org/licenses/LICENSE-2.0 > + * Unless required by applicable law or agreed to in writing, = software > + * distributed under the License is distributed on an "AS IS" BASIS, > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or = implied. > + * See the License for the specific language governing permissions = and > + * limitations under the License. > + */ > package org.apache.vxquery.compiler.expression; >=20 > +import java.util.HashMap; > +import java.util.Map; > + > import org.apache.vxquery.context.StaticContext; > import org.apache.vxquery.util.Debug; >=20 > @@ -30,10 +31,18 @@ >=20 > public abstract <T> T accept(ExpressionVisitor<T> visitor); >=20 > + public abstract <T> T accept(MutableExpressionVisitor<T> visitor, = ExpressionHandle handle); > + > + public abstract Expression copy(Map<Variable, Expression> = substitution); > + > + public final Expression copy() { > + return copy(new HashMap<Variable, Expression>()); > + } > + > public final StaticContext getStaticContext() { > return ctx; > } > - =20 > + > public String toString(Object o) { > return Debug.toString(o); > } >=20 > Modified: = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/ExpressionHandle.java > URL: = http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/src/main/java= /org/apache/vxquery/compiler/expression/ExpressionHandle.java?rev=3D906965= &r1=3D906964&r2=3D906965&view=3Ddiff > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/ExpressionHandle.java (original) > +++ = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/ExpressionHandle.java Fri Feb 5 15:19:44 2010 > @@ -1,19 +1,17 @@ > /* > -* Licensed to the Apache Software Foundation (ASF) under one or more > -* contributor license agreements. See the NOTICE file distributed = with > -* this work for additional information regarding copyright ownership. > -* The ASF licenses this file to You under the Apache License, Version = 2.0 > -* (the "License"); you may not use this file except in compliance = with > -* the License. You may obtain a copy of the License at > -* > -* http://www.apache.org/licenses/LICENSE-2.0 > -* > -* Unless required by applicable law or agreed to in writing, software > -* distributed under the License is distributed on an "AS IS" BASIS, > -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or = implied. > -* See the License for the specific language governing permissions and > -* limitations under the License. > -*/ > + * Licensed to the Apache Software Foundation (ASF) under one or more > + * contributor license agreements. See the NOTICE file distributed = with > + * this work for additional information regarding copyright = ownership. > + * The ASF licenses this file to You under the Apache License, = Version 2.0 > + * (the "License"); you may not use this file except in compliance = with > + * the License. You may obtain a copy of the License at > + * http://www.apache.org/licenses/LICENSE-2.0 > + * Unless required by applicable law or agreed to in writing, = software > + * distributed under the License is distributed on an "AS IS" BASIS, > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or = implied. > + * See the License for the specific language governing permissions = and > + * limitations under the License. > + */ > package org.apache.vxquery.compiler.expression; >=20 > public final class ExpressionHandle { > @@ -33,4 +31,12 @@ > public void set(Expression expression) { > this.expression =3D expression; > } > + > + public <T> T accept(ExpressionVisitor<T> visitor) { > + return expression.accept(visitor); > + } > + > + public <T> T accept(MutableExpressionVisitor<T> visitor) { > + return expression.accept(visitor, this); > + } > } > \ No newline at end of file >=20 > Modified: = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/ExpressionPrinter.java > URL: = http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/src/main/java= /org/apache/vxquery/compiler/expression/ExpressionPrinter.java?rev=3D90696= 5&r1=3D906964&r2=3D906965&view=3Ddiff > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/ExpressionPrinter.java (original) > +++ = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/ExpressionPrinter.java Fri Feb 5 15:19:44 2010 > @@ -1,19 +1,17 @@ > /* > -* Licensed to the Apache Software Foundation (ASF) under one or more > -* contributor license agreements. See the NOTICE file distributed = with > -* this work for additional information regarding copyright ownership. > -* The ASF licenses this file to You under the Apache License, Version = 2.0 > -* (the "License"); you may not use this file except in compliance = with > -* the License. You may obtain a copy of the License at > -* > -* http://www.apache.org/licenses/LICENSE-2.0 > -* > -* Unless required by applicable law or agreed to in writing, software > -* distributed under the License is distributed on an "AS IS" BASIS, > -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or = implied. > -* See the License for the specific language governing permissions and > -* limitations under the License. > -*/ > + * Licensed to the Apache Software Foundation (ASF) under one or more > + * contributor license agreements. See the NOTICE file distributed = with > + * this work for additional information regarding copyright = ownership. > + * The ASF licenses this file to You under the Apache License, = Version 2.0 > + * (the "License"); you may not use this file except in compliance = with > + * the License. You may obtain a copy of the License at > + * http://www.apache.org/licenses/LICENSE-2.0 > + * Unless required by applicable law or agreed to in writing, = software > + * distributed under the License is distributed on an "AS IS" BASIS, > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or = implied. > + * See the License for the specific language governing permissions = and > + * limitations under the License. > + */ > package org.apache.vxquery.compiler.expression; >=20 > public class ExpressionPrinter { > @@ -37,7 +35,7 @@ > return buffer; > } >=20 > - private void print(Expression e) { > + private void print(ExpressionHandle e) { > ++level; > e.accept(this); > --level; > @@ -194,7 +192,7 @@ > = expr.getFunction().getSignature().getArity()).append("] ["); > for (ExpressionHandle arg : expr.getArguments()) { > buffer.append("\n"); > - print(arg.get()); > + print(arg); > buffer.append(","); > } > buffer.append("\n"); >=20 > Modified: = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/ExtensionExpression.java > URL: = http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/src/main/java= /org/apache/vxquery/compiler/expression/ExtensionExpression.java?rev=3D906= 965&r1=3D906964&r2=3D906965&view=3Ddiff > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/ExtensionExpression.java (original) > +++ = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/ExtensionExpression.java Fri Feb 5 15:19:44 2010 > @@ -1,22 +1,22 @@ > /* > -* Licensed to the Apache Software Foundation (ASF) under one or more > -* contributor license agreements. See the NOTICE file distributed = with > -* this work for additional information regarding copyright ownership. > -* The ASF licenses this file to You under the Apache License, Version = 2.0 > -* (the "License"); you may not use this file except in compliance = with > -* the License. You may obtain a copy of the License at > -* > -* http://www.apache.org/licenses/LICENSE-2.0 > -* > -* Unless required by applicable law or agreed to in writing, software > -* distributed under the License is distributed on an "AS IS" BASIS, > -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or = implied. > -* See the License for the specific language governing permissions and > -* limitations under the License. > -*/ > + * Licensed to the Apache Software Foundation (ASF) under one or more > + * contributor license agreements. See the NOTICE file distributed = with > + * this work for additional information regarding copyright = ownership. > + * The ASF licenses this file to You under the Apache License, = Version 2.0 > + * (the "License"); you may not use this file except in compliance = with > + * the License. You may obtain a copy of the License at > + * http://www.apache.org/licenses/LICENSE-2.0 > + * Unless required by applicable law or agreed to in writing, = software > + * distributed under the License is distributed on an "AS IS" BASIS, > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or = implied. > + * See the License for the specific language governing permissions = and > + * limitations under the License. > + */ > package org.apache.vxquery.compiler.expression; >=20 > +import java.util.ArrayList; > import java.util.List; > +import java.util.Map; >=20 > import javax.xml.namespace.QName; >=20 > @@ -46,16 +46,26 @@ > this.pragmas =3D pragmas; > } >=20 > - public Expression getInput() { > - return input.get(); > - } > - > - public void setInput(Expression input) { > - this.input.set(input); > + public ExpressionHandle getInput() { > + return input; > } >=20 > @Override > public <T> T accept(ExpressionVisitor<T> visitor) { > return visitor.visitExtensionExpression(this); > } > + > + @Override > + public <T> T accept(MutableExpressionVisitor<T> visitor, = ExpressionHandle handle) { > + return visitor.visitExtensionExpression(handle); > + } > + > + @Override > + public Expression copy(Map<Variable, Expression> substitution) { > + List<Pair<QName, String>> pragmasCopy =3D new = ArrayList<Pair<QName, String>>(); > + for (Pair<QName, String> p : pragmas) { > + pragmasCopy.add(new Pair<QName, String>(p.first, = p.second)); > + } > + return new ExtensionExpression(ctx, = input.get().copy(substitution), pragmasCopy); > + } > } > \ No newline at end of file >=20 > Modified: = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/FLWORExpression.java > URL: = http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/src/main/java= /org/apache/vxquery/compiler/expression/FLWORExpression.java?rev=3D906965&= r1=3D906964&r2=3D906965&view=3Ddiff > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/FLWORExpression.java (original) > +++ = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/FLWORExpression.java Fri Feb 5 15:19:44 2010 > @@ -1,24 +1,24 @@ > /* > -* Licensed to the Apache Software Foundation (ASF) under one or more > -* contributor license agreements. See the NOTICE file distributed = with > -* this work for additional information regarding copyright ownership. > -* The ASF licenses this file to You under the Apache License, Version = 2.0 > -* (the "License"); you may not use this file except in compliance = with > -* the License. You may obtain a copy of the License at > -* > -* http://www.apache.org/licenses/LICENSE-2.0 > -* > -* Unless required by applicable law or agreed to in writing, software > -* distributed under the License is distributed on an "AS IS" BASIS, > -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or = implied. > -* See the License for the specific language governing permissions and > -* limitations under the License. > -*/ > + * Licensed to the Apache Software Foundation (ASF) under one or more > + * contributor license agreements. See the NOTICE file distributed = with > + * this work for additional information regarding copyright = ownership. > + * The ASF licenses this file to You under the Apache License, = Version 2.0 > + * (the "License"); you may not use this file except in compliance = with > + * the License. You may obtain a copy of the License at > + * http://www.apache.org/licenses/LICENSE-2.0 > + * Unless required by applicable law or agreed to in writing, = software > + * distributed under the License is distributed on an "AS IS" BASIS, > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or = implied. > + * See the License for the specific language governing permissions = and > + * limitations under the License. > + */ > package org.apache.vxquery.compiler.expression; >=20 > import java.util.ArrayList; > import java.util.List; > +import java.util.Map; >=20 > +import org.apache.vxquery.compiler.tools.ExpressionUtils; > import org.apache.vxquery.context.StaticContext; >=20 > public class FLWORExpression extends Expression { > @@ -40,20 +40,21 @@ > return clauses; > } >=20 > - public Expression getReturnExpression() { > - return rExpr.get(); > - } > - > - public void setReturnExpression(Expression rExpr) { > - this.rExpr.set(rExpr); > + public ExpressionHandle getReturnExpression() { > + return rExpr; > } >=20 > public enum ClauseTag { > - FOR, LET, WHERE, ORDERBY, > + FOR, > + LET, > + WHERE, > + ORDERBY, > } >=20 > public static abstract class Clause { > public abstract ClauseTag getTag(); > + > + public abstract Clause copy(StaticContext ctx, Map<Variable, = Expression> substitution); > } >=20 > public static final class ForClause extends Clause { > @@ -95,6 +96,25 @@ > public void setScoreVariable(ScoreVariable scoreVar) { > this.scoreVar =3D scoreVar; > } > + > + @Override > + public Clause copy(StaticContext ctx, Map<Variable, = Expression> substitution) { > + ForLetVariable fv =3D new = ForLetVariable(Variable.VarTag.FOR, = ExpressionUtils.createVariableCopyName(forVar > + .getName()), = forVar.getSequence().get().copy(substitution)); > + substitution.put(forVar, new = VariableReferenceExpression(ctx, fv)); > + PositionVariable pv =3D null; > + if (posVar !=3D null) { > + pv =3D new = PositionVariable(ExpressionUtils.createVariableCopyName(posVar.getName()))= ; > + substitution.put(posVar, new = VariableReferenceExpression(ctx, pv)); > + } > + ScoreVariable sv =3D null; > + if (scoreVar !=3D null) { > + sv =3D new ScoreVariable(scoreVar.getName()); > + substitution.put(scoreVar, new = VariableReferenceExpression(ctx, sv)); > + } > + return new ForClause(fv, pv, sv); > + } > + > } >=20 > public static final class LetClause extends Clause { > @@ -116,6 +136,14 @@ > public void setLetVariable(ForLetVariable letVar) { > this.letVar =3D letVar; > } > + > + @Override > + public Clause copy(StaticContext ctx, Map<Variable, = Expression> substitution) { > + ForLetVariable lv =3D new = ForLetVariable(Variable.VarTag.LET, = ExpressionUtils.createVariableCopyName(letVar > + .getName()), = letVar.getSequence().get().copy(substitution)); > + substitution.put(letVar, new = VariableReferenceExpression(ctx, lv)); > + return new LetClause(lv); > + } > } >=20 > public static final class WhereClause extends Clause { > @@ -130,21 +158,25 @@ > return ClauseTag.WHERE; > } >=20 > - public Expression getCondition() { > - return condition.get(); > + public ExpressionHandle getCondition() { > + return condition; > } >=20 > - public void setCondition(Expression condition) { > - this.condition.set(condition); > + @Override > + public Clause copy(StaticContext ctx, Map<Variable, = Expression> substitution) { > + return new = WhereClause(condition.get().copy(substitution)); > } > } >=20 > public enum OrderDirection { > - ASCENDING, DESCENDING, > + ASCENDING, > + DESCENDING, > } >=20 > public enum EmptyOrder { > - GREATEST, LEAST, DEFAULT, > + GREATEST, > + LEAST, > + DEFAULT, > } >=20 > public static final class OrderbyClause extends Clause { > @@ -206,10 +238,34 @@ > public void setStability(boolean stable) { > this.stable =3D stable; > } > + > + @Override > + public Clause copy(StaticContext ctx, Map<Variable, = Expression> substitution) { > + List<Expression> oe =3D new ArrayList<Expression>(); > + for (ExpressionHandle h : orderingExpressions) { > + oe.add(h.get().copy(substitution)); > + } > + return new OrderbyClause(oe, new = ArrayList<OrderDirection>(orderingDirections), new = ArrayList<EmptyOrder>( > + emptyOrders), new ArrayList<String>(collations), = stable); > + } > } >=20 > @Override > public <T> T accept(ExpressionVisitor<T> visitor) { > return visitor.visitFLWORExpression(this); > } > + > + @Override > + public <T> T accept(MutableExpressionVisitor<T> visitor, = ExpressionHandle handle) { > + return visitor.visitFLWORExpression(handle); > + } > + > + @Override > + public Expression copy(Map<Variable, Expression> substitution) { > + List<Clause> clausesCopy =3D new ArrayList<Clause>(); > + for (Clause c : clauses) { > + clausesCopy.add(c.copy(ctx, substitution)); > + } > + return new FLWORExpression(ctx, clausesCopy, = rExpr.get().copy(substitution)); > + } > } > \ No newline at end of file >=20 > Modified: = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/ForLetVariable.java > URL: = http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/src/main/java= /org/apache/vxquery/compiler/expression/ForLetVariable.java?rev=3D906965&r= 1=3D906964&r2=3D906965&view=3Ddiff > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/ForLetVariable.java (original) > +++ = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/ForLetVariable.java Fri Feb 5 15:19:44 2010 > @@ -1,19 +1,17 @@ > /* > -* Licensed to the Apache Software Foundation (ASF) under one or more > -* contributor license agreements. See the NOTICE file distributed = with > -* this work for additional information regarding copyright ownership. > -* The ASF licenses this file to You under the Apache License, Version = 2.0 > -* (the "License"); you may not use this file except in compliance = with > -* the License. You may obtain a copy of the License at > -* > -* http://www.apache.org/licenses/LICENSE-2.0 > -* > -* Unless required by applicable law or agreed to in writing, software > -* distributed under the License is distributed on an "AS IS" BASIS, > -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or = implied. > -* See the License for the specific language governing permissions and > -* limitations under the License. > -*/ > + * Licensed to the Apache Software Foundation (ASF) under one or more > + * contributor license agreements. See the NOTICE file distributed = with > + * this work for additional information regarding copyright = ownership. > + * The ASF licenses this file to You under the Apache License, = Version 2.0 > + * (the "License"); you may not use this file except in compliance = with > + * the License. You may obtain a copy of the License at > + * http://www.apache.org/licenses/LICENSE-2.0 > + * Unless required by applicable law or agreed to in writing, = software > + * distributed under the License is distributed on an "AS IS" BASIS, > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or = implied. > + * See the License for the specific language governing permissions = and > + * limitations under the License. > + */ > package org.apache.vxquery.compiler.expression; >=20 > import javax.xml.namespace.QName; > @@ -33,11 +31,7 @@ > return tag; > } >=20 > - public Expression getSequence() { > - return sequence.get(); > - } > - > - public void setSequence(Expression sequence) { > - this.sequence.set(sequence); > + public ExpressionHandle getSequence() { > + return sequence; > } > } > \ No newline at end of file >=20 > Modified: = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/FunctionCallExpression.java > URL: = http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/src/main/java= /org/apache/vxquery/compiler/expression/FunctionCallExpression.java?rev=3D= 906965&r1=3D906964&r2=3D906965&view=3Ddiff > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/FunctionCallExpression.java (original) > +++ = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/FunctionCallExpression.java Fri Feb 5 15:19:44 2010 > @@ -1,23 +1,22 @@ > /* > -* Licensed to the Apache Software Foundation (ASF) under one or more > -* contributor license agreements. See the NOTICE file distributed = with > -* this work for additional information regarding copyright ownership. > -* The ASF licenses this file to You under the Apache License, Version = 2.0 > -* (the "License"); you may not use this file except in compliance = with > -* the License. You may obtain a copy of the License at > -* > -* http://www.apache.org/licenses/LICENSE-2.0 > -* > -* Unless required by applicable law or agreed to in writing, software > -* distributed under the License is distributed on an "AS IS" BASIS, > -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or = implied. > -* See the License for the specific language governing permissions and > -* limitations under the License. > -*/ > + * Licensed to the Apache Software Foundation (ASF) under one or more > + * contributor license agreements. See the NOTICE file distributed = with > + * this work for additional information regarding copyright = ownership. > + * The ASF licenses this file to You under the Apache License, = Version 2.0 > + * (the "License"); you may not use this file except in compliance = with > + * the License. You may obtain a copy of the License at > + * http://www.apache.org/licenses/LICENSE-2.0 > + * Unless required by applicable law or agreed to in writing, = software > + * distributed under the License is distributed on an "AS IS" BASIS, > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or = implied. > + * See the License for the specific language governing permissions = and > + * limitations under the License. > + */ > package org.apache.vxquery.compiler.expression; >=20 > import java.util.ArrayList; > import java.util.List; > +import java.util.Map; >=20 > import org.apache.vxquery.context.StaticContext; > import org.apache.vxquery.functions.Function; > @@ -53,4 +52,18 @@ > public <T> T accept(ExpressionVisitor<T> visitor) { > return visitor.visitFunctionCallExpression(this); > } > + > + @Override > + public <T> T accept(MutableExpressionVisitor<T> visitor, = ExpressionHandle handle) { > + return visitor.visitFunctionCallExpression(handle); > + } > + > + @Override > + public Expression copy(Map<Variable, Expression> substitution) { > + List<Expression> argsCopy =3D new ArrayList<Expression>(); > + for (ExpressionHandle h : args) { > + argsCopy.add(h.get().copy(substitution)); > + } > + return new FunctionCallExpression(ctx, function, argsCopy); > + } > } > \ No newline at end of file >=20 > Modified: = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/IfThenElseExpression.java > URL: = http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/src/main/java= /org/apache/vxquery/compiler/expression/IfThenElseExpression.java?rev=3D90= 6965&r1=3D906964&r2=3D906965&view=3Ddiff > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/IfThenElseExpression.java (original) > +++ = incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/compiler/= expression/IfThenElseExpression.java Fri Feb 5 15:19:44 2010 > @@ -1,21 +1,21 @@ > /* > -* Licensed to the
{'source': 'Apache Software Foundation Public Mail Archives'}