ICompiler
Defines the contract for a compiler that supports compiling source files into an assembly.
Propriedades
public string Extension { get; }
value = iCompiler.Extension
Gets the file extension used by the compiler.
public bool IsAssemblyPersistable { get; }
value = iCompiler.IsAssemblyPersistable
Gets a value indicating whether the compiled assembly can be persisted.
public bool IsCaseSensitive { get; }
value = iCompiler.IsCaseSensitive
Gets a value indicating whether the language is case sensitive.
public bool IsReferencesSupported { get; }
value = iCompiler.IsReferencesSupported
Gets a value indicating whether the compiler supports external references.
public bool IsTabsSupported { get; }
value = iCompiler.IsTabsSupported
Gets a value indicating whether the compiler supports tabs in the source code.
Métodos
public Task<CompilationError[]> Analyse(object analyzer, IEnumerable<object> analyzerSettings, string name, IEnumerable<string> sources, IEnumerable<ValueTuple<string, byte[]>> refs, CancellationToken cancellationToken)
result = iCompiler.Analyse(analyzer, analyzerSettings, name, sources, refs, cancellationToken)
Analyzes the provided source code using the specified analyzer and settings.
- analyzer
- The analyzer used to perform the analysis.
- analyzerSettings
- The settings applied to the analyzer.
- name
- The name of the compilation unit.
- sources
- The source code files as strings.
- refs
- A collection of references as tuples containing the name and binary content.
- cancellationToken
- A token to monitor for cancellation requests.
Retorna: A task that represents the asynchronous analysis operation. The task result contains an array of CompilationError instances.
public Task<CompilationResult> Compile(string name, IEnumerable<string> sources, IEnumerable<ValueTuple<string, byte[]>> refs, CancellationToken cancellationToken)
result = iCompiler.Compile(name, sources, refs, cancellationToken)
Compiles the provided source code files with the specified references.
- name
- The name of the compilation unit.
- sources
- The source code files as strings.
- refs
- A collection of references as tuples containing the name and binary content.
- cancellationToken
- A token to monitor for cancellation requests.
Retorna: A task that represents the asynchronous compile operation. The task result contains a CompilationResult.
public ICompilerContext CreateContext()
result = iCompiler.CreateContext()
Creates a new compiler context.
Retorna: A new instance of ICompilerContext.