@Test public void shouldParseStepExpressionFromQuotedStringLiteral() { assertThat(parser.parseStepExpr(tokenize("'foo'")), is((StepExpression)filterStep(literal("foo")))); }
protected StepExpression parseStepExpr( TokenStream tokens ) { KindTest kindTest = parseKindTest(tokens); if (kindTest != null) { 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, "(")) { return parseFilterExpr(tokens); } AxisStep result = parseAxisStep(tokens); if (result != null) return result; return parseFilterExpr(tokens); }
XPathParser { protected StepExpression parseStepExpr( TokenStream tokens ) { KindTest kindTest = parseKindTest(tokens); if (kindTest != null) { 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, "(")) { return parseFilterExpr(tokens); } AxisStep result = parseAxisStep(tokens); if (result != null) return result; return parseFilterExpr(tokens); } }
XPathParser { protected StepExpression parseStepExpr( TokenStream tokens ) { KindTest kindTest = parseKindTest(tokens); if (kindTest != null) { 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, "(")) { return parseFilterExpr(tokens); } AxisStep result = parseAxisStep(tokens); if (result != null) return result; return parseFilterExpr(tokens); } XPathParser( TypeSystem context ); }
XPathParser { protected StepExpression parseStepExpr( TokenStream tokens ) { KindTest kindTest = parseKindTest(tokens); if (kindTest != null) { 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, "(")) { return parseFilterExpr(tokens); } AxisStep result = parseAxisStep(tokens); if (result != null) return result; return parseFilterExpr(tokens); } XPathParser( TypeSystem context ); Component parseXPath( String xpath ); }
XPathParser { protected StepExpression parseStepExpr( TokenStream tokens ) { KindTest kindTest = parseKindTest(tokens); if (kindTest != null) { 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, "(")) { return parseFilterExpr(tokens); } AxisStep result = parseAxisStep(tokens); if (result != null) return result; return parseFilterExpr(tokens); } XPathParser( TypeSystem context ); Component parseXPath( String xpath );  }