Hey. I was wondering if anyone here could help me with a little problem I'm having. I'm trying to create a "source-to-source" compiler, but I really can't figure it out. Everyone has told me to "Use Yacc/Lex
" (or various variants of them), but I really don't understand how they're useful. I have a basic understanding of what they do (scan a file looking for certain things defined in the language grammar, tokenize, etc), but not so much as to how this is actually useful, or even how to use it.
I've tried searching, reading, rereading, and I've got absolutely no where.

I'd really appreciate any help on understanding all this.

8 Years
Discussion Span
Last Post by Tirian

>Everyone has told me to "Use Yacc/Lex" (or various variants
>of them), but I really don't understand how they're useful.

Then you don't know enough about how compilers work or how they're implemented. In such a case it's a bad idea to use tools because even if you end up with a usable result, you probably still won't understand it. You should get your hands dirty and write a compiler (even a simple one) by hand at least once.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.