[Mobies-commit] [commit] r4239 - in UDM/trunk/src/Udm: . PythonAPIGen

endre at redhat3.isis.vanderbilt.edu endre at redhat3.isis.vanderbilt.edu
Mon Jan 13 13:29:59 CST 2014


Author: endre
Date: Mon Jan 13 13:29:58 2014
New Revision: 4239

Log:
Working on domain-specific python code generator

Modified:
   UDM/trunk/src/Udm/PythonAPIGen/PythonAPIGen.cpp
   UDM/trunk/src/Udm/Udm.cpp

Modified: UDM/trunk/src/Udm/PythonAPIGen/PythonAPIGen.cpp
==============================================================================
--- UDM/trunk/src/Udm/PythonAPIGen/PythonAPIGen.cpp	Mon Jan 13 13:29:53 2014	(r4238)
+++ UDM/trunk/src/Udm/PythonAPIGen/PythonAPIGen.cpp	Mon Jan 13 13:29:58 2014	(r4239)
@@ -47,8 +47,9 @@
 
   /*CREATE IMPORT*/
   m_output << "import sys" << endl;
+  m_output << "import udm" << endl;
   m_output << "import Uml" << endl;
-  m_output << "from UdmPython import *" << endl << endl;
+  //m_output << "from UdmPython import *" << endl << endl;
 
 
   /*GENERATE PYTHON CLASSES*/
@@ -107,8 +108,9 @@
 
 void PythonAPIGen::generateClass(::Uml::Class &cls)
 {
-	m_output << "class " << cls.name() << "(UdmPython):" << endl;
-	m_output << "\t\"\"\"Generated\"\"\"" << endl;
+	//m_output << "class " << cls.name() << "(UdmPython):" << endl;
+	m_output << "class " << cls.name() << "(udm.Object):" << endl;
+    m_output << "\t\"\"\"Generated\"\"\"" << endl;
 
 	generateAttributes(cls);
 	

Modified: UDM/trunk/src/Udm/Udm.cpp
==============================================================================
--- UDM/trunk/src/Udm/Udm.cpp	Mon Jan 13 13:29:53 2014	(r4238)
+++ UDM/trunk/src/Udm/Udm.cpp	Mon Jan 13 13:29:58 2014	(r4239)
@@ -43,6 +43,7 @@
 "  [default] Generate C++\n"
 //"  -s Generate C#\n"
 "  -j Generate Java\n"
+"  -p Generate Python\n"
 "  --leesa Generate C++ with support for generic programming\n"
 "\n"
 "  -t generate DTD\n"


More information about the Mobies-commit mailing list