answersLogoWhite

0

Lex is officially known as a "Lexical Analyser".

It's main job is to break up an input stream into more usable elements.

Or in, other words, to identify the "interesting bits" in a text file.

For example, if you are writing a compiler for the C Programming language, the symbols { } ( ) ; all have significance on their own. The letter a usually appears as part of a keyword or variable name, and is not interesting on it's own. Instead, we are interested in the whole word. Spaces and newlines are completely uninteresting, and we want to ignore them completely, unless they appear within quotes "like this"

All of these things are handled by the Lexical Analyser.

User Avatar

Wiki User

9y ago

What else can I help you with?