[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 |
|
---|
[686839b] | 36 | <para os="e">To test the results, issue:</para>
|
---|
| 37 |
|
---|
| 38 | <screen os="e2"><userinput remap="test">make check</userinput></screen>
|
---|
[3f8be484] | 39 |
|
---|
[4bb4b626] | 40 | <para os="f">Install the package:</para>
|
---|
[3f8be484] | 41 |
|
---|
[4bb4b626] | 42 | <screen os="g"><userinput>make install</userinput></screen>
|
---|
[3f8be484] | 43 |
|
---|
[4bb4b626] | 44 | <para os="h">There are some packages that expect to find the
|
---|
[3f8be484] | 45 | <filename class="libraryfile">lex</filename> library in <filename
|
---|
| 46 | class="directory">/usr/lib</filename>. Create a symlink to account for
|
---|
| 47 | this:</para>
|
---|
| 48 |
|
---|
[4bb4b626] | 49 | <screen os="i"><userinput>ln -sv libfl.a /usr/lib/libl.a</userinput></screen>
|
---|
[3f8be484] | 50 |
|
---|
[4bb4b626] | 51 | <para os="j">A few programs do not know about <command>flex</command> yet and
|
---|
[3f8be484] | 52 | try to run its predecessor, <command>lex</command>. To support those
|
---|
| 53 | programs, create a wrapper script named <filename>lex</filename> that
|
---|
| 54 | calls <filename>flex</filename> in <command>lex</command> emulation
|
---|
| 55 | mode:</para>
|
---|
| 56 |
|
---|
[4bb4b626] | 57 | <screen os="k"><userinput>cat > /usr/bin/lex << "EOF"
|
---|
[3f8be484] | 58 | <literal>#!/bin/sh
|
---|
| 59 | # Begin /usr/bin/lex
|
---|
| 60 |
|
---|
| 61 | exec /usr/bin/flex -l "$@"
|
---|
| 62 |
|
---|
| 63 | # End /usr/bin/lex</literal>
|
---|
| 64 | EOF
|
---|
[94e6142] | 65 | chmod -v 755 /usr/bin/lex</userinput></screen>
|
---|
[3f8be484] | 66 |
|
---|
| 67 | </sect2>
|
---|
| 68 |
|
---|
| 69 | <sect2 id="contents-flex" role="content">
|
---|
| 70 | <title>Contents of Flex</title>
|
---|
| 71 |
|
---|
| 72 | <segmentedlist>
|
---|
| 73 | <segtitle>Installed programs</segtitle>
|
---|
[f5e37b2] | 74 | <segtitle>Installed libraries</segtitle>
|
---|
[3f8be484] | 75 |
|
---|
| 76 | <seglistitem>
|
---|
| 77 | <seg>flex and lex</seg>
|
---|
[06c4516] | 78 | <seg>libfl.[a,so] and libfl_pic.[a,so]</seg>
|
---|
[3f8be484] | 79 | </seglistitem>
|
---|
| 80 | </segmentedlist>
|
---|
| 81 |
|
---|
| 82 | <variablelist>
|
---|
| 83 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 84 | <?dbfo list-presentation="list"?>
|
---|
| 85 | <?dbhtml list-presentation="table"?>
|
---|
| 86 |
|
---|
| 87 | <varlistentry id="flex">
|
---|
| 88 | <term><command>flex</command></term>
|
---|
| 89 | <listitem>
|
---|
| 90 | <para>A tool for generating programs that recognize patterns in text;
|
---|
| 91 | it allows for the versatility to specify the rules for pattern-finding,
|
---|
| 92 | eradicating the need to develop a specialized program</para>
|
---|
| 93 | <indexterm zone="ch-system-flex flex">
|
---|
| 94 | <primary sortas="b-flex">flex</primary>
|
---|
| 95 | </indexterm>
|
---|
| 96 | </listitem>
|
---|
| 97 | </varlistentry>
|
---|
| 98 |
|
---|
[2b220db9] | 99 | <varlistentry id="flexpp">
|
---|
| 100 | <term><command>flex++</command></term>
|
---|
| 101 | <listitem>
|
---|
| 102 | <para>Link to <command>flex</command> which makes it generate C++
|
---|
| 103 | scanner classes</para>
|
---|
| 104 | <indexterm zone="ch-system-flex flexpp">
|
---|
| 105 | <primary sortas="b-flex++">flex++</primary>
|
---|
| 106 | </indexterm>
|
---|
| 107 | </listitem>
|
---|
| 108 | </varlistentry>
|
---|
| 109 |
|
---|
[3f8be484] | 110 | <varlistentry id="lex">
|
---|
| 111 | <term><command>lex</command></term>
|
---|
| 112 | <listitem>
|
---|
| 113 | <para>A script that runs <command>flex</command> in
|
---|
| 114 | <command>lex</command> emulation mode</para>
|
---|
| 115 | <indexterm zone="ch-system-flex lex">
|
---|
| 116 | <primary sortas="b-lex">lex</primary>
|
---|
| 117 | </indexterm>
|
---|
| 118 | </listitem>
|
---|
| 119 | </varlistentry>
|
---|
| 120 |
|
---|
[06c4516] | 121 | <varlistentry id="libfl">
|
---|
| 122 | <term><filename class="libraryfile">libfl</filename></term>
|
---|
[3f8be484] | 123 | <listitem>
|
---|
| 124 | <para>The <filename class="libraryfile">flex</filename> library</para>
|
---|
[06c4516] | 125 | <indexterm zone="ch-system-flex libfl">
|
---|
| 126 | <primary sortas="c-libfl">libfl</primary>
|
---|
[3f8be484] | 127 | </indexterm>
|
---|
| 128 | </listitem>
|
---|
| 129 | </varlistentry>
|
---|
| 130 |
|
---|
[06c4516] | 131 | <varlistentry id="libfl_pic">
|
---|
| 132 | <term><filename class="libraryfile">libfl_pic</filename></term>
|
---|
[8053eec] | 133 | <listitem>
|
---|
| 134 | <para>The <filename class="libraryfile">flex</filename> library</para>
|
---|
[06c4516] | 135 | <indexterm zone="ch-system-flex libfl_pic">
|
---|
| 136 | <primary sortas="c-libfl">libfl_pic</primary>
|
---|
[8053eec] | 137 | </indexterm>
|
---|
| 138 | </listitem>
|
---|
| 139 | </varlistentry>
|
---|
| 140 |
|
---|
[3f8be484] | 141 | </variablelist>
|
---|
| 142 |
|
---|
| 143 | </sect2>
|
---|
| 144 |
|
---|
| 145 | </sect1>
|
---|