NORMA_DD (1158356)

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

Текст из файла

79








Norma compiler

Detail design



Keldysh Institute of Applied Mathematics

Russia Academy of Sciences

1999



Contents

1. Technical background.

2. General scheme of Norma compiler

3. Main data structures of Norma compiler.

3.1 Symbol table

3.2 Constant table

3.3 List of Norma statements

3.4 List of iterations

3.5 Table of iterations structure

3.6 Statements-lines table

3.7 Table of ordered groups

3.8 List of errors

3.9 Table of domains

3.9.1 Table of ranges

3.9.2 Table of conditions

3.9.3 Table of conditional domains

3.9.4 Table of diagonals

3.10 Table of ordered indexes

3.11 Table of distribution indexes

3.12 Table of functional dependencies

3.12.1 What-compute table

3.12.2 Where-compute table

3.13 Table of operators body

3.14 Table of input-output formats

3.15 Data dependencies graph (DDG)

3.16 Reduced data dependencies graph (RDDG)

3.17 List of MSCS

3.18 List for parallel layer scheme representation

3.19 Table of distributed variables

3.20 Table of shadow variables

3.21 Table of remote variables

3.22 Intermediate representation of Fortran DVM programs

3.23 Input variables queue

4. Global initialisation

4.1 Initialisation of global counters (function count0)

4.2 Analysis of translation's options (function zaparg)

5. Norma part unit compilation

5.1 Local initialisation

5.1.1 Initialisation of local counters (function count)

5.1.2 Initialisation of Symbol table (function tableid)

5.1.3 Initialisation of Constant table (function tablecon)

5.2 Part unit scanner

5.2.1 Begin scanning (function beginlex)

5.2.2 Read source file (function nextline)

5.2.3 Norma part unit head analyses (function begin_part)

5.2.4 Norma statement extraction (function line)

5.2.5 Conversion in tokens (function pkd)

5.2.6 Type of statement detection (function statement)

5.2.7 Part unit head processing(function head_of_part)

5.2.8 Norma iteration processing (function lexitex)

5.2.9 Statement processing(function kbaht)

5.2.10 Stop compilation detection (function StopCompile)

5.2.11 Scanning termination (function EndLex)

5.3 Part unit parsing

5.3.1 Group a statements processing (function kvpar1)

5.3.2 Group b,c,d statements processing (function kvop1)

5.3.3 Group e statements processing (function kbbxo)

5.3.4 Group f statements processing (function kbbyx)

5.3.5 Group g statements processing (function kvopr1)

5.3.6 Iteration processing (function kbiter)

5.4 Data dependencies graph builder

5.4.1 DDG constructor

5.4.2 RDDG constructor

5.5 Data dependencies graph analyser

5.6 Fortran DVM intermediate representation generator

5.6.1 Simple node realisation (function begkf)

5.6.2 Iteration node realisation (function gen_iter)

5.6.3 Ordered group node realisation (function ms)

5.6.4 MSCS node realisation (function mssv)

5.7 Fortran DVM code generator

5.8 Input files analyser

5.9 Listing generator

5.10 Exit from part unit compilation

6. Exit from compilation



1Technical background.

Detail design of Norma compiler is a detailed version of the preliminary design (doc. "Norma compiler. Preliminary design."). Main units of the compiler, its control structure and data structures defined in the preliminary design are given now in details. Notions are taken from doc. "Norma. Language specification" also.

Norma compiler translates Norma-program from <source file> into FORTRAN DVM program placed in <target file>. Norma compiler is implemented for workstation cluster and executed under OS UNIX.

Norma command starts up compiler. The format of this command is given below:

norma <options> < source file>

Norma compiler consists of the next components.

1) Global initialisation

2) Norma part unit compilation

a) Local initialisation

b) Part unit scanner

c) Part unit parser

d) Data dependencies graph builder

e) Data dependencies graph analyser

f) FORTRAN DVM intermediate representation generator

g) FORTRAN DVM code generator

h) Input files analyser

i) Listing generator

j) Exit from part unit compilation.

3) Exit from compilation.

General scheme of Norma compiler, declaration of the main compiler data structures ( defined in doc. "Norma compiler. Preliminary design") and detailed specification of some compiler's units (principal functions, data structures and interfaces) are given below.

All the declarations of data structures, functions and interfaces are done at the level of logical organisation and doesn't depend on the implementation language of Norma compiler.

2General scheme of Norma compiler

Control structure of Norma compiler is given in Fig. 1.

G lobal initialisation


No

I s there next Norma part unit?


Yes

L ocal initialisation

P art unit scanner

P art unit parser

B uilding graph of data dependencies

A nalysing graph of d ata dependencies

G enerating intermediate representation of FORTRAN DVM program

G enerating FORTRAN DVM code


A nalysis of the input files

E xit from part unit compilation


E xit from compilation

L isting generation

Fig.1. Control structure of Norma compiler.

3Main data structures of Norma compiler.

In this project we use some notions which correspond to notion of unique number: <statement number>, <iteration number>, <MSCS number>, <ordered-group-number>, <token code>.

Let's consider that

a1< statement number< a2

b1 < identifier-token code < b2

a3< MSCS number < a4

b3 < identifier-token code < b4

a5< ordered-group-number < a6

a7< iteration number < a8

and besides a1<a2<a3<a4<a5<a6<a7<a8, b1<b2<b3<b4. Characteristic of singleness follows from this condition. The value of parameters ai, bj are defined during realisation and in this project we consider a1=1, a2=499, a3=500, a4=549, a5=550, a6=599, a7=600, a8=650, b1=185, b2=9999, b3=10000.

3.1Symbol table

Symbol table is used for holding identificators of Norma program and information about these identificators. Identificators of Norma program are put into the symbol table at the stage of part unit scanner and the information about their characteristics - at the stage of part unit parser

Line of Symbol table has the following form:

identifier

info

token-code

<info>::=

X

- PART name, MAIN PART name

AR

- FUNCTION name, REAL

AI

- FUNCTION name, INTEGER

AD

- FUNCTION name, DOUBLE

P<integer>

- DOMAIN PARAMETERS identifier =<integer>

M<indexes number><list indexes>

- domain

I

- domain index

II

- iteration index

VI<token-code>

- VARIABLE DEFINED ON domain

<token-code>, INTEGER

VR<token-code>

- VARIABLE DEFINED ON domain

<token-code>, REAL

VD<token-code>

- VARIABLE DEFINED ON domain

<token-code>, DOUBLE

SR

- VARIABLE, INTEGER

SI

- VARIABLE, REAL

SD

- VARIABLE, DOUBLE

ER

- EXTERNAL FUNCTION, REAL

EI

- EXTERNAL FUNCTION, INTEGER

ED

- EXTERNAL FUNCTION, DOUBLE

R

- EXTERNAL PART

F

- Standard Norma function

<token-code>::=<integer>

3.2Constant table

Constant table is used for holding constants of Norma program and information about these constants. Constants of Norma program and the information about their characteristics are put into the symbol table at the stage of part unit scanner.

Line of Constant table has the following form:

constant-body

info

token-code

<info>::=

R

- REAL

I

- INTEGER

D

- DOUBLE

<token-code>::=<integer>

3.3List of Norma statements

List of Norma statements is used for holding operators and declarations of Norma program in the form of structured sequence of tokens. Operators and declarations of Norma program can be divided into the following groups of statements:

  1. Declarations of DOMAIN PARAMETERS, INDEX - group а,

  2. Declarations of domains, - group b,

  3. Declarations of variables, DISTRIBUTION INDEX, EXTERNAL - group c

  4. Declarations of conditional variables, - group d,

  5. Declarations of INPUT, - group e,

  6. Declarations of OUTPUT, - group f,

  7. Norma-operators - group g.

Every statement of Norma program is given in the form of the token codes sequence and unique number of the statement.

Structure of List of Norma statements:

h ead of group a list

statement-1 of group a

statement-k of group a


h ead of group b list

statement-1 of group b

statement-l of group b


h ead of group c list

statement-1 of group c

statement-m of group c


h ead of group d list

statement-1 of group d

statement-n of group d


h ead of group e list

statement-1 of group e

statement-p of group e


h ead of group f list

statement-1 of group f

statement-q of group f


h ead of group g list

statement-1 of group g

statement-q of group g

<statement> ::=<statement number><sequence of token codes>

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

Тип файла документ

Документы такого типа открываются такими программами, как Microsoft Office Word на компьютерах Windows, Apple Pages на компьютерах Mac, Open Office - бесплатная альтернатива на различных платформах, в том числе Linux. Наиболее простым и современным решением будут Google документы, так как открываются онлайн без скачивания прямо в браузере на любой платформе. Существуют российские качественные аналоги, например от Яндекса.

Будьте внимательны на мобильных устройствах, так как там используются упрощённый функционал даже в официальном приложении от Microsoft, поэтому для просмотра скачивайте PDF-версию. А если нужно редактировать файл, то используйте оригинальный файл.

Файлы такого типа обычно разбиты на страницы, а текст может быть форматированным (жирный, курсив, выбор шрифта, таблицы и т.п.), а также в него можно добавлять изображения. Формат идеально подходит для рефератов, докладов и РПЗ курсовых проектов, которые необходимо распечатать. Кстати перед печатью также сохраняйте файл в PDF, так как принтер может начудить со шрифтами.

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

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