All of lore.kernel.org
 help / color / mirror / Atom feed
* Parser
@ 2009-03-04  3:18 Kevin Lacquement
  2009-03-07 11:15 ` Parser Marco Gerards
  0 siblings, 1 reply; 6+ messages in thread
From: Kevin Lacquement @ 2009-03-04  3:18 UTC (permalink / raw)
  To: The development of GRUB 2

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

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?

-- 
Sic non confunctus, non reficiat.


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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Parser
  2009-03-04  3:18 Parser Kevin Lacquement
@ 2009-03-07 11:15 ` Marco Gerards
  2009-03-09 16:43   ` Parser Kevin Lacquement
  0 siblings, 1 reply; 6+ messages in thread
From: Marco Gerards @ 2009-03-07 11:15 UTC (permalink / raw)
  To: The development of GRUB 2

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.

--
Marco




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Parser
  2009-03-07 11:15 ` Parser Marco Gerards
@ 2009-03-09 16:43   ` Kevin Lacquement
  2009-03-09 18:09     ` Parser Felix Zielcke
  0 siblings, 1 reply; 6+ messages in thread
From: Kevin Lacquement @ 2009-03-09 16:43 UTC (permalink / raw)
  To: The development of GRUB 2

[-- 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 --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Parser
  2009-03-09 16:43   ` Parser Kevin Lacquement
@ 2009-03-09 18:09     ` Felix Zielcke
  2009-03-09 19:03       ` Parser Kevin Lacquement
  0 siblings, 1 reply; 6+ messages in thread
From: Felix Zielcke @ 2009-03-09 18:09 UTC (permalink / raw)
  To: The development of GRUB 2

Am Montag, den 09.03.2009, 09:43 -0700 schrieb Kevin Lacquement:

> 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)
> 

gcc has -nostdinc to remove the standard search paths for the includes.

http://gcc.gnu.org/onlinedocs/gcc-4.3.3/gcc/Preprocessor-Options.html#Preprocessor-Options

-- 
Felix Zielcke




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Parser
  2009-03-09 18:09     ` Parser Felix Zielcke
@ 2009-03-09 19:03       ` Kevin Lacquement
  2009-03-09 20:55         ` Parser David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Kevin Lacquement @ 2009-03-09 19:03 UTC (permalink / raw)
  To: The development of GRUB 2

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

Felix Zielcke wrote:
> Am Montag, den 09.03.2009, 09:43 -0700 schrieb Kevin Lacquement:
> 
>> 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)
>>
> 
> gcc has -nostdinc to remove the standard search paths for the includes.
> 
> http://gcc.gnu.org/onlinedocs/gcc-4.3.3/gcc/Preprocessor-Options.html#Preprocessor-Options
> 

If we do that, though, we'll still need to create wrapper headers for
the headers that flex #includes.  Also, does grub depend on gcc, or will
it work with other C compilers?  I'd like to avoid adding a dependency
on a specific compiler if the dep doesn't already exist.

-- 
Sic non confunctus, non reficiat.


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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Parser
  2009-03-09 19:03       ` Parser Kevin Lacquement
@ 2009-03-09 20:55         ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2009-03-09 20:55 UTC (permalink / raw)
  To: grub-devel, kevin

From: Kevin Lacquement <kevin@lacqui.com>
Date: Mon, 09 Mar 2009 12:03:14 -0700

> If we do that, though, we'll still need to create wrapper headers
> for the headers that flex #includes.  Also, does grub depend on gcc,
> or will it work with other C compilers?  I'd like to avoid adding a
> dependency on a specific compiler if the dep doesn't already exist.

Such a dependency already exists, to be honest.

From GCC extensions such as type and function attributes to exporting
libgcc internal symbols, there is a hard dependency on GCC and I doubt
that's going away any time soon.



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-03-09 20:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-04  3:18 Parser Kevin Lacquement
2009-03-07 11:15 ` Parser Marco Gerards
2009-03-09 16:43   ` Parser Kevin Lacquement
2009-03-09 18:09     ` Parser Felix Zielcke
2009-03-09 19:03       ` Parser Kevin Lacquement
2009-03-09 20:55         ` Parser David Miller

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.