[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[certi-cvs] certi/scripts GenerateMessages.py GenMsgAST.py ...
From: |
certi-cvs |
Subject: |
[certi-cvs] certi/scripts GenerateMessages.py GenMsgAST.py ... |
Date: |
Sun, 07 Mar 2010 18:22:03 +0000 |
CVSROOT: /sources/certi
Module name: certi
Changes by: Eric NOULARD <erk> 10/03/07 18:22:03
Modified files:
scripts : GenerateMessages.py GenMsgAST.py GenMsgCXX.py
Log message:
Handle messages which are not meant
to be send on their own (alone).
However they may appear as a field of to-be-sent message.
Those message are easy to filter out since they
do not merge from a base message.
As such they may not be created by the factory.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/certi/scripts/GenerateMessages.py?cvsroot=certi&r1=1.33&r2=1.34
http://cvs.savannah.gnu.org/viewcvs/certi/scripts/GenMsgAST.py?cvsroot=certi&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/certi/scripts/GenMsgCXX.py?cvsroot=certi&r1=1.4&r2=1.5
Patches:
Index: GenerateMessages.py
===================================================================
RCS file: /sources/certi/certi/scripts/GenerateMessages.py,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -b -r1.33 -r1.34
--- GenerateMessages.py 6 Mar 2010 12:55:10 -0000 1.33
+++ GenerateMessages.py 7 Mar 2010 18:22:03 -0000 1.34
@@ -19,7 +19,7 @@
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
## USA
##
-## $Id: GenerateMessages.py,v 1.33 2010/03/06 12:55:10 erk Exp $
+## $Id: GenerateMessages.py,v 1.34 2010/03/07 18:22:03 erk Exp $
## ----------------------------------------------------------------------------
"""
@@ -58,7 +58,6 @@
# see http://docs.python.org/library/logging.html
import logging
-
# Build some logger related objects
stdoutHandler = logging.StreamHandler(sys.stdout)
# See formatting there:
Index: GenMsgAST.py
===================================================================
RCS file: /sources/certi/certi/scripts/GenMsgAST.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- GenMsgAST.py 6 Mar 2010 12:55:10 -0000 1.3
+++ GenMsgAST.py 7 Mar 2010 18:22:03 -0000 1.4
@@ -17,7 +17,7 @@
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
## USA
##
-## $Id: GenMsgAST.py,v 1.3 2010/03/06 12:55:10 erk Exp $
+## $Id: GenMsgAST.py,v 1.4 2010/03/07 18:22:03 erk Exp $
## ----------------------------------------------------------------------------
"""
@@ -496,6 +496,10 @@
enumval.type = None
msgTypeEnumVals = [enumval]
for msg in AST.messages:
+ # We do not generate the enum factory entry for a message
+ # with no merge there is no possible factory for that
+ # kind of message.
+ if msg.hasMerge():
enumval = EnumType.EnumValue(msg.name.upper(),None)
enumval.type = msg.name
msgTypeEnumVals.append(enumval)
Index: GenMsgCXX.py
===================================================================
RCS file: /sources/certi/certi/scripts/GenMsgCXX.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- GenMsgCXX.py 6 Mar 2010 12:55:10 -0000 1.4
+++ GenMsgCXX.py 7 Mar 2010 18:22:03 -0000 1.5
@@ -17,7 +17,7 @@
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
## USA
##
-## $Id: GenMsgCXX.py,v 1.4 2010/03/06 12:55:10 erk Exp $
+## $Id: GenMsgCXX.py,v 1.5 2010/03/07 18:22:03 erk Exp $
## ----------------------------------------------------------------------------
"""
@@ -476,8 +476,9 @@
methodName = self.getSerializeMethodName(field.typeid.name)
if None == methodName:
if field.typeid.name in [m.name for m in self.AST.messages]:
- stream.write("<< \"FIXME inherited \";\n ")
- stream.write(self.commentLineBeginWith+" FIXME FIXME FIXME
inherited message\n")
+ stream.write("<< \"FIXME inherited \" ")
+
+ #stream.write(self.commentLineBeginWith+" FIXME FIXME FIXME
inherited message\n")
else:
stream.write("<< \"")
stream.write(self.getIndent()+self.commentLineBeginWith+"FIXME
FIXME don't know how to serialize native field <%s> of type
<%s>"%(field.name,field.typeid.name))
@@ -615,10 +616,12 @@
# Generate Constructor
stream.write(self.getIndent()+"%s::%s() {\n" %
(msg.name,msg.name))
self.indent()
+ if msg.hasMerge():
# Assign my name.
stream.write(self.getIndent()+"this->messageName =
\""+msg.name+"\";\n")
if (None!=self.replacePrefix):
stream.write(self.getIndent()+"this->type =
"+msg.name.upper().replace(self.replacePrefix[0],self.replacePrefix[1],1)+";\n")
+
# Write init value if any was provided
if len(msg.fields)>0:
self.applyToFields(stream, msg.fields,
self.writeInitFieldStatement)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [certi-cvs] certi/scripts GenerateMessages.py GenMsgAST.py ...,
certi-cvs <=