Exemplo n.º 1
0
 /// <summary>
 /// Fill a new method
 /// </summary>
 /// <param name="comp">compilation</param>
 /// <param name="subProc">sub process object</param>
 /// <param name="converter">language converter</param>
 /// <param name="f">new function</param>
 /// <param name="file">writing in</param>
 public static void FillNewMethod(ICompilateurInstance comp, IProcess subProc, ICodeConverter converter, IFunction f, FinalFile file)
 {
     // la fonction est implémentée
     converter.PushFunction(converter.CurrentFunction);
     f.PropagateControlFlow(converter.CurrentFunction);
     converter.SetCurrentFunction(f);
     subProc.FunctionName = converter.ProcessAsFunction;
     converter.CurrentFunction.ForwardControlFlowSub();
     comp.Convert(converter, subProc, file);
     converter.CurrentFunction.BackwardControlFlowSub();
     converter.SetCurrentFunction(converter.PopFunction());
 }
Exemplo n.º 2
0
        public void Convert(ICodeConverter converter, IProcess proc, FinalFile file)
        {
            Process  jobProc = new Process();
            Function f       = new Function();

            f.IsJob = true;
            f.Name  = this.jobName;
            // la première fonction commence à xxx_1
            f.InstanceNumber = converter.ImplementedFunctions.FindAll(new Predicate <IFunction>(delegate(IFunction func)
            {
                return(func.IsJob && func.StrictName == this.jobName);
            })).Count + 1;
            jobProc.Name         = ":" + f.Name;
            jobProc.FunctionName = f.Name;
            this.cachedComp.PushProcess(jobProc);
            converter.ImplementedFunctions.Add(f);
            converter.PushFunction(converter.CurrentFunction);
            converter.SetCurrentFunction(f);
        }