NORMA (1158464), страница 2

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

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

apostrophe :

'

space :

Space has no graphical representation.

3.1.2. Commentaries

The line which begins from the sign “!” or the part of line which follows the sign “!” is a commentary.

3.1.3. Tokens

There are 5 classes of tokens: identificators, key-words, constants, operation signs, delimiters.

Spaces, LF, commentaries are considered tokens’ delimiters and have no influence on the program semantics.

3.1.4. Identificators

identificator :

letter { { digit, letter } }*

The letters of upper register differ from the ones of low register. Identificators can have any length. The number of the meaningful symbols is defined in the specification of the translator’s source language (usually first 6 symbols are meaningful).

3.1.5. Key words

These key-words are used in the language:

MAIN PART

VARIABLE

ITERATION

PART

DEFINED ON

BOUNDARY

FUNCTION

REAL

END BOUNDARY

BEGIN

INTEGER

INITIAL

END PART

DOUBLE

END INITIAL

RESULT

DOMAIN PARAMETERS

EXIT WHEN

EXTERNAL FUNCTION

INPUT

END ITERATION

EXTERNAL PART

OUTPUT

FOR

DISTRIBUTION INDEX

ON

ASSUME

INDEX

COMPUTE

3.1.6. Constants

constant :

arithm-constant

string

arithm-constant:

int-constant

real-constant

double-constant

int-constant :

{ digit }+

real-constant :

body [ E [ { +,- } ] power ]

double-constant :

body [ D [ { +,- } ] power ]

body :

int-constant . int-constant

power

int-constant

string

‘ { { symbol-not-apostrophe, ‘‘ } }+

symbol-not-apostrophe:

letter

digit

special- symbol-not-apostrophe

supplementary-symbol

The rules of writing constants are similar to the ones in the Fortran language.

The type and the value of the constant is defined by the way of its representation. These are examples of arithmetical constants :

101 999 0.1 1.0

10.5E-6 1.0E+7 1.0E7 0.1D-8 15.333D4

These records are not arithmetical constants:

.1 1. 1E-1 1.E5

These are examples of the strings :

'Hello, world!'

'Об ''ем тела = '

3.1.7. Signs of operations

operation :

{rel-operation, log-operation, arithm-operation }

rel-operation:

{ =,>,<,<=,>=,<>,>< }

rel-except-not-equal-operation :

{ =,>,<,>=,<= }

log-operation :

{ AND, OR, NOT }

arithm-operation :

{ +,-,*,/,** }

Symbols >= and <= are used for comparisons and , <> and >< symbols - for .

3.1.8. Delimiters

delimiter :

{ space,/,(,),[,],!,?,,,,.,# }

3.2. Names

name :

identificator

list-name :

name { , name }*

Name is an identificator. It has a particular meaning and defines a particular program’s object (e.g. variable, domain, part of the program). There can’t be two definitions of the objects which have the same name.

The rule of name localization is true for every program element (part or function). The names declared in the program element are localized in it. There is no notion “global variable“ in this language. The names of the functions or the parts if they are actual or formal parameters of other parts or functions are indicated in the external names declaration EXTERNAL FUNCTION or EXTERNAL PART [see 5.16].

Half-underlined syntactical symbols e.g. name-set are syntactically equivalent to symbol name. Underlined part of the construction has additional semantic information.

Symbol list-name substitutes non-empty list of the names enumerated by comma.

3.3. Basic data types

There are basic data types specified in the language:

integer, real, double, logical, string

Value from the set of integers is assigned to the element of integer data type. There are arithmetical and comparison operations (rel-operation) for integer type elements.

Value from the set of real numbers is assigned to the element of real data type. There are arithmetical and comparison operations (rel-operation) for real type elements.

Value from the set of real numbers is assigned to the element of double data type and it allows to use double precious real numbers. There are arithmetical and comparison operations (rel-operation) for double type elements.

There are variables of integer, real and double type in the language.

Value “true” and “false” is assigned to the element of logical data type. It is used for definition of condition. There are logical operations for logical type elements. There are no variables of logical type in the language.

The element of string data type is a set of symbols from principal symbol set and supplementary symbol set. There are only constants but no variables and operations of this type.

3.4. Expressions

3.4.1. Arithmetical expressions

arithm-expression :

[ { +, - } ] term { arithm-operation term }*

term :

arihm-constant

call-function

name-index

name-domain-parameter

name-scalar

variable-on-domain

(arithm-expression)

variable-on-domain :

name-variable-on-domain [ [ list-index-expression ] ]

const-expression :

[ { +,- } ] const-expression-without-sign

const-expression-without-sign :

integer-term { arithm-operation integer-term }*

integer-term :

int-constant

name-domain-parameter

( const-expression )

index-expression :

name-index [ [ { +,- } ] const-expression-without-sign ]

name-index = const-expression-without-sign

name-index = name-index [ [ { +,- } ] const-expression-without-sign ]

The result of the index expression computation in a fixed point T of the domain (5.1.1.) is coordinates of the point T. These coordinates can be defined according to the rules :

indexes are substituted to the constant expressions, values of T coordinates (taking into account index displacement if it is given) or values of the other given indexes in the point T.

For example, the list of index expressions [i-1,j,k=7,l=i+4] for the point T with i=9, j=15, k=3, l=37 gives us the value of the point T’ from index domain with i=8, j=15, k=7, l=13 coordinates.

The order of arithmetical expression computation is :

(1) index expressions computation;

(2) finding arguments (actual parameters) of the functions ( including determination of reduction functions operation domain [5.2.3];

(3) carrying-out in-brackets ( and ) operations: if there are several brackets of the one level, they are examined from the left to the right;

(4) carrying-out raising to the ** power operations: if there are several operations of the one level, they are examined from the right to the left;

(5) carrying-out of multiplication and division * and / operations; if there are several operations of the one level, they are examined from the left to the right;

(6) carrying-out of sum and difference + and - operations; if there are several operations of the one level, they are examined from the left to the right.

The type of arithmetical expression result is defined by the types of operation results. The type of operation result can be :

(1) integer, if both operands are integer ;

(2) double, if even one operand is double ;

(3) real in any other cases.

Constant expression is a particular case of arithmetical expression. The examples of arithmetical expressions :

AL12[J=2*M-1]+STEPLP*JJ

Q+1.0D5/((R[Q-1]-R)*(R[Q-1]-R[Q+1]))

CN*TRAP(STEP, 2*MV+1, MMR ON POLL)

3.4.2. Conditional expressions

log-expression :

[ NOT ] logic-term { log-operation logic-term }*

logic-term :

comparison

( log-expression )

comparison :

arithm-expression comp-operation arithm-expression

condition-on-domain :

log-expression

condition-on-index :

name-index rel-except-not-equal-operation

name-index [ { +,- } const-expression-without-sign ]

name-index rel-except-not-equal-operation const-expression-without-sign

The order of operations for logical expression computation :

(1) carrying out of arithmetical expressions computation;

(2) carrying out of in-brackets ( and ) operations; if there are several brackets of the one level, they are examined from the left to the right.

(3) carrying out of comparisons =,>,<,>=,<=,<>,>< ; if there are several operations of the one level, they are examined from the left to the right.

(4) carrying out of logical negation NOT operations; if there are several operations of the one level, they are examined from the left to the right.

(5) carrying out of logical multiplication AND operations; if there are several operations of the one level, they are examined from the left to the right.

(6) carrying out of logical sum OR operations; if there are several operations of the one level, they are examined from the left to the right.

There are examples of logical expressions:

ABS(MOD-X1+Y1)<=1.0D-20

NOT (II=(2*N+1)*(2*NV+1) AND NU=0)

I=J+1

4. Program structure

program :

{ part }+

part :

main-part

simple-part

part-function

main-part :

MAIN PART name-part . declaration-of-part

simple-part :

PART name-simple-part . declaration-of-part

part-function :

FUNCTION name-function [type-function] . declaration-of-function

declaration-of-part :

formal-parameters-of-part BEGIN body-of-part END PART

formal-parameters-of-part :

[ list-name ] [RESULT list-name]

declaration-of-function :

formal-parameters-of-function BEGIN body-of-part END PART

formal-parameters-of-function :

list-name

body-of-part :

{ element-of-part }*

element-of-part :

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

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

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