ISO IEC 30170-2012 Information technology - Programming languages - Ruby《信息技术 编程语言 Ruby》.pdf
《ISO IEC 30170-2012 Information technology - Programming languages - Ruby《信息技术 编程语言 Ruby》.pdf》由会员分享,可在线阅读,更多相关《ISO IEC 30170-2012 Information technology - Programming languages - Ruby《信息技术 编程语言 Ruby》.pdf(334页珍藏版)》请在麦多课文档分享上搜索。
1、 Reference number ISO/IEC 30170:2012(E) ISO/IEC 2012INTERNATIONAL STANDARD ISO/IEC 30170 First edition 2012-04-15 Information technology Programming languages Ruby Technologies de linformation Langages de programmation Ruby ISO/IEC 30170:2012(E) COPYRIGHT PROTECTED DOCUMENT ISO/IEC 2012 All rights r
2、eserved. Unless otherwise specified, no part of this publication may be reproduced or utilized in any form or by any means, electronic or mechanical, including photocopying and microfilm, without permission in writing from either ISO at the address below or ISOs member body in the country of the req
3、uester. ISO copyright office Case postale 56 CH-1211 Geneva 20 Tel. + 41 22 749 01 11 Fax + 41 22 749 09 47 E-mail copyrightiso.org Web www.iso.org Published in Switzerland ii ISO/IEC 2012 All rights reservedISO/IEC 30170:2012(E) Contents Page 1 Scope . . . . . . . . . . . . . . . . . . . . . . . .
4、. . . . . . . . . . . . . . . . . . . . 1 2 Normative references . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 3 Conformance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 4 Terms and denitions . . . . . . . . . . . . . . . . . . . . . .
5、 . . . . . . . . . . . . . 2 5 Notational conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 5.1 General description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 5.2 Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6、. . . . . . 4 5.2.1 General description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 5.2.2 Productions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 5.2.3 Syntactic term sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 5.2.4 Syntactic terms
7、 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 5.2.5 Conceptual names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 5.3 Semantics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 5.4 Attributes of execution contexts . . . . . .
8、 . . . . . . . . . . . . . . . . . . . . 11 6 Fundamental concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 6.1 Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 6.2 Variables . . . . . . . . . . . . . . . . . . . . . . . . . .
9、 . . . . . . . . . . . . . 12 6.2.1 General description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 6.2.2 Instance variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 6.3 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10、 13 6.4 Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 6.5 Classes, singleton classes, and modules . . . . . . . . . . . . . . . . . . . . . . . 14 6.5.1 General description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 6.5.2 Classes . .
11、. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 6.5.3 Singleton classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 6.5.4 Inheritance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 6.5.5 Modules . . . . . . . . . . . . . . . .
12、 . . . . . . . . . . . . . . . . . . . . . 17 6.6 Boolean values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 7 Execution contexts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 7.1 General description. . . . . . . . . . . . . . . . . . . .
13、 . . . . . . . . . . . . . . 18 7.2 The initial state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 8 Lexical structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 8.1 General description. . . . . . . . . . . . . . . . . . . . . . . . . .
14、 . . . . . . . . 19 8.2 Program text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 8.3 Line terminators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 8.4 Whitespace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
15、1 8.5 Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 8.6 End-of-program markers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 8.7 Tokens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 8.7.1 General desc
16、ription . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 8.7.2 Keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 8.7.3 Identiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 8.7.4 Punctuators . . . . . . . . . . . . . . .
17、. . . . . . . . . . . . . . . . . . . 25 8.7.5 Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 ISO/IEC 2012 All rights reserved iiiISO/IEC 30170:2012(E) 8.7.6 Literals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 8.7.6.1 General de
18、scription . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 8.7.6.2 Numeric literals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 8.7.6.3 String literals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 8.7.6.3.1 General description . . . . . . . . . . . . . .
19、. . . . . . . . . . 29 8.7.6.3.2 Single quoted strings . . . . . . . . . . . . . . . . . . . . . . . 29 8.7.6.3.3 Double quoted strings . . . . . . . . . . . . . . . . . . . . . . . 30 8.7.6.3.4 Quoted non-expanded literal strings . . . . . . . . . . . . . . . 33 8.7.6.3.5 Quoted expanded literal st
20、rings . . . . . . . . . . . . . . . . . 35 8.7.6.3.6 Here documents . . . . . . . . . . . . . . . . . . . . . . . . . . 36 8.7.6.3.7 External command execution . . . . . . . . . . . . . . . . . . . 38 8.7.6.4 Array literals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 8.7.6.5 Reg
21、ular expression literals . . . . . . . . . . . . . . . . . . . . . . . 42 8.7.6.6 Symbol literals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 9 Scope of variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 9.1 General description. . . . . . . . .
22、. . . . . . . . . . . . . . . . . . . . . . . . . 44 9.2 Scope of local variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 9.3 Scope of global variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 10 Program structure . . . . . . . . . . . . . . . . . . .
23、 . . . . . . . . . . . . . . . . . . 45 10.1 Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 10.2 Compound statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 11 Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
24、. . . . . . . . . . . . 47 11.1 General description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 11.2 Logical expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 11.2.1 General description . . . . . . . . . . . . . . . . . . . . . . . . . . . .
- 1.请仔细阅读文档,确保文档完整性,对于不预览、不比对内容而直接下载带来的问题本站不予受理。
- 2.下载的文档,不会出现我们的网址水印。
- 3、该文档所得收入(下载+内容+预览)归上传者、原创作者;如果您是本文档原作者,请点此认领!既往收益都归您。
下载文档到电脑,查找使用更方便
10000 积分 0人已下载
下载 | 加入VIP,交流精品资源 |
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- ISOIEC301702012INFORMATIONTECHNOLOGYPROGRAMMINGLANGUAGESRUBY 信息技术 编程 语言 RUBYPDF

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