ImageVerifierCode 换一换
格式:PDF , 页数:89 ,大小:3.72MB ,
资源ID:798009      下载积分:10000 积分
快捷下载
登录下载
邮箱/手机:
温馨提示:
如需开发票,请勿充值!快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝扫码支付 微信扫码支付   
注意:如需开发票,请勿充值!
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【http://www.mydoc123.com/d-798009.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(ITU-T HDBK IC-1993 Introduction to Chill (Study Group X 89 pp)《冷的介绍 研究组 89pp》.pdf)为本站会员(孙刚)主动上传,麦多课文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知麦多课文库(发送邮件至master@mydoc123.com或直接QQ联系客服),我们立即给予删除!

ITU-T HDBK IC-1993 Introduction to Chill (Study Group X 89 pp)《冷的介绍 研究组 89pp》.pdf

1、 STD-ITU-T HDBK IC-ENGL 1993 111 4B6259L 0682443 446 Ip INTERNATIONAL TELECOMMUNICATION UNION ITU-T TELECOMMUNICATION STANDARDIZATION SECTOR OF ITU INTRODUCTION TO CHILL STDmITU-T HDBK IC-ENGL 1993 9 486259L Ob82444 382 INTERNATIONAL TELECOMMUNICATION UNION ITU-T TELECOMMUNICATION STANDARDIZATION SE

2、CTOR OF TU INTRODUCTION TO CHILL ISBN 92-61 -04891 -9 STD-ITU-T HDBK IC-ENGL 1993 4862593 0682445 219 NOTES 1 As a consequence of a reform process within the International Telecommunication Union (ITU), the CCITT ceased to exist as of 28 February 1993. In its place, the IT Telecommunication Standard

3、ization Sector (ITU-T) was created as of 1 March 1993. Similarly, in this reform process, the CCIR and the IFRB have been replaced by the Radiocommunication Sector. In order not to delay publication of this Introduction, no change has been made in the text to references containing the acronyms “CCIT

4、T, CCIR or IFRB” or their associated entities such as Plenary Assembly, Secretariat, etc. Future editions of this Recommendation will contain the proper terminology related to the new ITU structure. 2 previous 1980 version. This 1993 version of the “Introduction to CHILL” was prepared by IT-T Study

5、Group X, and replaces the O ITU 1993 All rights reserved. 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 the ITU. Contents 1 introduction 2 Lexical Conventions 3

6、 Data 3.1 Mode Definitions . 3.2 Synonym Definitions 3.3 Location Declarations 3.4 Discrete Data . 3.5 Res . 3.6 Powersets 3.7 References 3.8 Procedures 3.9 Strings 3.10 Arrays 3.11 Structures 3.12 Mode Checking . 3.13 Mode Conversions 3.14 Conditional Expressions . 3.15 Operator Precedence . . 4 Ac

7、tions 4.1 Assignment Action 4.2 IfAction . 4.3 CaseAction . 4.4 DoAction 4.5 ExitAction 4.6 GotoAction . 4.7 CaLlAction 4.8 Assert Action 5 Program Structure 5.1 Blocks 5.2 Procedures 5.3 Modulions 5.4 Piecewise Programming . lTU-T . Introduction to CHILL 1 3 4 4 5 6 7 11 Il 12 14 15 17 18 20 21 22

8、23 25 25 26 27 28 32 33 33 34 35 35 36 40 42 i STD-ITU-T HDBK IC-ENGL 2773 4862571 Ob82447 O71 5.5 NameManagement . 45 6 Concurrent Execution 47 6.1 Processes . 47 6.2 Synchronisation . 48 6.3 Communication . 52 7 Time Supervision 56 7.1 Timeoutable Processes 56 7.2 TimingData . 56 7.3 TimingActions

9、 . 57 8 Exception Handling 61 9 Input and Output 64 9.1 FiieHandiing 65 9.2 DataTransfer . 66 9.3 Text Inputloutput 67 References 78 Index 79 11 ITU-T . introduction to CHILL STD-ITU-T HDBK IC-ENGL 1793 48b257L 0682448 T28 Chapter 1 Introduction CHILL is the high-level programming language defined a

10、nd recommended by the International Telegraph and Telephone Consultative Committee (CCITT) for the production of software for telecommunication systems. In 1988, the Intemational Standardization Organization (ISO) and the International Electrotechnical Commission (IEC) adopted CHILL as the internati

11、onal standard ISO/IEC 9496. CHILL was initially designed for the development of stored program control switching systems. However, it has proven to be a general and powerful high-level programming language, being used in many other applications (e.g. suport software), mainly in the fields of private

12、 and public telecommunications. The CCITI”s Recommendation Z.2001, 21 is the definitive reference of the language, providing a complete definition of its features. Although the 2.200 can answer any question concerning the syntax and semantics of the language, being the natural guide for compiler wri

13、ters, its formal and concise style of presentation is inadequate for programmers. The purpose of this document is to provide an overview of the main features of CHILL, by concentrating on their semantics and use, rather than on their syntax and subtle exceptional cases. The reader is not required to

14、 be famiiiar with CHILL, but is supposed to know at least another high-level programming language, such as Pascal3 or C4. The CHILL syntax is not very different from the syntax of those languages and might not be difficult to understand, even without a formal description. The presentation of the lan

15、guage is intended to be self-contained. In case of doubt the reader should consult 2.200. CHILL belongs to a programming language generation which emerged after PU1 5, Algol 686 and Pascal. It Since then, the maintenance and the evolution of this recommendation has been in charge of a CCITT team. Th

16、e team evaluates the feedback supplied by language users and implementors and the decisions made at the previous periods. This has been extremely positive for the language by allowing the continuous improvement of the accuracy of its definition, its readability, and its expressiveness. I was develop

17、ed in parallel with Ada7 in the 70s. The first version of the 2.200 was published by CCIT in 1980. At present, CHILL is one of the most refined high-level programming languages. It implements many of the recent ideas raised in the software engineering field and offers constructs and mechanisms orien

18、ted toward concurrent programming in centralised and distributed systems. Some of these features are outlined below. CHILL stands for QXT - This example defines a synonym for a subrange of integers from 1 to 3 1. Day is called the synrnode name and range (1:3i) the defining mode of the mode definiti

19、on. Day can be used with the same meaning of the defining mode, in any context. In particular, day locations can be assigned to range (i:31) locations and vice-versa. There are two kinds of mode definitions. The one introduced by the reserved word synmode defines synonyms for a given mode. The reser

20、ved word newmode, on the other hand, introduces mode definitions where new modes are defined. This means that the names in a newmode definition are not synonyms, but names of modes that, although sharing the same structure with the defining mode, are incompatible with it. 4 ITU-T - Introduction to C

21、HILL STD-ITU-T HDBK IC-ENGL 1993 48b2591 Ob82452 459 newmode dollar, pound = int; This defines two new modes: dollar and pound. Both of them share the same structure with the defining mode int, inheriting most of the properties of integers. In particular, dollar and pound can be used to index an arr

22、ay, and their values can be arithmetically operated. They cannot be intermingled, however. It is not allowed to assign a pound value to a dollar location, neither to sum a dollar with a pound. Newmode definitions are very useful since they allow the compiler to detect some errors during mode checkin

23、g that a mere structural mode compatibility mechanism would not. Every mode defines the size of the locations associated to it. The built-in routine size applied to a mode delivers the size of its locations in addressable units . 3.2 Synonym Definitions Synonyms (constants) are named values. The nam

24、e defined in a synonym definition can be used in any context in place of the constant value that it represents. The use of synonyms greatly improves program readability and maintainabiiity. syn zero = O, pi = 3.1415; tilde = - , In this example, zero is a synonym denoting the integer value O. Tilde

25、denotes the character value *-, and pi denotes the real value 3.1415. Unlike Pascal-in which only discrete and real values can be named in a constant definition-CHILL allows any value to be named in a synonym definition. syn message = “This is a message. I, OCMS = OCMA* defaultstat = status .fileid:

26、 O, Message is a synonym for a string value, ocrs for an array value, and defaultstat for a structure value. Array and structure values are described by tuples (see sections 3.10 and 3.1 1). It is possible to associate a mode with a synonym. An addressable unit is the smallest chunk of memory a comp

27、uter can address. It is usually a byte, but there are architectures where the addressable units are 16- or 32-bit words. This means that the result of size is implementation dependent. -T - Introduction to CHILL 5 STD-ITU-T HDBK IC-ENGL 1993 1511 4b2591 0682453 395 sl sYn million = f OOOO, milfiondo

28、llars dollar = 1 _OOOOOO; Million is an integer value that can be stored in locations of any mode derived from int. In particular, it can be stored in a dollar location. On the other hand, milliondollars is a dollar value. It can only be stored in aocations with a dollar mode. 3.3 Location Declarati

29、ons A location is a place for storage of values. A location can be accessed for different purposes, such as reading a value, storing a value, or to obtain its address. A location declaration is introduced by the reserved word dcl, followed by a list of names and a description of a mode. Optionally,

30、the locations can be initialised with a value in its declaration. dcl i int, j, k int := O; In this example, i, j, and k are integer locations. Both j and k are initialised with O. The initial value of i is undefined. This simple kind of location declaration creates new locations. A loc-identity dec

31、laration is different in that it creates new accesses to locations declared elsewhere. dcl table array (f:f) int, element int loc := rable(25 -t i); In the example above the loc-identity location element is a new access name for the array element denoted by table(2-5 -+ i). Note that i can be any in

32、teger location. In particular, it can be a procedure parameter. This means that element can access different elements of table in different procedure activations. A mode can have the read-only property, meaning that all locations assigned to it must be initialised in their declarations, but not modi

33、fied later on. Such modes are commonly used in loc-identity declarations. In fact, one can create a read-only access to a read-write location by declaring a read-only loc-identity refemng to it. dcl i int, ir read int loc := i; In this example, the contents of i can be read but not modified through

34、the loc-identity ir. If i is declared inside a module, its contents can be made accessible outside the module boundaries by granting the loc-identity ir. This way, the module implementor is protected against modifications made by others to its private data. 6 U-T - Introduction to CHILL STDmITU-T HD

35、BK IC-ENGL 1993 4862593 Ob82454 223 M CHILL does not impose any restriction on the order in which the data in a program are defined or declared. in particular, a mode name can be used in a location declaration before its definition. This flexibility can be used to make the program clearer by groupin

36、g related mode definitions and ordering them from the most complex to the most simple. As an example, the following Pascal program extract defines a data structure to describe a list of persons. const N = 100; tY Pe agemode = O 130; person = record name: packed array O 791 of char; nameength: O 80;

37、age: agemode; person-list = array O IV of person; end; var group: person-list; The largest data of this passage is the variable group, since it is the list. However, one have to skim all other definitions until find it. A clear bottom-up approach. The same data structure, defined in CHILL, could tak

38、e advantage of its greater flexibiiity to emphasise what is largest in a more hierarchical order. dcl group personlist; newmode personist = array (0:N) person; newmode person = struct (name chars (80) varying, age age-mode); synmode agemode = range (0:130); This way, the reader is presented first to

39、 the big picture. The details can be found later, if needed. 3.4 Discrete Data Discrete data are values and locations associated with discrete modes. Discrete modes define finite sets of weli ordered values. Each discrete value has an internal representation denoted by an integer value. The order of

40、 the 7 ITU-T - introduction to CHILL STD*ITU-T HDBK IC-ENGL 3993 W 4862593 0682455 Lb8 W values is based on the order of their internal representations. CHILL has a set of predefined discrete modes: integers, booleans, characters, sets, and ranges thereof. Discrete data can be operated upon in many

41、ways to construct expressions. In particular, any pair of discrete data of the same mode can be compared by means of relational operators (=, /= , , =, .val /= O; od; p := p- .next; This loop implements the basic algorithm of a hear search through a linked list. The expression controlling the loop c

42、hecks if p has not reached the end of the list (p /= null) and if the element pointed to by p is not the target of the search - .val /= O). Note that, ifp is null it cannot be dereferenced (p- .val). The andif operator evaluates first its left operand. Only if it is true the second operand is evalua

43、ted. If we had used the operator and instead, we couldnt be sure either of the order of evaluation or if all operands would, indeed, be evaluated. Characters The character mode defines a sequence of 256 character values. Actually, the character set of CHILL is an extension of the CCIT Alphabet No.5,

44、 International Reference Version, Recommendation V3. The first 128 values are the same as defined by the ASCII standard. The name char is predefined as the character mode name. For ail printable characters but the circumflex (*), the corresponding character literal can be simply the printable repres

45、entation of it enclosed in apostrophes. For example, a, O, (space), and ” (a single apostrophe). A control sequence is a way of representing any character, even the non-printable ones, so that it is possible to construct character literals for any character value. In its most general form, it consis

46、ts of a circumflex followed by a constant integer expression in parenthesis, denoting the internai representation of the character. (That is why the circumflex is not allowed to appear in a simple printable representation.) Enclosing a control sequence in apostrophes we can construct character liter

47、als for any character. *(O) - the character NUL * (255) *(32) - - the character which code is 255 - the same as (space) A circumflex followed by a printable character is a control sequence denoting the character value obtained by negating the 7* bit of its internal representation. It is commonly use

48、d as a more readable notation for the special characters in the range O: 3 1. * *A * M - the same as -(O) - the same as *() - the same as * (1 3) , which is the CR character - the same as * (127)” which is the DEL charactex r 3 Finaliy, there is a special way to denote the circumflex itself. - - whi

49、ch is the same as * (94) . ,A*, -T - Introduction to CHILL 9 STD-ITU-T HDBK IC-ENGL 1993 48b2591 Ob82457 T30 Sets A set mode (enumeration type) defines a set of values that can be used to represent non-numeric (symbolic) quantities. A set mode is described by the reserved word set followed by a list of value names enclosed in parenthesis. newmode colour = set (red, green, blue, yellow); Colour defines four named values. The internal representation of red is O, green is 1, blue is 2, and

copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
备案/许可证编号:苏ICP备17064731号-1