Browse Source

Changed defaults in transformation rules to make sense. LHS and RHS conditions are set to 'result = True', RHS action to 'pass'. An action was added to NAC/LHS/RHS elements to set the value of RAMified attributes to 'result = True' or 'result = getAttr()' when they are connected to NAC/LHS or RHS, respectively. For this, a new methods called 'getAttrNames' was added to the metamodelling API

Simon Van Mierlo 9 years ago
parent
commit
b6cf7cc672

BIN
.manual/manual.pdf


+ 10 - 3
.manual/manual.tex

@@ -17,13 +17,13 @@
 
 
 %REF:: http://en.wikibooks.org/wiki/LaTeX/Customizing_LaTeX
-\newcommand{\versiondate}{2012/08/02}
-\newcommand{\version}{v0.19}
+\newcommand{\versiondate}{2016/08/31}
+\newcommand{\version}{v0.20}
 \newcommand{\TBC}{\textit{(To be completed) }}
 
 
 \title{\textbf{AToMPM User's Manual\footnote{This file has version number \version. Last revision is dated \versiondate.}}}
-\author{Rapha\"{e}l Mannadiar\\ (\texttt{raphael.mannadiar@mail.mcgill.ca})}
+\author{Rapha\"{e}l Mannadiar\\ (\texttt{raphael.mannadiar@mail.mcgill.ca}) \\ Simon Van Mierlo\\ (\texttt{simon.vanmierlo@uantwerpen.be})}
 \date{\versiondate}
 
 
@@ -683,6 +683,13 @@ Return the value of the given attribute from the given entity, specified via its
 \vspace*{1em}
 
 
+\addcontentsline{toc}{subsubsection}{\quad \texttt{function getAttrNames(\_id)}}
+\begin{center}	{\large \texttt{function getAttrNames(\_id)}} \end{center}
+
+Return all attribute names of the given entity, specified via its abstract syntax identifier.\\
+\vspace*{1em}
+
+
 \addcontentsline{toc}{subsubsection}{\quad \texttt{function getAllNodes([\_fulltypes])}}
 \begin{center}	{\large \texttt{function getAllNodes([\_fulltypes])}} \end{center}
 

BIN
manual.pdf


+ 8 - 0
mmmk.js

@@ -681,6 +681,14 @@ with AToMPM.  If not, see <http://www.gnu.org/licenses/>.
 				else
 					return self.model.nodes[_id][_attr]['value'];
 			}
+			function getAttrNames(_id)
+			{
+				if( _id == undefined )
+					_id = id;
+				if( self.model.nodes[_id] == undefined )
+					throw 'invalid getAttrNames() id :: '+_id;
+				return Object.getOwnPropertyNames(self.model.nodes[_id]);
+			}
 			function hasAttr(_attr,_id)
 			{
 				if( _id == undefined )

+ 126 - 72
users/(default)/Formalisms/__Transformations__/TransformationRule/TransformationRule.defaultIcons.metamodel

@@ -92,6 +92,52 @@
 									1
 								]
 							}
+						},
+						"13": {
+							"textContent": {
+								"type": "string",
+								"value": "<coded>"
+							},
+							"style": {
+								"type": "map<string,string>",
+								"value": {
+									"stroke": "#000000",
+									"stroke-dasharray": "",
+									"fill": "#000000",
+									"fill-opacity": 1,
+									"font-size": "20px",
+									"stroke-width": 1,
+									"arrow-start": "none",
+									"arrow-end": "none"
+								}
+							},
+							"mapper": {
+								"type": "code",
+								"value": "/* specify code that evaluates to an associative array of the form {...,csattr:val,...} */\n({'textContent': getAttr('name')})"
+							},
+							"parser": {
+								"type": "code",
+								"value": "/* specify code that evaluates to an associative array of the form {...,attr:val,...} */"
+							},
+							"$type": "/Formalisms/__LanguageSyntax__/ConcreteSyntax/ConcreteSyntax/Text",
+							"position": {
+								"type": "list<double>",
+								"value": [
+									4,
+									503
+								]
+							},
+							"orientation": {
+								"type": "double",
+								"value": 0
+							},
+							"scale": {
+								"type": "list<double>",
+								"value": [
+									1,
+									1
+								]
+							}
 						}
 					},
 					"edges": []
@@ -297,74 +343,6 @@
 				"default": "-1"
 			}
 		],
-		"PatternContentsLink": [
-			{
-				"name": "link-style",
-				"type": "map<string,string>",
-				"default": {
-					"stroke": "#00ff00",
-					"stroke-dasharray": "",
-					"stroke-opacity": 0.2,
-					"stroke-width": 1,
-					"arrow-start": "none",
-					"arrow-end": "classic-wide-long"
-				}
-			},
-			{
-				"name": "typename",
-				"type": "string",
-				"default": "PatternContentsLink"
-			},
-			{
-				"name": "position",
-				"type": "list<double>",
-				"default": [
-					1602,
-					100
-				]
-			},
-			{
-				"name": "orientation",
-				"type": "double",
-				"default": 0
-			},
-			{
-				"name": "scale",
-				"type": "list<double>",
-				"default": [
-					1,
-					1
-				]
-			},
-			{
-				"name": "mapper",
-				"type": "code",
-				"default": ""
-			},
-			{
-				"name": "parser",
-				"type": "code",
-				"default": ""
-			},
-			{
-				"name": "$contents",
-				"type": "map<string,*>",
-				"default": {
-					"nodes": {},
-					"edges": []
-				}
-			},
-			{
-				"name": "$asuri",
-				"type": "string",
-				"default": "-1"
-			},
-			{
-				"name": "$segments",
-				"type": "map<string,list<string>>",
-				"default": {}
-			}
-		],
 		"RHSImportIcon": [
 			{
 				"name": "typename",
@@ -461,6 +439,82 @@
 				"type": "string",
 				"default": "-1"
 			}
+		],
+		"PatternContentsLink": [
+			{
+				"name": "link-style",
+				"type": "map<string,string>",
+				"default": {
+					"stroke": "#000000",
+					"stroke-dasharray": "",
+					"stroke-opacity": 0,
+					"stroke-width": 0
+				}
+			},
+			{
+				"name": "arrowHead",
+				"type": "ENUM(circle-black,circle-black-large,circle-white,circle-white-large,diamond-black,diamond-black-large,diamond-white,diamond-white-large,triangle-black,triangle-black-large,triangle-white,triangle-white-large,arrow-black,arrow-black-large,arrow-empty,arrow-empty-large,custom)",
+				"default": "custom"
+			},
+			{
+				"name": "arrowTail",
+				"type": "ENUM(circle-black,circle-black-large,circle-white,circle-white-large,diamond-black,diamond-black-large,diamond-white,diamond-white-large,triangle-black,triangle-black-large,triangle-white,triangle-white-large,arrow-black,arrow-black-large,arrow-empty,arrow-empty-large,custom)",
+				"default": "arrow-black"
+			},
+			{
+				"name": "typename",
+				"type": "string",
+				"default": "PatternContentsLink"
+			},
+			{
+				"name": "position",
+				"type": "list<double>",
+				"default": [
+					1572,
+					173
+				]
+			},
+			{
+				"name": "orientation",
+				"type": "double",
+				"default": 0
+			},
+			{
+				"name": "scale",
+				"type": "list<double>",
+				"default": [
+					1,
+					1
+				]
+			},
+			{
+				"name": "mapper",
+				"type": "code",
+				"default": "/* specify code that evaluates to an associative array of the form {...,csattr:val,...} */"
+			},
+			{
+				"name": "parser",
+				"type": "code",
+				"default": "/* specify code that evaluates to an associative array of the form {...,attr:val,...} */"
+			},
+			{
+				"name": "$contents",
+				"type": "map<string,*>",
+				"default": {
+					"nodes": {},
+					"edges": []
+				}
+			},
+			{
+				"name": "$asuri",
+				"type": "string",
+				"default": "-1"
+			},
+			{
+				"name": "$segments",
+				"type": "map<string,list<string>>",
+				"default": {}
+			}
 		]
 	},
 	"constraints": [],
@@ -469,8 +523,8 @@
 		"NACIcon": [],
 		"LHSIcon": [],
 		"RHSIcon": [],
-		"PatternContentsLink": [],
-		"RHSImportIcon": []
+		"RHSImportIcon": [],
+		"PatternContentsLink": []
 	},
 	"legalConnections": {},
 	"connectorTypes": {},
@@ -478,7 +532,7 @@
 		"NACIcon": [],
 		"LHSIcon": [],
 		"RHSIcon": [],
-		"PatternContentsLink": [],
-		"RHSImportIcon": []
+		"RHSImportIcon": [],
+		"PatternContentsLink": []
 	}
 }

File diff suppressed because it is too large
+ 3107 - 260
users/(default)/Formalisms/__Transformations__/TransformationRule/TransformationRule.defaultIcons.model


File diff suppressed because it is too large
+ 21 - 3
users/(default)/Formalisms/__Transformations__/TransformationRule/TransformationRule.metamodel


File diff suppressed because it is too large
+ 24 - 6
users/(default)/Formalisms/__Transformations__/TransformationRule/TransformationRuleMM.model