没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
Bison
The YACC-compatible Parser Generator
November 1995, Bison Version 1.25
by Charles Donnelly and Richard Stallman
Copyright
c
1988, 89, 90, 91, 92, 93, 1995 Free Software Foundation
Published bytheFree Software Foundation
59 Temple Place, Suite 330
Boston, MA 02111-1307 USA
Printed copies are available for $15 each.
ISBN 1-882114-45-0
Permission is granted to make and distribute verbatim copies of this manual provided the
copyright notice and this permission notice are preserved on all copies.
Permission is granted to copy and distribute modied versions of this manual under the
conditions for verbatim copying, provided also that the sections entitled \GNU General
Public License" and \Conditions for Using Bison" are included exactly as in the original,
and provided that the entire resulting derived work is distributed under the terms of a
permission notice identical to this one.
Permission is grantedtocopy and distribute translations of this manual into another lan-
guage, under the ab ove conditions for mo died versions, except that the sections entitled
\GNU General Public License", \Conditions for Using Bison" and this permission notice
may be included in translations approved by the Free Software Foundation instead of in the
original English.
Cover art by Etienne Suvasa.
Introduction 1
Intro duction
Bison
is a general-purp ose parser generator that converts a grammar description for an
LALR(1) context-free grammar into a C program to parse that grammar. Once you are
procient with Bison, you may use it to develop a wide range of language parsers, from
those used in simple desk calculators to complex programming languages.
Bison is upward compatible with Yacc: all prop erly-written Yacc grammars oughtto
work with Bison with no change. Anyone familiar with Yacc should b e able to use Bison
with little trouble. You need to b e uent in C programming in order to use Bison or to
understand this manual.
We b egin with tutorial chapters that explain the basic concepts of using Bison and show
three explained examples, each building on the last. If you don't know Bison or Yacc,
start by reading these chapters. Reference chapters follow which describe sp ecic aspects
of Bison in detail.
Bison was written primarily by Rob ert Corbett; Richard Stallman made it Yacc-
compatible. Wilfred Hansen of Carnegie Mellon University added multicharacter string
literals and other features.
This edition corresp onds to version 1.25 of Bison.
2 Bison 1.25
Conditions for Using Bison 3
Conditions for Using Bison
As of Bison version 1.24, wehavechanged the distribution terms for
yyparse
to p ermit
using Bison's output in non-free programs. Formerly, Bison parsers could be used only in
programs that were free software.
The other GNU programming tools, such as the GNU C compiler, havenever had such
a requirement. They could always be used for non-free software. The reason Bison was
dierentwas not due to a sp ecial policy decision; it resulted from applying the usual General
Public License to all of the Bison source code.
The output of the Bison utility|the Bison parser le|contains a verbatim copyofa
sizable piece of Bison, which is the code for the
yyparse
function. (The actions from your
grammar are inserted into this function at one p oint, but the rest of the function is not
changed.) When we applied the GPL terms to the co de for
yyparse
, the eect was to
restrict the use of Bison output to free software.
We didn't change the terms b ecause of sympathy for p eople who wanttomake software
proprietary.
Software should be free.
But we concluded that limiting Bison's use to free
software was doing little to encourage p eople to make other software free. So we decided to
make the practical conditions for using Bison match the practical conditions for using the
other GNU tools.
剩余95页未读,继续阅读
ustbapple
- 粉丝: 1
- 资源: 14
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页