step.setIncludeDescendants(descendant); if (index > 0) { step.setIndex(index);
step.setIncludeDescendants(descendant); if (index > 0) { step.setIndex(index);
step.setNameTest(steps[i].getNameTest()); step.setIncludeDescendants(steps[i].getIncludeDescendants()); step.setIndex(steps[i].getIndex()); pathNode.addPathStep(step);
step.setNameTest(steps[i].getNameTest()); step.setIncludeDescendants(steps[i].getIncludeDescendants()); step.setIndex(steps[i].getIndex()); pathNode.addPathStep(step);
((RelationQueryNode) queryNode).setPositionValue(1); } else if (queryNode.getType() == QueryNode.TYPE_LOCATION) { ((LocationStepQueryNode) queryNode).setIndex(1); } else { exceptions.add(new InvalidQueryException("Unsupported location for first()")); ((RelationQueryNode) queryNode).setPositionValue(LocationStepQueryNode.LAST); } else if (queryNode.getType() == QueryNode.TYPE_LOCATION) { ((LocationStepQueryNode) queryNode).setIndex(LocationStepQueryNode.LAST); } else { exceptions.add(new InvalidQueryException("Unsupported location for last()"));
((RelationQueryNode) queryNode).setPositionValue(1); } else if (queryNode.getType() == QueryNode.TYPE_LOCATION) { ((LocationStepQueryNode) queryNode).setIndex(1); } else { exceptions.add(new InvalidQueryException("Unsupported location for first()")); ((RelationQueryNode) queryNode).setPositionValue(LocationStepQueryNode.LAST); } else if (queryNode.getType() == QueryNode.TYPE_LOCATION) { ((LocationStepQueryNode) queryNode).setIndex(LocationStepQueryNode.LAST); } else { exceptions.add(new InvalidQueryException("Unsupported location for last()"));
RelationQueryNode pos = (RelationQueryNode) aPred; if (pos.getValueType() == QueryConstants.TYPE_POSITION) { node.setIndex(pos.getPositionValue());
RelationQueryNode pos = (RelationQueryNode) aPred; if (pos.getValueType() == QueryConstants.TYPE_POSITION) { node.setIndex(pos.getPositionValue());
if (node.getId() == JJTINTEGERLITERAL) { int index = Integer.parseInt(node.getValue()); ((LocationStepQueryNode) queryNode).setIndex(index); } else { exceptions.add(new InvalidQueryException("LocationStep only allows integer literal as position index"));
if (node.getId() == JJTINTEGERLITERAL) { int index = Integer.parseInt(node.getValue()); ((LocationStepQueryNode) queryNode).setIndex(index); } else { exceptions.add(new InvalidQueryException("LocationStep only allows integer literal as position index"));