Files
master/chapter06/flex.html
2015-05-23 18:50:06 +08:00

243 lines
8.0 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content=
"application/xhtml+xml; charset=utf-8" />
<title>
6.32.&nbsp;Flex-2.5.39
</title>
<link rel="stylesheet" type="text/css" href="../stylesheets/lfs.css" />
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
<link rel="stylesheet" href="../stylesheets/lfs-print.css" type="text/css"
media="print" />
</head>
<body class="lfs" id="lfs-7.7-systemd">
<div class="navheader">
<h4>
Linux From Scratch - Version 7.7-systemd
</h4>
<h3>
第六章&nbsp;安装基本的系统软件
</h3>
<ul>
<li class="prev">
<a accesskey="p" href="m4.html" title="M4-1.4.17">上一页</a>
<p>
M4-1.4.17
</p>
</li>
<li class="next">
<a accesskey="n" href="bison.html" title="Bison-3.0.4">下一页</a>
<p>
Bison-3.0.4
</p>
</li>
<li class="up">
<a accesskey="u" href="chapter06.html" title=
"第六章&nbsp;安装基本的系统软件">返回</a>
</li>
<li class="home">
<a accesskey="h" href="../index.html" title=
"Linux From Scratch - Version 7.7-systemd">主页</a>
</li>
</ul>
</div>
<div class="wrap" lang="en" xml:lang="en">
<h1 class="sect1">
<a id="ch-system-flex" name="ch-system-flex"></a>6.32. Flex-2.5.39
</h1>
<div class="package" lang="en" xml:lang="en">
<p>
Flex 软件包包括一个用于生成识别文本模式的程序的工具。
</p>
<div class="segmentedlist">
<div class="seglistitem">
<div class="seg">
<strong class="segtitle">大概编译时间:</strong>
<span class="segbody">0.3 SBU</span>
</div>
<div class="seg">
<strong class="segtitle">需要磁盘空间:</strong>
<span class="segbody">38 MB</span>
</div>
</div>
</div>
</div>
<div class="installation" lang="en" xml:lang="en">
<h2 class="sect2">
6.32.1. 安装 Flex
</h2>
<p>
首先,跳过需要 Bison 的三个回归测试:
</p>
<pre class="userinput">
<kbd class="command">sed -i -e '/test-bison/d' tests/Makefile.in</kbd>
</pre>
<p>
准备编译 Flex
</p>
<pre class="userinput">
<kbd class=
"command">./configure --prefix=/usr --docdir=/usr/share/doc/flex-2.5.39</kbd>
</pre>
<p>
编译软件包:
</p>
<pre class="userinput">
<kbd class="command">make</kbd>
</pre>
<p>
用以下命令测试结果(大约 0.5 SBU)
</p>
<pre class="userinput">
<kbd class="command">make check</kbd>
</pre>
<p>
安装软件包:
</p>
<pre class="userinput">
<kbd class="command">make install</kbd>
</pre>
<p>
一些程序还不知道 <span class=
"command"><strong>flex</strong></span> 并尝试运行它的预处理器,
<span class="command"><strong>lex</strong></span>。为了支持这些程序,
创建以 <span class="command"><strong>lex</strong></span> 仿真模式运行
<code class="filename">flex</code> 的符号链接 <code class=
"filename">lex</code>
</p>
<pre class="userinput">
<kbd class="command">ln -sv flex /usr/bin/lex</kbd>
</pre>
</div>
<div class="content" lang="en" xml:lang="en">
<h2 class="sect2">
<a id="contents-flex" name="contents-flex"></a>6.32.2. Flex 的内容
</h2>
<div class="segmentedlist">
<div class="seglistitem">
<div class="seg">
<strong class="segtitle">安装的程序:</strong>
<span class="segbody">flex, flex++ (链接到 flex), 和 lex
(链接到 flex)</span>
</div>
<div class="seg">
<strong class="segtitle">安装的库:</strong>
<span class="segbody">libfl.{a,so} 和 libfl_pic.{a,so}</span>
</div>
<div class="seg">
<strong class="segtitle">安装目录:</strong>
<span class="segbody">/usr/share/doc/flex-2.5.39</span>
</div>
</div>
</div>
<div class="variablelist">
<h3>
简要介绍
</h3>
<table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top" />
<col />
</colgroup>
<tbody>
<tr>
<td>
<p>
<a id="flex" name="flex"></a><span class=
"term"><span class=
"command"><strong>flex</strong></span></span>
</p>
</td>
<td>
<p>
一个用于生成能识别文本模式程序的工具;它允许指定多种用于模式发现的规则,
从而消除了开发专门程序的需要
</p>
</td>
</tr>
<tr>
<td>
<p>
<a id="flexpp" name="flexpp"></a><span class=
"term"><span class=
"command"><strong>flex++</strong></span></span>
</p>
</td>
<td>
<p>
flex 的扩展,用于生成 C++ 代码和类。是到 <span class=
"command"><strong>flex</strong></span> 的符号链接
</p>
</td>
</tr>
<tr>
<td>
<p>
<a id="lex" name="lex"></a><span class=
"term"><span class="command"><strong>lex</strong></span></span>
</p>
</td>
<td>
<p>
一个以 <span class=
"command"><strong>lex</strong></span> 仿真模式运行
<span class=
"command"><strong>flex</strong></span> 的脚本
</p>
</td>
</tr>
<tr>
<td>
<p>
<a id="libfl" name="libfl"></a><span class=
"term"><code class="filename">libfl</code></span>
</p>
</td>
<td>
<p>
<code class="filename">flex</code>
</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="navfooter">
<div class="book">
<div class="titlepage">
<div class="author">
<span class="firstname">翻译团队:<a href="http://lctt.github.io/" target="_blank">LCTT</a></span>
<span class="surname">译者/校对:<a href="http://github.com/ictlyh" target="_blank">ictlyh</a>,</span>
</div>
</div>
</div>
<ul>
<li class="prev">
<a accesskey="p" href="m4.html" title="M4-1.4.17">上一页</a>
<p>
M4-1.4.17
</p>
</li>
<li class="next">
<a accesskey="n" href="bison.html" title="Bison-3.0.4">下一页</a>
<p>
Bison-3.0.4
</p>
</li>
<li class="up">
<a accesskey="u" href="chapter06.html" title=
"第六章&nbsp;安装基本的系统软件">返回</a>
</li>
<li class="home">
<a accesskey="h" href="../index.html" title=
"Linux From Scratch - Version 7.7-systemd">主页</a>
</li>
</ul>
</div>
</body>
</html>