[3f8be484] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[aa18ac0] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[3f8be484] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
| 7 |
|
---|
| 8 | <sect1 id="ch-system-flex" role="wrap">
|
---|
| 9 | <?dbhtml filename="flex.html"?>
|
---|
| 10 |
|
---|
| 11 | <title>Flex-&flex-version;</title>
|
---|
| 12 |
|
---|
| 13 | <indexterm zone="ch-system-flex">
|
---|
| 14 | <primary sortas="a-Flex">Flex</primary>
|
---|
| 15 | </indexterm>
|
---|
| 16 |
|
---|
| 17 | <sect2 role="package">
|
---|
| 18 | <title/>
|
---|
| 19 |
|
---|
| 20 | <para>The Flex package contains a utility for generating programs that
|
---|
| 21 | recognize patterns in text.</para>
|
---|
| 22 |
|
---|
| 23 | </sect2>
|
---|
| 24 |
|
---|
| 25 | <sect2 role="installation">
|
---|
| 26 | <title>Installation of Flex</title>
|
---|
| 27 |
|
---|
[4bb4b626] | 28 | <para os="a">Prepare Flex for compilation:</para>
|
---|
[3f8be484] | 29 |
|
---|
[4bb4b626] | 30 | <screen os="b"><userinput>./configure --prefix=/usr</userinput></screen>
|
---|
[3f8be484] | 31 |
|
---|
[4bb4b626] | 32 | <para os="c">Compile the package:</para>
|
---|
[3f8be484] | 33 |
|
---|
[4bb4b626] | 34 | <screen os="d"><userinput>make</userinput></screen>
|
---|
[3f8be484] | 35 |
|
---|
[4bb4b626] | 36 | <para os="e">To test the results, issue:
|
---|
[3f8be484] | 37 | <userinput>make check</userinput>.</para>
|
---|
| 38 |
|
---|
[4bb4b626] | 39 | <para os="f">Install the package:</para>
|
---|
[3f8be484] | 40 |
|
---|
[4bb4b626] | 41 | <screen os="g"><userinput>make install</userinput></screen>
|
---|
[3f8be484] | 42 |
|
---|
[4bb4b626] | 43 | <para os="h">There are some packages that expect to find the
|
---|
[3f8be484] | 44 | <filename class="libraryfile">lex</filename> library in <filename
|
---|
| 45 | class="directory">/usr/lib</filename>. Create a symlink to account for
|
---|
| 46 | this:</para>
|
---|
| 47 |
|
---|
[4bb4b626] | 48 | <screen os="i"><userinput>ln -sv libfl.a /usr/lib/libl.a</userinput></screen>
|
---|
[3f8be484] | 49 |
|
---|
[4bb4b626] | 50 | <para os="j">A few programs do not know about <command>flex</command> yet and
|
---|
[3f8be484] | 51 | try to run its predecessor, <command>lex</command>. To support those
|
---|
| 52 | programs, create a wrapper script named <filename>lex</filename> that
|
---|
| 53 | calls <filename>flex</filename> in <command>lex</command> emulation
|
---|
| 54 | mode:</para>
|
---|
| 55 |
|
---|
[4bb4b626] | 56 | <screen os="k"><userinput>cat > /usr/bin/lex << "EOF"
|
---|
[3f8be484] | 57 | <literal>#!/bin/sh
|
---|
| 58 | # Begin /usr/bin/lex
|
---|
| 59 |
|
---|
| 60 | exec /usr/bin/flex -l "$@"
|
---|
| 61 |
|
---|
| 62 | # End /usr/bin/lex</literal>
|
---|
| 63 | EOF
|
---|
[94e6142] | 64 | chmod -v 755 /usr/bin/lex</userinput></screen>
|
---|
[3f8be484] | 65 |
|
---|
| 66 | </sect2>
|
---|
| 67 |
|
---|
| 68 | <sect2 id="contents-flex" role="content">
|
---|
| 69 | <title>Contents of Flex</title>
|
---|
| 70 |
|
---|
| 71 | <segmentedlist>
|
---|
| 72 | <segtitle>Installed programs</segtitle>
|
---|
[f5e37b2] | 73 | <segtitle>Installed libraries</segtitle>
|
---|
[3f8be484] | 74 |
|
---|
| 75 | <seglistitem>
|
---|
| 76 | <seg>flex and lex</seg>
|
---|
[f5e37b2] | 77 | <seg>libfl.a and libfl_pic.a</seg>
|
---|
[3f8be484] | 78 | </seglistitem>
|
---|
| 79 | </segmentedlist>
|
---|
| 80 |
|
---|
| 81 | <variablelist>
|
---|
| 82 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 83 | <?dbfo list-presentation="list"?>
|
---|
| 84 | <?dbhtml list-presentation="table"?>
|
---|
| 85 |
|
---|
| 86 | <varlistentry id="flex">
|
---|
| 87 | <term><command>flex</command></term>
|
---|
| 88 | <listitem>
|
---|
| 89 | <para>A tool for generating programs that recognize patterns in text;
|
---|
| 90 | it allows for the versatility to specify the rules for pattern-finding,
|
---|
| 91 | eradicating the need to develop a specialized program</para>
|
---|
| 92 | <indexterm zone="ch-system-flex flex">
|
---|
| 93 | <primary sortas="b-flex">flex</primary>
|
---|
| 94 | </indexterm>
|
---|
| 95 | </listitem>
|
---|
| 96 | </varlistentry>
|
---|
| 97 |
|
---|
[2b220db9] | 98 | <varlistentry id="flexpp">
|
---|
| 99 | <term><command>flex++</command></term>
|
---|
| 100 | <listitem>
|
---|
| 101 | <para>Link to <command>flex</command> which makes it generate C++
|
---|
| 102 | scanner classes</para>
|
---|
| 103 | <indexterm zone="ch-system-flex flexpp">
|
---|
| 104 | <primary sortas="b-flex++">flex++</primary>
|
---|
| 105 | </indexterm>
|
---|
| 106 | </listitem>
|
---|
| 107 | </varlistentry>
|
---|
| 108 |
|
---|
[3f8be484] | 109 | <varlistentry id="lex">
|
---|
| 110 | <term><command>lex</command></term>
|
---|
| 111 | <listitem>
|
---|
| 112 | <para>A script that runs <command>flex</command> in
|
---|
| 113 | <command>lex</command> emulation mode</para>
|
---|
| 114 | <indexterm zone="ch-system-flex lex">
|
---|
| 115 | <primary sortas="b-lex">lex</primary>
|
---|
| 116 | </indexterm>
|
---|
| 117 | </listitem>
|
---|
| 118 | </varlistentry>
|
---|
| 119 |
|
---|
| 120 | <varlistentry id="libfl.a">
|
---|
| 121 | <term><filename class="libraryfile">libfl.a</filename></term>
|
---|
| 122 | <listitem>
|
---|
| 123 | <para>The <filename class="libraryfile">flex</filename> library</para>
|
---|
| 124 | <indexterm zone="ch-system-flex libfl.a">
|
---|
| 125 | <primary sortas="c-libfl.a">libfl.a</primary>
|
---|
| 126 | </indexterm>
|
---|
| 127 | </listitem>
|
---|
| 128 | </varlistentry>
|
---|
| 129 |
|
---|
[8053eec] | 130 | <varlistentry id="libfl_pic.a">
|
---|
| 131 | <term><filename class="libraryfile">libfl_pic.a</filename></term>
|
---|
| 132 | <listitem>
|
---|
| 133 | <para>The <filename class="libraryfile">flex</filename> library</para>
|
---|
| 134 | <indexterm zone="ch-system-flex libfl_pic.a">
|
---|
| 135 | <primary sortas="c-libfl.a">libfl_pic.a</primary>
|
---|
| 136 | </indexterm>
|
---|
| 137 | </listitem>
|
---|
| 138 | </varlistentry>
|
---|
| 139 |
|
---|
[3f8be484] | 140 | </variablelist>
|
---|
| 141 |
|
---|
| 142 | </sect2>
|
---|
| 143 |
|
---|
| 144 | </sect1>
|
---|