Definition

Lex (lexical analyzer generator)

Lex is a program designed to generate scanners, also known as tokenizers, which recognize lexical patterns in text. Lex is an acronym that stands for "lexical analyzer generator." It is intended primarily for Unix-based systems. The code for Lex was originally developed by Eric Schmidt and Mike Lesk.

Lex can perform simple transformations by itself but its main purpose is to facilitate lexical analysis, the processing of character sequences such as source code to produce symbol sequences called tokens for use as input to other programs such as parsers. Lex can be used with a parser generator to perform lexical analysis. It is easy, for example, to interface Lex and Yacc, an open source program that generates code for the parser in the C programming language.

Lex is proprietary but versions based on the original code are available as open source. These include a streamlined version called Flex, an acronym for "fast lexical analyzer generator," as well as components of OpenSolaris and Plan 9.

This was last updated in February 2007
Posted by: Margaret Rouse

Email Alerts

Register now to receive SearchEnterpriseLinux.com-related news, tips and more, delivered to your inbox.
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

More News and Tutorials

  • Getting a handle on UCS: Vendor lock-in, interoperability and implementation

    The shortfalls of UCS include the potential for vendor lock-in and interoperability issues. Learn more about these and what you need to know to deploy a UCS in your data center. Some implementation considerations include storage, hypervisors, and a contingency plan in case your vendor changes course.

  • Getting a handle on UCS: Advantages and costs

    Unified computing systems (UCS) hold the promise of simplicity for data center, but the technology and associated costs may not be appropriate for every application. Learn about the potential of UCS to help your data center, and what you should consider prior to implementation.

  • Linux update on IBM System p

    Most machines running Linux are x86 PCs. IBM's System p and Linux go well together, and Ken Milberg explains why and what's new. He gives five reasons to run Linux on System p, and shares some of the options for PowerVM, IBM's virtualization platform.

Do you have something to add to this definition? Let us know.

Send your comments to techterms@whatis.com

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: