// Generated by Haxe 4.3.1
package haxe.root;

import haxe.root.*;

@SuppressWarnings(value={"rawtypes", "unchecked"})
public class DBConcept extends haxe.lang.HxObject
{
	public static void main(String[] args)
	{
		Sys._args = args;
		haxe.java.Init.init();
		haxe.root.DBConcept.main();
	}
	
	public DBConcept(haxe.lang.EmptyObject empty)
	{
	}
	
	
	public DBConcept()
	{
		//line 30 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
		haxe.root.DBConcept.__hx_ctor__DBConcept(this);
	}
	
	
	protected static void __hx_ctor__DBConcept(haxe.root.DBConcept __hx_this)
	{
	}
	
	
	public static void main()
	{
		//line 33 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
		java.lang.Object p = haxe.root.DBConcept.loadParams(haxe.root.Sys.args());
		//line 34 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
		if (haxe.lang.Runtime.valEq(haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(p, "src", true)), "")) 
		{
			//line 35 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
			haxe.root.DBConcept.printUsage();
		}
		else
		{
			//line 37 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
			{
				//line 37 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
				java.lang.String __temp_svar1 = (haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(p, "sType", true)));
				//line 37 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
				int __temp_hash3 = __temp_svar1.hashCode();
				//line 37 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
				boolean __temp_executeDef2 = true;
				//line 37 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
				if (( __temp_svar1 != null )) 
				{
					//line 37 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
					switch (__temp_hash3)
					{
						case 99237:
						{
							//line 37 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
							if (__temp_svar1.equals("dbc")) 
							{
								//line 37 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
								__temp_executeDef2 = false;
								//line 38 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
								haxe.root.DBConcept.generation(p);
							}
							
							//line 37 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
							break;
						}
						
						
						case -894935028:
						case 3450718:
						case -2105481388:
						case 104382626:
						case 839186932:
						case 103666422:
						{
							//line 37 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
							if (( (( ( __temp_hash3 == -894935028 ) && __temp_svar1.equals("sqlite") )) || ( (( ( __temp_hash3 == 3450718 ) && __temp_svar1.equals("psql") )) || ( (( ( __temp_hash3 == -2105481388 ) && __temp_svar1.equals("postgresql") )) || ( (( ( __temp_hash3 == 104382626 ) && __temp_svar1.equals("mysql") )) || ( (( ( __temp_hash3 == 839186932 ) && __temp_svar1.equals("mariadb") )) || __temp_svar1.equals("maria") ) ) ) ) )) 
							{
								//line 37 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
								__temp_executeDef2 = false;
								//line 39 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
								haxe.root.DBConcept.dbRetroconception(p);
							}
							
							//line 37 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
							break;
						}
						
						
					}
					
				}
				
				//line 40 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
				if (__temp_executeDef2) 
				{
					//line 40 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
					haxe.root.DBConcept.printUsage();
				}
				
			}
			
		}
		
	}
	
	
	public static void printUsage()
	{
		//line 46 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
		java.lang.System.out.println(((java.lang.Object) ("usage: dbconcept -s path/to/source.dbc [-d sqlite[:filename.db]]") ));
		//line 47 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
		java.lang.System.out.println(((java.lang.Object) ("usage: dbconcept -s path/to/source.dbc [-d maria[:host,db,user,pass]]") ));
		//line 48 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
		java.lang.System.out.println(((java.lang.Object) ("usage: dbconcept -s path/to/source.dbc [-d psql") ));
		//line 51 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
		java.lang.System.out.println(((java.lang.Object) ("usage: dbconcept -s sqlite:filename.db [-d path/to/destination ]") ));
		//line 52 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
		java.lang.System.out.println(((java.lang.Object) ("usage: dbconcept -s maria:host,db,user,pass [-d path/to/destination ]") ));
		//line 55 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
		java.lang.System.out.println(((java.lang.Object) ("\toption: [--univ] : display format") ));
	}
	
	
	public static void generation(java.lang.Object p)
	{
		//line 59 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
		model.Diagram diagram = null;
		//line 60 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
		if ( ! (sys.FileSystem.exists(haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(p, "src", true)))) ) 
		{
			//line 61 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
			java.lang.System.out.println(((java.lang.Object) (( ( "error: file \'" + haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(p, "src", true)) ) + "\' not found" )) ));
		}
		else
		{
			//line 63 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
			diagram = source.Mocodo.load(sys.io.File.getContent(haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(p, "src", true))));
		}
		
		//line 65 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
		if (( diagram != null )) 
		{
			//line 66 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
			java.lang.String basename = haxe.lang.StringExt.substring(haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(p, "src", true)), 0, haxe.lang.StringExt.lastIndexOf(haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(p, "src", true)), ".", null));
			//line 67 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
			model.MLD mld = transform.DiagramToMLD.transform(diagram);
			//line 68 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
			transform.DiagramToUML.transform(diagram);
			//line 69 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
			sys.io.File.saveContent(( basename + ".mld" ), mld.toString(haxe.lang.Runtime.toBool(((java.lang.Boolean) (haxe.lang.Runtime.getField(p, "univ", true)) ))));
			//line 70 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
			sys.io.File.saveContent(( basename + "-mcd.svg" ), haxe.xml.Printer.print(schema.MCDToSVG.generateSVG(diagram), null));
			//line 71 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
			sys.io.File.saveContent(( basename + "-mld.svg" ), haxe.xml.Printer.print(schema.MLDToSVG.generateSVG(mld, false), null));
			//line 72 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
			sys.io.File.saveContent(( basename + "-mpd.svg" ), haxe.xml.Printer.print(schema.MLDToSVG.generateSVG(mld, true), null));
			//line 73 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
			sys.io.File.saveContent(( basename + "-uml-domain.svg" ), haxe.xml.Printer.print(schema.UMLToSVG.generateSVG(diagram, false, true), null));
			//line 75 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
			if ( ! (haxe.lang.Runtime.valEq(haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(p, "dType", true)), "")) ) 
			{
				//line 76 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
				java.lang.String sql = null;
				//line 76 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
				{
					//line 76 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
					java.lang.String __temp_svar1 = (haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(p, "dType", true)));
					//line 76 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
					int __temp_hash3 = __temp_svar1.hashCode();
					//line 76 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
					boolean __temp_executeDef2 = true;
					//line 76 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
					if (( __temp_svar1 != null )) 
					{
						//line 76 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
						switch (__temp_hash3)
						{
							case 104382626:
							case 839186932:
							case 103666422:
							{
								//line 76 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
								if (( (( ( __temp_hash3 == 104382626 ) && __temp_svar1.equals("mysql") )) || ( (( ( __temp_hash3 == 839186932 ) && __temp_svar1.equals("mariadb") )) || __temp_svar1.equals("maria") ) )) 
								{
									//line 76 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
									__temp_executeDef2 = false;
									//line 76 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
									sql = database.DBMariaDB.generateSQL(mld);
								}
								
								//line 76 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
								break;
							}
							
							
							case -894935028:
							{
								//line 76 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
								if (__temp_svar1.equals("sqlite")) 
								{
									//line 76 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
									__temp_executeDef2 = false;
									//line 76 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
									sql = database.DBSqlite.generateSQL(mld);
								}
								
								//line 76 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
								break;
							}
							
							
							case 3450718:
							case -2105481388:
							{
								//line 76 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
								if (( (( ( __temp_hash3 == 3450718 ) && __temp_svar1.equals("psql") )) || __temp_svar1.equals("postgresql") )) 
								{
									//line 76 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
									__temp_executeDef2 = false;
									//line 76 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
									sql = database.DBPostgreSQL.generateSQL(mld);
								}
								
								//line 76 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
								break;
							}
							
							
						}
						
					}
					
					//line 76 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
					if (__temp_executeDef2) 
					{
						//line 76 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
						sql = null;
					}
					
				}
				
				//line 82 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
				if (( sql != null )) 
				{
					//line 83 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
					java.lang.String sqlfile = ( ( ( basename + "-" ) + haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(p, "dType", true)) ) + ".sql" );
					//line 84 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
					sys.io.File.saveContent(sqlfile, sql);
					//line 85 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
					if ( ! (haxe.lang.Runtime.valEq(haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(p, "dst", true)), "")) ) 
					{
						//line 86 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
						{
							//line 86 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
							java.lang.String __temp_svar4 = (haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(p, "dType", true)));
							//line 86 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
							int __temp_hash6 = __temp_svar4.hashCode();
							//line 86 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
							if (( __temp_svar4 != null )) 
							{
								//line 86 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
								switch (__temp_hash6)
								{
									case 104382626:
									case 839186932:
									case 103666422:
									{
										//line 88 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
										if (( (( ( __temp_hash6 == 104382626 ) && __temp_svar4.equals("mysql") )) || ( (( ( __temp_hash6 == 839186932 ) && __temp_svar4.equals("mariadb") )) || __temp_svar4.equals("maria") ) )) 
										{
											//line 88 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
											database.DBMariaDB.createDatabase(haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(p, "dst", true)), sqlfile);
										}
										
										//line 88 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
										break;
									}
									
									
									case -894935028:
									{
										//line 87 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
										if (__temp_svar4.equals("sqlite")) 
										{
											//line 87 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
											database.DBSqlite.createDatabase(haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(p, "dst", true)), sqlfile);
										}
										
										//line 87 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
										break;
									}
									
									
									case 3450718:
									case -2105481388:
									{
										//line 89 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
										if (( (( ( __temp_hash6 == 3450718 ) && __temp_svar4.equals("psql") )) || __temp_svar4.equals("postgresql") )) 
										{
											//line 89 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
											database.DBPostgreSQL.createDatabase(haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(p, "dst", true)), sqlfile);
										}
										
										//line 89 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
										break;
									}
									
									
								}
								
							}
							
						}
						
					}
					
				}
				else
				{
					//line 93 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
					haxe.ds.StringMap<java.lang.String> files = null;
					//line 93 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
					{
						//line 93 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
						java.lang.String __temp_svar7 = (haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(p, "dType", true)));
						//line 93 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
						boolean __temp_executeDef8 = true;
						//line 93 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
						if (( __temp_svar7 != null )) 
						{
							//line 93 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
							switch (__temp_svar7.hashCode())
							{
								case 3195302:
								{
									//line 93 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
									if (__temp_svar7.equals("haxe")) 
									{
										//line 93 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
										__temp_executeDef8 = false;
										//line 93 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
										files = code.HaxeCode.generate(diagram);
									}
									
									//line 93 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
									break;
								}
								
								
								case -973197092:
								{
									//line 93 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
									if (__temp_svar7.equals("python")) 
									{
										//line 93 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
										__temp_executeDef8 = false;
										//line 93 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
										files = code.PythonCode.generate(diagram);
									}
									
									//line 93 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
									break;
								}
								
								
								case 3254818:
								{
									//line 93 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
									if (__temp_svar7.equals("java")) 
									{
										//line 93 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
										__temp_executeDef8 = false;
										//line 93 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
										files = code.JavaCode.generate(diagram);
									}
									
									//line 93 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
									break;
								}
								
								
								case 110968:
								{
									//line 93 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
									if (__temp_svar7.equals("php")) 
									{
										//line 93 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
										__temp_executeDef8 = false;
										//line 93 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
										files = code.PhpCode.generate(diagram);
									}
									
									//line 93 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
									break;
								}
								
								
							}
							
						}
						
						//line 93 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
						if (__temp_executeDef8) 
						{
							//line 93 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
							files = null;
						}
						
					}
					
					//line 100 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
					if (( files != null )) 
					{
						//line 101 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
						if ((  ! (haxe.lang.Runtime.valEq(haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(p, "dst", true)), ""))  &&  ! (sys.FileSystem.exists(haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(p, "dst", true))))  )) 
						{
							//line 102 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
							sys.FileSystem.createDirectory(haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(p, "dst", true)));
						}
						
						//line 104 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
						{
							//line 104 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
							java.lang.Object file = ((java.lang.Object) (new haxe.ds._StringMap.StringMapKeyIterator<java.lang.String>(((haxe.ds.StringMap<java.lang.String>) (files) ))) );
							//line 104 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
							while (haxe.lang.Runtime.toBool(((java.lang.Boolean) (haxe.lang.Runtime.callField(file, "hasNext", null)) )))
							{
								//line 104 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
								java.lang.String file1 = haxe.lang.Runtime.toString(haxe.lang.Runtime.callField(file, "next", null));
								//line 105 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
								sys.io.File.saveContent(( (( (haxe.lang.Runtime.valEq(haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(p, "dst", true)), "")) ? ("") : (( haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(p, "dst", true)) + "/" )) )) + file1 ), files.get(file1));
							}
							
						}
						
					}
					
				}
				
			}
			
		}
		
	}
	
	
	public static void dbRetroconception(java.lang.Object p)
	{
		//line 114 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
		model.MLD mld = null;
		//line 115 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
		if (haxe.lang.Runtime.valEq(haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(p, "sType", true)), "sqlite")) 
		{
			//line 116 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
			if ( ! (sys.FileSystem.exists(haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(p, "src", true)))) ) 
			{
				//line 117 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
				java.lang.System.out.println(((java.lang.Object) (( ( "error: file \'" + haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(p, "src", true)) ) + "\' not found" )) ));
			}
			else
			{
				//line 119 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
				mld = database.DBSqlite.analyse(haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(p, "src", true)));
			}
			
		}
		else
		{
			//line 121 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
			if (( new haxe.root.Array<java.lang.String>(new java.lang.String[]{"maria", "mariadb", "mysql"}).indexOf(haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(p, "sType", true)), null) != -1 )) 
			{
				//line 122 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
				mld = database.DBMariaDB.analyse(haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(p, "src", true)));
			}
			
		}
		
		//line 124 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
		if (( mld != null )) 
		{
			//line 125 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
			model.Diagram diagram = transform.MLDToDiagram.transform(mld);
			//line 126 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
			graph.DiagramAdapter.arrange(diagram);
			//line 127 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
			if ((  ! (haxe.lang.Runtime.valEq(haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(p, "dst", true)), ""))  &&  ! (sys.FileSystem.exists(haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(p, "dst", true))))  )) 
			{
				//line 128 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
				sys.FileSystem.createDirectory(haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(p, "dst", true)));
			}
			
			//line 130 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
			java.lang.String basename = ( (( (haxe.lang.Runtime.valEq(haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(p, "dst", true)), "")) ? ("") : (( haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(p, "dst", true)) + "/" )) )) + (( (haxe.lang.Runtime.valEq(haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(p, "sType", true)), "sqlite")) ? (haxe.lang.StringExt.substring(haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(p, "src", true)), 0, haxe.lang.StringExt.lastIndexOf(haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(p, "src", true)), ".", null))) : (( "rev" + haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(p, "sType", true)) )) )) );
			//line 131 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
			sys.io.File.saveContent(( basename + ".mld" ), mld.toString(haxe.lang.Runtime.toBool(((java.lang.Boolean) (haxe.lang.Runtime.getField(p, "univ", true)) ))));
			//line 132 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
			sys.io.File.saveContent(( basename + "-mcd.svg" ), haxe.xml.Printer.print(schema.MCDToSVG.generateSVG(diagram), null));
			//line 133 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
			sys.io.File.saveContent(( basename + ".dbc" ), source.Mocodo.save(diagram));
			//line 134 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
			sys.io.File.saveContent(( basename + "-mld.svg" ), haxe.xml.Printer.print(schema.MLDToSVG.generateSVG(mld, false), null));
			//line 135 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
			sys.io.File.saveContent(( basename + "-mpd.svg" ), haxe.xml.Printer.print(schema.MLDToSVG.generateSVG(mld, true), null));
			//line 136 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
			sys.io.File.saveContent(( basename + "-uml-domain.svg" ), haxe.xml.Printer.print(schema.UMLToSVG.generateSVG(diagram, false, true), null));
		}
		
	}
	
	
	public static java.lang.Object loadParams(haxe.root.Array<java.lang.String> args)
	{
		//line 141 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
		java.lang.Object params = new haxe.lang.DynamicObject(new java.lang.String[]{"dType", "dst", "sType", "src", "univ"}, new java.lang.Object[]{"", "", "", "", false}, new java.lang.String[]{}, new double[]{});
		//line 142 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
		boolean oSrc = false;
		//line 143 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
		boolean oDst = false;
		//line 144 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
		{
			//line 144 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
			int _g = 0;
			//line 144 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
			while (( _g < args.length ))
			{
				//line 144 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
				java.lang.String arg = args.__get(_g);
				//line 144 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
				 ++ _g;
				//line 145 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
				if (haxe.lang.Runtime.valEq(arg, "-s")) 
				{
					//line 145 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
					oSrc = true;
				}
				else
				{
					//line 146 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
					if (oSrc) 
					{
						//line 147 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
						oSrc = false;
						//line 148 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
						if (( haxe.lang.StringExt.indexOf(arg, ":", null) != -1 )) 
						{
							//line 149 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
							java.lang.String __temp_expr8 = haxe.lang.Runtime.toString(haxe.lang.Runtime.setField(params, "sType", haxe.lang.StringExt.substring(arg, 0, haxe.lang.StringExt.indexOf(arg, ":", null))));
							//line 150 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
							java.lang.String __temp_expr9 = haxe.lang.Runtime.toString(haxe.lang.Runtime.setField(params, "src", haxe.lang.StringExt.substring(arg, ( haxe.lang.StringExt.indexOf(arg, ":", null) + 1 ), null)));
						}
						else
						{
							//line 152 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
							java.lang.String __temp_expr6 = haxe.lang.Runtime.toString(haxe.lang.Runtime.setField(params, "sType", "dbc"));
							//line 153 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
							java.lang.String __temp_expr7 = haxe.lang.Runtime.toString(haxe.lang.Runtime.setField(params, "src", arg));
						}
						
					}
					else
					{
						//line 155 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
						if (haxe.lang.Runtime.valEq(arg, "-d")) 
						{
							//line 155 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
							oDst = true;
						}
						else
						{
							//line 156 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
							if (oDst) 
							{
								//line 157 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
								oDst = false;
								//line 158 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
								if (( haxe.lang.StringExt.indexOf(arg, ":", null) != -1 )) 
								{
									//line 159 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
									java.lang.String __temp_expr4 = haxe.lang.Runtime.toString(haxe.lang.Runtime.setField(params, "dType", haxe.lang.StringExt.substring(arg, 0, haxe.lang.StringExt.indexOf(arg, ":", null))));
									//line 160 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
									java.lang.String __temp_expr5 = haxe.lang.Runtime.toString(haxe.lang.Runtime.setField(params, "dst", haxe.lang.StringExt.substring(arg, ( haxe.lang.StringExt.indexOf(arg, ":", null) + 1 ), null)));
								}
								else
								{
									//line 161 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
									if (( new haxe.root.Array<java.lang.String>(new java.lang.String[]{"sqlite", "maria", "mariadb", "mysql", "psql", "postgresql"}).indexOf(arg, null) != -1 )) 
									{
										//line 162 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
										java.lang.String __temp_expr3 = haxe.lang.Runtime.toString(haxe.lang.Runtime.setField(params, "dType", arg));
									}
									else
									{
										//line 164 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
										java.lang.String __temp_expr2 = haxe.lang.Runtime.toString(haxe.lang.Runtime.setField(params, "dst", arg));
									}
									
								}
								
							}
							else
							{
								//line 166 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
								if (haxe.lang.Runtime.valEq(arg, "--univ")) 
								{
									//line 166 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
									boolean __temp_expr1 = haxe.lang.Runtime.toBool(((java.lang.Boolean) (haxe.lang.Runtime.setField(params, "univ", true)) ));
								}
								
							}
							
						}
						
					}
					
				}
				
			}
			
		}
		
		//line 168 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/DBConcept.hx"
		return params;
	}
	
	
}


