[xquery-talk] Necessary whitespace

Benito van der Zander benito at benibela.de
Tue Apr 28 15:26:57 PDT 2015


Hi Michael,
>
>
> On 04/28/2015 11:22 PM, Michael Dyck wrote:
> > On 15-04-28 05:17 PM, Michael Dyck wrote:
> >> On 15-04-28 04:33 PM, Benito van der Zander wrote:
> >>> Hi Michael,
> >>>
> >>> What if it parses it in
> >>> 12!(12 div.)
> >>> as two tokens?
> >>> "." is a terminal symbol, and "div" is not a NCName there, just 
> part of a
> >>> MultiplicativeExpr.
> >>
> >> As pointed out by Ghislain yesterday, the last paragraph of A.2.2 
> applies:
> >> if a QName or NCName is followed by a "." or "-", the two tokens 
> must be
> >> separated by whitespace and/or Comments.
> >
> > Oh, sorry, right, you're saying it's not an NCName. Hm, that might 
> be a spec bug then.
>

Yes

>
>> Or in
>> 1<<a>2</a>
>> as "<" and "<a>2</a>"
>>
>> "<<" is longer, but not consistent.
>
>
>  "<<" is longer than "<", and there are continuations of "1<<" that 
> conform to the EBNF, so the LMP rule compels the tokenizer to pick 
> "<<", which leads to raising an error at ">". Ghislain also said this 
> yesterday.
>
> It's unclear what you mean by "consistent". If you mean that having 
> the tokenizer pick "<<" is not consistent with parsing the string as: 

Perhaps getting a consistent parsing tree?

Theoretically a parser could parse it right-to-left and see <a>2</a> 
before <


Cheers,
Benito



On 04/28/2015 11:22 PM, Michael Dyck wrote:
> On 15-04-28 05:17 PM, Michael Dyck wrote:
>> On 15-04-28 04:33 PM, Benito van der Zander wrote:
>>> Hi Michael,
>>>
>>> What if it parses it in
>>> 12!(12 div.)
>>> as two tokens?
>>> "." is a terminal symbol, and "div" is not a NCName there, just part 
>>> of a
>>> MultiplicativeExpr.
>>
>> As pointed out by Ghislain yesterday, the last paragraph of A.2.2 
>> applies:
>> if a QName or NCName is followed by a "." or "-", the two tokens must be
>> separated by whitespace and/or Comments.
>
> Oh, sorry, right, you're saying it's not an NCName. Hm, that might be 
> a spec bug then.
>
> -Michael
>
>
>
> _______________________________________________
> talk at x-query.com
> http://x-query.com/mailman/listinfo/talk
>
>



More information about the talk mailing list