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


C# ICompiler类代码示例

本文整理汇总了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);
 }
开发者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


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