public static LsElse Read(string One, ref LswPython.PythonPositions PythonPosition) { LsElse Two = new LsElse(); Two.Tabindex = CountTabs(One); bool Continu = true; do { PythonPosition.Position++; try { string Four = PythonPosition.InLine[PythonPosition.Position]; if (CheckRepeate(Four, Two)) { LsBaseList list = (LsBaseList)(new PythonControler().In(new string[] { Four.Trim() })); Two.InerLines.Add(list.Bases[0]); } else { Continu = false; } } catch { Continu = false; } } while (Continu); PythonPosition.Position = PythonPosition.Position - 1; return(Two); }
public object InRef(string[] InLine, ref MySqlPositions MySqlPositionRef) { LsBaseList Return = new LsBaseList(); while (MySqlPositionRef.Position < MySqlPositionRef.InLine.Length) { Regex stringrgx = new Regex(@"(s|S)(e|E)(t|T) {1,}.+ {0,}= {0,}'(([^']{0,}[\\]'[^'\\]{0,}){1,}|([^']{0,}''[^']{0,}){1,}|[^']{1,})';{0,1}"); Regex boolrgx = new Regex(@"(s|S)(e|E)(t|T) {1,}.+ {0,}= {0,}((t|T)(r|R)(u|U)(e|E)|(f|F)(a|A)(l|L)(s|S)(e|E));{0,1}"); Regex chargrgx = new Regex(@"(s|S)(e|E)(t|T) {1,}.+ {0,}= {0,}'(([\\]'){1}|[^']{1})';{0,1}"); Regex intgrgx = new Regex(@"(s|S)(e|E)(t|T) {1,}.+ {0,}= {0,}(\d{1,}|.+);{0,1}"); Regex bracketrgx = new Regex(@"^[(] {0,}.+ {0,}[)]$"); Regex ifrgx = new Regex(@"(i|I)(f|F) {0,}[(] {0,}.+ {0,}[)] {0,}(t|T)(h|H)(e|E)(n|N)"); Regex elseifrgx = new Regex(@"(e|E)(l|L)(s|S)(e|E)(i|I)(i|I)(f|F) {0,}[(] {0,}.+ {0,}[)] {0,}(t|T)(h|H)(e|E)(n|N)"); if (chargrgx.Match(MySqlPositionRef.InLine[MySqlPositionRef.Position].TrimEnd()).Success) { Return.Bases.Add(lswCharPath.Read(MySqlPositionRef.InLine[MySqlPositionRef.Position].TrimEnd())); } else if (stringrgx.Match(MySqlPositionRef.InLine[MySqlPositionRef.Position].TrimEnd()).Success) { Return.Bases.Add(lswStringPath.Read(MySqlPositionRef.InLine[MySqlPositionRef.Position].TrimEnd())); } else if (boolrgx.Match(MySqlPositionRef.InLine[MySqlPositionRef.Position].TrimEnd()).Success) { Return.Bases.Add(lswBoolPath.Read(MySqlPositionRef.InLine[MySqlPositionRef.Position].TrimEnd())); } else if (intgrgx.Match(MySqlPositionRef.InLine[MySqlPositionRef.Position].TrimEnd()).Success) { Return.Bases.Add(lswIntPath.Read(MySqlPositionRef.InLine[MySqlPositionRef.Position].TrimEnd())); } else if (bracketrgx.Match(MySqlPositionRef.InLine[MySqlPositionRef.Position].TrimEnd()).Success) { Return.Bases.Add(lswBracketPath.Read(MySqlPositionRef.InLine[MySqlPositionRef.Position].TrimEnd(), ref MySqlPositionRef)); } else if (ifrgx.Match(MySqlPositionRef.InLine[MySqlPositionRef.Position].TrimEnd()).Success) { Return.Bases.Add(lswIfPath.Read(MySqlPositionRef.InLine[MySqlPositionRef.Position].TrimEnd(), ref MySqlPositionRef)); } else if (elseifrgx.Match(MySqlPositionRef.InLine[MySqlPositionRef.Position].TrimEnd()).Success) { Return.Bases.Add(lswElseIfPath.Read(MySqlPositionRef.InLine[MySqlPositionRef.Position].TrimEnd(), ref MySqlPositionRef)); } else if (MySqlPositionRef.InLine[MySqlPositionRef.Position].TrimEnd().ToLower().Substring(0, 4) == "else") { Return.Bases.Add(lswElsePath.Read(MySqlPositionRef.InLine[MySqlPositionRef.Position].TrimEnd(), ref MySqlPositionRef)); } else { Return.Bases.Add(new LsName() { Name = MySqlPositionRef.InLine[MySqlPositionRef.Position].TrimEnd(), Lanaguage = "MySql" }); } MySqlPositionRef.Position++; } return(Return); }
public object InRef(string[] InLine, ref CSharpPositions CSharpPositionRef) { LsBaseList Return = new LsBaseList(); while (CSharpPositionRef.Position < CSharpPositionRef.InLine.Length) { Regex stringrgx = new Regex(@"(public |protected |private |static |readonly |internal ){0,} {0,}string {1,}\w+ {0,}= {0,}.+ {0,};"); Regex boolrgx = new Regex(@"(public |protected |private |static |readonly |internal ){0,} {0,}bool {1,}\w+ {0,}= {0,}.+ {0,};"); Regex charrgx = new Regex(@"(public |protected |private |static |readonly |internal ){0,} {0,}char {1,}\w+ {0,}= {0,}.+ {0,};"); Regex intrgx = new Regex(@"(public |protected |private |static |readonly |internal ){0,} {0,}int {1,}\w+ {0,}= {0,}.+ {0,};"); Regex bracketrgx = new Regex(@"^[(].+[)]$"); Regex ifrgx = new Regex(@"^if [(].+[)]"); Regex elseifrgx = new Regex(@"^else if [(].+[)]"); if (stringrgx.Match(CSharpPositionRef.InLine[CSharpPositionRef.Position].TrimEnd()).Success) { Return.Bases.Add(lswStringPath.Read(CSharpPositionRef.InLine[CSharpPositionRef.Position].TrimEnd())); } else if (boolrgx.Match(CSharpPositionRef.InLine[CSharpPositionRef.Position].TrimEnd()).Success) { Return.Bases.Add(lswBoolPath.Read(CSharpPositionRef.InLine[CSharpPositionRef.Position].TrimEnd())); } else if (charrgx.Match(CSharpPositionRef.InLine[CSharpPositionRef.Position].TrimEnd()).Success) { Return.Bases.Add(lswCharPath.Read(CSharpPositionRef.InLine[CSharpPositionRef.Position].TrimEnd())); } else if (bracketrgx.Match(CSharpPositionRef.InLine[CSharpPositionRef.Position].TrimEnd()).Success) { Return.Bases.Add(lswBracketPath.Read(CSharpPositionRef.InLine[CSharpPositionRef.Position].TrimEnd(), ref CSharpPositionRef)); } else if (intrgx.Match(CSharpPositionRef.InLine[CSharpPositionRef.Position].TrimEnd()).Success) { Return.Bases.Add(lswIntPath.Read(CSharpPositionRef.InLine[CSharpPositionRef.Position].TrimEnd())); } else if (ifrgx.Match(CSharpPositionRef.InLine[CSharpPositionRef.Position].TrimEnd()).Success) { Return.Bases.Add(lswIfPath.Read(CSharpPositionRef.InLine[CSharpPositionRef.Position].TrimEnd(), ref CSharpPositionRef)); } else if (CSharpPositionRef.InLine[CSharpPositionRef.Position].TrimEnd() == "else") { Return.Bases.Add(lswElsePath.Read(CSharpPositionRef.InLine[CSharpPositionRef.Position].TrimEnd(), ref CSharpPositionRef)); } else if (elseifrgx.Match(CSharpPositionRef.InLine[CSharpPositionRef.Position].TrimEnd()).Success) { Return.Bases.Add(lswElseIfPath.Read(CSharpPositionRef.InLine[CSharpPositionRef.Position].TrimEnd(), ref CSharpPositionRef)); } else { Return.Bases.Add(new LsName() { Name = CSharpPositionRef.InLine[CSharpPositionRef.Position].TrimEnd(), Lanaguage = "C#" }); } CSharpPositionRef.Position++; } return(Return); }
public string OutRef(object OutLine, ref CSharpPositions CSharpPositionRef) { LsBaseList baseList = (LsBaseList)OutLine; string Return = ""; foreach (var item in baseList.Bases) { try { if (((lsBase)item).lsType == "LsString") { Return += lswStringPath.Write(item) + "\r\n"; } else if (((lsBase)item).lsType == "LsBool") { Return += lswBoolPath.Write(item) + "\r\n"; } else if (((lsBase)item).lsType == "LsChar") { Return += lswCharPath.Write(item) + "\r\n"; } else if (((lsBase)item).lsType == "LsBracket") { Return += lswBracketPath.Write(item, ref CSharpPositionRef) + "\r\n"; } else if (((lsBase)item).lsType == "LsInt") { Return += lswIntPath.Write(item) + "\r\n"; } else if (((lsBase)item).lsType == "LsIf") { Return += lswIfPath.Write(item, ref CSharpPositionRef) + "\r\n"; } else if (((lsBase)item).lsType == "LsElseIf") { Return += lswElseIfPath.Write(item, ref CSharpPositionRef) + "\r\n"; } else if (((lsBase)item).lsType == "LsElse") { Return += lswElsePath.Write(item, ref CSharpPositionRef) + "\r\n"; } else if (((lsBase)item).lsType == "LsName") { try { Return += ((LsName)item).Lanaguage + " Doesn't Have a conversion file for this." + "\r\n"; } catch { Return += "{No_Type}" + "\r\n"; } } else { try { Return += item.ToString() + " {No_Type} " + "\r\n"; } catch { Return += "{No_Type}" + "\r\n"; } } } catch (Exception e) { Return += e.Message + "\r\n"; } } return(Return); }
//"The name 'CountTabs' does not exist in the current context" public static LsIf Read(string One, ref LswMySql.MySqlPositions MySqlPosition) { LsIf Two = new LsIf(); string Three = One.Trim().Substring(2, One.Length - 6).Trim(); //string Three = One.Trim().Substring(2,One.Length - 3).Split("THEN".ToCharArray())[0].Trim() + ")"; Two.Bracket = (LsBracket) new MySqlControler().PartInRef(Three, ref MySqlPosition); bool Continu = true; do { MySqlPosition.Position++; try { string Four = MySqlPosition.InLine[MySqlPosition.Position]; if (Four.Trim().ToLower() == "end if;") { Continu = false; MySqlPosition.Position++; MySqlPosition.Position++; Two.EndIf = true; } else if (CheckRepeate(Four, Two)) { LsBaseList list = (LsBaseList)(new MySqlControler().In(new string[] { Four.Trim() })); Two.InerLines.Add(list.Bases[0]); } else if (Four.Trim().ToLower().Substring(0, 4) == "else") { Continu = false; MySqlPosition.Position++; MySqlPosition.Position++; Two.EndIf = false; } else { Two.EndIf = true; Continu = false; } } catch { Continu = false; Two.EndIf = true; } } while (Continu); MySqlPosition.Position = MySqlPosition.Position - 1; return(Two); }
public static LsElseIf Read(string One, ref LswCSharp.CSharpPositions CSharpPosition) { LsElseIf Two = new LsElseIf(); Two.Tabindex = CountTabs(One); string Three = "(" + One.Trim().Substring(8, One.Length - 9).Trim() + ")"; Two.Bracket = (LsBracket) new CSharpControler().PartInRef(Three, ref CSharpPosition); bool Continu = true; do { CSharpPosition.Position++; try { string Four = CSharpPosition.InLine[CSharpPosition.Position]; if (Four.Trim() == "}") { Continu = false; CSharpPosition.Position++; if (CSharpPosition.InLine[CSharpPosition.Position + 1].Trim().ToLower().Substring(0, 4) == "else") { Two.EndIf = true; } } else if (Four.Trim() == "{") { Continu = true; } else if (CheckRepeate(Four, Two)) { LsBaseList list = (LsBaseList)(new CSharpControler().In(new string[] { Four.Trim() })); Two.InerLines.Add(list.Bases[0]); } else { Continu = false; } } catch { Continu = false; } } while (Continu); CSharpPosition.Position = CSharpPosition.Position - 1; return(Two); }
public static LsElse Read(string One, ref LswCSharp.CSharpPositions CSharpPosition) { LsElse Two = new LsElse(); Two.Tabindex = CountTabs(One); bool Continu = true; do { CSharpPosition.Position++; try { string Four = CSharpPosition.InLine[CSharpPosition.Position]; if (Four.Trim() == "}") { Continu = false; CSharpPosition.Position++; Two.EndIf = true; } else if (Four.Trim() == "{") { Continu = true; } else if (CheckRepeate(Four, Two)) { LsBaseList list = (LsBaseList)(new CSharpControler().In(new string[] { Four.Trim() })); Two.InerLines.Add(list.Bases[0]); } else { Continu = false; } } catch { Continu = false; } } while (Continu); CSharpPosition.Position = CSharpPosition.Position - 1; return(Two); }
public static LsIf Read(string One, ref LswPython.PythonPositions PythonPosition) { LsIf Two = new LsIf(); Two.Tabindex = CountTabs(One); string Three = "(" + One.Trim().Substring(3, One.Length - 4).Trim() + ")"; Two.Bracket = (LsBracket) new PythonControler().PartInRef(Three, ref PythonPosition); bool Continu = true; do { PythonPosition.Position++; try { string Four = PythonPosition.InLine[PythonPosition.Position]; if (CheckRepeate(Four, Two)) { LsBaseList list = (LsBaseList)(new PythonControler().In(new string[] { Four.Trim() })); Two.InerLines.Add(list.Bases[0]); } else if (Four.Trim().ToLower().Substring(0, 4) != "elif" || Four.Trim().ToLower().Substring(0, 4) != "else") { Continu = false; Two.EndIf = false; } else { Continu = false; } } catch { Continu = false; } } while (Continu); PythonPosition.Position = PythonPosition.Position - 1; return(Two); }
public static LsElse Read(string One, ref LswMySql.MySqlPositions MySqlPosition) { LsElse Two = new LsElse(); Two.Tabindex = CountTabs(One); bool Continu = true; do { MySqlPosition.Position++; try { string Four = MySqlPosition.InLine[MySqlPosition.Position]; if (Four.Trim().ToLower() == "end if;") { Continu = false; MySqlPosition.Position++; MySqlPosition.Position++; Two.EndIf = true; } else if (CheckRepeate(Four, Two)) { LsBaseList list = (LsBaseList)(new MySqlControler().In(new string[] { Four.Trim() })); Two.InerLines.Add(list.Bases[0]); } else { Continu = false; } } catch { Continu = false; } } while (Continu); MySqlPosition.Position = MySqlPosition.Position - 1; return(Two); }
public object InRef(string[] InLine, ref PythonPositions PythonPositionRef) { LsBaseList Return = new LsBaseList(); while (PythonPositionRef.Position < PythonPositionRef.InLine.Length) { //Done Regex stringrgx = new Regex(@"\w+ {0,}=[ (]{0,}""{1}[^""]+""{1}([ +)(]{0,}""{1}[^""]+""{1}|[ +)(]{0,}'{1}[^']+'{1}|[ +)(]{0,}""{3}.+""{3}|[ +)(]{0,}\w+){0,}[)]{0,}|\w+ {0,}=[ (]{0,}""{3}.+""{3}([ +)(]{0,}""{1}[^""]+""{1}|[ +)(]{0,}'{1}[^']+'{1}|[ +)(]{0,}""{3}.+""{3}|[ +)(]{0,}\w+){0,}[)]{0,}|\w+ {0,}=[ (]{0,}'{1}[^']+'{1}([ +)(]{0,}""{1}[^""]+""{1}|[ +)(]{0,}'{1}[^']+'{1}|[ +)(]{0,}""{3}.+""{3}|[ +)(]{0,}\w+){0,}[)]{0,}"); Regex charrgx = new Regex(@"\w+ {0,}=[ (]{0,}""{1}[^""]{1}""{1}[)]{0,}|\w+ {0,}=[ (]{0,}""{3}.{1}""{3}[)]{0,}|\w+ {0,}=[ (]{0,}'{1}[^']{1}'{1}[)]{0,}"); //Not Done Regex boolrgx = new Regex(@"\w+ {0,}= {0,}true|\w+ {0,}= {0,}false"); Regex intrgx = new Regex(@"\w+ {0,}= {0,}[0-9]+"); Regex defoltrgx = new Regex(@"\w+ {0,}= {0,}\w+"); //Finished Regex bracketrgx = new Regex(@"^[(].+[)]$"); Regex ifrgx = new Regex(@"^if .+:$"); Regex elseifrgx = new Regex(@"^elif .+:$"); if (charrgx.Match(PythonPositionRef.InLine[PythonPositionRef.Position].TrimEnd()).Success) { Return.Bases.Add(lswCharPath.Read(PythonPositionRef.InLine[PythonPositionRef.Position].TrimEnd())); } else if (stringrgx.Match(PythonPositionRef.InLine[PythonPositionRef.Position].TrimEnd()).Success) { Return.Bases.Add(lswStringPath.Read(PythonPositionRef.InLine[PythonPositionRef.Position].TrimEnd())); } else if (boolrgx.Match(PythonPositionRef.InLine[PythonPositionRef.Position].TrimEnd()).Success) { Return.Bases.Add(lswBoolPath.Read(PythonPositionRef.InLine[PythonPositionRef.Position].TrimEnd())); } else if (intrgx.Match(PythonPositionRef.InLine[PythonPositionRef.Position].TrimEnd()).Success) { Return.Bases.Add(lswIntPath.Read(PythonPositionRef.InLine[PythonPositionRef.Position].TrimEnd())); } else if (bracketrgx.Match(PythonPositionRef.InLine[PythonPositionRef.Position].TrimEnd()).Success) { Return.Bases.Add(lswBracketPath.Read(PythonPositionRef.InLine[PythonPositionRef.Position].TrimEnd(), ref PythonPositionRef)); } else if (ifrgx.Match(PythonPositionRef.InLine[PythonPositionRef.Position].TrimEnd()).Success) { Return.Bases.Add(lswIfPath.Read(PythonPositionRef.InLine[PythonPositionRef.Position].TrimEnd(), ref PythonPositionRef)); } else if (defoltrgx.Match(PythonPositionRef.InLine[PythonPositionRef.Position].TrimEnd()).Success) { Return.Bases.Add(lswStringPath.Read(PythonPositionRef.InLine[PythonPositionRef.Position].TrimEnd())); } else if (elseifrgx.Match(PythonPositionRef.InLine[PythonPositionRef.Position].TrimEnd()).Success) { Return.Bases.Add(lswElseIfPath.Read(PythonPositionRef.InLine[PythonPositionRef.Position].TrimEnd(), ref PythonPositionRef)); } else if (PythonPositionRef.InLine[PythonPositionRef.Position].TrimEnd().ToLower().Substring(0, 4) == "else") { Return.Bases.Add(lswElsePath.Read(PythonPositionRef.InLine[PythonPositionRef.Position].TrimEnd(), ref PythonPositionRef)); } else { Return.Bases.Add(new LsName() { Name = PythonPositionRef.InLine[PythonPositionRef.Position].TrimEnd(), Lanaguage = "Python" }); } PythonPositionRef.Position++; } return(Return); }