Installing Flex-2.5.4a

Estimated build time:           0.05 SBU
Estimated required disk space:  3 MB

Installation of Flex

Install Flex by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Some programs don't know about flex and try to find the lex program (flex is a (better) alternative for lex). So to please those few programs out there we'll create a bash script called lex that calls flex and have it emulate lex.

Create a new file /usr/bin/lex by running the following:

cat > /usr/bin/lex << "EOF"
#!/bin/sh
# Begin /usr/bin/lex

exec /usr/bin/flex -l "$@"

# End /usr/bin/lex
EOF
chmod 755 /usr/bin/lex

Contents of Flex

Last checked against version 2.5.4a.

Program Files

flex, flex++ (link to flex) and lex

Descriptions

flex

flex is a tool for generating programs which recognize patterns in text. Pattern recognition is very useful in many applications. A user sets up rules about what to look for and flex will make a program that looks for those patterns. The reason people use flex is that it is much easier to set up rules for what to look for than to write the actual program which finds the text.

flex++

flex++ invokes a version of flex which is used exclusively for C++ scanners.

lex

We create a bash script called lex which calls flex using the -l option. This is for compatibility purposes for programs which use lex instead of flex.

Descriptions

libfl

libfl is the flex library.

Flex Installation Dependencies

Last checked against version 2.5.4a.

Bash: sh
Binutils: ar, as, ld, ranlib
Bison: bison
Diffutils: cmp
Fileutils: chmod, cp, install, ln, mv, rm, touch
Gcc: cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Sed: sed
Sh-utils: echo, hostname
Textutils: cat, tr