Приложение A. Синтаксис на езика UniPascal
85
45: VariantPart =
'case' TagField 'of'
45:
   CnstList ':' '(' [FieldList] ')' { ';'
45:
   CnstList ':' '(' [FieldList] ')' }.
46: TagField =
[Ident ':'] OrdinalTypeIdent.
47: OrdinalTypeIdent = Ident.
48: SetType =
'set' 'of' OrdinalType.
49: FileType =
'file' [ 'of' Type ].
50: PointerType =
'^' TypeIdent.
51: Expression =
(SimpleExpression [relationOp
51:
  SimpleExpression]) |
51:
ExpTypeCast.
52: SimpleExpression = ['+' | '-'] Term {AdditiveOp Term}.
53: Term =
Factor {MultiplicativeOp Factor}.
54: Factor =
Constant |
54:
VariableRef |
54:
SetConstructor |
54:
FunctionCall |
54:
'not' Factor |
54:
( '(' Expression ')' ).
55: SetConstructor =
'[' [SetElement {',' SetElement}] ']'.
56: SetElement =
Expression [ '..' Expression ].
57: FunctionCall =
QualIdent [ ActualParamList ].
58: relationOp =
'='| '<>'| '<' | '<=' | '>'| '>='| 'in'.
59: AdditiveOp =
'+'| '-' | 'or'| 'xor'| '|'.
60: MultiplicativeOp = '*'| '/' | 'div'| 'mod'| 'and'| '&'.
61: ExpTypeCast =
TypeIdent '(' Expression ')'.
62: VarTypeCast =
TypeIdent '(' VariableRef ')'.
63: Statement =
[Label ':'] ( SimpleStatement |
63:
              StructStatement ).
64: SimpleStatement =
EmptyStatement | Assignment |
64:
ProcedureCall | GotoStatement.
65: EmptyStatement =
.
66: Assignment =
(VariableRef | FuncIdent) ':=' Expression.
67: VariableRef =
VarTypeCast |
67:
(QualIdent {'.' Ident | '^' |
67:
'[' Expression {',' Expression} ']'}).
68: FuncIdent =
Ident.
69: ProcedureCall =
QualIdent [ ActualParamList ].
70: GotoStatement =
'goto' Label.
71: StructStatement =
CompoundStatement |
71:
IfStatement       |
71:
CaseStatement     |
71:
RepetativeStat    |
71:
WithStatement     .
72: CompoundStatement = 'begin' Statement { ';' Statement } 'end'.
<<  <  GO  >  >>

Вернуться к началу сайта