本文整理汇总了C#中ICompiler类的典型用法代码示例。如果您正苦于以下问题:C# ICompiler类的具体用法?C# ICompiler怎么用?C# ICompiler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ICompiler类属于命名空间,在下文中一共展示了ICompiler类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ChangeCompilerState
private void ChangeCompilerState(ICompiler sender, PascalABCCompiler.CompilerState State, string FileName)
{
switch (State)
{
case CompilerState.CompilationFinished:
if (compiler.ErrorsList.Count > 0)
foreach (Errors.Error er in compiler.ErrorsList)
SendErrorOrWarning(er);
if (compiler.Warnings.Count > 0)
foreach (Errors.Error er in compiler.Warnings)
SendErrorOrWarning(er);
SendCommand(ConsoleCompilerConstants.LinesCompiled, compiler.LinesCompiled.ToString());
SendCommand(ConsoleCompilerConstants.BeginOffest, compiler.BeginOffset.ToString());
SendCommand(ConsoleCompilerConstants.VarBeginOffest, compiler.VarBeginOffset.ToString());
SendCommand(ConsoleCompilerConstants.CompilerOptionsOutputType, ((int)compiler.CompilerOptions.OutputFileType).ToString());
sendWorkingSet();
break;
case CompilerState.Ready:
if(compilerReloading)
sendWorkingSet();
break;
}
if (FileName != null)
SendCommand(ConsoleCompilerConstants.CommandStartNumber + (int)State, FileName);
else
SendCommand(ConsoleCompilerConstants.CommandStartNumber + (int)State);
}
开发者ID:CSRedRat,项目名称:pascalabcnet,代码行数:27,代码来源:CommandConsoleCompiler.cs
示例2: Compile
public bool Compile(CompilationPass pass, ICompiler compiler, CompileToolContext context)
{
var sourceRefs = new SourceReference[] { this._sourceRef };
var project = (IProjectScope)Parent;
switch (pass)
{
case CompilationPass.Pass1RegisterIdentifiers:
IIdentifierScope scope;
var existingDef = project.Find(this._labelIdentifier, out scope);
if (existingDef != null && scope == project)
{
context.AddMessage(new BinaryCompileMessage { Filename = this._filename, Line = 0, Message = "Identifier already exists in this scope", MessageLevel = Level.Error });
return false;
}
this._labelInstruction = new LabelInstruction(sourceRefs);
project.Add(new BinaryFileLabel(this._labelIdentifier, this._labelInstruction, this._sourceRef));
break;
case CompilationPass.Pass3GenerateCode:
compiler.AddInstruction(this._labelInstruction, context);
compiler.AddInstruction(new BinaryFileDataInstruction(this._filename, sourceRefs), context);
break;
}
return true;
}
开发者ID:kierenj,项目名称:0x10c-DevKit,代码行数:27,代码来源:BinaryFileScope.cs
示例3: Init
public void Init(ICompiler compiler)
{
this.compiler = compiler;
this.compiler.BeforeConvertCsToJsEntity += Compiler_BeforeConvertCsToJsEntity;
// Our main Ast Gen...
this.compiler.AfterConvertCsToJsEntity += Compiler_AfterConvertCsToJsEntity;
this.compiler.AfterMergeJsFiles += Compiler_AfterMergeJsFiles;
this.compiler.BeforeSaveJsFiles += Compiler_BeforeSaveJsFiles;
#region Unused SharpKit Compiler Events
//Compiler.BeforeParseCs += new Action(Compiler_BeforeParseCs);
//Compiler.AfterParseCs += new Action(Compiler_AfterParseCs);
//Compiler.BeforeApplyExternalMetadata += new Action(Compiler_BeforeApplyExternalMetadata);
//Compiler.AfterApplyExternalMetadata += new Action(Compiler_AfterApplyExternalMetadata);
//Compiler.BeforeConvertCsToJs += new Action(Compiler_BeforeConvertCsToJs);
//Compiler.AfterConvertCsToJs += new Action(Compiler_AfterConvertCsToJs);
//Compiler.BeforeMergeJsFiles += new Action(Compiler_BeforeMergeJsFiles);
//Compiler.BeforeInjectJsCode += new Action(Compiler_BeforeInjectJsCode);
//Compiler.AfterInjectJsCode += new Action(Compiler_AfterInjectJsCode);
//Compiler.BeforeOptimizeJsFiles += new Action(Compiler_BeforeOptimizeJsFiles);
//Compiler.AfterOptimizeJsFiles += new Action(Compiler_AfterOptimizeJsFiles);
//Compiler.AfterSaveJsFiles += new Action(Compiler_AfterSaveJsFiles);
//Compiler.BeforeEmbedResources += new Action(Compiler_BeforeEmbedResources);
//Compiler.AfterEmbedResources += new Action(Compiler_AfterEmbedResources);
//Compiler.BeforeSaveNewManifest += new Action(Compiler_BeforeSaveNewManifest);
//Compiler.AfterSaveNewManifest += new Action(Compiler_AfterSaveNewManifest);
//Compiler.BeforeExit += new Action(Compiler_BeforeExit);
#endregion
}
开发者ID:RandoriCSharp,项目名称:randori-plugin-sharpkit,代码行数:30,代码来源:RandoriCompilerPlugin.cs
示例4: ScoresController
public ScoresController(IDbContext context, ICompiler compiler, IRunner runner, Participant participant = null)
{
_context = context;
_compiler = compiler;
_runner = runner;
_participant = participant ?? GetCurrentParticipant();
}
开发者ID:prademak,项目名称:JavaProgrammingContest,代码行数:7,代码来源:ScoresController.cs
示例5: RunController
public RunController(IDbContext context, ICompiler compiler, IRunner runner, Participant participant = null)
{
_context = context;
_compiler = compiler;
_runner = runner;
_participant = participant == null ? GetCurrentParticipant() : participant;
}
开发者ID:prademak,项目名称:JavaProgrammingContest,代码行数:7,代码来源:RunController.cs
示例6: JavaCompileDisassemblePlagiarismDetector
public JavaCompileDisassemblePlagiarismDetector(
ICompiler compiler,
string compilerPath,
IDisassembler disassembler,
ISimilarityFinder similarityFinder)
: base(compiler, compilerPath, disassembler, similarityFinder)
{
}
开发者ID:Teodor92,项目名称:OpenJudgeSystem,代码行数:8,代码来源:JavaCompileDisassemblePlagiarismDetector.cs
示例7: SetUp
public void SetUp()
{
log = Substitute.For<ILog>();
loader = Substitute.For<ILoader>();
compiler = Substitute.For<ICompiler>();
compileCommand = new CompileCommand(log, loader, compiler);
}
开发者ID:wilsonmar,项目名称:mulder,代码行数:8,代码来源:CompileCommandTests.cs
示例8: FieldCompiler
public FieldCompiler(ICompiler compiler, VariableDeclaration variableDeclaration)
{
_compiler = compiler;
_variableDeclaration = variableDeclaration;
var className = ((ClassType)_compiler.GetPreviousContextFromStack(0)).Name;
_javaClass = JavaClassMetadata.GetClass(className);
}
开发者ID:JonathanLydall,项目名称:Java-Transpiler-In-C-Sharp,代码行数:8,代码来源:FieldCompiler.cs
示例9: LineCoverageCalc
public LineCoverageCalc(ITestExplorer testExplorer,
ICompiler compiler,
ITestRunner testRunner)
{
_testExplorer = testExplorer;
_compiler = compiler;
_testRunner = testRunner;
}
开发者ID:pzielinski86,项目名称:RuntimeTestCoverage,代码行数:8,代码来源:LineCoverageCalc.cs
示例10: EmitWriteValue
public virtual void EmitWriteValue(ICompiler<ObjectWriter> c, int stream, int fieldValue, int session)
{
var converted = c.Convert<object>(fieldValue);
var method = typeof(ValueSerializer).GetTypeInfo().GetMethod(nameof(WriteValue));
//write it to the value serializer
var vs = c.Constant(this);
c.EmitCall(method, vs, stream, converted, session);
}
开发者ID:akkadotnet,项目名称:Wire,代码行数:9,代码来源:ValueSerializer.cs
示例11: CompileWith
private async Task<CompilationResult> CompileWith(ICompiler compiler, string contentId, IFile file)
{
CompilationResult result = await compiler.Compile(file);
if (result.Success)
{
Cache[contentId] = new WeakReference<Type>(result.GetCompiledType());
}
return result;
}
开发者ID:anurse,项目名称:Edge,代码行数:9,代码来源:DefaultCompilationManager.cs
示例12: ConstructorCompiler
public ConstructorCompiler(ICompiler compiler, IList<MethodDeclaration> constructors, ClassType classType)
{
_compiler = compiler;
_constructors = constructors;
_classType = classType;
_classIsExtending = !string.IsNullOrEmpty(_classType.Extends);
_classMetadata = JavaClassMetadata.GetClass(_classType.Name);
_targetMethodName = string.Format("{0}Constructor_", _classType.Name);
}
开发者ID:JonathanLydall,项目名称:Java-Transpiler-In-C-Sharp,代码行数:10,代码来源:ConstructorCompiler.cs
示例13: Main
// -------------------------------------------------------------------
// Constructor
// -------------------------------------------------------------------
public Main(IFactory factory)
: base(factory)
{
this.compiler = factory.Resolve<ICompiler>();
this.compilerState = factory.Resolve<ICompilationState>();
this.includes = new List<CarbonDirectory>();
this.jobs = new Dictionary<CompilationJob, int>();
this.includeJobDictionary = new Dictionary<string, CompilationJob>();
}
开发者ID:Craiel,项目名称:CarbonProjects,代码行数:13,代码来源:Main.cs
示例14: MethodCallExpressionCompiler
public MethodCallExpressionCompiler(ICompiler compiler, MethodCallExpression methodCallExpression, IList<InnerExpressionProcessingListItem> list)
{
var itemIndex = list == null ? 0 : list.IndexOf(list.First(x => x.AstNode == methodCallExpression));
_compiler = compiler;
_methodCallExpression = methodCallExpression;
if (itemIndex > 0)
{
_previousExpression = list[itemIndex - 1].AstNode;
}
}
开发者ID:JonathanLydall,项目名称:Java-Transpiler-In-C-Sharp,代码行数:12,代码来源:MethodCallExpressionCompiler.cs
示例15: Process
public void Process(ChunkReader reader, Machine machine, ICompiler compiler)
{
if (this.count > 0)
for (int k = 0; k < this.count; k++)
this.process(machine, compiler, reader.GetChunk());
else
for (string text = reader.GetChunk(); text != null; text = reader.GetChunk())
if (string.IsNullOrEmpty(text.Trim()))
return;
else
this.process(machine, compiler, text);
}
开发者ID:ajlopez,项目名称:AjTalk,代码行数:12,代码来源:ChunkReaderProcessor.cs
示例16: CompileDisassemblePlagiarismDetector
protected CompileDisassemblePlagiarismDetector(
ICompiler compiler,
string compilerPath,
IDisassembler disassembler,
ISimilarityFinder similarityFinder)
{
this.Compiler = compiler;
this.CompilerPath = compilerPath;
this.Disassembler = disassembler;
this.similarityFinder = similarityFinder;
this.sourcesCache = new Dictionary<string, string>();
}
开发者ID:Teodor92,项目名称:OpenJudgeSystem,代码行数:12,代码来源:CompileDisassemblePlagiarismDetector.cs
示例17: Apply
public static void Apply(ICompiler<SyntaxToken, SyntaxNode, SemanticModel> compiler)
{
var lexical = compiler.Lexical();
//aca se hacen los cambios antes de llegar a Roslyn, o sea, aca no hay nada compilado
lexical
.match() //le dices que vas a buscar un patron
.token("repository", named: "keyword") //algo que diga repository
.identifier() //seguido de un identificador
.token('{') //seguido de un {
.then(compiler.Lexical().transform() //cuando lo encuentre
.replace("keyword", "class ") //cambia repository por class
.then(Repository)); //y cuando se compile te llama a esta funcion con la clase
}
开发者ID:mpmedia,项目名称:Excess,代码行数:14,代码来源:Extension.cs
示例18: CompilerFor
public ICompilerConfiguration CompilerFor(string extension, ICompiler compiler)
{
var possible = _compilers.SingleOrDefault(c => string.Compare(c.Key, extension, StringComparison.OrdinalIgnoreCase) == 0);
var newComp = new KeyValuePair<string, ICompiler>(extension, compiler);
if (possible.Key != null)
{
var index = _compilers.IndexOf(possible);
_compilers.Remove(possible);
_compilers.Insert(index, newComp);
}
else
{
_compilers.Add(newComp);
}
return this;
}
开发者ID:ajorkowski,项目名称:NodeAssets,代码行数:18,代码来源:CompilerConfiguration.cs
示例19: GeneralOptionsPanel
public GeneralOptionsPanel ()
{
this.Build ();
object[] compilers = AddinManager.GetExtensionObjects ("/ValaBinding/Compilers");
foreach (ICompiler compiler in compilers) {
vala_compilers.Add (compiler);
}
foreach (ICompiler compiler in vala_compilers)
valaCombo.AppendText (compiler.Name);
string vala_compiler = PropertyService.Get<string> ("ValaBinding.DefaultValaCompiler", new ValaCompiler ().Name);
foreach (ICompiler compiler in vala_compilers) {
if (compiler.Name == vala_compiler) {
default_vala_compiler = compiler;
}
}
if (default_vala_compiler == null)
default_vala_compiler = new ValaCompiler ();
int active;
Gtk.TreeIter iter;
Gtk.ListStore store;
active = 0;
store = (Gtk.ListStore)valaCombo.Model;
store.GetIterFirst (out iter);
while (store.IterIsValid (iter)) {
if ((string)store.GetValue (iter, 0) == default_vala_compiler.Name) {
break;
}
store.IterNext (ref iter);
active++;
}
valaCombo.Active = active;
}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:42,代码来源:GeneralOptionsPanel.cs
示例20: Get
public static ICompilerCache Get(bool direct, string cachedir, string compiler, string workdir, Dictionary<string,string> envs, out ICompiler comp )
{
comp = null;
ICompilerCache rv = null;
if (Settings.ServiceMode) {
try {
rv = new CClashServerClient(cachedir);
} catch (CClashWarningException) {
rv = new NullCompilerCache(cachedir);
}
}
if ( rv == null )
{
if (direct) {
Logging.Emit("use direct mode");
rv = new DirectCompilerCache(cachedir);
} else {
throw new NotSupportedException("ppmode is not supported yet");
}
}
comp = rv.SetCompiler(compiler, workdir, envs);
return rv;
}
开发者ID:artillery,项目名称:cclash,代码行数:24,代码来源:CompilerCacheBase.cs
注:本文中的ICompiler类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论