当前位置: 首页>>代码示例>>C#>>正文


C# IErrorReporter类代码示例

本文整理汇总了C#中IErrorReporter的典型用法代码示例。如果您正苦于以下问题:C# IErrorReporter类的具体用法?C# IErrorReporter怎么用?C# IErrorReporter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IErrorReporter类属于命名空间,在下文中一共展示了IErrorReporter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DispatcherEngine

 public DispatcherEngine(ISequenceEventSelector sequencedEventSelector, IErrorQueueLoader errorQueueLoader, IHandlerExecutor handlerExecutor, IErrorReporter errorReporter)
 {
     _sequencedEventSelector = sequencedEventSelector;
     _errorQueueLoader = errorQueueLoader;
     _handlerExecutor = handlerExecutor;
     _errorReporter = errorReporter;
 }
开发者ID:brucewu16899,项目名称:lacjam,代码行数:7,代码来源:DispatcherEngine.cs

示例2: ApplyTo

		public override void ApplyTo(IAssembly assembly, IAttributeStore attributeStore, IErrorReporter errorReporter) {
			foreach (var t in assembly.GetAllTypeDefinitions()) {
				if (!attributeStore.AttributesFor(t).HasAttribute<DefaultMemberReflectabilityAttribute>()) {
					ApplyTo(t, attributeStore, errorReporter);
				}
			}
		}
开发者ID:ShuntaoChen,项目名称:SaltarelleCompiler,代码行数:7,代码来源:DefaultMemberReflectabilityAttribute.cs

示例3: MetadataImporter

		public MetadataImporter(IErrorReporter errorReporter, ICompilation compilation, CompilerOptions options) {
			_errorReporter = errorReporter;
			_compilation = compilation;
			_minimizeNames = options.MinimizeScript;
			_systemObject = compilation.MainAssembly.Compilation.FindType(KnownTypeCode.Object);
			_typeSemantics = new Dictionary<ITypeDefinition, TypeSemantics>();
			_delegateSemantics = new Dictionary<ITypeDefinition, DelegateScriptSemantics>();
			_instanceMemberNamesByType = new Dictionary<ITypeDefinition, HashSet<string>>();
			_staticMemberNamesByType = new Dictionary<ITypeDefinition, HashSet<string>>();
			_methodSemantics = new Dictionary<IMethod, MethodScriptSemantics>();
			_propertySemantics = new Dictionary<IProperty, PropertyScriptSemantics>();
			_fieldSemantics = new Dictionary<IField, FieldScriptSemantics>();
			_eventSemantics = new Dictionary<IEvent, EventScriptSemantics>();
			_constructorSemantics = new Dictionary<IMethod, ConstructorScriptSemantics>();
			_propertyBackingFieldNames = new Dictionary<IProperty, string>();
			_eventBackingFieldNames = new Dictionary<IEvent, string>();
			_backingFieldCountPerType = new Dictionary<ITypeDefinition, int>();
			_internalTypeCountPerAssemblyAndNamespace = new Dictionary<Tuple<IAssembly, string>, int>();
			_ignoredMembers = new HashSet<IMember>();

			var sna = compilation.MainAssembly.AssemblyAttributes.SingleOrDefault(a => a.AttributeType.FullName == typeof(ScriptNamespaceAttribute).FullName);
			if (sna != null) {
				var data = AttributeReader.ReadAttribute<ScriptNamespaceAttribute>(sna);
				if (data.Name == null || (data.Name != "" && !data.Name.IsValidNestedJavaScriptIdentifier())) {
					Message(Messages._7002, sna.Region, "assembly");
				}
			}
		}
开发者ID:chenxustu1,项目名称:SaltarelleCompiler,代码行数:28,代码来源:MetadataImporter.cs

示例4: Process

		protected string Process(string source, string[] typeNames = null, string entryPoint = null, IEnumerable<IAssemblyResource> resources = null, IErrorReporter errorReporter = null) {
			bool assertNoErrors = errorReporter == null;
			errorReporter = errorReporter ?? new MockErrorReporter(true);
			var sourceFile = new MockSourceFile("file.cs", source);
			var n = new Namer();
			var references = new[] { Files.Mscorlib };
			var compilation = PreparedCompilation.CreateCompilation("x", new[] { sourceFile }, references, null, resources);
			var md = new MetadataImporter(errorReporter, compilation.Compilation, new CompilerOptions());
			var rtl = new RuntimeLibrary(md, errorReporter, compilation.Compilation, n);
			var l = new MockLinker();
			md.Prepare(compilation.Compilation.GetAllTypeDefinitions());
			var compiler = new Compiler(md, n, rtl, errorReporter);
			var compiledTypes = compiler.Compile(compilation).ToList();
			var obj = new OOPEmulator(compilation.Compilation, md, rtl, n, l, errorReporter);
			IMethod ep;
			if (entryPoint != null) {
				var type = compiledTypes.Single(c => c.CSharpTypeDefinition.FullName == entryPoint.Substring(0, entryPoint.IndexOf('.')));
				ep = type.CSharpTypeDefinition.Methods.Single(m => m.FullName == entryPoint);
			}
			else {
				ep = null;
			}
			var rewritten = obj.Process(compiledTypes.Where(t => typeNames == null || typeNames.Contains(t.CSharpTypeDefinition.FullName)), ep);

			if (assertNoErrors)
				Assert.That(((MockErrorReporter)errorReporter).AllMessages, Is.Empty, "Should not have errors");

			return string.Join("", rewritten.Select(s => OutputFormatter.Format(s, allowIntermediates: true)));
		}
开发者ID:n9,项目名称:SaltarelleCompiler,代码行数:29,代码来源:OOPEmulatorTestBase.cs

示例5: Lexer

 public Lexer(IErrorReporter errorReporter, string source)
 {
     _errorReporter = errorReporter;
     _source = source;
     _reader = new CharReader(source);
     _tokenRange = SourceRange.Empty;
 }
开发者ID:chenzuo,项目名称:nquery,代码行数:7,代码来源:Lexer.cs

示例6: Generate

        public override TypeDefinition Generate(IErrorReporter errorReporter)
        {
            var t = new TypeDefinition(
                providedType.Namespace,
                providedType.Name + Internal.Plugins.Codegen.CodegenPlugin.IProviderSuffix,
                TypeAttributes.Public,
                References.Binding);

            var providerOfT = References.IProviderOfT.MakeGenericInstanceType(providedType);

            t.Interfaces.Add(providerOfT);
            t.CustomAttributes.Add(new CustomAttribute(References.CompilerGeneratedAttribute));

            var providerOfT_get = ModuleDefinition.Import(providerOfT.Resolve()
                                                                     .Methods
                                                                     .First(m => m.Name == "Get"))
                                                  .MakeHostInstanceGeneric(providedType);

            var providerKeyField = new FieldDefinition("providerKey", FieldAttributes.Private, References.String);
            var mustBeInjectableField = new FieldDefinition("mustBeInjectable", FieldAttributes.Private, References.Boolean);
            var delegateBindingField = new FieldDefinition("delegateBinding", FieldAttributes.Private, References.Binding);

            t.Fields.Add(providerKeyField);
            t.Fields.Add(mustBeInjectableField);
            t.Fields.Add(delegateBindingField);

            EmitCtor(t, providerKeyField, mustBeInjectableField);
            EmitResolve(t, mustBeInjectableField, providerKeyField, delegateBindingField);
            EmitGet(t, providerOfT_get, delegateBindingField);

            return t;
        }
开发者ID:paulcbetts,项目名称:stiletto,代码行数:32,代码来源:ProviderBindingGenerator.cs

示例7: ScriptSharpRuntimeLibrary

 public ScriptSharpRuntimeLibrary(IScriptSharpMetadataImporter metadataImporter, IErrorReporter errorReporter, Func<ITypeParameter, string> getTypeParameterName, Func<ITypeReference, JsExpression> createTypeReferenceExpression)
 {
     _metadataImporter = metadataImporter;
     _errorReporter = errorReporter;
     _getTypeParameterName = getTypeParameterName;
     _createTypeReferenceExpression = createTypeReferenceExpression;
 }
开发者ID:koczkatamas,项目名称:SaltarelleCompiler,代码行数:7,代码来源:ScriptSharpRuntimeLibrary.cs

示例8: Compiler

 public Compiler(IMetadataImporter metadataImporter, INamer namer, IRuntimeLibrary runtimeLibrary, IErrorReporter errorReporter)
 {
     _metadataImporter = metadataImporter;
     _namer            = namer;
     _errorReporter    = errorReporter;
     _runtimeLibrary   = runtimeLibrary;
 }
开发者ID:jack128,项目名称:SaltarelleCompiler,代码行数:7,代码来源:Compiler.cs

示例9: MetadataImporter

		public MetadataImporter(IErrorReporter errorReporter, ICompilation compilation, IAttributeStore attributeStore, CompilerOptions options) {
			_errorReporter = errorReporter;
			_compilation = compilation;
			_attributeStore = attributeStore;
			_minimizeNames = options.MinimizeScript;
			_systemObject = compilation.MainAssembly.Compilation.FindType(KnownTypeCode.Object);
			_typeSemantics = new Dictionary<ITypeDefinition, TypeSemantics>();
			_delegateSemantics = new Dictionary<ITypeDefinition, DelegateScriptSemantics>();
			_instanceMemberNamesByType = new Dictionary<ITypeDefinition, HashSet<string>>();
			_staticMemberNamesByType = new Dictionary<ITypeDefinition, HashSet<string>>();
			_methodSemantics = new Dictionary<IMethod, MethodScriptSemantics>();
			_propertySemantics = new Dictionary<IProperty, PropertyScriptSemantics>();
			_fieldSemantics = new Dictionary<IField, FieldScriptSemantics>();
			_eventSemantics = new Dictionary<IEvent, EventScriptSemantics>();
			_constructorSemantics = new Dictionary<IMethod, ConstructorScriptSemantics>();
			_propertyBackingFieldNames = new Dictionary<IProperty, Tuple<string, bool>>();
			_eventBackingFieldNames = new Dictionary<IEvent, Tuple<string, bool>>();
			_backingFieldCountPerType = new Dictionary<ITypeDefinition, int>();
			_internalTypeCountPerAssemblyAndNamespace = new Dictionary<Tuple<IAssembly, string>, int>();
			_ignoredMembers = new HashSet<IMember>();

			var sna = _attributeStore.AttributesFor(compilation.MainAssembly).GetAttribute<ScriptNamespaceAttribute>();
			if (sna != null) {
				if (sna.Name == null || (sna.Name != "" && !sna.Name.IsValidNestedJavaScriptIdentifier())) {
					Message(Messages._7002, default(DomRegion), "assembly");
				}
			}
		}
开发者ID:ShuntaoChen,项目名称:SaltarelleCompiler,代码行数:28,代码来源:MetadataImporter.cs

示例10: SymbolTableBuilder

        public SymbolTableBuilder(Program node, IErrorReporter errorReporter)
        {
            _errorReporter = errorReporter;
            _syntaxTree = node;
            _globalScope = new GlobalScope();

            _scopeStack = new Stack<IScope>();
        }
开发者ID:Lateks,项目名称:MiniJavaCompiler,代码行数:8,代码来源:SymbolTableBuilder.cs

示例11: SemanticsChecker

 public SemanticsChecker(Program program, IErrorReporter errorReporter)
 {
     if (program.Scope == null)
         throw new ArgumentException("Global scope is undefined.");
     _programRoot = program;
     _symbolTable = (GlobalScope)program.Scope;
     _errors = errorReporter;
 }
开发者ID:Lateks,项目名称:MiniJavaCompiler,代码行数:8,代码来源:SemanticsChecker.cs

示例12: Compiler

 public Compiler(IMetadataImporter metadataImporter, INamer namer, IRuntimeLibrary runtimeLibrary, IErrorReporter errorReporter, bool allowUserDefinedStructs)
 {
     _metadataImporter        = metadataImporter;
     _namer                   = namer;
     _errorReporter           = errorReporter;
     _runtimeLibrary          = runtimeLibrary;
     _allowUserDefinedStructs = allowUserDefinedStructs;
 }
开发者ID:JimmyJune,项目名称:SaltarelleCompiler,代码行数:8,代码来源:Compiler.cs

示例13: Add

 /// <summary>
 /// Adds <paramref name="reporter"/> to the list of error reporters.
 /// </summary>
 /// <param name="reporter"></param>
 /// <exception cref="ArgumentNullException"><paramref name="reporter"/> is <c>null</c>.</exception>
 public void Add(IErrorReporter reporter)
 {
     lock (reporters)
     {
         foreach (var asm in reporter.AssembliesHandled)
             reporters.Add (asm, reporter);
     }
 }
开发者ID:ermau,项目名称:Gablarski,代码行数:13,代码来源:AutomaticErrorReporter.cs

示例14: RuntimeLibrary

		public RuntimeLibrary(IMetadataImporter metadataImporter, IErrorReporter errorReporter, ICompilation compilation, INamer namer) {
			_metadataImporter = metadataImporter;
			_errorReporter = errorReporter;
			_compilation = compilation;
			_namer = namer;
			_omitDowncasts = MetadataUtils.OmitDowncasts(compilation);
			_omitNullableChecks = MetadataUtils.OmitNullableChecks(compilation);
		}
开发者ID:chenxustu1,项目名称:SaltarelleCompiler,代码行数:8,代码来源:RuntimeLibrary.cs

示例15: CreateEmulator

		protected OOPEmulator CreateEmulator(ICompilation compilation, IErrorReporter errorReporter = null) {
			var n = new Namer();
			errorReporter = errorReporter ?? new MockErrorReporter();
			var md = new MetadataImporter(errorReporter, compilation, new CompilerOptions());
			md.Prepare(compilation.GetAllTypeDefinitions());
			var rtl = new RuntimeLibrary(md, errorReporter, compilation, n);
			return new OOPEmulator(compilation, md, rtl, n, new MockLinker(), errorReporter);
		}
开发者ID:chenxustu1,项目名称:SaltarelleCompiler,代码行数:8,代码来源:OOPEmulatorTestBase.cs


注:本文中的IErrorReporter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。