|
|
|
@ -954,7 +954,9 @@ Type<out TypeReference type>
@@ -954,7 +954,9 @@ Type<out TypeReference type>
|
|
|
|
|
= |
|
|
|
|
( ClassType<out type> |
|
|
|
|
| SimpleType<out name> (. type = new TypeReference(name); .) |
|
|
|
|
|
|
|
|
|
[ NullableQuestionMark<ref type> ] |
|
|
|
|
|
|
|
|
|
| "void" "*" (. pointer = 1; type = new TypeReference("void"); .) |
|
|
|
|
) (. List<int> r = new List<int>(); .) |
|
|
|
|
|
|
|
|
@ -970,6 +972,32 @@ Type<out TypeReference type>
@@ -970,6 +972,32 @@ Type<out TypeReference type>
|
|
|
|
|
.) |
|
|
|
|
. |
|
|
|
|
|
|
|
|
|
TypeWONullableQuestionMark<out TypeReference type> |
|
|
|
|
(. |
|
|
|
|
string name; |
|
|
|
|
int pointer = 0; |
|
|
|
|
type = null; |
|
|
|
|
.) |
|
|
|
|
= |
|
|
|
|
( ClassTypeWONullableQuestionMark<out type> |
|
|
|
|
| SimpleType<out name> (. type = new TypeReference(name); .) |
|
|
|
|
|
|
|
|
|
| "void" "*" (. pointer = 1; type = new TypeReference("void"); .) |
|
|
|
|
) (. List<int> r = new List<int>(); .) |
|
|
|
|
|
|
|
|
|
{ IF (IsPointerOrDims()) (. int i = 0; .) |
|
|
|
|
( "*" (. ++pointer; .) |
|
|
|
|
| "[" { "," (. ++i; .) } "]" (. r.Add(i); .) |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
(. if (type != null) { |
|
|
|
|
type.RankSpecifier = r.ToArray(); |
|
|
|
|
type.PointerNestingLevel = pointer; |
|
|
|
|
} |
|
|
|
|
.) |
|
|
|
|
. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NonArrayType<out TypeReference type> |
|
|
|
|
(. |
|
|
|
|
string name; |
|
|
|
@ -979,7 +1007,7 @@ NonArrayType<out TypeReference type>
@@ -979,7 +1007,7 @@ NonArrayType<out TypeReference type>
|
|
|
|
|
= |
|
|
|
|
( ClassType<out type> |
|
|
|
|
| SimpleType<out name> (. type = new TypeReference(name); .) |
|
|
|
|
[ NullableQuestionMark<ref type> ] |
|
|
|
|
[ NullableQuestionMark<ref type> ] |
|
|
|
|
| "void" "*" (. pointer = 1; type = new TypeReference("void"); .) |
|
|
|
|
) |
|
|
|
|
|
|
|
|
@ -1078,6 +1106,14 @@ ClassType<out TypeReference typeRef>
@@ -1078,6 +1106,14 @@ ClassType<out TypeReference typeRef>
|
|
|
|
|
| "string" (. typeRef = new TypeReference("string"); .) |
|
|
|
|
. |
|
|
|
|
|
|
|
|
|
ClassTypeWONullableQuestionMark<out TypeReference typeRef> |
|
|
|
|
(. TypeReference r; typeRef = null; .) |
|
|
|
|
= |
|
|
|
|
TypeNameWONullableQuestionMark<out r> (. typeRef = r; .) |
|
|
|
|
| "object" (. typeRef = new TypeReference("object"); .) |
|
|
|
|
| "string" (. typeRef = new TypeReference("string"); .) |
|
|
|
|
. |
|
|
|
|
|
|
|
|
|
IntegralType<out string name> (. name = ""; .) |
|
|
|
|
= |
|
|
|
|
"sbyte" (. name = "sbyte"; .) |
|
|
|
@ -2244,7 +2280,7 @@ RelationalExpr<ref Expression outExpr>
@@ -2244,7 +2280,7 @@ RelationalExpr<ref Expression outExpr>
|
|
|
|
|
"is" (. op = BinaryOperatorType.TypeCheck; .) |
|
|
|
|
| "as" (. op = BinaryOperatorType.AsCast; .) |
|
|
|
|
) |
|
|
|
|
Type<out type> (. outExpr = new BinaryOperatorExpression(outExpr, op, new TypeReferenceExpression(type)); .) |
|
|
|
|
TypeWONullableQuestionMark<out type> (. outExpr = new BinaryOperatorExpression(outExpr, op, new TypeReferenceExpression(type)); .) |
|
|
|
|
} |
|
|
|
|
. |
|
|
|
|
|
|
|
|
@ -2324,6 +2360,31 @@ TypeName<out TypeReference typeRef>
@@ -2324,6 +2360,31 @@ TypeName<out TypeReference typeRef>
|
|
|
|
|
[ NullableQuestionMark<ref typeRef> ] |
|
|
|
|
. |
|
|
|
|
|
|
|
|
|
TypeNameWONullableQuestionMark<out TypeReference typeRef> |
|
|
|
|
(. List<TypeReference> typeArguments = null; |
|
|
|
|
string alias = null; |
|
|
|
|
string qualident; |
|
|
|
|
.) |
|
|
|
|
= |
|
|
|
|
[ IF (la.kind == Tokens.Identifier && Peek(1).kind == Tokens.DoubleColon) |
|
|
|
|
ident (. alias = t.val; .) |
|
|
|
|
"::" |
|
|
|
|
] |
|
|
|
|
Qualident<out qualident> |
|
|
|
|
[ TypeArgumentList<out typeArguments> ] |
|
|
|
|
(. |
|
|
|
|
if (alias == null) { |
|
|
|
|
typeRef = new TypeReference(qualident, typeArguments); |
|
|
|
|
} else if (alias == "global") { |
|
|
|
|
typeRef = new TypeReference(qualident, typeArguments); |
|
|
|
|
typeRef.IsGlobal = true; |
|
|
|
|
} else { |
|
|
|
|
typeRef = new TypeReference(alias + "." + qualident, typeArguments); |
|
|
|
|
} |
|
|
|
|
.) |
|
|
|
|
. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NullableQuestionMark<ref TypeReference typeRef> |
|
|
|
|
(. List<TypeReference> typeArguments = new List<TypeReference>(1); .) |
|
|
|
|
= |
|
|
|
|