class XPathParser {

    protected StepExpression parseStepExpr( TokenStream tokens ) {
        KindTest kindTest = parseKindTest(tokens);
        if (kindTest != null) {
            // Now parse the predicates ...
            List<Component> predicates = parsePredicates(tokens);
            return new AxisStep(kindTest, predicates);
        }
        if (tokens.matches('(') || tokens.matches('.') || tokens.matches(XPathTokenizer.QUOTED_STRING)
            || tokens.matches(ANY_VALUE, "(") || tokens.matches(ANY_VALUE, ":", ANY_VALUE, "(")) {
            // We know its a filter expression (though literals don't fit this pattern) ...
            return parseFilterExpr(tokens);
        }
        AxisStep result = parseAxisStep(tokens);
        if (result != null) return result;
        // It must be the remaining kind of filter expression ...
        return parseFilterExpr(tokens);
    }

    public  XPathParser( TypeSystem context );

}