From MAILER-DAEMON Tue Jul 12 17:12:34 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1bN4yo-0005Hm-1p
	for mharc-bug-bison@gnu.org; Tue, 12 Jul 2016 17:12:34 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:60082)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <victor.khomenko@newcastle.ac.uk>) id 1bN4ym-0005GG-Fh
	for bug-bison@gnu.org; Tue, 12 Jul 2016 17:12:33 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <victor.khomenko@newcastle.ac.uk>) id 1bN4yi-0004Lh-A0
	for bug-bison@gnu.org; Tue, 12 Jul 2016 17:12:31 -0400
Received: from cheviot12.ncl.ac.uk ([128.240.234.12]:46126)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <victor.khomenko@newcastle.ac.uk>) id 1bN4yh-0004Ka-Tp
	for bug-bison@gnu.org; Tue, 12 Jul 2016 17:12:28 -0400
Received: from exhubvm02.ncl.ac.uk ([128.240.234.9]
	helo=EXHUBVM02.campus.ncl.ac.uk)
	by cheviot12.ncl.ac.uk with esmtp (Exim 4.63)
	(envelope-from <victor.khomenko@newcastle.ac.uk>) id 1bN4yc-00068K-Cs
	for bug-bison@gnu.org; Tue, 12 Jul 2016 22:12:23 +0100
Received: from EUR03-DB5-obe.outbound.protection.outlook.com (94.245.120.87)
	by exhub.ncl.ac.uk (128.240.234.9) with Microsoft SMTP Server (TLS) id
	14.3.266.1; Tue, 12 Jul 2016 22:12:22 +0100
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=newcastle.onmicrosoft.com; s=selector1-newcastle-ac-uk;
	h=From:Date:Subject:Message-ID:Content-Type:MIME-Version;
	bh=grw8MF0jUdOVnc0euQFZhL3B8rVzD7EmuD6k29Cva/c=;
	b=pvcr0durSzOSyXPgLCS9/zgySh3ToTHm/jehOXK6bN5UjQDCykJcGlT+fSPWcP0YHeAMKrXODdVTf+iIoTXs/S/KDSXFH+8ssSXoaRJ9I8/reNdkUDWOvIlcyzD3ws+5oO/cKi8SkK8FTB8D34AG+oChpPAAco8UPITpD14fk4o=
Received: from DB5PR07MB1606.eurprd07.prod.outlook.com (10.166.12.145) by
	DB5PR07MB1607.eurprd07.prod.outlook.com (10.166.12.146) with Microsoft
	SMTP Server (TLS) id 15.1.534.14; Tue, 12 Jul 2016 21:12:21 +0000
Received: from DB5PR07MB1606.eurprd07.prod.outlook.com ([10.166.12.145]) by
	DB5PR07MB1606.eurprd07.prod.outlook.com ([10.166.12.145]) with mapi id
	15.01.0534.023; Tue, 12 Jul 2016 21:12:21 +0000
From: Victor Khomenko <victor.khomenko@newcastle.ac.uk>
To: "'bug-bison@gnu.org'" <bug-bison@gnu.org>
Subject: Enhancement request: enabling Variant in C parsers
Thread-Topic: Enhancement request: enabling Variant in C parsers
Thread-Index: AdHcgSK8o4bYFBHHSoat1yL1MuDH+Q==
Date: Tue, 12 Jul 2016 21:12:21 +0000
Message-ID: <DB5PR07MB160626C477F5DC044C17C45BA3300@DB5PR07MB1606.eurprd07.prod.outlook.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
authentication-results: spf=none (sender IP is )
	smtp.mailfrom=victor.khomenko@newcastle.ac.uk; 
x-originating-ip: [79.77.114.50]
x-ms-office365-filtering-correlation-id: 226ba580-abeb-40d7-a2a1-08d3aa9936da
x-microsoft-exchange-diagnostics: 1; DB5PR07MB1607;
	6:pdRg/CXo3Wj8TsawieQXi32koPISnjLGdboRPfPjA61+gf61J217A9g2dZ5DS+naIgcPSITWYUqo3bpymnlwpo0sD1HQbo/2wJxDL2khNfl0Txon84GLxY3o2fckXm/tQb5onJX1hz1QQDACt9yL0vdczIqc+AFE1C8leeSj/ljBOhzEgi+B2UL6GsuVJl9+QEA5pAdsy5/wLhYOu8ezYn+vYTWEJUU69Q1usV74k3EqHwq88o1otJhLW+eaatEK21VSc/CFqhSgsg5nd5x5Q57dX69VurMhXJf4YL9MEAY=;
	5:vloOeQvX6JxZ9YxWDhfRXxwv93odwYUJ7gXbnApjO/PwIEs7P7SMo+1cQAFOmEm8pFjsceMEJm2zoQvIHqauNgOxjEvy8SJeBzmwwLlsq9IvbVy3AI0YhX4kThG7V3X+PRiA3iCryVIxY2ezAqjvLw==;
	24:zbKs63SKBDSm6u2xO39eh6yLKXFB8w0ChCzVBx6tAlBuypoOh5bOczMJqH6QYGywYP3X1ksYuBZMEcDOcHngnLURYq3WYj8oE3HwJSm/Oio=;
	7:MxaRJFLsLB1EKKDXi1+CvbfvUpVd7WlEiOzzA7wGjd3n2PE+SqZTcwFKsNNDIaTFz7aFsAj92Nx2cZvxhEXoxB9Ni3euKEE4VqEtZW2o01v5wkD53hAPiz/Wd92VVY3omjN8/yj7MDnwSoAIwkE4L74Gg0sjLAAWMbcKmd03FWPnVy6xzvQ4WOXMrx2anxWIo+N1QiKYkM6azFnUd30TlsfHrgG1ti5zcaw1JTwFBP18jQTNooaEW/yvTxleOD7W
x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB5PR07MB1607;
x-microsoft-antispam-prvs: <DB5PR07MB160756CFB74752C58006AD06A3300@DB5PR07MB1607.eurprd07.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:;
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0;
	RULEID:(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001);
	SRVR:DB5PR07MB1607; BCL:0; PCL:0; RULEID:; SRVR:DB5PR07MB1607; 
x-forefront-prvs: 0001227049
x-forefront-antispam-report: SFV:NSPM;
	SFS:(10009020)(6009001)(7916002)(199003)(189002)(7736002)(10400500002)(305945005)(7846002)(105586002)(7696003)(5003600100003)(74316002)(229853001)(106356001)(11100500001)(86362001)(50986999)(54356999)(68736007)(101416001)(3280700002)(122556002)(76576001)(450100001)(33656002)(9686002)(5002640100001)(586003)(6116002)(102836003)(2906002)(3846002)(87936001)(92566002)(8936002)(189998001)(97736004)(110136002)(74482002)(8676002)(81156014)(107886002)(81166006)(77096005)(2900100001)(66066001)(3660700001)(491001);
	DIR:OUT; SFP:1101; SCL:1; SRVR:DB5PR07MB1607;
	H:DB5PR07MB1606.eurprd07.prod.outlook.com; FPR:; SPF:None;
	PTR:InfoNoRecords; A:1; MX:1; LANG:en; 
received-spf: None (protection.outlook.com: newcastle.ac.uk does not designate
	permitted sender hosts)
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Jul 2016 21:12:21.4836 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 9c5012c9-b616-44c2-a917-66814fbe3e87
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR07MB1607
X-OriginatorOrg: newcastle.ac.uk
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 128.240.234.12
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison/>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 12 Jul 2016 21:12:33 -0000

Dear developers,

It would be nice to enable Variant in C parsers - these obviously have to b=
e compiled with a C++ compiler.

Motivation:
 * I (and probably some other people) find some aspects of C++ parsers unwi=
eldy, so prefer the good old C parsers in my C++ programs.
 * Maintaining/refactoring existing C parsers using variants is straightfor=
ward, whereas rewriting them as C++ parsers requires much effort.

Apologies if this was discussed earlier - I didn't find anything relevant i=
n the mail archives though.

Thanks,
Victor.


From MAILER-DAEMON Thu Jul 14 20:33:48 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1bNr4e-000232-I7
	for mharc-bug-bison@gnu.org; Thu, 14 Jul 2016 20:33:48 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:35845)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <rich_wicks@yahoo.com>) id 1bNr4c-0001uK-6W
	for bug-bison@gnu.org; Thu, 14 Jul 2016 20:33:46 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <rich_wicks@yahoo.com>) id 1bNr4Y-0005ha-4t
	for bug-bison@gnu.org; Thu, 14 Jul 2016 20:33:45 -0400
Received: from nm40-vm0.bullet.mail.bf1.yahoo.com ([72.30.239.208]:40138)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <rich_wicks@yahoo.com>) id 1bNr4X-0005hU-Vd
	for bug-bison@gnu.org; Thu, 14 Jul 2016 20:33:42 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
	t=1468542821; bh=d7DF17pWUysntrgLZ7gfBSkS6TyouZYtG9pHI1cmtc0=;
	h=Date:From:Reply-To:To:Subject:References:From:Subject;
	b=CIzRNZhu5+186PkleacT3ik/GMwupxYFo6mOG79BJTCL4SKw2G+T9MAKYJXykwK9hkwrSnHpDauU9ewgqZri7St26Jlb3P/D8kqDmwoqVprah7zONkAQV9X/oj+YIL1ChLZP7EoDsGYswZYTTyutsk8izKkUop2a3DsWYTHiBgwwKlnrkvFoV1QnVANxKt9tXlvlGVqjeW9yiwnhF1JokyOgQSccl5UachaIjUGGhCJyrN2R3nMuIKQRFwFmYYYSBD4m30WTuQxKGfNIzmACvrrU1jHRVW/Ug8pGA4l5fV1raAJzRcrVK599w1WsokBnwIPZA5xVGKsylcL8t7W32g==
Received: from [66.196.81.174] by nm40.bullet.mail.bf1.yahoo.com with NNFMP;
	15 Jul 2016 00:33:41 -0000
Received: from [98.139.212.235] by tm20.bullet.mail.bf1.yahoo.com with NNFMP;
	15 Jul 2016 00:33:41 -0000
Received: from [127.0.0.1] by omp1044.mail.bf1.yahoo.com with NNFMP;
	15 Jul 2016 00:33:41 -0000
X-Yahoo-Newman-Property: ymail-5
X-Yahoo-Newman-Id: 208572.73670.bm@omp1044.mail.bf1.yahoo.com
X-YMail-OSG: 21ZqtuAVM1ls9Ptn0.vauBnya.h6GOoN6eBnkMU_JiWE3VgLTif5xscLUv78my6
	.b1VoXrcNYZTkfGZ1dvNCyMIhruGQ.Q3sQ0.imJItiyU0kXX.R4ByYc8jUDE0KSOkwJG8wb8LYqW
	5GgmY_UekQ.GWLqL.gjOChY8TVCogbwCGYbaXJHC6sM.Ym6dMpzkjekkfQxLasu7CvAUNjG99gza
	Itc_pOFmvlUfZLexPxqoQwgEiuuQ91aTrTPk3Dyyo9LFN8OXxlU3Rg56Wryc0xYpWq6w2agjMP4k
	OwkZxuBotSrEBjFKv8DzFkTKAU8iDG8tj04s5fJNIFCG0cJni3QHMX5GNNN.v9bCV1eeH1b.LRgY
	c7Fu.twQAPTDgS4rbkPQ8c4ev8gByCJdJ4eoMelskwqoKG0r.7QrhlQH2WXfZEpl.3hTo0hhmYGS
	V.HZAdVFeVvz2Cbu_ww5mEp.tOnQ7uC0vkMV5G14ShobfvrCdH.uK0TbtuCeggC77Ans4wYVE8qO
	23w7xhptEYThHNSphn1Q-
Received: from jws100138.mail.ne1.yahoo.com by
	sendmailws137.mail.ne1.yahoo.com;
	Fri, 15 Jul 2016 00:33:40 +0000; 1468542820.143
Date: Fri, 15 Jul 2016 00:33:39 +0000 (UTC)
From: Richard Wicks <rich_wicks@yahoo.com>
Reply-To: Richard Wicks <rich_wicks@yahoo.com>
To: "bug-bison@gnu.org" <bug-bison@gnu.org>
Message-ID: <185578136.4054269.1468542819873.JavaMail.yahoo@mail.yahoo.com>
Subject: yylval and strdup() on a 64 bit system - yylval should be a 64 bit
	number
MIME-Version: 1.0
References: <185578136.4054269.1468542819873.JavaMail.yahoo.ref@mail.yahoo.com>
Content-Length: 146
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
X-Received-From: 72.30.239.208
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Content-Filtered-By: Mailman/MimeDel 2.1.21
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison/>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 15 Jul 2016 00:33:47 -0000

Minor bug - yylval cannot contain a 64 bit pointer, however this doesn't actually effect most systems due to where the heap is located in memory.

From MAILER-DAEMON Thu Jul 14 21:47:33 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1bNsE1-0002GP-D2
	for mharc-bug-bison@gnu.org; Thu, 14 Jul 2016 21:47:33 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:45986)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <kaz@kylheku.com>) id 1bNsDz-0002GJ-Bm
	for bug-bison@gnu.org; Thu, 14 Jul 2016 21:47:32 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <kaz@kylheku.com>) id 1bNsDx-0001gk-5u
	for bug-bison@gnu.org; Thu, 14 Jul 2016 21:47:30 -0400
Received: from smtp-out-so.shaw.ca ([64.59.136.137]:48073)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <kaz@kylheku.com>)
	id 1bNsDs-0001ex-AP; Thu, 14 Jul 2016 21:47:24 -0400
Received: from kylheku.com ([24.85.175.81]) by shaw.ca with SMTP
	id NsDdbJHdz32mrNsDfbo4lN; Thu, 14 Jul 2016 19:47:13 -0600
X-Authority-Analysis: v=2.2 cv=ROzxJMq+ c=1 sm=1 tr=0
	a=WiYoHcCliNeVponEdG0Ckg==:117 a=WiYoHcCliNeVponEdG0Ckg==:17
	a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=cAmyUtKerLwA:10
	a=uZvujYp8AAAA:8 a=QZl8nKJjlbRiFjBLzBkA:9
	a=7Zwj6sZBwVKJAoWSPKxL6X1jA+E=:19
	a=e6EVyAWORa8A:10 a=SLzB8X_8jTLwj6mN0q5r:22
Received: from www-data by kylheku.com with local (Exim 4.72)
	(envelope-from <kaz@kylheku.com>)
	id 1bNsDb-0005Os-JX; Thu, 14 Jul 2016 18:47:07 -0700
To: Richard Wicks <rich_wicks@yahoo.com>
Subject: Re: yylval and strdup() on a 64 bit system - yylval should be a 64
	bit number
X-PHP-Originating-Script: 501:rcmail.php
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8;
 format=flowed
Content-Transfer-Encoding: quoted-printable
Date: Thu, 14 Jul 2016 18:47:07 -0700
From: Kaz Kylheku <kaz@kylheku.com>
Cc: bug-bison@gnu.org, bug-bison <bug-bison-bounces+kaz=kylheku.com@gnu.org>
In-Reply-To: <185578136.4054269.1468542819873.JavaMail.yahoo@mail.yahoo.com>
References: <185578136.4054269.1468542819873.JavaMail.yahoo.ref@mail.yahoo.com>
	<185578136.4054269.1468542819873.JavaMail.yahoo@mail.yahoo.com>
Message-ID: <bd7bff4a580014fb95778a52657e59e0@mail.kylheku.com>
X-Sender: kaz@kylheku.com
User-Agent: Roundcube Webmail/0.9.2
X-CMAE-Envelope: MS4wfEgqbvSKgyQd5U3BNyiE8++I07AxYxVBvcdjEfxtNdjOVY4J2kHQgPbh+9APTst5vKMJPJ2KQM71qZVK4p87w+iLJIC9GeD0OOquzYZrRqW7AL5FyCng
	cahSkAMV0EYOATv98T+ObO4EUA8sGfvLZzgavaPLBkpUP5KyqCw6it69hpvSk+KELajuzDxVhOA8AmtFq6Y0hKD9HskH3iOknFzlXWF213K/7q3trN/8llM0
	LuJKBwvR2LMdnDo8bXMB2A==
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
X-Received-From: 64.59.136.137
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison/>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 15 Jul 2016 01:47:32 -0000

On 14.07.2016 17:33, Richard Wicks wrote:
> Minor bug - yylval cannot contain a 64 bit pointer, however this
> doesn't actually effect most systems due to where the heap is located
> in memory.

Do you have a minimal test case for this bug, along with a
description of the expected and actual behavior?

The default type of yylval, in a traditional non-reentrant
Yacc-generated parser, is int.

Indeed, that cannot portably hold a pointer.

Nobody in their right mind expects it to; if yylval is to hold a=20
pointer,
its type should be configured accordingly.

If you want just one value type, but other than int, the classic
way is to define the preprocessor macro YYSTYPE.

   #define YYSTYPE char *

Now your yylval is not a number at all; it has char * type, which is a
64 bit pointer on a 64 bit system.

There is also the %union directive which makes YYSTYPE a union, and at=20
the
same informs Bison about the member names, which are used to implement
a kind of semantic typing scheme, as well as to provide a convnienent
syntactic sugar for accessing the semantic values without having to use
the union member selection syntax explicitly.

You use this if you want some of your parse nodes to be numbers and
others something else, like symbols or strings.

It's all in the Bison manual, not to mention various tutorials and books=20
on
Lex and Yacc, the manuals of other implementations, vast numbers
of open source examples of parsers, and not to mention the POSIX=20
standard
which describes the requirements for a yacc utility:

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/yacc.html




