当前位置: 首页>>代码示例>>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;未经允许,请勿转载。