ANSI-INCITS-113-1987-R2003.pdf

上传人:爱问知识人 文档编号:3730064 上传时间:2019-09-22 格式:PDF 页数:377 大小:17.06MB
返回 下载 相关 举报
ANSI-INCITS-113-1987-R2003.pdf_第1页
第1页 / 共377页
ANSI-INCITS-113-1987-R2003.pdf_第2页
第2页 / 共377页
ANSI-INCITS-113-1987-R2003.pdf_第3页
第3页 / 共377页
ANSI-INCITS-113-1987-R2003.pdf_第4页
第4页 / 共377页
ANSI-INCITS-113-1987-R2003.pdf_第5页
第5页 / 共377页
亲,该文档总共377页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述

《ANSI-INCITS-113-1987-R2003.pdf》由会员分享,可在线阅读,更多相关《ANSI-INCITS-113-1987-R2003.pdf(377页珍藏版)》请在三一文库上搜索。

1、for Informations Systems - Programming Languages - Modules and Individual Character kNSI INCITS 113a-1989 (R2003) (formerly ANSI X3.113a-1989 (R1998): for Full Basic Input Developed by Where IT all begins Copyright American National Standards Institute Provided by IHS under license with ANSI License

2、e=IHS Employees/1111111001, User=OConnor, Maurice Not for Resale, 04/29/2007 07:00:12 MDTNo reproduction or networking permitted without license from IHS -,-,- ANSI X3.113a-1989 Supplement to ANSI X3 113-1 989 I American National Standard I for information systems - programming languages - modules a

3、nd individual character input for full BASIC Approved July 26,1989 Secretariat: Computer and Business Equipment Manufacturers Association Page 1 of 14 pages 1 . Introduction This Addendum is designed to promote the interchangeability of BASIC programs among a variety of automatic for example, a modu

4、le may provide for additional mathematical functions from which programs may access the ones needed and ignore the rest. Finally, modules could be used to add functional enhancements to BASIC; for example, a full GKS binding could be pro- vided to BASIC using modules. 18.2 Syntax 1. program 2. modul

5、e-part 3. module-def program-name-line? main-program = remark-line* module-def = module-line module-header procedure-part* (procedure-part I module-part)* remark-line* end-module-line ANSI X3.113a-1989 Copyright American National Standards Institute Provided by IHS under license with ANSI Licensee=I

6、HS Employees/1111111001, User=OConnor, Maurice Not for Resale, 04/29/2007 07:00:12 MDTNo reproduction or networking permitted without license from IHS -,-,- Page 6 of 14 pages 4. module-line 5. module-statement 6. module-name 7. module-header 8. module-header-line 9. public-line 10. public-statement

7、 11. global-type 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. function-type sub-type picture-type share-line share-statement channel-type channel-list module-option-line module-option-statement end-module-line end-module-statement type-declaration external-share-type 25. qualifred-id-list 26.

8、 qualifred-id 27. numeric-identifier 28. string-identifier 29. subprogram-name 30. picture-name 31. line 32. declaration-line 33. dim-line line-number module-statement tait MODULE module-name routine-identifier (remark-line I public-line)* (remark-line I share-line)* module-header-line* remark-line

9、I declaration-line I dim-line I module-option-line I block line-number public-statement tail PUBLIC global-type nweric-type I string-type l function-type I sub-type I picture-type ECTNCTION function-list PICRE picture-name-list line-number share-statement tail SHARE (global-type I channel-type) CHAN

10、NEL channel-list channel-number ( comma channel-number )* line-number module-option-statement tail MODULE option-statement line-number end-moduk-statement tail END MODULE external-share-type EXTERNAL (FUNCTION / SUB / PICTURE / NUMERIC / STRING) qualifred-id-list qualifred-id (comma qualifred-id)* m

11、odule-name period (defrned-junction I routine-identifier I simple-nwneric-variable I simple-string-variable I formal-array) module-name period letter identifrer-character* module-name period letter identifrer-characte fl dollar-sign module-name period routine-identifier module-name period routine-id

12、entifrer public-line I share-line I module-line I module-option-line I module-header-line I end-module-line I dim-line I declaration-line line-number declaration-statement tail line-number dim-statement tail SUB sub-list A given identijer shall not appear more than once in the union of the public-st

13、atements, share-statements, declare-statements with the numeric-type, and the dimension-statements i n the module-header of a given module- def. A given identijer shall not appear more than once in the union of the public-statements, share-statements, declare-statements with the string-type, and the

14、 dimension-statements i n the module-header of a given module-def. A given identifier shall not appear more than once in the union of the public-statements, share-statements, and declare-statements with the function-type i n the module-header of a given module-def. A given identifier shall not appea

15、r more than once in the union of the public-statements, share-statements, and declare-statements with the sub-type in the module-header of a given module-def. ANSI X3.113a-1989 Copyright American National Standards Institute Provided by IHS under license with ANSI Licensee=IHS Employees/1111111001,

16、User=OConnor, Maurice Not for Resale, 04/29/2007 07:00:12 MDTNo reproduction or networking permitted without license from IHS -,-,- Page 7 of 14 pages A given identijer shall not appear more than once in the union of the public-statements, share-statements, and declare-statements with the picture-ty

17、pe i n the module-header of a given module-def. A given channel-number shall not appear more than once in the union of the share-statements with the channel- type in the module-header of a given module-def. An identifier that appears in apublic-statement of a given module-def shall not also appear i

18、n an external-share- type in that module-def. A variable or routine whose identifier appears in apublic-statement shall be accessible: from the main-program, or from any external-proc-def, or from any other module-def associated with the muin-program, provided that such main-program, external-proc-d

19、efs, or other associated module-defS shall contain a declare-statement with an external-shure-type containing a reference o that variable or routine. A variable or routine whose identifier appears in a public-statement or shure-statement shall be accessible from within the module-de$ including the m

20、odule-header and all external-proc-defs in the module-de5 without further declaration. A channel-number that appears in a share-statement shall be accessible from within the module-de$ including t h e module-header and all external-proc-defs in the module-def. A variable whose identifier, or a chann

21、el whose channel-number does not appear in either apublic-statement or share-statement shall be accessible only from within the module-header. A module-header shall contain at most one ANGLE option, at most one ARITHMETIC option, at most one COLLATE option, and at most one BASE option. I f a module-

22、header contains a MODULE OPTION statement of a given type, then no OPTION statement of that type may appear in the module-header or in any external-procedure in that module-def. I f an external-procedure i n a module-def accesses a numeric share-identifier orpublic-identifier i n that module- def, t

23、hen the ARITHMETIC options of that external-procedure and the module-header shall be the same. I f an external-procedure in a module-def accesses a string share-identifier or public-identifier in that module-def, then the COLLATE options of that external-procedure and the module-header shall be the

24、same. A qualifred-id appearing in an external-share-type containing the keyword FUNCIION shall contain a dejned- function that refers to a defined-function that appears in apublic-statement in the module-def named in the qualijied-id. A qualified-id appearing in an external-share-type containing the

25、 keyword SUB shall contain a routine-identijer that refers to a subprogram-name that appears in apublic-statement in the module-def named in the qualified-id. A qualified-id appearing in an external-share-type containing the keyword PICTURE sha contain a routine- identijer that refers to apicture-na

26、me that appears in a public-statement in the module-defnamed in the qualified-id. A qualified-id appearing in an external-share-type containing the keyword NUMERIC shall contain a simple- numeric-variable or numeric formal-array that refers to a simple-numeric-variable or numeric array-name that app

27、ears i n apublic-statement in the module-def named in the qualified-id. A qualifred-id appearing i n an external-share-type containing the keyword STRING shall contain a simple- string-variable or string formal-array that refers to a simple-string-variable or string array-name that appears in a publ

28、ic-statement in the module-def named in the qualified-id. i ANSI X3.113a-1989 Copyright American National Standards Institute Provided by IHS under license with ANSI Licensee=IHS Employees/1111111001, User=OConnor, Maurice Not for Resale, 04/29/2007 07:00:12 MDTNo reproduction or networking permitte

29、d without license from IHS -,-,- Page 8 of 14 pages A qualified-id shall appear in an external-share-type in every program-unit in which the conesponding defined- function, subprogram-name, picture-name, numeric-identifier, or string-identifier is to be used. When not otherwise ambiguous, the module

30、-name and period of a qualified-id appearing in a external-share-type may be omitted in sub- sequent uses of the corresponding defined-function, subprogram-name, picture-name, nwneric-identifier, or string- identifier in a program-unit. The external-share-type containing the qualified-id shall occur

31、 in a lower-numbered line than any other reference to that identifier in aprogram-unit. A qualified-id that contains a formal-array shall be subsequently referred to using the Corresponding array-name (i.e., without the empty parentheses) in place of the formal-array. 183 Examples 2. (First example)

32、 1000 MODULE stack 1020 PUBLIC FNCTION isempty$, isfull$ 1030 SHARE SUB inc, dec 1040 1050 LET maxdepth = 100 1060 LET pointer = O 1070 1080 EXTERNAL SUB inc (x) 1090 LETx=x+l 1100 ENDSUB 1110 ! 1120 EXTERNAL SUB dec (x) 1130 LETX=X-l 1140 ENDSUB 1150 ! 1160 EXTERNAL SUB push (item) 1170 IF pointer

33、= maxdepth then ,_- 2. (Second example) 1000 MODULE Common 1010 1020 PUBLIC STRING a.$ 1030 LET x,y,z = O 1040 LET a$ = “* 1050 END MODULE 23. EXTERNAL NU?vjERIC common.x, comrnon.y, common.z PUBLIC NUMERIC x, y, z EXTERNAL STRING common.a$ EXTERNAL SUB stack.push, stack.pop EXTERNAL FUNCTION stack.

34、isfull$, stackisempty$ 18.4 Semantics Variables declared in public-statements, share-statements, dimension-statements, or declare-statements (other t h a n declare-statements with external-share-type), and simple-Variables appearing in the module-header shall be assigned, at program startup, impleme

35、ntation-defined values consistent with the policies of the implementation. The blocks contained in the module-header shall be executed before any procedure or variable whose name appears i n the public-statements of the module-header are accessed. Such blocks shall be executed at most once during th

36、e run of the program. Where the effect of statements at initialization may depend on the order of initialization of two or more modules in a program, as may occur with call-statements and function references (e.g., to RND), those effects are implementationdehed. Variables and arrays appearing in the

37、 share-statements of the module-header shall have their values preserved between invocations of the procedures contained in the module-def. Variables declared in the public-statements of t h e module-header shall remain in existence between invocations of the procedures contained in the module-dtf,

38、but may have their values changed inasmuch as they are accessible from outside the module-def. . Channels whose numben appear in the share-statements of the module-header shall have their status preserved between invocations of the procedures within the module-def. That is, if the channel refers to

39、an opened fie, then that channel shall remain opened until specrfically closed as a result of an action of an external-procedure contained in that module-dtf. Procedures within module-deji are external-procedures with respect to the scope o f local variables and channels used within such procedures

40、but not appearing as formal-parameters, except that a i l variables and channels appear- ing in public-statements or share-statements in the same module shaii be accessible from within such procedures. The scope of an OIWON that is not a MODULE OPTION is the external-procedure in which it i s found,

41、 or, if it is in the module-header, the scope is the module-header. The scope of a MODULE OPTION is the entire module, including the module-header and all the external- procedures contained in the module- their existence does not in any respect preclude anyone, whether he has approved the standards

42、or not, from manufacturing, marketing, purchasing, or using products, processes, or procedures not conforming to the standards. The American National Standards Institute does not develop standards and will in no circumstances give an interpretation of any American National Standard. Moreover, no per

43、son shall have the right or authority to issue an interpretation of an American National Standard in the name of the American National Standards Institute. Requests for interpretations should be addressed to the secretariat or sponsor whose name appears on the title page of this standard. CAUTION NO

44、TICE: This American National Standard may be revised or withdrawn at any time. The procedures of the American National Standards Institute require that action be taken periodically to reaffirm, revise, or withdraw this standard. Purchasers of American National Standards may receive current informati

45、on on all standards by calling or writing the American National Standards Institute. American National Published by American National Standards Institute 11 West 42nd Street, New York, New York 10036 Copyright O1 987 by Information Technology Industry Council (ITI) All rights reserved. No part of th

46、is publication may be reproduced in any form, in an electronic retrieval system or otherwise, without prior written permission of ITI, 1250 Eye Street NW, Washington, DC 20005. Printed in the United States of America Copyright American National Standards Institute Provided by IHS under license with

47、ANSI Licensee=IHS Employees/1111111001, User=OConnor, Maurice Not for Resale, 04/29/2007 07:00:12 MDTNo reproduction or networking permitted without license from IHS -,-,- ANSI X3.113-1987 American National Standard for Information Systems - Programming Languages - Full BASIC Secretariat Computer an

48、d Business Equipment Manufacturers Association Approved January 28, 1987 American National Standards Institute, Inc Abstract This standard presents the form for and the interpretation of programs written in the BASIC program- ming language for use on computers and information processing systems. Cop

49、yright American National Standards Institute Provided by IHS under license with ANSI Licensee=IHS Employees/1111111001, User=OConnor, Maurice Not for Resale, 04/29/2007 07:00:12 MDTNo reproduction or networking permitted without license from IHS -,-,- (This Foneword is not part of American National Standard X3.113-1987.

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 其他


经营许可证编号:宁ICP备18001539号-1