Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mcs/ilasm/codegen/InstrBase.cs')
-rw-r--r--mcs/ilasm/codegen/InstrBase.cs51
1 files changed, 51 insertions, 0 deletions
diff --git a/mcs/ilasm/codegen/InstrBase.cs b/mcs/ilasm/codegen/InstrBase.cs
new file mode 100644
index 00000000000..3fba1787275
--- /dev/null
+++ b/mcs/ilasm/codegen/InstrBase.cs
@@ -0,0 +1,51 @@
+// InstrBase.cs
+// (C) Sergey Chaban (serge@wildwestsoftware.com)
+
+using System;
+using System.Reflection.Emit;
+
+namespace Mono.ILASM {
+
+ public abstract class InstrBase {
+
+ private OpCode opcode;
+
+ /// <summary>
+ /// </summary>
+ /// <param name="opcode"></param>
+ public InstrBase (OpCode opcode)
+ {
+ this.opcode = opcode;
+ }
+
+ /// <summary>
+ /// </summary>
+ /// <param name="tok"></param>
+ public InstrBase (InstrToken tok) : this ((OpCode)tok.Value)
+ {
+ }
+
+
+ /// <summary>
+ /// </summary>
+ /// <param name="tok"></param>
+ public InstrBase (ILToken tok) : this (tok as InstrToken)
+ {
+ }
+
+
+ /// <summary>
+ /// </summary>
+ public OpCode Opcode {
+ get {
+ return opcode;
+ }
+ }
+
+
+ /// <summary>
+ /// </summary>
+ /// <param name="gen"></param>
+ public abstract void Emit (ILGenerator ilgen, Class host);
+ }
+}