xref: /src/contrib/flex/README.md (revision 7e38239042df09edbbdc443ccb4825f9155c6bb7)
17e382390SJung-uk KimThis is flex, the fast lexical analyzer generator.
27e382390SJung-uk Kim
37e382390SJung-uk Kimflex is a tool for generating scanners: programs which recognize
47e382390SJung-uk Kimlexical patterns in text.
57e382390SJung-uk Kim
67e382390SJung-uk KimThe flex codebase is kept in
77e382390SJung-uk Kim[Git on GitHub.](https://github.com/westes/flex)
87e382390SJung-uk Kim
97e382390SJung-uk KimUse GitHub's [issues](https://github.com/westes/flex/issues) and
107e382390SJung-uk Kim[pull request](https://github.com/westes/flex) features to file bugs
117e382390SJung-uk Kimand submit patches.
127e382390SJung-uk Kim
137e382390SJung-uk KimThere are several mailing lists available as well:
147e382390SJung-uk Kim
157e382390SJung-uk Kim* flex-announce@lists.sourceforge.net - where posts will be made
167e382390SJung-uk Kim  announcing new releases of flex.
177e382390SJung-uk Kim* flex-help@lists.sourceforge.net - where you can post questions about
187e382390SJung-uk Kim  using flex
197e382390SJung-uk Kim* flex-devel@lists.sourceforge.net - where you can discuss development
207e382390SJung-uk Kim  of flex itself
217e382390SJung-uk Kim
227e382390SJung-uk KimFind information on subscribing to the mailing lists at:
237e382390SJung-uk Kim
247e382390SJung-uk Kimhttp://sourceforge.net/mail/?group_id=97492
257e382390SJung-uk Kim
267e382390SJung-uk KimThe flex distribution contains the following files which may be of
277e382390SJung-uk Kiminterest:
287e382390SJung-uk Kim
297e382390SJung-uk Kim* README - This file.
307e382390SJung-uk Kim* NEWS - current version number and list of user-visible changes.
317e382390SJung-uk Kim* INSTALL - basic installation information.
327e382390SJung-uk Kim* ABOUT-NLS - description of internationalization support in flex.
337e382390SJung-uk Kim* COPYING - flex's copyright and license.
347e382390SJung-uk Kim* doc/ - user documentation.
357e382390SJung-uk Kim* examples/ - containing examples of some possible flex scanners and a
367e382390SJung-uk Kim	      few other things. See the file examples/README for more
377e382390SJung-uk Kim              details.
387e382390SJung-uk Kim* tests/ - regression tests. See TESTS/README for details.
397e382390SJung-uk Kim* po/ - internationalization support files.
407e382390SJung-uk Kim
417e382390SJung-uk KimYou need the following tools to build flex from the maintainer's
427e382390SJung-uk Kimrepository:
437e382390SJung-uk Kim
447e382390SJung-uk Kim* compiler suite - flex is built with gcc
457e382390SJung-uk Kim* bash, or a good Bourne-style shell
467e382390SJung-uk Kim* m4 - m4 -p needs to work; GNU m4 and a few others are suitable
477e382390SJung-uk Kim* GNU bison;  to generate parse.c from parse.y
487e382390SJung-uk Kim* autoconf; for handling the build system
497e382390SJung-uk Kim* automake; for Makefile generation
507e382390SJung-uk Kim* gettext; for i18n support
517e382390SJung-uk Kim* help2man; to generate the flex man page
527e382390SJung-uk Kim* tar, gzip, lzip, etc.; for packaging of the source distribution
537e382390SJung-uk Kim* GNU texinfo; to build and test the flex manual. Note that if you want
547e382390SJung-uk Kim  to build the dvi/ps/pdf versions of the documentation you will need
557e382390SJung-uk Kim  texi2dvi and related programs, along with a sufficiently powerful
567e382390SJung-uk Kim  implementation of TeX to process them. See your operating system
577e382390SJung-uk Kim  documentation for how to achieve this. The printable versions of the
587e382390SJung-uk Kim  manual are not built unless specifically requested, but the targets
597e382390SJung-uk Kim  are included by automake.
607e382390SJung-uk Kim* GNU indent; for indenting the flex source the way we want it done
617e382390SJung-uk Kim
627e382390SJung-uk KimIn cases where the versions of the above tools matter, the file
637e382390SJung-uk Kimconfigure.ac will specify the minimum required versions.
647e382390SJung-uk Kim
657e382390SJung-uk KimOnce you have all the necessary tools installed, life becomes
667e382390SJung-uk Kimsimple. To prepare the flex tree for building, run the script:
677e382390SJung-uk Kim
687e382390SJung-uk Kim```bash
697e382390SJung-uk Kim./autogen.sh
707e382390SJung-uk Kim```
717e382390SJung-uk Kim
727e382390SJung-uk Kimin the top level of the flex source tree.
737e382390SJung-uk Kim
747e382390SJung-uk KimThis script calls the various tools needed to get flex ready for the
757e382390SJung-uk KimGNU-style configure script to be able to work.
767e382390SJung-uk Kim
777e382390SJung-uk KimFrom this point on, building flex follows the usual  routine:
787e382390SJung-uk Kim
797e382390SJung-uk Kim```bash
807e382390SJung-uk Kimconfigure && make && make install
817e382390SJung-uk Kim```
827e382390SJung-uk Kim
837e382390SJung-uk KimThis file is part of flex.
847e382390SJung-uk Kim
857e382390SJung-uk KimThis code is derived from software contributed to Berkeley by
867e382390SJung-uk KimVern Paxson.
877e382390SJung-uk Kim
887e382390SJung-uk KimThe United States Government has rights in this work pursuant
897e382390SJung-uk Kimto contract no. DE-AC03-76SF00098 between the United States
907e382390SJung-uk KimDepartment of Energy and the University of California.
917e382390SJung-uk Kim
927e382390SJung-uk KimRedistribution and use in source and binary forms, with or without
937e382390SJung-uk Kimmodification, are permitted provided that the following conditions
947e382390SJung-uk Kimare met:
957e382390SJung-uk Kim
967e382390SJung-uk Kim1. Redistributions of source code must retain the above copyright
977e382390SJung-uk Kim   notice, this list of conditions and the following disclaimer.
987e382390SJung-uk Kim2. Redistributions in binary form must reproduce the above copyright
997e382390SJung-uk Kim   notice, this list of conditions and the following disclaimer in the
1007e382390SJung-uk Kim   documentation and/or other materials provided with the distribution.
1017e382390SJung-uk Kim
1027e382390SJung-uk KimNeither the name of the University nor the names of its contributors
1037e382390SJung-uk Kimmay be used to endorse or promote products derived from this software
1047e382390SJung-uk Kimwithout specific prior written permission.
1057e382390SJung-uk Kim
1067e382390SJung-uk KimTHIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
1077e382390SJung-uk KimIMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
1087e382390SJung-uk KimWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1097e382390SJung-uk KimPURPOSE.
110