NORMA_DD (1158356), страница 8
Текст из файла (страница 8)
multidimensional-domain
new-domain
multidimensional-domain :
onedimensional-domain
[ name-multidimensional-domain : ] ( domain-product )
onedimensional-domain :
[ name-onedimensional-domain : ] ( name-index = value )
new-domain :
[ name-new-domain : ] new-domain-without-name
declaration-of-diagonal-domain :
name-diagonal-domain : name-unconditional-domain / list-condition-on-index
It calls functions onedim (processing onedimensional-domain), multidim (processing multidimensional-domain), condm (processing new-domain or diagonal-domain) depending on the type of declaration.
Function fixes error:
error code 9 'incorrect domain'<error context>
error code 17 'repeated declaration of domain '<error context>
5.3.2.2Onedimensional domain declaration parsing (function onedim)
It analyses and processes onedimensional-domain. Syntax in Norma language:
onedimensional-domain :
[ name-onedimensional-domain : ] ( name-index = value )
value :
range
const-expression
range :
const-expression .. const-expression
1) Constant expressions const-expression which are the boundaries of ranges (function wyc) are computed. First polish notation is built by constant expression function poliz, then function wyc1 interprets polish notation and calculates its value, function zapk puts calculated values into Constant table.
2) Information about range is written into Table of ranges, information about domain - into Table of domains, information about name-onedimensional-domain and name-index -into Symbol table, name-index is written to Table of ordered indexes if it hasn't been there before.
Function fixes errors:
error code 10 'incorrect boundary of range'
error code 8 <error context>' is not DOMAIN PARAMETERS
error code 74 'incorrect scalar expression '<error context>
Function fixes warning:
error code 7 'range for index'<error context>'consists from one point'
5.3.2.3Multidimensional domain declaration parsing (function multidim)
It analyses and processes multidimensional-domain. Syntax in Norma-language:
multidimensional-domain :
onedimensional-domain
[ name-multidimensional-domain : ] ( domain-product )
domain-product :
component-domain { ; component-domain }+
component-domain :
multidimensional-domain
name-unconditional-domain
It sorts out domains included into domain-product by recursion and calls function onedim for processing onedimensional-domain.
Information about domain is written into Table of domains by function cokm, which checks the unique type of indexes in domain-product.
Function fixes errors:
error code 12 'repeated index'<error context>
5.3.2.4New-domain and diagonal domain parsing (function condm)
It analyses and processes new-domain and diagonal-domain. Syntax in Norma language:.
new-domain :
[ name-new-domain : ] new-domain-without-name
new-domain-without-name :
name-unconditional-domain / list-modification
modification :
name-index = value
name-onedimensional-domain { { +,- } boundary-function }+
boundary-function :
LEFT( const-expression )
RIGHT( const-expression )
declaration-of-diagonal-domain :
name-diagonal-domain : name-unconditional-domain / list-condition-on-index
General structure of function condm control is given in the following scheme.
grank
c
ondm inf listus con1 usl mnoz alp1
uslnew
Function inf chooses information about root domain name-unconditional-domain from Table of domains (new-domain and diagonal-domain are processed in the same way).
Function fixes errors:
error code 409 ‘indefined domain’<error context>
Function listus extracts elements list-modification or list-condition-on-index and puts them into list list-condition.
Function con1 analyses the result of function inf work: if root domain isn't declared processing is cancelled in other case function usl is called.
Function usl analyses the type of condition in list-condition and calls function grank (processing of conditions name-onedimensional-domain{{+,-}boundary-function}), or function mnoz (see. 5.3.2.1) (processing conditions name-index = value), or function uslnew (processing conditions condition-on-index).
Function fixes errors:
error code 16 ‘incorrect conditional domain’<error context>.
Function grank calls function wyc (see. 5.3.2.2) for calculation the value of const-expression from boundary-function, function graz for obtaining information about name-onedimensional-domain, and function grana for obtaining modified one-dimensional domain.
Function fixes errors:
error code 20 'incorrect name of domain '<error context>
error code 21 <error context>' is not one-dimensional domain'
error code 16 ‘incorrect conditional domain’<error context>
error code 22 'incorrect parameter '<error context>' of function LEFT or RIGHT'
error code 23 'negative boundary of range for index '<error context>
Function uslnew builds Table of diagonals for declaration-of-diagonal-domain.
For processing of list-condition-on-index function zapu (see 5.3.2.6.) used, for including information about name-diagonal-domain into Table of diagonals function con_2 used, information about name-diagonal-domain for including into Table domains passed to function alp1.
Function fixes errors:
error code 1 'constant '<error context>' in condition on index '<error context>
error code 2 'range for index '<error context>’consists from one point’
error code 3 <error context> ‘has not index’<error context>
error code 14 'domain with conditions on indexes '<error context>' and '<error context>' is empty'.
Function alp1 writes information about the domain designed in the result into Table of domains.
Function fixes errors:
error code 18 'undefined subdomain '<error context>' in condition'.
error code 19 'undefined index '<error context>' in condition'.
5.3.2.5Declaration of variable parsing (function opisdef)
It analyses and processes declarations of variables, DISTRIBUTION INDEX, EXTERNAL. Syntax in Norma language:.
declaration-of-scalar-variables :
VARIABLE list-name-scalar [ type ]
declaration-of-variables-on-domains :
VARIABLE list-name-variable-on-domain DEFINED ON name-unconditional-domain [ type ]
type :
{ REAL, INTEGER, DOUBLE }
declaration-of-external-names :
declaration-of-external-functions
declaration-of-external-parts
declaration-of-external-functions :
EXTERNAL FUNCTION list-name-external-function [ type ]
declaration-of-external-parts :
EXTERNAL PART list-name-external-simple-part
declaration-of-distribution-indexes :
DISTRIBUTION INDEX name-index = simple-range , name-index = simple-range
simple-range :
int-constant .. int-constant
Function receives a statement from group c of List of Norma statements, calling function kbdef.
The result of function opisdef is information about the names of variables and external names written into Symbol table, information written into Table of distribution indexes, or information about detected errors written into List of errors.
General structure of function opisdef control is given in the following scheme.
opissk
opisve
o
pisdef rcodf
fcodf
ind_proc
Functions opisdef call function opissk, opisve, rcodf, fcodf, ind_proc depending on the type of statement (declaration-of-scalar-variables, declaration-of-variables-on-domains, declaration-of-external-functions, declaration-of-external-parts, declaration-of-distribution-indexes).
Function opissk analyses and processes declaration-of-scalar-variables - writes information about name-scalar into Symbol table.
Function fixes error:
error code 407 'incorrect list element of variables'<error context>
Function opisve analyses and processes declaration-of-variables-on-domains - writes information about name-variable-on-domain into Symbol table.
Function fixes errors:
error code 407 'incorrect list element of variables'<error context>
error code 412 'incorrect declaration of variable'<error context> ’: undefined domain’
Function rcodf analyses and processes declaration-of-external-parts - writes information about name-external-simple-part into Symbol table.
Function fixes error:
error code 170 'incorrect list element of external parts'<error context>
Function fcodf analyses and processes declaration-of-external-functions - writes information about name-external-function into Symbol table.
Function fixes error:
error code 169 'incorrect list element of external functions'<error context>
Function ind_proc analyses and processes declaration-of-distribution-indexes and fills in Table of distribution indexes.
Function fixes errors:
error code 65 'incorrect distribution index:’ <error context>
error code 66 'incorrect distribution index:incorrect number’ <error context>
5.3.2.6Conditional domain parsing (function opiska)
It analyses and processes conditional-domain. Syntax in Norma language:
declaration-of-conditional-domain :
name-conditional domain , name-conditional-domain : name-domain / condition-on-domain















