Revision: 15280
          http://gate.svn.sourceforge.net/gate/?rev=15280&view=rev
Author:   valyt
Date:     2012-01-31 15:09:11 +0000 (Tue, 31 Jan 2012)
Log Message:
-----------
Hopefully fixed a bug that occurred for state transitions with multiple 
constraints.

Modified Paths:
--------------
    gate/trunk/plugins/JAPE_Plus/src/gate/jape/plus/SPTBuilder.java

Modified: gate/trunk/plugins/JAPE_Plus/src/gate/jape/plus/SPTBuilder.java
===================================================================
--- gate/trunk/plugins/JAPE_Plus/src/gate/jape/plus/SPTBuilder.java     
2012-01-31 15:00:54 UTC (rev 15279)
+++ gate/trunk/plugins/JAPE_Plus/src/gate/jape/plus/SPTBuilder.java     
2012-01-31 15:09:11 UTC (rev 15280)
@@ -15,6 +15,7 @@
 
 package gate.jape.plus;
 
+import java.io.File;
 import java.io.FileWriter;
 import java.io.IOException;
 import java.lang.reflect.Constructor;
@@ -135,8 +136,20 @@
       }
     }
     SPTBase optimisedTransducer = null;
+    
+    // when debugging, this will dump the generated sources where Eclipse can 
+    // see the.
+//    try {
+//      File srcDir = new File("plugins/JAPE_Plus/test/src/japephases/");
+//      srcDir.mkdirs();
+//      FileWriter writer = new FileWriter(new File(srcDir, className + 
".java"));
+//      writer.write(sptCode.toString());
+//      writer.close();
+//    } catch(IOException e1) {
+//      e1.printStackTrace();
+//    }
+
     try {
-      
       Map<String, String> classes = new HashMap<String, String>(1);
       String fqcn = GENERATED_CLASS_PACKAGE + "." + className; 
       classes.put(fqcn, sptCode.toString());
@@ -456,8 +469,8 @@
       }
       tabs--;
       out.append(TABS[tabs]).append("} // end constraint block\n");
-      
-      out.append(TABS[tabs]).append(
+    }
+    out.append(TABS[tabs]).append(
         "// we finished checking all constraints, and they all succeeded\n");
       out.append(TABS[tabs]).append(
         "// -> apply the transition with all possible bindings 
combinations\n");
@@ -465,10 +478,7 @@
         "// a next step is a set of bound annotations, one for each 
constraint\n");
       out.append(TABS[tabs]).append(
         "generateAllNewInstances(instance, ").append(
-          transition.nextState).append(", annotsForConstraints);\n");
-    }
-
-
+          transition.nextState).append(", annotsForConstraints);\n");    
   }
   
   protected void writeClassFooter(StringBuilder out) {

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to