class XPathParser {

    protected PathExpression parseRelativePathExpr( TokenStream tokens ) {
        List<StepExpression> steps = new ArrayList<StepExpression>();
        steps.add(parseStepExpr(tokens));
        while (tokens.canConsume('/')) {
            if (tokens.canConsume('/')) {
                steps.add(new DescendantOrSelf());
            }
            if (tokens.hasNext()) {
                steps.add(parseStepExpr(tokens));
            }
        }
        OrderBy orderBy = parseOrderBy(tokens); // may be null
        return new PathExpression(true, steps, orderBy);
    }

    public  XPathParser( TypeSystem context );

}