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.