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



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

Statements


Statement ::= VariableDeclaration ; | EmbeddedStatement
      1. Variable Declarations


VariableDeclaration ::= ( PrimaryPattern | var ) Identifier Constraint? ( = Expression )?
      1. Empty Statements


EmbeddedStatement ::= ;
      1. Break Statements


EmbeddedStatement ::= break ;
      1. Continue Statements


EmbeddedStatement ::= continue ;
      1. Return Statements


EmbeddedStatement ::= return Expression? ;
      1. Throw Statements


EmbeddedStatement ::= throw Expression ;
      1. Assertion Statements


The optional expression after the comma, before the question mark (?) follows C# standards and its intended for documenting the reason of the assertion. The optional expression will be automatically converted to string and attached to the assertion.

EmbeddedStatement ::= assert Expression ( , Expression )? ;
      1. Dispatch Statements


EmbeddedStatement ::= dispatch TransmitExpression ;

TransmitExpression ::= Expression ( issues | accepts ) Expression
      1. Start Statement


EmbeddedStatement ::= start Identifier InvokeArguments ;
      1. Stop Statement


EmbeddedStatement ::= stop ;
      1. Reject Statement


EmbeddedStatement ::= reject ;
      1. Delete Statement


EmbeddedStatement ::= delete Expression ;
      1. Expression Statements


EmbeddedStatement ::= StatementExpression ;

StatementExpression ::=

NonInvokeStatementExpression = Expression

| NonInvokeStatementExpression += Expression

| NonInvokeStatementExpression -= Expression

StatementExpression ::=

NonInvokeStatementExpression InvokeArguments

| NonInvokeStatementExpression ++

| NonInvokeStatementExpression –-

NonInvokeStatementExpression ::= (NonInvokeStatementExpression[1])

NonInvokeStatementExpression[1] ::=

ReferenceExpression

| PrimaryStatementExpression . Identifier

| PrimaryStatementExpression # Identifier

| PrimaryStatementExpression [ Expression ( , Expression )* ]

PrimaryStatementExpression ::=

NonInvokeStatementExpression

| PrimaryStatementExpression InvokeArguments
      1. Block Statements


EmbeddedStatement ::= Block

Block ::= { Statement* }
      1. For Statements


EmbeddedStatement ::=

for ( ForInitializer? ; Expression? ; ( StatementList ,? )? ) EmbeddedStatement

ForInitializer ::= VariableDeclaration ( , VariableDeclaration )* | StatementList ,?

StatementList ::= StatementExpression ( , StatementExpression )*
      1. Foreach Statements


EmbeddedStatement ::= foreach Bindings EmbeddedStatement
      1. If Statements


EmbeddedStatement ::= if ( Expression ) EmbeddedStatement

( else EmbeddedStatement )?
      1. While Statements


EmbeddedStatement ::= while ( Expression ) EmbeddedStatement
      1. Do Statements


EmbeddedStatement ::= do EmbeddedStatement while ( Expression ) ;
      1. Switch Statements


EmbeddedStatement ::= switch ( Expression ){ SwitchCase* DefaultCase? }

SwitchCase ::= case Pattern => Statement*

DefaultCase ::= default => Statement*
      1. Try Statements


EmbeddedStatement ::= try Block ( catch ( Pattern ) Block )+ ( finally Block )?

EmbeddedStatement ::= try Block finally Block
      1. Release Statements


EmbeddedStatement ::= release Expression;


    1. Download 1.37 Mb.

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




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

    Main page