Permalink
Browse files

In ilasm/tests:

	* test-uint.il: New. Test for keywords uint8, uint16, uint32 & uint64.

2005-12-14  Ankit Jain  <jankit@novell.com>

In ilasm/scanner:
2005-12-14  Ankit Jain  <jankit@novell.com>

	* ILTables.cs (keywords): Add uint8, uint16, uint32 and uint64 keywords.

In ilasm/parser:
2005-12-14  Ankit Jain  <jankit@novell.com>

	* ILParser.jay: Add K_UINT8, K_UINT16, K_UINT32 and K_UINT64 tokens.
	(type): Add rule for the new keywords.
	(native_type): Likewise.
	Fix #76978.


svn path=/trunk/mcs/; revision=54354
  • Loading branch information...
1 parent 260014c commit d6138e051deadd923670412a98482d70fbbff4e4 @radical radical committed Dec 14, 2005
View
7 mcs/ilasm/parser/ChangeLog
@@ -1,3 +1,10 @@
+2005-12-14 Ankit Jain <jankit@novell.com>
+
+ * ILParser.jay: Add K_UINT8, K_UINT16, K_UINT32 and K_UINT64 tokens.
+ (type): Add rule for the new keywords.
+ (native_type): Likewise.
+ Fix #76978.
+
2005-12-13 Ankit Jain <jankit@novell.com>
* ILParser.jay (class_head | D_CLASS ..): Use 'comp_name' instead of 'id' to allow
View
37 mcs/ilasm/parser/ILParser.jay
@@ -363,6 +363,10 @@ namespace Mono.ILASM {
%token K_FLOAT64
%token K_ERROR
%token K_UNSIGNED
+%token K_UINT8
+%token K_UINT16
+%token K_UINT32
+%token K_UINT64
%token K_DECIMAL
%token K_DATE
%token K_BSTR
@@ -915,18 +919,35 @@ type : K_CLASS class_ref
{
$$ = new PrimitiveTypeRef (PrimitiveType.UInt8, "System.Byte");
}
+ | K_UINT8
+ {
+ $$ = new PrimitiveTypeRef (PrimitiveType.UInt8, "System.Byte");
+ }
| K_UNSIGNED K_INT16
{
$$ = new PrimitiveTypeRef (PrimitiveType.UInt16, "System.UInt16");
}
+ | K_UINT16
+ {
+ $$ = new PrimitiveTypeRef (PrimitiveType.UInt16, "System.UInt16");
+ }
+
| K_UNSIGNED K_INT32
{
$$ = new PrimitiveTypeRef (PrimitiveType.UInt32, "System.UInt32");
}
+ | K_UINT32
+ {
+ $$ = new PrimitiveTypeRef (PrimitiveType.UInt32, "System.UInt32");
+ }
| K_UNSIGNED K_INT64
{
$$ = new PrimitiveTypeRef (PrimitiveType.UInt64, "System.UInt64");
}
+ | K_UINT64
+ {
+ $$ = new PrimitiveTypeRef (PrimitiveType.UInt64, "System.UInt64");
+ }
| K_NATIVE K_INT
{
// TODO: Is this the proper full name
@@ -1113,18 +1134,34 @@ native_type : /* EMPTY */
{
$$ = NativeType.UInt8;
}
+ | K_UINT8
+ {
+ $$ = NativeType.UInt8;
+ }
| K_UNSIGNED K_INT16
{
$$ = NativeType.UInt16;
}
+ | K_UINT16
+ {
+ $$ = NativeType.UInt16;
+ }
| K_UNSIGNED K_INT32
{
$$ = NativeType.UInt32;
}
+ | K_UINT32
+ {
+ $$ = NativeType.UInt32;
+ }
| K_UNSIGNED K_INT64
{
$$ = NativeType.UInt64;
}
+ | K_UINT64
+ {
+ $$ = NativeType.UInt64;
+ }
| native_type STAR
| native_type OPEN_BRACKET CLOSE_BRACKET
{
View
4 mcs/ilasm/scanner/ChangeLog
@@ -1,3 +1,7 @@
+2005-12-14 Ankit Jain <jankit@novell.com>
+
+ * ILTables.cs (keywords): Add uint8, uint16, uint32 and uint64 keywords.
+
2005-11-28 Ankit Jain <jankit@novell.com>
* StringHelper.cs (idChars): Add ` to the list.
View
4 mcs/ilasm/scanner/ILTables.cs
@@ -211,6 +211,10 @@ public static Hashtable Keywords
keywords ["float64"] = new ILToken (Token.K_FLOAT64, "float64");
keywords ["error"] = new ILToken (Token.K_ERROR, "error");
keywords ["unsigned"] = new ILToken (Token.K_UNSIGNED, "unsigned");
+ keywords ["uint8"] = new ILToken (Token.K_UINT8, "uint8");
+ keywords ["uint16"] = new ILToken (Token.K_UINT16, "uint16");
+ keywords ["uint32"] = new ILToken (Token.K_UINT32, "uint32");
+ keywords ["uint64"] = new ILToken (Token.K_UINT64, "uint64");
keywords ["decimal"] = new ILToken (Token.K_DECIMAL, "decimal");
keywords ["date"] = new ILToken (Token.K_DATE, "date");
keywords ["bstr"] = new ILToken (Token.K_BSTR, "bstr");
View
4 mcs/ilasm/tests/ChangeLog
@@ -1,5 +1,9 @@
2005-12-14 Ankit Jain <jankit@novell.com>
+ * test-uint.il: New. Test for keywords uint8, uint16, uint32 & uint64.
+
+2005-12-14 Ankit Jain <jankit@novell.com>
+
* dotted-names.il: Add test for class with no explicit namespace.
2005-12-13 Ankit Jain <jankit@novell.com>
View
32 mcs/ilasm/tests/test-uint.il
@@ -0,0 +1,32 @@
+//Test for keywords : uint8, uint16, uint32 & uint64
+//Should get parsed as unsigned int8 .. etc
+//
+//uint8 in marshal (..) should get parsed as native types
+
+.assembly Test
+{
+}
+
+.namespace MonoTest
+{
+ .class private auto autochar beforefieldinit ConsoleApp
+ extends [mscorlib]System.Object
+ {
+ .field private marshal (uint8) int32 a0
+ .field private marshal (uint16) int32 a1
+ .field private marshal (uint32) int32 a2
+ .field private marshal (uint64) int64 a3
+
+ .method assembly hidebysig static void Test() cil managed
+ {
+ // Code size 74 (0x4a)
+ .maxstack 2
+
+ .locals init (uint8 V_0,
+ uint16 V_1,
+ uint32 V_2,
+ uint64 V_3)
+ ret
+ }
+ }
+}

0 comments on commit d6138e0

Please sign in to comment.