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.user Subject: Re: nyacc 0.73.0 released Date: Sat, 31 Dec 2016 16:04:24 -0800 Message-ID: <57B2C5AB-DDE6-4B0E-9D9F-A45C6B34ED51@gmail.com> References: <87d1gfcfnm.fsf@gnu.org> <87r34ob2wc.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1483229109 30564 195.159.176.226 (1 Jan 2017 00:05:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 1 Jan 2017 00:05:09 +0000 (UTC) Cc: guile-user@gnu.org To: Jan Nieuwenhuizen Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sun Jan 01 01:05:05 2017 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 1cNTe1-00067Y-Dv for guile-user@m.gmane.org; Sun, 01 Jan 2017 01:05:01 +0100 Original-Received: from localhost ([::1]:45703 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cNTdz-00025b-6l for guile-user@m.gmane.org; Sat, 31 Dec 2016 19:04:59 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34276) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cNTdb-00025W-3a for guile-user@gnu.org; Sat, 31 Dec 2016 19:04:36 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cNTda-0000D6-3k for guile-user@gnu.org; Sat, 31 Dec 2016 19:04:35 -0500 Original-Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]:33113) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cNTdV-00009s-EP; Sat, 31 Dec 2016 19:04:29 -0500 Original-Received: by mail-pf0-x243.google.com with SMTP id 127so13362891pfg.0; Sat, 31 Dec 2016 16:04:29 -0800 (PST) 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=nttMV6GAbNsbKPjEfO78YrdFWWLa2A/SMSIOdjEsndM=; b=U9QfYPGCRM87tmzT45MbAZqiXOpJidmtTgZm6BTii6YeKQDIWwTGoisBzgk3iYjwi6 FK8d2WNps7CI5lhuuBRJRxUQ/XJOsMokZAvcFbDml/sDrIaxLUeRbTDJiCa2sY84i1Cs nhX4klXavqIdgSMGN14EdPcEMeTlryb5mtB9X1reckBsmqmmtWVrHci2agaegIRlPa+T QNHuUiC/jaLooxIbSmRo9ll+OqpMHkHAASPRctCgbeYJT3Gk63IZnSM7z6zCHH7qvGl6 OVOapMp9LuDG7IYID5mWveC3UUJasgYUPbbQs1Tll0hhTDgvVT8s7WuwUa633AZRK99s gVCg== 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=nttMV6GAbNsbKPjEfO78YrdFWWLa2A/SMSIOdjEsndM=; b=bVFZ8KMQrwtZHZpIgu6wT4bE+heoyqz4e9c6QTDzvPMHeYwsE21tP8ZTU+TwbaMUyc n+rR6fUMa8zc2r1m18z1Zu/hm9l4J5+kY9sqm+n+vJOqz6PvInCrPXs/I31l1yRuWvpj DCR2GHFtbxBl+uGPUjrNh1mw99uM/mqI7FL56NSd4Z6Eo9MhokLmMzC7jGBHcFzPjOEY KHN1JhhGHi/8AchxprrqDcxGdGpjFn8I8bXojHZLJRyWc6IWwQPgtnARKNe6c4qEuZog 4zRQJbgDUFk24+TkWPs3eU9KsNAygCrp3+A1XA0DcVCDklJeAiHragisJ1RJM4jX6asH r6Dg== X-Gm-Message-State: AIkVDXLKQIckBhN+B4Fllh0crUdIa/j9JxyhHIO2vayNzDoxzhYuLbdQEhTsW5sauL8YoQ== X-Received: by 10.99.251.69 with SMTP id w5mr97941287pgj.124.1483229068483; Sat, 31 Dec 2016 16:04:28 -0800 (PST) Original-Received: from nautilus.championbroadband.com (216-165-246-244.championbroadband.com. [216.165.246.244]) by smtp.gmail.com with ESMTPSA id p68sm121985846pfd.11.2016.12.31.16.04.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 31 Dec 2016 16:04:27 -0800 (PST) In-Reply-To: <87r34ob2wc.fsf@gnu.org> X-Mailer: Apple Mail (2.3259) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c00::243 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:13070 Archived-At: > On Dec 31, 2016, at 6:15 AM, Jan Nieuwenhuizen = wrote: >=20 > Matt Wette writes: >=20 >> I believe C99 parser is complete. There may be errors, but I think >> all the elements are there. > Also, it seems like it doesn't like it if an #includ'ed file is meant = to > go inside a function, like (simplified example) >=20 > --8<---------------cut here---------------start------------->8--- > // main.i > r =3D 3; > --8<---------------cut here---------------end--------------->8--- >=20 > --8<---------------cut here---------------start------------->8--- > // main.c > int > main () > { > int r; > #include "main.i" > return r; > }=20 > --8<---------------cut here---------------end--------------->8--- >=20 >=20 > =3D=3D> ./main.i:2: parse failed at state 43, on input "r" Jan, So this is a bug. And I am not sure how to proceed yet. The parser was = designed to return a AST with code from includes under a subtree. This = allows a file to be processed with respect to code only in that file. = The way it works is to parse the included file as a new parse. That = only works at the top level. This breaks for files included inside = functions etc. =20 How are you processing the file? Do you want to be able to discriminate = between a file and the included files, and only if included files are at = the decl level (e.g., #include ) but code inside functions gets = included as is (i.e., the AST looks as if the code was in the parent = file)? This will take some sort of parser-lexer hook I think. I want to think = about a clean architecture for all the use cases. Matt