Exemplo n.º 1
0
 public SubroutineInfo GetSubroutineInfo()
 {
     if (_subroutineInfo == null)
     {
         var builder = new SubroutineBuilder(DeltinScript, this);
         builder.SetupSubroutine();
         _subroutineInfo = builder.SubroutineInfo;
     }
     return(_subroutineInfo);
 }
 public SubroutineInfo GetSubroutineInfo()
 {
     if (SubroutineInfo == null)
     {
         var determiner = new ConstructorDeterminer(this);
         var builder    = new SubroutineBuilder(parseInfo.TranslateInfo, determiner);
         builder.SetupSubroutine();
     }
     return(SubroutineInfo);
 }
Exemplo n.º 3
0
        protected SubroutineBase(SubroutineFacade SubroutineFacade,
                                 Label startLabel, SubroutineBuilder <Label> builder)
            : this(SubroutineFacade)
        {
            this.StartLabel           = startLabel;
            Builder                   = builder;
            CodeProvider              = builder.CodeProvider;
            this.entry_after_requires = GetTargetBlock(startLabel);

            AddSuccessor(this.entry, EdgeTag.Entry, this.entry_after_requires);
        }
Exemplo n.º 4
0
        public override TranslationResult Translate(TranslationContext context)
        {
            var method = context.Semantics.GetDeclaredSymbol(this.methodDeclarationSyntax);
            SubroutineBuilder builder = new SubroutineBuilder(
                method,
                false,
                null, this.Parameters, this.Body,
                context, this.OriginalNode);

            return(builder.TranslateSelf());
        }
Exemplo n.º 5
0
        // Creates the subroutine.
        SubroutineCatalogItem IWorkshopFunctionController.GetSubroutine() => _toWorkshop.SubroutineCatalog.GetSubroutine(this, () => {
            // Create the builder.
            _subroutineBuilder = new SubroutineBuilder(_toWorkshop.DeltinScript, new SubroutineContext()
            {
                Controller            = this,
                ElementName           = "func group", ObjectStackName = "func group", RuleName = "lambda",
                VariableGlobalDefault = true
            });

            return(new SetupSubroutine(_subroutineBuilder.Initiate(), () => {}));
        });
 // Sets up single-instance methods for methods with the 'rule' attribute.
 public SubroutineInfo GetSubroutineInfo()
 {
     if (!IsSubroutine)
     {
         return(null);
     }
     if (SubroutineInfo == null)
     {
         var builder = new SubroutineBuilder(parseInfo.TranslateInfo, new DefinedSubroutineContext(parseInfo, this, GetOverrideFunctionHandlers()));
         builder.SetupSubroutine();
         SubroutineInfo = builder.SubroutineInfo;
     }
     return(SubroutineInfo);
 }
        public override TranslationResult Translate(TranslationContext context)
        {
            var methodSymbol = this.methodSyntax != null?context.Semantics.GetDeclaredSymbol(this.methodSyntax) : null;

            var classSymbol = context.Semantics.GetDeclaredSymbol(this.parentClass);


            SubroutineBuilder builder = new SubroutineBuilder(
                methodSymbol,
                true,
                classSymbol, this.Parameters, this.Body,
                context,
                this.OriginalNode);

            return(builder.TranslateSelf());
        }
 protected FaultFinallySubroutineBase(SubroutineFacade subroutineFacade, Label startLabel, SubroutineBuilder <Label> builder)
     : base(subroutineFacade, startLabel, builder)
 {
 }
Exemplo n.º 9
0
 protected SubroutineWithHandlers(SubroutineFacade subroutineFacade,
                                  Label startLabel,
                                  SubroutineBuilder <Label> builder)
     : base(subroutineFacade, startLabel, builder)
 {
 }
Exemplo n.º 10
0
 public FaultSubroutine(SubroutineFacade subroutineFacade, Label startLabel,
                        SubroutineBuilder <Label> builder) : base(subroutineFacade, startLabel, builder)
 {
 }