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



Download 1.37 Mb.
Page1/24
Date23.04.2018
Size1.37 Mb.
#46651
  1   2   3   4   5   6   7   8   9   ...   24


PEF
Protocol Engineering Framework




The Open Protocol Notation
Programming Guide v0.1


Document Version v0.1 (4/23/2018)


Abstract. Open Protocol Notation (OPN) is a text-based notation for describing the architecture, messages, and behavior of network protocols.

Version

Editor

Change

Date

0.1

v-cepark

Initial formal release version

9-06-2013
































Table of Contents


1.Introduction 8

1.1.Scope 8

1.2.Approach 8

1.3.About this Document 9

2.Overview 10

2.1.Types 10

2.1.1.Generic Types 10

2.1.2.Predefined Types 10

2.1.3.External Types 13

2.1.4.Reference Types 13

2.1.5.XML Type 16

2.1.6.JSON Type 21

2.1.7.Conversions 24

2.1.8.Type Inference 25

2.1.9.Aliases for Types 25

2.2.Patterns 26

2.2.1.Basic Pattern Forms 26

2.2.2.Regular Expression Patterns 27

2.2.3.Pattern Conjunction, Disjunction and Negation 27

2.2.4.Collection Patterns 27

2.2.5.Reference Type Patterns 28

2.2.6.Interface Patterns 28

2.2.7.Capture Patterns 29

2.2.8.Parameterized Patterns 30

2.2.9.Enumeration and Flags Patterns 30

2.2.10.From Patterns 31

2.2.11.Localized Strings 32

2.3.Grammars 33

2.3.1.Basic Syntax Forms 33

2.3.2.Parsing 35

2.3.3.Tokenization 36

2.3.4.Look-Ahead and Semantic Condition 36

2.3.5.Syntax Rules as Methods 37

2.3.6.Using Syntax in Patterns 37

2.3.7.Parameters in Syntax Rules 37

2.4.Behavioral Scenarios 37

2.4.1.Basic Syntax and Semantics 38

2.4.2.Matching Semantics 40

2.4.3.Strict vs. Loose 40

1.1.4Setting Backtrack Points 41

1Scenario Parameters 43

2.4.6.Result of the Match 44

1.Combining Scenarios 45

2.5.Methods, Expressions and Statements 45

2.5.1.Method Definitions 46

2.5.2.Patterns in Methods and Statements 47

2.5.3.Binders 48

2.6.Aspects 49

2.7.Modules, Name Resolution, Visibility, and Lifetime 51

2.8.Protocol Architecture 52

2.8.1.Messages 52

2.8.2.Message Annotations 53

2.8.3.Message Stacking 53

2.8.4.Operations 54

2.8.5.Virtual Operations 56

2.8.6.Contracts 58

2.8.7.Endpoints 59

2.8.8.Roles 63

2.8.9.Protocol Namespaces 64

2.9.Protocol Behavior 64

2.9.1.Actors 65

2.9.2.Observe and Process rules 65

2.9.3.Establishing Actor Priorities 68

2.9.4.Dealing with Endpoints 69

2.9.5.Explicit Activation and Deactivation of Actors 71

2.9.6.Associating Actors with Endpoints and Roles 71

2.9.7.Bindings 73

2.10.Invariant Checking 74

2.10.1.Presence indicators 75

3.Walkthrough: TCP/IP 77

3.1.MiniIP Layer 77

3.2.MiniTCP Layer 78

3.3.Application Layer 82

4.Language Reference 84

4.1.Lexis 84

4.1.1.Lexical Unit 84

4.1.2.Whitespace 84

4.1.3.Comments 84

4.1.4.Literals 84

4.1.5.Identifiers and Keywords 86

4.1.6.Operators and Punctuators 86

4.2.Expressions 87

4.2.1.Function Expressions 87

4.2.2.Conditional Expressions 87

4.2.3.Binder Expressions 87

4.2.4. Logical Operator Expressions 87

4.2.5.Endpoint Expression 87

4.2.6.Logical and Bitwise Operator Expressions 87

4.2.7.Relational Operator Expressions 87

4.2.8.Bit Shift Operator Expressions 88

4.2.9.Range Expression 88

4.2.10.In Expression 88

4.2.11.Is Expressions 88

4.2.12.As Expressions 88

4.2.13.Arithmetic Operator Expressions 88

4.2.14.Assignment Expressions 88

4.2.15.Reference Expressions 88

4.2.16.Access Expressions 89

4.2.17.Invoke Expressions 89

4.2.18.Parenthesized Expressions 89

4.2.19.Literal Expressions 89

4.2.20.Creation Expressions 90

4.2.21.This Expression 90

4.2.22.Value Expression 90

4.2.23.Freeze Expression 90

4.3.Patterns 90

4.3.1.Composed Patterns 90

4.3.2.Count Patterns 91

4.3.3.From (Decoding) Pattern 91

4.3.4.Constraint Patterns 91

4.3.5.Capture Patterns 91

4.3.6.Not Patterns 91

4.3.7.Nullable or Optional Patterns 91

4.3.8.Parenthesized Patterns 91

4.3.9.Function Patterns 91

4.3.10.Reference Patterns 92

4.3.11.Literal and Expression Patterns 92

4.3.12.Range Patterns 92

4.3.13.Membership Patterns 92

4.3.14.Compound Patterns 92

4.3.15.Array Patterns 92

4.3.16.Map Patterns 93

4.3.17.Set Patterns 93

4.3.18.Enum Patterns 93

4.3.19.Reference Patterns with Capture 93

4.4.Productions 94

4.4.1.Alternation Productions 94

4.4.2.Sequencing Productions 94

4.4.3.Capture Productions 94

4.4.4.Quantifier Productions 94

4.4.5.Transformation Productions 94

4.4.6.Semantic Condition Productions 94

4.4.7.Parenthesize Productions 94

4.4.8.Pattern Reference Productions 94

4.4.9.Literal Productions 94

4.5.Scenarios 94

4.5.1.Combination 94

4.5.2.Backtracking 95

4.5.3.Alternation 95

4.5.4.Sequencing 95

4.5.5.Quantifying 95

4.5.6.Semantic Condition 95

4.5.7.Drop 96

4.5.8.Parenthesis 96

4.5.9.Negation 96

4.5.10.Terminals 96

4.6.Statements 97

4.6.1.Variable Declarations 97

4.6.2.Empty Statements 97

4.6.3.Break Statements 97

4.6.4.Continue Statements 97

4.6.5.Return Statements 97

4.6.6.Throw Statements 97

4.6.7.Assertion Statements 97

4.6.8.Dispatch Statements 97

4.6.9.Start Statement 98

4.6.10.Stop Statement 98

4.6.11.Reject Statement 98

4.6.12.Delete Statement 98

4.6.13.Expression Statements 98

4.6.14.Block Statements 99

4.6.15.For Statements 99

4.6.16.Foreach Statements 99

4.6.17.If Statements 99

4.6.18.While Statements 99

4.6.19.Do Statements 99

4.6.20.Switch Statements 99

4.6.21.Try Statements 99

4.6.22.Release Statements 99

4.7.Declarations 100

4.7.1.Aspects 100

4.7.2.Field Declarations 100

4.7.3.Annotation Declarations 100

4.7.4.Method Declarations 100

4.7.5.Constructor Declarations 101

4.7.6.Invariant Declarations 101

4.7.7.Pattern Declarations 101

4.7.8.Syntax Declarations 101

4.7.9.Type Declarations 101

4.7.10.Interface Declarations 101

4.7.11.Message Declarations 102

4.7.12.Virtual Declarations 102

4.7.13.Aspect Declarations 102

4.7.14.Actor Declaration 104

4.7.15.Binding Declaration 104

4.7.16.Contract Declarations 105

4.7.17.Endpoint Declarations 105

4.7.18.Scenario Declarations 105

4.7.19.Role Declarations 105

4.7.20.Typedef Declarations 106

4.7.21.Documents 106

5.Library Reference 107

5.1.Any 107

5.2.Scalars 107

5.2.1.Integers 107

5.2.2.Enums 111

5.2.3.Floating Point 111

5.2.4.Any Number 113

5.2.5.Booleans 113

5.2.6.Characters 114

5.3.Collections 115

5.3.1.Strings 115

5.3.2.Binary 115

5.3.3.Arrays 116

5.3.4.Maps 117

5.3.5.Sets 117

5.4.Streams 118

5.5.Messages 118

5.5.1.Annotations 118

5.5.2.Origins 119

5.6.Endpoint Transport 120

5.7.XML 120

5.8.JSON 123

5.9.Treedata 124

5.10.Date and Time 125

5.11.Modalities 126

5.12.Error handling 127

5.12.1.ValidationCheck 127

5.12.2.ErrorCodeIf 128

5.12.3.ReportInsufficientData 128

5.13.Logging Messages 129

5.14.Associating On-the-Wire Data to OPN Values 130

5.14.1.Basic Associations 130

5.14.2.Associating Collections 132

5.14.3.Retrieving Associations 135

5.14.4.Summary of the API 135

5.15.Trace Library 136

5.16.Aspects 137

5.16.1.Aspects for Data Mapping 137

5.16.2.Aspects for Documentation 150

5.16.3.Visualization 152

5.16.4.DisplayInfo 152

5.16.5.StopProcessing 153

5.16.6.OPNAuthoring 154

5.16.7.UsageInfo 155

6.Implementation Notes 157

7.References 158





Download 1.37 Mb.

Share with your friends:
  1   2   3   4   5   6   7   8   9   ...   24




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

    Main page