* ILParser.jay: Emit INSTR_I8 instructions as int
authorJackson Harper <jackson@novell.com>
Tue, 6 May 2003 08:00:01 +0000 (08:00 -0000)
committerJackson Harper <jackson@novell.com>
Tue, 6 May 2003 08:00:01 +0000 (08:00 -0000)
instructions. Implement label lists, emit switch instruction.

svn path=/trunk/mcs/; revision=14324

mcs/ilasm/parser/ChangeLog
mcs/ilasm/parser/ILParser.jay

index e53a1623e8178b04c57e3bf1a14dd8c3b6a10c59..6162a39cf8987c9e2ec0af1f72e3f274d4c6dab0 100644 (file)
@@ -1,3 +1,8 @@
+2003-05-06 Jackson Harper <jackson@latitudegeo.com>
+
+       * ILParser.jay: Emit INSTR_I8 instructions as int
+       instructions. Implement label lists, emit switch instruction.
+               
 2003-05-05 Jackson Harper <jackson@latitudegeo.com>
 
        * ILParser.jay: Add labels to methods, add branching instructions.
index 0d03aea807f0e4f2582a4084060bff8114b484da..44e57851e72ff7aa873df29394580b67b20bf6f6 100644 (file)
@@ -1513,7 +1513,8 @@ instr                     : INSTR_NONE
                        | INSTR_I id /* Allow variable names */\r
                        | INSTR_I8 int64\r
                           {\r
-                                \r
+                                codegen.CurrentMethodDef.AddInstr (new\r
+                                        IntInstr ((IntOp) $1, (int) $2));\r
                           }\r
                        | INSTR_R float64\r
                           {\r
@@ -1535,7 +1536,7 @@ instr                     : INSTR_NONE
                        | INSTR_R OPEN_PARENS bytes CLOSE_PARENS\r
                        | INSTR_BRTARGET int32\r
                           {\r
-                                \r
+                                // Need to add this to PEAPI        \r
                           }\r
                        | INSTR_BRTARGET id\r
                           {\r
@@ -1559,6 +1560,10 @@ instr                    : INSTR_NONE
                        | INSTR_SIG call_conv type OPEN_PARENS sig_args CLOSE_PARENS\r
                        | INSTR_TOK owner_type\r
                        | INSTR_SWITCH OPEN_PARENS labels CLOSE_PARENS\r
+                          {\r
+                                codegen.CurrentMethodDef.AddInstr (new SwitchInstr ((ArrayList) $3,\r
+                                        codegen.CurrentMethodDef));\r
+                          }\r
                        ;\r
 \r
 method_ref             : call_conv type type_spec DOUBLE_COLON method_name \r
@@ -1569,9 +1574,27 @@ method_ref               : call_conv type type_spec DOUBLE_COLON method_name
 \r
 labels                 : /* EMPTY */\r
                        | id\r
+                          {\r
+                                ArrayList label_list = new ArrayList ();\r
+                                label_list.Add ($1);\r
+                                $$ = label_list;\r
+                          }\r
                        | int32\r
+                          {\r
+                                ArrayList label_list = new ArrayList ();\r
+                                label_list.Add ($1);\r
+                                $$ = label_list;\r
+                          }\r
                        | labels COMMA id\r
+                          {\r
+                                ArrayList label_list = (ArrayList) $1;\r
+                                label_list.Add ($3);\r
+                          }\r
                        | labels COMMA int32\r
+                          {\r
+                                ArrayList label_list = (ArrayList) $1;\r
+                                label_list.Add ($3);\r
+                          }\r
                        ;\r
 \r
 owner_type             : type_spec\r