! -- Sets ---------------------------------------------------- {ID Head} = {Letter} {ID UHead} = {Letter} + [_] {ID UTail} = {Alphanumeric} + [_] {Hex Digit} = {Digit} + [ABCDEFabcdef] {String Chars} = {Printable} - ["\] ! -- Terminals ----------------------------------------------- Identifier = {ID Head}{ID UTail}* | {ID UHead}{ID UTail}+ | '@' {ID UHead}{ID UTail}* StringLiteral = '"' ( {String Chars} | '\' {Printable} )* '"' IntLiteral = {Digit}+ HexLiteral = '0' 'x' {Hex Digit}+ Comment Start = '/*' Comment End = '*/' Comment Line = '//' ! -- Global Declarations ------------------------------------------------------------------ ::= ::= | !empty ::= | ::= | | | | | ::= | !empty ::= 'namespace' '{' '}' | 'namespace' Identifier '{' '}' ::= 'refines' Identifier | !empty ::= 'class' Identifier '{' '}' ::= 'extends' | !empty ::= 'abstracts' | !empty ::= 'abstracts' | 'extends' | !empty ::= ':' | !empty ::= 'using' ';' ! -- Types -------------------------------------------------------------------------------- ::= ',' | ::= | 'range' '(' ')' | ::= '<' '>' | !empty ::= '.' Identifier | Identifier ::= ',' | ',' '!' | ::= 'sbyte' | 'byte' | 'short' | 'ushort' | 'int' | 'uint' | 'long' | 'ulong' ::= 'string' | 'object' ::= | | 'bool' | 'any' ::= 'null' | 'true' | 'false' | StringLiteral | IntLiteral | HexLiteral ! -- Modifiers and Attributes ------------------------------------------------------------- ::= 'static' | 'synthetic' | 'abstract' | 'base' | 'readonly' ::= | ::= | | | !empty ::= | !empty ::= | ::= '[' ']' ! -- Members and Inner Declarations ------------------------------------------------------- ::= | !empty ::= | | | | | | | ::= ';' | 'const' ';' ::= ',' | ::= Identifier | Identifier '=' ::= Identifier '{' '}' | Identifier '[' Identifier ']' '{' '}' | 'this' '[' Identifier ']' '{' '}' | '_' Identifier '{' '}' | '_' Identifier '[' Identifier ']' '{' '}' ::= | | | ::= 'get' ::= 'set' ::= | ::= Identifier '(' ')' | 'void' Identifier '(' ')' | '_' Identifier '(' ')' | 'instance' Identifier '(' ')' ::= Identifier '(' ')' ::= '!' | !empty ::= | ';' ::= | !empty ::= 'requires' ';' | 'ensures' ';' ::= 'otherwise' | !empty ::= 'wait' | 'notice' | 'warning' | 'error' ::= | !empty ::= 'delegate' ';' ::= 'group' '=' '{' '}' ';' ::= Identifier '{' '}' ::= | | | !empty ::= 'struct' | 'union' ::= Identifier '{' '}' ::= 'enum' | 'flags' ::= | !empty ::= ',' | ::= | Identifier '=' | Identifier '=' '{' '}' ::= '..' ::= ',' | ::= | ::= 'range' Identifier '=' ';' ! -- Rules -------------------------------------------------------------------------------- ::= 'rule' ';' | 'rule' Identifier ';' ::= 'notice' | 'warning' | 'error' | !empty ::= ',' | ::= ::= 'forall' '(' ')' | !empty ::= ',' | ::= Identifier ! -- Temporal Patterns ------------------------------------------------------------------- ::= 'is' 'universal' | 'is' 'absent' | 'exists' | 'precedes' | 'leads' 'to' | 'responds' 'to' | 'corresponds' 'to' ::= 'globally' | 'before' | 'after' | 'after' 'until' | 'between' 'and' ::= '{' '}' ! -- Parameters and Arguments ------------------------------------------------------------ ::= | !empty ::= ',' | ::= | !empty ::= ',' | ::= Identifier | 'out' 'instance' | 'instance' | '_' | '...' ::= | 'in' 'out' | '_' | '...' ::= 'out' | 'ref' | !empty ! -- Expressions ------------------------------------------------------------------------- ::= | | | | | | | | | | | '(' ')' ::= '(' ')' ::= 'old' ::= 'new' '(' ')' ::= '(' 'bool' ')' | '(' ')' | '(' ')' | '{' ',' '}' ::= 'choose' | 'max' | 'min' ::= ',' | ::= '(' ')' ::= '::' 'succeeded' | '::' 'failed' | '::' 'entered' | '::' 'returned' | !empty ::= 'thread' | 'this' | 'result' | 'value' ::= 'any' | '.' 'any' ::= '[' ']' ::= | '.' ::= '::' 'written' | '::' 'read' | '::' 'get' | '::' 'set' | !empty ::= | '+' | '-' | '!' | '~' | | ::= '++' ::= '--' ::= '++' ::= '--' ::= '*' | '/' | '%' | ::= '+' | '-' | ::= '<<' | '>>' | ::= '<' | '>' | '<=' | '>=' | 'is' | 'as' | ::= '==' | '!=' | '===' | '!==' | ::= '&' | ::= '^' | ::= '|' | ::= '&&' | ::= '||' | ::= '==>' | ::= | '?' ':' ::= ::= '=' | '+=' | '-=' | '*=' | '/=' | '%=' | '&=' | '|=' | '^=' | '>>=' | '<<=' | ':=' ::= | ::= | | | | | ! -- Statements -------------------------------------------------------------------------- ::= '{' '}' ::= | !empty ::= | | ::= ';' | | | | | | | | | | | | | | ::= ';' ::= 'return' ';' | 'return' ';' ::= 'break' ';' ::= 'goto' Identifier ';' ::= 'if' '(' ')' | 'if' '(' ')' 'else' ::= 'while' '(' ')' | 'foreach' '(' Identifier 'in' ')' | 'anytimes' '(' ')' ::= 'select' '{' '}' ::= | !empty ::= 'end' | 'first' ::= | ::= 'wait' '(' ')' '->' | 'timeout' '->' ::= 'atomic' ::= 'assert' '(' ')' ';' | 'assert' '(' ',' StringLiteral ')' ';' ::= 'assume' '(' ')' ';' ::= 'base' ':' | 'extracted' ':' | 'group' Identifier ':' | Identifier ':' ::= 'async' 'with' ';' | 'async' ';' ::= Identifier ';' | Identifier '=' ';' ::= 'try' 'with' '{' '}' ::= | ::= Identifier '->' | 'any' '->' ::= 'raise' Identifier ';'