From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Jan Nieuwenhuizen Newsgroups: gmane.lisp.guile.user Subject: Re: [ANN] Nyacc version 0.83.0 released Date: Fri, 06 Apr 2018 14:38:28 +0200 Organization: AvatarAcademy.nl Message-ID: <874lko8q7v.fsf@gnu.org> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1523018243 9099 195.159.176.226 (6 Apr 2018 12:37:23 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 6 Apr 2018 12:37:23 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) Cc: guile-user@gnu.org To: Matt Wette Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Apr 06 14:37:18 2018 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f4QcF-0002Et-NO for guile-user@m.gmane.org; Fri, 06 Apr 2018 14:37:15 +0200 Original-Received: from localhost ([::1]:52290 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f4QeL-0006Vr-7L for guile-user@m.gmane.org; Fri, 06 Apr 2018 08:39:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55999) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f4Qdh-0006Rg-NO for guile-user@gnu.org; Fri, 06 Apr 2018 08:38:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f4Qde-0005wp-Gf for guile-user@gnu.org; Fri, 06 Apr 2018 08:38:45 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:47860) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f4QdU-0005id-43; Fri, 06 Apr 2018 08:38:32 -0400 Original-Received: from mx.verum.com ([31.223.170.65]:34453 helo=dundal.peder.onsbrabantnet.nl) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1f4QdT-0004ZQ-FR; Fri, 06 Apr 2018 08:38:31 -0400 X-Url: http://AvatarAcademy.nl In-Reply-To: (Matt Wette's message of "Sun, 21 Jan 2018 10:19:11 -0800") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:14532 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Matt Wette writes: Hey Matt, > Nyacc version 0.83.0 has been released.=C2=A0=C2=A0 Nyacc is a set of Gui= le > modules for generating parsers, parsing C code, and converting C > headers to Guile Scheme. Very nice work. I've not really been working on MesCC for months now, concentrating on Mes itself to support running Nyacc and MesCC. I postponed updating Nyacc and even reverted to using 0.80.40 (or actually my slightly modified 0.80.42). I finally got round to looking at it and delighted that everything works! Two patches attached: cond-expands need to grok `mes' (or use else instead of `guile'). Also, parsing can be still a bit slow when running Nyacc on Mes (tcc.c now parses in ~1h); so I added some tracing to stderr. Possibly you have a better way to do this, esp. the NYACC_TRACE environment variable kludge... Saw your headsup about changing struct definitions, shall I wait with my upcomping Mes 0.12 release for that; do you already have a branch where I can test it and change MesCC? Greetings, janneke --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-cond-expand-allow-mes.patch >From fbbba0435f1ddcd5020599017781c8e88443bda2 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Fri, 6 Apr 2018 14:23:45 +0200 Subject: [PATCH 1/2] cond-expand: allow mes. --- module/nyacc/lang/util.scm | 3 ++- module/nyacc/lex.scm | 3 ++- module/nyacc/parse.scm | 3 ++- module/nyacc/util.scm | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/module/nyacc/lang/util.scm b/module/nyacc/lang/util.scm index 3de9ee4..b617885 100644 --- a/module/nyacc/lang/util.scm +++ b/module/nyacc/lang/util.scm @@ -44,7 +44,8 @@ #t) (guile (use-modules (ice-9 optargs)) - (use-modules (srfi srfi-16)))) + (use-modules (srfi srfi-16))) + (mes)) ;; This is a generic copyright/licence that will be printed in the output ;; of the examples/nyacc/lang/*/ actions.scm and tables.scm files. diff --git a/module/nyacc/lex.scm b/module/nyacc/lex.scm index 3e5c1e3..5122856 100644 --- a/module/nyacc/lex.scm +++ b/module/nyacc/lex.scm @@ -59,7 +59,8 @@ (guile-2 #t) (guile (use-modules (ice-9 optargs)) - (use-modules (ice-9 syncase)))) + (use-modules (ice-9 syncase))) + (mes)) (define (sf fmt . args) (apply simple-format #t fmt args)) diff --git a/module/nyacc/parse.scm b/module/nyacc/parse.scm index 39ceca3..51d73cd 100644 --- a/module/nyacc/parse.scm +++ b/module/nyacc/parse.scm @@ -27,7 +27,8 @@ (use-modules (srfi srfi-43))) (guile (use-modules (ice-9 optargs)) - (use-modules (nyacc compat18)))) + (use-modules (nyacc compat18))) + (mes)) ;; @item (machine-hashed? mach) => #t|#f ;; Indicate if the machine has been hashed. diff --git a/module/nyacc/util.scm b/module/nyacc/util.scm index ed7168b..1d34449 100644 --- a/module/nyacc/util.scm +++ b/module/nyacc/util.scm @@ -34,7 +34,7 @@ (guile (use-modules (ice-9 optargs)) (use-modules (nyacc compat18))) - ) + (mes)) (define (fmtstr fmt . args) (apply simple-format #f fmt args)) -- 2.16.2 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0002-trace-function-names-being-parsed.patch >From 1dd946b919ed84803e27af2697c83ffa8bafb34c Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Thu, 5 Apr 2018 21:13:13 +0200 Subject: [PATCH 2/2] trace function names being parsed. * module/nyacc/lang/c99/mach.d/c99act.scm (trace-function)[NYACC_TRACE]: Trace function names being parsed. (c99-act-v): Use it. --- module/nyacc/lang/c99/mach.d/c99act.scm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/module/nyacc/lang/c99/mach.d/c99act.scm b/module/nyacc/lang/c99/mach.d/c99act.scm index cfbdb7f..565f9b4 100644 --- a/module/nyacc/lang/c99/mach.d/c99act.scm +++ b/module/nyacc/lang/c99/mach.d/c99act.scm @@ -8,6 +8,12 @@ ;; version 3 of the License, or (at your option) any later version. ;; See the file COPYING.LESSER included with the this distribution. +(define (trace-function $1) + (when (getenv "NYACC_TRACE") + (display " :" (current-error-port)) + (display (cadr $1) (current-error-port)) + (display "\n" (current-error-port)))) + (define c99-act-v (vector ;; $start => translation-unit @@ -487,12 +493,15 @@ `(array-of ,$1 (var-len))) ;; direct-declarator => direct-declarator "(" parameter-type-list ")" (lambda ($4 $3 $2 $1 . $rest) + (trace-function $1) `(ftn-declr ,$1 ,(tl->list $3))) ;; direct-declarator => direct-declarator "(" identifier-list ")" (lambda ($4 $3 $2 $1 . $rest) + (trace-function $1) `(ftn-declr ,$1 ,(tl->list $3))) ;; direct-declarator => direct-declarator "(" ")" (lambda ($3 $2 $1 . $rest) + (trace-function $1) `(ftn-declr ,$1 (param-list))) ;; pointer => "*" type-qualifier-list pointer (lambda ($3 $2 $1 . $rest) -- 2.16.2 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable --=20 Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.com --=-=-=--