From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Matt Wette Newsgroups: gmane.lisp.guile.user Subject: Re: Nyacc: how to lex comments? Date: Tue, 17 Mar 2020 05:31:32 -0700 Message-ID: <8e63d711-a8b0-a525-b58a-2dac104a5e46@gmail.com> References: <20200316213941.GA5467@tuxteam.de> <20200317074649.GA27693@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="ciao.gmane.io:159.69.161.202"; logging-data="76014"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Tue Mar 17 13:31:57 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 1jEBO0-000Jfp-Qe for guile-user@m.gmane-mx.org; Tue, 17 Mar 2020 13:31:56 +0100 Original-Received: from localhost ([::1]:60550 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jEBNz-0006Un-P2 for guile-user@m.gmane-mx.org; Tue, 17 Mar 2020 08:31:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59135) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jEBNi-0006TF-Vd for guile-user@gnu.org; Tue, 17 Mar 2020 08:31:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jEBNg-0005dT-HE for guile-user@gnu.org; Tue, 17 Mar 2020 08:31:37 -0400 Original-Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]:46153) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jEBNg-0005ZL-9K for guile-user@gnu.org; Tue, 17 Mar 2020 08:31:36 -0400 Original-Received: by mail-pl1-x634.google.com with SMTP id r3so1519585pls.13 for ; Tue, 17 Mar 2020 05:31:35 -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=Pi8RT41/+9W7sKEFyFUxJbaN2jAm75KrVAxI6M1MPzE=; b=ayelkp/deoxERggV3ee2ZqhIy+lCny3Vm5BXpPmkSLO4avlHpRVB7bCvXvv6/r4Z9Z EsrLw1uyRZ82oFZvGX/sBL+wwDMoVlltGhOsqotZ2/lscQk/fsgGlnD11UEio/fCB5Mb WBhcdZFLN/LdPfF+bai3kXJfImQu3RaxvFrbr1axQVzeIxlGzZ83rv0bHG0Da8S6kXX5 lIh+o6nTz+5GT8oDEi0b1gXjUmUHMCfE+UfszuPGS8CZF+ytv/zcERsCxpJjzaL/s3Da rlvLMIb77d6x/yGAorx26BlOEDy3ZSvUmmWu9Q6saBtB6VoXzyDpJQEZNQyjz+GrlPCd VbwQ== 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=Pi8RT41/+9W7sKEFyFUxJbaN2jAm75KrVAxI6M1MPzE=; b=ACQ6ESVrkAgJjPn15jxIl79FwrtuhSl0NwfwlLu11X+tiNhawoiaB8DcN2qXS8u3ZC K4BxpKlSNjfsHUEdXJ/umHhvOjJYtKSLSo1HX/dKWpzn0l6GoFKq0j2HL6gYvjgvd3th 7iwmOIXY+3th728PLIaG3Og4x2bPfIq4tuCoWDgEiR92eoqgBT6hh/SmLU0z018Q05gN mKKawjLeyT7kpZ82wvjxop7znm7C75fBM2V7lXND1+TrKKBgE99H9CZQZVC2oD3VC0yk Wtq5G14KacOxJPG5JUSB+1lPUNgDdnBDcsT4SivVDMbhMNcSj3Z3t9u9ZXm2kqbr1LMz X7KQ== X-Gm-Message-State: ANhLgQ11XxirBXMIo65mqcRVDF6GiPI373L7BhLQlU4GD+qfHDBI2o9U 4ZaWVzqb8jGb/E4nCYjJIV016pq5 X-Google-Smtp-Source: ADFU+vs4a7vrX39/+EGpaeJzJYM+glvC59Fi2nMcDAufUMgsarEhAy1vhjA+HgS2G18aUdupStDJYA== X-Received: by 2002:a17:902:562:: with SMTP id 89mr4275798plf.58.1584448294021; Tue, 17 Mar 2020 05:31:34 -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 e9sm3170265pfl.179.2020.03.17.05.31.32 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 17 Mar 2020 05:31:33 -0700 (PDT) In-Reply-To: <20200317074649.GA27693@tuxteam.de> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::634 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:16316 Archived-At: On 3/17/20 12:46 AM, tomas@tuxteam.de wrote: > On Mon, Mar 16, 2020 at 05:11:59PM -0700, Matt Wette wrote: >> On 3/16/20 2:39 PM, tomas@tuxteam.de wrote: >>> Hi, >>> >>> in my quest to play parsing, I'm failing when I try to cope with >>> comments. >>> > [...] > >> make-comm-reader will not eat newlines at end of comment by default. >> If you want the comment # ... \n to include the newline try adding >> #:eat-newline #t. > D'oh, thanks. Also, I noticed I've to set #:comm-skipper in 'gen-lexer', > instead of #:comm-reader. > > I didn't quite understand the difference between both. Would I have > to include comments explicitly in the grammar if the lexer uses > #:comment-reader? > > Thanks again > -- tomás Yes.  Use comm-reader if your grammar accepts comments. Use comm-skipper if your grammar does not. The ffi-helper does read comments in the C grammar and dumps them in the output files, for example.