[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NYACC: getting source location info?

From: tomas
Subject: Re: NYACC: getting source location info?
Date: Sat, 11 Jul 2020 10:10:14 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Fri, Jul 10, 2020 at 08:00:15PM -0700, Matt Wette wrote:

Hey, and thanks for your quick response!

> On 7/10/20 1:37 PM, wrote:
> >Hi,
> >
> >I'm having some fun with NYACC (thanks, Matt!).
> >
> >To help debugging things and for errors and warnings, it'd be nice
> >to "know" where the current LHS non-terminal starts in the source.


> I assume you mean providing source location information to the
> values (i.e, $1, etc).

Yes, basically.

I was just looking from the other end of the rule (and pictured
having a "special symbol" like $loc giving the "start point" of
the curent LHS). Both would be equivalent, I think.

>                       I've thought about that a few times but have
> not arrived at anything intelligent.  Maybe using object properties
> (see sec 6.11 in Guile Ref) in the lexical analyzer, as you mention.

I didn't think of that -- it feels pretty "side-channel-y" at first,
but perhaps it's an elegant solution, after all.

-- t

Attachment: signature.asc
Description: Digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]