84
Приложение A. Синтаксис на езика UniPascal
20: Declarations =
{ { LabelDeclaration } |
20:
{ ConstDeclaration } |
20:
{ TypeDeclaration } |
20:
{ VarDeclaration } |
20:
{ PFDeclaration } } .
21: ProgramHeading =
'program' Ident [ '(' IdentList ')' ] ';'.
22: Label =
Ident | IntConst.
23: LabelDeclaration = 'label' Label { ',' Label } ';'.
24: ConstDeclaration = 'const' Ident '=' Constant ';' {
24:
Ident '=' Constant ';' }.
25: Constant =
SignedRealConst | SignedIntConst |
25:
CharConst | StringConst | ConstExpression.
26: ConstExpression =
Expression.
27: TypeDeclaration =
'type' Ident '=' Type ';' {
27:
Ident '=' Type ';' }.
28: Type =
TypeIdent | SimpleType |
28:
PointerType | StructuredType.
29: TypeIdent =
Ident.
30: VarDeclaration =
'var' IdentList ':' Type ';' {
30:
IdentList ':' Type ';' }.
31: PFDeclaration =
{ ProcDeclaration | FuncDeclaration }.
32: SimpleType =
OrdinalType | RealType.
33: OrdinalType =
Enumerated | SubRange | StandardType.
34: StandardType =
'integer' | 'shortint' | 'longint' |
34:
'cardinal' | 'shortcard' | 'natural' |
34:
'char' | 'boolean' |
34:
'byte' | 'word' | 'longword'|.
35: RealType =
'real'.
36: Enumerated =
'(' IdentList ')'.
37: SubRange =
Constant '..' Constant.
38: StructuredType =
['packed'] (ArrayType |
38:
StringType |
38:
RecordType |
38:
SetType |
38:
FileType ).
39: ArrayType =
'array' '[' IndexType {','
39:
IndexType } ']' 'of' Type.
40: IndexType =
OrdinalType.
41: StringType =
'string' [ '[' Constant ']' ].
42: RecordType =
'record' FieldList 'end'.
43: FieldList =
(FixedPart [';']) | (VariantPart [';']) |
43:
(FixedPart ';' VariantPart [';']).
44: FixedPart =
IdentList ':' Type { ';'
44:
IdentList ':' Type }.
<< < GO > >>
Вернуться к началу сайта