Index: /trunk/org.modelica.mdt.core/src/org/modelica/mdt/core/compiler/ModelicaParser.java
===================================================================
--- /trunk/org.modelica.mdt.core/src/org/modelica/mdt/core/compiler/ModelicaParser.java	(revision 436)
+++ /trunk/org.modelica.mdt.core/src/org/modelica/mdt/core/compiler/ModelicaParser.java	(revision 437)
@@ -95,18 +95,56 @@
 		/*
 		 * Go through the string character by character, looking for commas (,)
-		 * and start ({) and end (}) of lists. 
+		 * and start ({) and end (}) of lists. Take special note of " as they
+		 * start and end strings. Inside a string, there can be , { and }
+		 * characters and also escaped characters (for example \").
 		 */
+		
+		// TODO Rewrite this using a better way of acumulating the characters.
+		// Right now, it uses string += otherString, which generates alot of
+		// strings that later are thrown away. Slowness, the slowness!
 		String subString = "";
 		int depth = 0;
 		boolean listFound = false;
+		boolean insideString = false;
 		for(int characterPosition = 0;characterPosition < str.length()
 			;characterPosition++)
 		{
-			if(str.charAt(characterPosition) == '{')
+			if(str.charAt(characterPosition) == '\\' && insideString == true)
+			{
+				/* Read this \ and the escaped character */
+				characterPosition++;
+				
+				if(characterPosition >= str.length())
+				{
+					/* This is some kind of error*/
+					throw new ModelicaParserException("String ends in \\: " 
+							+ str);
+				}
+
+				subString += "\\" + str.charAt(characterPosition);
+			}
+			else if(str.charAt(characterPosition) == '"')
+			{
+				/* If we're not inside a string, enter string mode*/
+				if(insideString == false)
+				{
+					insideString = true;
+				}
+				/* else exit it */
+				else
+				{
+					insideString = false;
+				}
+				
+				subString += '"';
+			}
+			else if(str.charAt(characterPosition) == '{' && insideString == false)
 			{
 				listFound = true;
 				depth++;
-			}
-			if(str.charAt(characterPosition) == ',' && depth == 0)
+				
+				subString += '{';
+			}
+			else if(str.charAt(characterPosition) == ',' && depth == 0 && insideString == false)
 			{
 				/*
@@ -158,11 +196,9 @@
 				subString = "";
  			}
-			else
-			{
-				subString += str.charAt(characterPosition);
-			}
-			if(str.charAt(characterPosition) == '}')
+			else if(str.charAt(characterPosition) == '}' && insideString == false)
 			{
 				depth--;
+				
+				subString += '}';
 				
 				/* Unmatched } */
@@ -171,4 +207,8 @@
 					throw new ModelicaParserException("Unmatched }: ["+str+"]");
 				}
+			}
+			else
+			{
+				subString += str.charAt(characterPosition);
 			}
 		}
@@ -221,4 +261,10 @@
 		}
 		
+		if(insideString == true)
+		{
+			/* We should not be inside a string at the end of the list */
+			throw new ModelicaParserException("Unterminated string: ["+str+"]");
+		}
+		
 		return elements;
 	}
Index: /trunk/org.modelica.mdt.test/src/org/modelica/mdt/test/TestModelicaParser.java
===================================================================
--- /trunk/org.modelica.mdt.test/src/org/modelica/mdt/test/TestModelicaParser.java	(revision 436)
+++ /trunk/org.modelica.mdt.test/src/org/modelica/mdt/test/TestModelicaParser.java	(revision 437)
@@ -142,11 +142,7 @@
 
 	private static final String GET_CLASS_INFO1 = 
-		"{\"model\"," +
-		"\"Chua's circuit, ns, V, A\"," +
-		"C:\\OpenModelica132\\ModelicaLibrary\\Modelica\\Electrical\\Anal" +
-		"og\\Examples\\ChuaCircuit.mo\"," +
-		"{false,false,true}," +
-		"{\"writable\",1,1,65,16}}";
-
+	"{\"model\",\"Chua's circuit, ns, V, A\",\"/home/x05andre/ex/Modelica " +
+	"Library/Modelica/Electrical/Analog/Examples/ChuaCircuit.mo\",{false,f" +
+	"alse,true},{\"writable\",1,1,65,16}}";
 	/*
 	 * The expected results when getElements() output is parsed 
@@ -414,11 +410,11 @@
 
 		parsedList = ModelicaParser.parseList(GET_CLASS_INFO1);
-		
-		assertEquals("parse resuls if of wrong length", 4, parsedList.size());
+
+		assertEquals("Parse resuls is of wrong length", 5, parsedList.size());
 		
 		listElement = parsedList.elementAt(0);
-		assertTrue("expected simple element found list",
-				listElement instanceof Element);
-		assertEquals("wrong string", "\"model\"",
+		assertTrue("Expected simple element found list",
+				listElement instanceof Element);
+		assertEquals("Wrong string", "\"model\"",
 				((Element)listElement).toString());
 
@@ -426,36 +422,16 @@
 		assertTrue("expected simple element found list",
 				listElement instanceof Element);
-		assertEquals("wrong string",
-				"Chua's circuit, ns, V, A\",\"C:\\OpenModelica132\\Modelica" +
-				"Library\\Modelica\\Electrical\\Analog\\Examples\\ChuaCircuit.mo",
-				((Element)listElement).toString());
-
+		assertEquals("Wrong string",
+				"\"Chua's circuit, ns, V, A\"",
+				((Element)listElement).toString());
 		
 		listElement = parsedList.elementAt(2);
-		assertTrue("expected list found simple element",
-				listElement instanceof List);
-		list = (List)listElement;
-		
-		assertEquals("parse resuls if of wrong length", 3, parsedList.size());
-		
-		listElement = list.elementAt(0);
-		assertTrue("expected simple element found list",
-				listElement instanceof Element);
-		assertEquals("wrong string", "false",
-				((Element)listElement).toString());
-		
-		listElement = list.elementAt(1);
-		assertTrue("expected simple element found list",
-				listElement instanceof Element);
-		assertEquals("wrong string", "false",
-				((Element)listElement).toString());
-		
-		listElement = list.elementAt(2);
-		assertTrue("expected simple element found list",
-				listElement instanceof Element);
-		assertEquals("wrong string", "true",
-				((Element)listElement).toString());
-
-
+		assertTrue("Expected simple element found list",
+				listElement instanceof Element);
+		assertEquals("Wrong string",
+				"\"/home/x05andre/ex/Modelica Library/Modelica/Electrical/Anal" +
+				"og/Examples/ChuaCircuit.mo\"",
+				((Element)listElement).toString());
+		
 		listElement = parsedList.elementAt(3);
 		assertTrue("expected list found simple element",
@@ -463,10 +439,36 @@
 		list = (List)listElement;
 		
-		assertEquals("parse resuls if of wrong length", 5, parsedList.size());
+		assertEquals("parse resuls if of wrong length", 3, list.size());
 		
 		listElement = list.elementAt(0);
 		assertTrue("expected simple element found list",
 				listElement instanceof Element);
-		assertEquals("wrong string", "writeable",
+		assertEquals("wrong string", "false",
+				((Element)listElement).toString());
+		
+		listElement = list.elementAt(1);
+		assertTrue("expected simple element found list",
+				listElement instanceof Element);
+		assertEquals("wrong string", "false",
+				((Element)listElement).toString());
+		
+		listElement = list.elementAt(2);
+		assertTrue("expected simple element found list",
+				listElement instanceof Element);
+		assertEquals("wrong string", "true",
+				((Element)listElement).toString());
+
+
+		listElement = parsedList.elementAt(4);
+		assertTrue("expected list found simple element",
+				listElement instanceof List);
+		list = (List)listElement;
+		
+		assertEquals("parse resuls if of wrong length", 5, list.size());
+		
+		listElement = list.elementAt(0);
+		assertTrue("expected simple element found list",
+				listElement instanceof Element);
+		assertEquals("wrong string", "\"writable\"",
 				((Element)listElement).toString());
 		
