Contents


Приложение 2. Синтаксические правила.

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 :
declaration .
operator .
iteration .

declaration :
declaration-of-domain
declaration-of-domain-indexes
declaration-of-scalar-variables
declaration-of-variables-on-domains
declaration-of-distribution-indexes
declaration-of-domain-parameters
declaration-of-input
declaration-of-output
declaration-of-external

declaration-of-domain :
declaration-of-unconditional-domain
declaration-of-conditional-domain
declaration-of-unconditional-domain
declaration-of-rectangular-domain
declaration-of-diagonal-domain
domain :
new-domain-without-name
name-domain
unconditional-domain :
new-domain-without-name
name-unconditional-domain
name-domain :
name-unconditional-domain
name-conditional-domain
name-unconditional-domain :
name-rectangular-domain
name-diagonal-domain
declaration-of-rectangular-domain :
multidimensional-domain
new-domain
multidimensional-domain :
onedimensional-domain
[ name-multidimensional-domain : ] ( domain-product )
domain-product :
component-domain { ; component-domain }+
component-domain :
multidimensional-domain
name-unconditional-domain
onedimensional-domain :
[ name-onedimensional-domain : ] ( name-index = value )
value :
range
const-expression
range :
const-expression .. const-expression
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 )
name-rectangular-domain :
name-onedimensional-domain
name-multidimensional-domain
name-new-domain
declaration-of-diagonal-domain :
name-diagonal-domain : name-unconditional-domain / list-condition-on-index
declaration-of-conditional-domain :
name-conditional domain , name-conditional-domain : name-domain / condition-on-domain

declaration-of-domain-indexes :
INDEX list-name-index

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-domain-parameters :
DOMAIN PARAMETERS list-prescription
prescription :
name-domain-parameter = int-const

declaration-of-input :
INPUT list-input-scalar
INPUT input-on-domain
input-scalar :
name-scalar [ attributes ]
input-on-domain :
list input-output-variable ON unconditional domain
input-output-variable :
name-variable-on-domain [ attributes ]

declaration-of-output :
OUTPUT list-output-scalar
OUTPUT output-on-domain
output-scalar :
name-scalar [ attributes ]
output-on-domain :
list- input-output-variable ON domain
attributes :
( list-attribute )
attribute :
string
ORDER( list-name-index )
FILE = ' file-name '
ALL
format
format :
I int-constant
{ F,E,D } int-constant . int-constant

file :
input-element { input-element }*
input-element :
name-scalar = arithm-constant;
name-variable-on-domain ( list-index-range ) = data ;
index-range :
name-index = int-constant .. int-constant
data :
list-data-element
data-element :
int-constant
body
int-constant ( data )

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

operator :
scalar-operator
operator-ASSUME
call-part

scalar-operator :
name-scalar = scalar-arithm-expression
scalar-arithm-expression :
arithm-expression

operator-ASSUME
FOR domain ASSUME relation { ; relation }*
relation :
name-variable-on-domain = arithm-expression
call-part
call-function :
call-reduction-function
call-standard-function
call-external-function
call-reduction-function :
name-reduction-function ( ( name-domain )arithm-expression )
call-standard-function :
name-standard-function ( arithm-expression )
name-m-standard-function ( {arithm-expression}+ )
name-reduction-function :
{ SUM,MULT,MAX,MIN }
call-external-function :
name-external-function [ ( list-in-parameter ) ]
in-parameter :
arithm-expression
name-variable-on-domain ON domain-of -parameter
iterated-variable-on-domain ON domain-of-parameter
name-external-simple-part
name-external-function
domain-of-parameter :
name-unconditional-domain
name-unconditional-domain / index-expression
name-unconditional-domain / ( list-index-expression )
iterated-variable-on-domain :
name-variable-on-domain [ name-iteration-index [-1] ]
name-standard-function :
sqrt
abs
exp
alog
alog10
sin
cos
asin
atan
sign
dsqrt
dabs
dexp
dalog
dalog
dsin
dcos
dasin
datan
dsign
entier
name-m-standard-function :
amax1
amin1
dmax1
dmin1

call-part :
COMPUTE name-part [ ( actual-parameters )]
actual-parameters :
[ list-in-parameter ] [ RESULT list-out-parameter ]
out-parameter :
name-scalar
name-variable-on-domain ON domain-of-parameter
iterated-variable-on-domain ON domain-of-parameter

iteration :
head-of-iteration
[ boundary-value ]
initial-value
body-of-iteration
exit-condition
end-iteration
head-of-iteration :
ITERATION list-iterated-element ON name-iteration-index .
iterated-element :
name-variable [ ( list-name-result ) ]
boundary-value :
BOUNDARY { operator .}+ END BOUNDARY
initial-value :
INITIAL name-iteration-index = 0 : { element-of-initial .}+
END INITIAL
element-of--initial :
operator
declaration-of-input
declaration-of-output
body-of-iteration :
{ element-of-iteration-body . }+
element-of-iteration-body :
operator
iteration
declaration-of-output
exit-condition :
EXIT WHEN log-expression
end-iteration :
END ITERATION name-iteration-index

letter :
{ A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z }
{ a,b,c,d,e,f,g,h,i,j k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}
digit :
{ 0,1,2,3,4,5,6,7,8,9 }
special-symbol :
special-symbol-not-apostrophe
apostrophe
special-symbol-not-apostrophe :
{ space ,=,>,>,+,-,*,/,(,),[,],!,?,,,.,#}
apostrophe :
'
space :
Space has no graphical representation.

identificator :
letter { { digit, letter } }*
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

operation :
{rel-operation, log-operation, arithm-operation }
rel-operation:
{ =,>,<,<=,>=,<>,>< }
rel-except-not-equal-operation :
{ =,>,<,>=,<= }
log-operation :
{ AND, OR, NOT }
arithm-operation :
{ +,-,*,/,** }
name :
identificator
list-name :
name { , name }*

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 ]
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

Contents