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: nyacc 0.73.0 released Date: Sat, 31 Dec 2016 15:15:47 +0100 Organization: AvatarAcademy.nl Message-ID: <87r34ob2wc.fsf@gnu.org> References: <87d1gfcfnm.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1483193796 17421 195.159.176.226 (31 Dec 2016 14:16:36 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 31 Dec 2016 14:16:36 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: guile-user@gnu.org To: Matt Wette Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Dec 31 15:16:32 2016 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 1cNKST-0003JQ-9D for guile-user@m.gmane.org; Sat, 31 Dec 2016 15:16:29 +0100 Original-Received: from localhost ([::1]:44282 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cNKSU-0008Rr-JC for guile-user@m.gmane.org; Sat, 31 Dec 2016 09:16:30 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49164) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cNKS7-0008Rm-Oo for guile-user@gnu.org; Sat, 31 Dec 2016 09:16:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cNKS4-0003du-Jh for guile-user@gnu.org; Sat, 31 Dec 2016 09:16:07 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:46654) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cNKRr-0003Xn-K9; Sat, 31 Dec 2016 09:15:51 -0500 Original-Received: from peder.onsbrabantnet.nl ([88.159.206.46]:49552 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 1cNKRq-0002VJ-V7; Sat, 31 Dec 2016 09:15:51 -0500 X-Url: http://AvatarAcademy.nl In-Reply-To: (Matt Wette's message of "Mon, 26 Dec 2016 06:53:32 -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:13067 Archived-At: Matt Wette writes: > I believe C99 parser is complete. There may be errors, but I think > all the elements are there. Great! As it turns out, I was using some GNU extensions (anonymous unions inside structs. I have now picked-up my work on Mes's simple C compiler backend, using Nyacc. I have already replaced my LALR parser with Nyacc's AST[0]. How far is the Nyacc's C99 preprocessor? I have two problems with it. It would be very helpful if it would disregard anything inside a false conditional directive. It seems I cannot conditionally comment things out that Nyacc does not parse, like --8<---------------cut here---------------start------------->8--- #if __GNUC__ void _start () { puts ("Hello micro-mes!\n"); ///int r =3D main (0,0); int r; asm ( "push $0\n\t" "push $0\n\t" "call main\n\t" "movl %%eax,%0\n\t" : "=3Dr" (r) : //no inputs "" (&main) ); #endif // GNUC --8<---------------cut here---------------end--------------->8--- =3D=3D> micro-mes.c:199: parse failed at state 379, on input ":" or like GCC headers that Nyacc does not parse, like , which is a bit of a pain. Also, it seems like it doesn't like it if an #includ'ed file is meant to go inside a function, like (simplified example) --8<---------------cut here---------------start------------->8--- // main.i r =3D 3; --8<---------------cut here---------------end--------------->8--- --8<---------------cut here---------------start------------->8--- // main.c int main () { int r; #include "main.i" return r; }=20 --8<---------------cut here---------------end--------------->8--- =3D=3D> ./main.i:2: parse failed at state 43, on input "r" Greetings, Jan [0] https://gitlab.com/janneke/mes/tree/wip-mescc --=20 Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.nl= =20=20