Programming Tools Guide
Chapter 12, lex

Running the lexical analyzer

Running the lexical analyzer

By default, the lexical analyzer takes input from the standard input. To have it take input from a file, use redirection; for example:

a.out < text.in

a.out is the executable lexical analyzer.

Output is sent to the standard output. You can redirect this as well:

a.out < text.in > text.out