From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Matt Wette Newsgroups: gmane.lisp.guile.user Subject: Re: Bytestructures: a "type system" for bytevectors Date: Mon, 20 Jun 2016 16:47:29 -0700 Message-ID: <23A3AD54-4CFC-42BA-8617-A2F6A587D278@gmail.com> References: <87r3mkg2iy.fsf@T420.taylan> <87y460gfhd.fsf@pobox.com> <87k2hjseh4.fsf@T420.taylan> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1466466554 11467 80.91.229.3 (20 Jun 2016 23:49:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 20 Jun 2016 23:49:14 +0000 (UTC) Cc: Andy Wingo , guile-user@gnu.org To: =?utf-8?Q?Taylan_Ulrich_Bay=C4=B1rl=C4=B1/Kammer?= Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Jun 21 01:49:09 2016 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bF8wG-0002q6-Oz for guile-user@m.gmane.org; Tue, 21 Jun 2016 01:49:08 +0200 Original-Received: from localhost ([::1]:47135 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bF8wF-0008WJ-Or for guile-user@m.gmane.org; Mon, 20 Jun 2016 19:49:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39445) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bF8uo-0006nI-FJ for guile-user@gnu.org; Mon, 20 Jun 2016 19:47:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bF8uj-0003h8-IK for guile-user@gnu.org; Mon, 20 Jun 2016 19:47:37 -0400 Original-Received: from mail-pa0-x22d.google.com ([2607:f8b0:400e:c03::22d]:33200) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bF8uj-0003h4-73 for guile-user@gnu.org; Mon, 20 Jun 2016 19:47:33 -0400 Original-Received: by mail-pa0-x22d.google.com with SMTP id b13so55248567pat.0 for ; Mon, 20 Jun 2016 16:47:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc:message-id:references :to; bh=oS1ECATMROlJsAAxjxLfXUF5fE5+j+Hzqckcl59sK/k=; b=p7Q5WYNMupqZpscD6HPdZhmgOdkl6ODW6MZhrRbSSeBkrsXup1lXjUEO8nRjlbIZWW 15dhMwZRKK/IgVluLwAsjoFg9JodIY1ZcX3Dc4sMuTYB3w9Rsu7n/8SGAZ1OGdjD4jYG rtlH+CUfuGgbnyu6UPYgy79/K3pSMipyiPGvU4Jbmz31Sb3CKPomHvN7Me6tO/nJcL/s no4jBS3fgu1po0vMREQULuVIHKr5mp+YkqSgkAl7ETZ7bmq6XJxbzWed+KzdCkyMo41S tyTbAxVbui6ImSJ1uwhcNIsputaQjDgJRHgi+JTaHkqIXP/s/ADPRvXyJYSB9khE0HIS 6TQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=oS1ECATMROlJsAAxjxLfXUF5fE5+j+Hzqckcl59sK/k=; b=Z4D5vdE8q9RpEEZXZlcFCn2k5bEr131r7JWcLvrc3BUWFPJfRKf84qzkAeI8u/ssSg pXWIL1E0z1uSsOGLvIWeoqF7x5m4Pabltb/k78UnPk+WWZxFwHJW6FTjgdeR4JpUcK/M crdkoPjtT5msnyhT0KEA1YxvCXaw6H+5vx46EuVJdkPBN2J32WUGo1JJYWTc6Pg6s1G0 j4w/omeeSE8+azlw2eQcsgvuRwTrXs40IWUhHybE1JNegb/MrAcHeKf6fUDl6ivpXxNO 9w1HQKkZPWYDiiQ6k7W5AWsnSf9Nw9l9tANuod025GJmlrVqhorUtxhjncjqI4YUYbRW Idsw== X-Gm-Message-State: ALyK8tIFRbMIERcVKDui2UGs3YfKvJCUeuAx/ATz7oBrYDRLyd8tuVF/3NVgwM7cvnHg4w== X-Received: by 10.66.167.103 with SMTP id zn7mr24363953pab.149.1466466452095; Mon, 20 Jun 2016 16:47:32 -0700 (PDT) Original-Received: from nautilus.championbroadband.com (216-165-228-109.championbroadband.com. [216.165.228.109]) by smtp.gmail.com with ESMTPSA id n17sm42654393pfb.38.2016.06.20.16.47.30 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 20 Jun 2016 16:47:31 -0700 (PDT) In-Reply-To: <87k2hjseh4.fsf@T420.taylan> X-Mailer: Apple Mail (2.2104) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c03::22d X-Content-Filtered-By: Mailman/MimeDel 2.1.21 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:12670 Archived-At: > On Jun 20, 2016, at 3:05 PM, Taylan Ulrich Bay=C4=B1rl=C4=B1/Kammer = wrote: > [SNIP] > Would I have to write a C parser in Scheme, or can we cheat somehow? scheme@(guile-user)> (use-modules (nyacc lang c99 parser)) scheme@(guile-user)> (use-modules (ice-9 pretty-print)) scheme@(guile-user)> (pretty-print (with-input-from-string "int = printf(char *fmt, ...);" parse-c99)) (trans-unit (decl (decl-spec-list (type-spec (fixed-type "int"))) (init-declr-list (init-declr (ftn-declr (ident "printf") (param-list (param-decl (decl-spec-list (type-spec (fixed-type "char"))) (param-declr (ptr-declr (pointer) (ident "fmt")))) (ellipis))))))) nyacc is an all-guile implementation of yacc and comes with a c99 = parser, available from www.nongnu.org. =20 The parser outputs parse trees in sxml format. It is beta-level code. Matt