Custom input preprocessor

How do I write a custom input preprocessor?