From 681a173c51dfced5baedb919f5295de5d966cb88 Mon Sep 17 00:00:00 2001 From: Mattijs Ugen Date: Fri, 6 Jul 2012 20:21:47 +0200 Subject: [PATCH] Fix not matching * as nodetest In a peculiar manner, should figure out how to do properly... --- .../pxml/transform/xpath/XPathTransformer.jj | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/Source/nl/utwente/cs/pxml/transform/xpath/XPathTransformer.jj b/Source/nl/utwente/cs/pxml/transform/xpath/XPathTransformer.jj index bbd2117..220accc 100644 --- a/Source/nl/utwente/cs/pxml/transform/xpath/XPathTransformer.jj +++ b/Source/nl/utwente/cs/pxml/transform/xpath/XPathTransformer.jj @@ -54,7 +54,7 @@ class XPathTransformer { token = new Token(); jj_ntk = -1; jj_gen = 0; - for (int i = 0; i < 2; i++) jj_la1[i] = -1; + for (int i = 0; i < 1; i++) jj_la1[i] = -1; } /** @@ -175,18 +175,14 @@ TOKEN : { // separator between axis name and node test | < SEPARATOR : "::" > -// node names, required to start with a letter or _, followed by a word character (A-z, 0-9 or _) -| < NODENAME : (["A"-"z", "_"])(["0"-"9", "A"-"z", "_"])* > - -// XPath expression for 'any' -| < NODEANY : "*" > - -// XPath node types (copied from http://www.w3.org/TR/xpath/ section 3.7) -| < NODETYPE : - "comment()" +| < NODETEST : + (["A"-"z", "_"])(["0"-"9", "A"-"z", "_"])* + | "*" + | "comment()" | "text()" | "processing-instruction()" | "node()" > + } String parseInput() : @@ -301,7 +297,7 @@ AxisStep axisStep() : < STEP > axis = < AXIS > < SEPARATOR > - ( nodeTest = < NODENAME > | < NODEANY > | < NODETYPE > ) + nodeTest = < NODETEST > { // return the input, an XPath axis step return new AxisStep(axis.image, nodeTest.image);