RE: Parentheses may be used for grouping

> Since parentheses may be used for grouping this is obviously allowed, 
> 
> /foo/bar[ ( fish or cow ) and dog ]
> 
> however am I correct in assuming that the following example 
> supplied in the spec is not allowed according to the grammar?
> 
> (preceding::foo)[1]
> 
> I do understand what it means etc. I just can't work out how 
> (Expr)Predicate is allowed.


This expression is allowed, I think. An Expr can be a StepExpr, which can be
a GeneralStep; a GeneralStep is a PrimaryExpr followed by a StepQualifiers;
a parenthesized expression is a PrimaryExpr, and "[1]" is a StepQualifiers.

> It's not allowed to have '(' or ')' ina Step either.

Again, a StepExpr can be a GeneralStep which can be a Primary. 

Mike Kay 

Received on Thursday, 3 January 2002 11:16:47 UTC