|
From: | Matt Wette |
Subject: | Re: NYACC: getting source location info? |
Date: | Fri, 10 Jul 2020 20:00:15 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
On 7/10/20 1:37 PM, tomas@tuxteam.de 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. Its endpoint is (is it?) (port-line (current-input-port) [and, of course, (port-column ...)] -- at least some playing around suggest that (and it makes sense, somehow). Is there anything I've overlooked? Or do I have to hack the (or roll-my-own) lexer for that? Thanks for any insight cheers -- t
I assume you mean providing source location information to the values (i.e, $1, etc). 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. Take care, Matt
[Prev in Thread] | Current Thread | [Next in Thread] |