Re: Thoughts on pragmas and iXML

On Mon, 2025-02-10 at 01:15 +0000, Bethan Tovey-Walsh wrote:
>  Whatever you might want to do with the second pragma could therefore
> instead be included directly as part of the first pragma.  Does that
> make sense?

This assumes a model of editing the input rather than annotating it by
adding pragmas.

> In many ways, scope is an issue of syntax, rather than one of
> semantics. A pragma's scope tells us which grammar construct provides
> its context. The pragma will often manipulate that construct in some
> way, but it doesn't actually have to do so - that's a question for
> the pragma's semantics.

If i take a fragment of a grammar and want to reuse it elsewhere,
incorporating it into another grammar, i need to know where the pragmas
effect stops.

If the answer is, a pragma within a rule must not have any effect after
the end of that rule (in purely lexical terms), so that i can't do

name: {# start mode case-insensitive #} letter+.

identifier: name | {# end mode case-insensitive #} keyword.

then maybe that’s enough; a pragma between rules might apply to the
immediately following rule, to the left hand side, or to the rest of
the input until overridden.


-- 
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 Monday, 10 February 2025 03:19:01 UTC