DataMuseum.dk

Presents historical artifacts from the history of:

DANOSI

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DANOSI

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦c3f62596c⟧ TextFile

    Length: 14336 (0x3800)
    Types: TextFile
    Names: »RTPDIAG.SYN«

Derivation

└─⟦0634bcb0f⟧ Bits:30010529 ABA: RTP syndia RC macro DVBS1.SW2114.src.2.6-7 PN 99110141
    └─⟦this⟧ »RTPDIAG.SYN« 

TextFile

"\r
\r
REAL-TIME PASCAL SYNTAX DIAGRAMS.\r
---------------------------------\r
\r
The diagrams of this chapter are those of Appendix B of\r
the Real-Time Pascal Reference Manual, however, the\r
section references are replaced by sequence numbers.\r
The sequence number of a diagram is intended as a unique\r
identification of the diagram. This facilitates a simple\r
correspondence between the diagrams of this chapter and the\r
diagrams which define an intermediate language between\r
two passes of the compiler.\r
\r
The diagrams constitute the input language of the compiler,\r
with language symbols specified in capital letters, and\r
indication of occurrences of syntax categories, in form\r
of category name in small letters.\r
\r
\r
It is the purpose of pass one to check that the syntax rules\r
are observed by the input text. The semantical checks, as\r
specified in the Reference Manual and in the User's Guide,\r
must be carried out by later passes of the compiler.\r
Checks and actions concerning a specific diagram are listed\r
below the diagram, together with an indication of the\r
responsible pass, or if a run time check is necessary\r
the indication: code.\r
\r
\r
"\r
$syndia01\r
<'compilation unit'>=\r
( !\r
+<context> '.'/-\r
)\r
+<'program declaration'>!\r
<'routine declaration'>\r
/';'-\r
'.'\r
;\r
\r
$syndia02\r
<context>=\r
<'context_name'> ';'\r
+\r
<'constant declaration'>!\r
<'type declaration'>!\r
<'external_routine declaration'>\r
/';'-\r
;\r
\r
$syndia03\r
<name>=\r
(<letter>! '_')\r
+\r
(!\r
<letter>\r
!\r
<digit>!\r
'_'\r
)\r
/ -\r
;\r
\r
$syndia04\r
<'program declaration'>=\r
<'program heading'>';'<'program block'>;\r
\r
$syndia05\r
<'routine declaration'>=\r
function\r
<'function heading'>\r
!\r
procedure\r
<'procedure heading'>\r
';'<'routine block'>;\r
\r
$syndia06\r
<'program heading'>=\r
program <'program_name'> (!<'formal parameters'>) ;\r
\r
"pass2: The result type of a function must be an ordinal\r
or pointer type."\r
\r
$functheading\r
<'function heading'>=\r
<'function_name'>\r
(!<'formal parameters'>)':'<'common type specification'>\r
;\r
\r
$procheading\r
<'procedure heading'>=\r
<'procedure_name'>\r
(!\r
<'formal parameters'>\r
)\r
;\r
\r
$syndia08\r
<'formal parameters'>=\r
'('\r
+\r
(!var!inspect!shared)\r
+<'formal_name'>/','-\r
':'<'formal type specification'>\r
/';'-\r
')'\r
;\r
\r
$syndia09\r
<'formal type specification'>=\r
<'type definition'>!\r
<'defined type'>!\r
<'parameterized-type_name'>\r
;\r
\r
$syndia10\r
<'program block'>=\r
(!<'program declaration part'>';')<'compound statement'>!\r
external\r
;\r
\r
$syndia11\r
<'routine block'>=\r
(!<'routine declaration part'>';')<'compound statement'>!\r
external!\r
forward\r
;\r
\r
$syndia12\r
<'program declaration part'>=\r
+\r
<'common declaration'>!\r
<'shared declaration'>!\r
<'program declaration'>\r
/';'-\r
;\r
\r
$syndia13\r
<'routine declaration part'>=\r
+<'common declaration'>/';'-\r
;\r
\r
$syndia14\r
<'common declaration'>=\r
<'constant declaration'>!\r
<'type declaration'>!\r
<'variable declaration'>!\r
<'routine declaration'>\r
;\r
\r
$syndia15\r
<'constant declaration'>=\r
const + <name>'='<expression>/';'-;\r
\r
"pass2: detect the type of the constant, and check that\r
       the expression only involves constants."\r
\r
$syndia16\r
<'type declaration'>=\r
type\r
+<'single type declaration'> /';' -\r
;\r
\r
$syndia17\r
<'single type declaration'>=\r
<'forward-type_name'>!\r
(\r
<'bound-type_name'>!\r
<'parameterized type'>\r
) '=' <'common type specification'>;\r
\r
$paramtype\r
<'parameterized type'>=\r
<'parameterized-type_name'><'formal type parameters'>\r
;\r
\r
$syndia24\r
<'common type specification'>=\r
<'type definition'>!\r
<'parameterized type binding'>\r
<'defined type'>\r
;\r
\r
$syndia19\r
<'type definition'>=\r
<'ordinal-type definition'>!\r
<'pointer-type definition'>!\r
<'set-type definition'>!\r
<'structured-type definition'>\r
;\r
\r
$syndia20\r
<'ordinal-type definition'>=\r
<'enumeration-type definition'>!\r
<'subrange definition'>\r
;\r
\r
$syndia21\r
<'enumeration-type definition'>=\r
'('\r
(<'scalar_name'>!'?')\r
+',' (<'scalar_name'>!'?')/-\r
')'\r
;\r
\r
$syndia22\r
<'subrange definition'>=\r
<'lower-bound_expression'>\r
'..'\r
<'upper-bound_expression'>\r
;\r
\r
"pass2: detect the base type of the subrange\r
pass3: if possible, check non negative number of elements\r
       otherwise let pass4 generate code for a run time check."\r
\r
$syndia23\r
<'pointer-type definition'>=\r
'^' <'common type specification'>\r
;\r
$syndia25\r
<'defined type'>=\r
<'predefined ordinal type'>!\r
<'shielded type'>!\r
<'bound-type_name'>\r
;\r
\r
$syndia26\r
<'predefined ordinal type'>=\r
<boolean>!\r
<char>!\r
<integer>!\r
<double>\r
;\r
\r
$syndia28\r
<'shielded type'>=\r
<mailbox>!\r
<reference>!\r
<pool>!\r
<process>!\r
<port>!\r
<chain>!\r
<'external program type'>\r
;\r
\r
$extprog\r
<'external program type'>=\r
external program\r
<'formal parameters'>\r
;\r
\r
$syndia29\r
<'parameterized type binding'>=\r
<'parameterized-type_name'>\r
'('\r
<'actual type parameters'>\r
')'\r
;\r
\r
"pass2: check actual parameter list against formal parameter\r
       list for accordance with types and number of parameters."\r
\r
$syndia30\r
<'actual type parameters'>=\r
+<expression>/','-\r
;\r
\r
$syndia31\r
<'formal type parameters'>=\r
'('\r
+\r
+<'type-parameter_name'>/','-\r
':'\r
<'common type specification'>\r
/ ';' -\r
')' ;\r
\r
$syndia32\r
<'set-type definition'>=\r
set of <'common type specification'>\r
;\r
\r
"pass2: check that the type is an ordinal type."\r
\r
$syndia33\r
<'structured-type definition'>=\r
(!packed)\r
(<'array-type definition'>!\r
<'record-type definition'>)\r
;\r
\r
$syndia34\r
<'array-type definition'>=\r
array '(' <'common type specification'> ')' of <'common type specification'>\r
;\r
\r
"pass1: allow shorthand notation for multi dimensional arrays.\r
pass2: the idex type must be an ordinal type."\r
\r
$syndia35\r
<'record-type definition'>=\r
record\r
+\r
+(<'field_name'>!'?')/','-\r
':'\r
<'common type specification'>\r
/';'-\r
end \r
;\r
\r
"pass2: test for distinct field names;\r
       a field type must not be specified by an\r
       'enumeration-type definition'."\r
\r
$syndia37\r
<'variable declaration'>=\r
var\r
+<'variable specification'>/';'-\r
;\r
\r
$syndia38\r
<'shared declaration'>=\r
shared\r
+<'variable specification'>\r
/';'-\r
;\r
\r
$syndia39\r
<'variable specification'>=\r
+<name>/','-\r
':'<'common type specification'>\r
(!':='<'initialization_expression'>)\r
;\r
\r
"pass2: if an initial value is present the type of the expression\r
       must be assignable to the specified type of the variable,\r
       and it may not contain function calls except for the\r
       predefined: abs, byt, chr, int, ord, prod, succ, and wrd.\r
       The type of a shared variable must not be process, reference,\r
       or chain."\r
\r
$syndia40\r
<'compound statement'>=\r
begin\r
+<statement>/';'-\r
end;\r
\r
$syndia41\r
<statement>=\r
(\r
!\r
<'compound statement'>!\r
<'assignment statement'>!\r
<'exchange statement'>!\r
<'if statement'>!\r
<'case statement'>!\r
<'for statement'>!\r
<'loop statement'>!\r
<'while statement'>!\r
<'repeat statement'>!\r
<'procedure call'>!\r
<'exitloop statement'>!\r
<'continueloop statement'>!\r
<'exit statement'>!\r
<'goto statement'>!\r
<'labelled statement'>!\r
<'with statement'>!\r
<'lock statement'>!\r
<'region statement'>\r
)\r
;\r
\r
$syndia42\r
<'assignment statement'>=\r
<'variable denotation'> ':=' <expression>;\r
\r
"pass2, code: type check, assignment compatibility, and range check.\r
pass2: variable may not be of a shielded type or of a\r
       structured type with shielded component types."\r
\r
$syndia43\r
<'variable denotation'>=\r
<'object denotation'>!\r
<'function_name'>\r
;\r
\r
$syndia44\r
<'exchange statement'>=\r
<'object denotation'>\r
':=:'\r
<'object denotation'>\r
;\r
\r
"pass2: check equal types.\r
       the type of the variables, or any of its component types\r
       must not be mailbox, pool, chain, or port."\r
\r
$syndia45\r
<'if statement'>=\r
if <'boolean_expression'> then <statement>\r
(!else <statement>)\r
;\r
\r
"pass2: the type of the expression must be boolean."\r
\r
$syndia46\r
<'case statement'>=\r
case <'selecting_expression'> of\r
+<'case element'>/';'-\r
<'end case'>\r
;\r
\r
"pass2: the selecting expression must be of an ordinal type."\r
\r
$syndia47\r
<'case element'>=\r
+<expression>(!'..'<expression>)/','-\r
':'\r
<statement>\r
;\r
\r
"pass2: all the label expressions must be constant, and be\r
       type compatible with the selecting expression.\r
pass3: all the case labels must be distinct."\r
\r
$syndia48\r
<'end case'>=\r
(!otherwise\r
+<statement>/';'-\r
)\r
end\r
;\r
\r
"pass3, pass4: if the OTHERWISE part is empty an implicit one must\r
       be generated with code to make a fault occur, if\r
       executed."\r
\r
$syndia49\r
<'for statement'>=\r
for <'for_name'> ':='\r
<'iteration description'>\r
do\r
<statement>\r
;\r
\r
"pass2: the object denoted by for_name acts as a constant in \r
       the statement following DO.\r
       The type of the for_name object is a subrange type with\r
       the iteration expressions as limits, i.e. if TO is specified\r
       the range interval is  expression1 .. expression2  (possibly\r
       an empty interval) and if DOWNTO is specified the range interval\r
       is  expression2 .. expression1  traversed in reverse order."\r
\r
$syndia50\r
<'iteration description'>=\r
<'start_expression'>\r
(to!downto)\r
<'stop_expression'>\r
;\r
\r
"pass2: the expressions must be of the same ordinal type."\r
\r
$syndia51\r
<'loop statement'>=\r
loop\r
+<statement>/';'-\r
endloop\r
;\r
\r
$syndia52\r
<'while statement'>=\r
while <'boolean_expression'> do <statement>;\r
\r
"pass2: the type of the expression must be boolean."\r
\r
$syndia53\r
<'repeat statement'>=\r
repeat\r
+<statement>/';'-\r
until <'boolean_expression'>\r
;\r
\r
"pass2: the type of the expression must be boolean."\r
\r
$syndia54\r
<'procedure call'>=\r
<'procedure_name'>\r
(!<'actual parameters'>)\r
;\r
 \r
"pass2: check actual parameter list against formal parameter list."\r
\r
$syndia55\r
<'function call'>=\r
<'function_name'>\r
(!<'actual parameters'>)\r
;\r
\r
"pass2: check actual parameter list against formal parameter list."\r
\r
$syndia56\r
<'actual parameters'>=\r
'(' +\r
<'expression'>!\r
'?'\r
/','- ')'\r
;\r
\r
"pass3: if address transfer then check the object to be regular."\r
\r
$syndia57\r
<'exitloop statement'>=\r
exitloop;\r
\r
$syndia58\r
<'continueloop statement'>=\r
continueloop;\r
\r
$syndia59\r
<'exit statement'>=\r
exit;\r
\r
$syndia60\r
<'goto statement'>=\r
goto\r
<'label_name'>\r
;\r
\r
"pass2: check definition of label at legal scope."\r
\r
$syndia61\r
<'labelled statement'>=\r
<'label_name'>\r
':' <statement>\r
;\r
\r
$syndia62\r
<'with statement'>=\r
with\r
<'with definition'>\r
do <statement>\r
;\r
\r
"pass1: allow shorthand notation for nested (simple) with definitions."\r
\r
$syndia63\r
<'with definition'>=\r
<'with_object denotation'>\r
(! <'with renaming'>)\r
;\r
\r
$withren\r
<'with renaming'>=\r
as <'local_name'>\r
(!':' <'common type specification'>)\r
;\r
\r
"pass2: the type of the with-object must not be protected,\r
       nor may the local type.\r
pass2, code: The size of the local type must be less than\r
             or equal to the size of the with-object.\r
pass3: the with_object must be regular.\r
"\r
\r
$syndia64\r
<'lock statement'>=\r
(lockdata ! lockbuf)\r
<'lock definition'>\r
do <statement>\r
;\r
 \r
"pass2: the type of the ref-object must be reference or chain."\r
\r
$lockdef\r
<'lock definition'>=\r
<'ref_object denotation'>\r
to\r
<'message_name'>\r
(! ':' <'common type specification'>)\r
;\r
$syndia65\r
<'region statement'>=\r
region\r
<'shared_object denotation'>\r
do\r
<statement>\r
;\r
\r
"pass2: the object must be of kind SHARED. \r
       SHARED objects may only be accessed inside \r
       REGION statements."\r
\r
$syndia66\r
<expression>=\r
<'simple expression'>\r
(!\r
<'relational operator'>\r
<'simple expression'>\r
)\r
;\r
\r
$syndia67\r
<'relational operator'>=\r
(\r
'='!'<>'!'<'!'<='!'>'!'>='!in\r
)\r
;\r
\r
$syndia68\r
<'simple expression'>=\r
(!'+'!'-')\r
+<term>\r
/<'addition-type operator'>-\r
;\r
\r
$syndia69\r
<'addition-type operator'>=\r
(\r
'+'!'-'!or!xor\r
)\r
;\r
\r
$syndia70\r
<term>=\r
+\r
<factor>\r
/<'multiplication-type operator'>-\r
;\r
\r
$syndia71\r
<'multiplication-type operator'>=\r
(\r
'*'!div!mod!and!\r
shift\r
)\r
;\r
\r
$syndia72\r
<factor>=\r
<'object denotation'>!\r
<'value denotation'>!\r
<'function call'>!\r
<'typesize call'>!\r
<'varsize call'>!\r
<'link call'>!\r
<'unlink call'>!\r
<'create call'>!\r
'(' <expression> ')'!\r
not <'neg_factor'>\r
;\r
\r
$syndia73\r
<'object denotation'>=\r
<'object_name'>!\r
<'indexed element'>!\r
<'selected field'>!\r
<'designated variable'>\r
;\r
\r
$syndia74\r
<'indexed element'>=\r
<'array_object denotation'>\r
'('\r
<'index_expression'>\r
')'\r
;\r
\r
$syndia75\r
<'selected field'>=\r
<'record_object denotation'>\r
'.'\r
<'field_name'>\r
;\r
\r
$syndia76\r
<'designated variable'>=\r
<'pointer_object denotation'> '^';\r
\r
$syndia77\r
<'value denotation'>=\r
<'structured value'>!\r
<number>!\r
<'set denotation'>!\r
<'predefined value_name'>!\r
<'selected type parameter'>!\r
<'scalar_name'>!\r
getswitch '(' <'switch_name'> ')' !\r
<'character literal'>!\r
<'character string'>\r
;\r
\r
$syndia78\r
<'structured value'>=\r
(!<'bound-type_name'>\r
!<'parameterized type binding'>)\r
'(:'\r
+\r
<'value_expression'>!\r
<'repeated value'>\r
/ ',' -\r
':)'\r
;\r
"pass2, pass3, code: check types and number of elements."\r
\r
$syndia79\r
<'repeated value'>=\r
<'repetition_expression'>\r
'***'\r
<'value_expression'>\r
;\r
"pass2: check type of repetition_expression: (non negative) integer;\r
       and type of value expression.\r
\r
pass3: check correct number of elements, if constant. Check non negative\r
       repetition, if constant.\r
code: Check correct number of elements, if not constant.\r
      Check non negative repetition if not constant.\r
"\r
\r
$syndia80\r
<'set denotation'>=\r
'(.'\r
(\r
!\r
+\r
<'element_expression'>!\r
<'element interval'>\r
/ ',' -\r
)\r
'.)'\r
;\r
\r
$syndia81\r
<'element interval'>=\r
<'lower_expression'>\r
'..'\r
<'upper_expression'>\r
;\r
\r
$syndia82\r
<'selected type parameter'>=\r
<'object denotation'>\r
'!'\r
<'type-parameter_name'>\r
;\r
\r
$syndia83\r
<'typesize call'>=\r
typesize '(' <'bound-type_name'> ')' ;\r
\r
$syndia84\r
<'varsize call'>=\r
varsize '(' <'variable_name'> ')' ;\r
\r
$syndia85\r
<'link call'>=\r
link '(' <'string_expression'> ',' <'program_name'> ')' ;\r
\r
$syndia86\r
<'unlink call'>=\r
unlink\r
'('\r
<'program_name'>\r
')'\r
;\r
\r
$syndia87\r
<'create call'>=\r
create '(' ( <'name_expression'> ','\r
<'program call'> ','\r
&\r
<'process_object denotation'> ','\r
<'size_expression'> ','\r
&\r
<'priority_expression'>\r
)\r
')'\r
;\r
\r
$syndia88\r
<'program call'>=\r
<'program_name'>\r
(!<'actual parameters'>)\r
;\r
.\r
«eof»