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