Marco Gerards wrote: > Kevin Lacquement <ke...@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.
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel