浏览代码

deleted invalid plugins, compile to icon definition metamodel now also checks whether an icon is specified for a type which is not present in the AS metamodel

Simon Van Mierlo 9 年之前
父节点
当前提交
718be2c47b
共有 3 个文件被更改,包括 13 次插入10 次删除
  1. 13 6
      mmmk.js
  2. 0 2
      plugins/atompm_process_model_enactor.js
  3. 0 2
      plugins/interactive_statechart_simulator.js

+ 13 - 6
mmmk.js

@@ -959,7 +959,8 @@ with AToMPM.  If not, see <http://www.gnu.org/licenses/>.
 		3. construct mm.types based on information from step 2... the resulting 
 			mm.types wil look very much like ConcreteSyntax.types, with a few added
 			'special' attributes (e.g., $asuri, $contents, etc.) 
-		4. return mm stringified (ensures no references to objects in this.model
+        4. check whether all non-abstract types have an icon, and no abstract types have an icon    
+		5. return mm stringified (ensures no references to objects in this.model
 			are returned) */
 	'compileToIconDefinitionMetamodel' : 
 		function(csm, asmm)
@@ -1132,9 +1133,9 @@ with AToMPM.  If not, see <http://www.gnu.org/licenses/>.
 
 
 						/* 3 */
-						var node   			  = model.nodes[iid];
-					  		 type   			  = node['typename']['value'];
-							 isConnectorType = 'link-style' in node;
+						var node   			= model.nodes[iid];
+					  		type   	        = node['typename']['value'];
+							isConnectorType = 'link-style' in node;
 						mm.types[type] = [];
 
 						self.metamodels[CS].
@@ -1167,7 +1168,7 @@ with AToMPM.  If not, see <http://www.gnu.org/licenses/>.
 						mm.types2parentTypes[type] = [];
 					});
                 
-                /* check whether all non-abstract types have an icon, and no abstract types have an icon */
+                /* 4 */
                 var types = [],
                     abstractTypes = [];
                     
@@ -1189,8 +1190,14 @@ with AToMPM.  If not, see <http://www.gnu.org/licenses/>.
                         }
                     }
                 }
+                
+                for (var curr_type in mm["types"]) {                    
+                    if (!(curr_type.slice(0, -4) in asmm["types"])) {
+                        return {'$err':'type '+curr_type.slice(0, -4)+' not found in the abstract syntax metamodel, visual representation ' + curr_type + ' invalid'};
+                    }
+                }
                     
-				/* 4 */
+				/* 5 */
 				return _utils.jsons(mm,null,"\t");
 			}
 			catch(err)

+ 0 - 2
plugins/atompm_process_model_enactor.js

@@ -1,2 +0,0 @@
-/* TODO */
-{}

+ 0 - 2
plugins/interactive_statechart_simulator.js

@@ -1,2 +0,0 @@
-/* TODO */
-{}