From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16449 invoked by alias); 16 Jan 2012 19:29:13 -0000 Received: (qmail 16339 invoked by uid 22791); 16 Jan 2012 19:29:11 -0000 X-SWARE-Spam-Status: No, hits=-7.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 16 Jan 2012 19:28:56 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q0GJSlkd028357 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 16 Jan 2012 14:28:55 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q0GI3Gv3011492; Mon, 16 Jan 2012 13:03:16 -0500 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id q0GI3EOF027998; Mon, 16 Jan 2012 13:03:14 -0500 From: Tom Tromey To: Sergio Durigan Junior Cc: gdb-patches@sourceware.org Subject: Re: [RFC 2/8] C language References: Date: Mon, 16 Jan 2012 19:29:00 -0000 In-Reply-To: (Sergio Durigan Junior's message of "Sun, 15 Jan 2012 16:58:57 -0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-01/txt/msg00567.txt.bz2 >>>>> "Sergio" == Sergio Durigan Junior writes: Sergio> Here and in all the .y files, I had to add an argument to the parser and Sergio> the lexer functions, which is a `struct parser_state *ps'. I think 'ps' is too short a name for something used all over the file. Sergio> +%parse-param {struct parser_state *ps} Sergio> +%lex-param {struct parser_state *ps} This means we would require bison. I don't really mind us requiring bison, but I think it is a bigger issue and would need a separate patch - and at least configury changes. Another approach would be to temporarily make a "local global" in the .y file, then set this local global in the entry point to the parser. This does not solve the whole problem, but it does make things somewhat more modular, as a first step. Sergio> - { write_exp_elt_opcode (BINOP_COMMA); } Sergio> + { write_exp_elt_opcode (ps, BINOP_COMMA); } All the mechanical changes are ok. Thanks for taking this on. Tom