<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  <!ENTITY % general-entities SYSTEM "../general.ent">
  %general-entities;
]>

<sect1 id="ch-system-bison" role="wrap">
  <?dbhtml filename="bison.html"?>

  <sect1info condition="script">
    <productname>bison</productname>
    <productnumber>&bison-version;</productnumber>
    <address>&bison-url;</address>
  </sect1info>

  <title>Bison-&bison-version;</title>

  <indexterm zone="ch-system-bison">
    <primary sortas="a-Bison">Bison</primary>
  </indexterm>

  <sect2 role="package">
    <title/>

    <para>Bison 软件包包含语法分析器生成器。</para>

    <segmentedlist>
      <segtitle>&buildtime;</segtitle>
      <segtitle>&diskspace;</segtitle>

      <seglistitem>
        <seg>&bison-ch6-sbu;</seg>
        <seg>&bison-ch6-du;</seg>
      </seglistitem>
    </segmentedlist>

  </sect2>

  <sect2 role="installation">
    <title>安装 Bison</title>

    <para>准备安装 Bison：</para>

<screen><userinput remap="configure">./configure --prefix=/usr --docdir=/usr/share/doc/bison-&bison-version;</userinput></screen>

    <para>编译该软件包：</para>

<screen><userinput remap="make">make</userinput></screen>

<!--
    <para>To test the results (about 2.2 SBU), issue:</para>

<screen><userinput remap="test">make check</userinput></screen>
-->

    <!--para>There is a circular dependency between bison and flex with regard to
    the checks.  If desired, after installing flex in the next section, the
<<<<<<< HEAD
    bison checks can be run with <command>make check</command>.  Three
    tests related to lalr1.cc fail for unknown reasons.</para-->
    <para>在考虑测试的情况下， bison 和 flex 之间存在循环依赖。
		如果希望的话，可以在下一节安装 flex 后，
		返回这里运行 <command>make check</command> 运行测试。</para>

    <para>安装该软件包：</para>

<screen><userinput remap="install">make install</userinput></screen>

  </sect2>

  <sect2 id="contents-bison" role="content">
    <title>Bison 的内容</title>

    <segmentedlist>
      <segtitle>安装的程序</segtitle>
      <segtitle>安装的库</segtitle>
      <segtitle>安装的目录</segtitle>

      <seglistitem>
        <seg>bison 和 yacc</seg>
        <seg>liby.a</seg>
        <seg>/usr/share/bison</seg>
      </seglistitem>
    </segmentedlist>

    <variablelist>
      <bridgehead renderas="sect3">简要描述</bridgehead>
      <?dbfo list-presentation="list"?>
      <?dbhtml list-presentation="table"?>

      <varlistentry id="bison">
        <term><command>bison</command></term>
        <listitem>
          <!--para>Generates, from a series of rules, a program for analyzing the
          structure of text files; Bison is a replacement for Yacc (Yet Another
          Compiler Compiler)</para-->
          <para>根据一组规则，创建一个用于分析文本文件结构的程序；
			  Bison 是 Yacc (Yet Another Compiler Compiler) 的替代品。
		  </para>
          <indexterm zone="ch-system-bison bison">
            <primary sortas="b-bison">bison</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="yacc">
        <term><command>yacc</command></term>
        <listitem>
          <para><command>bison</command> 的一个封装器，被那些仍然调用
			  <command>yacc</command> 而非 <command>bison</command>
			  的程序使用，它使用 <parameter>-y</parameter> 选项调用
			  <command>bison</command>。</para>
          <indexterm zone="ch-system-bison yacc">
            <primary sortas="b-yacc">yacc</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="liby">
        <term><filename class="libraryfile">liby</filename></term>
        <listitem>
			<para>Yacc 库包含与 Yacc 兼容的 <function>yyerror</function>
				和 <function>main</function> 函数实现；它并不是很有用，
				但 POSIX 需要它</para>
          <indexterm zone="ch-system-bison liby">
            <primary sortas="c-liby">liby</primary>
          </indexterm>
        </listitem>
      </varlistentry>

    </variablelist>

  </sect2>

</sect1>
