Ағылшыншамен салыстырыңыз: абзацты басыңыз — түпнұсқа терезеде ашылады. Абзац астындағы EN түймесі оны мәтін ішінде көрсетеді.
Мазмұны
Кіріспе
1960 жылдардағы компьютерлік бағдарламалау тілі
1960s computer programming language
Atlas Autocode (AA) – 1963 жыл шамасында Манчестер университетінде жасалған бағдарламалау тілі. ALGOL тілінің бір түрі ретінде, ол Тони Брукер мен Деррик Моррис Atlas компьютері үшін әзірленді. Алғашқы AA және AB компиляторларын Джефф Ролл мен Тони Брукер Brooker Morris Compiler компиляторын пайдаланып жазды, ал кейін Джефф Ролл CC қолданбаған (ABC) нұсқасын жасады. Autocode сөзі, негізінен, бағдарламалау тілі үшін қолданылған алғашқы термин еді. Әртүрлі автокодтар бір-бірінен айқын түрде ерекшеленуі мүмкін.
Atlas Autocode (AA) is a programming language developed around 1963 at the University of Manchester. A variant of the language ALGOL, it was developed by Tony Brooker and Derrick Morris for the Atlas computer. The initial AA and AB compilers were written by Jeff Rohl and Tony Brooker using the Brooker Morris Compiler compiler, with a later hand coded non CC implementation (ABC) by Jeff Rohl. The word Autocode was basically an early term for programming language. Different autocodes could vary greatly.
Ерекшеліктері
АА – бұл блок құрылымды тіл, онда нақты типтелген айнымалылар, кіші программалар және функциялар болған. Ол ALGOL-дың кейбір мүмкіндіктерін, мысалы, ALGOL 60-та параметрлерді атау арқылы жіберуді қалдырды, бұл параметр әр еске алынған сайын қайта есептеу үшін қысқа кіші программаның (thunk) жад мекенжайын жіберуді білдіреді. АА компиляторы массивтерге қол жеткенде ауқымдық тексеруді жүзеге асыра алатын, сондай-ақ массивтің өлшемдері орындалу кезінде анықталуына мүмкіндік беретін. Яғни, массивді бүтін сандық массив ретінде жариялауға болады. АА жоғары деңгейлі кіші программалары машиналық кодты қамтуы мүмкін, ішкі циклды тиімді ету үшін немесе басқа жағдайда орындау қиын операцияларды жүзеге асыру үшін. АА күрделі сандарды бейнелеу үшін күрделі дерек типін қосты, ішінара электр инженерлік факультетінің талабы бойынша, себебі күрделі сандар айнымалы ток мінез-құлқын бейнелеу үшін қолданылады. 1-дің түбірлік дәрежесін білдіретін жолғаны i арқылы бейнеленген, ол тұрақты күрделі шама ретінде қарастырылды = i. Күрделі дерек типі кейіннен Атлас Автокоды IMP тіліне дамығанда алынып тасталды. IMP – АА-ның кеңейтілген нұсқасы және Эдинбург көп қол жеткімелі жүйесінің (EMAS) операциялық жүйесін жазу үшін қолданылды. АА-ның екінші маңызды жетістігі (IMP және EMAS-тың бастапқы тілі болғаннан кейін) – оның түпнұсқалық компилятордың көптеген мүмкіндіктеріне ие болғаны. АА компиляторының бір түрі жоғарыдан төменге рекурсивті түсу парсеріне орындалу уақыты қолдауын қамтыды. Компиляторда қолданылған парсер стилі 60-шы жылдардан бастап 2000-шы жылға дейін Эдинбургте үздіксіз қолданылып келді. Басқа Автокодтар Titan компьютері, Кембридждегі Atlas 2 прототипі және Ferranti Mercury үшін әзірленді.
AA was a block structured language that featured explicitly typed variables, subroutines, and functions. It omitted some ALGOL features such as passing parameters by name, which in ALGOL 60 means passing the memory address of a short subroutine (a thunk) to recalculate a parameter each time it is mentioned. The AA compiler could generate range checking for array accesses, and allowed an array to have dimensions that were determined at runtime, i. e., an array could be declared as integer array Thing (i:j), where i and j were calculated values. AA high level routines could include machine code, either to make an inner loop more efficient or to effect some operation which otherwise cannot be done easily. AA included a complex data type to represent complex numbers, partly because of pressure from the electrical engineering department, as complex numbers are used to represent the behavior of alternating current. The imaginary unit square root of 1 was represented by i, which was treated as a fixed complex constant = i. The complex data type was dropped when Atlas Autocode later evolved into the language Edinburgh IMP. IMP was an extension of AA and was used to write the Edinburgh Multiple Access System (EMAS) operating system. AA's second greatest claim to fame (after being the progenitor of IMP and EMAS) was that it had many of the features of the original Compiler Compiler. A variant of the AA compiler included run time support for a top down recursive descent parser. The style of parser used in the Compiler Compiler was in use continuously at Edinburgh from the 60's until almost the year 2000. Other Autocodes were developed for the Titan computer, a prototype Atlas 2 at Cambridge, and the Ferranti Mercury.
Синтаксисі
Atlas Autocode синтаксисі ALGOL-ге ұқсас болды, бірақ оған автордың Friden Flexowriter деп аталатын шығыс құрылғысының әсері тиді. Осылайша, ол 1⁄2 сияқты символдарды 0,5 ретінде және 2-нің дәрежесін 2 деп жазуға мүмкіндік берді. Мысалы, таңбалар жиынтығында ↑ символы болмағандықтан, экспоненциалдау | және * символдарын біріктіріп жазу арқылы жүзеге асырылды. Жоғарыда аталған кілт сөздердің астын сызуды да үстіне сызу арқылы жасауға болады. Бұл тіл Atlas Autocode Reference Manual нұсқаулығында егжей-тегжейлі сипатталған. АА-да қолданылған басқа Flexowriter таңбалары: α – қалқыма нүктелі сандарда, мысалы, қазіргі 3.56e 7 үшін 3.56α 7; β – 48 биттік Atlas жад сөзінің екінші жартысын білдіреді; π – математикалық тұрақты пи үшін. АА ағылшын Electric KDF9 компьютеріне көшірілгенде, таңбалар жиыны Халықаралық стандарттау ұйымының (ISO) стандартына ауыстырылды. Бұл компиляторды Эдинбург компьютерлік тарихы жобасы ескі қағаз таспадан қалпына келтірді және ол онлайн режимінде қолжетімді, сондай-ақ Atlas Autocode нұсқаулығының Эдинбург нұсқасының жоғары сапалы сканерленген нұсқасы бар. АА-дағы кілт сөздер басқа мәтіннен үстіне сызық жүргізу арқылы ерекшеленетін, бұл Flexowriter-дегі қалың әріппен (ALGOL-дегідей) салыстырылады. Сонымен қатар, екі түрлі «атап көрсету» режимі болды. Біріншіден, «үлкен әріптерді шектеу» режимінде жолдардың ішіндегі барлық үлкен әріптер астын сызылған кішкентай әріптер ретінде қарастырылды. Екіншіден, кейбір нұсқаларда (бірақ түпнұсқалық Atlas нұсқасында емес) кілт сөздердің алдына "%" белгісін қою арқылы оларды «атап көрсетуге» болады, мысалы, «бағдарламаның соңы» кілт сөзін %end %of %programme немесе %endofprogramme деп жазуға болады. Бұл жазуды едәуір жеңілдетті, өйткені кілт сөздің барлығын үстіне сызудың орнына тек бір таңбаны қажет етті. ALGOL-дегідей, тілде де сақталған сөздер болған жоқ, өйткені кілт сөздер сақталған таңбалар тізбесін тану арқылы емес, астын сызу (немесе «атап көрсету») арқылы анықталды. If token=if then result = token деген жазбада if деген кілт сөз де, if деп аталатын айнымалы да бар. ALGOL-дегідей, AA-да айнымалы атауларында бос орындарға рұқсат етілді, мысалы, previous value integer. Бос орындар маңызды емес еді және «жолдарды қайта құру» деп аталатын қарапайым лексикалық алдын ала талдау кезеңінде талдаудан бұрын алынып тасталды. Компилятор жоғарыдағы мысалда «iftoken=ifthenresult=token» деп көрер еді. Бос орындардың болуына себеп, кілт сөздер басқа тәсілдермен ажыратылатындығы және деректер көзі лексикалық фазасыз, сканнерсіз талдау арқылы өңделгендігі болды, бұл лексикалық синтаксистің контекстке сезімтал болуына мүмкіндік берді. Өрнектер үшін синтаксис көбейту операторын жіберуге мүмкіндік берді, мысалы, 3a 3*a ретінде қарастырылды, ал a(i+j) a*(i+j) ретінде қарастырылды, егер a массив болмаса. Екіұшты жағдайларда мүмкіндігінше ең ұзын атау қолданылды (максималды сәйкестік), мысалы, ab a*b ретінде қарастырылмады, a және b мәлімделген немесе мәлімделмеген.
Atlas Autocode's syntax was largely similar to ALGOL, though it was influenced by the output device which the author had available, a Friden Flexowriter. Thus, it allowed symbols like ½ for .5 and the superscript 2 for to the power of 2. The Flexowriter supported overstriking and thus, AA did also: up to three characters could be overstruck as a single symbol. For example, the character set had no ↑ symbol, so exponentiation was an overstrike of | and *. The aforementioned underlining of reserved words (keywords) could also be done using overstriking. The language is described in detail in the Atlas Autocode Reference Manual. Other Flexowriter characters that were found a use in AA were: α in floating point numbers, e. g., 3.56α 7 for modern 3.56e 7 ; β to mean the second half of a 48 bit Atlas memory word; π for the mathematical constant pi. When AA was ported to the English Electric KDF9 computer, the character set was changed to International Organization for Standardization (ISO). That compiler has been recovered from an old paper tape by the Edinburgh Computer History Project and is available online, as is a high quality scan of the original Edinburgh version of the Atlas Autocode manual. Keywords in AA were distinguishable from other text by being underlined, which was implemented via overstrike in the Flexowriter (compare to bold in ALGOL). There were also two stropping regimes. First, there was an "uppercasedelimiters" mode where all uppercase letters (outside strings) were treated as underlined lowercase. Second, in some versions (but not in the original Atlas version), it was possible to strop keywords by placing a "%" sign in front of them, for example the keyword endofprogramme could be typed as %end %of %programme or %endofprogramme. This significantly reduced typing, due to only needing one character, rather than overstriking the whole keyword. As in ALGOL, there were no reserved words in the language as keywords were identified by underlining (or stropping), not by recognising reserved character sequences. In the statement if token=if then result = token, there is both a keyword if and a variable named if. As in ALGOL, AA allowed spaces in variable names, such as integer previous value. Spaces were not significant and were removed before parsing in a trivial pre lexing stage called "line reconstruction". What the compiler would see in the above example would be "iftoken=ifthenresult=token". Spaces were possible due partly to keywords being distinguished in other ways, and partly because the source was processed by scannerless parsing, without a separate lexing phase, which allowed the lexical syntax to be context sensitive. The syntax for expressions let the multiplication operator be omitted, e. g., 3a was treated as 3*a, and a(i+j) was treated as a*(i+j) if a was not an array. In ambiguous uses, the longest possible name was taken (maximal munch), for example ab was not treated as a*b, whether or not a and b had been declared.