NORMA_DD (1158356), страница 6

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

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

b egin_part line pkd statement lexitex

kbaht

nextline EndLex count


StopCompile

5.2.1Begin scanning (function beginlex)

It is an entry point of Part unit scanner.

It increases counter bline=bline+1.

5.2.2Read source file (function nextline)

1) It reads next line of source file with Norma-program,

It increases counter eline=eline+1.

2) If this line begins with symbol ?, it reads the lines of the source file up to the line which contains symbol ? in the first position (executing operation eline=eline+1), after that it reads the next line of the source file (bline=eline),

3) If the line contains any comments then comment is erased,

4) If the end of file is detected, eof=1,

5)In other case it substitutes the group of space characters by one space character.

5.2.3Norma part unit head analyses (function begin_part)

  1. If eof=1, it calls StopCompile,

  2. If the line begins with key words MAIN PART, PART, FUNCTION, it passes it to function line,

  3. In other case it detects error and calls beginlex.

Function fixes error:

error code 304 'incorrect head of part'

5.2.4Norma statement extraction (function line)

  1. If eof=1, it calls EndLex and StopCompile one after another,

  2. If statement begins with symbol # (attribute of sequential computations' mode), then seq= -seq; if seq>0, next line in Таблицы последовательных групп (Table of ordered groups) is set,

  3. If delimiter '.' is detected, there analyses context of this delimiter (function point). If it is the end of Norma-statement, this Norma-statement is eliminated from the line and passed to function pkd,

  4. In other case it calls function nextline, unites result-line of its work with current line and calls line by recursion .

Function fixes errors:

error code 305 'missed END PART.'

error code 111 'incorrect using #...#''

error code 402 'declaration or operator is not ended with .'

5.2.5Conversion in tokens (function pkd)

It translates initial Norma-statement into sequence of tokens, creating Symbol table and Constant table. Key words and delimiter are recognised by explicit extraction from the text.

Norma-statement in the form of sequence of tokens is passed to function statement.

Function fixes error:

error code 403 'forbidden symbol ' <error context>

5.2.6Type of statement detection (function statement)

If Norma-statement begins with tokens MAIN PART, PART, FUNCTION, it calls function head_of_part, if Norma-statement begins with token ITERATION -it calls function lexitex, if with token END PART - function EndLex, in other case it calls function kbant. Norma-statement in the form of sequence of tokens is passed to the corresponding function.

Function fixes error:

error code 302 'missed . before END PART'

5.2.7Part unit head processing(function head_of_part)

General structure of function's control is given in the following scheme.


h ead_of_part nextline

infun line

If token BEGIN is detected in the sequence of tokens then all the tokens placed before it are passed to function infun, and all the tokens placed after - to function line.

If token BEGIN isn't detected in the sequence of tokens then function nextline is called and the result of its work is united with current sequence of tokens and passed to function head_of_part again.

Function infun constructs two optional structures: part parameters list and record-part type record, which contains information about the part type. These structures will be used in Fortran DVM code generator to generate head of Fortran DVM unit (PROGRAM, SUBROUTINE, FUNCTION and list of formal parameters). Besides information about the name of the part is put into Symbol table.

Structure of part parameters list

i n-parameters

out-parameters

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

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

Structure of part type record

part type

part name

info

<part type>::=MAIN PART

PART

FUNCTION

<part name>::=<token code>

<info>::=

R

- REAL FUNCTION

I

- INTEGER FUNCTION

D

- DOUBLE FUNCTION

Function fixes errors:

error code 298 'program has two MAIN PART'

error code 300 'incorrect part name'

error code 301 'missed BEGIN part body'

error code 303 'incorrect list of part parameters'

5.2.8Norma iteration processing (function lexitex)

It does scan and partial parsing of ITERATION construction. Parsing is of top-down recursive kind. The result of function lexitex work is information about current iteration put into Список итераций (List of iterations).

It uses function nextline in reading the source file with Norma-program.

Function lexitex uses some additional data structures as follows :

1) Stack of iterations iter_stack. It is used for analysing the structure of embedded iterations.

i teration index

iteration number

iteration level 1

i teration index

iteration number

iteration level 2

2) List of iterations with errors err_kwit. It is used to lock passing iterations which contain errors into Part unit parser.

General structure of function lexitex control is given in the following scheme.

l exitex lhead zagiter is-bound spuskgr what nino line



is-initial spuskgr what



spuskitordo


thisfor spuskend


Function lexitex initialises counter of errors in iteration fat=0; if any error is detected in analysis of iteration then operation fat=fat+1 is done.

Function fixes error:

error code 58 'missed iteration index in head of ITERATION ON'

Function lhead makes coumt itn=itn+1; puts record

iteration index

itn

into iter_stack and extracts head of ITERATION in the form of sequence of tokens and passes it to function zagiter.

Function zagiter writes in in field <iteration number> value itn and fills <hеad-of-iteration> from List of iterations for current iteration.

Function fixes error:

error code 53 'incorrect list element of iterated variables:'<error context>

error code 59 'iteration index is not identifier'<error context>

error code 60 'incorrect key word in head of ITERATION ON' <error context>

error code 405 'incorrect identifier'<error context>

Function is-bound checks if there is token BOUNDARY in the current sequence of tokens.

If this token is detected it sets an attribute denoting the end of searching for END BOUNDARY and calls function spuskgr, extracting operators included into construction BOUNDARY…END BOUNDARY.

If this token isn't detected, it sets attribute NOT BOUNDARY.

Function spuskgr extracts operators one after another (ASSUME, INPUT, OUTPUT, COMPUTE, scalar operator) and passes them for processing to function thisfor. If token coincides with an attribute denoting end of search is detected then extracting is cancelled and function calls function what. If an attribute denoting end of search NOT BOUNDARY or ERROR is set, function what is called by at once.

Function fixes errors:

error code 62 'incorrect operator or declaration in ITERATION ON''

error code 111 'incorrect using #...#''

error code 54 'missed <error context> in ITERATION ON '<error context>

Function what analyses attribute denoting the end of search.

If an attribute denoting the end of search is ERROR it calls function which performs termination of processing iteration nino.

If an attribute denoting the end of search is END BOUNDARY it determines structure <list of boundary operators> from List of iterations for current iteration and calls function is-initial.

If an attribute denoting the end of research is END INITIAL it determines structure <list of initial operators> from List of iterations for current iteration and calls function spuskitordo extracting operators included into the body of iteration.

Function is-initial checks if there is token INITIAL in the current sequence of tokens.

If this token is detected it sets an attribute denoting end of search END INITIAL and calls function spuskgr, extracting operators included into the construction INITIAL…END INITIAL.

If this token isn't detected, it sets attribute ERROR.

Function fixes errors:

error code 63 'iteration index <error context>' differs from index of '<error context>

error code 54 'missed <error context> in ITERATION ON '<error context>

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

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

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