From d70f1333ce07929ff20a9c948d03bb4859470a53 Mon Sep 17 00:00:00 2001 From: "sicking%bigfoot.com" Date: Wed, 2 Nov 2005 07:36:04 +0000 Subject: [PATCH] Remove unused (and a few almost-unused) functions in the XPath classes. Bug 88612. r=peterv, sr=jst git-svn-id: svn://10.0.0.236/trunk@183526 18797224-902f-48f8-a5cc-f745e15eee43 --- .../content/xslt/src/xpath/txAdditiveExpr.cpp | 27 +-- .../content/xslt/src/xpath/txBooleanExpr.cpp | 27 +-- .../xslt/src/xpath/txBooleanFunctionCall.cpp | 21 +- .../xslt/src/xpath/txBooleanResult.cpp | 14 +- mozilla/content/xslt/src/xpath/txExpr.h | 198 +----------------- .../content/xslt/src/xpath/txExprParser.cpp | 28 +-- mozilla/content/xslt/src/xpath/txExprParser.h | 5 +- mozilla/content/xslt/src/xpath/txExprResult.h | 13 +- .../content/xslt/src/xpath/txFilterExpr.cpp | 17 +- .../content/xslt/src/xpath/txFunctionCall.cpp | 44 +--- .../content/xslt/src/xpath/txFunctionLib.h | 22 +- .../content/xslt/src/xpath/txLocationStep.cpp | 43 +--- .../xslt/src/xpath/txMultiplicativeExpr.cpp | 27 +-- .../xslt/src/xpath/txNodeSetFunctionCall.cpp | 26 +-- .../xslt/src/xpath/txNumberFunctionCall.cpp | 20 +- .../content/xslt/src/xpath/txNumberResult.cpp | 25 +-- mozilla/content/xslt/src/xpath/txPathExpr.cpp | 17 +- .../xslt/src/xpath/txPredicateList.cpp | 12 +- .../xslt/src/xpath/txRelationalExpr.cpp | 8 +- mozilla/content/xslt/src/xpath/txRootExpr.cpp | 6 +- .../xslt/src/xpath/txStringFunctionCall.cpp | 30 +-- .../content/xslt/src/xpath/txStringResult.cpp | 21 +- .../content/xslt/src/xpath/txUnaryExpr.cpp | 11 - .../content/xslt/src/xpath/txUnionExpr.cpp | 11 +- .../xslt/src/xpath/txVariableRefExpr.cpp | 26 +-- 25 files changed, 78 insertions(+), 621 deletions(-) diff --git a/mozilla/content/xslt/src/xpath/txAdditiveExpr.cpp b/mozilla/content/xslt/src/xpath/txAdditiveExpr.cpp index 5528dfe8ee0..405c8cd309a 100644 --- a/mozilla/content/xslt/src/xpath/txAdditiveExpr.cpp +++ b/mozilla/content/xslt/src/xpath/txAdditiveExpr.cpp @@ -21,7 +21,7 @@ * Keith Visco, kvisco@ziplink.net * -- original author. * - * $Id: txAdditiveExpr.cpp,v 1.1 2005-11-02 07:33:58 kvisco%ziplink.net Exp $ + * $Id: txAdditiveExpr.cpp,v 1.2 2005-11-02 07:33:59 sicking%bigfoot.com Exp $ */ /** @@ -30,20 +30,11 @@ * + : addition * - : subtraction * @author Keith Visco - * @version $Revision: 1.1 $ $Date: 2005-11-02 07:33:58 $ + * @version $Revision: 1.2 $ $Date: 2005-11-02 07:33:59 $ **/ #include "Expr.h" -/** - * Creates a new AdditiveExpr using the default operator (ADDITION) -**/ -AdditiveExpr::AdditiveExpr() { - this->op = ADDITION; - this->leftExpr = 0; - this->rightExpr = 0; -} //-- AdditiveExpr - /** * Creates a new AdditiveExpr using the given operator **/ @@ -58,20 +49,6 @@ AdditiveExpr::~AdditiveExpr() { delete rightExpr; } //-- ~AdditiveExpr -/** - * Sets the left side of this AdditiveExpr -**/ -void AdditiveExpr::setLeftExpr(Expr* leftExpr) { - this->leftExpr = leftExpr; -} //-- setLeftExpr - -/** - * Sets the right side of this AdditiveExpr -**/ -void AdditiveExpr::setRightExpr(Expr* rightExpr) { - this->rightExpr = rightExpr; -} //-- setRightExpr - /** * Evaluates this Expr based on the given context node and processor state * @param context the context node for evaluation of this Expr diff --git a/mozilla/content/xslt/src/xpath/txBooleanExpr.cpp b/mozilla/content/xslt/src/xpath/txBooleanExpr.cpp index 928f38ca778..20d4fdde7ea 100644 --- a/mozilla/content/xslt/src/xpath/txBooleanExpr.cpp +++ b/mozilla/content/xslt/src/xpath/txBooleanExpr.cpp @@ -26,7 +26,7 @@ * - If the left hand was false, the right hand expression * was not getting checked. * - * $Id: txBooleanExpr.cpp,v 1.2 2005-11-02 07:33:47 kvisco%ziplink.net Exp $ + * $Id: txBooleanExpr.cpp,v 1.3 2005-11-02 07:33:48 sicking%bigfoot.com Exp $ */ @@ -34,20 +34,11 @@ * Represents a BooleanExpr, a binary expression that * performs a boolean operation between it's lvalue and rvalue:
* @author Keith Visco - * @version $Revision: 1.2 $ $Date: 2005-11-02 07:33:47 $ + * @version $Revision: 1.3 $ $Date: 2005-11-02 07:33:48 $ **/ #include "Expr.h" -/** - * Creates a new BooleanExpr using the default operator (AND) -**/ -BooleanExpr::BooleanExpr() { - this->op = AND; - this->leftExpr = 0; - this->rightExpr = 0; -} //-- BooleanExpr - /** * Creates a new BooleanExpr using the given operator **/ @@ -62,20 +53,6 @@ BooleanExpr::~BooleanExpr() { delete rightExpr; } //-- ~BooleanExpr -/** - * Sets the left side of this AdditiveExpr -**/ -void BooleanExpr::setLeftExpr(Expr* leftExpr) { - this->leftExpr = leftExpr; -} //-- setLeftExpr - -/** - * Sets the right side of this AdditiveExpr -**/ -void BooleanExpr::setRightExpr(Expr* rightExpr) { - this->rightExpr = rightExpr; -} //-- setRightExpr - /** * Evaluates this Expr based on the given context node and processor state * @param context the context node for evaluation of this Expr diff --git a/mozilla/content/xslt/src/xpath/txBooleanFunctionCall.cpp b/mozilla/content/xslt/src/xpath/txBooleanFunctionCall.cpp index b265bd92397..c0bd0eba9b8 100644 --- a/mozilla/content/xslt/src/xpath/txBooleanFunctionCall.cpp +++ b/mozilla/content/xslt/src/xpath/txBooleanFunctionCall.cpp @@ -24,7 +24,7 @@ * Marina Mechtcheriakova, mmarina@mindspring.com * -- added lang() implementation * - * $Id: txBooleanFunctionCall.cpp,v 1.8 2005-11-02 07:33:41 peterv%netscape.com Exp $ + * $Id: txBooleanFunctionCall.cpp,v 1.9 2005-11-02 07:33:42 sicking%bigfoot.com Exp $ */ #include "FunctionLib.h" @@ -33,32 +33,25 @@ /** * Creates a default BooleanFunctionCall, which always evaluates to False * @author Keith Visco - * @version $Revision: 1.8 $ $Date: 2005-11-02 07:33:41 $ -**/ -BooleanFunctionCall::BooleanFunctionCall() : FunctionCall(XPathNames::FALSE_FN) { - this->type = TX_FALSE; -} //-- BooleanFunctionCall - -/** - * Creates a BooleanFunctionCall of the given type + * @version $Revision: 1.9 $ $Date: 2005-11-02 07:33:42 $ **/ BooleanFunctionCall::BooleanFunctionCall(short type) : FunctionCall() { switch ( type ) { case TX_BOOLEAN : - FunctionCall::setName(XPathNames::BOOLEAN_FN); + name = XPathNames::BOOLEAN_FN; break; case TX_LANG: - FunctionCall::setName(XPathNames::LANG_FN); + name = XPathNames::LANG_FN; break; case TX_NOT : - FunctionCall::setName(XPathNames::NOT_FN); + name = XPathNames::NOT_FN; break; case TX_TRUE : - FunctionCall::setName(XPathNames::TRUE_FN); + name = XPathNames::TRUE_FN; break; default: - FunctionCall::setName(XPathNames::FALSE_FN); + name = XPathNames::FALSE_FN; break; } this->type = type; diff --git a/mozilla/content/xslt/src/xpath/txBooleanResult.cpp b/mozilla/content/xslt/src/xpath/txBooleanResult.cpp index 1c23e7cf3a5..a72c9bfc703 100644 --- a/mozilla/content/xslt/src/xpath/txBooleanResult.cpp +++ b/mozilla/content/xslt/src/xpath/txBooleanResult.cpp @@ -21,7 +21,7 @@ * Keith Visco, kvisco@ziplink.net * -- original author. * - * $Id: txBooleanResult.cpp,v 1.6 2005-11-02 07:33:51 kvisco%ziplink.net Exp $ + * $Id: txBooleanResult.cpp,v 1.7 2005-11-02 07:33:52 sicking%bigfoot.com Exp $ */ /* @@ -37,10 +37,6 @@ BooleanResult::BooleanResult() { value = MB_FALSE; } //-- BooleanResult -BooleanResult::BooleanResult(const BooleanResult& boolResult) { - this->value = boolResult.getValue(); -} //-- BooleanResult - /** * Creates a new BooleanResult with the value of the given MBool parameter * @param boolean the MBool to use for initialization of this BooleanResult's value @@ -49,14 +45,6 @@ BooleanResult::BooleanResult(MBool boolean) { this->value = boolean; } //-- BooleanResult -/** - * Returns the value of this BooleanResult - * @return the value of this BooleanResult -**/ -MBool BooleanResult::getValue() const { - return this->value; -} //-- getValue - /* * Virtual Methods from ExprResult */ diff --git a/mozilla/content/xslt/src/xpath/txExpr.h b/mozilla/content/xslt/src/xpath/txExpr.h index 9b680b48d9a..b09688d6141 100644 --- a/mozilla/content/xslt/src/xpath/txExpr.h +++ b/mozilla/content/xslt/src/xpath/txExpr.h @@ -28,7 +28,7 @@ * -- removal of Patterns and some restructuring * in the class set * - * $Id: txExpr.h,v 1.14 2005-11-02 07:33:39 sicking%bigfoot.com Exp $ + * $Id: txExpr.h,v 1.15 2005-11-02 07:33:40 sicking%bigfoot.com Exp $ */ @@ -49,7 +49,7 @@ /* XPath class definitions. Much of this code was ported from XSL:P. - @version $Revision: 1.14 $ $Date: 2005-11-02 07:33:39 $ + @version $Revision: 1.15 $ $Date: 2005-11-02 07:33:40 $ */ //necessary prototypes @@ -179,32 +179,18 @@ public: **/ void addParam(Expr* expr); - /** - * Returns the name of this FunctionCall - * @return the name of this FunctionCall - **/ - const String& getName(); - virtual MBool requireParams(int paramCountMin, ContextState* cs); virtual MBool requireParams(int paramCountMin, int paramCountMax, ContextState* cs); - /** - * Sets the function name of this FunctionCall - * @param name the name of this Function - **/ - void setName(const String& name); - - protected: List params; FunctionCall(); FunctionCall(const String& name); - FunctionCall(const String& name, List* parameters); /** * Evaluates the given Expression and converts it's result to a String. @@ -218,8 +204,6 @@ protected: **/ double evaluateToNumber(Expr* expr, Node* context, ContextState* cs); -private: - String name; }; //-- FunctionCall @@ -267,9 +251,7 @@ public: TEXT_EXPR, COMMENT_EXPR, PI_EXPR, - NODE_EXPR, - WILD_CARD, - ROOT_EXPR + NODE_EXPR }; virtual ~NodeExpr() {}; @@ -278,12 +260,6 @@ public: //- Public Methods -/ //------------------/ - /** - * Returns the type of this NodeExpr - * @return the type of this NodeExpr - **/ - virtual short getType() = 0; - /** * Virtual methods from Expr **/ @@ -305,29 +281,12 @@ public: //- Public Methods -/ //------------------/ - AttributeExpr(); AttributeExpr(String& name); - virtual ~AttributeExpr(); - - void setWild(MBool isWild); - - /** - * Returns the name of this AttributeExpr - * @return the name of this AttributeExpr - **/ - const String& getName(); - - /** - * Sets the name of this AttributeExpr - * @param name the name of the element that this AttributeExpr matches - **/ - void setName(const String& name); /** * Virtual methods from NodeExpr **/ virtual ExprResult* evaluate(Node* context, ContextState* cs); - short getType(); virtual MBool matches(Node* node, Node* context, ContextState* cs); virtual double getDefaultPriority(Node* node, Node* context, ContextState* cs); virtual void toString(String& dest); @@ -354,22 +313,11 @@ public: //- Public Methods -/ //------------------/ - /** - * Creates a new BasicNodeExpr of type NodeExpr::NODE_EXPR, which matches - * any node - **/ - BasicNodeExpr(); - /** * Creates a new BasicNodeExpr of the given type **/ BasicNodeExpr(NodeExprType nodeExprType); - /** - * Destroys this BasicNodeExpr - **/ - virtual ~BasicNodeExpr(); - /** * Sets the name of the node to match. Only availible for pi nodes **/ @@ -379,7 +327,6 @@ public: * Virtual methods from NodeExpr **/ virtual ExprResult* evaluate(Node* context, ContextState* cs); - short getType(); virtual MBool matches(Node* node, Node* context, ContextState* cs); virtual double getDefaultPriority(Node* node, Node* context, ContextState* cs); virtual void toString(String& dest); @@ -402,27 +349,12 @@ public: //- Public Methods -/ //------------------/ - ElementExpr(); ElementExpr(String& name); - virtual ~ElementExpr(); - - /** - * Returns the name of this ElementExpr - * @return the name of this ElementExpr - **/ - const String& getName(); - - /** - * Sets the name of this ElementExpr - * @param name the name of the element that this ElementExpr matches - **/ - void setName(const String& name); /** * Virtual methods from NodeExpr **/ virtual ExprResult* evaluate(Node* context, ContextState* cs); - short getType(); virtual double getDefaultPriority(Node* node, Node* context, ContextState* cs); virtual MBool matches(Node* node, Node* context, ContextState* cs); virtual void toString(String& dest); @@ -432,11 +364,8 @@ private: static const String WILD_CARD; String name; - MBool isNamespaceWild; - MBool isNameWild; - String prefix; }; //-- ElementExpr @@ -456,7 +385,6 @@ public: * Virtual methods from NodeExpr **/ virtual ExprResult* evaluate(Node* context, ContextState* cs); - virtual short getType(); virtual MBool matches(Node* node, Node* context, ContextState* cs); virtual double getDefaultPriority(Node* node, Node* context, ContextState* cs); virtual void toString(String& dest); @@ -495,12 +423,6 @@ public: **/ MBool isEmpty(); - /** - * Removes the given Expr from the list - * @param expr the Expr to remove from the list - **/ - Expr* remove(Expr* expr); - /** * Returns the String representation of this PredicateList. * @param dest the String to use when creating the String @@ -538,19 +460,6 @@ public: SELF_AXIS }; - /** - * Creates a new LocationStep using the default Axis Identifier and no - * NodeExpr (which matches nothing) - **/ - LocationStep(); - - /** - * Creates a new LocationStep using the default Axis Identifier and - * the given NodeExpr - * @param nodeExpr the NodeExpr to use when matching Nodes - **/ - LocationStep(NodeExpr* nodeExpr); - /** * Creates a new LocationStep using the given NodeExpr and Axis Identifier * @param nodeExpr the NodeExpr to use when matching Nodes @@ -563,18 +472,6 @@ public: **/ virtual ~LocationStep(); - /** - * Sets the Axis Identifier for this LocationStep - * @param axisIdentifier the Axis in which to search for nodes - **/ - void setAxisIdentifier(short axisIdentifier); - - /** - * Sets the NodeExpr of this LocationStep for use when matching nodes - * @param nodeExpr the NodeExpr to use when matching nodes - **/ - void setNodeExpr(NodeExpr* nodeExpr); - /** * Virtual methods from Expr **/ @@ -598,12 +495,6 @@ class FilterExpr : public PredicateList, public Expr { public: - /** - * Creates a new FilterExpr using the default no default Expr - * (which evaluates to nothing) - **/ - FilterExpr(); - /** * Creates a new FilterExpr using the given Expr * @param expr the Expr to use for evaluation @@ -615,12 +506,6 @@ public: **/ virtual ~FilterExpr(); - /** - * Sets the Expr of this FilterExpr for evaluation - * @param expr the Expr to use for evaluation - **/ - void setExpr(Expr* expr); - /** * Virtual methods from Expr **/ @@ -630,7 +515,6 @@ public: virtual void toString(String& dest); private: - Expr* expr; }; //-- FilterExpr @@ -640,9 +524,7 @@ class NumberExpr : public Expr { public: - NumberExpr(); NumberExpr(double dbl); - ~NumberExpr(); /** * Virtual methods from Expr @@ -662,11 +544,7 @@ class StringExpr : public Expr { public: - StringExpr(); - StringExpr(String& value); StringExpr(const String& value); - StringExpr(const char* value); - ~StringExpr(); /** * Virtual methods from Expr @@ -694,21 +572,9 @@ public: //-- LF, changed from static const short to enum enum _AdditiveExprType { ADDITION = 1, SUBTRACTION }; - AdditiveExpr(); AdditiveExpr(Expr* leftExpr, Expr* rightExpr, short op); ~AdditiveExpr(); - /** - * Sets the left side of this AdditiveExpr - **/ - void setLeftExpr(Expr* leftExpr); - - /** - * Sets the right side of this AdditiveExpr - **/ - void setRightExpr(Expr* rightExpr); - - /** * Virtual methods from Expr **/ @@ -728,15 +594,9 @@ class UnaryExpr : public Expr { public: - UnaryExpr(); UnaryExpr(Expr* expr); ~UnaryExpr(); - /** - * Sets the expression to negate - **/ - void setExpr(Expr* expr); - /** * Virtual methods from Expr **/ @@ -758,21 +618,9 @@ public: //-- BooleanExpr Types enum _BooleanExprType { AND = 1, OR }; - BooleanExpr(); BooleanExpr(Expr* leftExpr, Expr* rightExpr, short op); ~BooleanExpr(); - /** - * Sets the left side of this BooleanExpr - **/ - void setLeftExpr(Expr* leftExpr); - - /** - * Sets the right side of this BooleanExpr - **/ - void setRightExpr(Expr* rightExpr); - - /** * Virtual methods from Expr **/ @@ -801,20 +649,9 @@ public: //-- LF, changed from static const short to enum enum _MultiplicativeExprType { DIVIDE = 1, MULTIPLY, MODULUS }; - MultiplicativeExpr(); MultiplicativeExpr(Expr* leftExpr, Expr* rightExpr, short op); ~MultiplicativeExpr(); - /** - * Sets the left side of this MultiplicativeExpr - **/ - void setLeftExpr(Expr* leftExpr); - - /** - * Sets the right side of this MultiplicativeExpr - **/ - void setRightExpr(Expr* rightExpr); - /** * Virtual methods from Expr **/ @@ -852,7 +689,6 @@ public: GREATER_OR_EQUAL }; - RelationalExpr(); RelationalExpr(Expr* leftExpr, Expr* rightExpr, short op); ~RelationalExpr(); @@ -878,15 +714,7 @@ class VariableRefExpr : public Expr { public: - VariableRefExpr(); VariableRefExpr(const String& name); - VariableRefExpr(String& name); - ~VariableRefExpr(); - - /** - * Sets the name of the variable of reference - **/ - void setName(const String& name); /** * Virtual methods from Expr @@ -921,21 +749,12 @@ public: **/ virtual ~PathExpr(); - /** - * Adds the Expr to this PathExpr - * @param expr the Expr to add to this PathExpr - * @param index the index at which to add the given Expr - **/ - void addExpr(int index, Expr* expr, short ancestryOp); - /** * Adds the Expr to this PathExpr * @param expr the Expr to add to this PathExpr **/ void addExpr(Expr* expr, short ancestryOp); - virtual MBool isAbsolute(); - /** * Virtual methods from Expr **/ @@ -946,6 +765,8 @@ public: private: + virtual MBool isAbsolute(); + struct PathExprItem { Expr* expr; short ancestryOp; @@ -984,9 +805,6 @@ public: virtual double getDefaultPriority(Node* node, Node* context, ContextState* cs); virtual void toString(String& dest); - virtual MBool isAbsolute(); - - }; //-- RootExpr /** @@ -1012,12 +830,6 @@ public: **/ void addExpr(Expr* expr); - /** - * Adds the PathExpr to this UnionExpr at the specified index - * @param expr the Expr to add to this UnionExpr - **/ - void addExpr(int index, Expr* expr); - /** * Virtual methods from Expr **/ diff --git a/mozilla/content/xslt/src/xpath/txExprParser.cpp b/mozilla/content/xslt/src/xpath/txExprParser.cpp index fade8f25618..63a27ee107e 100644 --- a/mozilla/content/xslt/src/xpath/txExprParser.cpp +++ b/mozilla/content/xslt/src/xpath/txExprParser.cpp @@ -30,7 +30,7 @@ * -- fixed bug in ::parsePredicates, * made sure we continue looking for more predicates. * - * $Id: txExprParser.cpp,v 1.15 2005-11-02 07:33:39 peterv%netscape.com Exp $ + * $Id: txExprParser.cpp,v 1.16 2005-11-02 07:33:40 sicking%bigfoot.com Exp $ */ /** @@ -38,7 +38,7 @@ * This class is used to parse XSL Expressions * @author Keith Visco * @see ExprLexer - * @version $Revision: 1.15 $ $Date: 2005-11-02 07:33:39 $ + * @version $Revision: 1.16 $ $Date: 2005-11-02 07:33:40 $ **/ #include "ExprParser.h" @@ -168,12 +168,6 @@ Expr* ExprParser::createPatternExpr(const String& pattern) { return expr; } //-- createPatternExpr -LocationStep* ExprParser::createLocationStep(const String& path) { - ExprLexer lexer(path); - LocationStep* lstep = createLocationStep(lexer); - return lstep; -} //-- createLocationPath - //--------------------/ //- Private Methods -/ //-------------------/ @@ -353,8 +347,7 @@ Expr* ExprParser::createFilterExpr(ExprLexer& lexer) { if (lexer.peek()->type == Token::L_BRACKET) { - FilterExpr* filterExpr = new FilterExpr(); - filterExpr->setExpr(expr); + FilterExpr* filterExpr = new FilterExpr(expr); //-- handle predicates if (!parsePredicates(filterExpr, lexer)) { @@ -396,7 +389,7 @@ FunctionCall* ExprParser::createFunctionCall(ExprLexer& lexer) { fnCall = new NodeSetFunctionCall(NodeSetFunctionCall::COUNT); } else if (XPathNames::FALSE_FN.isEqual(tok->value)) { - fnCall = new BooleanFunctionCall(); + fnCall = new BooleanFunctionCall(BooleanFunctionCall::TX_FALSE); } else if (XPathNames::ID_FN.isEqual(tok->value)) { fnCall = new NodeSetFunctionCall(NodeSetFunctionCall::ID); @@ -480,8 +473,6 @@ FunctionCall* ExprParser::createFunctionCall(ExprLexer& lexer) { LocationStep* ExprParser::createLocationStep(ExprLexer& lexer) { - LocationStep* lstep = new LocationStep(); - //-- child axis is default short axisIdentifier = LocationStep::CHILD_AXIS; NodeExpr* nodeExpr = 0; @@ -534,7 +525,6 @@ LocationStep* ExprParser::createLocationStep(ExprLexer& lexer) { axisIdentifier = LocationStep::SELF_AXIS; } else { - delete lstep; //XXX ErrorReport: unknow axis return 0; } @@ -549,13 +539,13 @@ LocationStep* ExprParser::createLocationStep(ExprLexer& lexer) { //-- eat token lexer.nextToken(); axisIdentifier = LocationStep::PARENT_AXIS; - nodeExpr = new BasicNodeExpr(); + nodeExpr = new BasicNodeExpr(NodeExpr::NODE_EXPR); break; case Token::SELF_NODE : //-- eat token lexer.nextToken(); axisIdentifier = LocationStep::SELF_AXIS; - nodeExpr = new BasicNodeExpr(); + nodeExpr = new BasicNodeExpr(NodeExpr::NODE_EXPR); break; default: break; @@ -578,14 +568,12 @@ LocationStep* ExprParser::createLocationStep(ExprLexer& lexer) { lexer.pushBack(); nodeExpr = createNodeExpr(lexer); if (!nodeExpr) { - delete lstep; return 0; } } } - lstep->setAxisIdentifier(axisIdentifier); - lstep->setNodeExpr(nodeExpr); + LocationStep* lstep = new LocationStep(nodeExpr, axisIdentifier); //-- handle predicates if (!parsePredicates(lstep, lexer)) { @@ -611,7 +599,7 @@ NodeExpr* ExprParser::createNodeExpr(ExprLexer& lexer) { nodeExpr = new BasicNodeExpr(NodeExpr::COMMENT_EXPR); break; case Token::NODE : - nodeExpr = new BasicNodeExpr(); + nodeExpr = new BasicNodeExpr(NodeExpr::NODE_EXPR); break; case Token::PROC_INST : nodeExpr = new BasicNodeExpr(NodeExpr::PI_EXPR); diff --git a/mozilla/content/xslt/src/xpath/txExprParser.h b/mozilla/content/xslt/src/xpath/txExprParser.h index bb53745e9c8..250c3e953a2 100644 --- a/mozilla/content/xslt/src/xpath/txExprParser.h +++ b/mozilla/content/xslt/src/xpath/txExprParser.h @@ -21,14 +21,14 @@ * Keith Visco, kvisco@ziplink.net * -- original author. * - * $Id: txExprParser.h,v 1.5 2005-11-02 07:33:55 sicking%bigfoot.com Exp $ + * $Id: txExprParser.h,v 1.6 2005-11-02 07:33:56 sicking%bigfoot.com Exp $ */ /** * ExprParser * This class is used to parse XSL Expressions * @author Keith Visco - * @version $Revision: 1.5 $ $Date: 2005-11-02 07:33:55 $ + * @version $Revision: 1.6 $ $Date: 2005-11-02 07:33:56 $ * @see ExprLexer **/ @@ -56,7 +56,6 @@ public: Expr* createExpr (const String& pattern); Expr* createPatternExpr (const String& pattern); - LocationStep* createLocationStep(const String& path); /** * Creates an Attribute Value Template using the given value diff --git a/mozilla/content/xslt/src/xpath/txExprResult.h b/mozilla/content/xslt/src/xpath/txExprResult.h index 7492b889353..973b01af73f 100644 --- a/mozilla/content/xslt/src/xpath/txExprResult.h +++ b/mozilla/content/xslt/src/xpath/txExprResult.h @@ -23,7 +23,7 @@ * Larry Fitzpatrick, OpenText, lef@opentext.com * -- changed constant short result types to enum * - * $Id: txExprResult.h,v 1.10 2005-11-02 07:33:52 nisheeth%netscape.com Exp $ + * $Id: txExprResult.h,v 1.11 2005-11-02 07:33:53 sicking%bigfoot.com Exp $ */ #ifndef TRANSFRMX_EXPRRESULT_H @@ -88,9 +88,6 @@ public: BooleanResult(); BooleanResult(MBool boolean); - BooleanResult(const BooleanResult& boolResult); - - MBool getValue() const; virtual short getResultType(); virtual void stringValue(String& str); @@ -107,10 +104,6 @@ public: NumberResult(); NumberResult(double dbl); - NumberResult(const NumberResult& nbrResult); - - double getValue() const; - MBool isNaN() const; virtual short getResultType(); virtual void stringValue(String& str); @@ -128,13 +121,9 @@ class StringResult : public ExprResult { public: StringResult(); - StringResult(String& str); StringResult(const String& str); - StringResult(const StringResult& strResult); StringResult(const char* str); - String& getValue(); - virtual short getResultType(); virtual void stringValue(String& str); virtual MBool booleanValue(); diff --git a/mozilla/content/xslt/src/xpath/txFilterExpr.cpp b/mozilla/content/xslt/src/xpath/txFilterExpr.cpp index 2d3c37b592f..d13891b4578 100644 --- a/mozilla/content/xslt/src/xpath/txFilterExpr.cpp +++ b/mozilla/content/xslt/src/xpath/txFilterExpr.cpp @@ -23,7 +23,7 @@ * Bob Miller, kbob@oblix.com * -- plugged core leak. * - * $Id: txFilterExpr.cpp,v 1.1 2005-11-02 07:33:50 kvisco%ziplink.net Exp $ + * $Id: txFilterExpr.cpp,v 1.2 2005-11-02 07:33:51 sicking%bigfoot.com Exp $ */ #include "Expr.h" @@ -31,15 +31,11 @@ /** * @author Keith Visco - * @version $Revision: 1.1 $ $Date: 2005-11-02 07:33:50 $ + * @version $Revision: 1.2 $ $Date: 2005-11-02 07:33:51 $ **/ //-- Implementation of FilterExpr --/ -FilterExpr::FilterExpr() : PredicateList() { - expr = 0; -} - /** * Creates a new FilterExpr using the given Expr * @param expr the Expr to use for evaluation @@ -55,15 +51,6 @@ FilterExpr::~FilterExpr() { delete expr; } //-- ~FilterExpr -/** - * Sets the Expr of this FilterExpr for use during evaluation - * @param expr the Expr to use for evaluation -**/ -void FilterExpr::setExpr(Expr* expr) { - this->expr = expr; -} //-- setExpr - - //------------------------------------/ //- Virtual methods from PatternExpr -/ //------------------------------------/ diff --git a/mozilla/content/xslt/src/xpath/txFunctionCall.cpp b/mozilla/content/xslt/src/xpath/txFunctionCall.cpp index 8b00b398ae6..70e0e5009aa 100644 --- a/mozilla/content/xslt/src/xpath/txFunctionCall.cpp +++ b/mozilla/content/xslt/src/xpath/txFunctionCall.cpp @@ -21,7 +21,7 @@ * Keith Visco, kvisco@ziplink.net * -- original author. * - * $Id: txFunctionCall.cpp,v 1.3 2005-11-02 07:33:40 sicking%bigfoot.com Exp $ + * $Id: txFunctionCall.cpp,v 1.4 2005-11-02 07:33:41 sicking%bigfoot.com Exp $ */ #include "Expr.h" @@ -29,7 +29,7 @@ /** * This class represents a FunctionCall as defined by the XSL Working Draft * @author Keith Visco - * @version $Revision: 1.3 $ $Date: 2005-11-02 07:33:40 $ + * @version $Revision: 1.4 $ $Date: 2005-11-02 07:33:41 $ **/ const String FunctionCall::INVALID_PARAM_COUNT = @@ -55,27 +55,6 @@ FunctionCall::FunctionCall(const String& name) this->name = name; } //-- FunctionCall -/** - * Creates a new FunctionCall with the given function name and parameter list - * Note: The object references in parameters will be deleted when this - * FunctionCall gets destroyed. -**/ -FunctionCall::FunctionCall(const String& name, List* parameters) -{ - //-- copy name - this->name = name; - - if (parameters) { - ListIterator* pIter = parameters->iterator(); - while (pIter->hasNext()) { - params.add(pIter->next()); - } - delete pIter; - } - -} //-- FunctionCall - - /** * Destructor **/ @@ -160,15 +139,6 @@ double FunctionCall::evaluateToNumber(Expr* expr, Node* context, return result; } //-- evaluateToNumber -/** - * Returns the name of this FunctionCall - * @return the name of this FunctionCall -**/ -const String& FunctionCall::getName() -{ - return (const String&)this->name; -} //-- getName - /** * Called to check number of parameters **/ @@ -201,16 +171,6 @@ MBool FunctionCall::requireParams(int paramCountMin, ContextState* cs) return MB_TRUE; } //-- requireParams -/** - * Sets the function name of this FunctionCall - * @param name the name of this Function -**/ -void FunctionCall::setName(const String& name) -{ - this->name.clear(); - this->name.append(name); -} //-- setName - /** * Returns the String representation of this NodeExpr. * @param dest the String to use when creating the String diff --git a/mozilla/content/xslt/src/xpath/txFunctionLib.h b/mozilla/content/xslt/src/xpath/txFunctionLib.h index c54011d66bd..c1e7803bf86 100644 --- a/mozilla/content/xslt/src/xpath/txFunctionLib.h +++ b/mozilla/content/xslt/src/xpath/txFunctionLib.h @@ -27,7 +27,7 @@ * Marina Mechtcheriakova * -- added support for lang function * - * $Id: txFunctionLib.h,v 1.10 2005-11-02 07:33:52 peterv%netscape.com Exp $ + * $Id: txFunctionLib.h,v 1.11 2005-11-02 07:33:53 sicking%bigfoot.com Exp $ */ #ifndef TRANSFRMX_FUNCTIONLIB_H @@ -115,11 +115,6 @@ public: enum booleanFunctions { TX_BOOLEAN = 1, TX_FALSE, TX_LANG, TX_NOT, TX_TRUE }; - /** - * Creates a default BooleanFunctionCall, which always evaluates to False - **/ - BooleanFunctionCall(); - /** * Creates a BooleanFunctionCall of the given type **/ @@ -265,11 +260,6 @@ public: POSITION //-- position() }; - /** - * Creates a default NodeSetFunction call. Position function is the default. - **/ - NodeSetFunctionCall(); - /** * Creates a NodeSetFunctionCall of the given type **/ @@ -309,11 +299,6 @@ public: TRANSLATE //-- translate() }; - /** - * Creates a default String function. String() function is the default. - **/ - StringFunctionCall(); - /** * Creates a String function of the given type **/ @@ -349,11 +334,6 @@ public: SUM //-- sum() }; - /** - * Creates a default Number function. number() function is the default. - **/ - NumberFunctionCall(); - /** * Creates a Number function of the given type **/ diff --git a/mozilla/content/xslt/src/xpath/txLocationStep.cpp b/mozilla/content/xslt/src/xpath/txLocationStep.cpp index 26bdb921aec..1cbf1d1284b 100644 --- a/mozilla/content/xslt/src/xpath/txLocationStep.cpp +++ b/mozilla/content/xslt/src/xpath/txLocationStep.cpp @@ -21,35 +21,16 @@ * Keith Visco, kvisco@ziplink.net * -- original author. * - * $Id: txLocationStep.cpp,v 1.8 2005-11-02 07:33:48 peterv%netscape.com Exp $ + * $Id: txLocationStep.cpp,v 1.9 2005-11-02 07:33:49 sicking%bigfoot.com Exp $ */ /* Implementation of an XPath LocationStep - @version $Revision: 1.8 $ $Date: 2005-11-02 07:33:48 $ + @version $Revision: 1.9 $ $Date: 2005-11-02 07:33:49 $ */ #include "Expr.h" -/** - * Creates a new LocationStep using the default Axis Identifier and no - * NodeExpr (which matches nothing) -**/ -LocationStep::LocationStep() : PredicateList() { - nodeExpr = 0; - this->axisIdentifier = CHILD_AXIS; -} //-- LocationStep - -/** - * Creates a new LocationStep using the default Axis Identifier and - * the given NodeExpr - * @param nodeExpr the NodeExpr to use when matching Nodes -**/ -LocationStep::LocationStep(NodeExpr* nodeExpr) : PredicateList() { - this->nodeExpr = nodeExpr; - this->axisIdentifier = CHILD_AXIS; -} //-- LocationStep - /** * Creates a new LocationStep using the given NodeExpr and Axis Identifier * @param nodeExpr the NodeExpr to use when matching Nodes @@ -69,26 +50,6 @@ LocationStep::~LocationStep() { delete nodeExpr; } //-- ~LocationStep -/** - * Sets the Axis Identifier for this LocationStep - * @param axisIdentifier the Axis in which to search for nodes -**/ -void LocationStep::setAxisIdentifier(short axisIdentifier) { - this->axisIdentifier = axisIdentifier; -} //-- setAxisIdentifier - - -/** - * Sets the NodeExpr of this LocationStep for use when matching nodes - * @param nodeExpr the NodeExpr to use when matching nodes -**/ -void LocationStep::setNodeExpr(NodeExpr* nodeExpr) { - // delete current NodeExpr - if (this->nodeExpr) delete this->nodeExpr; - this->nodeExpr = nodeExpr; -} //-- setNodeExpr - - //------------------------------------/ //- Virtual methods from PatternExpr -/ //------------------------------------/ diff --git a/mozilla/content/xslt/src/xpath/txMultiplicativeExpr.cpp b/mozilla/content/xslt/src/xpath/txMultiplicativeExpr.cpp index 00e92b50976..24c74b750cd 100644 --- a/mozilla/content/xslt/src/xpath/txMultiplicativeExpr.cpp +++ b/mozilla/content/xslt/src/xpath/txMultiplicativeExpr.cpp @@ -21,7 +21,7 @@ * Keith Visco, kvisco@ziplink.net * -- original author. * - * $Id: txMultiplicativeExpr.cpp,v 1.2 2005-11-02 07:33:51 peterv%netscape.com Exp $ + * $Id: txMultiplicativeExpr.cpp,v 1.3 2005-11-02 07:33:52 sicking%bigfoot.com Exp $ */ /** @@ -31,21 +31,12 @@ * mod : modulus * div : divide * @author Keith Visco - * @version $Revision: 1.2 $ $Date: 2005-11-02 07:33:51 $ + * @version $Revision: 1.3 $ $Date: 2005-11-02 07:33:52 $ **/ #include "Expr.h" #include -/** - * Creates a new MultiplicativeExpr using the default operator (MULTIPLY) -**/ -MultiplicativeExpr::MultiplicativeExpr() { - this->op = MULTIPLY; - this->leftExpr = 0; - this->rightExpr = 0; -} //-- RelationalExpr - /** * Creates a new MultiplicativeExpr using the given operator **/ @@ -60,20 +51,6 @@ MultiplicativeExpr::~MultiplicativeExpr() { delete rightExpr; } //-- ~MultiplicativeExpr -/** - * Sets the left side of this MultiplicativeExpr -**/ -void MultiplicativeExpr::setLeftExpr(Expr* leftExpr) { - this->leftExpr = leftExpr; -} //-- setLeftExpr - -/** - * Sets the right side of this MultiplicativeExpr -**/ -void MultiplicativeExpr::setRightExpr(Expr* rightExpr) { - this->rightExpr = rightExpr; -} //-- setRightExpr - /** * Evaluates this Expr based on the given context node and processor state * @param context the context node for evaluation of this Expr diff --git a/mozilla/content/xslt/src/xpath/txNodeSetFunctionCall.cpp b/mozilla/content/xslt/src/xpath/txNodeSetFunctionCall.cpp index d893d64596c..f46aa7e8f1c 100644 --- a/mozilla/content/xslt/src/xpath/txNodeSetFunctionCall.cpp +++ b/mozilla/content/xslt/src/xpath/txNodeSetFunctionCall.cpp @@ -24,14 +24,14 @@ * Marina Mechtcheriakova, mmarina@mindspring.com * -- changed some behavoir to be more compliant with spec * - * $Id: txNodeSetFunctionCall.cpp,v 1.7 2005-11-02 07:33:50 peterv%netscape.com Exp $ + * $Id: txNodeSetFunctionCall.cpp,v 1.8 2005-11-02 07:33:51 sicking%bigfoot.com Exp $ */ /** * NodeSetFunctionCall * A representation of the XPath NodeSet funtions * @author Keith Visco - * @version $Revision: 1.7 $ $Date: 2005-11-02 07:33:50 $ + * @version $Revision: 1.8 $ $Date: 2005-11-02 07:33:51 $ **/ #include "FunctionLib.h" @@ -39,14 +39,6 @@ #include "XMLDOMUtils.h" #include -/** - * Creates a default NodeSetFunctionCall. The Position function - * is the default -**/ -NodeSetFunctionCall::NodeSetFunctionCall() : FunctionCall(XPathNames::POSITION_FN) { - type = POSITION; -} //-- NodeSetFunctionCall - /** * Creates a NodeSetFunctionCall of the given type **/ @@ -54,25 +46,25 @@ NodeSetFunctionCall::NodeSetFunctionCall(short type) : FunctionCall() { this->type = type; switch ( type ) { case COUNT : - FunctionCall::setName(XPathNames::COUNT_FN); + name = XPathNames::COUNT_FN; break; case ID : - FunctionCall::setName(XPathNames::ID_FN); + name = XPathNames::ID_FN; break; case LAST : - FunctionCall::setName(XPathNames::LAST_FN); + name = XPathNames::LAST_FN; break; case LOCAL_NAME: - FunctionCall::setName(XPathNames::LOCAL_NAME_FN); + name = XPathNames::LOCAL_NAME_FN; break; case NAME: - FunctionCall::setName(XPathNames::NAME_FN); + name = XPathNames::NAME_FN; break; case NAMESPACE_URI: - FunctionCall::setName(XPathNames::NAMESPACE_URI_FN); + name = XPathNames::NAMESPACE_URI_FN; break; default: - FunctionCall::setName(XPathNames::POSITION_FN); + name = XPathNames::POSITION_FN; break; } } //-- NodeSetFunctionCall diff --git a/mozilla/content/xslt/src/xpath/txNumberFunctionCall.cpp b/mozilla/content/xslt/src/xpath/txNumberFunctionCall.cpp index 83dd396ed64..d4a8486e2f1 100644 --- a/mozilla/content/xslt/src/xpath/txNumberFunctionCall.cpp +++ b/mozilla/content/xslt/src/xpath/txNumberFunctionCall.cpp @@ -25,7 +25,7 @@ * Nisheeth Ranjan, nisheeth@netscape.com * -- implemented rint function, which was not available on Windows. * - * $Id: txNumberFunctionCall.cpp,v 1.13 2005-11-02 07:33:48 peterv%netscape.com Exp $ + * $Id: txNumberFunctionCall.cpp,v 1.14 2005-11-02 07:33:49 sicking%bigfoot.com Exp $ */ /* @@ -38,14 +38,6 @@ #include "XMLDOMUtils.h" #include -/** - * Creates a default NumberFunctionCall. The number() function - * is the default -**/ -NumberFunctionCall::NumberFunctionCall() : FunctionCall(XPathNames::NUMBER_FN) { - type = NUMBER; -} //-- NumberFunctionCall - /** * Creates a NumberFunctionCall of the given type **/ @@ -53,20 +45,20 @@ NumberFunctionCall::NumberFunctionCall(short type) : FunctionCall() { this->type = type; switch ( type ) { case ROUND : - FunctionCall::setName(XPathNames::ROUND_FN); + name = XPathNames::ROUND_FN; break; case CEILING : - FunctionCall::setName(XPathNames::CEILING_FN); + name = XPathNames::CEILING_FN; break; case FLOOR : - FunctionCall::setName(XPathNames::FLOOR_FN); + name = XPathNames::FLOOR_FN; break; case SUM : - FunctionCall::setName(XPathNames::SUM_FN); + name = XPathNames::SUM_FN; break; case NUMBER : default : - FunctionCall::setName(XPathNames::NUMBER_FN); + name = XPathNames::NUMBER_FN; break; } } //-- NumberFunctionCall diff --git a/mozilla/content/xslt/src/xpath/txNumberResult.cpp b/mozilla/content/xslt/src/xpath/txNumberResult.cpp index 6f5e9644433..14ccfd59ab0 100644 --- a/mozilla/content/xslt/src/xpath/txNumberResult.cpp +++ b/mozilla/content/xslt/src/xpath/txNumberResult.cpp @@ -21,14 +21,14 @@ * Keith Visco, kvisco@ziplink.net * -- original author. * - * $Id: txNumberResult.cpp,v 1.6 2005-11-02 07:34:01 kvisco%ziplink.net Exp $ + * $Id: txNumberResult.cpp,v 1.7 2005-11-02 07:34:02 sicking%bigfoot.com Exp $ */ /** * NumberResult * Represents the a number as the result of evaluating an Expr * @author Keith Visco - * @version $Revision: 1.6 $ $Date: 2005-11-02 07:34:01 $ + * @version $Revision: 1.7 $ $Date: 2005-11-02 07:34:02 $ **/ #include "ExprResult.h" @@ -40,10 +40,6 @@ NumberResult::NumberResult() { value = 0.0; } //-- NumberResult -NumberResult::NumberResult(const NumberResult& nbrResult) { - this->value = nbrResult.getValue(); -} //-- NumberResult - /** * Creates a new NumberResult with the value of the given double parameter * @param dbl the double to use for initialization of this NumberResult's value @@ -52,21 +48,6 @@ NumberResult::NumberResult(double dbl) { this->value = dbl; } //-- NumberResult -/** - * Returns the value of this NumberResult - * @return the value of this NumberResult -**/ -double NumberResult::getValue() const { - return this->value; -} //-- getValue - -/** - * -**/ -MBool NumberResult::isNaN() const { - return Double::isNaN(value); -} //-- isNaN - /* * Virtual Methods from ExprResult */ @@ -87,7 +68,7 @@ MBool NumberResult::booleanValue() { // OG+ // As per the XPath spec, the boolean value of a number is true if and only if // it is neither positive 0 nor negative 0 nor NaN - return (MBool)(this->value != 0.0 && this->value != -0.0 && ! isNaN()); + return (MBool)(value != 0.0 && !Double::isNaN(value)); // OG- } //-- booleanValue diff --git a/mozilla/content/xslt/src/xpath/txPathExpr.cpp b/mozilla/content/xslt/src/xpath/txPathExpr.cpp index 0cdd119f9b1..5cdc99806eb 100644 --- a/mozilla/content/xslt/src/xpath/txPathExpr.cpp +++ b/mozilla/content/xslt/src/xpath/txPathExpr.cpp @@ -29,7 +29,7 @@ * - foo//bar would not match properly if there was more than * one node in the NodeSet (nodes) on the final iteration * - * $Id: txPathExpr.cpp,v 1.8 2005-11-02 07:33:44 peterv%netscape.com Exp $ + * $Id: txPathExpr.cpp,v 1.9 2005-11-02 07:33:45 sicking%bigfoot.com Exp $ */ #include "Expr.h" @@ -63,21 +63,6 @@ PathExpr::~PathExpr() delete iter; } //-- ~PathExpr -/** - * Adds the Expr to this PathExpr - * @param expr the Expr to add to this PathExpr - * @param index the index at which to add the given Expr -**/ -void PathExpr::addExpr(int index, Expr* expr, short ancestryOp) -{ - if (expr) { - PathExprItem* pxi = new PathExprItem; - pxi->expr = expr; - pxi->ancestryOp = ancestryOp; - expressions.insert(index, pxi); - } -} //-- addPattenExpr - /** * Adds the Expr to this PathExpr * @param expr the Expr to add to this PathExpr diff --git a/mozilla/content/xslt/src/xpath/txPredicateList.cpp b/mozilla/content/xslt/src/xpath/txPredicateList.cpp index 9cbe9ce4baa..ddff678abb4 100644 --- a/mozilla/content/xslt/src/xpath/txPredicateList.cpp +++ b/mozilla/content/xslt/src/xpath/txPredicateList.cpp @@ -21,7 +21,7 @@ * Keith Visco, kvisco@ziplink.net * -- original author. * - * $Id: txPredicateList.cpp,v 1.3 2005-11-02 07:33:52 margaret.chan%sun.com Exp $ + * $Id: txPredicateList.cpp,v 1.4 2005-11-02 07:33:53 sicking%bigfoot.com Exp $ */ #include "Expr.h" @@ -30,7 +30,7 @@ * Represents an ordered list of Predicates, * for use with Step and Filter Expressions * @author Keith Visco - * @version $Revision: 1.3 $ $Date: 2005-11-02 07:33:52 $ + * @version $Revision: 1.4 $ $Date: 2005-11-02 07:33:53 $ **/ //-- PredicateList Implementation --/ @@ -123,14 +123,6 @@ MBool PredicateList::isEmpty() { return (MBool)(predicates.getLength() == 0); } //-- isEmpty -/** - * Removes the given Expr from the list - * @param expr the Expr to remove from the list -**/ -Expr* PredicateList::remove(Expr* expr) { - return (Expr*)predicates.remove(expr); -} //-- remove - void PredicateList::toString(String& dest) { ListIterator* iter = predicates.iterator(); diff --git a/mozilla/content/xslt/src/xpath/txRelationalExpr.cpp b/mozilla/content/xslt/src/xpath/txRelationalExpr.cpp index 727ae29ef9a..aab0006a7f0 100644 --- a/mozilla/content/xslt/src/xpath/txRelationalExpr.cpp +++ b/mozilla/content/xslt/src/xpath/txRelationalExpr.cpp @@ -21,7 +21,7 @@ * Keith Visco, kvisco@ziplink.net * -- original author. * - * $Id: txRelationalExpr.cpp,v 1.5 2005-11-02 07:33:48 peterv%netscape.com Exp $ + * $Id: txRelationalExpr.cpp,v 1.6 2005-11-02 07:33:49 sicking%bigfoot.com Exp $ */ #include "Expr.h" @@ -31,12 +31,6 @@ //- RelationalExpr -/ //------------------/ -RelationalExpr::RelationalExpr() { - this->op = EQUAL; - this->leftExpr = 0; - this->rightExpr = 0; -} //-- RelationalExpr - RelationalExpr::RelationalExpr(Expr* leftExpr, Expr* rightExpr, short op) { this->op = op; this->leftExpr = leftExpr; diff --git a/mozilla/content/xslt/src/xpath/txRootExpr.cpp b/mozilla/content/xslt/src/xpath/txRootExpr.cpp index 3de9a4ff50b..a40eb2be54d 100644 --- a/mozilla/content/xslt/src/xpath/txRootExpr.cpp +++ b/mozilla/content/xslt/src/xpath/txRootExpr.cpp @@ -21,15 +21,11 @@ * Keith Visco, kvisco@ziplink.net * -- original author. * - * $Id: txRootExpr.cpp,v 1.1 2005-11-02 07:33:56 kvisco%ziplink.net Exp $ + * $Id: txRootExpr.cpp,v 1.2 2005-11-02 07:33:57 sicking%bigfoot.com Exp $ */ #include "Expr.h" -MBool RootExpr::isAbsolute() { - return MB_TRUE; -} //-- isAbsolute - /** * Evaluates this Expr based on the given context node and processor state * @param context the context node for evaluation of this Expr diff --git a/mozilla/content/xslt/src/xpath/txStringFunctionCall.cpp b/mozilla/content/xslt/src/xpath/txStringFunctionCall.cpp index cda56250295..696e902921f 100644 --- a/mozilla/content/xslt/src/xpath/txStringFunctionCall.cpp +++ b/mozilla/content/xslt/src/xpath/txStringFunctionCall.cpp @@ -21,14 +21,14 @@ * Keith Visco, kvisco@ziplink.net * -- original author. * - * $Id: txStringFunctionCall.cpp,v 1.11 2005-11-02 07:33:46 peterv%netscape.com Exp $ + * $Id: txStringFunctionCall.cpp,v 1.12 2005-11-02 07:33:47 sicking%bigfoot.com Exp $ */ /** * StringFunctionCall * A representation of the XPath String funtions * @author Keith Visco - * @version $Revision: 1.11 $ $Date: 2005-11-02 07:33:46 $ + * @version $Revision: 1.12 $ $Date: 2005-11-02 07:33:47 $ **/ #include "FunctionLib.h" @@ -36,14 +36,6 @@ #include "XMLDOMUtils.h" #include -/** - * Creates a default StringFunctionCall. The string() function - * is the default -**/ -StringFunctionCall::StringFunctionCall() : FunctionCall(XPathNames::STRING_FN) { - type = STRING; -} //-- StringFunctionCall - /** * Creates a StringFunctionCall of the given type **/ @@ -51,31 +43,31 @@ StringFunctionCall::StringFunctionCall(short type) : FunctionCall() { this->type = type; switch ( type ) { case CONCAT: - FunctionCall::setName(XPathNames::CONCAT_FN); + name = XPathNames::CONCAT_FN; break; case CONTAINS: - FunctionCall::setName(XPathNames::CONTAINS_FN); + name = XPathNames::CONTAINS_FN; break; case STARTS_WITH: - FunctionCall::setName(XPathNames::STARTS_WITH_FN); + name = XPathNames::STARTS_WITH_FN; break; case STRING_LENGTH: - FunctionCall::setName(XPathNames::STRING_LENGTH_FN); + name = XPathNames::STRING_LENGTH_FN; break; case SUBSTRING: - FunctionCall::setName(XPathNames::SUBSTRING_FN); + name = XPathNames::SUBSTRING_FN; break; case SUBSTRING_AFTER: - FunctionCall::setName(XPathNames::SUBSTRING_AFTER_FN); + name = XPathNames::SUBSTRING_AFTER_FN; break; case SUBSTRING_BEFORE: - FunctionCall::setName(XPathNames::SUBSTRING_BEFORE_FN); + name = XPathNames::SUBSTRING_BEFORE_FN; break; case TRANSLATE: - FunctionCall::setName(XPathNames::TRANSLATE_FN); + name = XPathNames::TRANSLATE_FN; break; default: - FunctionCall::setName(XPathNames::STRING_FN); + name = XPathNames::STRING_FN; break; } } //-- StringFunctionCall diff --git a/mozilla/content/xslt/src/xpath/txStringResult.cpp b/mozilla/content/xslt/src/xpath/txStringResult.cpp index dda106e50a0..3c0b682c80d 100644 --- a/mozilla/content/xslt/src/xpath/txStringResult.cpp +++ b/mozilla/content/xslt/src/xpath/txStringResult.cpp @@ -21,33 +21,23 @@ * Keith Visco, kvisco@ziplink.net * -- original author. * - * $Id: txStringResult.cpp,v 1.7 2005-11-02 07:33:58 nisheeth%netscape.com Exp $ + * $Id: txStringResult.cpp,v 1.8 2005-11-02 07:33:59 sicking%bigfoot.com Exp $ */ /** * StringResult * Represents a String as a Result of evaluating an Expr * @author Keith Visco - * @version $Revision: 1.7 $ $Date: 2005-11-02 07:33:58 $ + * @version $Revision: 1.8 $ $Date: 2005-11-02 07:33:59 $ **/ #include "ExprResult.h" - /** * Default Constructor **/ StringResult::StringResult() { } //-- StringResult -/** - * Creates a new StringResult with the value of the given String parameter - * @param str the String to use for initialization of this StringResult's value -**/ -StringResult::StringResult(String& str) { - //-- copy str - this->value = str; -} //-- StringResult - /** * Creates a new StringResult with the value of the given String parameter * @param str the String to use for initialization of this StringResult's value @@ -66,13 +56,6 @@ StringResult::StringResult(const char* str) { this->value = str; } //-- StringResult -/** - * Returns the value of this StringResult -**/ -String& StringResult::getValue() { - return this->value; -} //-- getValue - /* * Virtual Methods from ExprResult */ diff --git a/mozilla/content/xslt/src/xpath/txUnaryExpr.cpp b/mozilla/content/xslt/src/xpath/txUnaryExpr.cpp index 356d583a2e1..cea1f9ab06a 100644 --- a/mozilla/content/xslt/src/xpath/txUnaryExpr.cpp +++ b/mozilla/content/xslt/src/xpath/txUnaryExpr.cpp @@ -20,11 +20,6 @@ #include "Expr.h" -UnaryExpr::UnaryExpr() -{ - expr = 0; -} - UnaryExpr::UnaryExpr(Expr* expr) { this->expr = expr; @@ -35,12 +30,6 @@ UnaryExpr::~UnaryExpr() delete expr; } -void UnaryExpr::setExpr(Expr* expr) -{ - delete this->expr; - this->expr = expr; -} - /* * Evaluates this Expr based on the given context node and processor state * @param context the context node for evaluation of this Expr diff --git a/mozilla/content/xslt/src/xpath/txUnionExpr.cpp b/mozilla/content/xslt/src/xpath/txUnionExpr.cpp index 05dcb719a93..460632214ae 100644 --- a/mozilla/content/xslt/src/xpath/txUnionExpr.cpp +++ b/mozilla/content/xslt/src/xpath/txUnionExpr.cpp @@ -21,7 +21,7 @@ * Keith Visco, kvisco@ziplink.net * -- original author. * - * $Id: txUnionExpr.cpp,v 1.2 2005-11-02 07:33:51 sicking%bigfoot.com Exp $ + * $Id: txUnionExpr.cpp,v 1.3 2005-11-02 07:33:52 sicking%bigfoot.com Exp $ */ #include "Expr.h" @@ -59,15 +59,6 @@ void UnionExpr::addExpr(Expr* expr) { expressions.add(expr); } //-- addExpr -/** - * Adds the Expr to this UnionExpr - * @param expr the Expr to add to this UnionExpr -**/ -void UnionExpr::addExpr(int index, Expr* expr) { - if (expr) - expressions.insert(index, expr); -} //-- addExpr - //------------------------------------/ //- Virtual methods from Expr -/ //------------------------------------/ diff --git a/mozilla/content/xslt/src/xpath/txVariableRefExpr.cpp b/mozilla/content/xslt/src/xpath/txVariableRefExpr.cpp index 45f51e84a06..3c42e36b7d7 100644 --- a/mozilla/content/xslt/src/xpath/txVariableRefExpr.cpp +++ b/mozilla/content/xslt/src/xpath/txVariableRefExpr.cpp @@ -21,7 +21,7 @@ * Keith Visco, kvisco@ziplink.net * -- original author. * - * $Id: txVariableRefExpr.cpp,v 1.1 2005-11-02 07:33:55 kvisco%ziplink.net Exp $ + * $Id: txVariableRefExpr.cpp,v 1.2 2005-11-02 07:33:56 sicking%bigfoot.com Exp $ */ #include "Expr.h" @@ -30,12 +30,6 @@ //- VariableRefExpr -/ //-------------------/ -/** - * Default constructor -**/ -VariableRefExpr::VariableRefExpr() { -} //-- VariableRefExpr - /** * Creates a VariableRefExpr with the given variable name **/ @@ -43,19 +37,6 @@ VariableRefExpr::VariableRefExpr(const String& name) { this->name = name; } //-- VariableRefExpr -/** - * Creates a VariableRefExpr with the given variable name -**/ -VariableRefExpr::VariableRefExpr(String& name) { - this->name = name; -} //-- VariableRefExpr - -/** - * Default destructor -**/ -VariableRefExpr::~VariableRefExpr() { -} //-- ~VariableRefExpr - /** * Evaluates this Expr based on the given context node and processor state * @param context the context node for evaluation of this Expr @@ -92,8 +73,9 @@ ExprResult* VariableRefExpr::evaluate(Node* context, ContextState* cs) { break; //-- StringResult default: - StringResult* strResult = new StringResult(); - exprResult->stringValue(strResult->getValue()); + String tmp; + exprResult->stringValue(tmp); + StringResult* strResult = new StringResult(tmp); copyOfResult = strResult; break; }