santiagopg 02/05/16 07:35:19
Modified: java/src/org/apache/xalan/xsltc/compiler xpath.cup
Log:
Fix for axes127.
Revision Changes Path
1.38 +20 -22
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/xpath.cup
Index: xpath.cup
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/xpath.cup,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- xpath.cup 10 May 2002 17:38:32 -0000 1.37
+++ xpath.cup 16 May 2002 14:35:19 -0000 1.38
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: xpath.cup,v 1.37 2002/05/10 17:38:32 santiagopg Exp $
+ * @(#)$Id: xpath.cup,v 1.38 2002/05/16 14:35:19 santiagopg Exp $
*
* The Apache Software License, Version 1.1
*
@@ -228,6 +228,21 @@
public void report_fatal_error(String message, Object info) {
// empty
}
+
+ public RelativeLocationPath insertStep(Step step, RelativeLocationPath
rlp) {
+ if (rlp instanceof Step) {
+ return new ParentLocationPath(step, (Step) rlp);
+ }
+ else if (rlp instanceof ParentLocationPath) {
+ final ParentLocationPath plp = (ParentLocationPath) rlp;
+ final RelativeLocationPath newrlp = insertStep(step, plp.getPath());
+ return new ParentLocationPath(newrlp, plp.getStep());
+ }
+ else {
+ addError(new ErrorMsg(ErrorMsg.INTERNAL_ERR,
"XPathParser.insertStep"));
+ return rlp;
+ }
+ }
:}
terminal SLASH, DOT, LBRACK, RBRACK, VBAR, LPAREN, RPAREN, STAR, COMMA;
@@ -610,29 +625,12 @@
AbbreviatedAbsoluteLocationPath ::= DSLASH RelativeLocationPath:rlp
{:
+ final Step step = new Step(Axis.DESCENDANTORSELF, -1, null);
- AbsoluteLocationPath alp = null;
-
- Step left = new Step(Axis.DESCENDANTORSELF, -1, null);
-
- if (rlp instanceof ParentLocationPath) {
- ParentLocationPath plp = new ParentLocationPath(left, rlp);
- alp = new AbsoluteLocationPath(plp);
- }
- else if (rlp instanceof Step) {
- Step right = (Step)rlp;
- alp = new AbsoluteLocationPath(new ParentLocationPath(left,
right));
- }
- else {
- // Don't think we'll ever get here...
- Step right = new Step(Axis.CHILD, NodeTest.ELEMENT, null);
- alp = new AbsoluteLocationPath(new ParentLocationPath(left, right));
- }
-
- RESULT = new FilteredAbsoluteLocationPath(alp);
+ RESULT = new FilteredAbsoluteLocationPath(
+ new AbsoluteLocationPath(parser.insertStep(step,
+ (RelativeLocationPath) rlp)));
:};
-
-
Step ::= NodeTest:ntest
{:
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]