You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You must specify type names to have valid input to various reflection operations. A fully qualified type name consists of an assembly name specification, a namespace specification, and a type name. Type name specifications are used by methods such as <xref:System.Type.GetType%2A?displayProperty=nameWithType>, <xref:System.Reflection.Module.GetType%2A?displayProperty=nameWithType>, <xref:System.Reflection.Emit.ModuleBuilder.GetType%2A?displayProperty=nameWithType>, and <xref:System.Reflection.Assembly.GetType%2A?displayProperty=nameWithType>.
22
22
23
-
## Grammar for Type Names
23
+
## Grammar for type names
24
24
The grammar defines the syntax of formal languages. The following table lists lexical rules that describe how to recognize a valid input. Terminals (those elements that are not further reducible) are shown in all uppercase letters. Nonterminals (those elements that are further reducible) are shown in mixed-case or singly quoted strings, but the single quote (') is not a part of the syntax itself. The pipe character (|) denotes rules that have subrules.
25
25
26
26
```antlr
@@ -35,10 +35,13 @@ ReferenceTypeSpec
35
35
36
36
SimpleTypeSpec
37
37
: PointerTypeSpec
38
-
| ArrayTypeSpec
38
+
| GenericTypeSpec
39
39
| TypeName
40
40
;
41
41
42
+
GenericTypeSpec
43
+
: SimpleTypeSpec ` NUMBER
44
+
42
45
PointerTypeSpec
43
46
: SimpleTypeSpec '*'
44
47
;
@@ -101,7 +104,7 @@ AssemblyProperty
101
104
;
102
105
```
103
106
104
-
## Specifying Special Characters
107
+
## Specifying special characters
105
108
In a type name, IDENTIFIER is any valid name determined by the rules of a language.
106
109
107
110
Use the backslash (\\) as an escape character to separate the following tokens when used as part of IDENTIFIER.
@@ -125,7 +128,7 @@ AssemblyProperty
125
128
126
129
If the namespace were `Ozzy.Out+Back`, then the plus sign must be preceded by a backslash. Otherwise, the parser would interpret it as a nesting separator. Reflection emits this string as `Ozzy.Out\+Back.Kangaroo+Wallaby,MyAssembly`.
127
130
128
-
## Specifying Assembly Names
131
+
## Specifying assembly names
129
132
The minimum information required in an assembly name specification is the textual name (IDENTIFIER) of the assembly. You can follow the IDENTIFIER by a comma-separated list of property/value pairs as described in the following table. IDENTIFIER naming should follow the rules for file naming. The IDENTIFIER is case-insensitive.
SimpleTypeSpec\`NUMBERrepresentsanopengenerictypewithfrom1to*n*generictypeparameters. Forexample, togetreferencetotheopengenerictypeList\<T>ortheclosedgenerictypeList\<String>, use ``Type.GetType("System.Collections.Generic.List`1")`` TogetareferencetothegenerictypeDictionary\<TKey,TValue>, use ``Type.GetType("System.Collections.Generic.Dictionary`2")``.
180
+
181
+
## Specifying pointers
176
182
SimpleTypeSpec*representsanunmanagedpointer. Forexample, togetapointertotypeMyType, use `Type.GetType("MyType*")`. TogetapointertoapointertotypeMyType, use `Type.GetType("MyType**")`.
177
183
178
-
## Specifying References
184
+
## Specifying references
179
185
SimpleTypeSpec&representsamanagedpointerorreference. Forexample, togetareferencetotypeMyType, use `Type.GetType("MyType &")`. Notethatunlikepointers, referencesarelimitedtoonelevel.
0 commit comments