From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Matt Wette Newsgroups: gmane.lisp.guile.devel Subject: Re: [ANN] nyacc 0.82.0 released Date: Mon, 11 Sep 2017 18:44:06 -0700 Message-ID: <38943055-9474-455A-9926-8A74D7BA469A@gmail.com> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1505180671 7121 195.159.176.226 (12 Sep 2017 01:44:31 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 12 Sep 2017 01:44:31 +0000 (UTC) Cc: guile-user , guile-devel To: Matt Wette Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Sep 12 03:44:26 2017 Return-path: Envelope-to: guile-devel@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 1draFR-0001GX-JS for guile-devel@m.gmane.org; Tue, 12 Sep 2017 03:44:21 +0200 Original-Received: from localhost ([::1]:33113 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1draFX-0002Jz-94 for guile-devel@m.gmane.org; Mon, 11 Sep 2017 21:44:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50923) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1draFQ-00028y-H1 for guile-devel@gnu.org; Mon, 11 Sep 2017 21:44:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1draFK-0005m6-Sf for guile-devel@gnu.org; Mon, 11 Sep 2017 21:44:16 -0400 Original-Received: from mail-pf0-x22e.google.com ([2607:f8b0:400e:c00::22e]:35250) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1draFG-0005js-5T; Mon, 11 Sep 2017 21:44:10 -0400 Original-Received: by mail-pf0-x22e.google.com with SMTP id q76so2939072pfq.2; Mon, 11 Sep 2017 18:44:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=x/f/cYo8GLY7LuEh4bVoOh48qoqFk+Fj27qsj0DumTE=; b=idlaVG6AeoyGdOVofjCHtrYW+ap59wwIuweoeXUyzlpllpsvnpUqozySLYZWGo77Lc WGMk/Y79BSloqFiwRR4kZAw7hGhjWODv4aLFiTw3x2rZwp69GkCzlGSSJC0s0V9MSCpW teUm2+PCmOGObC6h/4IVa4C6TGcEgEyqSfVUPH8DQuYYIT6hBwEzoU041SWT5R3c7JmK 901DQ+xv4cxApnVlrHCGbCgsu7xXpgfSj09llhZ6aw2py6oqvs1xTnVJHy+MUqaW7EJG /9isVuZhgroodMRhIb5dH8/bLpU3nKFXQKHCV96c3nsj8o93NNRCpX+MoaIyDvU3hcAU MM+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=x/f/cYo8GLY7LuEh4bVoOh48qoqFk+Fj27qsj0DumTE=; b=LFAw7M8e4fr7RZFOhH6rFghaHrb3ThwyoRZN7mM7nLcUpwNK/fTZJXSQhxLeniquT+ f1ZIRDTi+Gqy1eqs1YTkKnI/trWPUv69i0PJ5d+QC3tmgwi7sMAmivmm63vLvfyHFAuj D/dlfWzYJWJLqmj7jqdiNyDTkAoh7mbUStjyHXgw3DM2hLwkaI8PlwWCF416QOPHEXio obX6W677G16or2LaqBiKD0hB/5K534S02XGMIte6EPslB7bgog+a9vhaeM3DiQSX43oG l6oKJla/6flgQqPjGUQvVas56a6sLnEdOwU6ri6w2TRJ9v6QmDWT3Ey6QnStodUwvMd+ 3B+A== X-Gm-Message-State: AHPjjUhr2OYN3oBrY6RNW+a/icBNgjYHqUqOploR9iwHWgtCPqA1t9ez GtbejJ6zrTxh6Q== X-Google-Smtp-Source: ADKCNb45YVd5HcILAC3NSdc3vClQuDkM6sa1sw0EySZH8+t8LL6Dc8EfaxZgXTL1TnfW/T2DAYdBHQ== X-Received: by 10.84.131.109 with SMTP id 100mr15383176pld.122.1505180647682; Mon, 11 Sep 2017 18:44:07 -0700 (PDT) Original-Received: from nautilus.championbroadband.com (216-165-229-229.championbroadband.com. [216.165.229.229]) by smtp.gmail.com with ESMTPSA id y128sm16295890pfy.125.2017.09.11.18.44.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Sep 2017 18:44:07 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.3273) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::22e X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.org gmane.lisp.guile.devel:19288 Archived-At: > On Sep 10, 2017, at 8:37 AM, Matt Wette wrote: >=20 > Nyacc 0.82.0 has been released Appologies if you have tried this and running into problems. I found a = few bugs. I have been working on macos but now trying on Centos system. I will = release a minor update by end of the coming weekend. The patch below should = help you=20 get by for now. -- Matt diff --git a/examples/nyacc/lang/c99/ffi-help.scm = b/examples/nyacc/lang/c99/ffi-help.scm index a9ec063..f4a2221 100644 --- a/examples/nyacc/lang/c99/ffi-help.scm +++ b/examples/nyacc/lang/c99/ffi-help.scm @@ -19,6 +19,8 @@ ;; bytestructure->descriptor->ffi-descriptor ;; bs:pointer->proc =20 +;; For enum typedefs we are not creating types but just using wrappers. + (define-module (nyacc lang c99 ffi-help) #:export (*ffi-help-version* define-ffi-module @@ -73,7 +75,7 @@ "__attribute__(X)=3D" "__inline=3D" "__inline__=3D" "__asm(X)=3D" "__asm__(X)=3D" - "__has_include=3D(X)__has_include__(X)" + "__has_include(X)=3D__has_include__(X)" "__extension__=3D" ) ;;("sys/cdefs.h" "__DARWIN_ALIAS(X)=3D") @@ -82,9 +84,10 @@ '(("__builtin" "__builtin_va_list=3Dvoid*" "__attribute__(X)=3D" "__inline=3D" "__inline__=3D" - "__asm(X)=3D" "__asm__(X)=3D") - "__has_include=3D(X)__has_include__(X)" + "__asm(X)=3D" "__asm__(X)=3D" + "__has_include(X)=3D__has_include__(X)" "__extension__=3D" + ) )))) (define fh-cpp-defs (cond @@ -753,7 +756,9 @@ (define (gen-exec-params params) (fold-right (lambda (param-decl seed) - (let* ((param-decl (expand-typerefs param-decl (*udict*) = (*defined*))) + ;; Changed to (*wrapped*) to include enum types. If we need = (*defined*) + ;; then we will need to create enum types in cnvt-udecl typedefs. + (let* ((param-decl (expand-typerefs param-decl (*udict*) = (*wrapped*))) (param-decl (udecl-rem-type-qual param-decl)) ;; ??? (mspec (udecl->mspec param-decl))) (acons (car mspec) (mspec->fh-unwrapper mspec) seed))) @@ -798,27 +803,6 @@ ;; specl is decl-spec-list tree ;; params is list of param-decl trees (i.e., cdr of param-list tree) ;; @end deffn -(define (OLD-cnvt-fctn name rdecl params) - #;(when (string=3D? name "gdbm_store") (sfout "cnvt-fctn\n") (ppout = params)) - (let* ((decl-return (gen-decl-return rdecl)) - (decl-params (gen-decl-params params)) - (exec-return (gen-exec-return-wrapper rdecl)) - (exec-params (gen-exec-params params))) - (when #f - (sfout "cnvt-fctn\n") (ppout params) - (ppout decl-params) (ppout exec-params)) - (ppscm - `(define ,(string->symbol name) - (let ((~f #f)) - (lambda ,(gen-exec-arg-names exec-params) - (unless ~f - (set! ~f (fh-link-proc - ,name ,decl-return (list ,@decl-params)))) - (let ,(gen-exec-unwrappers exec-params) - ,(if exec-return - `(,exec-return (~f ,@(gen-exec-call-args = exec-params))) - `(~f ,@(gen-exec-call-args exec-params)))))))) - (sfscm "(export ~A)\n" name))) (define (cnvt-fctn name rdecl params) (let* ((decl-return (gen-decl-return rdecl)) (decl-params (gen-decl-params params)) diff --git a/examples/system/ffi-help-rt.scm = b/examples/system/ffi-help-rt.scm index 80f0382..9550ac7 100644 --- a/examples/system/ffi-help-rt.scm +++ b/examples/system/ffi-help-rt.scm @@ -194,7 +194,7 @@ (make-fht (quote type) unwrap #f #f (make-bs*-printer (quote type)))) (define (wrap val) ;; pointer returned from code - (make (bytestructure type val))) + (make (bytestructure desc (ffi:pointer-address val)))) (export make type? unwrap type wrap) ))) =20 @@ -353,7 +353,7 @@ (define (unwrap~pointer obj) (cond ((ffi:pointer? obj) obj) - ((string? obj) (string->pointer obj)) + ((string? obj) (ffi:string->pointer obj)) ((bytestructure? obj) (ffi:make-pointer (bytestructure-ref obj))) ((fh-object? obj) (unwrap~pointer (struct-ref obj 0))) (else (error "expecting pointer type"))))