當前位置: 首頁>>代碼示例>>C#>>正文


C# SymbolWriter.CompileUnitEntry類代碼示例

本文整理匯總了C#中Mono.CompilerServices.SymbolWriter.CompileUnitEntry的典型用法代碼示例。如果您正苦於以下問題:C# CompileUnitEntry類的具體用法?C# CompileUnitEntry怎麽用?C# CompileUnitEntry使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


CompileUnitEntry類屬於Mono.CompilerServices.SymbolWriter命名空間,在下文中一共展示了CompileUnitEntry類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: SourceMethod

		public SourceMethod (CompileUnitEntry file, MethodDef method, Location start)
		{
			this.file = file;
			this.method = method;
			this.StartLine = start.line;

			lines = new ArrayList ();
			MarkLocation (start.line, 0);
		}
開發者ID:nobled,項目名稱:mono,代碼行數:9,代碼來源:DebuggingInfo.cs

示例2: MethodEntry

		internal MethodEntry(MonoSymbolFile file, CompileUnitEntry comp_unit, int token, ScopeVariable[] scope_vars, LocalVariableEntry[] locals, LineNumberEntry[] lines, CodeBlockEntry[] code_blocks, string real_name, MethodEntry.Flags flags, int namespace_id)
		{
			this.SymbolFile = file;
			this.real_name = real_name;
			this.locals = locals;
			this.code_blocks = code_blocks;
			this.scope_vars = scope_vars;
			this.flags = flags;
			this.index = -1;
			this.Token = token;
			this.CompileUnitIndex = comp_unit.Index;
			this.CompileUnit = comp_unit;
			this.NamespaceID = namespace_id;
			this.CheckLineNumberTable(lines);
			this.lnt = new LineNumberTable(file, lines);
			file.NumLineNumbers += lines.Length;
			int num_locals = (locals != null) ? locals.Length : 0;
			if (num_locals <= 32)
			{
				for (int i = 0; i < num_locals; i++)
				{
					string nm = locals[i].Name;
					for (int j = i + 1; j < num_locals; j++)
					{
						if (locals[j].Name == nm)
						{
							flags |= MethodEntry.Flags.LocalNamesAmbiguous;
							goto IL_108;
						}
					}
				}
				IL_108:;
			}
			else
			{
				Dictionary<string, LocalVariableEntry> local_names = new Dictionary<string, LocalVariableEntry>();
				for (int k = 0; k < locals.Length; k++)
				{
					LocalVariableEntry local = locals[k];
					if (local_names.ContainsKey(local.Name))
					{
						flags |= MethodEntry.Flags.LocalNamesAmbiguous;
						break;
					}
					local_names.Add(local.Name, local);
				}
			}
		}
開發者ID:qq1792,項目名稱:LSharp,代碼行數:48,代碼來源:MethodEntry.cs

示例3: MethodEntry

		internal MethodEntry (MonoSymbolFile file, CompileUnitEntry comp_unit,
				      int token, ScopeVariable[] scope_vars,
				      LocalVariableEntry[] locals, LineNumberEntry[] lines,
				      CodeBlockEntry[] code_blocks, string real_name,
				      Flags flags, int namespace_id)
		{
			this.SymbolFile = file;
			this.real_name = real_name;
			this.locals = locals;
			this.code_blocks = code_blocks;
			this.scope_vars = scope_vars;
			this.flags = flags;

			index = -1;

			Token = token;
			CompileUnitIndex = comp_unit.Index;
			CompileUnit = comp_unit;
			NamespaceID = namespace_id;

			CheckLineNumberTable (lines);
			lnt = new LineNumberTable (file, lines);
			file.NumLineNumbers += lines.Length;

			int num_locals = locals != null ? locals.Length : 0;

			if (num_locals <= 32) {
				// Most of the time, the O(n^2) factor is actually
				// less than the cost of allocating the hash table,
				// 32 is a rough number obtained through some testing.
				
				for (int i = 0; i < num_locals; i ++) {
					string nm = locals [i].Name;
					
					for (int j = i + 1; j < num_locals; j ++) {
						if (locals [j].Name == nm) {
							flags |= Flags.LocalNamesAmbiguous;
							goto locals_check_done;
						}
					}
				}
			locals_check_done :
				;
			} else {
				Hashtable local_names = new Hashtable ();
				foreach (LocalVariableEntry local in locals) {
					if (local_names.Contains (local.Name)) {
						flags |= Flags.LocalNamesAmbiguous;
						break;
					}
					local_names.Add (local.Name, local);
				}
			}
		}
開發者ID:transformersprimeabcxyz,項目名稱:monodevelop-1,代碼行數:54,代碼來源:MonoSymbolTable.cs

示例4: SourceFile

 public SourceFile(CompileUnitEntry comp_unit, SourceFileEntry entry)
 {
     this.compilation_unit = comp_unit;
     this.entry = entry;
 }
開發者ID:juancarlosbaezpozos,項目名稱:JustDecompileEngine,代碼行數:5,代碼來源:MdbWriter.cs

示例5: GetCompileUnit

		public CompileUnitEntry GetCompileUnit (int index)
		{
			if ((index < 1) || (index > ot.CompileUnitCount))
				throw new ArgumentException ();
			if (reader == null)
				throw new InvalidOperationException ();

			lock (this) {
				CompileUnitEntry unit;
				if (compile_unit_hash.TryGetValue (index, out unit))
					return unit;

				long old_pos = reader.BaseStream.Position;

				reader.BaseStream.Position = ot.CompileUnitTableOffset +
					CompileUnitEntry.Size * (index - 1);
				unit = new CompileUnitEntry (this, reader);
				compile_unit_hash.Add (index, unit);

				reader.BaseStream.Position = old_pos;
				return unit;
			}
		}
開發者ID:KAW0,項目名稱:Alter-Native,代碼行數:23,代碼來源:MonoSymbolFile.cs

示例6: DefineCompilationUnit

		public CompileUnitEntry DefineCompilationUnit (SourceFileEntry source)
		{
			CompileUnitEntry entry = new CompileUnitEntry (file, source);
			comp_units.Add (entry);
			return entry;
		}
開發者ID:transformersprimeabcxyz,項目名稱:monodevelop-1,代碼行數:6,代碼來源:MonoSymbolWriter.cs

示例7: GetCompileUnit

 public CompileUnitEntry GetCompileUnit(int index)
 {
     if (index < 1 || index > this.ot.CompileUnitCount)
     {
         throw new ArgumentException();
     }
     if (this.reader == null)
     {
         throw new InvalidOperationException();
     }
     CompileUnitEntry result;
     CompileUnitEntry unit;
     if (this.compile_unit_hash.TryGetValue(index, out unit))
     {
         result = unit;
     }
     else
     {
         long old_pos = this.reader.BaseStream.Position;
         this.reader.BaseStream.Position = (long)(this.ot.CompileUnitTableOffset + CompileUnitEntry.Size * (index - 1));
         unit = new CompileUnitEntry(this, this.reader);
         this.compile_unit_hash.Add(index, unit);
         this.reader.BaseStream.Position = old_pos;
         result = unit;
     }
     return result;
 }
開發者ID:qq1792,項目名稱:LSharp,代碼行數:27,代碼來源:MonoSymbolFile.cs

示例8: CheckCompileUnit

        protected void CheckCompileUnit(CompileUnitEntry unit)
        {
            SourceFileEntry file = unit.SourceFile;
            SourceFileEntry file2 = File.GetSourceFile (file.Index);
            if ((file2 == null) || (file != file2))
                throw new MonoSymbolFileException (
                    "Invalid source file reference in compile unit {0}.", unit.Index);

            Debug ("  Compile unit {0}: {1} {2} {3}", unit.Index, file, file2, file == file2);

            if (unit.Namespaces == null)
                throw new MonoSymbolFileException (
                    "Invalid name space table in compile unit {0}.", unit.Index);
        }
開發者ID:baulig,項目名稱:debugger,代碼行數:14,代碼來源:MdbSymbolReader.cs

示例9: CreateUnitSymbolInfo

		//
		// Creates symbol file index in debug symbol file
		//
		void CreateUnitSymbolInfo (MonoSymbolFile symwriter, List<KeyValuePair<string, string>> pathMap)
		{
			var si = file.CreateSymbolInfo (symwriter, pathMap);
			comp_unit = new CompileUnitEntry (symwriter, si);

			if (include_files != null) {
				foreach (SourceFile include in include_files.Values) {
					si = include.CreateSymbolInfo (symwriter, pathMap);
					comp_unit.AddFile (si);
				}
			}
		}
開發者ID:sushihangover,項目名稱:playscript,代碼行數:15,代碼來源:namespace.cs

示例10: AddCompileUnit

		internal int AddCompileUnit (CompileUnitEntry entry)
		{
			comp_units.Add (entry);
			return comp_units.Count;
		}
開發者ID:KAW0,項目名稱:Alter-Native,代碼行數:5,代碼來源:MonoSymbolFile.cs

示例11: DefineMethod

		public MethodEntry DefineMethod (CompileUnitEntry comp_unit, int token,
						 ScopeVariable[] scope_vars, LocalVariableEntry[] locals,
						 LineNumberEntry[] lines, CodeBlockEntry[] code_blocks,
						 string real_name, MethodEntry.Flags flags,
						 int namespace_id)
		{
			if (reader != null)
				throw new InvalidOperationException ();

			MethodEntry method = new MethodEntry (
				this, comp_unit, token, scope_vars, locals, lines, code_blocks,
				real_name, flags, namespace_id);
			AddMethod (method);
			return method;
		}
開發者ID:KAW0,項目名稱:Alter-Native,代碼行數:15,代碼來源:MonoSymbolFile.cs

示例12: DefineNamespace

		public int DefineNamespace (string name, CompileUnitEntry unit,
					    string[] using_clauses, int parent)
		{
			if ((unit == null) || (using_clauses == null))
				throw new NullReferenceException ();

			return unit.DefineNamespace (name, using_clauses, parent);
		}
開發者ID:transformersprimeabcxyz,項目名稱:monodevelop-1,代碼行數:8,代碼來源:MonoSymbolWriter.cs

示例13: DefineNamespace

		public static int DefineNamespace (string name, CompileUnitEntry source,
						   string[] using_clauses, int parent)
		{
			if (symwriter != null)
				return symwriter.DefineNamespace (name, source, using_clauses, parent);
			else
				return -1;
		}
開發者ID:calumjiao,項目名稱:Mono-Class-Libraries,代碼行數:8,代碼來源:symbolwriter.cs

示例14: SymbolDocumentWriterImpl

		public SymbolDocumentWriterImpl (CompileUnitEntry comp_unit)
		{
			this.comp_unit = comp_unit;
		}
開發者ID:ItsVeryWindy,項目名稱:mono,代碼行數:4,代碼來源:SymbolWriterImpl.cs

示例15: CreateUnitSymbolInfo

        //
        // Creates symbol file index in debug symbol file
        //
        void CreateUnitSymbolInfo(MonoSymbolFile symwriter)
        {
            var si = file.CreateSymbolInfo (symwriter);
            comp_unit = new CompileUnitEntry (symwriter, si);

            if (include_files != null) {
                foreach (SourceFile include in include_files.Values) {
                    si = include.CreateSymbolInfo (symwriter);
                    comp_unit.AddFile (si);
                }
            }
        }
開發者ID:exodrifter,項目名稱:mcs-ICodeCompiler,代碼行數:15,代碼來源:namespace.cs


注:本文中的Mono.CompilerServices.SymbolWriter.CompileUnitEntry類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。