Grammar extracted by Vadim Zaytsev, see the Grammar Zoo entry for details: csharp/v2.0/ecma-334-4/extracted
Source used for this grammar: ECMA-334, 4th edition, June 2006 [Standard] [PDF]
compilation-unit
, namespace-name
, type-name
, namespace-or-type-name
, type
, value-type
, struct-type
, simple-type
, numeric-type
, integral-type
, floating-point-type
, enum-type
, nullable-type
, non-nullable-value-type
, reference-type
, class-type
, interface-type
, array-type
, non-array-type
, rank-specifiers
, rank-specifier
, dim-separators
, delegate-type
, variable-reference
, argument-list
, argument
, primary-expression
, primary-no-array-creation-expression
, simple-name
, parenthesized-expression
, member-access
, predefined-type
, invocation-expression
, element-access
, expression-list
, this-access
, base-access
, post-increment-expression
, post-decrement-expression
, object-creation-expression
, array-creation-expression
, delegate-creation-expression
, typeof-expression
, unbound-type-name
, generic-dimension-specifier
, commas
, checked-expression
, unchecked-expression
, default-value-expression
, anonymous-method-expression
, anonymous-method-signature
, anonymous-method-parameter-list
, anonymous-method-parameter
, unary-expression
, pre-increment-expression
, pre-decrement-expression
, cast-expression
, multiplicative-expression
, additive-expression
, shift-expression
, relational-expression
, equality-expression
, and-expression
, exclusive-or-expression
, inclusive-or-expression
, conditional-and-expression
, conditional-or-expression
, null-coalescing-expression
, conditional-expression
, assignment
, assignment-operator
, expression
, constant-expression
, boolean-expression
, statement
, embedded-statement
, block
, statement-list
, empty-statement
, labeled-statement
, declaration-statement
, local-variable-declaration
, local-variable-declarators
, local-variable-declarator
, local-variable-initializer
, local-constant-declaration
, constant-declarators
, constant-declarator
, expression-statement
, statement-expression
, selection-statement
, if-statement
, switch-statement
, switch-block
, switch-sections
, switch-section
, switch-labels
, switch-label
, iteration-statement
, while-statement
, do-statement
, for-statement
, for-initializer
, for-condition
, for-iterator
, statement-expression-list
, foreach-statement
, jump-statement
, break-statement
, continue-statement
, goto-statement
, return-statement
, throw-statement
, try-statement
, catch-clauses
, specific-catch-clauses
, specific-catch-clause
, general-catch-clause
, finally-clause
, checked-statement
, unchecked-statement
, lock-statement
, using-statement
, resource-acquisition
, yield-statement
, namespace-declaration
, qualified-identifier
, namespace-body
, extern-alias-directives
, extern-alias-directive
, using-directives
, using-directive
, using-alias-directive
, using-namespace-directive
, namespace-member-declarations
, namespace-member-declaration
, type-declaration
, qualified-alias-member
, class-declaration
, class-modifiers
, class-modifier
, class-base
, interface-type-list
, class-body
, class-member-declarations
, class-member-declaration
, constant-declaration
, constant-modifiers
, constant-modifier
, field-declaration
, field-modifiers
, field-modifier
, variable-declarators
, variable-declarator
, variable-initializer
, method-declaration
, method-header
, method-modifiers
, method-modifier
, return-type
, member-name
, method-body
, formal-parameter-list
, fixed-parameters
, fixed-parameter
, parameter-modifier
, parameter-array
, property-declaration
, property-modifiers
, property-modifier
, accessor-declarations
, get-accessor-declaration
, set-accessor-declaration
, accessor-modifier
, accessor-body
, event-declaration
, event-modifiers
, event-modifier
, event-accessor-declarations
, add-accessor-declaration
, remove-accessor-declaration
, indexer-declaration
, indexer-modifiers
, indexer-modifier
, indexer-declarator
, operator-declaration
, operator-modifiers
, operator-modifier
, operator-declarator
, unary-operator-declarator
, overloadable-unary-operator
, binary-operator-declarator
, overloadable-binary-operator
, conversion-operator-declarator
, operator-body
, constructor-declaration
, constructor-modifiers
, constructor-modifier
, constructor-declarator
, constructor-initializer
, constructor-body
, static-constructor-declaration
, static-constructor-modifiers
, static-constructor-body
, finalizer-declaration
, finalizer-body
, struct-declaration
, struct-modifiers
, struct-modifier
, struct-interfaces
, struct-body
, struct-member-declarations
, struct-member-declaration
, array-initializer
, variable-initializer-list
, interface-declaration
, interface-modifiers
, interface-modifier
, interface-base
, interface-body
, interface-member-declarations
, interface-member-declaration
, interface-method-declaration
, interface-property-declaration
, interface-accessors
, interface-event-declaration
, interface-indexer-declaration
, enum-declaration
, enum-base
, enum-body
, enum-modifiers
, enum-modifier
, enum-member-declarations
, enum-member-declaration
, delegate-declaration
, delegate-modifiers
, delegate-modifier
, global-attributes
, global-attribute-sections
, global-attribute-section
, global-attribute-target-specifier
, global-attribute-target
, attributes
, attribute-sections
, attribute-section
, attribute-target-specifier
, attribute-target
, attribute-list
, attribute
, attribute-name
, attribute-arguments
, positional-argument-list
, positional-argument
, named-argument-list
, named-argument
, attribute-argument-expression
, type-parameter-list
, type-parameters
, type-parameter
, type-argument-list
, type-arguments
, type-argument
, type-parameter-constraints-clauses
, type-parameter-constraints-clause
, type-parameter-constraints
, primary-constraint
, secondary-constraints
, constructor-constraint
, keyword
), 0 root (—), 1 top (compilation-unit
), 4 bottom (right-shift
2, literal
, identifier
53, right-shift-assignment
).compilation-unit ::= extern-alias-directivesusing-directives global-attributes namespace-member-declarations
namespace-name ::= namespace-or-type-name
type-name ::= namespace-or-type-name
namespace-or-type-name ::= identifier type-argument-list"." identifier type-argument-listqualified-alias-member namespace-or-type-name
type ::= value-type reference-type type-parameter
value-type ::= struct-type enum-type
struct-type ::= type-name simple-type nullable-type
simple-type ::=
numeric-type
"bool"
numeric-type ::=
integral-type
floating-point-type
"decimal"
integral-type ::= "sbyte" "byte" "short" "ushort" "int" "uint" "long" "ulong" "char"
floating-point-type ::= "float" "double"
enum-type ::= type-name
nullable-type ::=
non-nullable-value-type "?"
non-nullable-value-type ::= enum-type type-name simple-type
reference-type ::= class-type interface-type array-type delegate-type
class-type ::= type-name "object" "string"
interface-type ::= type-name
array-type ::= non-array-type rank-specifiers
non-array-type ::= value-type class-type interface-type delegate-type type-parameter
rank-specifiers ::= rank-specifier rank-specifiers rank-specifier
rank-specifier ::= "[" dim-separators "]"
dim-separators ::= "," dim-separators ","
delegate-type ::= type-name
variable-reference ::= expression
argument-list ::=
argument
argument-list "," argument
argument ::= expression "ref" variable-reference "out" variable-reference
primary-expression ::= array-creation-expression primary-no-array-creation-expression
primary-no-array-creation-expression ::= literal simple-name parenthesized-expression member-access invocation-expression element-access this-access base-access post-increment-expression post-decrement-expression object-creation-expression delegate-creation-expression typeof-expression checked-expression unchecked-expression default-value-expression anonymous-method-expression
simple-name ::=
identifier type-argument-list
parenthesized-expression ::= "(" expression ")"
member-access ::= primary-expression "." identifier type-argument-list predefined-type "." identifier type-argument-list qualified-alias-member "." identifier type-argument-list
predefined-type ::= "bool" "byte" "char" "decimal" "double" "float" "int" "long" "object" "sbyte" "short" "string" "uint" "ulong" "ushort"
invocation-expression ::= primary-expression "(" argument-list ")"
element-access ::= primary-no-array-creation-expression "[" expression-list "]"
expression-list ::=
expression
expression-list "," expression
this-access ::=
"this"
base-access ::= "base" "." identifier type-argument-list "base" "[" expression-list "]"
post-increment-expression ::=
primary-expression "++"
post-decrement-expression ::=
primary-expression "--"
object-creation-expression ::= "new" type "(" argument-list ")"
array-creation-expression ::= "new" non-array-type "[" expression-list "]" rank-specifiers array-initializer "new" array-type array-initializer
delegate-creation-expression ::= "new" delegate-type "(" expression ")"
typeof-expression ::= "typeof" "(" type ")" "typeof" "(" unbound-type-name ")" "typeof" "(" "void" ")"
unbound-type-name ::= identifier generic-dimension-specifier"::" identifier generic-dimension-specifier unbound-type-name "." identifier generic-dimension-specifieridentifier
generic-dimension-specifier ::= "<" commas ">"
commas ::= "," commas ","
checked-expression ::= "checked" "(" expression ")"
unchecked-expression ::= "unchecked" "(" expression ")"
default-value-expression ::= "default" "(" type ")"
anonymous-method-expression ::= "delegate" anonymous-method-signature block
anonymous-method-signature ::= "(" anonymous-method-parameter-list ")"
anonymous-method-parameter-list ::=
anonymous-method-parameter
anonymous-method-parameter-list "," anonymous-method-parameter
anonymous-method-parameter ::=
parameter-modifier
type identifierunary-expression ::= primary-expression "+" unary-expression "-" unary-expression "!" unary-expression "~" unary-expression pre-increment-expression pre-decrement-expression cast-expression
pre-increment-expression ::=
"++" unary-expression
pre-decrement-expression ::=
"--" unary-expression
cast-expression ::= "(" type ")" unary-expression
multiplicative-expression ::= unary-expression multiplicative-expression "*" unary-expression multiplicative-expression "/" unary-expression multiplicative-expression "%" unary-expression
additive-expression ::= multiplicative-expression additive-expression "+" multiplicative-expression additive-expression "-" multiplicative-expression
shift-expression ::=
additive-expression
shift-expression "<<" additive-expression
shift-expression right-shift additive-expression
relational-expression ::= shift-expression relational-expression "<" shift-expression relational-expression ">" shift-expression relational-expression "<=" shift-expression relational-expression ">=" shift-expression relational-expression "is" type relational-expression "as" type
equality-expression ::= relational-expression equality-expression "==" relational-expression equality-expression "!=" relational-expression
and-expression ::=
equality-expression
and-expression "&" equality-expression
exclusive-or-expression ::=
and-expression
exclusive-or-expression "^" and-expression
inclusive-or-expression ::=
exclusive-or-expression
inclusive-or-expression "|" exclusive-or-expression
conditional-and-expression ::=
inclusive-or-expression
conditional-and-expression "&&" inclusive-or-expression
conditional-or-expression ::=
conditional-and-expression
conditional-or-expression "||" conditional-and-expression
null-coalescing-expression ::=
conditional-or-expression
conditional-or-expression "??" null-coalescing-expression
conditional-expression ::= null-coalescing-expression null-coalescing-expression "?" expression ":" expression
assignment ::= unary-expression assignment-operator expression
assignment-operator ::= "=" "+=" "-=" "*=" "/=" "%=" "&=" "|=" "^=" "<<=" right-shift-assignment
expression ::= conditional-expression assignment
constant-expression ::= expression
boolean-expression ::= expression
statement ::= labeled-statement declaration-statement embedded-statement
embedded-statement ::= block empty-statement expression-statement selection-statement iteration-statement jump-statement try-statement checked-statement unchecked-statement lock-statement using-statement yield-statement
block ::= "{" statement-list "}"
statement-list ::= statement statement-list statement
empty-statement ::=
";"
labeled-statement ::=
identifier ":" statement
declaration-statement ::= local-variable-declaration ";" local-constant-declaration ";"
local-variable-declaration ::= type local-variable-declarators
local-variable-declarators ::=
local-variable-declarator
local-variable-declarators "," local-variable-declarator
local-variable-declarator ::=
identifier
identifier "=" local-variable-initializer
local-variable-initializer ::= expression array-initializer
local-constant-declaration ::=
"const" type constant-declarators
constant-declarators ::=
constant-declarator
constant-declarators "," constant-declarator
constant-declarator ::=
identifier "=" constant-expression
expression-statement ::=
statement-expression ";"
statement-expression ::= invocation-expression object-creation-expression assignment post-increment-expression post-decrement-expression pre-increment-expression pre-decrement-expression
selection-statement ::= if-statement switch-statement
if-statement ::= "if" "(" boolean-expression ")" embedded-statement "if" "(" boolean-expression ")" embedded-statement "else" embedded-statement
switch-statement ::= "switch" "(" expression ")" switch-block
switch-block ::= "{" switch-sections "}"
switch-sections ::= switch-section switch-sections switch-section
switch-section ::= switch-labels statement-list
switch-labels ::= switch-label switch-labels switch-label
switch-label ::= "case" constant-expression ":" "default" ":"
iteration-statement ::= while-statement do-statement for-statement foreach-statement
while-statement ::= "while" "(" boolean-expression ")" embedded-statement
do-statement ::= "do" embedded-statement "while" "(" boolean-expression ")" ";"
for-statement ::= "for" "(" for-initializer ";" for-condition ";" for-iterator ")" embedded-statement
for-initializer ::= local-variable-declaration statement-expression-list
for-condition ::= boolean-expression
for-iterator ::= statement-expression-list
statement-expression-list ::=
statement-expression
statement-expression-list "," statement-expression
foreach-statement ::= "foreach" "(" type identifier "in" expression ")" embedded-statement
jump-statement ::= break-statement continue-statement goto-statement return-statement throw-statement
break-statement ::= "break" ";"
continue-statement ::= "continue" ";"
goto-statement ::= "goto" identifier ";" "goto" "case" constant-expression ";" "goto" "default" ";"
return-statement ::= "return" expression ";"
throw-statement ::= "throw" expression ";"
try-statement ::= "try" block catch-clauses "try" block catch-clauses finally-clause
catch-clauses ::=
specific-catch-clauses
specific-catch-clauses
general-catch-clausespecific-catch-clauses ::= specific-catch-clause specific-catch-clauses specific-catch-clause
specific-catch-clause ::= "catch" "(" class-type identifier ")" block
general-catch-clause ::=
"catch" block
finally-clause ::=
"finally" block
checked-statement ::=
"checked" block
unchecked-statement ::=
"unchecked" block
lock-statement ::= "lock" "(" expression ")" embedded-statement
using-statement ::= "using" "(" resource-acquisition ")" embedded-statement
resource-acquisition ::= local-variable-declaration expression
yield-statement ::= "yield" "return" expression ";" "yield" "break" ";"
namespace-declaration ::= "namespace" qualified-identifier namespace-body ";"
qualified-identifier ::=
identifier
qualified-identifier "." identifier
namespace-body ::= "{" extern-alias-directives using-directives namespace-member-declarations "}"
extern-alias-directives ::= extern-alias-directive extern-alias-directives extern-alias-directive
extern-alias-directive ::= "extern" "alias" identifier ";"
using-directives ::= using-directive using-directives using-directive
using-directive ::= using-alias-directive using-namespace-directive
using-alias-directive ::= "using" identifier "=" namespace-or-type-name ";"
using-namespace-directive ::= "using" namespace-name ";"
namespace-member-declarations ::= namespace-member-declaration namespace-member-declarations namespace-member-declaration
namespace-member-declaration ::= namespace-declaration type-declaration
type-declaration ::= class-declaration struct-declaration interface-declaration enum-declaration delegate-declaration
qualified-alias-member ::= identifier "::" identifier type-argument-list
class-declaration ::= attributes"partial" "class" identifier type-parameter-list class-base type-parameter-constraints-clauses class-body ";"class-modifiers
class-modifiers ::= class-modifier class-modifiers class-modifier
class-modifier ::= "new" "public" "protected" "internal" "private" "abstract" "sealed" "static"
class-base ::= ":" class-type ":" interface-type-list ":" class-type "," interface-type-list
interface-type-list ::=
interface-type
interface-type-list "," interface-type
class-body ::= "{" class-member-declarations "}"
class-member-declarations ::= class-member-declaration class-member-declarations class-member-declaration
class-member-declaration ::= constant-declaration field-declaration method-declaration property-declaration event-declaration indexer-declaration operator-declaration constructor-declaration finalizer-declaration static-constructor-declaration type-declaration
constant-declaration ::= attributes"const" type constant-declarators ";"constant-modifiers
constant-modifiers ::= constant-modifier constant-modifiers constant-modifier
constant-modifier ::= "new" "public" "protected" "internal" "private"
field-declaration ::= attributes";"field-modifiers type variable-declarators
field-modifiers ::= field-modifier field-modifiers field-modifier
field-modifier ::= "new" "public" "protected" "internal" "private" "static" "readonly" "volatile"
variable-declarators ::=
variable-declarator
variable-declarators "," variable-declarator
variable-declarator ::=
identifier
identifier "=" variable-initializer
variable-initializer ::= expression array-initializer
method-declaration ::= method-header method-body
method-header ::= attributes"(" formal-parameter-list ")" type-parameter-constraints-clausesmethod-modifiers return-type member-name type-parameter-list
method-modifiers ::= method-modifier method-modifiers method-modifier
method-modifier ::= "new" "public" "protected" "internal" "private" "static" "virtual" "sealed" "override" "abstract" "extern"
return-type ::=
type
"void"
member-name ::=
identifier
interface-type "." identifier
method-body ::=
block
";"
formal-parameter-list ::=
fixed-parameters
fixed-parameters "," parameter-array
parameter-array
fixed-parameters ::=
fixed-parameter
fixed-parameters "," fixed-parameter
fixed-parameter ::= attributesparameter-modifier type identifier
parameter-modifier ::= "ref" "out"
parameter-array ::= attributes"params" array-type identifier
property-declaration ::= attributes"{" accessor-declarations "}"property-modifiers type member-name
property-modifiers ::= property-modifier property-modifiers property-modifier
property-modifier ::= "new" "public" "protected" "internal" "private" "static" "virtual" "sealed" "override" "abstract" "extern"
accessor-declarations ::= get-accessor-declaration set-accessor-declarationset-accessor-declaration get-accessor-declaration
get-accessor-declaration ::= attributes"get" accessor-bodyaccessor-modifier
set-accessor-declaration ::= attributes"set" accessor-bodyaccessor-modifier
accessor-modifier ::= "protected" "internal" "private" "protected" "internal" "internal" "protected"
accessor-body ::=
block
";"
event-declaration ::= attributes"event" type variable-declarators ";" attributes event-modifiers "event" type member-name "{" event-accessor-declarations "}"event-modifiers
event-modifiers ::= event-modifier event-modifiers event-modifier
event-modifier ::= "new" "public" "protected" "internal" "private" "static" "virtual" "sealed" "override" "abstract" "extern"
event-accessor-declarations ::= add-accessor-declaration remove-accessor-declaration remove-accessor-declaration add-accessor-declaration
add-accessor-declaration ::= attributes"add" block
remove-accessor-declaration ::= attributes"remove" block
indexer-declaration ::= attributes"{" accessor-declarations "}"indexer-modifiers indexer-declarator
indexer-modifiers ::= indexer-modifier indexer-modifiers indexer-modifier
indexer-modifier ::= "new" "public" "protected" "internal" "private" "virtual" "sealed" "override" "abstract" "extern"
indexer-declarator ::= type "this" "[" formal-parameter-list "]" type interface-type "." "this" "[" formal-parameter-list "]"
operator-declaration ::=
attributes
operator-modifiers operator-declarator operator-bodyoperator-modifiers ::= operator-modifier operator-modifiers operator-modifier
operator-modifier ::= "public" "static" "extern"
operator-declarator ::= unary-operator-declarator binary-operator-declarator conversion-operator-declarator
unary-operator-declarator ::= type "operator" overloadable-unary-operator "(" type identifier ")"
overloadable-unary-operator ::= "+" "-" "!" "~" "++" "--" "true" "false"
binary-operator-declarator ::= type "operator" overloadable-binary-operator "(" type identifier "," type identifier ")"
overloadable-binary-operator ::= "+" "-" "*" "/" "%" "&" "|" "^" "<<" right-shift "==" "!=" ">" "<" ">=" "<="
conversion-operator-declarator ::= "implicit" "operator" type "(" type identifier ")" "explicit" "operator" type "(" type identifier ")"
operator-body ::=
block
";"
constructor-declaration ::= attributesconstructor-modifiers constructor-declarator constructor-body
constructor-modifiers ::= constructor-modifier constructor-modifiers constructor-modifier
constructor-modifier ::= "public" "protected" "internal" "private" "extern"
constructor-declarator ::= identifier "(" formal-parameter-list ")" constructor-initializer
constructor-initializer ::= ":" "base" "(" argument-list ")" ":" "this" "(" argument-list ")"
constructor-body ::=
block
";"
static-constructor-declaration ::= attributes"(" ")" static-constructor-bodystatic-constructor-modifiers identifier
static-constructor-modifiers ::= "extern" "static" "static" "extern"
static-constructor-body ::=
block
";"
finalizer-declaration ::= attributes"extern" "~" identifier "(" ")" finalizer-body
finalizer-body ::=
block
";"
struct-declaration ::= attributes"partial" "struct" identifier type-parameter-list struct-interfaces type-parameter-constraints-clauses struct-body ";"struct-modifiers
struct-modifiers ::= struct-modifier struct-modifiers struct-modifier
struct-modifier ::= "new" "public" "protected" "internal" "private"
struct-interfaces ::=
":" interface-type-list
struct-body ::= "{" struct-member-declarations "}"
struct-member-declarations ::= struct-member-declaration struct-member-declarations struct-member-declaration
struct-member-declaration ::= constant-declaration field-declaration method-declaration property-declaration event-declaration indexer-declaration operator-declaration constructor-declaration static-constructor-declaration type-declaration
array-initializer ::= "{" variable-initializer-list "}" "{" variable-initializer-list "," "}"
variable-initializer-list ::=
variable-initializer
variable-initializer-list "," variable-initializer
interface-declaration ::= attributes"partial" "interface" identifier type-parameter-list interface-base type-parameter-constraints-clauses interface-body ";"interface-modifiers
interface-modifiers ::= interface-modifier interface-modifiers interface-modifier
interface-modifier ::= "new" "public" "protected" "internal" "private"
interface-base ::=
":" interface-type-list
interface-body ::= "{" interface-member-declarations "}"
interface-member-declarations ::= interface-member-declaration interface-member-declarations interface-member-declaration
interface-member-declaration ::= interface-method-declaration interface-property-declaration interface-event-declaration interface-indexer-declaration
interface-method-declaration ::= attributes"new" return-type identifier type-parameter-list "(" formal-parameter-list ")" type-parameter-constraints-clauses ";"
interface-property-declaration ::= attributes"new" type identifier "{" interface-accessors "}"
interface-accessors ::= attributes"get" ";" attributes "set" ";" attributes "get" ";" attributes "set" ";" attributes "set" ";" attributes "get" ";"
interface-event-declaration ::= attributes"new" "event" type identifier ";"
interface-indexer-declaration ::= attributes"new" type "this" "[" formal-parameter-list "]" "{" interface-accessors "}"
enum-declaration ::= attributes"enum" identifier enum-base enum-body ";"enum-modifiers
enum-base ::=
":" integral-type
enum-body ::= "{" enum-member-declarations "}" "{" enum-member-declarations "," "}"
enum-modifiers ::= enum-modifier enum-modifiers enum-modifier
enum-modifier ::= "new" "public" "protected" "internal" "private"
enum-member-declarations ::=
enum-member-declaration
enum-member-declarations "," enum-member-declaration
enum-member-declaration ::= attributes"=" constant-expressionidentifier attributes identifier
delegate-declaration ::= attributes"delegate" return-type identifier type-parameter-list "(" formal-parameter-list ")" type-parameter-constraints-clauses ";"delegate-modifiers
delegate-modifiers ::= delegate-modifier delegate-modifiers delegate-modifier
delegate-modifier ::= "new" "public" "protected" "internal" "private"
global-attributes ::= global-attribute-sections
global-attribute-sections ::= global-attribute-section global-attribute-sections global-attribute-section
global-attribute-section ::= "[" global-attribute-target-specifier attribute-list "]" "[" global-attribute-target-specifier attribute-list "," "]"
global-attribute-target-specifier ::=
global-attribute-target ":"
global-attribute-target ::= identifier keyword
attributes ::= attribute-sections
attribute-sections ::= attribute-section attribute-sections attribute-section
attribute-section ::= "[" attribute-target-specifier attribute-list "]" "[" attribute-target-specifier attribute-list "," "]"
attribute-target-specifier ::=
attribute-target ":"
attribute-target ::= identifier keyword
attribute-list ::=
attribute
attribute-list "," attribute
attribute ::=
attribute-name attribute-arguments
attribute-name ::= type-name
attribute-arguments ::= "(" positional-argument-list ")" "(" positional-argument-list "," named-argument-list ")" "(" named-argument-list ")"
positional-argument-list ::=
positional-argument
positional-argument-list "," positional-argument
positional-argument ::= attribute-argument-expression
named-argument-list ::=
named-argument
named-argument-list "," named-argument
named-argument ::=
identifier "=" attribute-argument-expression
attribute-argument-expression ::= expression
type-parameter-list ::= "<" type-parameters ">"
type-parameters ::= attributes"," attributes type-parametertype-parameter type-parameters
type-parameter ::= identifier
type-argument-list ::= "<" type-arguments ">"
type-arguments ::=
type-argument
type-arguments "," type-argument
type-argument ::= type
type-parameter-constraints-clauses ::= type-parameter-constraints-clause type-parameter-constraints-clauses type-parameter-constraints-clause
type-parameter-constraints-clause ::= "where" type-parameter ":" type-parameter-constraints
type-parameter-constraints ::= primary-constraint secondary-constraints constructor-constraint primary-constraint "," secondary-constraints primary-constraint "," constructor-constraint secondary-constraints "," constructor-constraint primary-constraint "," secondary-constraints "," constructor-constraint
primary-constraint ::= class-type "class" "struct"
secondary-constraints ::= interface-type type-parameter secondary-constraints "," interface-type secondary-constraints "," type-parameter
constructor-constraint ::= "new" "(" ")"
keyword ::= "abstract" "as" "base" "bool" "break" "byte" "case" "catch" "char" "checked" "class" "const" "continue" "decimal" "default" "delegate" "do" "double" "else" "enum" "event" "explicit" "extern" "false" "finally" "fixed" "float" "for" "foreach" "goto" "if" "implicit" "in" "int" "interface" "internal" "is" "lock" "long" "namespace" "new" "null" "object" "operator" "out" "override" "params" "private" "protected" "public" "readonly" "ref" "return" "sbyte" "sealed" "short" "sizeof" "stackalloc" "static" "string" "struct" "switch" "this" "throw" "true" "try" "typeof" "uint" "ulong" "unchecked" "unsafe" "ushort" "using" "virtual" "void" "volatile" "while" "get" "set" "yield" "add" "remove" "alias" "partial" "where"