From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Matt Wette Newsgroups: gmane.lisp.guile.user Subject: Re: NYACC: getting source location info? Date: Fri, 10 Jul 2020 20:00:15 -0700 Message-ID: <85724108-5124-748b-c6b0-bf011ebf3a4a@gmail.com> References: <20200710203743.GA10781@tuxteam.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23108"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sat Jul 11 05:00:35 2020 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ju5kh-0005v0-9M for guile-user@m.gmane-mx.org; Sat, 11 Jul 2020 05:00:35 +0200 Original-Received: from localhost ([::1]:54146 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ju5kf-0003WR-P6 for guile-user@m.gmane-mx.org; Fri, 10 Jul 2020 23:00:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48918) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ju5kU-0003WE-OV for guile-user@gnu.org; Fri, 10 Jul 2020 23:00:22 -0400 Original-Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]:36612) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ju5kT-0005AB-1q for guile-user@gnu.org; Fri, 10 Jul 2020 23:00:22 -0400 Original-Received: by mail-pj1-x102e.google.com with SMTP id md7so3404813pjb.1 for ; Fri, 10 Jul 2020 20:00:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=O7TUf18sAtkb1P19fQExkeT/aRo3LMvxb7ASFqzlSuc=; b=hAD7F1BNRQOxQtSOazhOa1fy4JP/DIx2LJ4Xkl+gMgfjhjLiizxKKF5RFRl2AOy5/h kboZrUPFZ4+bMObGN/9zamTAn8ziucvkS0avv6GY5hVyjfijnQw/Mc+a0YAww1x1fLJq j5YKE8DzAtAcceRZziqyHYArWPX2AUUYyzBMgVUK/AC72QvkK6WM8fgfBx2NEtLHEp9U SSEY+sbCA5kRT1k5iPODTJi6rpnYxuit4qJWgbLUpUTOEnM8BAlns0ZKtVKtZIVvkkc7 Ak7FabJA1BP7WY1tLYgkIaYUSFQZyJLCmbW+qAUZ4QybERBT8ULo2md18K9/GPeOCpkS reHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=O7TUf18sAtkb1P19fQExkeT/aRo3LMvxb7ASFqzlSuc=; b=Fb9dsiZnvNMnTLARqKVUwbP6jRkkjuqxMzX6jpTr7Y2aqprQtYBIOgo6C3fdhLuQHx DDd+R1wEPB4rkT8obVIKJryRa82Gl9esoDS0JkP+XCneTq7Qggb3CTMM9isoRIg5/cJF bs72xpCWPTLnivbFXRG9NPuYKlt7OUUlH2hL708Qz8eszSzwccLTi8EgZhT7SBR5JSyC lYi7plSpuDhyHZC58c6njJwkEDWy3TqAc/ZF35WpVDdiXRtClVd4LUkXcO6Fi+fAt1NG Oy2ZEK1d+fiEYPk+7rgfRa/poqPu78xy/h7moaLfuCBE3xo1zpsdoENiK5kOsJSqGgLc k9QA== X-Gm-Message-State: AOAM533eAg47INaUChGkT/698lKJfdTSWODyVDsJBDJwCpDb1WOlG4oP X7l6CVI0bnruDkbi4cuaZAGqBZ4cTBI= X-Google-Smtp-Source: ABdhPJyIhVW9Q+1wrsikhNVSHKj5EJu6KB3tXg9NIBNK+EfQTdEzVZLQE8CbKgIubDrdp/tZAe3D9g== X-Received: by 2002:a17:90a:fe6:: with SMTP id 93mr8530395pjz.145.1594436418356; Fri, 10 Jul 2020 20:00:18 -0700 (PDT) Original-Received: from [192.168.2.183] (64-52-176-132.championbroadband.com. [64.52.176.132]) by smtp.gmail.com with ESMTPSA id m31sm7458777pjb.52.2020.07.10.20.00.16 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Jul 2020 20:00:17 -0700 (PDT) In-Reply-To: <20200710203743.GA10781@tuxteam.de> Content-Language: en-US Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=matt.wette@gmail.com; helo=mail-pj1-x102e.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:16659 Archived-At: 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