forked from phoedos/pmd
Updates for abbreviation/unabbreviation.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5422 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
@ -13,6 +13,10 @@ options
|
||||
VISITOR = true;
|
||||
NODE_USES_PARSER = true;
|
||||
NODE_PACKAGE="net.sourceforge.pmd.jerry.ast.xpath";
|
||||
|
||||
DEBUG_PARSER = false;
|
||||
DEBUG_LOOKAHEAD = false;
|
||||
DEBUG_TOKEN_MANAGER = false;
|
||||
}
|
||||
|
||||
PARSER_BEGIN(XPath2Parser)
|
||||
@ -298,7 +302,7 @@ TOKEN :
|
||||
|
|
||||
<#NCNAMECHAR :
|
||||
// Note: JavaCC cannot do <NAMECHAR> - ":", duplicate <NAMECHAR> here with ":" removed
|
||||
<LETTER> | <DIGIT> | "." | "-" | "_" | ":" | <COMBININGCHAR> | <EXTENDER>
|
||||
<LETTER> | <DIGIT> | "." | "-" | "_" | <COMBININGCHAR> | <EXTENDER>
|
||||
>
|
||||
|
|
||||
<#NCNAMESTARTCHAR :
|
||||
@ -1050,22 +1054,21 @@ void ForwardAxis() :
|
||||
{
|
||||
}
|
||||
{
|
||||
// TODO Why is this not matching?!?
|
||||
("child" "::")
|
||||
("child" { jjtThis.addAxis(AxisEnum.CHILD); } "::")
|
||||
|
|
||||
("descendant" "::")
|
||||
("descendant" { jjtThis.addAxis(AxisEnum.DESCENDANT); } "::")
|
||||
|
|
||||
("attribute" "::")
|
||||
("attribute" { jjtThis.addAxis(AxisEnum.ATTRIBUTE); } "::")
|
||||
|
|
||||
("self" "::")
|
||||
("self" { jjtThis.addAxis(AxisEnum.SELF); } "::")
|
||||
|
|
||||
("descendant-or-self" "::")
|
||||
("descendant-or-self" { jjtThis.addAxis(AxisEnum.DESCENDANT_OR_SELF); } "::")
|
||||
|
|
||||
("following-sibling" "::")
|
||||
("following-sibling" { jjtThis.addAxis(AxisEnum.FOLLOWING_SIBLING); } "::")
|
||||
|
|
||||
("following" "::")
|
||||
("following" { jjtThis.addAxis(AxisEnum.FOLLOWING); } "::")
|
||||
|
|
||||
("namespace" "::")
|
||||
("namespace" { jjtThis.addAxis(AxisEnum.NAMESPACE); } "::")
|
||||
}
|
||||
|
||||
// [31] http://www.w3.org/TR/xpath20/#doc-xpath-AbbrevForwardStep
|
||||
@ -1091,15 +1094,15 @@ void ReverseAxis() :
|
||||
{
|
||||
}
|
||||
{
|
||||
("parent" "::")
|
||||
("parent" { jjtThis.addAxis(AxisEnum.PARENT); } "::")
|
||||
|
|
||||
("ancestor" "::")
|
||||
("ancestor" { jjtThis.addAxis(AxisEnum.ANCESTOR); } "::")
|
||||
|
|
||||
("preceding-sibling" "::")
|
||||
("preceding-sibling" { jjtThis.addAxis(AxisEnum.PRECEDING_SIBLING); } "::")
|
||||
|
|
||||
("preceding" "::")
|
||||
("preceding" { jjtThis.addAxis(AxisEnum.PRECEDING); } "::")
|
||||
|
|
||||
("ancestor-or-self" "::")
|
||||
("ancestor-or-self" { jjtThis.addAxis(AxisEnum.ANCESTOR_OR_SELF); } "::")
|
||||
}
|
||||
|
||||
// [34] http://www.w3.org/TR/xpath20/#doc-xpath-AbbrevReverseStep
|
||||
@ -1278,11 +1281,12 @@ void OccurrenceIndicator() :
|
||||
{
|
||||
}
|
||||
{
|
||||
"?"
|
||||
{ Token token; }
|
||||
token = "?" { jjtThis.setImage(token.image); }
|
||||
|
|
||||
"*"
|
||||
token = "*" { jjtThis.setImage(token.image); }
|
||||
|
|
||||
"+"
|
||||
token = "+" { jjtThis.setImage(token.image); }
|
||||
// TODO
|
||||
/* xgs: occurrence-indicators */
|
||||
}
|
||||
@ -1369,7 +1373,8 @@ void PITest() :
|
||||
{
|
||||
}
|
||||
{
|
||||
"processing-instruction" "(" (<NCNAME> | StringLiteral())? ")"
|
||||
{ Token token; }
|
||||
"processing-instruction" "(" (token = <NCNAME> { jjtThis.setImage(token.image); } | StringLiteral())? ")"
|
||||
}
|
||||
|
||||
// [60] http://www.w3.org/TR/xpath20/#doc-xpath-AttributeTest
|
||||
@ -1411,7 +1416,8 @@ void ElementTest() :
|
||||
{
|
||||
}
|
||||
{
|
||||
"element" "(" (ElementNameOrWildcard() ("," TypeName() ("?")?)?)? ")"
|
||||
{ Token token; }
|
||||
"element" "(" (ElementNameOrWildcard() ("," TypeName() (token = "?" { jjtThis.setImage(token.image); })?)?)? ")"
|
||||
}
|
||||
|
||||
// [65] http://www.w3.org/TR/xpath20/#doc-xpath-ElementNameOrWildcard
|
||||
|
@ -2,7 +2,9 @@
|
||||
|
||||
package net.sourceforge.pmd.jerry.ast.xpath;
|
||||
|
||||
public class ASTElementTest extends SimpleNode {
|
||||
import net.sourceforge.pmd.jerry.ast.xpath.custom.ImageNode;
|
||||
|
||||
public class ASTElementTest extends ImageNode {
|
||||
public ASTElementTest(int id) {
|
||||
super(id);
|
||||
}
|
||||
|
@ -2,7 +2,9 @@
|
||||
|
||||
package net.sourceforge.pmd.jerry.ast.xpath;
|
||||
|
||||
public class ASTForwardAxis extends SimpleNode {
|
||||
import net.sourceforge.pmd.jerry.ast.xpath.custom.StepNode;
|
||||
|
||||
public class ASTForwardAxis extends StepNode {
|
||||
public ASTForwardAxis(int id) {
|
||||
super(id);
|
||||
}
|
||||
|
@ -2,7 +2,9 @@
|
||||
|
||||
package net.sourceforge.pmd.jerry.ast.xpath;
|
||||
|
||||
public class ASTOccurrenceIndicator extends SimpleNode {
|
||||
import net.sourceforge.pmd.jerry.ast.xpath.custom.ImageNode;
|
||||
|
||||
public class ASTOccurrenceIndicator extends ImageNode {
|
||||
public ASTOccurrenceIndicator(int id) {
|
||||
super(id);
|
||||
}
|
||||
|
@ -2,7 +2,9 @@
|
||||
|
||||
package net.sourceforge.pmd.jerry.ast.xpath;
|
||||
|
||||
public class ASTPITest extends SimpleNode {
|
||||
import net.sourceforge.pmd.jerry.ast.xpath.custom.ImageNode;
|
||||
|
||||
public class ASTPITest extends ImageNode {
|
||||
public ASTPITest(int id) {
|
||||
super(id);
|
||||
}
|
||||
|
@ -2,7 +2,9 @@
|
||||
|
||||
package net.sourceforge.pmd.jerry.ast.xpath;
|
||||
|
||||
public class ASTReverseAxis extends SimpleNode {
|
||||
import net.sourceforge.pmd.jerry.ast.xpath.custom.StepNode;
|
||||
|
||||
public class ASTReverseAxis extends StepNode {
|
||||
public ASTReverseAxis(int id) {
|
||||
super(id);
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1611,22 +1611,22 @@ private final int jjMoveNfa_0(int startState, int curPos)
|
||||
}
|
||||
break;
|
||||
case 36:
|
||||
if ((0x7ff600000000000L & l) != 0L)
|
||||
if ((0x3ff600000000000L & l) != 0L)
|
||||
{
|
||||
if (kind > 94)
|
||||
kind = 94;
|
||||
jjCheckNAdd(35);
|
||||
}
|
||||
if ((0x7ff600000000000L & l) != 0L)
|
||||
else if (curChar == 58)
|
||||
jjstateSet[jjnewStateCnt++] = 32;
|
||||
if ((0x3ff600000000000L & l) != 0L)
|
||||
{
|
||||
if (kind > 93)
|
||||
kind = 93;
|
||||
jjCheckNAdd(34);
|
||||
}
|
||||
if ((0x7ff600000000000L & l) != 0L)
|
||||
if ((0x3ff600000000000L & l) != 0L)
|
||||
jjCheckNAddTwoStates(30, 31);
|
||||
if (curChar == 58)
|
||||
jjstateSet[jjnewStateCnt++] = 32;
|
||||
break;
|
||||
case 0:
|
||||
if ((0x3ff000000000000L & l) != 0L)
|
||||
@ -1768,7 +1768,7 @@ private final int jjMoveNfa_0(int startState, int curPos)
|
||||
jjCheckNAddTwoStates(28, 23);
|
||||
break;
|
||||
case 30:
|
||||
if ((0x7ff600000000000L & l) != 0L)
|
||||
if ((0x3ff600000000000L & l) != 0L)
|
||||
jjCheckNAddTwoStates(30, 31);
|
||||
break;
|
||||
case 31:
|
||||
@ -1776,21 +1776,21 @@ private final int jjMoveNfa_0(int startState, int curPos)
|
||||
jjstateSet[jjnewStateCnt++] = 32;
|
||||
break;
|
||||
case 33:
|
||||
if ((0x7ff600000000000L & l) == 0L)
|
||||
if ((0x3ff600000000000L & l) == 0L)
|
||||
break;
|
||||
if (kind > 93)
|
||||
kind = 93;
|
||||
jjstateSet[jjnewStateCnt++] = 33;
|
||||
break;
|
||||
case 34:
|
||||
if ((0x7ff600000000000L & l) == 0L)
|
||||
if ((0x3ff600000000000L & l) == 0L)
|
||||
break;
|
||||
if (kind > 93)
|
||||
kind = 93;
|
||||
jjCheckNAdd(34);
|
||||
break;
|
||||
case 35:
|
||||
if ((0x7ff600000000000L & l) == 0L)
|
||||
if ((0x3ff600000000000L & l) == 0L)
|
||||
break;
|
||||
if (kind > 94)
|
||||
kind = 94;
|
||||
|
@ -17,10 +17,18 @@ public abstract class AbstractPrintVisitor {
|
||||
return outputBuffer.toString();
|
||||
}
|
||||
|
||||
protected void print(Object o) {
|
||||
print(String.valueOf(o));
|
||||
}
|
||||
|
||||
protected void print(String s) {
|
||||
lineBuffer.append(s);
|
||||
}
|
||||
|
||||
protected void println(Object o) {
|
||||
println(String.valueOf(o));
|
||||
}
|
||||
|
||||
protected void println(String s) {
|
||||
print(s);
|
||||
println();
|
||||
@ -64,7 +72,6 @@ public abstract class AbstractPrintVisitor {
|
||||
}
|
||||
|
||||
protected void TODO(Node node) {
|
||||
String nodeName = node.getClass().getName();
|
||||
StringBuffer buf = new StringBuffer(100);
|
||||
buf.append("Visit for ");
|
||||
buf.append(node);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -45,7 +45,7 @@ public enum AxisEnum {
|
||||
/**
|
||||
* TODO Document
|
||||
*/
|
||||
PRECEDING_SIBLINGS("preceding-siblings", false),
|
||||
PRECEDING_SIBLING("preceding-sibling", false),
|
||||
/**
|
||||
* TODO Document
|
||||
*/
|
||||
|
@ -66,7 +66,7 @@ public class NodeAccessorAxisNavigator implements AxisNavigator {
|
||||
case ANCESTOR:
|
||||
// TODO
|
||||
break;
|
||||
case PRECEDING_SIBLINGS:
|
||||
case PRECEDING_SIBLING:
|
||||
// TODO
|
||||
break;
|
||||
case PRECEDING:
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user