flex.xml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
  3. <!ENTITY % general-entities SYSTEM "../general.ent">
  4. <!ENTITY % patches-entities SYSTEM "../patches.ent">
  5. %general-entities;
  6. %patches-entities;
  7. ]>
  8. <sect1 id="ch-system-flex" role="wrap">
  9. <title>Flex-&flex-version;</title>
  10. <?dbhtml filename="flex.html"?>
  11. <indexterm zone="ch-system-flex"><primary sortas="a-Flex">Flex</primary></indexterm>
  12. <sect2 role="package"><title/>
  13. <para>The Flex package contains a utility for generating programs that
  14. recognize patterns in text.</para>
  15. <segmentedlist>
  16. <segtitle>&buildtime;</segtitle>
  17. <segtitle>&diskspace;</segtitle>
  18. <seglistitem><seg>0.1 SBU</seg><seg>22.5 MB</seg></seglistitem>
  19. </segmentedlist>
  20. <segmentedlist>
  21. <segtitle>&dependencies;</segtitle>
  22. <seglistitem><seg>Bash, Binutils, Bison, Coreutils, Diffutils,
  23. GCC, Gettext, Glibc, Grep, M4, Make, and Sed</seg></seglistitem>
  24. </segmentedlist>
  25. </sect2>
  26. <sect2 role="installation">
  27. <title>Installation of Flex</title>
  28. <para>Flex contains several known bugs. Fix these with the following patch:</para>
  29. <screen><userinput>patch -Np1 -i ../&flex-fixes-patch;</userinput></screen>
  30. <para>The GNU autotools detects that the Flex source code has been
  31. modified by the previous patch and tries to update the manual page
  32. accordingly. This does not work correctly on many systems, and the
  33. default page is fine, so make sure it does not get regenerated:</para>
  34. <screen><userinput>touch doc/flex.1</userinput></screen>
  35. <para>Prepare Flex for compilation:</para>
  36. <screen><userinput>./configure --prefix=/usr</userinput></screen>
  37. <para>Compile the package:</para>
  38. <screen><userinput>make</userinput></screen>
  39. <para>To test the results, issue:
  40. <userinput>make check</userinput>.</para>
  41. <para>Install the package:</para>
  42. <screen><userinput>make install</userinput></screen>
  43. <para>There are some packages that expect to find the
  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. <screen><userinput>ln -s libfl.a /usr/lib/libl.a</userinput></screen>
  48. <para>A few programs do not know about <command>flex</command> yet and
  49. try to run its predecessor, <command>lex</command>. To support those
  50. programs, create a wrapper script named <filename>lex</filename> that
  51. calls <filename>flex</filename> in <command>lex</command> emulation mode:</para>
  52. <screen><userinput>cat &gt; /usr/bin/lex &lt;&lt; "EOF"
  53. <literal>#!/bin/sh
  54. # Begin /usr/bin/lex
  55. exec /usr/bin/flex -l "$@"
  56. # End /usr/bin/lex</literal>
  57. EOF
  58. chmod 755 /usr/bin/lex</userinput></screen>
  59. </sect2>
  60. <sect2 id="contents-flex" role="content"><title>Contents of Flex</title>
  61. <segmentedlist>
  62. <segtitle>Installed programs</segtitle>
  63. <segtitle>Installed library</segtitle>
  64. <seglistitem><seg>flex, flex++ (link to flex), and lex</seg>
  65. <seg>libfl.a</seg></seglistitem>
  66. </segmentedlist>
  67. <variablelist><bridgehead renderas="sect3">Short Descriptions</bridgehead>
  68. <?dbfo list-presentation="list"?>
  69. <?dbhtml list-presentation="table"?>
  70. <varlistentry id="flex">
  71. <term><command>flex</command></term>
  72. <listitem>
  73. <para>A tool for generating programs that recognize patterns in text;
  74. it allows for the versatility to specify the rules for
  75. pattern-finding, eradicating the need to develop a specialized
  76. program</para>
  77. <indexterm zone="ch-system-flex flex"><primary sortas="b-flex">flex</primary></indexterm>
  78. </listitem>
  79. </varlistentry>
  80. <varlistentry id="flex-">
  81. <term><command>flex++</command></term>
  82. <listitem>
  83. <para>Invokes a version of <command>flex</command> that is used exclusively for C++ scanners</para>
  84. <indexterm zone="ch-system-flex flex-"><primary sortas="b-flex++">flex++</primary></indexterm>
  85. </listitem>
  86. </varlistentry>
  87. <varlistentry id="lex">
  88. <term><command>lex</command></term>
  89. <listitem>
  90. <para>A script that runs <command>flex</command> in <command>lex</command>
  91. emulation mode</para>
  92. <indexterm zone="ch-system-flex lex"><primary sortas="b-lex">lex</primary></indexterm>
  93. </listitem>
  94. </varlistentry>
  95. <varlistentry id="libfl.a">
  96. <term><filename class="libraryfile">libfl.a</filename></term>
  97. <listitem>
  98. <para>The <filename class="libraryfile">flex</filename> library</para>
  99. <indexterm zone="ch-system-flex libfl.a"><primary sortas="c-libfl.a">libfl.a</primary></indexterm>
  100. </listitem>
  101. </varlistentry>
  102. </variablelist>
  103. </sect2>
  104. </sect1>