All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Serbinenko <phcoder@gmail.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: Scripting support (PATCH)
Date: Sun, 30 Oct 2005 15:41:03 +0100	[thread overview]
Message-ID: <4364DB7F.1060309@gmail.com> (raw)
In-Reply-To: <87u0f0t30k.fsf@student.han.nl>

After discussion with Marco on IRC we decided that his code is better 
for the core features and other things are fast to implement.
But the next questions are menu entries. I propose the following syntax:
menu [arguments] name
{
    Commands
}

arguments can be --default, --fallback perhaps some more in the future.

But the main question is about realization. We need to store the source 
code to be able to edit it. Marco and me propose the following solution:
lexer keeps the buffer of current parsed script/block and it stores 
begin and end of tokens in this buffer in yylloc's new fields: buf_beg 
and buf_end. Then when parser founds a menu entry it copies a part of 
buffer using position of command. E.g (schematically):

"menu" string '{' commands '}'
{
    char was = buf[@4.buf_end];
    buf[@4.buf_end] = 0;
    create_menu_command ($2, grub_strdup (&buf[@4.buf_beg]));
}

And menu is always stored unparsed and parsed only just before 
execution. Than editing is no problem.

Other solution proposed by Marco was to rerun the script file or part of 
it.

We would like to know what other people think about it

                                                                         
         Vladimir 'phcoder' Serbinenko





  parent reply	other threads:[~2005-10-30 14:41 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-29 21:41 Scripting support (PATCH) Marco Gerards
2005-10-30  5:25 ` Yoshinori K. Okuji
2005-10-30  9:45   ` Marco Gerards
2005-10-30 11:55     ` Yoshinori K. Okuji
2005-10-30 12:17       ` Marco Gerards
2005-10-30 10:14   ` Marco Gerards
2005-10-30 14:41 ` Vladimir Serbinenko [this message]
2005-10-30 16:05   ` Marco Gerards
2005-10-30 16:46     ` Vladimir Serbinenko
2005-10-30 16:59       ` Marco Gerards
2005-10-30 17:15         ` Vladimir Serbinenko
2005-10-30 18:17           ` Marco Gerards
2005-10-31  6:39   ` Yoshinori K. Okuji
2005-10-30 20:49 ` Hollis Blanchard
2005-10-30 21:04   ` Marco Gerards
2005-10-31  6:45     ` Yoshinori K. Okuji
2005-10-31 18:58       ` Marco Gerards
2005-11-01 19:06         ` Marco Gerards
2005-11-01 19:55           ` Yoshinori K. Okuji
2005-11-03 21:58 ` Marco Gerards
2005-11-06 22:26   ` Marco Gerards
2005-11-08  3:38     ` Hollis Blanchard
2005-11-08 18:24       ` Marco Gerards
2005-11-09  6:14         ` Hollis Blanchard
     [not found] <200511010611.jA16B6Bq030884@dell01.dinaserver.com>
2005-11-02  9:37 ` adrian15
2005-11-06 22:13   ` Marco Gerards

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4364DB7F.1060309@gmail.com \
    --to=phcoder@gmail.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.