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
Date: Sat, 22 Oct 2005 17:37:19 +0200	[thread overview]
Message-ID: <435A5CAF.40103@gmail.com> (raw)
In-Reply-To: <87hdb9twr9.fsf@student.han.nl>

Hello

>
>  
>
>>In bash when you define a function it appears under environment
>>variables. IMHO it's useless to store completely the source code as an
>>environment variables. I propose that the functions will be preparsed
>>(converted to internal format ready for execution) because it will
>>gretelya simplify lexer and parser
>>    
>>
>
>Right.  We should discuss the internal format on the list, I think.
>
>  
>
>Right.  And this can be kept quite simple.  The commands itself are
>just a string of text.  The loops just check a variable, no?  It can
>be something like:
>
>for foo in 1 2 3
> do
>   echo $i
> done
>
>That can be translated into some kind of pseudo language:
>
>1: list = 1 2 3
>2: read i, list
>3: echo $i
>4: check list
>5: je 2
>
>I know it's stupid and kind of silly like this.  But we have to define
>a language.  It's important to discuss this on the list, IMO.
>
>  
>
I thought about (a):
1: command=forin variable=i list=1 2 3 end=NULL /* it will be 4 if 
script continues*/
2: echo $i
3: jump 1
Or (b):
1:splitpush 1 2 3
2:pop list
3:read i, list
4:push list
5:echo $i
6:pop list
7:check list
8:push list
9:je 2
10:pop list
The question is how many commands to make: a lot (like in a where nearly 
every internal command corresponds to a scripting command) or make so 
few commands as possible. I wonder which approach is better (it's 
question about bugs and readibility, of course, not about speed)


>Which mail are you talking about (subject and date)?  I must have
>missed a few the last months. :-(
>  
>
Re: [Patch] Scripting engine 25.09.2005
[Patch] Scripting engine 24.08.2005
It's just demonstration of some ideas. Now I think with new splitter it 
would be better to keep arglist unparsed. In this patch it was that if 
we have
echo 1 2 3\;\$ ab$i;
lexer returns (schematically)
STRING(echo) STRING(1) STRING(2) STRING (3;$) STRING(abVAR(i)) SEMICOLON
now I would do that it returns:
STRING(echo 1 2 3\;\$ ab$i) SEMICOLON


                                                                         
                                          Vladimir 'phcoder' Serbinenko



  reply	other threads:[~2005-10-22 15:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-22 13:59 Scripting support Marco Gerards
2005-10-22 14:46 ` Vladimir Serbinenko
2005-10-22 15:08   ` Marco Gerards
2005-10-22 15:37     ` Vladimir Serbinenko [this message]
2005-10-22 15:47       ` Marco Gerards
2005-10-22 16:03         ` Vladimir Serbinenko
2005-10-22 16:42           ` Marco Gerards
2005-10-22 16:33         ` Marco Gerards
2005-10-28  3:04   ` Yoshinori K. Okuji

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=435A5CAF.40103@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.