normDDe (1158428), страница 2
Текст из файла (страница 2)
<statement number> ::=<integer>
3.4List of iterations
List of iterations is used for holding iterations of Norma program in the form of structured sequence of tokens. It is created at the stage of part unit scanner and used for building Table of iterations structure and for passing iterations to be executed in Part unit parser. List of iterations is a temporary structure of compiler's data. After end of Part unit scanner work it isn't used anymore.
Norma program operators included into iteration are represented by references to the elements of List of Norma statements. Embedding structure of the iterations remains the same.
Structure of List of iterations:
|
| iteration | … | iteration |
Structure of <iteration> element:
| iteration number |
| head-of-iteration |
| list of boundary operators |
| list of initial operators |
| body-of-iteration |
| exit-condition |
| end-iteration |
<iteration number> ::=<integer>
<iteration number> - a unique number of iteration
<head-of-iteration> ::=<sequence of token codes for head-of-iteration >
< list of boundary operators > - list <statement number> (group e,f,g) from List of Norma statements:
|
| statement number | … | statement number |
<statement number> ::=<integer>
<list of initial operators> - list <statement number> (group e,f,g) from List of Norma statements
|
| statement number | … | statement number |
<statement number> ::=<integer>
<body-of-iteration> - list <statement number> (group g) from List of Norma statements or iteration elements (this is a way to represent embedded iterations).
|
| body element | … | body element |
<body element ::= <statement number> OR <iteration>
<statement number> ::=<integer>
<exit-condition> ::=<statement number>
<exit condition> - <statement number> (group g) from List of Norma statements
<end-iteration> ::=<sequence of token codes for end-iteration >
3.5Table of iterations structure
Table of iterations structure is used for holding iterations' structure in the form applied to execution in units Part unit parser’s, Data dependencies graph builder, Data dependencies graph analyser, FORTRAN DVM intermediate representation generator.
Line of Table of iterations structure has the following form:
|
| token-code of iteration index |
| list of iterated variables | list of enclosed iterations | list of boundary operators | list of initial operators | list of body operators |
<list of iterated variables> - list of iterated variables' names and corresponding names of result variables ( from the previous and current iterations )
|
| first result variable name | second result variable name | iterated | first | second | … |
< list of enclosed iterations > - references to <iteration number> from Table of iterations structure:
|
| iteration number | … |
<iteration number> ::=<integer>
< list of boundary operators > - list <statement number> (group e,f,g) from List of Norma statements
|
| statement number | … | statement number |
<statement number> ::=<integer>
<list of initial operators> - list <statement number> (group e,f,g) from List of Norma statements
|
| statement number | … | statement number |
<statement number> ::=<integer>
< list of body operators > - list <statement number> (group g) from List of Norma statements
|
| statement number | … | statement number |
<statement number> ::=<integer>
3.6Statements-lines table
Statements-lines table is used for holding information about the location of Norma program statements in the lines of <source-file>.
Line of Statements-lines table has the following form :
| statement number | begin line number | end line number |
<statement number> ::=<integer>
<begin line number> ::=<integer>
<end line number> ::=<integer>
This information means that Norma statement with number <statement number> from List of Norma statements begins in the source file from the line with number <begin line number> and ends at the line with number <end line number>.
3.7Table of ordered groups
Table of ordered groups is used for holding information about those Norma program operators which the mode of sequential computations is set for.
Structure of Table of ordered groups:
| ordered group |
| ordered group |
| ... |
Structure of <ordered group> element:
|
| statement number | … | statement number |
<statement number> ::=<integer>
This information means that mode of sequential computations is set for Norma - operators with numbers <statement number> from Table of ordered groups.
3.8List of errors
List of errors is used for holding information about errors and warnings in Norma program. This information has internal representation.
Structure of List of errors:
|
| errors in lines | … | errors in lines |
Structure of <errors in lines> element:
|
| error code | … | error context | error code | begin line number | end line number |
<error context>::=<sequence of token codes>
<error code>::=<integer>
<begin line number> ::=<integer>
<end line number> ::=<integer>
Each error is represented by pair <error context><error code>.
Element errors in lines gives information about all the errors with defined <error context><error code> in lines <begin line number>-<end line number> of the source file.
Information about error is put into List of errors by function ero with parameters
<error context><error code><statement number>
For the errors related to the program as a whole <statement number>=’*’.
3.9Table of domains
Table of domains is used for holding information about domains used in Norma-program. In domains processing we also use some supplementary data structures: Table of ranges, Table of conditions, Table of diagonals.
Line of Table of domains has the form:
| name of domain | shape | indexes | subdomains | conditional |
<name of domain>::=<token code>
<shape>::=<integer>
<indexes>::=<sequence of tokens>
<subdomains>::=<name of domain> OR <name of range>
<conditional>::=<condition number>Y OR <condition number>N
<shape> - domain's dimension (number of indexes)
<indexes> - list of domain's indexes
<subdomains> - names of elementary (one-dimensional) subsets which Cartesian product makes given set. If set is elementary (i.e. <shape>=1), then <subdomain> is a reference to the line of additional Table of ranges.
<conditional> - empty field for unconditional domains; for conditional domains it has a reference to the line in Table of conditions and attribute of condition's truth: Y - true, N - false. It is possible to define only one pair of conditional domains in one declaration in the Norma language: the first domain corresponds to the condition with true value and the second one - to the condition with false value. After processing such a declaration two lines are put into Table of domains, they differ from each other only in attributes Y and N but the references to Table of conditions coincide.
3.9.1Table of ranges
Line of Table of ranges has the form:
| name of range | begin of range | end of range |
<name of range>::=<token code>
iteration
iterated variable name
error context














