A common example from computer programming is the processing performed on source code before the next step of compilation.
Lexical preprocessors are the lowest-level of preprocessors as they only require lexical analysis, that is, they operate on the source text, prior to any parsing, by performing simple substitution of tokenized character sequences for other tokenized character sequences, according to user-defined rules.
For example: Other lexical preprocessors include the general-purpose m4, most commonly used in cross-platform build systems such as autoconf, and GEMA, an open source macro processor which operates on patterns of context.
Similarly, a number of programs written in OCaml customize the syntax of the language by the addition of new operators.
One of the unusual features of the Lisp family of languages is the possibility of using macros to create an internal DSL.
A preprocessor may be promoted as being general purpose, meaning that it is not aimed at a specific usage or programming language, and is intended to be used for a wide variety of text processing tasks.