From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1EWGWw-0000fb-5C for mharc-grub-devel@gnu.org; Sun, 30 Oct 2005 11:59:38 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EWGWv-0000fO-AE for grub-devel@gnu.org; Sun, 30 Oct 2005 11:59:37 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EWGWu-0000fB-OV for grub-devel@gnu.org; Sun, 30 Oct 2005 11:59:37 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EWGWu-0000f8-Kv for grub-devel@gnu.org; Sun, 30 Oct 2005 11:59:36 -0500 Received: from [145.74.66.11] (helo=mail-cn.han.nl) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EWGWu-0001TC-Mk for grub-devel@gnu.org; Sun, 30 Oct 2005 11:59:37 -0500 Received: from vscan-cn.han.nl (venus.han.nl [145.74.65.6]) by mail-cn.han.nl (Postfix) with ESMTP id 27E6E845C; Sun, 30 Oct 2005 17:59:35 +0100 (CET) Received: from mail-cn.han.nl ([145.74.66.11]) by vscan-cn.han.nl (venus.han.nl [145.74.65.6]) (amavisd-new, port 10024) with ESMTP id 17480-06; Sun, 30 Oct 2005 17:59:34 +0100 (CET) Received: from mail1.han.nl (mail1.han.nl [145.74.103.11]) by mail-cn.han.nl (Postfix) with ESMTP id 6CE708418; Sun, 30 Oct 2005 17:59:34 +0100 (CET) Received: from localhost.localdomain (mgerards.xs4all.nl [82.92.27.129]) by mail1.han.nl (Postfix) with ESMTP id 123F9C046; Sun, 30 Oct 2005 17:59:34 +0100 (CET) Mail-Copies-To: metgerards@student.han.nl To: Vladimir Serbinenko References: <87u0f0t30k.fsf@student.han.nl> <4364DB7F.1060309@gmail.com> <87vezfgfde.fsf@student.han.nl> <4364F8F9.9080407@gmail.com> From: Marco Gerards Date: Sun, 30 Oct 2005 17:59:34 +0100 In-Reply-To: <4364F8F9.9080407@gmail.com> (Vladimir Serbinenko's message of "Sun, 30 Oct 2005 17:46:49 +0100") Message-ID: <87d5lngcuh.fsf@student.han.nl> User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new (2.2.0) at vscan-cn.han.nl Cc: The development of GRUB 2 Subject: Re: Scripting support (PATCH) X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2005 16:59:37 -0000 Vladimir Serbinenko writes: >>I think you have to parse it immediately and both store parsed and the >>unparsed code. After editing you do the same again. >> > I see 2 approaches: > 1) Parse menu commands right before executing > 2) Parse them directly and reparse after editing. > I think 1st one is cleaner because the parser will be at the same > place after editing or before Same for #2. And #2 matches the rest of the code. Otherwise you are parsing the code twice. One when reading it and once when executing it. The code is already parsed by bison. If you ignore the result of this parsing you are causing a memory leak and wasting processor time. It is done already so why not use it? :) So the problem with approach #1 is doing double work, less obvious integration with the rest of the parser and memory leakage. >>This solution is required if you want to be able to edit the complete >>script instead of just the separate menu entries. I think this is not >>interesting, but if someone wants to know I can say more about this. >> >> > I think also. Because theese modifications are lost after boot they > are generally modified only to boot one time an OS with specifical > parameters and you don't need scripts for this. Right. The only reason I see for editing the script in general is to edit some menu generation routine. But that is a very rare case I think. If it turns out not to be a rare case, we can provide this feature later on. -- Marco