From c0f13f760674b431f30b5ff17469030c5fa5a8d4 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 2 May 2006 05:49:17 +0000 Subject: r11667@tres: ted | 2006-05-01 22:48:49 -0700 Backing out version 11530. SVK is so liberating and so frustrating all at the same time. (bzr r697) --- src/dom/xpathtoken.cpp | 120 +++++++++++++++++++++++++++---------------------- 1 file changed, 67 insertions(+), 53 deletions(-) (limited to 'src/dom/xpathtoken.cpp') diff --git a/src/dom/xpathtoken.cpp b/src/dom/xpathtoken.cpp index 2d5dfc1d7..c9d4898d7 100644 --- a/src/dom/xpathtoken.cpp +++ b/src/dom/xpathtoken.cpp @@ -131,12 +131,12 @@ static TokenStringPair tokenStrings[] = /** - * Return the enumerated TokenType of this token + * Return the string TokenType of this token * (in the .cpp file) */ DOMString Token::getTypeString() { - DOMString ret; + DOMString ret = "unknown"; for (TokenStringPair *pair = tokenStrings ; pair->sval ; pair++) { if (pair->ival == type) @@ -148,6 +148,8 @@ DOMString Token::getTypeString() return ret; } + + //######################################################################## //# X P A T H A X I S //######################################################################## @@ -166,7 +168,8 @@ Axis::Axis() */ Axis::Axis(int tokPos) { - assign(other); + init(); + tokenPosition = tokPos; } @@ -183,7 +186,15 @@ Axis::Axis(const Axis &other) /** * */ -StackItem &StackItem::operator=(const StackItem &other) +Axis::~Axis() +{ +} + + +/** + * + */ +Axis &Axis::operator=(const Axis &other) { assign(other); return *this; @@ -192,105 +203,99 @@ StackItem &StackItem::operator=(const StackItem &other) /** * */ -void StackItem::assign(const StackItem &other) +void Axis::init() { - sval = other.sval; - ival = other.ival; - dval = other.dval; + tokenPosition = 0; } - -//######################################################################## -//# X P A T H S T A C K I T E M -//######################################################################## - /** * */ -StackItem::StackItem() +void Axis::assign(const Axis &other) { - ival = 0L; - dval = 0.0; + tokenPosition = other.tokenPosition; } - /** * */ -StackItem::StackItem(const StackItem &other) +void Axis::setPosition(unsigned int val) { - assign(other); + tokenPosition = val; } - /** * */ -Stack::~Stack() +unsigned int Axis::getPosition() { + return tokenPosition; } - /** * */ -void Stack::assign(const Stack &other) +void Axis::setNode(const Node *val) { - root = other.root; - nodeList = other.nodeList; - size = other.size; - for (int i=0 ; i::iterator iter; printf("############# TOKENS\n"); for (iter = tokens.begin() ; iter != tokens.end() ; iter++) { Token *tok = *iter; - tok->execute(stack); + tok->dump(); } } - list = stack.getNodeList(); - return list; +//######################################################################## +//# X P A T H E X E C U T O R +//######################################################################## + +/** + * + */ +TokenExecutor::TokenExecutor() +{ + reset(); } -- cgit v1.2.3