Microsoft is writing a PHP parser that handles error recovery well, and the internals docs are really accessible.
It includes a discussion of handling trivia and even some sample parsing code.
Superb article on the history of parsers, what approaches are used in industry (mostly hand-written recursive descent!) and the expressiveness of parser combinators and PEG.