Grub Development Archive on 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: [Patch] Scripting engine
Date: Sun, 04 Sep 2005 15:23:01 +0200	[thread overview]
Message-ID: <431AF535.5040405@gmail.com> (raw)
In-Reply-To: <871x49ud1d.fsf@student.han.nl>

Marco Gerards wrote:

>
>Can't this be done in the same bison parser?  Or what do you mean?
>  
>
I don't think so. Even the tokenization is very differetn. Ex:
2+3*5 is one token for normal parsing, but five for arithmethic
and yylex knows nothing about what parsing is now. If it would always
issue 5 tokens it would be impossible to difference
2+3*5 and 2 + 3 * 5 And yylex normally must not issue the space -
it would make bison parser too complicated

>I noticed that you have hand written yylex, wouldn't it be a lot
>easier to use flex for this?  In that case you can easily detect
>tokens using regular expressions.  This makes maintaining the
>tokenizer really easy.
>  
>
For bash regular expression is not really needed. There are only 3 types
of tokens:
reserved words (if, ...), normal words (WORD) and command separators (;
and ENTER).
All token except WORD could be easily recognized by simple comparing
(check_for_keyword function). But WORD needs special treatment because
its value
is partially unknown that's why I use superchar structure (it keeps
known parts as well as
necessary information to determine the value of unknown parts)
                                 
                                                                        
                              Vladimir




      reply	other threads:[~2005-09-04 13:28 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-14  9:18 [DISCUSSION] Scripts and menus Vladimir Serbinenko
2005-08-14 13:29 ` Douglas Wade Needham
2005-08-14 13:53   ` Vladimir Serbinenko
2005-08-14 15:12   ` Yoshinori K. Okuji
2005-08-14 22:54     ` Douglas Wade Needham
2005-08-14 23:09       ` Yoshinori K. Okuji
2005-08-15  7:27       ` [DISCUSSION] Grub2 Improvements marm.mm
2005-08-15  8:37         ` Yoshinori K. Okuji
2005-08-14 14:35 ` [DISCUSSION] Scripts and menus Yoshinori K. Okuji
2005-08-14 16:03   ` Vladimir Serbinenko
2005-08-14 18:01     ` Yoshinori K. Okuji
2005-08-14 18:30       ` Vladimir Serbinenko
2005-08-15 17:37         ` Marco Gerards
2005-08-24  9:36           ` [Patch] Scripting engine Vladimir Serbinenko
2005-08-28 12:55             ` Yoshinori K. Okuji
2005-08-28 14:11               ` Vladimir Serbinenko
2005-09-25 11:40               ` Vladimir Serbinenko
2005-08-31 19:22             ` Marco Gerards
2005-09-04 13:23               ` Vladimir Serbinenko [this message]

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=431AF535.5040405@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox