xref: /freebsd/contrib/flex/README.md (revision a466cc55373fc3cf86837f09da729535b57e69a1)
1This is flex, the fast lexical analyzer generator.
2
3flex is a tool for generating scanners: programs which recognize
4lexical patterns in text.
5
6The flex codebase is kept in
7[Git on GitHub.](https://github.com/westes/flex)
8
9Use GitHub's [issues](https://github.com/westes/flex/issues) and
10[pull request](https://github.com/westes/flex) features to file bugs
11and submit patches.
12
13There are several mailing lists available as well:
14
15* flex-announce@lists.sourceforge.net - where posts will be made
16  announcing new releases of flex.
17* flex-help@lists.sourceforge.net - where you can post questions about
18  using flex
19* flex-devel@lists.sourceforge.net - where you can discuss development
20  of flex itself
21
22Find information on subscribing to the mailing lists at:
23
24http://sourceforge.net/mail/?group_id=97492
25
26The flex distribution contains the following files which may be of
27interest:
28
29* README - This file.
30* NEWS - current version number and list of user-visible changes.
31* INSTALL - basic installation information.
32* ABOUT-NLS - description of internationalization support in flex.
33* COPYING - flex's copyright and license.
34* doc/ - user documentation.
35* examples/ - containing examples of some possible flex scanners and a
36	      few other things. See the file examples/README for more
37              details.
38* tests/ - regression tests. See TESTS/README for details.
39* po/ - internationalization support files.
40
41You need the following tools to build flex from the maintainer's
42repository:
43
44* compiler suite - flex is built with gcc
45* bash, or a good Bourne-style shell
46* m4 - m4 -p needs to work; GNU m4 and a few others are suitable
47* GNU bison;  to generate parse.c from parse.y
48* autoconf; for handling the build system
49* automake; for Makefile generation
50* gettext; for i18n support
51* help2man; to generate the flex man page
52* tar, gzip, lzip, etc.; for packaging of the source distribution
53* GNU texinfo; to build and test the flex manual. Note that if you want
54  to build the dvi/ps/pdf versions of the documentation you will need
55  texi2dvi and related programs, along with a sufficiently powerful
56  implementation of TeX to process them. See your operating system
57  documentation for how to achieve this. The printable versions of the
58  manual are not built unless specifically requested, but the targets
59  are included by automake.
60* GNU indent; for indenting the flex source the way we want it done
61
62In cases where the versions of the above tools matter, the file
63configure.ac will specify the minimum required versions.
64
65Once you have all the necessary tools installed, life becomes
66simple. To prepare the flex tree for building, run the script:
67
68```bash
69./autogen.sh
70```
71
72in the top level of the flex source tree.
73
74This script calls the various tools needed to get flex ready for the
75GNU-style configure script to be able to work.
76
77From this point on, building flex follows the usual  routine:
78
79```bash
80configure && make && make install
81```
82
83This file is part of flex.
84
85This code is derived from software contributed to Berkeley by
86Vern Paxson.
87
88The United States Government has rights in this work pursuant
89to contract no. DE-AC03-76SF00098 between the United States
90Department of Energy and the University of California.
91
92Redistribution and use in source and binary forms, with or without
93modification, are permitted provided that the following conditions
94are met:
95
961. Redistributions of source code must retain the above copyright
97   notice, this list of conditions and the following disclaimer.
982. Redistributions in binary form must reproduce the above copyright
99   notice, this list of conditions and the following disclaimer in the
100   documentation and/or other materials provided with the distribution.
101
102Neither the name of the University nor the names of its contributors
103may be used to endorse or promote products derived from this software
104without specific prior written permission.
105
106THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
107IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
108WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
109PURPOSE.
110