protected Source parseFrom( TokenStream tokens,
TypeSystem typeSystem ) {
Position firstSourcePosition = tokens.nextPosition();
Source source = super.parseFrom(tokens, typeSystem);
if (tokens.matches(',') && source instanceof NamedSelector) {
NamedSelector selector = (NamedSelector)source;
JoinableSources joinedSources = new JoinableSources(selector, firstSourcePosition);
while (tokens.canConsume(',')) {
// This is a JCR-SQL-style JOIN ...
Position nextSourcePosition = tokens.nextPosition();
NamedSelector nextSource = parseNamedSelector(tokens, typeSystem);
joinedSources.add(nextSource, nextSourcePosition);
}
source = joinedSources;
}
return source;