/* * Copyright (c) 2001-2007 * DecisionSoft Limited. All rights reserved. * Copyright (c) 2004-2007 * Oracle. All rights reserved. * * Licensed 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. * * $Id: ASTVisitor.hpp,v 1.3 2007/11/28 13:13:24 jpcs Exp $ */ #ifndef _ASTVISITOR_HPP #define _ASTVISITOR_HPP #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include class XQILLA_API ASTVisitor : public Optimizer { public: ASTVisitor(Optimizer *parent = 0) : Optimizer(parent) {} protected: virtual void optimize(XQQuery *query); virtual ASTNode *optimize(ASTNode *item); virtual ASTNode *optimizeFunction(XQFunction *item); virtual ASTNode *optimizeLiteral(XQLiteral *item); virtual ASTNode *optimizeNav(XQNav *item); virtual ASTNode *optimizeParenthesizedExpr(XQParenthesizedExpr *item); virtual ASTNode *optimizeSequence(XQSequence *item); virtual ASTNode *optimizeStep(XQStep *item); virtual ASTNode *optimizeVariable(XQVariable *item); virtual ASTNode *optimizeIf(XQIf *item); virtual ASTNode *optimizeInstanceOf(XQInstanceOf *item); virtual ASTNode *optimizeCastableAs(XQCastableAs *item); virtual ASTNode *optimizeCastAs(XQCastAs *item); virtual ASTNode *optimizeTreatAs(XQTreatAs *item); virtual ASTNode *optimizeOperator(XQOperator *item); virtual ASTNode *optimizeContextItem(XQContextItem *item); virtual ASTNode *optimizeReturn(XQReturn *item); virtual ASTNode *optimizeQuantified(XQQuantified *item); virtual ASTNode *optimizeTypeswitch(XQTypeswitch *item); virtual ASTNode *optimizeValidate(XQValidate *item); virtual XQGlobalVariable *optimizeGlobalVar(XQGlobalVariable *item); virtual ASTNode *optimizeFunctionCall(XQFunctionCall *item); virtual ASTNode *optimizeDOMConstructor(XQDOMConstructor *item); virtual ASTNode *optimizeOrderingChange(XQOrderingChange *item); virtual ASTNode *optimizeAtomize(XQAtomize *item); virtual ASTNode *optimizeXPath1CompatConvertFunctionArg(XPath1CompatConvertFunctionArg *item); virtual ASTNode *optimizePromoteUntyped(XQPromoteUntyped *item); virtual ASTNode *optimizePromoteNumeric(XQPromoteNumeric *item); virtual ASTNode *optimizePromoteAnyURI(XQPromoteAnyURI *item); virtual ASTNode *optimizeDocumentOrder(XQDocumentOrder *item); virtual ASTNode *optimizePredicate(XQPredicate *item); virtual ASTNode *optimizeUserFunction(XQUserFunction::Instance *item); virtual ASTNode *optimizeNameExpression(XQNameExpression *item); virtual ASTNode *optimizeContentSequence(XQContentSequence *item); virtual ASTNode *optimizeDirectName(XQDirectName *item); virtual ASTNode *optimizeUDelete(UDelete *item); virtual ASTNode *optimizeURename(URename *item); virtual ASTNode *optimizeUReplace(UReplace *item); virtual ASTNode *optimizeUReplaceValueOf(UReplaceValueOf *item); virtual ASTNode *optimizeUInsertAsFirst(UInsertAsFirst *item); virtual ASTNode *optimizeUInsertAsLast(UInsertAsLast *item); virtual ASTNode *optimizeUInsertInto(UInsertInto *item); virtual ASTNode *optimizeUInsertAfter(UInsertAfter *item); virtual ASTNode *optimizeUInsertBefore(UInsertBefore *item); virtual ASTNode *optimizeUTransform(UTransform *item); virtual ASTNode *optimizeUApplyUpdates(UApplyUpdates *item); virtual ASTNode *optimizeFTContains(FTContains *item); virtual TupleNode *optimizeTupleNode(TupleNode *item); virtual TupleNode *optimizeContextTuple(ContextTuple *item); virtual TupleNode *optimizeForTuple(ForTuple *item); virtual TupleNode *optimizeLetTuple(LetTuple *item); virtual TupleNode *optimizeWhereTuple(WhereTuple *item); virtual TupleNode *optimizeOrderByTuple(OrderByTuple *item); }; #endif