public void Visit(Ast.Expr.FuncCall f) { foreach (var e in f.Item.ExprList) { Visit(e); } if (f.Item.Decl == null) { return; } Ast.Stmt.Funcdef fd = (Ast.Stmt.Funcdef)f.Item.Decl.Value; // Compare param types to decl types var formalList = SeqModule.ToList(fd.Item.FormalList); var actualList = SeqModule.ToList(f.Item.ExprList); var actualAndFormal = ListModule.Zip(actualList, formalList); foreach (var af in actualAndFormal) { if (af.Item1.ActualType != af.Item2.Formal.Type) { m_errorList.Add("Type Error: Cannot use actual paramater of type " + af.Item1.ActualType + " for formal paramater of type " + af.Item2.Formal.Type); } } f.ActualType = fd.Item.Formal.Type; }
public static FSharpOption <Tuple <FSharpOption <Bitmap>, string, FSharpList <Tuple <string, string> > > > EtiketParse(string path) { string txt = File.ReadAllText(path, enc); Match match = regBar.Match(txt); Match match2 = match; Match match3 = match2; Match n = match3; if (n.Success) { Match m = match3; string barc = m.Groups[1].Value; Match match4 = regEtik.Match(txt); Match match5 = match4; Match match6 = match5; Match l = match6; if (l.Success) { Match k = match6; return(FSharpOption <Tuple <FSharpOption <Bitmap>, string, FSharpList <Tuple <string, string> > > > .Some(new Tuple <FSharpOption <Bitmap>, string, FSharpList <Tuple <string, string> > >(null, barc, ListModule.Zip(FSharpList <string> .Cons("mark", FSharpList <string> .Cons("sht", FSharpList <string> .Cons("pp", FSharpList <string> .Cons("fn", FSharpList <string> .Cons("rh", FSharpList <string> .Cons("posgr", FSharpList <string> .Cons("sideAndSize", FSharpList <string> .Cons("strSteelCart", FSharpList <string> .Cons("car", FSharpList <string> .Cons("sp", FSharpList <string> .Cons("customername", FSharpList <string> .Cons("orderitemname", FSharpList <string> .Cons("mon_comm", FSharpList <string> .Empty))))))))))))), ListModule.Tail(SeqModule.ToList(new EtiketParse_71(k, null, null, 0, null))))))); } Match match7 = regImp.Match(txt); Match match8 = match7; Match match9 = match8; Match j = match9; if (j.Success) { Match i = match9; Bitmap bmp = new Bitmap(170, 170); Graphics gr = Graphics.FromImage(bmp); Pen pen = new Pen(Color.Black, 2f); Pen penB = new Pen(Color.Black, 4f); ListModule.Iterate(new EtiketParse_82_4(gr, pen, penB), SeqModule.ToList(new EtiketParse_81_5(txt, null, null, 0, null))); ListModule.Iterate(new EtiketParse_99_9(gr), ListModule.Filter(new EtiketParse_98_10(), SeqModule.ToList(new EtiketParse_97_11(txt, null, null, 0, null)))); return(FSharpOption <Tuple <FSharpOption <Bitmap>, string, FSharpList <Tuple <string, string> > > > .Some(new Tuple <FSharpOption <Bitmap>, string, FSharpList <Tuple <string, string> > >(FSharpOption <Bitmap> .Some(bmp), barc, ListModule.Zip(FSharpList <string> .Cons("mark", FSharpList <string> .Cons("MarkBalka", FSharpList <string> .Cons("ColorCode", FSharpList <string> .Cons("SideBalka", FSharpList <string> .Cons("car", FSharpList <string> .Cons("strSteelCart", FSharpList <string> .Cons("PosGroup", FSharpList <string> .Cons("pp", FSharpList <string> .Cons("IsShtulp", FSharpList <string> .Cons("IsFalsh", FSharpList <string> .Empty)))))))))), ListModule.Tail(SeqModule.ToList(new EtiketParse_109_15(i, null, null, 0, null))))))); } return(null); } return(null); }
public static Frame <c, a> frame <a, b, c>(IEnumerable <Tuple <TLeft, TRight> > columns) where b : ISeries <c> { Tuple <a[], b[]> tuple1 = ArrayModule.Unzip <TLeft, TRight>((Tuple <M0, M1>[])ArrayModule.OfSeq <Tuple <TLeft, TRight> >((IEnumerable <M0>)columns)); b[] values = tuple1.Item2; a[] keys = tuple1.Item1; Tuple <FSharpList <IVectorBuilder>, FSharpList <IIndexBuilder> > tuple2 = new Tuple <FSharpList <IVectorBuilder>, FSharpList <IIndexBuilder> >((FSharpList <IVectorBuilder>)ListModule.OfSeq <IVectorBuilder>(SeqModule.Distinct <IVectorBuilder>((IEnumerable <M0>)SeqModule.ToList <IVectorBuilder>((IEnumerable <M0>) new FFrameextensions.vbs <b, c>(values, default(b), (IEnumerator <b>)null, 0, (IVectorBuilder)null)))), (FSharpList <IIndexBuilder>)ListModule.OfSeq <IIndexBuilder>(SeqModule.Distinct <IIndexBuilder>((IEnumerable <M0>)SeqModule.ToList <IIndexBuilder>((IEnumerable <M0>) new FFrameextensions.ibs <b, c>(values, default(b), (IEnumerator <b>)null, 0, (IIndexBuilder)null))))); Tuple <IVectorBuilder, IIndexBuilder> tuple3; if (tuple2.Item1.get_TailOrNull() != null) { FSharpList <IVectorBuilder> fsharpList1 = tuple2.Item1; if (fsharpList1.get_TailOrNull().get_TailOrNull() == null && tuple2.Item2.get_TailOrNull() != null) { FSharpList <IIndexBuilder> fsharpList2 = tuple2.Item2; if (fsharpList2.get_TailOrNull().get_TailOrNull() == null) { tuple3 = new Tuple <IVectorBuilder, IIndexBuilder>(fsharpList1.get_HeadOrDefault(), fsharpList2.get_HeadOrDefault()); goto label_5; } } } tuple3 = new Tuple <IVectorBuilder, IIndexBuilder>(FVectorBuilderimplementation.VectorBuilder.Instance, FIndexBuilderimplementation.IndexBuilder.Instance); label_5: Tuple <IVectorBuilder, IIndexBuilder> tuple4 = tuple3; IVectorBuilder vectorBuilder = tuple4.Item1; return(FrameUtils.fromColumns <c, a, b>(tuple4.Item2, vectorBuilder, new Series <TLeft, TRight>(keys, values))); }
public Deedle.Ranges.Ranges <T> MergeWith(IEnumerable <Deedle.Ranges.Ranges <T> > ranges) { IEnumerable <Deedle.Ranges.Ranges <T> > list = (IEnumerable <Deedle.Ranges.Ranges <T> >)SeqModule.ToList <Deedle.Ranges.Ranges <T> >((IEnumerable <M0>) new Ranges.MergeWith <T>(this, ranges, 0, (Deedle.Ranges.Ranges <T>)null)); if (SeqModule.IsEmpty <Deedle.Ranges.Ranges <T> >((IEnumerable <M0>)list)) { throw new ArgumentException("Range cannot be empty", nameof(ranges)); } IRangeKeyOperations <T> operations = ((Deedle.Ranges.Ranges <T>)SeqModule.Head <Deedle.Ranges.Ranges <T> >((IEnumerable <M0>)list)).Operations; FSharpList <Tuple <T, T> > fsharpList = (FSharpList <Tuple <T, T> >)ListModule.SortWith <Tuple <T, T> >((FSharpFunc <M0, FSharpFunc <M0, int> >) new Ranges.MergeWith <T>(operations), SeqModule.ToList <Tuple <T, T> >((IEnumerable <M0>) new Ranges.MergeWith <T>(list, (Deedle.Ranges.Ranges <T>)null, (IEnumerator <Deedle.Ranges.Ranges <T> >)null, (Tuple <T, T>)null, (IEnumerator <Tuple <T, T> >)null, 0, (Tuple <T, T>)null))); FSharpFunc <Tuple <T, T>, FSharpFunc <FSharpList <Tuple <T, T> >, IEnumerable <Tuple <T, T> > > > fsharpFunc = (FSharpFunc <Tuple <T, T>, FSharpFunc <FSharpList <Tuple <T, T> >, IEnumerable <Tuple <T, T> > > >) new Ranges.MergeWith <T>(operations); IRangeKeyOperations <T> ops = operations; return(new Deedle.Ranges.Ranges <T>((IEnumerable <Tuple <T, T> >)FSharpFunc <Tuple <T, T>, FSharpList <Tuple <T, T> > > .InvokeFast <IEnumerable <Tuple <T, T> > >((FSharpFunc <Tuple <T, T>, FSharpFunc <FSharpList <Tuple <T, T> >, M0> >)fsharpFunc, (Tuple <T, T>)ListModule.Head <Tuple <T, T> >((FSharpList <M0>)fsharpList), (FSharpList <Tuple <T, T> >)ListModule.Tail <Tuple <T, T> >((FSharpList <M0>)fsharpList)), ops)); }
private void btnExport_Click(object sender, EventArgs e) { string issueNum = this.tbIssueNum.Text; if (issueNum == null || issueNum == string.Empty) { MessageBox.Show("Please enter an issue number."); return; } string path = this.tbAutopopPathEntry.Text; if (path == null || path == string.Empty) { MessageBox.Show("Please enter an Autopop Path."); return; } List <string[]> responses = new List <string[]>(); foreach (DataGridViewRow row in dataGridView1.Rows) { string[] temp = new string[3]; int i = 0; foreach (DataGridViewCell cell in row.Cells) { if (cell.Value != null) { temp[i] = cell.Value.ToString(); } else { temp[i] = null; } i++; } if (temp[0] != null || temp[1] != null || temp[2] != null) { responses.Add(temp); } } string sqlPathScript = AutoPopSqlGeneratorFSharp.SqlGenerators.GenerateNodePathSql(path); string oraclePathScript = AutoPopSqlGeneratorFSharp.SqlGenerators.GenerateNodePathOracle(path); string sqlInsertResponseScript = null; string oracleInsertResponseScript = null; if (responses.Count > 0) { sqlInsertResponseScript = AutoPopSqlGeneratorFSharp.SqlGenerators.GenerateResponseInsertSql(path, SeqModule.ToList(responses)); oracleInsertResponseScript = AutoPopSqlGeneratorFSharp.SqlGenerators.GenerateResponseInsertOracle(path, SeqModule.ToList(responses)); } if (sqlInsertResponseScript != null) { sqlPathScript += sqlInsertResponseScript; } if (oracleInsertResponseScript != null) { oraclePathScript += oracleInsertResponseScript; } FolderBrowserDialog folderBrowser = new FolderBrowserDialog(); folderBrowser.ShowDialog(); var folderPath = folderBrowser.SelectedPath; StreamWriter sw = new StreamWriter(folderPath + "\\" + issueNum + "_S_Autopopulate.sql"); sw.WriteLine(sqlPathScript); sw.Close(); sw = new StreamWriter(folderPath + "\\" + issueNum + "_O_Autopopulate.sql"); sw.WriteLine(oraclePathScript); sw.Close(); MessageBox.Show("Export success!"); }
public static FSharpList <T> toList <T>(this IEnumerable <T> x) => SeqModule.ToList(x); //new FSharpList<T>()