Any time there exists a static document (e.g., a file), or a dynamic document (e.g., a stream occuring over time), and that document has any kind of structure, you will find yourself needing some kind of parser. For simple enough structures, you can get by with ad hoc parsing (string hacking, regexes, etc.). For structures which do not nest, you can get by with a finite state machine; here a lexer generator is often helpful. For complex structures, you pretty much an organized parser. You can write parsers by hand if you are familiar with recursive descent style parsing. For really complex structures, a parser generator is almost always a big win.
If you want to process a computer langauge, you pretty much need lexers and parsers as a starting place. They aren't enough; you have to do something with the parser result.
A really spectacular usage of lexing and parsing that we did is to translate JOVIAL,
a 1960s language, into C, for the B-2 stealth bomber.
See http://www.semdesigns.com/Products/Services/NorthropGrummanB2.html