flex.xml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  4. <!ENTITY % general-entities SYSTEM "../general.ent">
  5. %general-entities;
  6. ]>
  7. <sect1 id="ch-system-flex" role="wrap">
  8. <?dbhtml filename="flex.html"?>
  9. <sect1info condition="script">
  10. <productname>flex</productname>
  11. <productnumber>&flex-version;</productnumber>
  12. <address>&flex-url;</address>
  13. </sect1info>
  14. <title>Flex-&flex-version;</title>
  15. <indexterm zone="ch-system-flex">
  16. <primary sortas="a-Flex">Flex</primary>
  17. </indexterm>
  18. <sect2 role="package">
  19. <title/>
  20. <para>The Flex package contains a utility for generating programs that
  21. recognize patterns in text.</para>
  22. <segmentedlist>
  23. <segtitle>&buildtime;</segtitle>
  24. <segtitle>&diskspace;</segtitle>
  25. <seglistitem>
  26. <seg>&flex-ch6-sbu;</seg>
  27. <seg>&flex-ch6-du;</seg>
  28. </seglistitem>
  29. </segmentedlist>
  30. </sect2>
  31. <sect2 role="installation">
  32. <title>Installation of Flex</title>
  33. <para>Prepare Flex for compilation:</para>
  34. <screen><userinput remap="configure">./configure --prefix=/usr</userinput></screen>
  35. <para>Compile the package:</para>
  36. <screen><userinput remap="make">make</userinput></screen>
  37. <para>To test the results (about 0.5 SBU), issue:</para>
  38. <screen><userinput remap="test">make check</userinput></screen>
  39. <para>Install the package:</para>
  40. <screen><userinput remap="install">make install</userinput></screen>
  41. <para>There are some packages that expect to find the
  42. <filename class="libraryfile">lex</filename> library in <filename
  43. class="directory">/usr/lib</filename>. Create a symlink to account for
  44. this:</para>
  45. <screen><userinput remap="install">ln -sv libfl.a /usr/lib/libl.a</userinput></screen>
  46. <para>A few programs do not know about <command>flex</command> yet and
  47. try to run its predecessor, <command>lex</command>. To support those
  48. programs, create a wrapper script named <filename>lex</filename> that
  49. calls <filename>flex</filename> in <command>lex</command> emulation
  50. mode:</para>
  51. <screen><userinput remap="install">cat &gt; /usr/bin/lex &lt;&lt; "EOF"
  52. <literal>#!/bin/sh
  53. # Begin /usr/bin/lex
  54. exec /usr/bin/flex -l "$@"
  55. # End /usr/bin/lex</literal>
  56. EOF
  57. chmod -v 755 /usr/bin/lex</userinput></screen>
  58. <para>If desired, install the <filename>flex.pdf</filename> documentation
  59. file:</para>
  60. <screen><userinput remap="install">mkdir -v /usr/share/doc/flex-&flex-version;
  61. cp -v doc/flex.pdf \
  62. /usr/share/doc/flex-&flex-version;</userinput></screen>
  63. </sect2>
  64. <sect2 id="contents-flex" role="content">
  65. <title>Contents of Flex</title>
  66. <segmentedlist>
  67. <segtitle>Installed programs</segtitle>
  68. <segtitle>Installed library</segtitle>
  69. <seglistitem>
  70. <seg>flex and lex</seg>
  71. <seg>libfl.a</seg>
  72. </seglistitem>
  73. </segmentedlist>
  74. <variablelist>
  75. <bridgehead renderas="sect3">Short Descriptions</bridgehead>
  76. <?dbfo list-presentation="list"?>
  77. <?dbhtml list-presentation="table"?>
  78. <varlistentry id="flex">
  79. <term><command>flex</command></term>
  80. <listitem>
  81. <para>A tool for generating programs that recognize patterns in text;
  82. it allows for the versatility to specify the rules for pattern-finding,
  83. eradicating the need to develop a specialized program</para>
  84. <indexterm zone="ch-system-flex flex">
  85. <primary sortas="b-flex">flex</primary>
  86. </indexterm>
  87. </listitem>
  88. </varlistentry>
  89. <varlistentry id="lex">
  90. <term><command>lex</command></term>
  91. <listitem>
  92. <para>A script that runs <command>flex</command> in
  93. <command>lex</command> emulation mode</para>
  94. <indexterm zone="ch-system-flex lex">
  95. <primary sortas="b-lex">lex</primary>
  96. </indexterm>
  97. </listitem>
  98. </varlistentry>
  99. <varlistentry id="libfl.a">
  100. <term><filename class="libraryfile">libfl.a</filename></term>
  101. <listitem>
  102. <para>The <filename class="libraryfile">flex</filename> library</para>
  103. <indexterm zone="ch-system-flex libfl.a">
  104. <primary sortas="c-libfl.a">libfl.a</primary>
  105. </indexterm>
  106. </listitem>
  107. </varlistentry>
  108. </variablelist>
  109. </sect2>
  110. </sect1>