michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef txXPathOptimizer_h__ michael@0: #define txXPathOptimizer_h__ michael@0: michael@0: #include "txCore.h" michael@0: michael@0: class Expr; michael@0: michael@0: class txXPathOptimizer michael@0: { michael@0: public: michael@0: /** michael@0: * Optimize the given expression. michael@0: * @param aInExpr Expression to optimize. michael@0: * @param aOutExpr Resulting expression, null if optimization didn't michael@0: * result in a new expression. michael@0: */ michael@0: nsresult optimize(Expr* aInExpr, Expr** aOutExpr); michael@0: michael@0: private: michael@0: // Helper methods for optimizing specific classes michael@0: nsresult optimizeStep(Expr* aInExpr, Expr** aOutExpr); michael@0: nsresult optimizePath(Expr* aInExpr, Expr** aOutExpr); michael@0: nsresult optimizeUnion(Expr* aInExpr, Expr** aOutExpr); michael@0: }; michael@0: michael@0: #endif