flex.xml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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>First, skip running three regression tests that require bison.</para>
  34. <screen><userinput remap="pre">sed -i -e '/test-bison/d' tests/Makefile.in</userinput></screen>
  35. <para>Prepare Flex for compilation:</para>
  36. <screen><userinput remap="configure">./configure --prefix=/usr \
  37. --docdir=/usr/share/doc/flex-&flex-version;</userinput></screen>
  38. <para>Compile the package:</para>
  39. <screen><userinput remap="make">make</userinput></screen>
  40. <para>To test the results (about 0.5 SBU), issue:</para>
  41. <screen><userinput remap="test">make check</userinput></screen>
  42. <para>Install the package:</para>
  43. <screen><userinput remap="install">make install</userinput></screen>
  44. <para>There are some packages that expect to find the
  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. <screen><userinput remap="install">ln -sv libfl.a /usr/lib/libl.a</userinput></screen>
  49. <para>A few programs do not know about <command>flex</command> yet and
  50. try to run its predecessor, <command>lex</command>. To support those
  51. programs, create a wrapper script named <filename>lex</filename> that
  52. calls <filename>flex</filename> in <command>lex</command> emulation
  53. mode:</para>
  54. <screen><userinput remap="install">cat &gt; /usr/bin/lex &lt;&lt; "EOF"
  55. <literal>#!/bin/sh
  56. # Begin /usr/bin/lex
  57. exec /usr/bin/flex -l "$@"
  58. # End /usr/bin/lex</literal>
  59. EOF
  60. chmod -v 755 /usr/bin/lex</userinput></screen>
  61. </sect2>
  62. <sect2 id="contents-flex" role="content">
  63. <title>Contents of Flex</title>
  64. <segmentedlist>
  65. <segtitle>Installed programs</segtitle>
  66. <segtitle>Installed libraries</segtitle>
  67. <segtitle>Installed directories</segtitle>
  68. <seglistitem>
  69. <seg>flex, flex++ (link to flex), and lex</seg>
  70. <seg>libfl.a and libfl_pic.a</seg>
  71. <seg>/usr/share/doc/flex-&flex-version;</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="flexpp">
  90. <term><command>flex++</command></term>
  91. <listitem>
  92. <para>An extension of flex, is used for generating C++ code
  93. and classes. It is a symbolic link to <command>flex</command></para>
  94. <indexterm zone="ch-system-flex flexpp">
  95. <primary sortas="b-flex++">flex++</primary>
  96. </indexterm>
  97. </listitem>
  98. </varlistentry>
  99. <varlistentry id="lex">
  100. <term><command>lex</command></term>
  101. <listitem>
  102. <para>A script that runs <command>flex</command> in
  103. <command>lex</command> emulation mode</para>
  104. <indexterm zone="ch-system-flex lex">
  105. <primary sortas="b-lex">lex</primary>
  106. </indexterm>
  107. </listitem>
  108. </varlistentry>
  109. <varlistentry id="libfl.a">
  110. <term><filename class="libraryfile">libfl.a</filename></term>
  111. <listitem>
  112. <para>The <filename class="libraryfile">flex</filename> library</para>
  113. <indexterm zone="ch-system-flex libfl.a">
  114. <primary sortas="c-libfl.a">libfl.a</primary>
  115. </indexterm>
  116. </listitem>
  117. </varlistentry>
  118. </variablelist>
  119. </sect2>
  120. </sect1>