Re: a surprising whitespace-related ambiguity

On Mon, 2024-03-18 at 22:09 -0600, C. M. Sperberg-McQueen wrote:
> Thank you.  I'm n

Some systems (e.g. lex) resolve ambiguities like - vs. -- with a
longest matching token rule. But this relies on a separate tokenisation
pass. This is used e.g. for a +++ b and ---c in the C programming
language (both legal, and equivalent to a + (++b) and - (--c), where ++
and -- are unary autoincrement/decrement operators).

On the other hand sock ** shoe; relies on knowing wither "sock" has
been declared earlier in the input as a variable or as a type, so there
is also feedback from the parser to the lexer.

Both CSS and XPath have the problem that identifiers can contain
hyphens, so that space is needed in a subtraction a - b to distinguish
it from an identifier called "a-b".

Hmm, not sure i’m helping.


-- 
Liam Quin, https://www.delightfulcomputing.com/
Available for XML/Document/Information Architecture/XSLT/
XSL/XQuery/Web/Text Processing/A11Y training, work & consulting.
Barefoot Web-slave, antique illustrations:  http://www.fromoldbooks.org

Received on Tuesday, 19 March 2024 07:17:36 UTC