本文整理汇总了C#中ICompiler类的典型用法代码示例。如果您正苦于以下问题:C# ICompiler类的具体用法?C# ICompiler怎么用?C# ICompiler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ICompiler类属于命名空间,在下文中一共展示了ICompiler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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;
}
示例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
}
示例4: ScoresController
public ScoresController(IDbContext context, ICompiler compiler, IRunner runner, Participant participant = null)
{
_context = context;
_compiler = compiler;
_runner = runner;
_participant = participant ?? GetCurrentParticipant();
}
示例5: RunController
public RunController(IDbContext context, ICompiler compiler, IRunner runner, Participant participant = null)
{
_context = context;
_compiler = compiler;
_runner = runner;
_participant = participant == null ? GetCurrentParticipant() : participant;
}
示例6: JavaCompileDisassemblePlagiarismDetector
public JavaCompileDisassemblePlagiarismDetector(
ICompiler compiler,
string compilerPath,
IDisassembler disassembler,
ISimilarityFinder similarityFinder)
: base(compiler, compilerPath, disassembler, similarityFinder)
{
}
示例7: SetUp
public void SetUp()
{
log = Substitute.For<ILog>();
loader = Substitute.For<ILoader>();
compiler = Substitute.For<ICompiler>();
compileCommand = new CompileCommand(log, loader, compiler);
}
示例8: FieldCompiler
public FieldCompiler(ICompiler compiler, VariableDeclaration variableDeclaration)
{
_compiler = compiler;
_variableDeclaration = variableDeclaration;
var className = ((ClassType)_compiler.GetPreviousContextFromStack(0)).Name;
_javaClass = JavaClassMetadata.GetClass(className);
}
示例9: LineCoverageCalc
public LineCoverageCalc(ITestExplorer testExplorer,
ICompiler compiler,
ITestRunner testRunner)
{
_testExplorer = testExplorer;
_compiler = compiler;
_testRunner = testRunner;
}
示例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);
}
示例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;
}
示例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);
}
示例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>();
}
示例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;
}
}
示例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);
}