normDDe (1158428), страница 7
Текст из файла (страница 7)
error code 63 'iteration index <error context>' differs from index of '<error context>
error code 54 'missed <error context> in ITERATION ON '<error context>
Function nino analyses the value of counter of errors in iteration fat and state of stack of iterations iter_stack.
If iter_stack contains 1 record and fat=0 (external iteration and there's no errors), function line is called for continuation of part unit scan.
If iter_stack contains 1 record and fat>0 (external iteration and there are errors), the value of field <iteration number> is passed from iter_stack into err_kwit and function line is called for continuation of part unit scan.
If iter_stack contains >1 records and fat=0 (enclosed iteration and there is no errors), top of stack is cleaned and function spuskitordo is called for continuation of analysing iteration body.
If iter_stack contains >1 records and fat>0 (enclosed iterations and there are errors), the value of field iteration number is passed from iter_stack into err_kwit, top of stack is cleaned and function spuskitordo is called for continuation of analysing iteration body.
Function spuskitordo extracts operators one after another (ASSUME, OUTPUT, COMPUTE, scalar operator) and passes them to function thisfor for processing.
If token ITERATION is detected it calls function lhead for processing enclosed iteration.
If token EXIT WHEN is detected it extracts condition of exit from iteration and passes it to function thisfor for processing, calls function spuskend to search for END ITERATION.
If an attribute denoting end of search is ERROR it calls function of termination of processing iteration nino.
Function fixes errors:
error code 54 'missed <error context> in ITERATION ON '<error context>
error code 62 'incorrect operator or declaration in ITERATION ON''
error code 111 'incorrect using #...#''
Function thisfor analyses a statement from iterqation. If statement begins with # (attribute of sequential computations' mode ) then seq= -seq; if seq>0, next line of Table of ordered groups is set.
Statement in the form of sequence of tokens is put into corresponding group of List of Norma statements by function writetab [5.2.9].
Operator ASSUME which consists of several relations is divided into statements by function cooth [5.2.9]. The number of statements is equal to the number of relations.
Function thisfor returns <statement number> of processed statement (or list of statement number for ASSUME operator, which consists of several relations) to calling function.
Function fixes error:
error code 61 'incorrect operator in ITERATION ON'
Function spuskend searches for token END ITERATION, analyses correspondence of iteration index in the header of iteration and in END ITERATION and calls function of iteration processing termination nino.
Function fixes errors:
error code 54 'missed <error context> in ITERATION ON '<error context>
error code 111 'incorrect using #...#''
error code 63 'iteration index <error context>' differs from index of '<error context>
5.2.9Statement processing(function kbaht)
Statement in the form of sequence of tokens is put into corresponding group of List of Norma statements by function writetab.
General structure of function kbaht control is given in the following scheme.
k
baht writetab in_kwant
cooth
Operator ASSUME, which consists of several relations is divided into statements by function cooth. The number of statements is equal to the number of relations. Each statement is given a unique statement number.
Function writetab determines group of Списка Норма-предложений (List of Norma statements) (group a-g) which statement must be included in and fixes next statement number (increasing counter kba=kba+1).
Function in_kwant
-
checks correctness of brackets' structure (brackets ‘(’ и ‘)’, ‘[’ и ‘]’) in the given statement,
-
puts statement into the corresponding group of List of Norma statements,
-
puts the line given below into Statements-lines table:
| statement number | bline | eline |
and fixes value bline=eline,
4) puts statement number into Table of ordered groups, if mode of sequential computations is set (seq=-1).
Function in_kwant fixes error:
error code 401 'open bracket '<error context>
5.2.10Stop compilation detection (function StopCompile)
1) glob=glob+osh, globw=globw+osh1
2) calls function stop - entry point of Exit from compilation.
5.2.11Scanning termination (function EndLex)
It terminates work of part unit scanner and passes information for processing at next stages of translation. It calls functions from the next units of translator.
General structure of function control is given in the following scheme.
E
ndLex table_it_struct parser listing
graf
erroutall forprint erroutall isiofile
e
xit_part_compile
Function table_it_struct converts List of iterations into Table of iterations structure.
Function parser - entry point of Part unit parser, (processing of definitions, operators, iterations),
Function listing - entry point of Listing generator (output of source program text and compiler's messages after parsing ),
Function graf - entry point of Data dependencies graph builder,
Function erroutall - entry point of Listing generator (output of compiler's messages after building and analysing Data dependencies graph and creating Fortran-DVM program),
Function forprint - entry point of unit Fortran DVM code generator (generating text representation of output Fortran DVM program).
Function isiofile - input point of Input files analyser (analysis of input data files).
Function exit_part_compile - entry point of unit Exit from part unit compilation.
5.3Part unit parsing
The purpose is parsing of Norma-program statements and their conversion into internal representation. Each statement of Norma-program is given in the form of sequence of tokens and the unique number of the statement. After analysing corresponding data structures of the compiler are filled in.
General structure of Part unit parser control is given in the following scheme.
p
arser kvpar1 kvop1 kbbxo kbbyx
kvopr1 kbiter
5.3.1Group a statements processing (function kvpar1)
It processes declarations DOMAIN PARAMETERS, INDEX. Syntax in Norma language:
declaration-of-domain-parameters :
DOMAIN PARAMETERS list-prescription
prescription :
name-domain-parameter = int-const
declaration-of-domain-indexes :
INDEX list-name-index
Function receives a declaration from group a of List of Norma statements and calls function kbpar.
listp
k
vpar1
porind
Function listp (processing DOMAIN PARAMETERS) or function porind (processing INDEX) are called depending on the type of declaration.
Function listp writes into Symbol table corresponding information about each name-domain-parameter (attribute ‘P’ and value int-const).
Function fixes errors:
error code 24 'incorrect DOMAIN PARAMETERS '<error context>
error code 25 'value of DOMAIN PARAMETERS '<error context>'is not integer’
Function porind writes name-index from the list of indexes into Table of ordered indexes and Symbol table, corresponding information about each name-index (attribute ‘I’).
Function fixes errors:
error code 31 incorrect list element of indexes'.
error code 32 'index '<error context>' declared twice'
error code 33 'incorrect index'<error context>
5.3.2Group b,c,d statements processing (function kvop1)
It processes declarations of domains, variables, DISTRIBUTION INDEX, EXTERNAL, declarations of conditional domains, - groups b,c,d of Cписка Норма предложений (List of Norma statements). Syntax in Norma language:
General structure of function kvop1 control is given in the following scheme.
k
vop1 opisdom opisdef opiska
Function opisdom processes declarations of domains. Syntax in Norma language:
declaration-of-unconditional-domain
declaration-of-rectangular-domain
declaration-of-diagonal-domain
Function receives a declaration of conditional domain from group b of List of Norma statements and calls function kbdomain.
The result of function opisdom work is information about domain written into Symbol table, Table of domains and Table of ranges, information about errors written into List of errors.
General structure of function opisdom control is given in the following scheme.
condm
o
pisdom
mnoz m
ultidim















