NORMA_DD (1158356), страница 10
Текст из файла (страница 10)
Stacks nom and mom are used in processing of any operator. Top of stack nom contains statement number of operator being processed at the moment ( for scalar-operator stack scalar-operator is empty at start).
General structure of function kvopr1 control is given in the following scheme.
scop
k
vopr1 opv6
kvo2
Function kvopr1 calls function scop (processing scalar-operator), opv6 (processing operator-ASSUME) or kvo2 (processing call-part in operator-ASSUME or out of operator-ASSUME) depending on the type of operator.
Function fixes errors:
error code 80 'incorrect left side of operator ASSUME: '<error context>' can not have indexes'
error code 415 'incorrect operator'
5.3.5.1Processing scalar-operator (function scop)
Norma syntax:
scalar-operator :
name-scalar = scalar-arithm-expression
General structure of function scop control is given in the following scheme.
s
cop doplfs a b1 zapf dopkdc dopgdc
Function doplfs checks if the variable in the left part of scalar-operator is allowable.
Function fixes error:
error code 72 'incorrect scalar-operator '<error context>
Other functions process the right part of scalar-operator.
Function a builds Polish notation for arithmetical expression in the right part of the operator. If in this procedure errors are detected processing of operator is cancelled.
Function fixes error:
error code 75 'incorrect expression'<error context>
Function b1 checks if the terms of scalar arithmetical expression represented in the Polish notation are allowable. The terms could be scalars, arithmetical constants, domain’s parameters, function calls, variables on domain with index-constants. The line for the terms of these types is created to write into Table of functional dependencies.
Besides additional processing for function calls is performed.
1) For call-reduction-function information is put into additional table summa, which line has the form
| statement number | name-reduction-domain |
Arithm-expression, which reduction-function is applied to, is passed for processing to function b (see 5.3.5.2). Also name-reduction-domain is put into stack mom.
2) For call-external-function information is put into additional table funpol, which line has the form
| statement number | name-external function |
and additional table exter which line has the form
| name-external function |
Function b1 fixes errors:
error code 74 'incorrect scalar expressiion'<error context>
error code 315 'incorrect index of variable'<error context>
error code 317 'incorrect index of scalar'<error context>
error code 5 'value of variable'<error context>’is not in declaration domain’
error code 55 'iteration index'<error context> of variable'<error context>’has false displacement’
Function zapf writes information about operator into Table of functional dependencies and the body of operator into Table of operators body.
Function dopkdc writes information about operator into What-compute table.
Function dopgdc writes information about operator into Where-compute table.
5.3.5.2Processing of operator-ASSUME (function opv6)
Norma syntax:
operator-ASSUME
FOR domain ASSUME relation { ; relation }*
relation :
name-variable-on-domain = arithm-expression
General structure of function opv6 control is given in the following scheme.
doprg
o
pv6 mnoz doplef a b opv1 zapf
dopkdc dopgdc
Function mnoz (see 5.3.2.1) processes operator's domain. If during this procedure errors are detected operator's processing is cancelled, otherwise token code of operator domain's is put into stack mom.
Function doplef (see 5.3.3) checks if the variable in the left part of -operator-ASSUME is allowable.
Other functions process the right part of scalar--ASSUME.
Function a (see 5.3.5.1) builds Polish notation for arithmetical expression in the right part of operator.
Function b checks if the terms of scalar arithmetical expression represented in the Polish notation are allowable. The terms could be scalars, arithmetical constants, domain’s parameters, indexes, function calls, variables on domain. The line for the terms of these types is created for writing into Table of functional dependencies. Function b is analogue of function b1 (see 5.3.5.1), except additional processing for term variable on domain. This processing is performed by function doprg.
Function b fixes errors:
error code 75 'incorrect expression'<error context>
error code 73 'value of index '<error context>' undefined'
Function doprg checks if variable on domain in operator-ASSUME is used correctly. Thus three conditions are checked:
1) indexes in index expressions of the variable must correspond to the indexes of definitional domain of variable,
2) indexes in index expressions of the variable must correspond to the indexes of operator's domain,
3) domain need-domain for variable must be included into the definitional domain of the value.
Besides checking these conditions function restores full index expressions if some indexes are given by default.
Function doprg fixes errors:
error code 71 'incorrect expression'<error context>
error code 311 'incorrect value of index'<error context>
error code 312 'incorrect index of variable' <error context>': '<error context>' is not integer constant’
error code 313 'incorrect index of variable' <error context>': '<error context>' is not index’
error code 314 'incorrect index of variable' <error context>': there is not sign before constant expression'
error code 315 'incorrect index of variable'<error context>
error code 316 'incorrect index of variable'<error context>': '<error context>' <0’
error code 317 'incorrect index of scalar'<error context>
error code 319 'incorrect index '<error context>' of variable '<error context> ': in ITERATION ON '
Function opv1 processes domain if it is conditional-domain. Logical condition is taken from Table of conditions and processed functions a and b. Information about terms of logical condition is included into Table of functional dependencies by function zapf for analysed operator.
Function zapf puts information about operator into Table of functional dependencies and the body of operator into Table of operators body.
Function dopkdc puts information about operator into What-compute table.
Function dopgdc puts information about operator into Where-compute table.
5.3.5.3Processing of call-part (function kvo2)
Norma syntax:
call-part :
COMPUTE name-part [ ( actual-parameters )]
actual-parameters :
[ list-in-parameter ] [ RESULT list-out-parameter ]
General structure of function kvo2 control is given in the following scheme.
k
vo2 mnoz kvoc paramt obrraz zapf
dopkdc dopgdc
Function mnoz (see 5.3.2.1) processes operator's domain. If in this procedure errors have been detected processing of operator is cancelled otherwise token code of operator's domain is put into stack mom. In processing call-part, which isn't included into operator-ASSUME, function mnoz isn't called and stack mom is empty.
Function kvoc analyses actual-parameters and calls function paramt for processing list-in-parameter and (or) list-out-parameter, setting attributes inout =’R’, env=’O’ in the first case, inout =’L’, env=’O’ in the second case.
Function paramt is universal function for processing list-parameter and in addition it receives attribute inout as an argument (for list-in-parameter inout =’R’, for list-out-parameter inout =’L’), and attribute env (type of call's environment: env =’O’ for call-part, set out of the construction iteration, env =’B’ for call-part set in boundary-value of construction iteration, env =’H’ for call-part set in initial-value of construction iteration, env =’P’ for call-part set in body-of-iteration.
Function chooses current parameter from list-parameter and depending on the type of parameter it calls corresponding function (functions) of parameter's processing:
in-parameter : function
arithm-expression b a
name-variable-on-domain ON domain-of -parameter espis3,espis4
iterated-variable-on-domain ON domain-of-parameter espis7,espis8
name-external-simple-part espis1
name-external-function espis1















