mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
c432cee937
--HG-- rename : content/xslt/src/base/moz.build => dom/xslt/base/moz.build rename : content/xslt/src/base/txCore.h => dom/xslt/base/txCore.h rename : content/xslt/src/base/txDouble.cpp => dom/xslt/base/txDouble.cpp rename : content/xslt/src/base/txErrorObserver.h => dom/xslt/base/txErrorObserver.h rename : content/xslt/src/base/txExpandedNameMap.cpp => dom/xslt/base/txExpandedNameMap.cpp rename : content/xslt/src/base/txExpandedNameMap.h => dom/xslt/base/txExpandedNameMap.h rename : content/xslt/src/base/txList.cpp => dom/xslt/base/txList.cpp rename : content/xslt/src/base/txList.h => dom/xslt/base/txList.h rename : content/xslt/src/base/txLog.h => dom/xslt/base/txLog.h rename : content/xslt/src/base/txNamespaceMap.cpp => dom/xslt/base/txNamespaceMap.cpp rename : content/xslt/src/base/txNamespaceMap.h => dom/xslt/base/txNamespaceMap.h rename : content/xslt/src/base/txOwningArray.h => dom/xslt/base/txOwningArray.h rename : content/xslt/src/base/txStack.h => dom/xslt/base/txStack.h rename : content/xslt/src/base/txStringUtils.h => dom/xslt/base/txStringUtils.h rename : content/xslt/src/base/txURIUtils.cpp => dom/xslt/base/txURIUtils.cpp rename : content/xslt/src/base/txURIUtils.h => dom/xslt/base/txURIUtils.h rename : content/xslt/crashtests/111994.xml => dom/xslt/crashtests/111994.xml rename : content/xslt/crashtests/111994.xsl => dom/xslt/crashtests/111994.xsl rename : content/xslt/crashtests/182460-select.xml => dom/xslt/crashtests/182460-select.xml rename : content/xslt/crashtests/182460-selects.xsl => dom/xslt/crashtests/182460-selects.xsl rename : content/xslt/crashtests/182460-table.xhtml => dom/xslt/crashtests/182460-table.xhtml rename : content/xslt/crashtests/226425.xml => dom/xslt/crashtests/226425.xml rename : content/xslt/crashtests/226425.xsl => dom/xslt/crashtests/226425.xsl rename : content/xslt/crashtests/406106-1.html => dom/xslt/crashtests/406106-1.html rename : content/xslt/crashtests/483444.xml => dom/xslt/crashtests/483444.xml rename : content/xslt/crashtests/485217.xml => dom/xslt/crashtests/485217.xml rename : content/xslt/crashtests/485217.xsl => dom/xslt/crashtests/485217.xsl rename : content/xslt/crashtests/485286.xml => dom/xslt/crashtests/485286.xml rename : content/xslt/crashtests/528300.xml => dom/xslt/crashtests/528300.xml rename : content/xslt/crashtests/528488.xml => dom/xslt/crashtests/528488.xml rename : content/xslt/crashtests/528963.xml => dom/xslt/crashtests/528963.xml rename : content/xslt/crashtests/545927.html => dom/xslt/crashtests/545927.html rename : content/xslt/crashtests/601543.html => dom/xslt/crashtests/601543.html rename : content/xslt/crashtests/602115.html => dom/xslt/crashtests/602115.html rename : content/xslt/crashtests/603844.html => dom/xslt/crashtests/603844.html rename : content/xslt/crashtests/667315.xml => dom/xslt/crashtests/667315.xml rename : content/xslt/crashtests/91332.xml => dom/xslt/crashtests/91332.xml rename : content/xslt/crashtests/91332.xsl => dom/xslt/crashtests/91332.xsl rename : content/xslt/crashtests/crashtests.list => dom/xslt/crashtests/crashtests.list rename : content/xslt/public/moz.build => dom/xslt/moz.build rename : content/xslt/public/nsIDocumentTransformer.h => dom/xslt/nsIDocumentTransformer.h rename : content/xslt/public/nsIXSLTException.idl => dom/xslt/nsIXSLTException.idl rename : content/xslt/public/nsIXSLTProcessor.idl => dom/xslt/nsIXSLTProcessor.idl rename : content/xslt/public/nsIXSLTProcessorPrivate.idl => dom/xslt/nsIXSLTProcessorPrivate.idl rename : content/xslt/tests/XSLTMark/XSLTMark-static.js => dom/xslt/tests/XSLTMark/XSLTMark-static.js rename : content/xslt/tests/XSLTMark/XSLTMark-test.js => dom/xslt/tests/XSLTMark/XSLTMark-test.js rename : content/xslt/tests/XSLTMark/XSLTMark-view.js => dom/xslt/tests/XSLTMark/XSLTMark-view.js rename : content/xslt/tests/XSLTMark/XSLTMark.css => dom/xslt/tests/XSLTMark/XSLTMark.css rename : content/xslt/tests/XSLTMark/XSLTMark.xul => dom/xslt/tests/XSLTMark/XSLTMark.xul rename : content/xslt/tests/buster/DiffDOM.js => dom/xslt/tests/buster/DiffDOM.js rename : content/xslt/tests/buster/DumpDOM.js => dom/xslt/tests/buster/DumpDOM.js rename : content/xslt/tests/buster/ReadMe => dom/xslt/tests/buster/ReadMe rename : content/xslt/tests/buster/buster-files.js => dom/xslt/tests/buster/buster-files.js rename : content/xslt/tests/buster/buster-handlers.js => dom/xslt/tests/buster/buster-handlers.js rename : content/xslt/tests/buster/buster-statics.js => dom/xslt/tests/buster/buster-statics.js rename : content/xslt/tests/buster/buster-test.js => dom/xslt/tests/buster/buster-test.js rename : content/xslt/tests/buster/buster-view.js => dom/xslt/tests/buster/buster-view.js rename : content/xslt/tests/buster/buster.css => dom/xslt/tests/buster/buster.css rename : content/xslt/tests/buster/buster.xul => dom/xslt/tests/buster/buster.xul rename : content/xslt/tests/buster/helper/generate-rdf.pl => dom/xslt/tests/buster/helper/generate-rdf.pl rename : content/xslt/tests/buster/install.js => dom/xslt/tests/buster/install.js rename : content/xslt/tests/buster/jar.mn => dom/xslt/tests/buster/jar.mn rename : content/xslt/tests/buster/moz.build => dom/xslt/tests/buster/moz.build rename : content/xslt/tests/buster/result-inspector.xul => dom/xslt/tests/buster/result-inspector.xul rename : content/xslt/tests/buster/result-view.css => dom/xslt/tests/buster/result-view.css rename : content/xslt/tests/buster/result-view.js => dom/xslt/tests/buster/result-view.js rename : content/xslt/tests/buster/result-view.xul => dom/xslt/tests/buster/result-view.xul rename : content/xslt/tests/buster/xslt-qa-overlay.js => dom/xslt/tests/buster/xslt-qa-overlay.js rename : content/xslt/tests/buster/xslt-qa-overlay.xul => dom/xslt/tests/buster/xslt-qa-overlay.xul rename : content/xslt/tests/mochitest/mochitest.ini => dom/xslt/tests/mochitest/mochitest.ini rename : content/xslt/tests/mochitest/moz.build => dom/xslt/tests/mochitest/moz.build rename : content/xslt/tests/mochitest/test_bug319374.xhtml => dom/xslt/tests/mochitest/test_bug319374.xhtml rename : content/xslt/tests/mochitest/test_bug427060.html => dom/xslt/tests/mochitest/test_bug427060.html rename : content/xslt/tests/mochitest/test_bug440974.html => dom/xslt/tests/mochitest/test_bug440974.html rename : content/xslt/tests/mochitest/test_bug453441.html => dom/xslt/tests/mochitest/test_bug453441.html rename : content/xslt/tests/mochitest/test_bug468208.html => dom/xslt/tests/mochitest/test_bug468208.html rename : content/xslt/tests/mochitest/test_bug511487.html => dom/xslt/tests/mochitest/test_bug511487.html rename : content/xslt/tests/mochitest/test_bug551412.html => dom/xslt/tests/mochitest/test_bug551412.html rename : content/xslt/tests/mochitest/test_bug551654.html => dom/xslt/tests/mochitest/test_bug551654.html rename : content/xslt/tests/mochitest/test_bug566629.html => dom/xslt/tests/mochitest/test_bug566629.html rename : content/xslt/tests/mochitest/test_bug566629.xhtml => dom/xslt/tests/mochitest/test_bug566629.xhtml rename : content/xslt/tests/mochitest/test_bug603159.html => dom/xslt/tests/mochitest/test_bug603159.html rename : content/xslt/tests/mochitest/test_bug616774.html => dom/xslt/tests/mochitest/test_bug616774.html rename : content/xslt/tests/mochitest/test_bug667315.html => dom/xslt/tests/mochitest/test_bug667315.html rename : content/xslt/tests/mochitest/test_exslt_regex.html => dom/xslt/tests/mochitest/test_exslt_regex.html rename : content/xslt/public/txIEXSLTRegExFunctions.idl => dom/xslt/txIEXSLTRegExFunctions.idl rename : content/xslt/public/txIFunctionEvaluationContext.idl => dom/xslt/txIFunctionEvaluationContext.idl rename : content/xslt/public/txINodeSet.idl => dom/xslt/txINodeSet.idl rename : content/xslt/public/txIXPathObject.idl => dom/xslt/txIXPathObject.idl rename : content/xslt/src/xml/moz.build => dom/xslt/xml/moz.build rename : content/xslt/src/xml/txXMLParser.cpp => dom/xslt/xml/txXMLParser.cpp rename : content/xslt/src/xml/txXMLParser.h => dom/xslt/xml/txXMLParser.h rename : content/xslt/src/xml/txXMLUtils.cpp => dom/xslt/xml/txXMLUtils.cpp rename : content/xslt/src/xml/txXMLUtils.h => dom/xslt/xml/txXMLUtils.h rename : content/xslt/src/xpath/XPathEvaluator.cpp => dom/xslt/xpath/XPathEvaluator.cpp rename : content/xslt/src/xpath/XPathEvaluator.h => dom/xslt/xpath/XPathEvaluator.h rename : content/xslt/src/xpath/moz.build => dom/xslt/xpath/moz.build rename : content/xslt/src/xpath/nsXPathExpression.cpp => dom/xslt/xpath/nsXPathExpression.cpp rename : content/xslt/src/xpath/nsXPathExpression.h => dom/xslt/xpath/nsXPathExpression.h rename : content/xslt/src/xpath/nsXPathNSResolver.cpp => dom/xslt/xpath/nsXPathNSResolver.cpp rename : content/xslt/src/xpath/nsXPathNSResolver.h => dom/xslt/xpath/nsXPathNSResolver.h rename : content/xslt/src/xpath/nsXPathResult.cpp => dom/xslt/xpath/nsXPathResult.cpp rename : content/xslt/src/xpath/nsXPathResult.h => dom/xslt/xpath/nsXPathResult.h rename : content/xslt/src/xpath/txBooleanExpr.cpp => dom/xslt/xpath/txBooleanExpr.cpp rename : content/xslt/src/xpath/txBooleanResult.cpp => dom/xslt/xpath/txBooleanResult.cpp rename : content/xslt/src/xpath/txCoreFunctionCall.cpp => dom/xslt/xpath/txCoreFunctionCall.cpp rename : content/xslt/src/xpath/txErrorExpr.cpp => dom/xslt/xpath/txErrorExpr.cpp rename : content/xslt/src/xpath/txExpr.cpp => dom/xslt/xpath/txExpr.cpp rename : content/xslt/src/xpath/txExpr.h => dom/xslt/xpath/txExpr.h rename : content/xslt/src/xpath/txExprLexer.cpp => dom/xslt/xpath/txExprLexer.cpp rename : content/xslt/src/xpath/txExprLexer.h => dom/xslt/xpath/txExprLexer.h rename : content/xslt/src/xpath/txExprParser.cpp => dom/xslt/xpath/txExprParser.cpp rename : content/xslt/src/xpath/txExprParser.h => dom/xslt/xpath/txExprParser.h rename : content/xslt/src/xpath/txExprResult.h => dom/xslt/xpath/txExprResult.h rename : content/xslt/src/xpath/txFilterExpr.cpp => dom/xslt/xpath/txFilterExpr.cpp rename : content/xslt/src/xpath/txForwardContext.cpp => dom/xslt/xpath/txForwardContext.cpp rename : content/xslt/src/xpath/txForwardContext.h => dom/xslt/xpath/txForwardContext.h rename : content/xslt/src/xpath/txFunctionCall.cpp => dom/xslt/xpath/txFunctionCall.cpp rename : content/xslt/src/xpath/txIXPathContext.h => dom/xslt/xpath/txIXPathContext.h rename : content/xslt/src/xpath/txLiteralExpr.cpp => dom/xslt/xpath/txLiteralExpr.cpp rename : content/xslt/src/xpath/txLocationStep.cpp => dom/xslt/xpath/txLocationStep.cpp rename : content/xslt/src/xpath/txMozillaXPathTreeWalker.cpp => dom/xslt/xpath/txMozillaXPathTreeWalker.cpp rename : content/xslt/src/xpath/txNameTest.cpp => dom/xslt/xpath/txNameTest.cpp rename : content/xslt/src/xpath/txNamedAttributeStep.cpp => dom/xslt/xpath/txNamedAttributeStep.cpp rename : content/xslt/src/xpath/txNodeSet.cpp => dom/xslt/xpath/txNodeSet.cpp rename : content/xslt/src/xpath/txNodeSet.h => dom/xslt/xpath/txNodeSet.h rename : content/xslt/src/xpath/txNodeSetAdaptor.cpp => dom/xslt/xpath/txNodeSetAdaptor.cpp rename : content/xslt/src/xpath/txNodeSetAdaptor.h => dom/xslt/xpath/txNodeSetAdaptor.h rename : content/xslt/src/xpath/txNodeSetContext.cpp => dom/xslt/xpath/txNodeSetContext.cpp rename : content/xslt/src/xpath/txNodeSetContext.h => dom/xslt/xpath/txNodeSetContext.h rename : content/xslt/src/xpath/txNodeTypeTest.cpp => dom/xslt/xpath/txNodeTypeTest.cpp rename : content/xslt/src/xpath/txNumberExpr.cpp => dom/xslt/xpath/txNumberExpr.cpp rename : content/xslt/src/xpath/txNumberResult.cpp => dom/xslt/xpath/txNumberResult.cpp rename : content/xslt/src/xpath/txPathExpr.cpp => dom/xslt/xpath/txPathExpr.cpp rename : content/xslt/src/xpath/txPredicateList.cpp => dom/xslt/xpath/txPredicateList.cpp rename : content/xslt/src/xpath/txPredicatedNodeTest.cpp => dom/xslt/xpath/txPredicatedNodeTest.cpp rename : content/xslt/src/xpath/txRelationalExpr.cpp => dom/xslt/xpath/txRelationalExpr.cpp rename : content/xslt/src/xpath/txResultRecycler.cpp => dom/xslt/xpath/txResultRecycler.cpp rename : content/xslt/src/xpath/txResultRecycler.h => dom/xslt/xpath/txResultRecycler.h rename : content/xslt/src/xpath/txRootExpr.cpp => dom/xslt/xpath/txRootExpr.cpp rename : content/xslt/src/xpath/txSingleNodeContext.h => dom/xslt/xpath/txSingleNodeContext.h rename : content/xslt/src/xpath/txStringResult.cpp => dom/xslt/xpath/txStringResult.cpp rename : content/xslt/src/xpath/txUnaryExpr.cpp => dom/xslt/xpath/txUnaryExpr.cpp rename : content/xslt/src/xpath/txUnionExpr.cpp => dom/xslt/xpath/txUnionExpr.cpp rename : content/xslt/src/xpath/txUnionNodeTest.cpp => dom/xslt/xpath/txUnionNodeTest.cpp rename : content/xslt/src/xpath/txVariableRefExpr.cpp => dom/xslt/xpath/txVariableRefExpr.cpp rename : content/xslt/src/xpath/txXPCOMExtensionFunction.cpp => dom/xslt/xpath/txXPCOMExtensionFunction.cpp rename : content/xslt/src/xpath/txXPathNode.h => dom/xslt/xpath/txXPathNode.h rename : content/xslt/src/xpath/txXPathObjectAdaptor.h => dom/xslt/xpath/txXPathObjectAdaptor.h rename : content/xslt/src/xpath/txXPathOptimizer.cpp => dom/xslt/xpath/txXPathOptimizer.cpp rename : content/xslt/src/xpath/txXPathOptimizer.h => dom/xslt/xpath/txXPathOptimizer.h rename : content/xslt/src/xpath/txXPathTreeWalker.h => dom/xslt/xpath/txXPathTreeWalker.h rename : content/xslt/src/xslt/moz.build => dom/xslt/xslt/moz.build rename : content/xslt/src/xslt/txBufferingHandler.cpp => dom/xslt/xslt/txBufferingHandler.cpp rename : content/xslt/src/xslt/txBufferingHandler.h => dom/xslt/xslt/txBufferingHandler.h rename : content/xslt/src/xslt/txCurrentFunctionCall.cpp => dom/xslt/xslt/txCurrentFunctionCall.cpp rename : content/xslt/src/xslt/txDocumentFunctionCall.cpp => dom/xslt/xslt/txDocumentFunctionCall.cpp rename : content/xslt/src/xslt/txEXSLTFunctions.cpp => dom/xslt/xslt/txEXSLTFunctions.cpp rename : content/xslt/src/xslt/txEXSLTRegExFunctions.js => dom/xslt/xslt/txEXSLTRegExFunctions.js rename : content/xslt/src/xslt/txEXSLTRegExFunctions.manifest => dom/xslt/xslt/txEXSLTRegExFunctions.manifest rename : content/xslt/src/xslt/txExecutionState.cpp => dom/xslt/xslt/txExecutionState.cpp rename : content/xslt/src/xslt/txExecutionState.h => dom/xslt/xslt/txExecutionState.h rename : content/xslt/src/xslt/txFormatNumberFunctionCall.cpp => dom/xslt/xslt/txFormatNumberFunctionCall.cpp rename : content/xslt/src/xslt/txGenerateIdFunctionCall.cpp => dom/xslt/xslt/txGenerateIdFunctionCall.cpp rename : content/xslt/src/xslt/txInstructions.cpp => dom/xslt/xslt/txInstructions.cpp rename : content/xslt/src/xslt/txInstructions.h => dom/xslt/xslt/txInstructions.h rename : content/xslt/src/xslt/txKey.h => dom/xslt/xslt/txKey.h rename : content/xslt/src/xslt/txKeyFunctionCall.cpp => dom/xslt/xslt/txKeyFunctionCall.cpp rename : content/xslt/src/xslt/txMozillaStylesheetCompiler.cpp => dom/xslt/xslt/txMozillaStylesheetCompiler.cpp rename : content/xslt/src/xslt/txMozillaTextOutput.cpp => dom/xslt/xslt/txMozillaTextOutput.cpp rename : content/xslt/src/xslt/txMozillaTextOutput.h => dom/xslt/xslt/txMozillaTextOutput.h rename : content/xslt/src/xslt/txMozillaXMLOutput.cpp => dom/xslt/xslt/txMozillaXMLOutput.cpp rename : content/xslt/src/xslt/txMozillaXMLOutput.h => dom/xslt/xslt/txMozillaXMLOutput.h rename : content/xslt/src/xslt/txMozillaXSLTProcessor.cpp => dom/xslt/xslt/txMozillaXSLTProcessor.cpp rename : content/xslt/src/xslt/txMozillaXSLTProcessor.h => dom/xslt/xslt/txMozillaXSLTProcessor.h rename : content/xslt/src/xslt/txNodeSorter.cpp => dom/xslt/xslt/txNodeSorter.cpp rename : content/xslt/src/xslt/txNodeSorter.h => dom/xslt/xslt/txNodeSorter.h rename : content/xslt/src/xslt/txOutputFormat.cpp => dom/xslt/xslt/txOutputFormat.cpp rename : content/xslt/src/xslt/txOutputFormat.h => dom/xslt/xslt/txOutputFormat.h rename : content/xslt/src/xslt/txPatternOptimizer.cpp => dom/xslt/xslt/txPatternOptimizer.cpp rename : content/xslt/src/xslt/txPatternOptimizer.h => dom/xslt/xslt/txPatternOptimizer.h rename : content/xslt/src/xslt/txPatternParser.cpp => dom/xslt/xslt/txPatternParser.cpp rename : content/xslt/src/xslt/txPatternParser.h => dom/xslt/xslt/txPatternParser.h rename : content/xslt/src/xslt/txRtfHandler.cpp => dom/xslt/xslt/txRtfHandler.cpp rename : content/xslt/src/xslt/txRtfHandler.h => dom/xslt/xslt/txRtfHandler.h rename : content/xslt/src/xslt/txStylesheet.cpp => dom/xslt/xslt/txStylesheet.cpp rename : content/xslt/src/xslt/txStylesheet.h => dom/xslt/xslt/txStylesheet.h rename : content/xslt/src/xslt/txStylesheetCompileHandlers.cpp => dom/xslt/xslt/txStylesheetCompileHandlers.cpp rename : content/xslt/src/xslt/txStylesheetCompileHandlers.h => dom/xslt/xslt/txStylesheetCompileHandlers.h rename : content/xslt/src/xslt/txStylesheetCompiler.cpp => dom/xslt/xslt/txStylesheetCompiler.cpp rename : content/xslt/src/xslt/txStylesheetCompiler.h => dom/xslt/xslt/txStylesheetCompiler.h rename : content/xslt/src/xslt/txTextHandler.cpp => dom/xslt/xslt/txTextHandler.cpp rename : content/xslt/src/xslt/txTextHandler.h => dom/xslt/xslt/txTextHandler.h rename : content/xslt/src/xslt/txToplevelItems.cpp => dom/xslt/xslt/txToplevelItems.cpp rename : content/xslt/src/xslt/txToplevelItems.h => dom/xslt/xslt/txToplevelItems.h rename : content/xslt/src/xslt/txUnknownHandler.cpp => dom/xslt/xslt/txUnknownHandler.cpp rename : content/xslt/src/xslt/txUnknownHandler.h => dom/xslt/xslt/txUnknownHandler.h rename : content/xslt/src/xslt/txVariableMap.h => dom/xslt/xslt/txVariableMap.h rename : content/xslt/src/xslt/txXMLEventHandler.h => dom/xslt/xslt/txXMLEventHandler.h rename : content/xslt/src/xslt/txXPathResultComparator.cpp => dom/xslt/xslt/txXPathResultComparator.cpp rename : content/xslt/src/xslt/txXPathResultComparator.h => dom/xslt/xslt/txXPathResultComparator.h rename : content/xslt/src/xslt/txXSLTEnvironmentFunctionCall.cpp => dom/xslt/xslt/txXSLTEnvironmentFunctionCall.cpp rename : content/xslt/src/xslt/txXSLTFunctions.h => dom/xslt/xslt/txXSLTFunctions.h rename : content/xslt/src/xslt/txXSLTNumber.cpp => dom/xslt/xslt/txXSLTNumber.cpp rename : content/xslt/src/xslt/txXSLTNumber.h => dom/xslt/xslt/txXSLTNumber.h rename : content/xslt/src/xslt/txXSLTNumberCounters.cpp => dom/xslt/xslt/txXSLTNumberCounters.cpp rename : content/xslt/src/xslt/txXSLTPatterns.cpp => dom/xslt/xslt/txXSLTPatterns.cpp rename : content/xslt/src/xslt/txXSLTPatterns.h => dom/xslt/xslt/txXSLTPatterns.h rename : content/xslt/src/xslt/txXSLTProcessor.cpp => dom/xslt/xslt/txXSLTProcessor.cpp rename : content/xslt/src/xslt/txXSLTProcessor.h => dom/xslt/xslt/txXSLTProcessor.h extra : rebase_source : 2ffae4527252a6937dd1ee2053d2c9d4fbe268fb
1007 lines
26 KiB
C++
1007 lines
26 KiB
C++
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#ifndef TRANSFRMX_EXPR_H
|
|
#define TRANSFRMX_EXPR_H
|
|
|
|
#include "mozilla/Attributes.h"
|
|
#include "nsAutoPtr.h"
|
|
#include "txExprResult.h"
|
|
#include "txCore.h"
|
|
#include "nsString.h"
|
|
#include "txOwningArray.h"
|
|
#include "nsIAtom.h"
|
|
|
|
#ifdef DEBUG
|
|
#define TX_TO_STRING
|
|
#endif
|
|
|
|
/*
|
|
XPath class definitions.
|
|
Much of this code was ported from XSL:P.
|
|
*/
|
|
|
|
class nsIAtom;
|
|
class txIParseContext;
|
|
class txIMatchContext;
|
|
class txIEvalContext;
|
|
class txNodeSet;
|
|
class txXPathNode;
|
|
|
|
/**
|
|
* A Base Class for all XSL Expressions
|
|
**/
|
|
class Expr
|
|
{
|
|
public:
|
|
Expr()
|
|
{
|
|
MOZ_COUNT_CTOR(Expr);
|
|
}
|
|
virtual ~Expr()
|
|
{
|
|
MOZ_COUNT_DTOR(Expr);
|
|
}
|
|
|
|
/**
|
|
* Evaluates this Expr based on the given context node and processor state
|
|
* @param context the context node for evaluation of this Expr
|
|
* @param ps the ContextState containing the stack information needed
|
|
* for evaluation
|
|
* @return the result of the evaluation
|
|
**/
|
|
virtual nsresult evaluate(txIEvalContext* aContext,
|
|
txAExprResult** aResult) = 0;
|
|
|
|
|
|
/**
|
|
* Returns the type of this expression.
|
|
*/
|
|
enum ExprType {
|
|
LOCATIONSTEP_EXPR,
|
|
PATH_EXPR,
|
|
UNION_EXPR,
|
|
LITERAL_EXPR,
|
|
OTHER_EXPR
|
|
};
|
|
virtual ExprType getType()
|
|
{
|
|
return OTHER_EXPR;
|
|
}
|
|
|
|
/**
|
|
* Returns the type or types of results this Expr return.
|
|
*/
|
|
typedef uint16_t ResultType;
|
|
enum {
|
|
NODESET_RESULT = 0x01,
|
|
BOOLEAN_RESULT = 0x02,
|
|
NUMBER_RESULT = 0x04,
|
|
STRING_RESULT = 0x08,
|
|
RTF_RESULT = 0x10,
|
|
ANY_RESULT = 0xFFFF
|
|
};
|
|
virtual ResultType getReturnType() = 0;
|
|
bool canReturnType(ResultType aType)
|
|
{
|
|
return (getReturnType() & aType) != 0;
|
|
}
|
|
|
|
typedef uint16_t ContextSensitivity;
|
|
enum {
|
|
NO_CONTEXT = 0x00,
|
|
NODE_CONTEXT = 0x01,
|
|
POSITION_CONTEXT = 0x02,
|
|
SIZE_CONTEXT = 0x04,
|
|
NODESET_CONTEXT = POSITION_CONTEXT | SIZE_CONTEXT,
|
|
VARIABLES_CONTEXT = 0x08,
|
|
PRIVATE_CONTEXT = 0x10,
|
|
ANY_CONTEXT = 0xFFFF
|
|
};
|
|
|
|
/**
|
|
* Returns true if this expression is sensitive to *any* of
|
|
* the requested contexts in aContexts.
|
|
*/
|
|
virtual bool isSensitiveTo(ContextSensitivity aContexts) = 0;
|
|
|
|
/**
|
|
* Returns sub-expression at given position
|
|
*/
|
|
virtual Expr* getSubExprAt(uint32_t aPos) = 0;
|
|
|
|
/**
|
|
* Replace sub-expression at given position. Does not delete the old
|
|
* expression, that is the responsibility of the caller.
|
|
*/
|
|
virtual void setSubExprAt(uint32_t aPos, Expr* aExpr) = 0;
|
|
|
|
virtual nsresult evaluateToBool(txIEvalContext* aContext,
|
|
bool& aResult);
|
|
|
|
virtual nsresult evaluateToString(txIEvalContext* aContext,
|
|
nsString& aResult);
|
|
|
|
#ifdef TX_TO_STRING
|
|
/**
|
|
* Returns the String representation of this Expr.
|
|
* @param dest the String to use when creating the String
|
|
* representation. The String representation will be appended to
|
|
* any data in the destination String, to allow cascading calls to
|
|
* other #toString() methods for Expressions.
|
|
* @return the String representation of this Expr.
|
|
**/
|
|
virtual void toString(nsAString& str) = 0;
|
|
#endif
|
|
}; //-- Expr
|
|
|
|
#ifdef TX_TO_STRING
|
|
#define TX_DECL_TOSTRING \
|
|
void toString(nsAString& aDest);
|
|
#define TX_DECL_GETNAMEATOM \
|
|
nsresult getNameAtom(nsIAtom** aAtom);
|
|
#else
|
|
#define TX_DECL_TOSTRING
|
|
#define TX_DECL_GETNAMEATOM
|
|
#endif
|
|
|
|
#define TX_DECL_EXPR_BASE \
|
|
nsresult evaluate(txIEvalContext* aContext, txAExprResult** aResult); \
|
|
ResultType getReturnType(); \
|
|
bool isSensitiveTo(ContextSensitivity aContexts);
|
|
|
|
#define TX_DECL_EXPR \
|
|
TX_DECL_EXPR_BASE \
|
|
TX_DECL_TOSTRING \
|
|
Expr* getSubExprAt(uint32_t aPos); \
|
|
void setSubExprAt(uint32_t aPos, Expr* aExpr);
|
|
|
|
#define TX_DECL_OPTIMIZABLE_EXPR \
|
|
TX_DECL_EXPR \
|
|
ExprType getType();
|
|
|
|
|
|
#define TX_DECL_FUNCTION \
|
|
TX_DECL_GETNAMEATOM \
|
|
TX_DECL_EXPR_BASE
|
|
|
|
#define TX_IMPL_EXPR_STUBS_BASE(_class, _ReturnType) \
|
|
Expr::ResultType \
|
|
_class::getReturnType() \
|
|
{ \
|
|
return _ReturnType; \
|
|
}
|
|
|
|
#define TX_IMPL_EXPR_STUBS_0(_class, _ReturnType) \
|
|
TX_IMPL_EXPR_STUBS_BASE(_class, _ReturnType) \
|
|
Expr* \
|
|
_class::getSubExprAt(uint32_t aPos) \
|
|
{ \
|
|
return nullptr; \
|
|
} \
|
|
void \
|
|
_class::setSubExprAt(uint32_t aPos, Expr* aExpr) \
|
|
{ \
|
|
NS_NOTREACHED("setting bad subexpression index"); \
|
|
}
|
|
|
|
#define TX_IMPL_EXPR_STUBS_1(_class, _ReturnType, _Expr1) \
|
|
TX_IMPL_EXPR_STUBS_BASE(_class, _ReturnType) \
|
|
Expr* \
|
|
_class::getSubExprAt(uint32_t aPos) \
|
|
{ \
|
|
if (aPos == 0) { \
|
|
return _Expr1; \
|
|
} \
|
|
return nullptr; \
|
|
} \
|
|
void \
|
|
_class::setSubExprAt(uint32_t aPos, Expr* aExpr) \
|
|
{ \
|
|
NS_ASSERTION(aPos < 1, "setting bad subexpression index");\
|
|
_Expr1.forget(); \
|
|
_Expr1 = aExpr; \
|
|
}
|
|
|
|
#define TX_IMPL_EXPR_STUBS_2(_class, _ReturnType, _Expr1, _Expr2) \
|
|
TX_IMPL_EXPR_STUBS_BASE(_class, _ReturnType) \
|
|
Expr* \
|
|
_class::getSubExprAt(uint32_t aPos) \
|
|
{ \
|
|
switch(aPos) { \
|
|
case 0: \
|
|
return _Expr1; \
|
|
case 1: \
|
|
return _Expr2; \
|
|
default: \
|
|
break; \
|
|
} \
|
|
return nullptr; \
|
|
} \
|
|
void \
|
|
_class::setSubExprAt(uint32_t aPos, Expr* aExpr) \
|
|
{ \
|
|
NS_ASSERTION(aPos < 2, "setting bad subexpression index");\
|
|
if (aPos == 0) { \
|
|
_Expr1.forget(); \
|
|
_Expr1 = aExpr; \
|
|
} \
|
|
else { \
|
|
_Expr2.forget(); \
|
|
_Expr2 = aExpr; \
|
|
} \
|
|
}
|
|
|
|
#define TX_IMPL_EXPR_STUBS_LIST(_class, _ReturnType, _ExprList) \
|
|
TX_IMPL_EXPR_STUBS_BASE(_class, _ReturnType) \
|
|
Expr* \
|
|
_class::getSubExprAt(uint32_t aPos) \
|
|
{ \
|
|
return _ExprList.SafeElementAt(aPos); \
|
|
} \
|
|
void \
|
|
_class::setSubExprAt(uint32_t aPos, Expr* aExpr) \
|
|
{ \
|
|
NS_ASSERTION(aPos < _ExprList.Length(), \
|
|
"setting bad subexpression index"); \
|
|
_ExprList[aPos] = aExpr; \
|
|
}
|
|
|
|
|
|
/**
|
|
* This class represents a FunctionCall as defined by the XPath 1.0
|
|
* Recommendation.
|
|
**/
|
|
class FunctionCall : public Expr
|
|
{
|
|
public:
|
|
/**
|
|
* Adds the given parameter to this FunctionCall's parameter list.
|
|
* The ownership of the given Expr is passed over to the FunctionCall,
|
|
* even on failure.
|
|
* @param aExpr the Expr to add to this FunctionCall's parameter list
|
|
* @return nsresult indicating out of memory
|
|
*/
|
|
nsresult addParam(Expr* aExpr)
|
|
{
|
|
return mParams.AppendElement(aExpr) ?
|
|
NS_OK : NS_ERROR_OUT_OF_MEMORY;
|
|
}
|
|
|
|
/**
|
|
* Check if the number of parameters falls within a range.
|
|
*
|
|
* @param aParamCountMin minimum number of required parameters.
|
|
* @param aParamCountMax maximum number of parameters. If aParamCountMax
|
|
* is negative the maximum number is not checked.
|
|
* @return boolean representing whether the number of parameters falls
|
|
* within the expected range or not.
|
|
*
|
|
* XXX txIEvalContext should be txIParseContest, bug 143291
|
|
*/
|
|
virtual bool requireParams(int32_t aParamCountMin,
|
|
int32_t aParamCountMax,
|
|
txIEvalContext* aContext);
|
|
|
|
TX_DECL_TOSTRING
|
|
Expr* getSubExprAt(uint32_t aPos) MOZ_OVERRIDE;
|
|
void setSubExprAt(uint32_t aPos, Expr* aExpr) MOZ_OVERRIDE;
|
|
|
|
protected:
|
|
|
|
txOwningArray<Expr> mParams;
|
|
|
|
/*
|
|
* Evaluates the given Expression and converts its result to a number.
|
|
*/
|
|
static nsresult evaluateToNumber(Expr* aExpr, txIEvalContext* aContext,
|
|
double* aResult);
|
|
|
|
/*
|
|
* Evaluates the given Expression and converts its result to a NodeSet.
|
|
* If the result is not a NodeSet an error is returned.
|
|
*/
|
|
static nsresult evaluateToNodeSet(Expr* aExpr, txIEvalContext* aContext,
|
|
txNodeSet** aResult);
|
|
|
|
/**
|
|
* Returns true if any argument is sensitive to the given context.
|
|
*/
|
|
bool argsSensitiveTo(ContextSensitivity aContexts);
|
|
|
|
|
|
#ifdef TX_TO_STRING
|
|
/*
|
|
* Returns the name of the function as an atom.
|
|
*/
|
|
virtual nsresult getNameAtom(nsIAtom** aAtom) = 0;
|
|
#endif
|
|
};
|
|
|
|
class txCoreFunctionCall : public FunctionCall
|
|
{
|
|
public:
|
|
|
|
// This must be ordered in the same order as descriptTable in
|
|
// txCoreFunctionCall.cpp. If you change one, change the other.
|
|
enum eType {
|
|
COUNT = 0, // count()
|
|
ID, // id()
|
|
LAST, // last()
|
|
LOCAL_NAME, // local-name()
|
|
NAMESPACE_URI, // namespace-uri()
|
|
NAME, // name()
|
|
POSITION, // position()
|
|
|
|
CONCAT, // concat()
|
|
CONTAINS, // contains()
|
|
NORMALIZE_SPACE, // normalize-space()
|
|
STARTS_WITH, // starts-with()
|
|
STRING, // string()
|
|
STRING_LENGTH, // string-length()
|
|
SUBSTRING, // substring()
|
|
SUBSTRING_AFTER, // substring-after()
|
|
SUBSTRING_BEFORE, // substring-before()
|
|
TRANSLATE, // translate()
|
|
|
|
NUMBER, // number()
|
|
ROUND, // round()
|
|
FLOOR, // floor()
|
|
CEILING, // ceiling()
|
|
SUM, // sum()
|
|
|
|
BOOLEAN, // boolean()
|
|
_FALSE, // false()
|
|
LANG, // lang()
|
|
_NOT, // not()
|
|
_TRUE // true()
|
|
};
|
|
|
|
/*
|
|
* Creates a txCoreFunctionCall of the given type
|
|
*/
|
|
txCoreFunctionCall(eType aType) : mType(aType)
|
|
{
|
|
}
|
|
|
|
TX_DECL_FUNCTION
|
|
|
|
static bool getTypeFromAtom(nsIAtom* aName, eType& aType);
|
|
|
|
private:
|
|
eType mType;
|
|
};
|
|
|
|
|
|
/*
|
|
* This class represents a NodeTest as defined by the XPath spec
|
|
*/
|
|
class txNodeTest
|
|
{
|
|
public:
|
|
txNodeTest()
|
|
{
|
|
MOZ_COUNT_CTOR(txNodeTest);
|
|
}
|
|
virtual ~txNodeTest()
|
|
{
|
|
MOZ_COUNT_DTOR(txNodeTest);
|
|
}
|
|
|
|
/*
|
|
* Virtual methods
|
|
* pretty much a txPattern, but not supposed to be used
|
|
* standalone. The NodeTest node() is different to the
|
|
* Pattern "node()" (document node isn't matched)
|
|
*/
|
|
virtual bool matches(const txXPathNode& aNode,
|
|
txIMatchContext* aContext) = 0;
|
|
virtual double getDefaultPriority() = 0;
|
|
|
|
/**
|
|
* Returns the type of this nodetest.
|
|
*/
|
|
enum NodeTestType {
|
|
NAME_TEST,
|
|
NODETYPE_TEST,
|
|
OTHER_TEST
|
|
};
|
|
virtual NodeTestType getType()
|
|
{
|
|
return OTHER_TEST;
|
|
}
|
|
|
|
/**
|
|
* Returns true if this expression is sensitive to *any* of
|
|
* the requested flags.
|
|
*/
|
|
virtual bool isSensitiveTo(Expr::ContextSensitivity aContext) = 0;
|
|
|
|
#ifdef TX_TO_STRING
|
|
virtual void toString(nsAString& aDest) = 0;
|
|
#endif
|
|
};
|
|
|
|
#define TX_DECL_NODE_TEST \
|
|
TX_DECL_TOSTRING \
|
|
bool matches(const txXPathNode& aNode, txIMatchContext* aContext); \
|
|
double getDefaultPriority(); \
|
|
bool isSensitiveTo(Expr::ContextSensitivity aContext);
|
|
|
|
/*
|
|
* This class represents a NameTest as defined by the XPath spec
|
|
*/
|
|
class txNameTest : public txNodeTest
|
|
{
|
|
public:
|
|
/*
|
|
* Creates a new txNameTest with the given type and the given
|
|
* principal node type
|
|
*/
|
|
txNameTest(nsIAtom* aPrefix, nsIAtom* aLocalName, int32_t aNSID,
|
|
uint16_t aNodeType);
|
|
|
|
NodeTestType getType() MOZ_OVERRIDE;
|
|
|
|
TX_DECL_NODE_TEST
|
|
|
|
nsCOMPtr<nsIAtom> mPrefix;
|
|
nsCOMPtr<nsIAtom> mLocalName;
|
|
int32_t mNamespace;
|
|
private:
|
|
uint16_t mNodeType;
|
|
};
|
|
|
|
/*
|
|
* This class represents a NodeType as defined by the XPath spec
|
|
*/
|
|
class txNodeTypeTest : public txNodeTest
|
|
{
|
|
public:
|
|
enum NodeType {
|
|
COMMENT_TYPE,
|
|
TEXT_TYPE,
|
|
PI_TYPE,
|
|
NODE_TYPE
|
|
};
|
|
|
|
/*
|
|
* Creates a new txNodeTypeTest of the given type
|
|
*/
|
|
txNodeTypeTest(NodeType aNodeType)
|
|
: mNodeType(aNodeType)
|
|
{
|
|
}
|
|
|
|
/*
|
|
* Sets the name of the node to match. Only availible for pi nodes
|
|
*/
|
|
void setNodeName(const nsAString& aName)
|
|
{
|
|
mNodeName = do_GetAtom(aName);
|
|
}
|
|
|
|
NodeType getNodeTestType()
|
|
{
|
|
return mNodeType;
|
|
}
|
|
|
|
NodeTestType getType() MOZ_OVERRIDE;
|
|
|
|
TX_DECL_NODE_TEST
|
|
|
|
private:
|
|
NodeType mNodeType;
|
|
nsCOMPtr<nsIAtom> mNodeName;
|
|
};
|
|
|
|
/**
|
|
* Class representing a nodetest combined with a predicate. May only be used
|
|
* if the predicate is not sensitive to the context-nodelist.
|
|
*/
|
|
class txPredicatedNodeTest : public txNodeTest
|
|
{
|
|
public:
|
|
txPredicatedNodeTest(txNodeTest* aNodeTest, Expr* aPredicate);
|
|
TX_DECL_NODE_TEST
|
|
|
|
private:
|
|
nsAutoPtr<txNodeTest> mNodeTest;
|
|
nsAutoPtr<Expr> mPredicate;
|
|
};
|
|
|
|
/**
|
|
* Represents an ordered list of Predicates,
|
|
* for use with Step and Filter Expressions
|
|
**/
|
|
class PredicateList {
|
|
public:
|
|
/**
|
|
* Adds the given Expr to the list.
|
|
* The ownership of the given Expr is passed over the PredicateList,
|
|
* even on failure.
|
|
* @param aExpr the Expr to add to the list
|
|
* @return nsresult indicating out of memory
|
|
*/
|
|
nsresult add(Expr* aExpr)
|
|
{
|
|
NS_ASSERTION(aExpr, "missing expression");
|
|
return mPredicates.AppendElement(aExpr) ?
|
|
NS_OK : NS_ERROR_OUT_OF_MEMORY;
|
|
}
|
|
|
|
nsresult evaluatePredicates(txNodeSet* aNodes, txIMatchContext* aContext);
|
|
|
|
/**
|
|
* Drops the first predicate without deleting it.
|
|
*/
|
|
void dropFirst()
|
|
{
|
|
mPredicates.RemoveElementAt(0);
|
|
}
|
|
|
|
/**
|
|
* returns true if this predicate list is empty
|
|
**/
|
|
bool isEmpty()
|
|
{
|
|
return mPredicates.IsEmpty();
|
|
}
|
|
|
|
#ifdef TX_TO_STRING
|
|
/**
|
|
* Returns the String representation of this PredicateList.
|
|
* @param dest the String to use when creating the String
|
|
* representation. The String representation will be appended to
|
|
* any data in the destination String, to allow cascading calls to
|
|
* other #toString() methods for Expressions.
|
|
* @return the String representation of this PredicateList.
|
|
**/
|
|
void toString(nsAString& dest);
|
|
#endif
|
|
|
|
protected:
|
|
bool isSensitiveTo(Expr::ContextSensitivity aContext);
|
|
Expr* getSubExprAt(uint32_t aPos)
|
|
{
|
|
return mPredicates.SafeElementAt(aPos);
|
|
}
|
|
void setSubExprAt(uint32_t aPos, Expr* aExpr)
|
|
{
|
|
NS_ASSERTION(aPos < mPredicates.Length(),
|
|
"setting bad subexpression index");
|
|
mPredicates[aPos] = aExpr;
|
|
}
|
|
|
|
//-- list of predicates
|
|
txOwningArray<Expr> mPredicates;
|
|
}; //-- PredicateList
|
|
|
|
class LocationStep : public Expr,
|
|
public PredicateList
|
|
{
|
|
public:
|
|
enum LocationStepType {
|
|
ANCESTOR_AXIS = 0,
|
|
ANCESTOR_OR_SELF_AXIS,
|
|
ATTRIBUTE_AXIS,
|
|
CHILD_AXIS,
|
|
DESCENDANT_AXIS,
|
|
DESCENDANT_OR_SELF_AXIS,
|
|
FOLLOWING_AXIS,
|
|
FOLLOWING_SIBLING_AXIS,
|
|
NAMESPACE_AXIS,
|
|
PARENT_AXIS,
|
|
PRECEDING_AXIS,
|
|
PRECEDING_SIBLING_AXIS,
|
|
SELF_AXIS
|
|
};
|
|
|
|
/**
|
|
* Creates a new LocationStep using the given NodeExpr and Axis Identifier
|
|
* @param nodeExpr the NodeExpr to use when matching Nodes
|
|
* @param axisIdentifier the Axis Identifier in which to search for nodes
|
|
**/
|
|
LocationStep(txNodeTest* aNodeTest,
|
|
LocationStepType aAxisIdentifier)
|
|
: mNodeTest(aNodeTest),
|
|
mAxisIdentifier(aAxisIdentifier)
|
|
{
|
|
}
|
|
|
|
TX_DECL_OPTIMIZABLE_EXPR
|
|
|
|
txNodeTest* getNodeTest()
|
|
{
|
|
return mNodeTest;
|
|
}
|
|
void setNodeTest(txNodeTest* aNodeTest)
|
|
{
|
|
mNodeTest.forget();
|
|
mNodeTest = aNodeTest;
|
|
}
|
|
LocationStepType getAxisIdentifier()
|
|
{
|
|
return mAxisIdentifier;
|
|
}
|
|
void setAxisIdentifier(LocationStepType aAxisIdentifier)
|
|
{
|
|
mAxisIdentifier = aAxisIdentifier;
|
|
}
|
|
|
|
private:
|
|
void fromDescendants(const txXPathNode& aNode, txIMatchContext* aCs,
|
|
txNodeSet* aNodes);
|
|
void fromDescendantsRev(const txXPathNode& aNode, txIMatchContext* aCs,
|
|
txNodeSet* aNodes);
|
|
|
|
nsAutoPtr<txNodeTest> mNodeTest;
|
|
LocationStepType mAxisIdentifier;
|
|
};
|
|
|
|
class FilterExpr : public Expr,
|
|
public PredicateList
|
|
{
|
|
public:
|
|
|
|
/**
|
|
* Creates a new FilterExpr using the given Expr
|
|
* @param expr the Expr to use for evaluation
|
|
*/
|
|
FilterExpr(Expr* aExpr)
|
|
: expr(aExpr)
|
|
{
|
|
}
|
|
|
|
TX_DECL_EXPR
|
|
|
|
private:
|
|
nsAutoPtr<Expr> expr;
|
|
|
|
}; //-- FilterExpr
|
|
|
|
|
|
class txLiteralExpr : public Expr {
|
|
public:
|
|
txLiteralExpr(double aDbl)
|
|
: mValue(new NumberResult(aDbl, nullptr))
|
|
{
|
|
}
|
|
txLiteralExpr(const nsAString& aStr)
|
|
: mValue(new StringResult(aStr, nullptr))
|
|
{
|
|
}
|
|
txLiteralExpr(txAExprResult* aValue)
|
|
: mValue(aValue)
|
|
{
|
|
}
|
|
|
|
TX_DECL_EXPR
|
|
|
|
private:
|
|
nsRefPtr<txAExprResult> mValue;
|
|
};
|
|
|
|
/**
|
|
* Represents an UnaryExpr. Returns the negative value of its expr.
|
|
**/
|
|
class UnaryExpr : public Expr {
|
|
|
|
public:
|
|
|
|
UnaryExpr(Expr* aExpr)
|
|
: expr(aExpr)
|
|
{
|
|
}
|
|
|
|
TX_DECL_EXPR
|
|
|
|
private:
|
|
nsAutoPtr<Expr> expr;
|
|
}; //-- UnaryExpr
|
|
|
|
/**
|
|
* Represents a BooleanExpr, a binary expression that
|
|
* performs a boolean operation between its lvalue and rvalue.
|
|
**/
|
|
class BooleanExpr : public Expr
|
|
{
|
|
public:
|
|
|
|
//-- BooleanExpr Types
|
|
enum _BooleanExprType { AND = 1, OR };
|
|
|
|
BooleanExpr(Expr* aLeftExpr, Expr* aRightExpr, short aOp)
|
|
: leftExpr(aLeftExpr),
|
|
rightExpr(aRightExpr),
|
|
op(aOp)
|
|
{
|
|
}
|
|
|
|
TX_DECL_EXPR
|
|
|
|
private:
|
|
nsAutoPtr<Expr> leftExpr, rightExpr;
|
|
short op;
|
|
}; //-- BooleanExpr
|
|
|
|
/**
|
|
* Represents a MultiplicativeExpr, a binary expression that
|
|
* performs a multiplicative operation between its lvalue and rvalue:
|
|
* * : multiply
|
|
* mod : modulus
|
|
* div : divide
|
|
*
|
|
**/
|
|
class txNumberExpr : public Expr
|
|
{
|
|
public:
|
|
|
|
enum eOp { ADD, SUBTRACT, DIVIDE, MULTIPLY, MODULUS };
|
|
|
|
txNumberExpr(Expr* aLeftExpr, Expr* aRightExpr, eOp aOp)
|
|
: mLeftExpr(aLeftExpr),
|
|
mRightExpr(aRightExpr),
|
|
mOp(aOp)
|
|
{
|
|
}
|
|
|
|
TX_DECL_EXPR
|
|
|
|
private:
|
|
nsAutoPtr<Expr> mLeftExpr, mRightExpr;
|
|
eOp mOp;
|
|
}; //-- MultiplicativeExpr
|
|
|
|
/**
|
|
* Represents a RelationalExpr, an expression that compares its lvalue
|
|
* to its rvalue using:
|
|
* = : equal to
|
|
* < : less than
|
|
* > : greater than
|
|
* <= : less than or equal to
|
|
* >= : greater than or equal to
|
|
*
|
|
**/
|
|
class RelationalExpr : public Expr
|
|
{
|
|
public:
|
|
enum RelationalExprType {
|
|
EQUAL,
|
|
NOT_EQUAL,
|
|
LESS_THAN,
|
|
GREATER_THAN,
|
|
LESS_OR_EQUAL,
|
|
GREATER_OR_EQUAL
|
|
};
|
|
|
|
RelationalExpr(Expr* aLeftExpr, Expr* aRightExpr, RelationalExprType aOp)
|
|
: mLeftExpr(aLeftExpr),
|
|
mRightExpr(aRightExpr),
|
|
mOp(aOp)
|
|
{
|
|
}
|
|
|
|
|
|
TX_DECL_EXPR
|
|
|
|
private:
|
|
bool compareResults(txIEvalContext* aContext, txAExprResult* aLeft,
|
|
txAExprResult* aRight);
|
|
|
|
nsAutoPtr<Expr> mLeftExpr;
|
|
nsAutoPtr<Expr> mRightExpr;
|
|
RelationalExprType mOp;
|
|
};
|
|
|
|
/**
|
|
* VariableRefExpr
|
|
* Represents a variable reference ($refname)
|
|
**/
|
|
class VariableRefExpr : public Expr {
|
|
|
|
public:
|
|
|
|
VariableRefExpr(nsIAtom* aPrefix, nsIAtom* aLocalName, int32_t aNSID);
|
|
|
|
TX_DECL_EXPR
|
|
|
|
private:
|
|
nsCOMPtr<nsIAtom> mPrefix;
|
|
nsCOMPtr<nsIAtom> mLocalName;
|
|
int32_t mNamespace;
|
|
};
|
|
|
|
/**
|
|
* Represents a PathExpr
|
|
**/
|
|
class PathExpr : public Expr {
|
|
|
|
public:
|
|
|
|
//-- Path Operators
|
|
//-- RELATIVE_OP is the default
|
|
//-- LF, changed from static const short to enum
|
|
enum PathOperator { RELATIVE_OP, DESCENDANT_OP };
|
|
|
|
/**
|
|
* Adds the Expr to this PathExpr
|
|
* The ownership of the given Expr is passed over the PathExpr,
|
|
* even on failure.
|
|
* @param aExpr the Expr to add to this PathExpr
|
|
* @return nsresult indicating out of memory
|
|
*/
|
|
nsresult addExpr(Expr* aExpr, PathOperator pathOp);
|
|
|
|
/**
|
|
* Removes and deletes the expression at the given index.
|
|
*/
|
|
void deleteExprAt(uint32_t aPos)
|
|
{
|
|
NS_ASSERTION(aPos < mItems.Length(),
|
|
"killing bad expression index");
|
|
mItems.RemoveElementAt(aPos);
|
|
}
|
|
|
|
TX_DECL_OPTIMIZABLE_EXPR
|
|
|
|
PathOperator getPathOpAt(uint32_t aPos)
|
|
{
|
|
NS_ASSERTION(aPos < mItems.Length(), "getting bad pathop index");
|
|
return mItems[aPos].pathOp;
|
|
}
|
|
void setPathOpAt(uint32_t aPos, PathOperator aPathOp)
|
|
{
|
|
NS_ASSERTION(aPos < mItems.Length(), "setting bad pathop index");
|
|
mItems[aPos].pathOp = aPathOp;
|
|
}
|
|
|
|
private:
|
|
class PathExprItem {
|
|
public:
|
|
nsAutoPtr<Expr> expr;
|
|
PathOperator pathOp;
|
|
};
|
|
|
|
nsTArray<PathExprItem> mItems;
|
|
|
|
/*
|
|
* Selects from the descendants of the context node
|
|
* all nodes that match the Expr
|
|
*/
|
|
nsresult evalDescendants(Expr* aStep, const txXPathNode& aNode,
|
|
txIMatchContext* aContext,
|
|
txNodeSet* resNodes);
|
|
};
|
|
|
|
/**
|
|
* This class represents a RootExpr, which only matches the Document node
|
|
**/
|
|
class RootExpr : public Expr {
|
|
public:
|
|
/**
|
|
* Creates a new RootExpr
|
|
*/
|
|
RootExpr()
|
|
#ifdef TX_TO_STRING
|
|
: mSerialize(true)
|
|
#endif
|
|
{
|
|
}
|
|
|
|
TX_DECL_EXPR
|
|
|
|
#ifdef TX_TO_STRING
|
|
public:
|
|
void setSerialize(bool aSerialize)
|
|
{
|
|
mSerialize = aSerialize;
|
|
}
|
|
|
|
private:
|
|
// When a RootExpr is used in a PathExpr it shouldn't be serialized
|
|
bool mSerialize;
|
|
#endif
|
|
}; //-- RootExpr
|
|
|
|
/**
|
|
* Represents a UnionExpr
|
|
**/
|
|
class UnionExpr : public Expr {
|
|
public:
|
|
/**
|
|
* Adds the PathExpr to this UnionExpr
|
|
* The ownership of the given Expr is passed over the UnionExpr,
|
|
* even on failure.
|
|
* @param aExpr the Expr to add to this UnionExpr
|
|
* @return nsresult indicating out of memory
|
|
*/
|
|
nsresult addExpr(Expr* aExpr)
|
|
{
|
|
return mExpressions.AppendElement(aExpr) ?
|
|
NS_OK : NS_ERROR_OUT_OF_MEMORY;
|
|
}
|
|
|
|
/**
|
|
* Removes and deletes the expression at the given index.
|
|
*/
|
|
void deleteExprAt(uint32_t aPos)
|
|
{
|
|
NS_ASSERTION(aPos < mExpressions.Length(),
|
|
"killing bad expression index");
|
|
|
|
delete mExpressions[aPos];
|
|
mExpressions.RemoveElementAt(aPos);
|
|
}
|
|
|
|
TX_DECL_OPTIMIZABLE_EXPR
|
|
|
|
private:
|
|
|
|
txOwningArray<Expr> mExpressions;
|
|
|
|
}; //-- UnionExpr
|
|
|
|
/**
|
|
* Class specializing in executing expressions like "@foo" where we are
|
|
* interested in different result-types, and expressions like "@foo = 'hi'"
|
|
*/
|
|
class txNamedAttributeStep : public Expr
|
|
{
|
|
public:
|
|
txNamedAttributeStep(int32_t aNsID, nsIAtom* aPrefix,
|
|
nsIAtom* aLocalName);
|
|
|
|
TX_DECL_EXPR
|
|
|
|
private:
|
|
int32_t mNamespace;
|
|
nsCOMPtr<nsIAtom> mPrefix;
|
|
nsCOMPtr<nsIAtom> mLocalName;
|
|
};
|
|
|
|
/**
|
|
*
|
|
*/
|
|
class txUnionNodeTest : public txNodeTest
|
|
{
|
|
public:
|
|
nsresult addNodeTest(txNodeTest* aNodeTest)
|
|
{
|
|
return mNodeTests.AppendElement(aNodeTest) ?
|
|
NS_OK : NS_ERROR_OUT_OF_MEMORY;
|
|
}
|
|
|
|
TX_DECL_NODE_TEST
|
|
|
|
private:
|
|
txOwningArray<txNodeTest> mNodeTests;
|
|
};
|
|
|
|
/**
|
|
* Expression that failed to parse
|
|
*/
|
|
class txErrorExpr : public Expr
|
|
{
|
|
public:
|
|
#ifdef TX_TO_STRING
|
|
txErrorExpr(const nsAString& aStr)
|
|
: mStr(aStr)
|
|
{
|
|
}
|
|
#endif
|
|
|
|
TX_DECL_EXPR
|
|
|
|
#ifdef TX_TO_STRING
|
|
private:
|
|
nsString mStr;
|
|
#endif
|
|
};
|
|
|
|
#endif
|
|
|
|
|