SharpDisasm.Tests/OpTableGeneration.cs
/// <summary>
/// Recursively construct a tree entry mapping an array of opcodes to an object
/// </summary>
/// <param name="opcodes"></param>
/// <param name="obj"></param>
/// <returns></returns>
Recursively construct a tree entry mapping an array of opcodes to an object
Recursively construct a tree entry mapping an array of opcodes to an object
private object MakeTree(string[] opcodes, object obj)
            {
                if (opcodes == null || opcodes.Length == 0)
                    return obj;
                var opc = opcodes[0];
                var tbl = NewTable(UdOpcodeTable.GetOpcodeType(opc));
                tbl.Add(opc, MakeTree(opcodes.Skip(1).ToArray(), obj));
                return tbl;
            }
private object MakeTree ( string [ ] opcodes , object obj ) { if ( opcodes == null || opcodes . Length == 0 ) return obj ; var opc = opcodes [ 0 ] ; var tbl = NewTable ( UdOpcodeTable . GetOpcodeType ( opc ) ) ; tbl . Add ( opc , MakeTree ( opcodes . Skip ( 1 ) . ToArray ( ) , obj ) ) ; return tbl ; }
Recursively construct a tree entry mapping an array of opcodes to an object
Recursively construct a tree entry mapping an array of opcodes to an object
None
opcodes
string[]
None
obj
object
None