All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Lacquement <kevin@lacqui.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: Parser
Date: Mon, 09 Mar 2009 09:43:10 -0700	[thread overview]
Message-ID: <49B5471E.4060007@lacqui.com> (raw)
In-Reply-To: <87zlfxd1no.fsf@xs4all.nl>

[-- Attachment #1: Type: text/plain, Size: 1283 bytes --]

Marco Gerards wrote:
> Kevin Lacquement <kevin@lacqui.com> writes:
> 
>> Again looking at the script parser, I notices that it uses a
>> Yacc-generated parser, but a hand-written tokenizer. Is there a reason
>> that it doesn't use Lex?  Is it due to external dependencies, and if so,
>> is there a way to recreate these deps (library or whatever) within the
>> constraints of the bootloader?
> 
> Right, and I really hate the handwritten parser.  It is easy to
> cleanly use bison.  Lex, OTOH, isn't easy and clean to use.  IIRC it
> depended on file IO, etc.  If you know a *clean* way to deal with
> this, I would favor it.  Making all kinds of dirty stubs is something
> I don't really like.
> 

I've looked at flex (including its source), and it looks like the
standard library #includes are hardcoded in.  I'm going to look into
some alternatives to allow the lexer to be created cleanly without
adding too much of a burden to other developers in the way of project deps.

Alternatively, is there a clean, portable way to make the C compiler
think that the grub headers are actually the system headers?  Or
possibly to replace the system header calls in the generated C code?
(Using sed or something similar)

-- 
Sic non confunctus, non reficiat.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]

  reply	other threads:[~2009-03-09 16:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-04  3:18 Parser Kevin Lacquement
2009-03-07 11:15 ` Parser Marco Gerards
2009-03-09 16:43   ` Kevin Lacquement [this message]
2009-03-09 18:09     ` Parser Felix Zielcke
2009-03-09 19:03       ` Parser Kevin Lacquement
2009-03-09 20:55         ` Parser David Miller

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=49B5471E.4060007@lacqui.com \
    --to=kevin@lacqui.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.