Backus–Naur Form(巴科斯范式)

From Wikipedia, the free encyclopedia

Jump to: navigation, search

In computer science, BNF (Backus Normal Form or Backus–Naur Form ) is a notation technique for context-free grammars, often used to describe the syntax of languages used in computing, such as computer programming languages, document formats , instruction sets and communication protocols . It is applied wherever exact descriptions of languages are needed, for instance, in official language specifications, in manuals, and in textbooks on programming language theory.

Many extensions and variants of the original notation are used; some are exactly defined, including Extended Backus–Naur Form (EBNF) and Augmented Backus–Naur Form (ABNF).

 

History

The idea of describing the structure of language with rewriting rules can be traced back to at least the work of Pāṇini (around 400 BC), who used it in his description of Sanskrit word structure - hence, some suggest to rename BNF to Panini–Backus Form. [ 1] . American linguists such as Leonard Bloomfield and Zellig Harris took this idea a step further by attempting to formalize language and its study in terms of formal definitions and procedures (around 1920-1960)..

Meanwhile, string rewriting rules as formal, abstract systems were introduced and studied by mathematicians such as Axel Thue (in 1914), Emil Post (1920s-1940s) and Alan Turing (1936). Noam Chomsky, teaching linguistics to students of information theory at MIT , combined linguistics and mathematics, by taking what is essentially Thue's formalism as the basis for the description of the syntax of natural language; he also introduced a clear distinction between generative rules (those of context-free grammars) and transformation rules (1956).[ 2] [ 3]

John Backus , a programming language designer at IBM, adopted Chomsky's generative rules[ 4] to describe the syntax of the new programming language IAL, known today as ALGOL 58 (1959),[ 5] using the BNF notation.

Further development of ALGOL led to ALGOL 60; in its report (1963), Peter Naur named Backus's notation Backus Normal Form , and simplified it to minimize the character set used. However, Donald Knuth argued that BNF should rather be read as Backus-Naur Form , as it is "not a normal form in any sense",[ 6] unlike, for instance, Chomsky Normal Form .

Introduction

A BNF specification is a set of derivation rules, written as

 
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值