normDDe (1158428), страница 5

Файл №1158428 normDDe (Раздаточные материалы) 5 страницаnormDDe (1158428) страница 52019-09-18СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 5)

<HPF-comment>::=<sequence of token codes>

<DVM-comment>::=<sequence of token codes>

<label>::=<integer>

<name-index>::=<token code>

<b-value>::=<integer>

<e-value>::=<integer>

<step>::=<integer>

<logic-expression>::=<sequence of token codes>

<list-parameters>::=<sequence of token codes>

<name-subroutine>::=<token code>

<name-program>::=<token code>

<name-function>::=<token code>

<chan-number>::=<integer>

<read-list>::=<sequence of token codes>

<write-list>::=<sequence of token codes>

<format-list>::=<sequence of token codes>

<declaration-list>::=<sequence of token codes>

<external-list>::=<sequence of token codes>

<data-list>::=<sequence of token codes>

<operators>::=<fortran-statement> OR <operators><fortran-statement>

<type>::=’I’ OR ‘R’ OR ‘D’

<assignment>::=<sequence of token codes>

<CONTINUE>::=<token code>

<DO>::=<token code>

<IF>::=<token code>

<CALL>::=<token code>

<READ>::=<token code>

<WRITE>::=<token code>

<FORMAT>::=<token code>

<IFTHEN>::=<token code>

<IF_THEN_ELSE>::=<token code>

<declaration>::= <REAL> OR <INTEGER> OR <DOUBLE PRECISION>

<REAL>::=<token code>

<INTEGER>::=<token code>

<DOUBLE PRECISION>::=<token code>

<EXTERNAL>::=<token code>

<PROGRAM>::=<token code>

<SUBROUTINE>::=<token code>

<FUNCTION>::=<token code>

<DATA>::=<token code>

<RETURN>::=<token code>

<END>::=<token code>

<STOP>::=<token code>

3.23Input variables queue

Input variables queue is used for holding information about the order of input determined by the compiler for input-variable.

The element of Input variables queue has the form:

file number

name-variable

format

name-index

range

name-index

range

<file number>::=<integer>

<name-variable>::=<identifier>

<format>::=<Norma language attribute format>

<name-index>::=<identifier>

<range>::=<integer><integer>

This information means that variable with name <name-variable> must be input from file with number <file-number> by format <format> for the values of indexes <name-index>=<range>, … , <name-index>=<range> (for scalar variable of field <name-index>there is no <range>).

4.Global initialisation

Translator's entry function - function norma initialises global counters of the translator and analyses translating options set in the command line.

General structure of unit Global initialisation control is given in the following scheme.

n orma count0 zaparg face count

erroutall

4.1Initialisation of global counters (function count0)

glob=0 - counter of errors in Norma - program,

globw=0 - counter of warnings in Norma - program,

eof=0 - attribute denotes end of reading source file with Norma - program ,

bline=0 - initial value of the counter for filling in field<begin line number> in Statements-lines table,

eline=0 - initial value of the counter for filling in field <end line number> in Statements-lines table,

beginline=0 - initial value of counter of source file's lines. These lines have been processed in creating list of translation.

4.2Analysis of translation's options (function zaparg)

Command line has form norma <options> <source file>.

Source file is supposed to have extension .hop and must be set in the form <name>.hop.

Function zaparg:

1) sets values of the variables used in reading and writing of the files in the process of translation:

filein=<name>.hop - name of the source file, containing Norma-program,

fileft=<name>.for - name of the target file, containing text of FORTRAN DVM-program,

filelst=<name>.lst - name of file with listing of Norma - program translation.

2) sets value of the variable holding value of the current directory:

dir=<directory-name>

3) processes options of translation

Possible options of translation:

f-77 - translation into sequential Fortran-77,

dvm - translation into FORTRAN DVM,

length=<integer> - number of identificator's significant symbols ,

lst=1 - there is a text of Norma program and translator's messages in listing,

lst=2 - there is a text of FORTRAN DVM program and translator's messages in listing,

lst=3 - there is a text of Norma program, FORTRAN DVM program and translator's messages in the listing.

In processing options of translation the values of variables are set for holding translation options by default and redeclarated in case the options of translation have been given.

The variables of translation's options and their values by default:

f-out =3 - translation into FORTRAN DVM

lenid=6 - 6 significant symbols in identificator

lstng= 3 - mode lst=3.

4) opens files fileft, filelst, filein,

5) calls function face from unit Listing generator for output the messages about date, time, compiler's version, options of translation,

6) if in executing items 1)-5) the mistakes have been detected then function erroutall from unit Listing generator is called, in other case we call function count from unit Local initialisation.

In analysis of translation's options the following errors are fixed:

error code 408 'incorrect name of source file '<error context>

error code 271 'file '<error context>' is not found'

error code 413 'incorrect compilation option '<error context>

5.Norma part unit compilation

It is main unit of the compiler. It consists of units a)-j) mentioned in pragraph 1. Description of these units are given below.

5.1Local initialisation

Local counters used in translation of Norma part unit and Symbol table, Constant table are initialised. Then input function beginlex from unit Part unit scanner is called.

General structure of unit Local initialisation control is given in the following scheme.

c ount tableid tablecon beginlex

5.1.1Initialisation of local counters (function count)

osh=0 - counter of errors in current part of Norma - program,

osh1=0 - counter of warnings in current part of Norma - program,

met=1 - counter for generating labels in FORTRAN-program,

formet=40000 - counter for generating marks of operators FORMAT in FORTRAN-program,

kba=0 - counter of statements' numbers <statement number> of Norma part unit,

itn=600 - counter of iterations' numbers <iteration number> of Norma part unit,

i=700 - counter for generating names of iterated (first result variable name, second result variable name),

seq=1 - attribute denoting absence of sequential computations' mode.

5.1.2Initialisation of Symbol table (function tableid)

Lines given below are put into Symbol table

TAN

F

185

DTAN

F

186

DSIGN

F

187

SIGN

F

188

DATAN

F

189

DASIN

F

190

DCOS

F

191

DSIN

F

192

DEXP

F

193

DLOG10

F

194

DLOG

F

195

DABS

F

196

DMIN1

F

197

DMAX1

F

198

DSQRT

F

199

EXP

F

200

SIN

F

201

COS

F

202

SQRT

F

203

ABS

F

204

ALOG

F

205

ALOG10

F

206

ASIN

F

207

5.1.3Initialisation of Constant table (function tablecon)

Lines given below are put into Таблицу констант (Constant table)

0

I

10000

1

I

10001

5.2Part unit scanner

General structure of Part unit scanner control is given in the following scheme.

b eginlex

Характеристики

Список файлов учебной работы

Свежие статьи
Популярно сейчас
А знаете ли Вы, что из года в год задания практически не меняются? Математика, преподаваемая в учебных заведениях, никак не менялась минимум 30 лет. Найдите нужный учебный материал на СтудИзбе!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
7021
Авторов
на СтудИзбе
260
Средний доход
с одного платного файла
Обучение Подробнее