/// <summary> /// Initializes a new instance of the <see cref="DecompilerContext" /> class. /// </summary> /// <param name="decompiler">The decompiler.</param> /// <param name="flowAnalyzer"></param> /// <param name="asm">The asm.</param> public DecompilerContext(IPapyrusDecompiler decompiler, IFlowAnalyzer flowAnalyzer, PapyrusAssemblyDefinition asm) { this.decompiler = decompiler; this.flowAnalyzer = flowAnalyzer; this.asm = asm; TempStringTable = new PapyrusStringTable(); codeBlocks = new Map <int, PapyrusCodeBlock>(); flowAnalyzer.SetContext(this); }
/// <summary> /// Builds the temporary string table. /// </summary> public void BuildTempStringTable() { TempStringTable = new PapyrusStringTable(); TempStringTable.Add("true"); TempStringTable.Add("false"); TempStringTable.Add("find"); TempStringTable.Add("rfind"); TempStringTable.Add("add"); TempStringTable.Add("insert"); TempStringTable.Add("removelast"); TempStringTable.Add("remove"); TempStringTable.Add("clear"); }
private void ReadStringTable(PapyrusAssemblyDefinition asm) { var stringTableLength = pexReader.ReadInt16(); var stringTable = new PapyrusStringTable(); for (var i = 0; i < stringTableLength; i++) { stringTable.Add(pexReader.ReadString(), true); } asm.StringTable = stringTable; pexReader.SetStringTable(stringTable); }
/// <summary> /// Initializes a new instance of the <see cref="Index" /> class. /// </summary> /// <param name="table">The table.</param> /// <param name="tableIndex">Index of the table.</param> /// <param name="identifier">The identifier.</param> public PapyrusStringTableIndex(PapyrusStringTable table, int tableIndex, string identifier) : this(tableIndex, identifier) { this.table = table; }
/// <summary> /// Sets the string table. /// </summary> /// <param name="stringTable">The string table.</param> public void SetStringTable(PapyrusStringTable stringTable) { StringTable = stringTable; }