@Test public void shouldParseFunctionCallWithOneQuotedStringLiteralParameter() { FunctionCall func = parser.parseFunctionCall(tokenize("a('foo')")); assertThat(func, is(notNullValue())); assertThat(func.getName(), is(nameTest("a"))); assertThat(func.getParameters().size(), is(1)); assertThat(func.getParameters().get(0), is((Component)literal("foo"))); }
protected FunctionCall parseFunctionCall( TokenStream tokens ) { NameTest name = parseQName(tokens); tokens.consume("("); List<Component> args = new ArrayList<Component>(); if (!tokens.matches(')')) { do { args.add(collapse(parseExprSingle(tokens))); } while (tokens.canConsume(",")); } tokens.consume(")"); return new FunctionCall(name, args); }
XPathParser { protected FunctionCall parseFunctionCall( TokenStream tokens ) { NameTest name = parseQName(tokens); tokens.consume("("); List<Component> args = new ArrayList<Component>(); if (!tokens.matches(')')) { do { args.add(collapse(parseExprSingle(tokens))); } while (tokens.canConsume(",")); } tokens.consume(")"); return new FunctionCall(name, args); } }
XPathParser { protected FunctionCall parseFunctionCall( TokenStream tokens ) { NameTest name = parseQName(tokens); tokens.consume("("); List<Component> args = new ArrayList<Component>(); if (!tokens.matches(')')) { do { args.add(collapse(parseExprSingle(tokens))); } while (tokens.canConsume(",")); } tokens.consume(")"); return new FunctionCall(name, args); } XPathParser( TypeSystem context ); }
XPathParser { protected FunctionCall parseFunctionCall( TokenStream tokens ) { NameTest name = parseQName(tokens); tokens.consume("("); List<Component> args = new ArrayList<Component>(); if (!tokens.matches(')')) { do { args.add(collapse(parseExprSingle(tokens))); } while (tokens.canConsume(",")); } tokens.consume(")"); return new FunctionCall(name, args); } XPathParser( TypeSystem context ); Component parseXPath( String xpath ); }
XPathParser { protected FunctionCall parseFunctionCall( TokenStream tokens ) { NameTest name = parseQName(tokens); tokens.consume("("); List<Component> args = new ArrayList<Component>(); if (!tokens.matches(')')) { do { args.add(collapse(parseExprSingle(tokens))); } while (tokens.canConsume(",")); } tokens.consume(")"); return new FunctionCall(name, args); } XPathParser( TypeSystem context ); Component parseXPath( String xpath );  }