ISO IEC 14977-1996 Information technology - Syntactic metalanguage - Extended BNF《信息技术 语法元语言 扩展的BNF》.pdf
《ISO IEC 14977-1996 Information technology - Syntactic metalanguage - Extended BNF《信息技术 语法元语言 扩展的BNF》.pdf》由会员分享,可在线阅读,更多相关《ISO IEC 14977-1996 Information technology - Syntactic metalanguage - Extended BNF《信息技术 语法元语言 扩展的BNF》.pdf(21页珍藏版)》请在麦多课文档分享上搜索。
1、INTERNATIONAL STANDARD ISO/IEC First edition 1996-I 2-l 5 Information technology - Syntactic metalanguage - Extended BNF Technologies de /information - MBtalangage syntaxique - BNF Btendu Reference number ISO/IEC 14977:1996(E) ISO/IEC 14977 : 1996(E) Contents Page Foreword . . . . . . . . . . . . .
2、. . . . . . . . . . . . . . . . . . , . . . . . . . . . . . iv Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Scope 2 Normative references 3 Definitions 4 The form of each syntactic element of Extended BNF 4.1 General . 4.2 Syntax . 4.3 Syntax-rule 4.4 Definitions-list.
3、 . 4.5 Single-definition . 4.6 Syntactic-term 4.7 Syntactic exception 4.8 Syntactic-factor . 4.9 Integer . 4.10 Syntactic-primary 4.11 Optional-sequence . 4.12 Repeated sequence . 4.13 Grouped sequence . 4.14 Meta-identifier 4.15 Meta-identifier-character . 4.16 Terminal-string. . 4.17 First-termina
4、l-character 4.18 Second-terminal-character 4.19 Special-sequence 4.20 Special-sequence-character . 4.21 Empty-sequence . 4.22 Further examples V 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 ISO/IEC 1996 All rights reserved. Unless otherwise specified, no pan of this publication may be reprodu
5、ced or utilized in any form or by any means, electronic or mechanical, including photocopying and microfilm, without permission in writing from the publisher. ISO/IEC Copyright Office l Case Postale 56 l CH-1211 Gerkve 20 l Switzerland Printed in Switzerland ii ISO/IEC ISO/IEC 14977 : 1996(E) 5 The
6、symbols represented by each syntactic element. . 5.1 General . 5.2 Terminal-string. . 5.3 Meta-identifier 5.4 Grouped-sequence . 5.5 Optional-sequence . 5.6 Repeated-sequence . 5.7 Syntactic-factor . 5.8 Syntactic-term 5.9 Single-definition . 5.10 Definitions-list 5.11 Special-sequence 5.12 Empty-se
7、quence . 6 Layout and Comments . 6.1 General . 6.2 Terminal-character . 6.3 Gap-free-symbol 6.4 Gap-separator 6.5 Commentless-symbol . 6.6 Comment-symbol 6.7 Bracketed-textual-comment . 7 The representation of each terminal-character in Extended BNF 7.1 General . 7.2 Letters and digits 7.3 Other ter
8、minal characters 7.4 Alternative representations. . 7.5 Other-character . 7.6 Gap-separator 7.7 Terminal-characters represented by a pair of characters . 7.8 Invalid character sequences . 8 Examples . 8.1 The syntax of Extended BNF . 8.2 Extended BNF used to define itself informally . 8.3 Extended B
9、NF defined informally Annexes A Two-level grammars . B Bibliography 3 3 4 4 4 4 4 4 4 5 5 5 5 8 8 10 IO I1 12 . . . 111 ISO/IEC 14977 : 1996(E) ISO/IEC Foreword IS0 (the International Organization for Standardization) and IEC (the International Electrotechnical Commission) form the specialized syste
10、m for worldwide standardization. National bodies that are members of IS0 or IEC participate in the development of International Standards through technical committees established by the respective organization to deal with particular fields of technical activity. IS0 and IEC technical committees col
11、laborate in fields of mutual interest. Other international organizations, governmental and non- governmental, in liaison with IS0 and IEC, also take part in the work. In the field of information technology, IS0 and IEC have established a joint technical committee ISO/IEC JTC 1. Draft International S
12、tandards adopted by the joint technical committee are circulated to national bodies for voting. Publication as an International Standard requires approval by at least 75% of the national bodies casting a vote. International Standard ISO/IEC 14977 was prepared by BSI (as BS 6154) and was adopted, und
13、er a special “fast-track procedure”, by Joint Technical Committee ISO/IEC JTC 1, Znfomtation technology, in parallel with its approval by national bodies of IS0 and IEC. Annexes A and B of this International Standard are for information only. iv ISO/IEC ISO/IEC 14977 : 1996(E) Introduction A syntact
14、ic metalanguage is an important tool of computer science. The concepts are well known, but many slightly different notations are in use. As a result syntactic metalanguages are still not widely used and understood, and the advantages of rigorous notations are unappreciated by many people. Extended B
15、NF brings some order to the formal definition of a syntax and will be useful not just for the definition of programming languages, but for many other formal definitions. Since the definition of the programming language Algol 60 (Naur, 1960) the custom has been to define the syntax of a programming l
16、anguage formally. Algol 60 was defined with a notation now known as BNF or Backus-Naur Form. This notation has proved a suitable basis for subsequent languages but has frequently been extended or slightly altered. The many different notations are confusing and have prevented the advantages of formal
17、 unambiguous definitions from being widely appreciated. The syntactic metalanguage Extended BNF described in this standard is based on Backus-Naur Form and includes the most widely adopted extensions. Syntactic metalanguages A syntactic metalanguage is a notation for defining the syntax of a languag
18、e by use of a number of rules. Each rule names part of the language (called a non-terminal symbol of the language) and then defines its possible forms. A terminal symbol of the language is an atom that cannot be split into smaller components of the language. A syntactic metalanguage is useful whenev
19、er a clear formal description and definition is required, e.g. the format for references in papers submitted to a journal, or the instructions for performing a complicated task. A formal syntax definition has three distinct uses: a) it names the various syntactic parts (i.e. non-terminal symbols) of
20、 the language; b) it shows which sequences of symbols are valid sentences of the language; c) it shows the syntactic structure of any sentence of the language. The need for a standard syntactic metalanguage Without a standard syntactic metalanguage every programming language definition starts by spe
21、cifying the metalanguage used to define its syntax. This causes various problems: V ISO/IEC 14977 : 1996(E) ISO/IEC Many different notations - It is unusual for two different programming languages to use the same metalanguage. Thus human readers are handicapped by having to learn a new metalanguage
22、before they can study a new language. Concepts not widely understood - The lack of a standard notation hinders the use of rigorous unambiguous definitions. Imperfect notations - Because a metalanguage needs to be defined for every programming language, almost inevitably, the metalanguage contains de
23、fects. For example errors occurred in the drafting of RTLJ2 (BS5904) and CORAL 66 (BS5905) because the metalanguages could not be typed easily. Special purpose notations - A metalanguage defined for a particular pro- gramming language is often simplified by taking advantage of special features in th
24、e language to be defined. However, the metalanguage is then unsuitable for other programming languages. Few general syntax processors - The multiplicity of syntactic meta- languages has limited the availability of computer programs to analyse and process syntaxes, e.g. to list a syntax neatly, to ma
- 1.请仔细阅读文档,确保文档完整性,对于不预览、不比对内容而直接下载带来的问题本站不予受理。
- 2.下载的文档,不会出现我们的网址水印。
- 3、该文档所得收入(下载+内容+预览)归上传者、原创作者;如果您是本文档原作者,请点此认领!既往收益都归您。
下载文档到电脑,查找使用更方便
10000 积分 0人已下载
下载 | 加入VIP,交流精品资源 |
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- ISOIEC149771996INFORMATIONTECHNOLOGYSYNTACTICMETALANGUAGEEXTENDEDBNF 信息技术 语法 语言 扩展 BNFPDF

链接地址:http://www.mydoc123.com/p-1256872.html