//Form public frmMain() { InitializeComponent(); //Load files // ReSharper disable CoVariantArrayConversion string s = Properties.Settings.Default.Source_Paths; if (!string.IsNullOrEmpty(s)) { cbPath.Items.Clear(); cbPath.Items.AddRange(s.Split('\n')); } cbPath.SelectedIndex = 0; s = Properties.Settings.Default.Run_Paths; if (s != "") { cbRun_Path.Items.Clear(); cbRun_Path.Items.AddRange(s.Split('\n')); } cbRun_Path.SelectedIndex = 0; // ReSharper restore CoVariantArrayConversion _ide.SourceRTF = tbParse_Source; _ide.CompiledRTF = tbCompiled; _ide.GetSourceFile = GetSourceFile; _parser = _ide.Parser; _compiler = _ide.Compiler; _source_tp = _ide.SourceAnnotations; _compile_tp = _ide.CompiledAnnotations; tbParse_Source_TextChanged(null, null); }
public Block(Compiler newCompiler) { Compiler = newCompiler; }
public GoToBackPatchInfo(Parse.Block newTarget, Parse.Block Parent, GoToBlock newGoToBlock, Compiler Compiler) { Target = newTarget; GoToBlock = newGoToBlock; //Find the common ancestor var ancestor = Target.FindCommonAncestor(Parent); Runnable[] ar; if (Target.Parent == null) //GoTo:Function { GoToBlock.ParentBlocksReturn = Parent.Depth; GoToBlock.ChildBlocksEnter = 1; ar = new Runnable[GoToBlock.ChildBlocksEnter]; ar[0] = Compiler.Functions[newTarget.Function].Block.Items[0]; } else { if (ancestor != Target) { GoToBlock.ParentBlocksReturn = Parent.Depth - ancestor.Depth; GoToBlock.ChildBlocksEnter = Target.Depth - ancestor.Depth; } else //GoTo a Parent { GoToBlock.ParentBlocksReturn = Parent.Depth - ancestor.Depth + 1; GoToBlock.ChildBlocksEnter = 1; } //Get the block indices ar = new Runnable[GoToBlock.ChildBlocksEnter]; } GoToBlock.BlocksEnter = ar; }
public void BackPatch(Compiler Compiler) { var ar = GoToBlock.BlocksEnter; var bl = Target; for (int i = ar.Length - 1 ; i >= 0 ; i--) { ar[i] = Compiler._BlocksByParse[bl].ExecuteIndex; bl = bl.Parent; } }