说明:收录全球国际标准 提供单次或批量下载
INTERNATIONAL ISO/IEC STANDARD 30170 First edition 2012-04-15 Information technology Programming languages Ruby Technologies de I'information Langages de programmation - Ruby Reference number ISO/IEC 30170:2012(E) IEC So @ISO/IEC2012 py IHS under lic ted without license from IHS Not for Resale ISO/IEC 30170:2012(E) COPYRIGHTPROTECTEDDOCUMENT ISO/IEC2012 IsO's memberbody in the country of the requester. ISO copyright office Case postale 56 : CH-1211 Geneva 20 Tel. + 41 22 749 01 11 Fax + 41 22 749 09 47 E-mail [email protected] Web www.iso.org Published in Switzerland ISO/IEC2012-Allrightsreserved y IHS unde nited without license from IHS Not for Resale ISO/IEC 30170:2012(E) Contents Page 1 Scope 1 2 Normative references 1 3 Conformance 1 4 Terms and definitions 2 5 Notational conventions 4 5.1 General description 4 5.2 Syntax . 4 5.2.1 General description 4 5.2.2 Productions . 5 5.2.3 Syntactic term sequences 6 5.2.4 Syntactic terms 5.2.5 Conceptual names 10 5.3 Semantics 10 5.4 Attributes of execution contexts 11 6 Fundamental concepts 12 6.1 Objects 12 6.2 Variables 12 6.2.1 General description 12 6.2.2 Instance variables 13 6.3 Methods . 13 6.4 Blocks 14 6.5 Classes, singleton classes, and modules 14 6.5.1 General description 14 6.5.2 Classes 14 6.5.3 Singleton classes 15 6.5.4 Inheritance 16 6.5.5 Modules 17 6.6 Boolean values 18 7 Execution contexts 18 7.1 General description 18 7.2 The initial state 19 8 Lexical structure 19 8.1 General description 19 8.2 Program text 20 8.3 Line terminators 20 8.4 Whitespace 21 8.5 Comments 22 8.6 End-of-program markers 23 8.7 Tokens 23 8.7.1 General description 23 8.7.2 Keywords 23 8.7.3 Identifiers 24 8.7.4 Punctuators 25 8.7.5 Operators 25 @ISO/IEC 2012 All rights reserved ii t license from IHS Not for Resale ISO/IEC 30170:2012(E) 8.7.6 Literals 26 8.7.6.1 General description 26 8.7.6.2 Numeric literals 26 8.7.6.3 String literals 29 8.7.6.3.1 General description 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 strings 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 Regular expression literals 42 8.7.6.6 Symbol literals 43 9 Scope of variables 44 9.1 General description 44 9.2 Scope of local variables 44 9.3 Scope of global variables 45 10 Program structure 45 10.1 Program 45 10.2 Compound statement 46 11 Expressions 47 11.1 General description 47 11.2 Logical expressions 47 11.2.1 General description 47 11.2.2 Logical NOT expressions 48 11.2.3 Logical AND expressions 49 11.2.4 Logical OR expressions 49 11.3 Method invocation expressions 50 11.3.1 General description 50 11.3.2 Method arguments 55 11.3.3 Blocks . 58 11.3.4 The super expression 61 11.3.5 The yield expression 64 11.4 Operator expressions . 65 11.4.1 General description 65 11.4.2 Assignments 66 11.4.2.1 General description 66 11.4.2.2 Single assignments 66 11.4.2.2.1 General description 66 11.4.2.2.2 Single variable assignments 67 11.4.2.2.3 Scoped constant assignments 69 11.4.2.2.4 Single indexing assignments . 69 11.4.2.2.5 Single method assignments 70 11.4.2.3 Abbreviated assignments 71 11.4.2.3.1 General description 71 11.4.2.3.2 Abbreviated variable assignments 71 11.4.2.3.3 Abbreviated indexing assignments 72 11.4.2.3.4 Abbreviated method assignments 73 11.4.2.4 Multiple assignments 74 iv @ISO/IEC 2012 All rights reserved Copyright International Organization for Standardization emitted without license from IHS Not for Resale ISO/IEC 30170:2012(E) 11.4.2.5 Assignments with rescue modifiers 78 11.4.3 Unary operator expressions 78 11.4.3.1 General description 78 11.4.3.2 The defined? expression 79 11.4.4 Binary operator expressions 81 11.5 Primary expressions 84 11.5.1 General description 84 11.5.2 Control structures 85 11.5.2.1 General description 85 11.5.2.2 Conditional expressions 85 11.5.2.2.1 General description 85 11.5.2.2.2 The if expr

.pdf文档 ISO IEC 30170 2012 Information technology — Programming languages — Ruby

文档预览
中文文档 5 页 50 下载 1000 浏览 0 评论 309 收藏 3.0分
温馨提示:本文档共5页,可预览 3 页,如浏览全部内容或当前文档出现乱码,可开通会员下载原始文档
ISO IEC 30170 2012 Information technology — Programming languages — Ruby 第 1 页 ISO IEC 30170 2012 Information technology — Programming languages — Ruby 第 2 页 ISO IEC 30170 2012 Information technology — Programming languages — Ruby 第 3 页
下载文档到电脑,方便使用
本文档由 人生无常 于 2026-01-05 23:12:27上传分享
友情链接
站内资源均来自网友分享或网络收集整理,若无意中侵犯到您的权利,敬请联系我们微信(点击查看客服),我们将及时删除相关资源。