1
0
Prechádzať zdrojové kódy

chapter06: Translate flex instruction

Xi Ruoyao 7 rokov pred
rodič
commit
7ff3d8662f
1 zmenil súbory, kde vykonal 23 pridanie a 22 odobranie
  1. 23 22
      chapter06/flex.xml

+ 23 - 22
chapter06/flex.xml

@@ -23,8 +23,7 @@
   <sect2 role="package">
     <title/>
 
-    <para>The Flex package contains a utility for generating programs that
-    recognize patterns in text.</para>
+    <para>Flex 软件包包含一个工具,用于生成在文本中识别模式的程序。</para>
 
     <segmentedlist>
       <segtitle>&buildtime;</segtitle>
@@ -41,14 +40,14 @@
   <sect2 role="installation">
     <title>安装Flex</title>
 
-    <para>First, fix a problem introduced with glibc-2.26:</para>
+    <para>首先修正一个 glibc-2.26 引入的问题:</para>
 
 <screen><userinput remap="pre">sed -i "/math.h/a #include &lt;malloc.h&gt;" src/flexdef.h</userinput></screen>
 
-    <para>The build procedure assumes the <application>help2man</application>
-    program is available to create a man page from the executable --help option.
-    This is not present, so we use an environment variable to skip this process.
-    Now, prepare Flex for compilation:</para>
+    <para>构建过程假设 <application>help2man</application>
+		程序存在,以根据可执行文件的 --help 选项创建一个 man 页面。
+		然而它并不存在,因此我们使用一个环境变量,跳过这一过程。
+		现在,准备编译 Flex:</para>
 
 <screen><userinput remap="configure">HELP2MAN=/tools/bin/true \
 ./configure --prefix=/usr --docdir=/usr/share/doc/flex-&flex-version;</userinput></screen>
@@ -57,7 +56,7 @@
 
 <screen><userinput remap="make">make</userinput></screen>
 
-    <para>To test the results (about 0.5 SBU), issue:</para>
+    <para>如果要测试编译结果(需要约 0.5 SBU), 执行:</para>
 
 <screen><userinput remap="test">make check</userinput></screen>
 
@@ -65,11 +64,10 @@
 
 <screen><userinput remap="install">make install</userinput></screen>
 
-    <para>A few programs do not know about <command>flex</command> yet and
-    try to run its predecessor, <command>lex</command>. To support those
-    programs, create a symbolic link named <filename>lex</filename> that
-    runs <filename>flex</filename> in <command>lex</command> emulation
-    mode:</para>
+    <para>个别程序还不知道 <command>flex</command> ,
+    并试图去运行它的前身 <command>lex</command>。为了支持这些程序,
+	创建一个名为 <filename>lex</filename> 的符号链接,它以
+	<command>lex</command> 仿真模式运行 <filename>flex</filename>:</para>
 
 <screen><userinput remap="install">ln -sv flex /usr/bin/lex</userinput></screen>
 
@@ -84,8 +82,8 @@
       <segtitle>安装的目录</segtitle>
 
       <seglistitem>
-        <seg>flex, flex++ (link to flex), and lex (link to flex)</seg>
-        <seg>libfl.so and libfl_pic.so</seg>
+        <seg>flex, flex++ (到 flex 的链接), 以及 lex (到 flex 的链接)</seg>
+        <seg>libfl.so  libfl_pic.so</seg>
         <seg>/usr/share/doc/flex-&flex-version;</seg>
       </seglistitem>
     </segmentedlist>
@@ -98,9 +96,12 @@
       <varlistentry id="flex">
         <term><command>flex</command></term>
         <listitem>
-          <para>A tool for generating programs that recognize patterns in text;
+          <!--para>A tool for generating programs that recognize patterns in text;
           it allows for the versatility to specify the rules for pattern-finding,
-          eradicating the need to develop a specialized program</para>
+          eradicating the need to develop a specialized program</para-->
+          <para>一个用于生成在文本文件中识别模式的程序的工具,
+			  它允许灵活地指定查找模式的规则,消除了开发专用程序的需要。
+		  </para>
           <indexterm zone="ch-system-flex flex">
             <primary sortas="b-flex">flex</primary>
           </indexterm>
@@ -110,8 +111,8 @@
       <varlistentry id="flexpp">
         <term><command>flex++</command></term>
         <listitem>
-          <para>An extension of flex, is used for generating C++ code
-          and classes. It is a symbolic link to <command>flex</command></para>
+          <para>flex 的扩展,用于生成 C++ 代码和类。它是一个指向
+          <command>flex</command> 的符号链接</para>
           <indexterm zone="ch-system-flex flexpp">
             <primary sortas="b-flex++">flex++</primary>
           </indexterm>
@@ -121,8 +122,8 @@
       <varlistentry id="lex">
         <term><command>lex</command></term>
         <listitem>
-          <para>A script that runs <command>flex</command> in
-          <command>lex</command> emulation mode</para>
+          <para>一个以 <command>lex</command> 仿真模式运行
+          <command>lex</command> 的脚本</para>
           <indexterm zone="ch-system-flex lex">
             <primary sortas="b-lex">lex</primary>
           </indexterm>
@@ -132,7 +133,7 @@
       <varlistentry id="libfl">
         <term><filename class="libraryfile">libfl</filename></term>
         <listitem>
-          <para>The <filename class="libraryfile">flex</filename> library</para>
+          <para><filename class="libraryfile">flex</filename> 库</para>
           <indexterm zone="ch-system-flex libfl">
             <primary sortas="c-libfl">libfl</primary>
           </indexterm>