The Open Protocol Notation Programming Guide 1 Document Version 1 (4/23/2018)



Download 1.37 Mb.
Page17/24
Date23.04.2018
Size1.37 Mb.
#46651
1   ...   13   14   15   16   17   18   19   20   ...   24

Declarations

  1. Aspects


Aspects ::= with InitializerExpression ( , InitializerExpression )*

AspectsAfterBlock ::= Aspects ;
      1. Field Declarations


FieldDeclaration ::=

ExtensionModifier?

FieldModifier* PrimaryPattern Identifier Constraint? Aspects?

( = Expression Aspects? )? ;

ExtensionModifier ::= change | delete

FieldModifier ::= VisibilityModifier | static | const

VisibilityModifier ::= public | internal
      1. Annotation Declarations


AnnotationDeclaration ::=

ExtensionModifier?

AnnotationModifier* annotation PrimaryPattern Identifier Aspects? ;

AnnotationModifier ::= VisibilityModifier

AnnotationDeclaration ::=

ExtensionModifier?

AnnotationModifier* annotation PrimaryPattern QualifiedIdentifier#Identifier Aspects? ;

AnnotationModifier ::= VisibilityModifier
      1. Method Declarations


MethodDeclaration ::=

ExtensionModifier?

MethodModifier* PrimaryPattern PropertyModifier? MethodIdentifier GenericParameters?

Parameters Aspects? ( Block AspectsAfterBlock? | ; )

MethodDeclaration ::=

extern VisibilityModifier? PrimaryPattern PropertyModifier? MethodIdentifier GenericParameters?

Parameters Aspects? ;

MethodDeclaration ::= ~endpoint ( PrimaryPattern Identifier Aspects?) Aspects? ( Block AspectsAfterBlock? | ; )

PropertyModifier ::= get | set

MethodModifier ::= VisibilityModifier | static | virtual | override | abstract

GenericParameters ::= < Identifier ( , Identifier)* >

Parameters ::= ( (this? Parameter ( , Parameter )* )? )

Parameter ::= ParameterModifier? PrimaryPattern Identifier Constraint? Aspects?

ParameterModifier ::= ref | out

MethodIdentifier ::= Identifier | operator DefinableOperator

DefinableOperator ::= one of

[] + - * / % ~ ^ & | << >> == != <= >= < > as in
      1. Constructor Declarations


ConstructorDeclaration ::=

ExtensionModifier?

VisibilityModifier? Identifier Parameters Aspects? ( Block AspectsAfterBlock? | ; )
      1. Invariant Declarations


InvariantDeclaration ::=

invariant (Identifier : )? Expression ( , Expression )? ;
      1. Pattern Declarations


PatternDeclaration ::=

ExtensionModifier? VisibilityModifier? pattern Identifier GenericParameters? Aspects?

= Pattern Aspects? ;
      1. Syntax Declarations


SyntaxDeclaration ::=

ExtensionModifier? VisibilityModifier? syntax Identifier TypeParameters? Aspects?

= Production Aspects? ;

SyntaxDeclaration ::=

ExtensionModifier? VisibilityModifier? syntax ignore Aspects?

= regex BlockLiteral Aspects? ;

SyntaxDeclaration ::=

ExtensionModifier? VisibilityModifier? syntax separator Aspects?

= regex BlockLiteral Aspects? ;
      1. Type Declarations


TypeDeclaration ::=

ExtensionModifier?

TypeModifier* type Identifier GenericParameters?

TypeParameters? Aspects? TypeBase?

{ TypeMember* } AspectsAfterBlock?

TypeDeclaration ::=

extern VisbilityModifier * type Identifier GenericParameters? Aspects? ;

TypeParameters ::= [ ( Parameter ( , Parameter )* )? ]

TypeBase ::= : ReferencePattern ( , ReferencePattern )*

TypeModifier ::= VisbilityModifier | abstract

TypeMember ::= FieldDeclaration | ConstructorDeclaration |

MethodDeclaration | PatternDeclaration | InvariantDeclaration
      1. Interface Declarations


InterfaceDeclaration ::=

VisibilityModifier? interface Identifier GenericParameters? Aspects? TypeBase?

{ InterfaceMember* } AspectsAfterBlock?

InterfaceMember ::= MethodDeclaration
      1. Message Declarations


MessageDeclaration ::=

ExtensionModifier?

VisibilityModifier? message

Identifier TypeParameters? Aspects? TypeBase?

{ MessageMember* } AspectsAfterBlock?

MessageDeclaration ::=

ExtensionModifier? VisibilityModifier? operation

Identifier TypeParameters? Aspects?

{ OperationMember* } ( Aspects ResultDeclaration* ; | ResultDeclaration+ ; )?

MessageDeclarationInContract ::=

ExtensionModifier?

VisibilityModifier? ( accepts | issues )? message

Identifier TypeParameters? Aspects? TypeBase?

{ MessageMember* } AspectsAfterBlock?

MessageDeclarationInContract ::=

ExtensionModifier? VisibilityModifier? ( accepts | issues )? operation

Identifier TypeParameters? Aspects?

{ OperationMember* } ( Aspects ResultDeclaration* ; | ResultDeclaration+ ; )?

OperationFieldDeclaration ::= ( in | out | result |in out |in result )? FieldDeclaration

ResultDeclaration ::= ( error | success | exception ) Pattern Aspects?

MessageMember ::= TypeMember

OperationMember ::= OperationFieldDeclaration | MethodDeclaration |

PatternDeclaration | InvariantDeclaration
      1. Virtual Declarations


MessageDeclaration ::=

ExtensionModifier? VisibilityModifier? virtual operation

Identifier Aspects?

{ OperationMember* } ( Aspects VirtualResultDeclaration* | VirtualResultDeclaration+ )?

= (Scenario | QualifiedIdentifier TypeArguments?);

MessageDeclarationInContract ::=

ExtensionModifier? VisibilityModifier? ( accepts | issues )? virtual operation

Identifier Aspects?

{ OperationMember* } ( Aspects VirtualResultDeclaration* | VirtualResultDeclaration+ )?

= (Scenario | QualifiedIdentifier TypeArguments?);

VirtualResultDeclaration ::= ( error | success ) Pattern Aspects? | (exception PrimaryPattern Identifier Constraint? Aspects? = Expression Aspects?)
      1. Aspect Declarations


AspectDeclaration ::=

ExtensionModifier?

TypeModifier* aspect Identifier Aspects? TypeBase?

{ AspectMember* } AspectsAfterBlock?

AspectMember ::= ThisFieldDeclaration | FieldDeclaration | InvariantDeclaration

ThisFieldDeclaration ::=

FieldModifier* PrimaryPattern this Constraint? Aspects?

( = Expression Aspects? )? ;
      1. Actor Declaration


ActorDeclaration ::=

ExtensionModifier?

VisibilityModifier? static? autostart? actor Identifier Parameters PartialOrderDeclaration* Aspects?

{ ActorMember* } AspectsAfterBlock?

ActorMember ::= FieldDeclaration | MethodDeclaration | PatternDeclaration | TypeDeclaration | InvariantDeclaration | RuleDeclaration | ActorDeclaration | ScenarioDeclaration

ActorModifier ::= VisibilityModifier | autostart

RuleDeclaration ::=

(observe | process) ( Identifier : )? TransmitPattern { Statement* }

RuleDeclaration ::=

observe ( Identifier : )? ScenarioTransmitPattern { Statement* }

ScenarioTransmitPattern ::= Expression (Identifier:)? Scenario

ScenarioTransmitPattern ::= Expression (Identifier:)? QualifiedIdentifier

TransmitPattern ::= Expression Direction Pattern

Direction ::= issues | accepts

PartialOrderDeclaration ::= (follows | precedes) QualifiedIdentifier GenericArguments? (, QualifiedIdentifier GenericArguments?)*
      1. Binding Declaration


BindingDeclaration ::=

ExtensionModifier?

BindingModifier* binding Identifier Aspects?

: ReferencePattern over ReferencePatternWithCapture

( { BindingMember* } AspectsAfterBlock? | Aspects? ; )

BindingMember ::= FieldDeclaration | MethodDeclaration | PatternDeclaration | TypeDeclaration | InvariantDeclaration | BindingRuleDeclaration

BindingModifier ::= VisibilityModifier

BindingRuleDeclaration ::=

rule ( Identifier : )? Direction Pattern => Expression Direction Expression Aspects? ;
      1. Contract Declarations


ContractDeclaration ::=

ExtensionModifier?

VisibilityModifier? contract Identifier Aspects? ( ContractElement+ )?

{ ContractMember* } AspectsAfterBlock?

ContractMember ::= MessageDeclarationInContract

ContractElement ::= ExtensionModifier?

( ( consumes | provides ) | accepts | issues ) ReferencePattern
      1. Endpoint Declarations


EndpointDeclaration ::=

ExtensionModifier?

VisibilityModifier? endpoint Identifier EndpointAddress? EndpointTransports? PartialOrderDeclaration? Aspects?

ContractElement+

( { EndpointMember* } AspectsAfterBlock? | Aspects? ; )

EndpointDeclaration ::=

ExtensionModifier?

VisibilityModifier? client endpoint Identifier PartialOrderDeclaration? Aspects?

( { EndpointMember* } AspectsAfterBlock? | Aspects? ; )

EndpointAddress ::= [ EndpointIndex ( , EndpointIndex )* ,? ]

EndpointIndex ::= Pattern Identifier Aspects?

EndpointTransports ::= over ReferencePatternWithCapture TransportConstraint? ( | over ReferencePatternWithCapture TransportConstraint?)*

TransportConstraint ::= where value EndpointTransports

EndpointMember ::= FieldDeclaration | MethodDeclaration | PatternDeclaration | TypeDeclaration | InvariantDeclaration | RuleDeclaration | ActorDeclaration | ScenarioDeclaration
      1. Scenario Declarations


ScenarioDeclaration ::=

ExtensionModifier? VisibilityModifier? scenario Identifier ScenarioTypeParameters? Aspects? = Scenario Aspects? ;

ScenarioTypeParameters ::= [ (  ScenarioTypeParameter ( ,ScenarioTypeParameter)* )? ]

ScenarioTypeParameter ::= out? PrimaryPattern Identifier Constraint? Aspects?
      1. Role Declarations


RoleDeclaration ::=

ExtensionModifier?

VisibilityModifier? role Identifier EndpointAddress? EndpointTransports? Aspects?

( { RoleMember* } AspectsAfterBlock? | Aspects? ; )

RoleMember ::= EndpointMember | EndpointDeclaration
      1. Typedef Declarations


TypedefDeclaration ::=

VisibilityModifier? typedef Identifier Aspects? = ReferencePatternIdentifier Aspects? ;
      1. Documents


Document ::=

module QualifiedIdentifier Extensions Aspects? ; UsingDeclaration* ModuleMember*

Document ::=

protocol QualifiedIdentifier Extensions Aspects? ; UsingDeclaration* ProtocolMember*

ModuleMember ::= FieldDeclaration | MethodDeclaration | TypeDeclaration |

PatternDeclaration | InvariantDeclaration | ActorDeclaration |

MessageDeclaration | ContractDeclaration |
AnnotationDeclaration | AspectDeclaration | InterfaceDeclaration |
SyntaxDeclaration | BindingDeclaration | ScenarioDeclaration |


TypedefDeclaration

ProtocolMember ::= ModuleMember | EndpointDeclaration | RoleDeclaration | ConnectionDeclaration

Extensions ::= extends QualifiedIdentifier ( , QualifiedIdentifer )*

UsingDeclaration ::= using (QualifiedIdentifier Aspects?) | XMLNamespace;

XMLNamespace ::= please refer to the XML namespaces grammar definition at
Namespaces in XML 1.0



  1. Download 1.37 Mb.

    Share with your friends:
1   ...   13   14   15   16   17   18   19   20   ...   24




The database is protected by copyright ©ininet.org 2024
send message

    Main page