SU1387018A1 - Programming language translator - Google Patents
Programming language translator Download PDFInfo
- Publication number
- SU1387018A1 SU1387018A1 SU7772150A SU7772150A SU1387018A1 SU 1387018 A1 SU1387018 A1 SU 1387018A1 SU 7772150 A SU7772150 A SU 7772150A SU 7772150 A SU7772150 A SU 7772150A SU 1387018 A1 SU1387018 A1 SU 1387018A1
- Authority
- SU
- USSR - Soviet Union
- Prior art keywords
- counter
- input
- output
- inputs
- register
- Prior art date
Links
Landscapes
- Executing Machine-Instructions (AREA)
Description
(89) BG 33401/BG 46425/31.01.80 148) 30.09.80(89) BG 33401 / BG 46425 / 31.01.80 148) 30.09.80
(21)7772150/24-24(21) 7772150 / 24-24
(22)12.11.81(22) 12.11.81
(46 P7.04.88. Бюл. №.13 (71) ВМЕИ Ленин (BG) (.72) Бонн Янков Янков и Лил н Илиев Николов (BG)(46 P7.04.88. Bull. No. 13 (71) SMEHES Lenin (BG) (.72) Bonn Yankov Yankov and Lil n Iliev Nikolov (BG)
(53)68J.325 (088.8)(53) 68J.325 (088.8)
(54)ТРАНСЛЯТОР ЯЗЬЖОВ-ПРОГРА 1МИРО- ВАНИЯ(54) LANGUAGE TRANSLATOR PROGRAM 1 WORLDWIDE
(57) Изобретение относитс к вычислительной технике и предназначена дл аппаратной трансл ции зыков программировани . Цель изобретени - расширение функциональных возможностей трансл тора за счет транслировани различных зыков произвольной конструкции. Трансл тор содержит блок 1 микропрограммного управлени , входной и вьходной счетчики(57) The invention relates to computing and is intended for hardware translation of programming languages. The purpose of the invention is to expand the functionality of a translator by translating various languages of an arbitrary design. The transmitter contains block 1 of firmware control, input and input counters.
а мгг аа малa mgg aa small
РО- Ro-
чеков и - лильравкиchecks and - lilravki
3S3S
3, 4, счетчик 5 адреса текущего символа , блок 6 оперативной пам ти текущего символа, счетчик 9 внутренней метки, счетчик 10 промежуточного результата , реверсивные счетчики операндов 13 и операторов 17, регистр 20 адреса, блок 7 посто нной пам ти пра-- вил трансл ции, счетчик 8 адреса правила трансл ции, блок регистров стековой пам ти операндов 11 и операторов 15, блоки стековой пам ти операндов 12 и операторов 16, мультиплексор операндов 14, дешифратор 18 операторов, блок 19 посто нной пам ти функции предшестви , два регистра 21, 22 функции предшестви , схему 23 сравнени и регистр 24 текущего символа. Обмен между блоками осуществл етс через шину 2 данных по соотве тствующим управл ющим сигналам блока 1. 6 ил.3, 4, counter 5 of the address of the current character, block 6 of the operative memory of the current symbol, counter 9 of the internal label, counter 10 of the intermediate result, reversible counter of the operands 13 and operators 17, register 20 of the address, block 7 of the fixed memory of the rule translation, counter 8 addresses of the translation rule, block of registers of stack memory of operands 11 and operators 15, blocks of stack memory of operands 12 and operators 16, multiplexer of operands 14, decoder of 18 operators, block 19 of permanent memory of the function of the preceding one, two registers 21, 22 function preceding comparison circuit 23 and current character register 24. The exchange between the blocks is carried out via bus 2 of data according to the corresponding control signals of block 1. 6 Il.
$$
(Л(L
Т т тT t
X 31 S2X 31 S2
i:o00i: o00
РР PP
«г/"G /
Изобретение относитс к вычислительной технике и может быть использовано дл аппаратной трансл ции зыков программировани .The invention relates to computing and can be used for hardware translation of programming languages.
Известно вычислительное устройство , позвол ющее осуществл ть трансл цию зыков программировани преимущественно программными средствами (За вка Великобритании № 1407761, кл. G 06 F 15/20, .1975).A computing device is known that allows programming languages to be translated mainly by software (UK Application No. 1407761, Cl. G 06 F 15/20, .1975).
Однако устррйство имеет низкую скорость трансл ции программ, написанных на проблемно-ориентированных зыках, так как применение программ дл трансл ции ухудшает скорость трансл ции.However, the device has a low translation speed of programs written in problem-oriented languages, since the use of programs for translation degrades the speed of translation.
Наиболее близким по технической сущности к изобретению вл етс уст- ройство, содержащее блок микропрограммного управлени , входной счетчик , выходной счетчик, счетчик адреса текущего символа, блок оперативной пам ти текущего символа, счетчик внутренней метки, счетчик промежу точного результата, реверсивные счетчики операндов и операторов и регист адреса, причем выход счетчика адреса текущего символа подключен к адресному входу блока оперативной пам ти текущего символа (Авторское свидетельство СССР № 674028, кл. G 06 F 15/38, 1976).The closest in technical essence to the invention is a device comprising a firmware control block, an input counter, an output counter, a current symbol address counter, a current character memory block, an internal label counter, an intermediate result counter, reversible operand counters and operators and register the addresses, and the output of the current character address counter is connected to the address input of the operating memory block of the current character (USSR Copyright Certificate No. 674028, Cl. G 06 F 15/38, 1976).
Недостатком известного устройства вл етс то, что оно не позвол ет измен ть входные и выходные зыки, т.е. реализовать трансл цию нескольких зыков на одной аппаратуре. Кроме того, с помощью устройства могут быть транслированы только выражени в зыках -высокого уровн .A disadvantage of the known device is that it does not allow changing input and output languages, i.e. implement translation of several languages on the same hardware. In addition, using the device can only translate expressions in high-level languages.
Целью изобретени вл етс расширение функциональных возможностей за счет транслировани различных зыков произвольной конструкции. The aim of the invention is to extend the functionality by translating various languages of an arbitrary design.
Поставленна цель достигаетс путем перенастройки трансл тора дл работы с различными входными и объектными зыками посредством смены содержимого посто нных запоминающих устройств.This goal is achieved by reconfiguring the translator to work with various input and object languages by changing the contents of the permanent storage devices.
На фиг, 1 представлена функциональна схема трансл тора на фиг.2- кодирование внутренних символов на входной ленте, где обозначает оператор, С - его код, а - one- ранд, причем С вл етс указателем в таблице имен или посто нных} на фиг. 3 - кодирование символов в сте0Fig. 1 shows a functional diagram of the translator in Fig. 2 - encoding of internal symbols on the input tape, where the operator stands for, C is its code, and 1 is rand, with C being a pointer in the name or constant table} in Fig. . 3 - character encoding in step 0
5five
Q Q
5 five
0 0
5 0 50
5five
Q Q
с with
ковой пам ти операндов, причем Р указатель, - терминал, а - нетерминал; на фиг. 4 - кодирование символов в пам ти правил трансл ции причем С - код или указатель, а биты ТТ кодируют тип следующим образом: - терминал, - нетерминал, - внутренн метка, а - - промежуточный результат; на фиг.5 - кодирование символов на выходной ленте , которое вл етс аналогичньм указанному на фиг 2 и 3; на фиг. 6 - функциональна схема регистр - текущего символа.operand memory, where P is a pointer, is a terminal, and is a non-terminal; in fig. 4 - character encoding in the memory of the translation rules, where C is a code or pointer, and TT bits encode the type as follows: - terminal, - nonterminal, - internal label, and - - intermediate result; Fig. 5 illustrates the encoding of characters on the output tape, which is similar to that indicated in Figs 2 and 3; in fig. 6 - the register is functional - the current character.
Трансл тор (фиг. 1) содержит блок 1 микропрограммного управлени , шину 2 данных, входной 3 и выходной 4. счетчики, счетчик 5 адреса текущего символа, блок 6 оперативной пам ти те- кущего символа-, блок 7 посто нной пам ти правил трансл ции, счетчик 8 адреса 1 правила трансл ции, счетчик 9 внутренней метки, счетчик 10 промежуточного результата , стек операндов, составленный из блока 11 регистров стековой пам ти операндов и блока 12 пам ти; операндов, реверсивного счетчика 13 операндов, мультиплексора 14 операндов , стек оператора, составленный из блока 15 регистров стековой пам ти операторов и блока 16 стековой пам ти операторов, реверсивного счетчика- 17 операторов,дешифратора 18 операторов, блока 19 посто нной пам ти функции предшестви , регистра 20 адреса, первого 21 и второго 22 регистров функции предшестви , схемы 23 сравнени , регистра 24 текущего символа, причем вьгходы реверсивных счетчиков операндов 13 и операторов 17 подключены к адресным входам блоков стековой пам ти операндов 12-и операторов 16 соответственно, информационные входы-выходы которых подключены к первым информационным входам-выходам блоков регистров стековой пам ти операндов 11 и операторов 15 соответственно , информационные выходы которых подключены к информационным входам мультиплексора 14 операндов и дешифратора 18 операторов соответственно, выход счетчика 8 адреса правила трансл ции подключен к адресному входу блока 7 посто нной пам ти правил трансл ции, выход которого подключен через шину 2 данных к информационному входу регистра 24 текущего символа,, первый выход которого подключей к адресному входу мультиплексора 14.операндов, выход которого подключен через шину 2 данных к информационному входу блока 6 оперативной пам ти текущего символа, информационный выход которого подключен через шину 2 данных к информационным входам входного счетчика 3, выходного счетчика 4, к информаци- онному входу регистра 24 текущего символа, второй информационный выход которого соединен через шину 2 данных с информационным входом блока 6 оперативной пам ти текущего симво- ла 6, с вторыми информационными входами-выходами блоков регистров стековой пам ти операндов 11 и стековой пам ти операторов 15 и с информационным входом регистра 20 адреса, выход которого подключен к адресному входу блока 19 посто нной пам ти функции предшестви , выход которого подключен к информационным входам первого 21 и второго 22 регистров функции The translator (Fig. 1) contains block 1 of firmware control, data bus 2, input 3 and output 4. counters, counter 5 of the address of the current character, block 6 of the operational memory of the current symbol-, block 7 of the permanent memory of translation rules the counter, the address 8 address 1 of the translational rule, the counter 9 of the internal label, the counter 10 of the intermediate result, the operand stack composed of the block 11 of the operand stack memory registers and the block 12 of the memory; operands, reversible counter 13 operands, multiplexer 14 operands, operator stack, composed of block 15 registers of operator memory and block 16 of operator stack, reversible counter — 17 operators, decoder of 18 operators, block 19 of the previous memory function, the address register 20, the first 21 and second 22 function registers of the preceding, comparison circuit 23, the current symbol register 24, and the inputs of the reversible counters of operands 13 and operators 17 are connected to the address inputs of the stack memory operand There are 12 operators and 16, respectively, the informational inputs-outputs of which are connected to the first informational inputs-outputs of the blocks of registers of the stack memory of operands 11 and operators 15, respectively, whose information outputs are connected to the information inputs of the multiplexer 14 operands and the decoder 18 operators, respectively, the counter output The 8 addresses of the translation rule are connected to the address input of the block 7 of the permanent memory of the translation rules, the output of which is connected via data bus 2 to the information input of register 24 its symbol, the first output of which is connected to the address input of the multiplexer 14. operands, the output of which is connected via bus 2 data to the information input of the operating memory block 6 of the current character, whose information output is connected via bus 2 data to the information inputs of the input counter 3, output counter 4, to the information input of the register 24 of the current symbol, the second information output of which is connected via the data bus 2 to the information input of the RAM 6 of the current character 6, with the second information units of the registers of the stack memory of operands 11 and the stack memory of operators 15 and with the information input of the register 20 of the address, the output of which is connected to the address input of the block 19 of the permanent memory of the function preceding, the output of which is connected to the information inputs of the first 21 and second 22 function registers
: предшестви , выходы которых подключены к первому и второму информаци- онньш входам схемы 23 сравнени , выход 68 которой, выходы признаков заполнени блоков регистров стековой пам ти операндов 48 и стековой пам ти операторов 58, выходы разр дов призг каков типа символа 73 и 74 и нулево:го состо ни регистра текущего символа подключены к соответствующим вхо- дам логических условий блока 1 микро- программного управлени , выход дешифратора 18 операторов подключен через шину 2 данных к информационному входу счетчика 8 адреса правила трансл ции, выходы счетчиков внутренней метки 9: preceding, the outputs of which are connected to the first and second informational inputs of the comparison circuit 23, the output 68 of which, the output signs of filling the blocks of registers of the stack memory of operands 48 and the stack memory of operators 58, the outputs of the bits of the prg what type of character 73 and 74 and zero: the current state of the current character register is connected to the corresponding inputs of the logic conditions of the microprogramming unit 1, the output of the decoder 18 operators is connected via the data bus 2 to the information input of the counter 8 of the translation rule, moves counter internal label 9
и промежуточного результата 10 подключены через шину 2 данных к информационному входу регистра 24 текуща го символа, выхода входного 3 и вьг-.and intermediate result 10 are connected via bus 2 data to the information input of the register 24 of the current symbol, the input input 3 and v2.
входного 4 счетчиков подключены через шину 2 данных к информационному входу счетчика 5 адреса текущего символа , выход-выходного счетчика ключен через шину 2 данных к второму информационному входу-выходу блока 11 регистров стековой пам ти операндов , второй информационный вход-выход блока 15 регистров стековой пам ти операторов подключен через шину 2 данных к информационному входу регистра, 20 адреса, входы записи 25 и 28, выдачи 26 и 29 и счетные входы 27 и 30 входного счетчика 3 и выходного счетinput 4 counters are connected via bus 2 data to the information input of counter 5 of the address of the current symbol, output-output counter is connected via bus 2 data to the second information input-output of block 11 of operand stack memory registers, second information input-output of block 15 of registers of stack memory These operators are connected via bus 2 data to the information input of the register, 20 addresses, recording entries 25 and 28, outputs 26 and 29 and counting inputs 27 and 30 of input counter 3 and output account
Q 5 0 5Q 5 0 5
Q Q
, - ,,
00
5five
чика 4 соответственно, вход 31 начальной установки, вход 32 записи и счетный вход 33 счетчика 5 адреса текущего символа, вход 34 управлени записью считыванием и вход 35 блока 6 оперативной пам ти текущего символа, входы считывани 36 и 64 блоков посто нной пам ти правил трансл ции 7 и функции предшестви 19, вход записи 37 и счетный вход 38 счетчика 8 адреса правила трансл ции, входы начальной установки 39 и 42, входы 40 и 43 разрешени вьщачи и счетные входы 41 и 44 счетчиков внутренней метки 9 и промежуточного результата 10 соответственно , входы установки в О 50 и 60, счетные суммирующие 51 и 61 и вычитающие 52 и 62 входы реверсивных счетчиков операндов 13 и операторов 17 соответственно, входы управлени записью считыванием 49 и 59 блоков пам ти операндов 12 и операторов 16, входы разрешени выдачи мультиплек- , сора 53 операндов и дешифратора 18 . операторов, входы 65, 66 и 67 записи регистра 20 адреса, первого 21 и второго 22 регистров функции предшестви , входы установки в О 45 и 54, записи 46 и 55, считывани 47 и 56 блоков регистров стековой пам ти операндов 11 и операторов 15 соответственно, вход разрешени выдачи 57 блока регистров стековой пам ти операторов 15, входы записи 69, разрешени выда- чи 71 и вьщачи признаков типа символа 72 регистра 24 текущего символа подключены к соответствующим управл ющим выходам блока 1 микропрограммного управлени . Таким образом, структура трансл тора открыта (разомкнута) и каждаш блок можно подключить к остальным через шину 2 данных.4, respectively, input 31 of the initial installation, input 32 of the record and counting input 33 of the counter 5 of the address of the current character, input 34 of the read control and input 35 of the operating memory 6 of the current character, read inputs 36 and 64 of the permanent translation memory 7 and the functions preceding 19, entry entry 37 and counting input 38 of counter 8 of the translation rule address, inputs of initial setup 39 and 42, inputs 40 and 43 of resolution permissions, and counting inputs 41 and 44 of counters of internal tag 9 and intermediate result 10, respectively, installation inputs in О 50 and 60, counting summing 51 and 61 and subtracting 52 and 62 inputs of reversible counters of operands 13 and operators 17, respectively, write control inputs by reading 49 and 59 memory blocks of operands 12 and operators 16, multiplexing, copy permit 53 inputs operands and decoder 18. operators, inputs 65, 66, and 67 of the register of address 20, the first 21 and second 22 of the preceding function registers, installation inputs of O 45 and 54, write 46 and 55, read 47 and 56 blocks of registers of the stack memory of operands 11 and operators 15, respectively , the permission input for issuing 57 block of operators' stack memory registers 15, recording entries 69, issuing permissions 71 and all the features of character type 72 of register 24 of the current character are connected to the corresponding control outputs of firmware control unit 1. Thus, the structure of the translator is open (open) and each block can be connected to the rest via bus 2 data.
Регистр 24 текущего символа содержит счетчик 76, в котором помещаетс поле С, триггеры 77 и 78, в которых записываютс признаки типа символа ТТ, дешифратор 79 нулевого состо ни счетчика, буферы 80 и 81 .с трем состо ни ми, элемент ИЛИ 82, причем информационный вход регистра 24 текущего символа составлен из информационных входов счетчика 76 и триггеров 77 и 78, выходом счетчика 76 вл етс первый информационный выход регистра 24 и он подключен к входу дешифратора 79 нулевого состо ни , к информационным входам буфера 80 и мультиплексора 14 oneрандов , выход триггера 77 подключен к информационному входу буфера 81, выходы буферов ВО и 81 составл ют второй информационный выход регистра 24 текущего символа, вход 69 записи подключен к соответствующим входам счетчика 76 и триггеров 77 и 78,вход 71 уменьщени на единицу подключен к вычитающему счетному входу счетчика 76, вход 70 разрешени выдачи подключен к соответствующим входам буфера 80 и через элемент ИЛИ 82 буфера 81, вход 72 разрешени вьщачи признака типа символа подключен через элемент ШШ 82 к соответствующему входу буфера 81.The current symbol register 24 contains a counter 76 in which field C is placed, triggers 77 and 78 in which characters of the TT character type are written, a counter zero state decoder 79, buffers 80 and 81 with three states, an OR element 82, and the information input of the register 24 of the current symbol is composed of information inputs of the counter 76 and flip-flops 77 and 78, the output of the counter 76 is the first information output of the register 24 and it is connected to the input of the zero state decoder 79, to the information inputs of the buffer 80 and the multiplexer 14 trigger 77 is connected to information input of buffer 81, outputs of buffers VO and 81 make up the second information output of register 24 of the current symbol, record 69 is connected to the corresponding inputs of counter 76 and triggers 77 and 78, input 71 decreases by one is connected to the subtracting counting input of counter 76, the issue resolution input 70 is connected to the corresponding inputs of the buffer 80 and through the OR 82 element of the buffer 81, the input 72 of the resolution of the character type indicator is connected via the WL 82 element to the corresponding input of the buffer 81.
Трансл тор работает следующим образом .The translator works as follows.
При запуске трансл тора сначала осуществл етс инициализаци , при которой проводитс начальна установка счетчиков 5, 9, 10, 13 и 17 и блоков 11 и 15 регистров, причем из блока 1 микропрограммного управлени подаютс соответствуннцие управл ющие сигналы на входы 31, 39, 42, 45, 50, 54 и 60. После этого в входной счетчик 3 записываетс адрес исходной программы, представл ющей собой входную ленту трансл тора, а в выходной счетчик 4 - начальный адрес, откуда должна передвигатьс генерированна трансл тором объектна программа , т.е. выходна лента трансл тора . Это осуществл етс путем подач на входы 34 и 35 блока 6 оперативной пам ти текущего символа сигналов считывани 34 и выбора 35, считанна информаци по адресу, содержащемус в счетчике 5 адреса текущего символа , записываетс через шину 2 данных в входной счетчик 3 путем подачи сигнала на его вход 25. Содержание счетчика 5 увеличиваетс на единицу (из блока 1 поступает сигнал на вход 33) а с блока 6 оперативной пам ти ука-- занным образом считьюаетс информаци и записываетс в выходной счетчик 4 путем подачи сигнала на его вход 28.At the start of the translator, the initialization is carried out, at which the initial installation of the counters 5, 9, 10, 13 and 17 and the register blocks 11 and 15 is carried out, and from the microprogram control unit 1 the corresponding control signals are fed to the inputs 31, 39, 42, 45, 50, 54 and 60. After that, the address of the source program, which is the input tape of the translator, is written into the input counter 3, and the output address 4, where the object program generated by the translator must move, i.e. output translator tape. This is done by applying to the inputs 34 and 35 of the operating memory 6 of the current symbol of the read signals 34 and selecting 35, the read information at the address contained in the counter 5 of the address of the current symbol is recorded via bus 2 data into the input counter 3 by applying a signal to its input is 25. The content of counter 5 is increased by one (from block 1 a signal is received at input 33) and information from block 6 of operational memory is read and information is recorded into output counter 4 by applying a signal to its input 28.
Начинаютс считъшание, анализ и трансл ци исходной программы. Содержание входного счетчика 3 переда- етс через шину 2 данных в счетчик 5 адреса текущего символа, причем подаютс управл ющие сигналы на входы 26- и 32, считываетс по соответствующему адресу блока 6 оперативнойThe reading, analysis and translation of the source program begin. The content of the input counter 3 is transmitted via the bus 2 data to the counter 5 addresses of the current symbol, and the control signals to the inputs 26- and 32 are fed, is read to the corresponding address of the block 6 operational
00
5five
00
5five
00
5five
00
5five
пам ти текущий символ с входной ленты (подаютс управл ющие сигналы на входы 34 и 35 блока 6), который посылаетс через шину 2 данных в регистр 24 текущего, символа путем подачи сигнала на вход 69.the memory of the current character from the input tape (control signals are fed to inputs 34 and 35 of block 6), which is sent via data bus 2 to register 24 of the current character by applying a signal to input 69.
Блок 1 микропрограммного управлени анализирует текущий символ - его . поле Т, представл ющее собой логическое условие 74, и в зависимости от его типа осуществл ет некоторое из следующих дeйctвий,Firmware control block 1 analyzes the current symbol - its. field T, which is a logical condition 74, and depending on its type, implements some of the following actions,
Если символ типа операнд.(), то он записываетс в стековую пам ть операндов следующим образом. Блок 1 микропрограммного управлени анализирует состо ние признака 48 - Полный регистр. Если логический О, то блок 1 посылает управл ющие сигналы 46 и 70, причем содержание ре- гистров 24 тек ущего символа записываетс в самый верхний регистр блока 11 регистров, а поле Р устанавливаетт с в 1. Если логическа 1, т.е. блок 11 регистров заполнен, то выхо-.. д щее содержание из самого нижнего регистра блока 11 регистров записываетс в продолжение стековой пам ти - блок 12 пам ти путем подачи из блока 1 микропрограммного управлени сигнала на вход 49, после чего содержание счетчика 13 увеличиваетс на единицу (подаетс сигнал на его вход 51). Теперь подаетс управл ющий сигнал из блока 1 на вход 27 счетчика 3, в результате чего его содержание увеличиваетс на единицу и повтор ютс указанные действи по считыванию .и анализированию текущего символа.If an operand () character is typed, it is written to the operand stack as follows. The firmware control unit 1 analyzes the state of the sign 48 - Full register. If the logic is O, then block 1 sends control signals 46 and 70, and the contents of registers 24 will be written to the upper limit of the symbol in the uppermost register of block 11 of registers, and the P field will be set to 1. If logical 1, i.e. the register block 11 is full, then the output .. the contents from the lower register register block 11 is recorded in the continuation of the stack memory - memory block 12 by applying a signal from input 1 of the microprogram control to input 49, after which the content of counter 13 is increased by unit (a signal is fed to its input 51). The control signal from block 1 is now supplied to the input 27 of the counter 3, as a result of which its content is increased by one and the indicated actions are repeated for reading and analyzing the current symbol.
Если символ типа оператор () то адрес, определенный кодом в регистре 24 текущего символа (после С), записываетс в регистр 20 адреса (из блока 1 поступают управл ющие сигналы на входы 65 и 70), после чего посылаетс сигнал считывани на вход 64 блока 19 посто нной пам ти функции предшестви . Считанна информаци представл ет собой функцию предшестви - сравнительный приоритет текущего символа И записываетс в первый регистр 21 функции предшестви путем подачи управл ющего сигнала на его вход 65. После этого с самого верхнего регистра блока 15 считываетс верхний символ стековой пам ти и посылаетс в регистр 20 адреса (дл этой цели блок 1 посылает управл5пощиеIf an operator-type character (), the address defined by the code in register 24 of the current character (after C) is written to address register 20 (control block receives control signals to inputs 65 and 70 from block 1), and then a read signal is sent to input 64 of block 19 is a permanent memory of the function preceding. The read information is a function preceding the comparative priority of the current symbol AND is written into the first register 21 of the function preceding by supplying a control signal to its input 65. After that, the upper character of the stack memory is read from the top register of the block 15 and sent to the address register 20 (for this purpose, block 1 sends control
сигналы на входы 57 и 65). По соответствующему адресу с блока 19 посто нной пам ти считываетс функци предшестви - сравнительный приоритет верхнего символа в стековой пам ти (приходит управл ющий сигнал на вход 64 считывани ) и записываетс во второй регистр 22 функции предшестви 22 (блок 1 подает управл ющий сигнал на вход 67). Содержание регистров 21 и 22 сравниваетс комбинационным путем посредством схемы 23 и в зависимости от результата - признака 68, осуществл етс одно из следующих действий.signals to inputs 57 and 65). At the corresponding address from the constant memory block 19, the function preceding is read - the comparative priority of the upper character in the stack memory (a control signal arrives at read input 64) and is written to the second register 22 of the function preceding 22 (block 1 delivers a control signal at the input 67). The contents of registers 21 and 22 are compared by combinational means by means of circuit 23 and, depending on the result — feature 68, one of the following actions is carried out.
а)Если содержание первого регистра 21 функции предшестви больше содержани второго регистра 22, т.е. величина признака 68 логическа 1, то текущий символ регистра 24 записываетс в стековой пам ти операторов следующим образом, Блок .1 микропрограммного управлени анализирует состо ние признака 58 полного блока регистров. Если оно логический О, то блок 1 посылает управл ющие сигналы на входы 55 и 70 и содержание регистра 24 текущего символа за писываетс в самый верхний регистр блока 15, причем одновременно информаци передаетс между следующими регистрами. Если признак имеет значение логической 1, т.е. блок 15 заполнен, то выход щее из самого нижнего регистра блока 15 содержание записываетс в продолжение стека -- блок 16 посредством подачи из блока 1 управл ющего сигнала на вход 59 управлени записью считыванием, после чего содержание счетчика 17 увеличиваетс на единицу (блок 1 посылает сигнал на вход 61). Далее следует увеличение содержани входного счетчика 3 на единицу (блок 1 подает сигнал на вход 27) и переход, к указанным действи м по считыванию и анализированию следующего символа : с входной ленты.a) If the content of the first register 21 of the function preceding is greater than the content of the second register 22, i.e. the value of feature 68 is logical 1, then the current character of register 24 is written in the operator stack as follows. The firmware control unit .1 analyzes the state of feature 58 of the full register block. If it is logical O, then block 1 sends control signals to inputs 55 and 70 and the contents of register 24 of the current character is written to the uppermost register of block 15, and at the same time information is transmitted between the following registers. If the attribute has a logical value of 1, i.e. the block 15 is full, the content leaving the lower register of the block 15 is written in continuation of the stack — block 16 by supplying the control signal from the block 1 to the read control input 59, after which the content of the counter 17 is increased by one (block 1 sends a signal to input 61). This is followed by an increase in the content of the input counter 3 per unit (block 1 provides a signal to input 27) and a transition to the indicated actions on reading and analyzing the following symbol: from the input tape.
б)Если содержание первого 21 и второго 22 регистров функции предшестви равны между собой (величина на выходе 68 - логическа 1), то поступают по пункту а.b) If the contents of the first 21 and second 22 registers of the preceding function are equal to each other (the value at output 68 is logical 1), then proceed as per item a.
в)Если содержание первого регистра 21 функции предшестви меньше содержани второго регистра 22 - состо ние признака 68 логический О,c) If the content of the first register 21 of the function preceding is less than the content of the second register 22 - the state of the sign 68 is logical O,
то осуществл етс трансл ци -редук0This is translated by transl.
5five
00
5five
00
5five
00
5five
00
5five
ци , котора заключаетс в следую.- щем: исходный код, генерируемый дешифратором 18 операторов, посылаетс через шину 2 данных в счетчик 8 адреса правила трансл ции (из блока 1 микропрограммного управлени прибывают управл ющие сигналы на входы 37 и 63). Этот код определ ет начальный адрес трансл ционного правила. Начина с адреса, заданного счетчиком 8, символы трансл ционного правила счи- тываютс по одному с блока 7 (до встрени символа Конец правила), причем дл считывани каждого следующего символа содержание счетчика 8 адреса правила трансл ции предварительно увеличиваетс на единицу. Считанный символ посылаетс в регистр 24 текущего символа. Дл осуществлени этих действий блок 1 микропрограммного управлени посылает управл ющие сигналы на входы 36 и 69, после чего подает сигнал на вход 38. Тип символа в регистре 24 анализируетс блоком 1 микропрограммного управлени - провер ютс значени признаков 73 и 74 (поле ТТ) и в зависимости от его типа осуществл етс одно из следующих действий.The chi, which is as follows: the source code generated by the operator decoder 18 is sent via data bus 2 to the counter 8 of the translation rule address (control signals from inputs 37 and 63 arrive from the microprogram control unit 1). This code defines the starting address of the translation rule. Starting with the address specified by counter 8, the characters of the translational rule are counted one by one from block 7 (until the end of the rule character is found), and for reading each next character, the content of the counter 8 of the translation rule address is preliminarily increased by one. The read character is sent to the current character register 24. To perform these actions, microprogram control unit 1 sends control signals to inputs 36 and 69, and then sends a signal to input 38. The character type in register 24 is analyzed by microprogram control unit 1 — the values of features 73 and 74 (field TT) and Depending on its type, one of the following actions is performed.
.Если этот тип терминал, то он отправл етс регистром 24 текущего символа в блок 6 по адресу, определенному выходным счетчиком 4 следующим образом. Содержание выходного счетчика 4 переводитс в счетчик 5, причем из блока 1 микропрограммного управлени высылаютс управл ющие сигналы на входы 29 и 32. После этого посылаютс управл ющие сигналы на входы 70, 34 и 35, в результате чего содержание регистра 24 текущего символа записываетс в блок 6. Наконец увеличиваетс содержание выходного счетчика 4, причем подаетс управл ющий сигнал на его вход 30. Таким образом , символ записываетс на выходной ленте. Переход т к считыванию и анализу следующего символа трансл ционного правила.If this type of terminal, it is sent by register 24 of the current character to block 6 at the address specified by output counter 4 as follows. The contents of output counter 4 are transferred to counter 5, and from the microprogram control unit 1, control signals are sent to inputs 29 and 32. Control signals are then sent to inputs 70, 34 and 35, with the result that the contents of register 24 of the current symbol are written into the block 6. Finally, the content of the output counter 4 is increased, and a control signal is applied to its input 30. Thus, the character is recorded on the output tape. Go to reading and analyzing the next character of the translation rule.
Если этот тип нетерминал, то тогда указанным способом адрес из выходного счетчика 4 записываетс в счетчик 5, а в блок 6 - содержание k-ro регистра блока 11 регистров стековой пам ти операндов, где k - указатель, наход щийс в поле С регистра 24 текущего символа. Выбор регистра управл етс мультиплексором 14 операндов.If this type is non-terminal, then by this method the address from output counter 4 is recorded in counter 5, and in block 6 the content of the k-ro register of block 11 of the operand stack memory registers, where k is the pointer located in the field C of register 24 of the current character. Register selection is controlled by multiplexer 14 operands.
Подача управл ющих сигналов на входы 53, 34 и 35 приводит к записи содержани выбранного регистра в блок 6. Возвращаемс к считыванию и анализу следующего символа трансл ционного правила.Applying the control signals to the inputs 53, 34 and 35 results in writing the contents of the selected register in block 6. We return to reading and analyzing the next character of the translational rule.
Если это тип внутренн меткаIf this is an internal tag type
или промежуточный результат,or intermediate result,
тоthat
10ten
1515
2020
2525
30thirty
сначала формируетс внутренний символ следующим образом. Содержание соответственно счетчика 9 метки или счетчика 10 промежуточного результата записываетс в регистр 24 текущего символа (поле С), дл этой цели подаютс управл ющие сигналы на входы 40 или 43 и 69. После этого внутренний символ записываетс на выходной ленте содержание регистра 24 текущего символа записываетс в блок 6 по адресу, определенному выходным счетчиком 4 указанным способом. Наконец увеличиваютс на единицу содержани выходного счетчика 4, счетчика 9 внутренней метки (или счетчика 10 промежуточного результата) путем подачи управл ющих сигналов на входы 30, 41 или 44 соответственно.an internal symbol is first formed as follows. The content of counter mark 9 or counter 10 of the intermediate result, respectively, is written to the current symbol register 24 (field C), control signals are fed to inputs 40 or 43 and 69 for this purpose. After that, the internal symbol is recorded on the output tape; in block 6 at the address determined by the output counter 4 in this way. Finally, the output counter 4, the internal tag counter 9 (or the intermediate result counter 10) are increased by supplying control signals to the inputs 30, 41, or 44, respectively.
Далее приступают снова к считыванию и анализу следующего символа с трансл ционного правила.Then proceed again to reading and analyzing the next character from the translational rule.
Если это символ Конец правила, то из стековой пам ти операторов выталкиваютс М-символы, где М определ етс следующим по пор дку символом трансл ционного правила. Из стековой , пам ти операндов выталкиваютс К-символы, где К определ етс следующим за М-символом, считанным из блока 7 посто нной пам ти правила трансл ции. Это осуществл етс сле дующим образом. Указанным способом с блока 7 посто нной пам ти правил трансл ции считываетс и записьшает- с в регистр 24 текущего символа сим- ., вол. После этого содержание счетчика 8 адреса правила трансл ции нарастает на единицу. Выталкивание символов из стековой пам ти операторов осуществл етс следующим образом.Со держание реверсивного счетчика 17 уменьшаетс на единицу (подаетс управл ющий сигнал на вход 62), вынимаетс элемент, записанный на вершине стековой пам ти -- самом верхнем регистре блока 15 регистров стековой 55 пам ти аператоров путем подачи управл ющих сигналов на входы 56 и 59, причем информаци продвигаетс вверхIf it is the End of a Rule character, then M-characters are pushed out of the operator stack, where M is determined by the next in order character of the translation rule. K-symbols are pushed out of the stack memory of operands, where K is determined following the M-symbol read from the persistent memory block 7 of the translation rule. This is done as follows. In this way, from block 7 of the permanent memory, the translation rules are read and written to register 24 of the current symbol of the sym., Wave. After that, the content of the counter 8 of the translation rule address increases by one. The ejection of characters from the stack of operator memory is carried out as follows. The keeping of the reversible counter 17 is reduced by one (a control signal is applied to input 62), the element recorded at the top of the stack memory — the uppermost register of the stack of 15 registers of the 55 memory — is removed. these aperators by supplying control signals to inputs 56 and 59, with the information moving up
50 50
3535
4040
00
5five
00
5five
00
, 5 , five
между регистрами, а элемент блока 16 стековой пам ти операторов, указываемый реверсивным счетчиком 17, записываетс в самый нижний регистр блока 15. Уменьшаетс содержание пол С регистра 24 текущего символа путем . подачи управл ющего сигнала на,вход 71, после чего провер етс вл етс ли его содержание нулем (признак 75). Если это не нуль, то повтор ютс указанные действи по выталкиванию элементов из стековой пам ти операторов. В противоположном случае считываетс с блока 6 и записываетс в регистр 24 текущего символа следующий символ К. Начинаетс выталкивание символов из стековой пам ти операндов. Содержание реверсивного счетчика 13 уменьшаетс . на единицу (блок 1 микропрограммного управлени посьшаёт управл ющий сигнал на вход 52), после чего поступают управл ющие сигналы на входы 47 и 49, чем выталкиваетс символ с вершины стековой пам ти (самого верхнего регистра блока 11 регистров стековой пам ти операндов), а элемент блока 12 пам ти операндов, Указываемый реверсивным счетчиком 13, записываетс в самом нижнем регистре блока 11.Уменьшаетс содержание пол С регистра 24 текущего символа и провер етс вл - етс ли его содержание нулем. Если оно не нуль, то повтор ютс указанные действи по выталкиванию символа из стековой пам ти операндов 11, за- письшаетс символ типа операнд и указатель, равный текущему содержанию выходного счетчика 4. Дл этой цели из блока 1 микропрограммного управлени подаютс управл ющие сигналы на входы 29 (разрешена выдача на счетчик 4), 72 (разрешена вьщача на регистр 24 - поле Т) и 46 (запись в 11). Приступают к считыванию следующего символа с входной ленты и анализу его типа. Этим цикл трансл тора закрываетс . between the registers, and the element of the block 16 of the operator stack, indicated by the reversible counter 17, is written to the lowermost register of the block 15. The content of the field C of the register 24 of the current symbol is decreasing. supplying a control signal to input 71, after which it is checked whether its content is zero (sign 75). If this is not zero, then the specified actions to push elements out of the operator stack memory are repeated. In the opposite case, the next character K is read from block 6 and written to register 24 of the current character. The characters are pushed out of the operand stack. The content of the reversible counter 13 is reduced. per unit (microprogram control unit 1 sends a control signal to input 52), then control signals to inputs 47 and 49 are received, which pushes the symbol from the top of the stack memory (the uppermost register of the operand stack memory register 11), and an element of the operand memory block 12, indicated by the reversible counter 13, is written in the lowermost register of the block 11. The content of the field C of the register 24 of the current character is reduced and it is checked whether its content is zero. If it is not zero, then the specified actions for pushing a symbol from the stack memory of operands 11 are repeated, an operand type symbol and a pointer equal to the current content of output counter 4 are written. For this purpose, control signals are fed to the microprogram control unit 1 29 (issuance to counter 4 is permitted), 72 (allowance is allowed for register 24 - field T) and 46 (entry 11). Start reading the next character from the input tape and analyzing its type. By this the translator cycle is closed.
5five
00
., 55 ., 55
Claims (1)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
SU7772150A SU1387018A1 (en) | 1981-11-12 | 1981-11-12 | Programming language translator |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
SU7772150A SU1387018A1 (en) | 1981-11-12 | 1981-11-12 | Programming language translator |
Publications (1)
Publication Number | Publication Date |
---|---|
SU1387018A1 true SU1387018A1 (en) | 1988-04-07 |
Family
ID=48225301
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
SU7772150A SU1387018A1 (en) | 1981-11-12 | 1981-11-12 | Programming language translator |
Country Status (1)
Country | Link |
---|---|
SU (1) | SU1387018A1 (en) |
-
1981
- 1981-11-12 SU SU7772150A patent/SU1387018A1/en active
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US3940745A (en) | Data processing unit having a plurality of hardware circuits for processing data at different priority levels | |
GB1167762A (en) | Input-Output Data Service Computer | |
NL143351B (en) | SYSTEM FOR FORMATTING NUMERIC INFORMATION TO BE PRINTED. | |
US3553653A (en) | Addressing an operating memory of a digital computer system | |
US3579192A (en) | Data processing machine | |
US4051459A (en) | Stored program controlled typewriting/editing system | |
US3465299A (en) | Information translating data comparing systems | |
US2962213A (en) | Electric digital computers | |
SU1387018A1 (en) | Programming language translator | |
US3487375A (en) | Multi-program data processor | |
JPS6037944B2 (en) | text processing device | |
US3629850A (en) | Flexible programming apparatus for electronic computers | |
US3214736A (en) | Magnetic tape scan with field selection | |
US3548385A (en) | Adaptive information retrieval system | |
GB1003924A (en) | Indirect addressing system | |
US3755784A (en) | System for revision line retrieval | |
US3512138A (en) | Computer system with printer position recognition and control | |
US3602897A (en) | Key-entry system | |
US3344403A (en) | File selection system | |
KR860007590A (en) | Buffer Memory Control System | |
US3718911A (en) | Carriage-position modification of external program | |
SU690497A1 (en) | Device for lexical analysis | |
SU1076894A1 (en) | Information output device | |
KR880005608A (en) | Disk controller | |
US3219979A (en) | Free access control |