changeset 195:06e52f99cb67

eclipse_plugin: now handles transcripts
author Sigurd Meldgaard <stm@daimi.au.dk>
date Wed, 16 Dec 2009 16:56:12 +0100
parents 411188503c72
children 14bb029606f9
files eclipse/src/eu/cace/pysmcl/builder/PySMCLBuilder.java eclipse/src/eu/cace/pysmcl/builder/PySMCLCompiler.java
diffstat 2 files changed, 13 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/eclipse/src/eu/cace/pysmcl/builder/PySMCLBuilder.java	Wed Dec 16 16:55:15 2009 +0100
+++ b/eclipse/src/eu/cace/pysmcl/builder/PySMCLBuilder.java	Wed Dec 16 16:56:12 2009 +0100
@@ -65,6 +65,7 @@
 		try {
 			IMarker marker = file.createMarker(MARKER_TYPE);
 			marker.setAttribute(IMarker.MESSAGE, message);
+			marker.setAttribute(IMarker.TEXT, message);
 			marker.setAttribute(IMarker.SEVERITY, severity);
 			marker.setAttribute(IMarker.CHAR_START, start);
 			marker.setAttribute(IMarker.CHAR_END, end);
--- a/eclipse/src/eu/cace/pysmcl/builder/PySMCLCompiler.java	Wed Dec 16 16:55:15 2009 +0100
+++ b/eclipse/src/eu/cace/pysmcl/builder/PySMCLCompiler.java	Wed Dec 16 16:56:12 2009 +0100
@@ -92,7 +92,7 @@
 	}
 
 	private List<String> splitGroup(String regex, String input){
-		Matcher m = Pattern.compile(regex).matcher(input);
+		Matcher m = Pattern.compile(regex, Pattern.DOTALL).matcher(input);
 		ArrayList<String> a = new ArrayList<String>();
 		if(m.find()){
 			for(int i=1; i <= m.groupCount(); i++){
@@ -117,7 +117,7 @@
 		Set<SMCLProblem> res = new HashSet<SMCLProblem>();
 		try{
 			System.out.println(output);
-			for(String line : output.split("\n")){
+			for(String line : output.split("\n!|!")){
 				if(line.startsWith("Seeding")){
 					//ignore
 				}else if(line.startsWith("secret:")){
@@ -131,18 +131,25 @@
 				} else if(line.startsWith("values:")){
 					List<String> m = splitGroup("values: (\\d+) (\\d+) (\\d+) \\((.*)\\)", line);
 					res.add(createMarker(resource,
-							""+m.get(3),
+							m.get(3),
 							Integer.parseInt(m.get(0)),
 							Integer.parseInt(m.get(1)),
 							Integer.parseInt(m.get(2)), IMarker.SEVERITY_INFO));				
 				} else if(line.startsWith("error:")){
 					List<String> m = splitGroup("error: (\\d+) (\\d+) (\\d+) \\((.*)\\)", line);
-					System.out.println(m);
 					res.add(createMarker(resource,
-							""+m.get(3),
+							m.get(3),
 							Integer.parseInt(m.get(0)),
 							Integer.parseInt(m.get(1)),
 							Integer.parseInt(m.get(2)), IMarker.SEVERITY_ERROR));				
+				} else if(line.startsWith("transformed:")){
+					List<String> m = splitGroup("transformed: (\\d+) (\\d+) (\\d+) \\((.*)\\)", line);
+					System.out.println(m);
+					res.add(createMarker(resource,
+							m.get(3),
+							Integer.parseInt(m.get(0)),
+							Integer.parseInt(m.get(1)),
+							Integer.parseInt(m.get(2)), IMarker.SEVERITY_INFO));				
 				} else {
 					throw new RuntimeException("Badly formatted output");
 				}