# westes/flex

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/westes-flex).**

4,028 stars · 574 forks · C · NOASSERTION

## Links

- GitHub: https://github.com/westes/flex
- awesome-repositories: https://awesome-repositories.com/repository/westes-flex.md

## Topics

`c` `flex` `lexer` `lexer-generator`

## Description

Flex is a scanner generator and lexical analyzer generator that transforms regular expression definitions into software capable of converting input text into tokens. It primarily generates C and C++ source code for use in the development of compilers and interpreters.

The tool provides a specific generator for producing object-oriented scanner implementations as classes, allowing lexical analysis tools to integrate directly into C++ software projects. It also includes a cross-compilation toolchain to build scanner implementations for target platforms different from the host machine.

The project covers functional capabilities for input column tracking to support precise error reporting and backup file management to prevent naming collisions.

## Tags

### Programming Languages & Runtimes

- [Lexical Analyzer Generators](https://awesome-repositories.com/f/programming-languages-runtimes/lexical-analyzer-generators.md) — Acts as a scanner and lexical analyzer generator for C and C++ programs.
- [C Source Generators](https://awesome-repositories.com/f/programming-languages-runtimes/c-source-generators.md) — Generates C source code from formal grammar specifications for native compilation.
- [Compiler Front-End Development](https://awesome-repositories.com/f/programming-languages-runtimes/compiler-front-end-development.md) — Provides the fundamental scanning and tokenization capabilities needed for C and C++ compiler front-ends.
- [Lexical Analyzers](https://awesome-repositories.com/f/programming-languages-runtimes/source-code-compilers/lexical-analyzers.md) — Transforms raw character streams into structured tokens based on defined patterns. ([source](https://github.com/westes/flex/blob/master/configure.ac))
- [Scanner Class Generators](https://awesome-repositories.com/f/programming-languages-runtimes/c-source-generators/scanner-class-generators.md) — Produces object-oriented scanner implementations as classes for C++ software projects.
- [Cross-Platform Compilers](https://awesome-repositories.com/f/programming-languages-runtimes/cross-platform-compilers.md) — Includes a build process that targets multiple operating systems and processor architectures. ([source](https://github.com/westes/flex/blob/master/NEWS))
- [Scanner Class Implementations](https://awesome-repositories.com/f/programming-languages-runtimes/scanner-class-implementations.md) — Provides the ability to generate scanner implementations as C++ classes for object-oriented integration.

### Data & Databases

- [DFA-Based Scanning](https://awesome-repositories.com/f/data-databases/text-pattern-matching/dfa-based-scanning.md) — Uses Deterministic Finite Automata to convert regular expressions into high-performance scanners.

### Development Tools & Productivity

- [Scanner Generators](https://awesome-repositories.com/f/development-tools-productivity/scanner-generators.md) — Transforms regular expression definitions into fast lexical analyzers for compilers and interpreters.
- [Cross-Architecture Binary Compilation](https://awesome-repositories.com/f/development-tools-productivity/cross-architecture-binary-compilation.md) — Supports compiling scanner implementations for hardware architectures different from the host.
- [Cross-Compilation Toolchains](https://awesome-repositories.com/f/development-tools-productivity/cross-compilation-toolchains.md) — Ships a build environment capable of generating executable binaries for diverse target hardware.
- [Scanner Class Generation](https://awesome-repositories.com/f/development-tools-productivity/import-class-generators/class-generation-hooks/scanner-class-generation.md) — Generates scanner implementations as C++ classes for integration into object-oriented software. ([source](https://github.com/westes/flex/tree/master/examples))

### Software Engineering & Architecture

- [Lexer Class Integration](https://awesome-repositories.com/f/software-engineering-architecture/object-oriented-frameworks/lexer-class-integration.md) — Generates lexical analysis tools as classes to integrate seamlessly into object-oriented C++ projects.
- [Input Buffering](https://awesome-repositories.com/f/software-engineering-architecture/stream-based-text-processing/input-buffering.md) — Implements memory chunking to minimize system calls while processing input text streams.
- [Table-Driven State Machines](https://awesome-repositories.com/f/software-engineering-architecture/table-driven-state-machines.md) — Utilizes precomputed lookup tables to map current states and input characters to the next state.

### Part of an Awesome List

- [Windows Environments](https://awesome-repositories.com/f/awesome-lists/more/windows-environments.md) — Listed in the “Windows Environments” section of the Awesome C awesome list.
