// Generated by Haxe 4.3.3
package source;

import haxe.root.*;

@SuppressWarnings(value={"rawtypes", "unchecked"})
public class Mocodo extends haxe.lang.HxObject
{
	static
	{
		//line 8 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		source.Mocodo.DEFAULT_TYPE = "VARCHAR(50)";
		//line 10 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		source.Mocodo.typeRE = new haxe.root.EReg(haxe.lang.Runtime.toString("([^\\[]*)\\[(.*)\\]"), haxe.lang.Runtime.toString(""));
		//line 11 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		source.Mocodo.entityRE = new haxe.root.EReg(haxe.lang.Runtime.toString("^[^/,:(]{2,}:"), haxe.lang.Runtime.toString(""));
		//line 13 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		source.Mocodo.associationRE = new haxe.root.EReg(haxe.lang.Runtime.toString("^[^/,:]{2,},"), haxe.lang.Runtime.toString(""));
		//line 15 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		source.Mocodo.legacySubsetRE = new haxe.root.EReg(haxe.lang.Runtime.toString("([^/,:]{2,}( U [^,:]{2,})*) C( ?\\[(X?T?)\\])? ([^,:]{2,})$"), haxe.lang.Runtime.toString("i"));
		//line 17 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		source.Mocodo.subsetRE = new haxe.root.EReg(haxe.lang.Runtime.toString("^/([XT]{0,2}|P)?\\\\ * ([^-><]{2,}) *([-><]) *(\\[.*\\])? *(.*$)"), haxe.lang.Runtime.toString("i"));
		//line 23 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		source.Mocodo.linkRE = new haxe.root.EReg(haxe.lang.Runtime.toString("[^01NX]*[01NX]{2}>? *(\\[.*\\])?(.*)$"), haxe.lang.Runtime.toString(""));
		//line 24 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		source.Mocodo.methodRE = new haxe.root.EReg(haxe.lang.Runtime.toString("^[^/,:(]{2,}\\(\\):"), haxe.lang.Runtime.toString(""));
	}
	
	public Mocodo(haxe.lang.EmptyObject empty)
	{
	}
	
	
	public Mocodo()
	{
		//line 7 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		source.Mocodo.__hx_ctor_source_Mocodo(this);
	}
	
	
	protected static void __hx_ctor_source_Mocodo(source.Mocodo __hx_this)
	{
	}
	
	
	public static java.lang.String DEFAULT_TYPE;
	
	public static haxe.root.EReg typeRE;
	
	public static haxe.root.EReg entityRE;
	
	public static haxe.root.EReg associationRE;
	
	public static haxe.root.EReg legacySubsetRE;
	
	public static haxe.root.EReg subsetRE;
	
	public static haxe.root.EReg linkRE;
	
	public static haxe.root.EReg methodRE;
	
	public static java.lang.String deComment(java.lang.String line)
	{
		//line 27 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		int posComment = haxe.lang.StringExt.indexOf(line, "//", null);
		//line 28 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		if (( posComment != -1 )) 
		{
			//line 29 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			line = haxe.lang.StringExt.substring(line, 0, posComment);
		}
		
		//line 31 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		int startComment = haxe.lang.StringExt.indexOf(line, "/*", null);
		//line 32 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		int endComment = haxe.lang.StringExt.indexOf(line, "*/", ( startComment + 2 ));
		//line 33 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		while (( ( startComment != -1 ) && ( endComment != -1 ) ))
		{
			//line 34 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			line = ( haxe.lang.StringExt.substring(line, 0, startComment) + haxe.lang.StringExt.substring(line, ( endComment + 2 ), null) );
			//line 35 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			startComment = haxe.lang.StringExt.indexOf(line, "/*", null);
			//line 36 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			endComment = haxe.lang.StringExt.indexOf(line, "*/", ( startComment + 2 ));
		}
		
		//line 38 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		return line;
	}
	
	
	public static model.Diagram load(java.lang.String mocodoText)
	{
		//line 47 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		haxe.root.Array<java.lang.String> lines = haxe.lang.StringExt.split(mocodoText, "\n");
		//line 48 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		model.Diagram diagram = new model.Diagram();
		//line 49 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		try 
		{
			//line 50 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			source.Mocodo.loadSets(diagram, lines);
			//line 51 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			source.Mocodo.loadAssociations(diagram, lines);
			//line 52 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			source.Mocodo.loadSubsets(diagram, lines);
			//line 53 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			source.Mocodo.loadMethods(diagram, lines);
			//line 54 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			source.Mocodo.loadLayout(diagram, lines);
		}
		catch (java.lang.Throwable _g)
		{
			//line 55 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			haxe.Exception _g1 = haxe.Exception.caught(_g);
			//line 55 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			java.lang.Object _g2 = _g1.unwrap();
			//line 49 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			if (( _g2 instanceof java.lang.String )) 
			{
				//line 55 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				java.lang.String msg = haxe.lang.Runtime.toString(_g2);
				//line 55 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				{
					//line 57 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					java.lang.System.out.println(((java.lang.Object) (msg) ));
					//line 59 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					diagram = null;
				}
				
			}
			else
			{
				//line 60 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				haxe.Exception e = _g1;
				//line 62 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				java.lang.System.out.println(((java.lang.Object) (e.get_message()) ));
			}
			
		}
		
		
		//line 67 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		if (( ( diagram != null ) &&  ! (haxe.lang.Runtime.toBool(((java.lang.Boolean) (haxe.lang.Runtime.callField(((java.lang.Object) (new haxe.ds._StringMap.StringMapValueIterator<model.Set>(((haxe.ds.StringMap<model.Set>) (diagram.sets) ))) ), "hasNext", null)) )))  )) 
		{
			//line 68 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			diagram = null;
		}
		
		//line 70 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		return diagram;
	}
	
	
	public static void loadAssociations(model.Diagram diagram, haxe.root.Array<java.lang.String> lines)
	{
		//line 74 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		{
			//line 74 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			int _g = 0;
			//line 74 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			int _g1 = lines.length;
			//line 74 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			while (( _g < _g1 ))
			{
				//line 74 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				int lineIndex = _g++;
				//line 75 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				java.lang.String line = source.Mocodo.deComment(lines.__get(lineIndex));
				//line 76 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				if (source.Mocodo.associationRE.match(line)) 
				{
					//line 77 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					java.lang.String name = ((java.lang.String) (((java.lang.Object) (haxe.lang.StringExt.substring(line, 0, haxe.lang.StringExt.indexOf(line, ",", null))) )) ).trim();
					//line 78 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					model.Association assoc = new model.Association(haxe.lang.Runtime.toString(name));
					//line 79 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					int posColumn = haxe.lang.StringExt.indexOf(line, ":", null);
					//line 80 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					if (( posColumn == -1 )) 
					{
						//line 80 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						posColumn = line.length();
					}
					
					//line 81 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					haxe.root.Array<java.lang.String> fields = haxe.lang.StringExt.split(haxe.lang.StringExt.substring(line, ( posColumn + 1 ), null), ",");
					//line 82 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					{
						//line 82 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						int _g2 = 0;
						//line 82 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						int _g3 = fields.length;
						//line 82 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						while (( _g2 < _g3 ))
						{
							//line 82 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							int i = _g2++;
							//line 83 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							java.lang.String field = ((java.lang.String) (((java.lang.Object) (fields.__get(i)) )) ).trim();
							//line 84 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							if ( ! (haxe.lang.Runtime.valEq(field, "")) ) 
							{
								//line 85 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
								source.Mocodo.loadField(assoc, null, field);
							}
							
						}
						
					}
					
					//line 88 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					diagram.associations.set(name, assoc);
				}
				
			}
			
		}
		
		//line 91 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		{
			//line 91 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			int _g4 = 0;
			//line 91 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			int _g5 = lines.length;
			//line 91 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			while (( _g4 < _g5 ))
			{
				//line 91 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				int lineIndex1 = _g4++;
				//line 92 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				java.lang.String line1 = lines.__get(lineIndex1);
				//line 93 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				if (source.Mocodo.associationRE.match(line1)) 
				{
					//line 94 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					java.lang.String name1 = ((java.lang.String) (((java.lang.Object) (haxe.lang.StringExt.substring(line1, 0, haxe.lang.StringExt.indexOf(line1, ",", null))) )) ).trim();
					//line 95 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					model.Association assoc1 = diagram.associations.get(name1);
					//line 96 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					int posColumn1 = haxe.lang.StringExt.indexOf(line1, ":", null);
					//line 97 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					if (( posColumn1 == -1 )) 
					{
						//line 97 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						posColumn1 = line1.length();
					}
					
					//line 98 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					haxe.root.Array<java.lang.String> links = haxe.lang.StringExt.split(haxe.lang.StringExt.substring(line1, ( haxe.lang.StringExt.indexOf(line1, ",", null) + 1 ), posColumn1), ",");
					//line 99 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					source.Mocodo.loadAssociationLinks(diagram, lineIndex1, assoc1, links);
				}
				
			}
			
		}
		
	}
	
	
	public static void loadAssociationLinks(model.Diagram diagram, int lineIndex, model.Association assoc, haxe.root.Array<java.lang.String> links)
	{
		//line 105 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		model.Set compoundSet = null;
		//line 106 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		model.Set componentSet = null;
		//line 107 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		{
			//line 107 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			int _g = 0;
			//line 107 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			int _g1 = links.length;
			//line 107 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			while (( _g < _g1 ))
			{
				//line 107 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				int i = _g++;
				//line 108 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				java.lang.String link = ((java.lang.String) (((java.lang.Object) (links.__get(i)) )) ).trim();
				//line 109 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				java.lang.String role = source.Mocodo.linkRE.replace(link, "$1");
				//line 110 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				if ( ! (haxe.lang.Runtime.valEq(role, "")) ) 
				{
					//line 110 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					role = haxe.lang.StringExt.substr(role, 1, ( role.length() - 2 ));
				}
				
				//line 111 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				java.lang.String setName = ((java.lang.String) (((java.lang.Object) (source.Mocodo.linkRE.replace(link, "$2")) )) ).trim();
				//line 112 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				boolean isWeak = false;
				//line 113 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				boolean isAgregate = false;
				//line 114 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				boolean hasArrow = false;
				//line 115 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				int visibility = model.Field.ACCESS_UNSET;
				//line 116 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				model.Set set = diagram.sets.get(setName);
				//line 117 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				if (( set == null )) 
				{
					//line 118 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					set = diagram.associations.get(setName);
					//line 119 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					if (( set != null )) 
					{
						//line 119 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						(((model.Association) (set) )).isAgregation = true;
					}
					
				}
				
				//line 121 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				if (( set != null )) 
				{
					//line 122 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					while (( ( ( ( ( haxe.lang.Runtime.valEq(haxe.lang.StringExt.charAt(link, 0), "_") || haxe.lang.Runtime.valEq(haxe.lang.StringExt.charAt(link, 0), "*") ) || haxe.lang.Runtime.valEq(haxe.lang.StringExt.charAt(link, 0), "o") ) || haxe.lang.Runtime.valEq(haxe.lang.StringExt.charAt(link, 0), "-") ) || haxe.lang.Runtime.valEq(haxe.lang.StringExt.charAt(link, 0), "+") ) || haxe.lang.Runtime.valEq(haxe.lang.StringExt.charAt(link, 0), "#") ))
					{
						//line 124 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						{
							//line 124 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							java.lang.String __temp_svar1 = (haxe.lang.StringExt.charAt(link, 0));
							//line 124 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							int __temp_hash3 = __temp_svar1.hashCode();
							//line 124 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							if (( __temp_svar1 != null )) 
							{
								//line 124 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
								switch (__temp_hash3)
								{
									case 35:
									{
										//line 128 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
										if (__temp_svar1.equals("#")) 
										{
											//line 128 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
											visibility = model.Field.ACCESS_PROTECTED;
										}
										
										//line 128 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
										break;
									}
									
									
									case 111:
									{
										//line 125 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
										if (__temp_svar1.equals("o")) 
										{
											//line 125 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
											isAgregate = true;
										}
										
										//line 125 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
										break;
									}
									
									
									case 95:
									case 42:
									{
										//line 126 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
										if (( (( ( __temp_hash3 == 95 ) && __temp_svar1.equals("_") )) || __temp_svar1.equals("*") )) 
										{
											//line 126 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
											componentSet = set;
											//line 126 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
											isWeak = true;
										}
										
										//line 126 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
										break;
									}
									
									
									case 45:
									{
										//line 127 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
										if (__temp_svar1.equals("-")) 
										{
											//line 127 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
											visibility = model.Field.ACCESS_PRIVATE;
										}
										
										//line 127 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
										break;
									}
									
									
									case 43:
									{
										//line 129 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
										if (__temp_svar1.equals("+")) 
										{
											//line 129 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
											visibility = model.Field.ACCESS_PUBLIC;
										}
										
										//line 129 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
										break;
									}
									
									
								}
								
							}
							
						}
						
						//line 131 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						link = haxe.lang.StringExt.substring(link, 1, null);
					}
					
					//line 133 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					if ( ! (isWeak) ) 
					{
						//line 133 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						compoundSet = set;
					}
					
					//line 134 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					java.lang.String min = haxe.lang.StringExt.charAt(link, 0);
					//line 135 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					java.lang.String max = haxe.lang.StringExt.charAt(link, 1);
					//line 136 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					if (haxe.lang.Runtime.valEq(haxe.lang.StringExt.charAt(link, 2), ">")) 
					{
						//line 137 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						hasArrow = true;
					}
					
					//line 139 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					assoc.links.push(new model.Link(((model.Set) (set) ), haxe.lang.Runtime.toString(role), haxe.lang.Runtime.toString(min), haxe.lang.Runtime.toString(max), haxe.lang.Runtime.toBool(((java.lang.Boolean) (isWeak) )), haxe.lang.Runtime.toBool(((java.lang.Boolean) (isAgregate) )), haxe.lang.Runtime.toBool(((java.lang.Boolean) (hasArrow) )), ((int) (visibility) )));
				}
				else
				{
					//line 142 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					throw ((java.lang.RuntimeException) (haxe.Exception.thrown(( ( ( ( "error line " + haxe.root.Std.string(( lineIndex + 1 )) ) + " : no entity or association named \'" ) + setName ) + "\'" ))) );
				}
				
			}
			
		}
		
		//line 146 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		if (( componentSet != null )) 
		{
			//line 147 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			componentSet.compound = compoundSet;
		}
		
	}
	
	
	public static void loadSets(model.Diagram diagram, haxe.root.Array<java.lang.String> lines)
	{
		//line 152 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		int _g = 0;
		//line 152 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		while (( _g < lines.length ))
		{
			//line 152 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			java.lang.String line = lines.__get(_g);
			//line 152 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			 ++ _g;
			//line 153 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			line = source.Mocodo.deComment(line);
			//line 154 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			if (source.Mocodo.entityRE.match(line)) 
			{
				//line 155 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				java.lang.String name = ((java.lang.String) (((java.lang.Object) (haxe.lang.StringExt.substring(line, 0, haxe.lang.StringExt.indexOf(line, ":", null))) )) ).trim();
				//line 156 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				boolean isInterface = false;
				//line 158 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				model.Set set = new model.Set(haxe.lang.Runtime.toString(name), ((model.Set) (null) ), ((java.lang.Object) (false) ), ((java.lang.Object) (isInterface) ), ((java.lang.Object) (null) ));
				//line 159 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				java.lang.String lineSubStr = ((java.lang.String) (((java.lang.Object) (haxe.lang.StringExt.substring(line, ( haxe.lang.StringExt.indexOf(line, ":", null) + 1 ), null)) )) ).trim();
				//line 160 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				if ( ! (haxe.lang.Runtime.valEq(lineSubStr, "")) ) 
				{
					//line 161 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					haxe.root.Array<java.lang.String> fields = haxe.lang.StringExt.split(lineSubStr, ",");
					//line 162 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					{
						//line 162 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						int _g1 = 0;
						//line 162 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						int _g2 = fields.length;
						//line 162 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						while (( _g1 < _g2 ))
						{
							//line 162 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							int i = _g1++;
							//line 163 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							source.Mocodo.loadField(set, i, ((java.lang.String) (((java.lang.Object) (fields.__get(i)) )) ).trim());
						}
						
					}
					
				}
				
				//line 166 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				diagram.sets.set(name, set);
			}
			
		}
		
	}
	
	
	public static void loadField(model.Set set, java.lang.Object fieldIndex, java.lang.String name)
	{
		//line 171 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		int fieldIndex1 = ( (haxe.lang.Runtime.eq(fieldIndex, null)) ? (-1) : (((int) (haxe.lang.Runtime.toInt(fieldIndex)) )) );
		//line 172 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		java.lang.String type = source.Mocodo.DEFAULT_TYPE;
		//line 173 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		int visibility = model.Field.ACCESS_UNSET;
		//line 174 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		boolean isStatic = false;
		//line 175 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		boolean idSwap = false;
		//line 176 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		if (source.Mocodo.typeRE.match(name)) 
		{
			//line 177 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			type = ((java.lang.String) (((java.lang.Object) (source.Mocodo.typeRE.replace(name, "$2")) )) ).trim();
			//line 178 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			name = ((java.lang.String) (((java.lang.Object) (source.Mocodo.typeRE.replace(name, "$1")) )) ).trim();
		}
		
		//line 180 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		while (( ( ( ( haxe.lang.Runtime.valEq(haxe.lang.StringExt.charAt(name, 0), "_") || haxe.lang.Runtime.valEq(haxe.lang.StringExt.charAt(name, 0), "~") ) || haxe.lang.Runtime.valEq(haxe.lang.StringExt.charAt(name, 0), "-") ) || haxe.lang.Runtime.valEq(haxe.lang.StringExt.charAt(name, 0), "+") ) || haxe.lang.Runtime.valEq(haxe.lang.StringExt.charAt(name, 0), "#") ))
		{
			//line 181 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			{
				//line 181 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				java.lang.String __temp_svar1 = (haxe.lang.StringExt.charAt(name, 0));
				//line 181 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				if (( __temp_svar1 != null )) 
				{
					//line 181 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					switch (__temp_svar1.hashCode())
					{
						case 35:
						{
							//line 184 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							if (__temp_svar1.equals("#")) 
							{
								//line 184 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
								visibility = model.Field.ACCESS_PROTECTED;
							}
							
							//line 184 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							break;
						}
						
						
						case 126:
						{
							//line 182 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							if (__temp_svar1.equals("~")) 
							{
								//line 182 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
								isStatic = true;
							}
							
							//line 182 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							break;
						}
						
						
						case 43:
						{
							//line 185 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							if (__temp_svar1.equals("+")) 
							{
								//line 185 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
								visibility = model.Field.ACCESS_PUBLIC;
							}
							
							//line 185 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							break;
						}
						
						
						case 95:
						{
							//line 186 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							if (__temp_svar1.equals("_")) 
							{
								//line 186 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
								idSwap = true;
							}
							
							//line 186 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							break;
						}
						
						
						case 45:
						{
							//line 183 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							if (__temp_svar1.equals("-")) 
							{
								//line 183 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
								visibility = model.Field.ACCESS_PRIVATE;
							}
							
							//line 183 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							break;
						}
						
						
					}
					
				}
				
			}
			
			//line 188 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			name = haxe.lang.StringExt.substr(name, 1, null);
		}
		
		//line 190 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		if ( ! (haxe.root.Std.isOfType(set, model.Association.class)) ) 
		{
			//line 191 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			if (( ( ( fieldIndex1 == 0 ) &&  ! (idSwap)  ) || ( ( fieldIndex1 != 0 ) && idSwap ) )) 
			{
				//line 192 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				set.id.push(name);
			}
			
		}
		
		//line 195 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		set.fields.push(new model.Field(haxe.lang.Runtime.toString(name), haxe.lang.Runtime.toString(type), ((java.lang.Object) (visibility) ), ((java.lang.Object) (isStatic) )));
	}
	
	
	public static void loadSubsets(model.Diagram diagram, haxe.root.Array<java.lang.String> lines)
	{
		//line 199 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		int _g = 0;
		//line 199 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		int _g1 = lines.length;
		//line 199 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		while (( _g < _g1 ))
		{
			//line 199 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			int lineIndex = _g++;
			//line 200 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			java.lang.String line = source.Mocodo.deComment(lines.__get(lineIndex));
			//line 201 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			if (source.Mocodo.legacySubsetRE.match(line)) 
			{
				//line 202 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				java.lang.String type = source.Mocodo.legacySubsetRE.replace(line, "$4");
				//line 203 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				java.lang.String supersetName = ((java.lang.String) (((java.lang.Object) (source.Mocodo.legacySubsetRE.replace(line, "$5")) )) ).trim();
				//line 204 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				model.Set superset = diagram.sets.get(supersetName);
				//line 205 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				if (( superset != null )) 
				{
					//line 206 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					superset.subsetType = type;
					//line 207 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					if (( ( haxe.lang.Runtime.valEq(type, "XT") || haxe.lang.Runtime.valEq(type, "TX") ) || haxe.lang.Runtime.valEq(type, "P") )) 
					{
						//line 208 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						superset.isAbstract = true;
					}
					
					//line 210 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					haxe.root.Array<java.lang.String> children = haxe.lang.StringExt.split(source.Mocodo.legacySubsetRE.replace(line, "$1"), " U ");
					//line 211 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					{
						//line 211 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						int _g2 = 0;
						//line 211 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						int _g3 = children.length;
						//line 211 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						while (( _g2 < _g3 ))
						{
							//line 211 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							int i = _g2++;
							//line 212 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							java.lang.String childName = ((java.lang.String) (((java.lang.Object) (children.__get(i)) )) ).trim();
							//line 213 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							model.Set child = diagram.sets.get(childName);
							//line 214 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							if (( child != null )) 
							{
								//line 215 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
								superset.subsets.push(child);
								//line 216 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
								child.id = new haxe.root.Array<java.lang.String>();
								//line 217 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
								child.superset = superset;
							}
							else
							{
								//line 220 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
								throw ((java.lang.RuntimeException) (haxe.Exception.thrown(( ( ( ( "error line " + haxe.root.Std.string(( lineIndex + 1 )) ) + " : no entity named \'" ) + childName ) + "\'" ))) );
							}
							
						}
						
					}
					
				}
				else
				{
					//line 226 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					throw ((java.lang.RuntimeException) (haxe.Exception.thrown(( ( ( ( "error line " + haxe.root.Std.string(( lineIndex + 1 )) ) + " : no entity named \'" ) + supersetName ) + "\'" ))) );
				}
				
			}
			else
			{
				//line 229 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				if (source.Mocodo.subsetRE.match(line)) 
				{
					//line 230 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					java.lang.String type1 = source.Mocodo.subsetRE.replace(line, "$1");
					//line 231 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					java.lang.String supersetName1 = haxe.root.StringTools.rtrim(source.Mocodo.subsetRE.replace(line, "$2"));
					//line 232 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					model.Set superset1 = diagram.sets.get(supersetName1);
					//line 233 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					if (( superset1 != null )) 
					{
						//line 234 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						superset1.subsetType = type1;
						//line 235 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						int tmp = 0;
						//line 235 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						{
							//line 235 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							java.lang.String __temp_svar1 = (source.Mocodo.subsetRE.replace(line, "$3"));
							//line 235 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							boolean __temp_executeDef2 = true;
							//line 235 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							if (( __temp_svar1 != null )) 
							{
								//line 235 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
								switch (__temp_svar1.hashCode())
								{
									case 45:
									{
										//line 235 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
										if (__temp_svar1.equals("-")) 
										{
											//line 235 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
											__temp_executeDef2 = false;
											//line 235 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
											tmp = model.Set.SUBSET_OPT_BOTH;
										}
										
										//line 235 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
										break;
									}
									
									
									case 62:
									{
										//line 235 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
										if (__temp_svar1.equals(">")) 
										{
											//line 235 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
											__temp_executeDef2 = false;
											//line 235 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
											tmp = model.Set.SUBSET_OPT_CHILDREN;
										}
										
										//line 235 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
										break;
									}
									
									
									case 60:
									{
										//line 235 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
										if (__temp_svar1.equals("<")) 
										{
											//line 235 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
											__temp_executeDef2 = false;
											//line 235 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
											tmp = model.Set.SUBSET_OPT_PARENT;
										}
										
										//line 235 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
										break;
									}
									
									
								}
								
							}
							
							//line 235 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							if (__temp_executeDef2) 
							{
								//line 235 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
								tmp = -1;
							}
							
						}
						
						//line 235 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						superset1.subsetOption = tmp;
						//line 241 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						if (( ( haxe.lang.Runtime.valEq(type1, "XT") || haxe.lang.Runtime.valEq(type1, "TX") ) || haxe.lang.Runtime.valEq(type1, "P") )) 
						{
							//line 242 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							superset1.isAbstract = true;
						}
						
						//line 244 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						java.lang.String classType = source.Mocodo.subsetRE.replace(line, "$4");
						//line 245 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						if ( ! (haxe.lang.Runtime.valEq(classType, "")) ) 
						{
							//line 246 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							superset1.subsetCode = haxe.lang.StringExt.substr(classType, 1, ( classType.length() - 2 ));
						}
						
						//line 248 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						haxe.root.Array<java.lang.String> children1 = haxe.lang.StringExt.split(source.Mocodo.subsetRE.replace(line, "$5"), ",");
						//line 249 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						{
							//line 249 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							int _g4 = 0;
							//line 249 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							int _g5 = children1.length;
							//line 249 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							while (( _g4 < _g5 ))
							{
								//line 249 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
								int i1 = _g4++;
								//line 250 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
								java.lang.String childName1 = ((java.lang.String) (((java.lang.Object) (children1.__get(i1)) )) ).trim();
								//line 251 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
								model.Set child1 = diagram.sets.get(childName1);
								//line 252 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
								if (( child1 != null )) 
								{
									//line 253 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
									superset1.subsets.push(child1);
									//line 254 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
									child1.id.shift();
									//line 255 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
									child1.superset = superset1;
								}
								else
								{
									//line 258 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
									throw ((java.lang.RuntimeException) (haxe.Exception.thrown(( ( ( ( "error line " + haxe.root.Std.string(( lineIndex + 1 )) ) + " : no entity named \'" ) + childName1 ) + "\'" ))) );
								}
								
							}
							
						}
						
					}
					else
					{
						//line 264 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						throw ((java.lang.RuntimeException) (haxe.Exception.thrown(( ( ( ( "error line " + haxe.root.Std.string(( lineIndex + 1 )) ) + " : no entity named \'" ) + supersetName1 ) + "\'" ))) );
					}
					
				}
				
			}
			
		}
		
	}
	
	
	public static void loadMethods(model.Diagram diagram, haxe.root.Array<java.lang.String> lines)
	{
		//line 272 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		int _g = 0;
		//line 272 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		int _g1 = lines.length;
		//line 272 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		while (( _g < _g1 ))
		{
			//line 272 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			int lineIndex = _g++;
			//line 273 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			java.lang.String line = source.Mocodo.deComment(lines.__get(lineIndex));
			//line 274 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			if (source.Mocodo.methodRE.match(line)) 
			{
				//line 275 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				java.lang.String className = ((java.lang.String) (((java.lang.Object) (haxe.lang.StringExt.substring(line, 0, ( haxe.lang.StringExt.indexOf(line, ":", null) - 2 ))) )) ).trim();
				//line 276 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				model.Set set = diagram.sets.get(className);
				//line 277 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				if (( set == null )) 
				{
					//line 278 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					set = new model.Set(haxe.lang.Runtime.toString(className), ((model.Set) (null) ), ((java.lang.Object) (false) ), ((java.lang.Object) (true) ), ((java.lang.Object) (true) ));
					//line 279 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					diagram.sets.set(className, set);
				}
				
				//line 281 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				java.lang.String lineSubStr = haxe.lang.StringExt.substring(line, ( haxe.lang.StringExt.indexOf(line, ":", null) + 1 ), null);
				//line 282 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				int start = 0;
				//line 283 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				int end = haxe.lang.StringExt.indexOf(lineSubStr, ")", start);
				//line 284 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				while (( end != -1 ))
				{
					//line 285 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					int next = haxe.lang.StringExt.indexOf(lineSubStr, ",", end);
					//line 286 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					int lob = haxe.lang.StringExt.indexOf(lineSubStr, "[", end);
					//line 287 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					int lcb = haxe.lang.StringExt.indexOf(lineSubStr, "]", end);
					//line 288 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					if (( ( ( lob != -1 ) && ( next > lob ) ) && ( next < lcb ) )) 
					{
						//line 289 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						next = haxe.lang.StringExt.indexOf(lineSubStr, ",", lcb);
					}
					
					//line 291 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					java.lang.String methodStr = null;
					//line 292 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					if (( next != -1 )) 
					{
						//line 293 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						methodStr = haxe.lang.StringExt.substring(lineSubStr, start, next);
						//line 294 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						start = ( next + 1 );
						//line 295 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						end = haxe.lang.StringExt.indexOf(lineSubStr, ")", start);
					}
					else
					{
						//line 297 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						methodStr = haxe.lang.StringExt.substring(lineSubStr, start, null);
						//line 298 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						end = -1;
					}
					
					//line 300 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					source.Mocodo.loadMethod(set, ((java.lang.String) (((java.lang.Object) (methodStr) )) ).trim());
				}
				
			}
			
		}
		
	}
	
	
	public static void loadMethod(model.Set set, java.lang.String methodStr)
	{
		//line 307 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		int visibility = model.Field.ACCESS_PUBLIC;
		//line 308 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		boolean isStatic = false;
		//line 309 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		java.lang.String name = ((java.lang.String) (((java.lang.Object) (haxe.lang.StringExt.substring(methodStr, 0, haxe.lang.StringExt.indexOf(methodStr, "(", null))) )) ).trim();
		//line 310 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		java.lang.String type = haxe.lang.StringExt.substring(methodStr, ( haxe.lang.StringExt.indexOf(methodStr, ")", null) + 1 ), null);
		//line 311 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		type = ((java.lang.String) (((java.lang.Object) (haxe.lang.StringExt.substring(type, ( haxe.lang.StringExt.indexOf(type, "[", null) + 1 ), haxe.lang.StringExt.indexOf(type, "]", null))) )) ).trim();
		//line 312 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		java.lang.String firstChar = haxe.lang.StringExt.charAt(name, 0);
		//line 313 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		while (( ( ( haxe.lang.Runtime.valEq(firstChar, "~") || haxe.lang.Runtime.valEq(firstChar, "-") ) || haxe.lang.Runtime.valEq(firstChar, "+") ) || haxe.lang.Runtime.valEq(firstChar, "#") ))
		{
			//line 314 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			{
				//line 314 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				java.lang.String __temp_svar1 = (firstChar);
				//line 314 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				if (( __temp_svar1 != null )) 
				{
					//line 314 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					switch (__temp_svar1.hashCode())
					{
						case 35:
						{
							//line 317 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							if (__temp_svar1.equals("#")) 
							{
								//line 317 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
								visibility = model.Field.ACCESS_PROTECTED;
							}
							
							//line 317 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							break;
						}
						
						
						case 126:
						{
							//line 315 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							if (__temp_svar1.equals("~")) 
							{
								//line 315 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
								isStatic = true;
							}
							
							//line 315 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							break;
						}
						
						
						case 43:
						{
							//line 318 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							if (__temp_svar1.equals("+")) 
							{
								//line 318 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
								visibility = model.Field.ACCESS_PUBLIC;
							}
							
							//line 318 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							break;
						}
						
						
						case 45:
						{
							//line 316 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							if (__temp_svar1.equals("-")) 
							{
								//line 316 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
								visibility = model.Field.ACCESS_PRIVATE;
							}
							
							//line 316 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							break;
						}
						
						
					}
					
				}
				
			}
			
			//line 320 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			name = haxe.lang.StringExt.substr(name, 1, null);
			//line 321 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			firstChar = haxe.lang.StringExt.charAt(name, 0);
		}
		
		//line 323 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		if (haxe.lang.Runtime.valEq(name, "")) 
		{
			//line 324 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			name = set.name;
		}
		
		//line 326 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		model.Method method = new model.Method(haxe.lang.Runtime.toString(name), haxe.lang.Runtime.toString(type), ((java.lang.Object) (visibility) ), ((java.lang.Object) (isStatic) ));
		//line 327 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		java.lang.String paramsStr = ((java.lang.String) (((java.lang.Object) (haxe.lang.StringExt.substring(methodStr, ( haxe.lang.StringExt.indexOf(methodStr, "(", null) + 1 ), haxe.lang.StringExt.indexOf(methodStr, ")", null))) )) ).trim();
		//line 328 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		if ( ! (haxe.lang.Runtime.valEq(paramsStr, "")) ) 
		{
			//line 329 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			source.Mocodo.loadParams(set, method, paramsStr);
		}
		
		//line 331 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		if (haxe.lang.Runtime.valEq(name, set.name)) 
		{
			//line 332 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			set.constructors.push(method);
		}
		else
		{
			//line 334 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			set.methods.push(method);
		}
		
	}
	
	
	public static void loadParams(model.Set set, model.Method method, java.lang.String paramsStr)
	{
		//line 339 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		int _g = 0;
		//line 339 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		haxe.root.Array<java.lang.String> _g1 = haxe.lang.StringExt.split(paramsStr, ",");
		//line 339 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		while (( _g < _g1.length ))
		{
			//line 339 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			java.lang.String paramSubStr = _g1.__get(_g);
			//line 339 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			 ++ _g;
			//line 340 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			java.lang.String name = ((java.lang.String) (((java.lang.Object) (paramSubStr) )) ).trim();
			//line 341 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			java.lang.String type = "";
			//line 342 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			if (( haxe.lang.StringExt.indexOf(paramSubStr, "[", null) != -1 )) 
			{
				//line 343 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				name = ((java.lang.String) (((java.lang.Object) (haxe.lang.StringExt.substring(paramSubStr, 0, haxe.lang.StringExt.indexOf(paramSubStr, "[", null))) )) ).trim();
				//line 344 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				if (( haxe.lang.StringExt.indexOf(paramSubStr, "]", haxe.lang.StringExt.indexOf(paramSubStr, "[", null)) != -1 )) 
				{
					//line 345 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					type = ((java.lang.String) (((java.lang.Object) (haxe.lang.StringExt.substring(paramSubStr, ( haxe.lang.StringExt.indexOf(paramSubStr, "[", null) + 1 ), haxe.lang.StringExt.indexOf(paramSubStr, "]", null))) )) ).trim();
				}
				
			}
			
			//line 348 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			if (haxe.lang.Runtime.valEq(type, "")) 
			{
				//line 349 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				model.Field field = set.getField(name);
				//line 350 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				if (( field != null )) 
				{
					//line 351 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					type = field.dbType;
				}
				else
				{
					//line 353 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					type = source.Mocodo.DEFAULT_TYPE;
				}
				
			}
			
			//line 356 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			method.params.push(new model.Field(haxe.lang.Runtime.toString(name), haxe.lang.Runtime.toString(type), ((java.lang.Object) (null) ), ((java.lang.Object) (null) )));
		}
		
	}
	
	
	public static void loadLayout(model.Diagram diagram, haxe.root.Array<java.lang.String> lines)
	{
		//line 361 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		int maxCol = 0;
		//line 362 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		int col = 0;
		//line 363 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		int row = 0;
		//line 364 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		{
			//line 364 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			int _g = 0;
			//line 364 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			while (( _g < lines.length ))
			{
				//line 364 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				java.lang.String line = lines.__get(_g);
				//line 364 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				 ++ _g;
				//line 365 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				line = source.Mocodo.deComment(line);
				//line 366 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				if (haxe.lang.Runtime.valEq(((java.lang.String) (((java.lang.Object) (line) )) ).trim(), "")) 
				{
					//line 367 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					if (( col != 0 )) 
					{
						//line 368 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						if (( col > maxCol )) 
						{
							//line 369 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							maxCol = col;
						}
						
						//line 371 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						col = 0;
						//line 372 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						 ++ row;
					}
					
				}
				else
				{
					//line 375 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					model.Set set = null;
					//line 376 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					if (haxe.lang.Runtime.valEq(((java.lang.String) (((java.lang.Object) (line) )) ).trim(), ":")) 
					{
						//line 377 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						 ++ col;
					}
					else
					{
						//line 378 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						if (source.Mocodo.entityRE.match(line)) 
						{
							//line 379 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							set = diagram.sets.get(((java.lang.String) (((java.lang.Object) (haxe.lang.StringExt.substring(line, 0, haxe.lang.StringExt.indexOf(line, ":", null))) )) ).trim());
							//line 380 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							set.row = row;
							//line 381 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							set.col = col;
							//line 382 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							 ++ col;
						}
						else
						{
							//line 383 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							if (source.Mocodo.associationRE.match(line)) 
							{
								//line 384 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
								set = diagram.associations.get(((java.lang.String) (((java.lang.Object) (haxe.lang.StringExt.substring(line, 0, haxe.lang.StringExt.indexOf(line, ",", null))) )) ).trim());
								//line 385 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
								set.row = row;
								//line 386 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
								set.col = col;
								//line 387 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
								 ++ col;
							}
							
						}
						
					}
					
				}
				
			}
			
		}
		
		//line 391 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		diagram.height = row;
		//line 392 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		diagram.width = maxCol;
	}
	
	
	public static java.lang.String save(model.Diagram diagram)
	{
		//line 396 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		java.lang.String mocodoText = "";
		//line 397 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		haxe.root.Array<haxe.root.Array<model.Set>> grid = diagram.getGrid();
		//line 398 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		{
			//line 398 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			int _g = 0;
			//line 398 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			int _g1 = grid.length;
			//line 398 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			while (( _g < _g1 ))
			{
				//line 398 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				int lineIndex = _g++;
				//line 399 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				{
					//line 399 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					int _g2 = 0;
					//line 399 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					haxe.root.Array<model.Set> _g3 = grid.__get(lineIndex);
					//line 399 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					while (( _g2 < _g3.length ))
					{
						//line 399 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						model.Set set = _g3.__get(_g2);
						//line 399 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						 ++ _g2;
						//line 400 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						if (( set == null )) 
						{
							//line 401 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							mocodoText += ":";
						}
						else
						{
							//line 403 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
							if (haxe.root.Std.isOfType(set, model.Association.class)) 
							{
								//line 404 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
								mocodoText += source.Mocodo.saveAssociation(((model.Association) (set) ));
							}
							else
							{
								//line 406 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
								mocodoText += source.Mocodo.saveSet(set);
							}
							
						}
						
						//line 409 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
						mocodoText += "\n";
					}
					
				}
				
				//line 411 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				if (( lineIndex != ( grid.length - 1 ) )) 
				{
					//line 412 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					mocodoText += "\n";
				}
				
			}
			
		}
		
		//line 415 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		return mocodoText;
	}
	
	
	public static java.lang.String saveAssociation(model.Association assoc)
	{
		//line 419 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		java.lang.String mocodoText = assoc.name;
		//line 420 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		{
			//line 420 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			int _g = 0;
			//line 420 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			haxe.root.Array<model.Link> _g1 = assoc.links;
			//line 420 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			while (( _g < _g1.length ))
			{
				//line 420 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				model.Link link = _g1.__get(_g);
				//line 420 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				 ++ _g;
				//line 421 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				mocodoText += ( ( ( ( ( ", " + (( (link.isWeak) ? ("_") : ("") )) ) + link.min ) + link.max ) + " " ) + link.set.name );
			}
			
		}
		
		//line 423 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		{
			//line 423 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			int _g2 = 0;
			//line 423 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			int _g3 = assoc.fields.length;
			//line 423 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			while (( _g2 < _g3 ))
			{
				//line 423 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				int fieldIndex = _g2++;
				//line 424 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				if (( fieldIndex != 0 )) 
				{
					//line 425 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					mocodoText += ", ";
				}
				else
				{
					//line 427 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					mocodoText += ": ";
				}
				
				//line 429 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				mocodoText += ( ( ( assoc.fields.__get(fieldIndex).name + " [" ) + assoc.fields.__get(fieldIndex).type ) + "]" );
			}
			
		}
		
		//line 431 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		return mocodoText;
	}
	
	
	public static java.lang.String saveSet(model.Set set)
	{
		//line 435 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		java.lang.String mocodoText = ( set.name + ": " );
		//line 436 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		haxe.root.Array<java.lang.String> _g = new haxe.root.Array<java.lang.String>(new java.lang.String[]{});
		//line 436 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		{
			//line 436 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			java.lang.Object x = ((java.lang.Object) (haxe.lang.Runtime.callField(((java.lang.Object) (set.fields) ), "iterator", null)) );
			//line 436 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			while (haxe.lang.Runtime.toBool(((java.lang.Boolean) (haxe.lang.Runtime.callField(x, "hasNext", null)) )))
			{
				//line 436 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				model.Field x1 = ((model.Field) (haxe.lang.Runtime.callField(x, "next", null)) );
				//line 436 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				_g.push(( ( ( x1.name + " [" ) + x1.type ) + "]" ));
			}
			
		}
		
		//line 436 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		mocodoText += _g.join(", ");
		//line 437 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		if (( set.subsets.length != 0 )) 
		{
			//line 438 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			java.lang.String mocodoText1 = ( ( "\n/\\ " + set.name ) + " - " );
			//line 438 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			haxe.root.Array<java.lang.String> _g1 = new haxe.root.Array<java.lang.String>(new java.lang.String[]{});
			//line 438 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			{
				//line 438 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				java.lang.Object x2 = ((java.lang.Object) (haxe.lang.Runtime.callField(((java.lang.Object) (set.subsets) ), "iterator", null)) );
				//line 438 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
				while (haxe.lang.Runtime.toBool(((java.lang.Boolean) (haxe.lang.Runtime.callField(x2, "hasNext", null)) )))
				{
					//line 438 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					model.Set x3 = ((model.Set) (haxe.lang.Runtime.callField(x2, "next", null)) );
					//line 438 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
					_g1.push(x3.name);
				}
				
			}
			
			//line 438 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
			mocodoText += ( mocodoText1 + _g1.join(", ") );
		}
		
		//line 440 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/source/Mocodo.hx"
		return mocodoText;
	}
	
	
}


