The Fast Lexical Analyzer - scanner generator for lexing in C and C++
Explorer09 and westes scanner: Include-guard flexint_shared.h
This prevents compiler's "redefinition of typedef" warnings or errors
when we could include flexint_shared.h twice, when building flex's own
scanner (scan.c) or in the "multiple_scanners" test in the testsuite.

(Depending on the compiler's flags this might or might not produce
errors, but it's good to guard it anyway.)

Fixes: #329

Signed-off-by: Kang-Che Sung <>
Latest commit 98018e3 Mar 19, 2018
Failed to load latest commit information.
.travis travis: '--disable-acl' when building gettext Mar 1, 2018
doc doc: amend manual section on state stack functions. Mar 13, 2018
examples Replaced FLEX_STD macro with std::. Dec 5, 2015
lib build: do not generate lib/ May 3, 2017
m4 build: support cross compiling. Feb 23, 2017
po doc: new uk translation Jun 18, 2017
src scanner: Include-guard flexint_shared.h May 22, 2018
tests build: Fix makefile dist-hook directory permissions. Mar 12, 2018
tools Add tools/ directory. Feb 16, 2014
.gitignore Move to src subdirectory. Aug 26, 2017 .cvsignore and got missed in the import to sourceforge; r… May 12, 2004
.mailmap build: .mailmap for cleaning up shortlog May 13, 2017
.prev-version build: 2.6.4 is previous version May 7, 2017
.travis.yml initial .travis.yml file Jan 3, 2018
AUTHORS rearrange and update AUTHORS Apr 3, 2007 flex is for flex #NCoC Jan 23, 2016
COPYING update copyright notice Apr 3, 2007 po: include update_linguas script in distribution. May 7, 2018
NEWS doc: list travis in NEWS [skip ci] Jan 3, 2018
ONEWS move old NEWS items to ONEWS May 18, 2001 doc: display build status badge in README May 7, 2018
THANKS copy in manual author and thanks info Jul 25, 2001 build: only touch ChangeLog if it does not exist May 2, 2017 build: Move dnl comments out of AC_CHECK_FUNCS Mar 1, 2018 initial default control file for shipper Mar 26, 2014

Build Status

This is flex, the fast lexical analyzer generator.

flex is a tool for generating scanners: programs which recognize lexical patterns in text.

The flex codebase is kept in Git on GitHub.

Use GitHub's issues and pull request features to file bugs and submit patches.

There are several mailing lists available as well:

Find information on subscribing to the mailing lists or search in the archive at: Note: Posting is only allowed from addresses that are subscribed to the lists.

The flex distribution contains the following files which may be of interest:

  • README - This file.
  • NEWS - current version number and list of user-visible changes.
  • INSTALL - basic installation information.
  • ABOUT-NLS - description of internationalization support in flex.
  • COPYING - flex's copyright and license.
  • doc/ - user documentation.
  • examples/ - containing examples of some possible flex scanners and a few other things. See the file examples/README for more details.
  • tests/ - regression tests. See TESTS/README for details.
  • po/ - internationalization support files.

You need the following tools to build flex from the maintainer's repository:

  • compiler suite - flex is built with gcc
  • bash, or a good Bourne-style shell
  • m4 - m4 -P needs to work; GNU m4 and a few others are suitable
  • GNU bison; to generate parse.c from parse.y
  • autoconf; for handling the build system
  • automake; for Makefile generation
  • gettext; for i18n support
  • help2man; to generate the flex man page
  • tar, gzip, lzip, etc.; for packaging of the source distribution
  • GNU texinfo; to build and test the flex manual. Note that if you want to build the dvi/ps/pdf versions of the documentation you will need texi2dvi and related programs, along with a sufficiently powerful implementation of TeX to process them. See your operating system documentation for how to achieve this. The printable versions of the manual are not built unless specifically requested, but the targets are included by automake.
  • GNU indent; for indenting the flex source the way we want it done

In cases where the versions of the above tools matter, the file will specify the minimum required versions.

Once you have all the necessary tools installed, life becomes simple. To prepare the flex tree for building, run the script:


in the top level of the flex source tree.

This script calls the various tools needed to get flex ready for the GNU-style configure script to be able to work.

From this point on, building flex follows the usual routine:

configure && make && make install

This file is part of flex.

This code is derived from software contributed to Berkeley by Vern Paxson.

The United States Government has rights in this work pursuant to contract no. DE-AC03-76SF00098 between the United States Department of Energy and the University of California.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.