added patches from Marina M. to fix predicate parsing, and make sure we look for Axis Identifier wild cards

git-svn-id: svn://10.0.0.236/trunk@65795 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
kvisco%ziplink.net
2000-04-13 09:13:22 +00:00
parent 656d2c9cb2
commit 4937ae4d73
2 changed files with 28 additions and 7 deletions

View File

@@ -25,13 +25,17 @@
* Bob Miller, Oblix Inc., kbob@oblix.com
* -- fixed bug with single quotes inside double quotes
*
* $Id: ExprLexer.cpp,v 1.1 2000-04-06 07:45:26 kvisco%ziplink.net Exp $
* Marina Mechtcheriakova, mmarina@mindspring.com
* -- Fixed bug in parse method so that we make sure we check for
* axis identifier wild cards, such as ancestor::*
*
* $Id: ExprLexer.cpp,v 1.2 2000-04-13 09:13:14 kvisco%ziplink.net Exp $
*/
/**
* Lexical analyzer for XPath expressions
* @author <a href="mailto:kvisco@ziplink.net">Keith Visco</a>
* @version $Revision: 1.1 $ $Date: 2000-04-06 07:45:26 $
* @version $Revision: 1.2 $ $Date: 2000-04-13 09:13:14 $
**/
#include <iostream.h>
@@ -640,6 +644,10 @@ void ExprLexer::parse(const String& pattern) {
case ASTERIX:
matchToken(tokenBuffer, ch);
switch ( prevToken->type ) {
//-- Fix: make sure check for axis identifier wild cards, such as
//-- ancestor::* - Marina M.
case Token::AXIS_IDENTIFIER :
//-- End Fix
case Token::PARENT_OP :
case Token::ANCESTOR_OP:
case Token::AT_SIGN :

View File

@@ -21,10 +21,12 @@
* Keith Visco, kvisco@ziplink.net
* -- original author.
* Olivier Gerardin, ogerardin@vo.lu
* -- fixed a bug in CreateExpr (@xxx=/yyy was parsed as
* @xxx=@xxx/yyy)
* -- fixed a bug in CreateExpr (@xxx=/yyy was parsed as @xxx=@xxx/yyy)
* Marina Mechtcheriakova
* -- fixed bug in ::parsePredicates,
* made sure we continue looking for more predicates.
*
* $Id: ExprParser.cpp,v 1.1 2000-04-06 07:45:29 kvisco%ziplink.net Exp $
* $Id: ExprParser.cpp,v 1.2 2000-04-13 09:13:22 kvisco%ziplink.net Exp $
*/
/**
@@ -32,7 +34,7 @@
* This class is used to parse XSL Expressions
* @author <A HREF="mailto:kvisco@ziplink.net">Keith Visco</A>
* @see ExprLexer
* @version $Revision: 1.1 $ $Date: 2000-04-06 07:45:29 $
* @version $Revision: 1.2 $ $Date: 2000-04-13 09:13:22 $
**/
#include "ExprParser.h"
@@ -811,8 +813,19 @@ String* ExprParser::parsePredicates(PredicateList* predicateList, ExprLexer& lex
}
if ( tok->type == Token::R_BRACKET) {
lexer.nextToken(); //-- eat ']'
break;
//-- Fix: look ahead at next token for mulitple predicates - Marina M.
tok = lexer.peek();
if ((!tok) || ( tok->type != Token::L_BRACKET )) break;
//-- /Fix
}
//-- Fix: handle multiple predicates - Marina M.
if (tok->type == Token::L_BRACKET)
lexer.nextToken(); //-- swallow '['
//-- /Fix
Expr* expr = createExpr(lexer);
predicateList->add(expr);
}