NORMA_PD (1158358)

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

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

13








Norma compiler

Preliminary design



Март 30, 1999

Keldysh Institute of Applied Mathematics

Russia Academy of Sciences



Contents

1. Main principles of NORMA compiler implementation

2. Functions of Norma compiler

3. Contents of Norma compiler

4. Norma part unit compilation

4.1 Local initialization

4.2 Part unit scanner

4.3 Part unit parser

4.4 Data dependencies graph builder

4.5 Data dependencies graph analyser

4.6 Fortran DVM intermediate representation generator

4.7 Fortran DVM code generator

4.8 Input files analyser

4.9 Listing generator

4.10 Exit part unit compilation



1.Main principles of NORMA compiler implementation

Norma compiler is based on traditional compilation methods and specific compilation methods, related to a solution of a target program synthesis problem.

The first class of methods include methods for lexical and syntactic analysis, methods for data representation (tables, access methods), code generation methods etc.

The second class of methods includes methods for creation of executable program based on a declarative specification of computational task. These methods were developed in KIAM RAS.

Implementaion of Norma compiler must support:

  1. effective mapping of Norma language computational model into Fortran DVM computational model,

  2. strong analysis of Norma program at all stages of compilation to detect much more errors in Norma source and to create diagnostic messages in terms of Norma source,

  3. possibility of Norma language (or Fortran DVM) modifications.

2.Functions of Norma compiler

Norma compiler translates a source file containing program written in Norma language into a target file containing Fortran DVM program. Norma compiler must be implemented for workstation cluster and executed under OS Unix.

norma command compiles Norma source and has the following form:

norma <options> <source-file>

On the norma command line options is one or more compiler options.

Source Norma program is placed into input file <source-file>.

Compiled Fortran DVM program is placed into output file <target-file>.

Listing is placed into output file <listing-file> and may consists of the source Norma program, error and warning messages, compiling time messages, Fortran DVM program (optional). Listing may be also sent onto a screen.

3.Contents of Norma compiler

Structure of Norma compiler.

Norma compiler consists of the next components.

  1. Global initialization.

  2. Norma part unit compilation.

  3. Exit compilation.

Global initialization’s functions are:

  1. to process compiler options,

  2. to initialize compilers variables and data structures,

  3. to open files, to output some compiling time messages (date, compiler version, compiler options).

Control Interface.

Global initialization is the initial component of Norma compiler.

Global initialization calls Norma part unit compilation.

Norma part unit compilation is the main component of the compiler and realizes autonomous translation method. If the Norma program consists of part units p1,p2,...,pn, n>0, then each pi, i=1,...,n will be compiled autonomously by this component.

Norma part unit compilation’s functions are described more precisely in paragraph 4.

Control Interface.

Norma part unit compilation is called from Global initialization (for i=1) or from Norma part unit compilation (for i=2,…,n).

Norma part unit compilation calls Norma part unit compilation (for i=2,…,n) or Exit compilation otherwise.

Exit compilation’s functions are:

  1. to close files,

  2. to output some compiling time messages (time of compilation, number of errors and warnings).

Control Interface.

Exit compilation is the final component of Norma compiler.

Exit compilation is called from Norma part unit compilation.

4.Norma part unit compilation

The Norma part unit compilation consists of the following components:

  1. Local initialization

  2. Part unit scanner

  3. Part unit parser

  4. Data dependencies graph builder

  5. Data dependencies graph analyser

  6. Fortran DVM intermediate representation generator

  7. Fortran DVM code generator

  8. Input files analyser

  9. Listing generator

  10. Exit part unit compilation

4.1Local initialization

Local initialization’s function is:

  1. to initialize compilers variables and data structures for part unit compilation. Data structure initialized: compiler counters, compiler tables etc.

Control Interface.

Local initialization is the initial component of Norma part unit compilation.

Local initialization call Part unit scanner.

4.2Part unit scanner

Part unit scanner’s functions are:

  1. to translate a sequence of symbols from <source-file> into a sequence of tokens; to create a symbol table.

Data structure created: symbol table, constant table.

  1. to fix up this sequence of tokens as a sequence of Norma program statements (declarations, operators, iterations).

Data structure created: list of Norma statements, list of iterations.

  1. to define of a relation between Norma program statements and <source-file> lines.

Data structure created: statements-lines table.

  1. to determine those Norma statements groups (ordered groups) which sequential computing mode is defined for.

Data structure created: table of ordered groups.

Data structure used: list of Norma statements.

  1. to check & detect lex-errors.

Data structure used: list of errors.

Control Interface.

Part unit scanner is called from Local initialization.

Part unit scanner calls Part unit parser.

Data Interface.

Part unit scanner reads Norma source from <source-file>.

Part unit scanner passes errors and warnings messages to Listing generator and passes lexically correct statements from list of Norma statements and list of iterations to Part unit parser in the following order:

  1. Declarations DOMAIN PARAMETERS, INDEX,

  2. Declarations of domains,

  3. Declaration of variables, DISTRIBUTION INDEX, EXTERNAL,

  4. Declaration of conditional domains,

  5. Declaration of input variables,

  6. Declaration of output variables,

  7. Norma operators,

  8. Iterations.

4.3Part unit parser

Part unit parser’s functions are:

  1. syntax analysis of Norma statements, errors checking and detection.

Data structure used: list of Norma statements, list of iterations, symbol table, constant table, table of domains, list of indexes order, table of distribution indexes, list of errors.

  1. internal representation for Norma statements creation

Data structure created: symbol table, constant table, table of domains, table of operators bodies, table of functional dependencies, list of indexes order, table of distribution indexes, table of input-output formats, table of iterations structures.

Control Interface.

Part unit parser is called from Part unit scanner.

Part unit parser calls Listing generator and after that Data dependencies graf builder.

Data Interface.

Part unit parser receive lexically correct statements from Part unit parser in the following order:

  1. Declarations DOMAIN PARAMETERS, INDEX,

  2. Declarations of domains,

  3. Declaration of variables, DISTRIBUTION INDEX, EXTERNAL,

  4. Declaration of conditional domains,

  5. Declaration of input variables,

  6. Declaration of output variables,

  7. Norma operators,

  8. Iterations.

Part unit parser passes table of functional dependencies to Data dependencies graf builder and passes errors and warnings messages to Listing generator.

Structure of Part unit parser.

Part unit parser consists of the following main blocks:

  1. Processing domain parameters declaration.

Functions: to check & detect errors, to update: symbol table.

  1. Processing domain indexes declaration.

Functions: to check & detect errors, to update: symbol table, to create: table of ordered indexes.

  1. Processing distribution indexes declaration.

Functions: to check & detect errors, to update: symbol table, to create: table of distribution indexes.

  1. Processing domains declaration.

Functions: to check & detect errors, to update: symbol table, constant table, to create: table of domains.

  1. Processing variables declaration.

Functions: to check & detect errors, to update: symbol table.

  1. Processing external names declaration.

Functions: to check & detect errors, to update: symbol table.

  1. Processing Norma operators.

Functions: to check & detect errors, to create: table of operators bodies, table of functional dependencies, table of shadow variables, table of remote variables.

Table of operators bodies contains text of Norma operators in the form, oriented on a code generation.

Table of functional dependencies contains text of Norma operators in the form, oriented on a data dependencies analysis.

Table of shadow variables contains infornation about storage allocation on each processor to include additional space for the elements of arrays that have to be moved in from neighboring processors (see document ‘Fortran DVM. Language description’, SHADOW directive description).

Table of remote variables contains infornation about program statements, which have remote references to distributed arrays (see document ‘Fortran DVM. Language description’, REMOTE_ACCESS directive description).

  1. Processing input and output variables declaration.

Functions: to check & detect errors, to update: table of operators bodies, table of functional dependencies, to create: table of input-output formats.

  1. Processing iterations.

Functions: to check & detect errors, to update: table of operators bodies, table of functional dependencies, table of shadow variables, table of remote variables.

4.4Data dependencies graph builder

Data dependencies graph builder functions are:

  1. data dependencies graph (DDG) creation.

DDG G(V,E) is a hierarchical oriented graph. V is a set of graph nodes, each node corresponds to a Norma operator, iteration or declaration of input and output variables. E is a set of edges reflecting the variables dependencies: if the variable X depends on the variable Y then there exists the edge e from X to Y.

All Norma iteration units for special nodes (iteration-nodes) are substituted. Iteration-nodes is a subgraph of DDG graph.

All Norma ordered groups (Norma statements groups which sequential computing mode is defined for) for special nodes (ordered-groups-nodes) are substituted.

Data structure used: table of functional dependencies, table of iterations structures, table of ordered groups, symbol table, table of domains, table of conditions.

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

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

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

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

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

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

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