diff --git a/scripts/GenMsgAST.py b/scripts/GenMsgAST.py
index 20168a4..8135fb9 100755
--- a/scripts/GenMsgAST.py
+++ b/scripts/GenMsgAST.py
@@ -1,4 +1,6 @@
+#!/usr/bin/python
 # -*- coding: utf-8 -*-
+
 ## ----------------------------------------------------------------------------
 ## CERTI - HLA RunTime Infrastructure
 ## Copyright (C) 2002-2005  ONERA
@@ -27,13 +29,18 @@ Generator AST classes.
 """
 
 import os
-import getopt, sys
+import getopt
+import sys
 import datetime
 import logging
+
 # Build some logger related objects
+
 stdoutHandler = logging.StreamHandler(sys.stdout)
-                                      
+
+
 class ASTElement(object):
+
     """
     The base class for all Abstract Syntax Tree element.
 
@@ -43,44 +50,62 @@ class ASTElement(object):
                     may be C{None}
     @type comment: C{CommentBlock}   
     """
-    
-    def __init__(self,name):        
-        self.__name     = name
-        self.__comment  = None
+
+    def __init__(self, name):
+        self.__name = name
+        self.__comment = None
         self.__linespan = None
-        self.logger = logging.Logger("ASTElement")
+        self.logger = logging.Logger('ASTElement')
         self.logger.setLevel(logging.ERROR)
         self.logger.addHandler(stdoutHandler)
-    
+
     def __getName(self):
-        return self.__name    
-    def __setName(self,name):        
+        return self.__name
+
+    def __setName(self, name):
         self.__name = name
-    # pythonic getter/setter using properties    
-    name = property(fget=__getName,fset=__setName,fdel=None, doc="The name of the C{ASTElement}")    
-    
+
+    # pythonic getter/setter using properties
+
+    name = property(fget=__getName, fset=__setName, fdel=None,
+                    doc='The name of the C{ASTElement}')
+
     def hasComment(self):
-        return self.__comment!=None
-    
+        return self.__comment != None
+
     def __getComment(self):
-        return self.__comment    
-    def __setComment(self,comment):
-        if isinstance(comment,type("")):
+        return self.__comment
+
+    def __setComment(self, comment):
+        if isinstance(comment, type('')):
             pass
         else:
-            self.logger.info("Adding comment %s to element %s" % (comment.lines,self.name))
+            self.logger.info('Adding comment %s to element %s'
+                             % (comment.lines, self.name))
             self.__comment = comment
-    # pythonic getter/setter using properties    
-    comment = property(fget=__getComment,fset=__setComment,fdel=None, doc="The comment block attached to the C{ASTElement}")
-    
+
+    # pythonic getter/setter using properties
+
+    comment = property(fget=__getComment, fset=__setComment, fdel=None,
+                       doc='The comment block attached to the C{ASTElement}'
+                       )
+
     def __getLinespan(self):
-        return self.__linespan    
-    def __setLinespan(self,linespan):        
+        return self.__linespan
+
+    def __setLinespan(self, linespan):
         self.__linespan = linespan
-    # pythonic getter/setter using properties    
-    linespan = property(fget=__getLinespan,fset=__setLinespan,fdel=None, doc="The line span of this C{ASTElement} in the original file")    
-    
+
+    # pythonic getter/setter using properties
+
+    linespan = property(fget=__getLinespan, fset=__setLinespan,
+                        fdel=None,
+                        doc='The line span of this C{ASTElement} in the original file'
+                        )
+
+
 class MessageAST(ASTElement):
+
     """
     Message Abstract Syntax Tree root class.
     
@@ -99,108 +124,140 @@ class MessageAST(ASTElement):
     @type messages: C{set} of C{MessageType}          
     
     """
-    def __init__(self,name):
-        super(MessageAST,self).__init__(name=os.path.basename(name))
-        self.__package            = None
-        self.__version            = None
-        self.__factory            = None
-        self.__nativeTypes        = []
-        self.__messageTypes       = []
-        self.__enumTypes          = []
+
+    def __init__(self, name):
+        super(MessageAST, self).__init__(name=os.path.basename(name))
+        self.__package = None
+        self.__version = None
+        self.__factory = None
+        self.__nativeTypes = []
+        self.__messageTypes = []
+        self.__enumTypes = []
+
         # The types dictionary is initialized with builtin types
-        self.__types                = {'onoff' : ASTElement("onoff"),
-                                       'bool' : ASTElement("bool"),
-                                       'string' : ASTElement("string"),
-                                       'byte' : ASTElement("byte"),
-                                       'int8' : ASTElement("int8"),
-                                       'uint8' : ASTElement("uint8"),
-                                       'int16' : ASTElement("int16"),
-                                       'uint16' : ASTElement("uint16"),
-                                       'int32' : ASTElement("int32"),
-                                       'uint32' : ASTElement("uint32"),   
-                                       'int64' : ASTElement("int64"),
-                                       'uint64' : ASTElement("uint64"),
-                                       'float' : ASTElement("float"),
-                                       'double' : ASTElement("double")}
-        self.__ultimateElement      = None                
-        self.logger = logging.Logger("MessageAST")
+
+        self.__types = {
+            'onoff': ASTElement('onoff'),
+            'bool': ASTElement('bool'),
+            'string': ASTElement('string'),
+            'byte': ASTElement('byte'),
+            'int8': ASTElement('int8'),
+            'uint8': ASTElement('uint8'),
+            'int16': ASTElement('int16'),
+            'uint16': ASTElement('uint16'),
+            'int32': ASTElement('int32'),
+            'uint32': ASTElement('uint32'),
+            'int64': ASTElement('int64'),
+            'uint64': ASTElement('uint64'),
+            'float': ASTElement('float'),
+            'double': ASTElement('double'),
+            }
+        self.__ultimateElement = None
+        self.logger = logging.Logger('MessageAST')
         self.logger.setLevel(logging.ERROR)
         self.logger.addHandler(stdoutHandler)
-        
+
     def hasPackage(self):
         return self.__package != None
+
     def __getPackage(self):
         return self.__package
-    def __setPackage(self,package):
+
+    def __setPackage(self, package):
         self.__package = package
-    # pythonic getter/setter using properties   
-    package = property(fget=__getPackage,fset=__setPackage,fdel=None,doc=None)
+
+    # pythonic getter/setter using properties
+
+    package = property(fget=__getPackage, fset=__setPackage, fdel=None,
+                       doc=None)
 
     def hasVersion(self):
         return self.__version != None
+
     def __getVersion(self):
         return self.__version
-    def __setVersion(self,version):
+
+    def __setVersion(self, version):
         self.__version = version
-    # pythonic getter/setter using properties   
-    version = property(fget=__getVersion,fset=__setVersion,fdel=None,doc=None)
+
+    # pythonic getter/setter using properties
+
+    version = property(fget=__getVersion, fset=__setVersion, fdel=None,
+                       doc=None)
 
     def hasFactory(self):
         return self.__factory != None
+
     def __getFactory(self):
         return self.__factory
-    def __setFactory(self,factory):
+
+    def __setFactory(self, factory):
         self.__factory = factory
-    # pythonic getter/setter using properties   
-    factory = property(fget=__getFactory,fset=__setFactory,fdel=None,doc=None)
-        
+
+    # pythonic getter/setter using properties
+
+    factory = property(fget=__getFactory, fset=__setFactory, fdel=None,
+                       doc=None)
+
     def __getNativeTypes(self):
-        return self.__nativeTypes  
-    # pythonic getter/setter using properties   
-    natives = property(fget=__getNativeTypes,fset=None,fdel=None,doc=None)
-    
+        return self.__nativeTypes
+
+    # pythonic getter/setter using properties
+
+    natives = property(fget=__getNativeTypes, fset=None, fdel=None,
+                       doc=None)
+
     def __getMessageTypes(self):
-        return self.__messageTypes  
-    # pythonic getter/setter using properties      
-    messages = property(fget=__getMessageTypes,fset=None,fdel=None,doc=None)
-    
-    def __getEnumTypes(self):    	    	
+        return self.__messageTypes
+
+    # pythonic getter/setter using properties
+
+    messages = property(fget=__getMessageTypes, fset=None, fdel=None,
+                        doc=None)
+
+    def __getEnumTypes(self):
         return self.__enumTypes
-    # pythonic getter/setter using properties   
-    enums = property(fget=__getEnumTypes,fset=None,fdel=None,doc=None)
-    
-    def getRootMergeType(self,msg,verbose=0):
-    	""" 
-    	Return the root merge type of a message.
-    	
-    	The idea is to find the root of the merge chain of
-    	the provided message. 
-    	@param msg: the message for which we want to know the root merge type
-    	@type any: more precisely either C{NativeType} or C{MessageType} however
-    	           only C{MessageType} may lead to a real search of the root.
-    	@return: the C{MessageType} root merge type or msg if msg wasn't an instance of C{MessageType}
-    	"""
-    	retval = None
-    	# msg may be a simple string not a type    	
-    	if (isinstance(msg,type(""))):
-    		current = self.getType(msg)
-    	else:
-    		current = msg
-    		
-    	while retval==None:
-    		if (verbose):
-    			print "current = %s, retval = %s" % (current,retval)
-    			print "type(current)=", type(current)    	    		    
-    	 	if isinstance(current,MessageType):
-    		  	if current.hasMerge():
-    		 	  current=self.getType(current.merge)
-    		 	else: 
-    		 	  retval = current
-    		else:
-    			retval = current   
+
+    # pythonic getter/setter using properties
+
+    enums = property(fget=__getEnumTypes, fset=None, fdel=None,
+                     doc=None)
+
+    def getRootMergeType(self, msg, verbose=0):
+        """ 
+    ....Return the root merge type of a message.
+    ....
+    ....The idea is to find the root of the merge chain of
+    ....the provided message. 
+    ....@param msg: the message for which we want to know the root merge type
+    ....@type any: more precisely either C{NativeType} or C{MessageType} however
+    ....           only C{MessageType} may lead to a real search of the root.
+    ....@return: the C{MessageType} root merge type or msg if msg wasn't an instance of C{MessageType}
+    ...."""
+
+        retval = None
+
+        # msg may be a simple string not a type    ....
+
+        if isinstance(msg, type('')):
+            current = self.getType(msg)
+        else:
+            current = msg
+
+        while retval == None:
+            if verbose:
+                print 'current = %s, retval = %s' % (current, retval)
+                print 'type(current)=', type(current)
+            if isinstance(current, MessageType):
+                if current.hasMerge():
+                    current = self.getType(current.merge)
+                else:
+                    retval = current
+            else:
+                retval = current
         return retval
-        
-    def add(self,any):
+
+    def add(self, any):
         """ 
         Add an ASTElement to the AST.
         
@@ -211,97 +268,118 @@ class MessageAST(ASTElement):
         @type any: some sub-class of C{ASTElement}, see: G{ASTElement}
           
         """
+
         if any == None:
-            self.logger.error("<None> given to AST some rule aren't finished")    
-        else:                     
-            self.logger.debug("Add %s %s" % (type(any).__name__,any.name))
+            self.logger.error("<None> given to AST some rule aren't finished"
+                              )
+        else:
+            self.logger.debug('Add %s %s' % (type(any).__name__,
+                              any.name))
+
             # Typename must be unique
-            if self.isDefined(any.name):                
-                self.logger.error("%s already defined in the AST" % any.name)
-                self.logger.error(" --> Check lines (%d,%d) " % any.linespan + "and (%d,%d)" % self.getType(any.name).linespan+ " of <%s>" % self.name)                          
-            elif isinstance(any,EnumType):            
-                self.addEnumType(any)                            
-            elif isinstance(any,NativeType):
+
+            if self.isDefined(any.name):
+                self.logger.error('%s already defined in the AST'
+                                  % any.name)
+                self.logger.error(' --> Check lines (%d,%d) '
+                                  % any.linespan + 'and (%d,%d)'
+                                  % self.getType(any.name).linespan
+                                  + ' of <%s>' % self.name)
+            elif isinstance(any, EnumType):
+                self.addEnumType(any)
+            elif isinstance(any, NativeType):
                 self.addNativeType(any)
-            elif isinstance(any,MessageType):
+            elif isinstance(any, MessageType):
                 self.addMessageType(any)
-            elif isinstance(any,Package):
+            elif isinstance(any, Package):
                 self.package = any
-            elif isinstance(any,Version):
+            elif isinstance(any, Version):
                 self.version = any
-            elif isinstance(any,Factory):
+            elif isinstance(any, Factory):
                 self.factory = any
+            elif isinstance(any, CommentBlock):
+
             # Handle comment block preceding other AST element
-            elif isinstance(any,CommentBlock):                
+
                 if self.__ultimateElement != None:
+
                     # attach the comment block to the preceding
                     # AST element (recursion is backtracking)
                     # The list of comment line should be reversed
+
                     any.lines.reverse()
                     self.__ultimateElement.comment = any
                 else:
-                    pass               
-            else:            
-                self.logger.error("<%s> not handle [yet]" % any)                   
-            self.__ultimateElement    = any            
-            
-    def addMessageType(self,message): 
+                    pass
+            else:
+                self.logger.error('<%s> not handle [yet]' % any)
+            self.__ultimateElement = any
+
+    def addMessageType(self, message):
         """
         Add a message type to the AST.
         
         @param message: The message type to be added
         @type message: C{MessageType}  
-        """       
+        """
+
         self.__messageTypes.append(message)
         self.__types[message.name] = message
-        
-    def addEnumType(self,enumType):
+
+    def addEnumType(self, enumType):
         """
         Add an enum type to the AST.
         
         @param enumType: The enum type to be added
         @type enumType: C{EnumType}  
-        """        
+        """
+
         self.__enumTypes.append(enumType)
-        self.__types[enumType.name] = enumType               
-    
-    def addNativeType(self,native):
+        self.__types[enumType.name] = enumType
+
+    def addNativeType(self, native):
         """
         Add a native type to the AST.
         
         @param native: The message type to be added
         @type native: C{NativeType}  
         """
+
         self.__nativeTypes.append(native)
         self.__types[native.name] = native
-        
-    def isDefined(self,typename):
+
+    def isDefined(self, typename):
         """
         Return true if the typename is know in this AST.
         
         @param typename: the name of the type
         @type typename: C{string}  
         """
-        return self.getType(typename)!=None        
-    
-    def getType(self,typename):
-        if isinstance(typename,type("")):
+
+        return self.getType(typename) != None
+
+    def getType(self, typename):
+        if isinstance(typename, type('')):
             if typename in self.__types.keys():
                 return self.__types[typename]
             else:
                 return None
         else:
-            return typename        
-    
+            return typename
+
     def __repr__(self):
-        res = "AST with <%d> native type(s), <%d> enum, <%d> message type(s)" % (len(self.natives),len(self.enums),len(self.messages))
-        if (self.hasFactory()):
-            res = res + " and factory <%s> "% self.factory.name
-        if (self.hasPackage()):
-            res = res + " in package <%s>" % self.package
-        return res    
-    
+        res = \
+            'AST with <%d> native type(s), <%d> enum, <%d> message type(s)' \
+            % (len(self.natives), len(self.enums), len(self.messages))
+        if self.hasFactory():
+            res = res + ' and factory <%s> ' % self.factory.name
+        if self.hasPackage():
+            res = res + ' in package <%s>' % self.package
+        return res
+
+
 class CommentBlock(ASTElement):
+
     """
     Represents a block of comment
     
@@ -309,21 +387,27 @@ class CommentBlock(ASTElement):
     @param lines: the comments lines
     @type lines: C{list} of C{string}  
     """
-    
-    def __init__(self,content,isAtEOL):
+
+    def __init__(self, content, isAtEOL):
         """
         C{CommentBlock} constructor
         """
-        super(CommentBlock,self).__init__(name="ANY Comment Block")
-        self.lines=[content]
-        self.__isAtEOL=isAtEOL
-        
+
+        super(CommentBlock, self).__init__(name='ANY Comment Block')
+        self.lines = [content]
+        self.__isAtEOL = isAtEOL
+
     def __getisAtEOL(self):
         return self.__isAtEOL
-    # pythonic getter/setter using properties   
-    isAtEOL = property(fget=__getisAtEOL,fset=None,fdel=None,doc="True if the comment is optional")   
-    
+
+    # pythonic getter/setter using properties
+
+    isAtEOL = property(fget=__getisAtEOL, fset=None, fdel=None,
+                       doc='True if the comment is optional')
+
+
 class Package(ASTElement):
+
     """
     Represents a package.
     
@@ -331,66 +415,82 @@ class Package(ASTElement):
     name is a C{string} containing a
     dot-separated IDs like: "fr.onera.certi"
     """
-    def __init__(self,name):        
-        super(Package,self).__init__(name)                        
-          
+
+    def __init__(self, name):
+        super(Package, self).__init__(name)
+
     def __repr__(self):
-        return "package %s" % self.name
+        return 'package %s' % self.name
+
 
 class Version(ASTElement):
+
     """
     Represents a version number.
     
     A C{Version} is a simple C{ASTElement} whose
     name is a C{string}.
     """
-    def __init__(self,number):
-        super(Version,self).__init__(name="Version")
+
+    def __init__(self, number):
+        super(Version, self).__init__(name='Version')
         self.number = number
-          
+
     def __repr__(self):
-        return "version %d.%d" % self.number
+        return 'version %d.%d' % self.number
+
 
 class Factory(ASTElement):
+
     """
     Represents a factory.
     
     A C{Factory} is anC{ASTElement} whose
     name is a C{string}.
     """
-    def __init__(self,name,creator,receiver=None):        
-        super(Factory,self).__init__(name)
-        self.creator  = creator
+
+    def __init__(
+        self,
+        name,
+        creator,
+        receiver=None,
+        ):
+        super(Factory, self).__init__(name)
+        self.creator = creator
         self.receiver = receiver
-	
+
     def hasFactoryCreator(self):
-	return self.creator != None
-    
+        return self.creator != None
+
     def hasFactoryReceiver(self):
-	return self.receiver != None
-          
+        return self.receiver != None
+
     def __repr__(self):
-        res="factory %s" % self.name
-        res=res+ ", creator = %s %s(%s)" % creator
-        res=res+ ", receiver = %s %s(%s)" % receiver
-        return res    
-     
+        res = 'factory %s' % self.name
+        res = res + ', creator = %s %s(%s)' % creator
+        res = res + ', receiver = %s %s(%s)' % receiver
+        return res
+
+
 class NativeType(ASTElement):
+
     """ 
     Represents a native message type.
     
     A C{NaptiveType} is a simple C{ASTElement} whose
     name is the name the native type.
     """
-    
-    def __init__(self,name,lines):
-        super(NativeType,self).__init__(name=name)
+
+    def __init__(self, name, lines):
+        super(NativeType, self).__init__(name=name)
+
         # store language line list in a dictionary
         # in order to ease retrieval
+
         self.languages = dict()
         self.representation = None
         for l in lines:
-            if isinstance(l,NativeType.LanguageLine):
+            if isinstance(l, NativeType.LanguageLine):
                 if l.name in self.languages.keys():
                     self.languages[l.name].append(l)
                 else:
@@ -398,42 +498,51 @@ class NativeType(ASTElement):
                     self.languages[l.name].append(l)
             else:
                 self.representation = l.representation
-        self.nbHeir	= 0
-        
+        self.nbHeir = 0
+
     def __repr__(self):
-        return "native %s" % self.name
-    
-    def hasLanguage(self,language):
-        return (language in self.languages.keys())
-    
-    def getLanguageLines(self,language):
+        return 'native %s' % self.name
+
+    def hasLanguage(self, language):
+        return language in self.languages.keys()
+
+    def getLanguageLines(self, language):
         if language in self.languages.keys():
             return self.languages[language]
-        
+
     def hasRepresentation(self):
         return self.representation != None
 
     def getRepresentation(self):
         return self.representation
-       
-	def hasHeir(self):
-		return self.nbHeir > 0
-     
+
+        def hasHeir(self):
+            return self.nbHeir > 0
+
+
     class LanguageLine(ASTElement):
+
         """ Represents a Language Line Value
         """
-        def __init__(self,name,value):
-            super(NativeType.LanguageLine,self).__init__(name=name)    
-            self.statement = value.strip("[]")                
+
+        def __init__(self, name, value):
+            super(NativeType.LanguageLine, self).__init__(name=name)
+            self.statement = value.strip('[]')
+
 
     class RepresentationLine(ASTElement):
+
         """ Represents a Representation Line Value
         """
-        def __init__(self,value):
-            super(NativeType.RepresentationLine,self).__init__(name='representation')
+
+        def __init__(self, value):
+            super(NativeType.RepresentationLine,
+                  self).__init__(name='representation')
             self.representation = value
-                    
+
+
 class MessageType(ASTElement):
+
     """ 
     Represents a message type.
     
@@ -443,216 +552,263 @@ class MessageType(ASTElement):
     @type merge: a C{MessageType}  
     @param combine: a combined set of fields
     """
-    def __init__(self,name,fields,merge):
-        super(MessageType,self).__init__(name=name)
-        self.fields        = fields
-        self.merge         = merge
-        self.enum          = None
-        self.nbHeir        = 0
-    
+
+    def __init__(
+        self,
+        name,
+        fields,
+        merge,
+        ):
+        super(MessageType, self).__init__(name=name)
+        self.fields = fields
+        self.merge = merge
+        self.enum = None
+        self.nbHeir = 0
+
     def __repr__(self):
-        res = "message %s " % self.name
+        res = 'message %s ' % self.name
         return res
-    
+
     def hasMerge(self):
         return self.merge != None
-    
+
     def hasEnum(self):
         return self.enum != None
-    
+
     def hasHeir(self):
-    	return self.nbHeir > 0
-    
+        return self.nbHeir > 0
+
+
     class CombinedField(ASTElement):
-        def __init__(self,typeid,fields):
-            super(MessageType.CombinedField,self).__init__(name="Combined")
+
+        def __init__(self, typeid, fields):
+            super(MessageType.CombinedField,
+                  self).__init__(name='Combined')
             self.typeid = typeid
-            self.fields = fields            
-    
+            self.fields = fields
+
+
     class MessageField(ASTElement):
+
         """ Represents a message field            
         """
-        def __init__(self,qualifier,typeid,name,defaultValue=None):
-            super(MessageType.MessageField,self).__init__(name=name)
-            self.qualifier    = qualifier
-            """ The field qualifier, which may be
-                 - repeated
-                 - optional
-                 - required 
-            """
-            self.typeid       = typeid
-            """ The type of the field
-            """
+
+        def __init__(
+            self,
+            qualifier,
+            typeid,
+            name,
+            defaultValue=None,
+            ):
+            super(MessageType.MessageField, self).__init__(name=name)
+            self.qualifier = qualifier
+            self.typeid = typeid
             self.defaultValue = defaultValue
-            """ The default value for this field
-            """
-            
+
         def hasDefaultValue(self):
             return self.defaultValue != None
-                
+
+
 class EnumType(ASTElement):
+
     """ Represents an enum type 
     """
-    def __init__(self,name,values):
-        super(EnumType,self).__init__(name=name)
-        # rebuild dictionary with value from the list                     
+
+    def __init__(self, name, values):
+        super(EnumType, self).__init__(name=name)
+
+        # rebuild dictionary with value from the list
+
         self.values = []
-        lastval     = -1        
-        for val in values:                                    
-            if (val.value==None):
-                val.value = lastval+1
+        lastval = -1
+        for val in values:
+            if val.value == None:
+                val.value = lastval + 1
                 self.values.append(val)
                 lastval += 1
             else:
-                self.values.append(val)                           
+                self.values.append(val)
                 lastval = val.value
-        
+
     def __repr__(self):
-        res = "Enum %s {\n" % self.name
-        for val in self.values:            
-            res = res + "  " + str(val[0]) + " = " + str(val[1]) + ", \n"
-        res = res + "}"
-        return res                 
-               
+        res = 'Enum %s {\n' % self.name
+        for val in self.values:
+            res = res + '  ' + str(val[0]) + ' = ' + str(val[1]) \
+                + ', \n'
+        res = res + '}'
+        return res
+
+
     class EnumValue(ASTElement):
+
         """ Represents an Enum Value
         """
-        def __init__(self,name,value):
-            super(EnumType.EnumValue,self).__init__(name=name)    
+
+        def __init__(self, name, value):
+            super(EnumType.EnumValue, self).__init__(name=name)
             self.value = value
-                
+
+
 class ASTChecker(object):
+
     """
     The Purpose of this class is to check AST properties. 
         
     """
+
     def __init__(self):
-        self.logger = logging.Logger("ASTChecker")
+        self.logger = logging.Logger('ASTChecker')
         self.logger.setLevel(logging.ERROR)
-        self.logger.addHandler(stdoutHandler)      
-    
-    def checkMessageFields(self,msg,AST):  
+        self.logger.addHandler(stdoutHandler)
+
+    def checkMessageFields(self, msg, AST):
         for f in msg.fields:
             if not AST.isDefined(f.typeid):
-                self.logger.fatal("The type <%s> used for field <%s.%s> is unknown (not a builtin, nor native, nor message)" % (f.typeid,msg.name,f.name))
-                self.logger.fatal(" --> Check lines (%d,%d)" % (f.linespan) + " of <%s>" % AST.name)                
+                self.logger.fatal('The type <%s> used for field <%s.%s> is unknown (not a builtin, nor native, nor message)'
+                                   % (f.typeid, msg.name, f.name))
+                self.logger.fatal(' --> Check lines (%d,%d)'
+                                  % f.linespan + ' of <%s>' % AST.name)
                 return False
             else:
-                if (isinstance(f,MessageType.MessageField)):                   
+                if isinstance(f, MessageType.MessageField):
                     f.typeid = AST.getType(f.typeid)
-                elif (isinstance(f,MessageType.CombinedField)):
-                    if (not self.checkMessageFields(f,AST)):
-			return False
+                elif isinstance(f, MessageType.CombinedField):
+                    if not self.checkMessageFields(f, AST):
+                        return False
                 else:
-                    self.logger.fatal("Unknown MessageField type %s" % f.str())
-		    return False
+                    self.logger.fatal('Unknown MessageField type %s'
+                            % f.str())
+                    return False
         return True
-   
-                
-    def check(self,AST):
+
+    def check(self, AST):
         """
         Check the AST.
         
         @param AST: the AST to be checked
         @type AST: C{MessageAST}  
         """
-        
+
         # Consider the AST not checked.
+
         AST.checked = False
-        
+
         # check if the supplied object has appropriate super type
         # @todo: note that we may just require to have the appropriate
         #        fields and not being sub-class of MesssageAST.
         #        this could be done with introspection.
         #        see: http://docs.python.org/library/inspect.html
+
         if not isinstance(AST, MessageAST):
-           self.logger.error("The supplied object is not an instance of MessageAST: <%s>" % type(AST))        
-           return
-       
+            self.logger.error('The supplied object is not an instance of MessageAST: <%s>'
+                               % type(AST))
+            return
+
         # check if all field used in message have known types
         # At the same time build the enum values for MessageTypes
-        enumval = EnumType.EnumValue("NOT_USED",None)
+
+        enumval = EnumType.EnumValue('NOT_USED', None)
         enumval.type = None
         msgTypeEnumVals = [enumval]
         lastMerge = None
         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.
             # However some message types may merge from one another
-            # as soon as there is a "common" root merge type 
+            # as soon as there is a "common" root merge type
+
             if msg.hasMerge():
-               parent = AST.getType(msg.merge)
-               parent.nbHeir += 1         
-               if (None!=lastMerge):
-               	   # recurse to find root merge
-               	   rootMerge = AST.getRootMergeType(msg.merge)             	                  	   
-                   if (lastMerge!=rootMerge):
-				   	  blah = AST.getRootMergeType(msg.merge,1)
-				   	  self.logger.error("Error: there is more than one merged type (%s != %s (root of %s)). You should use one merged type only" % (lastMerge,rootMerge,msg.merge))
-				   	  self.logger.fatal(" --> Check lines (%d,%d)" % (msg.linespan) + " of <%s>" % AST.name )
-				   	  return           
-               else:
-                   lastMerge = AST.getRootMergeType(msg.merge)
-                               
-               enumval      = EnumType.EnumValue(msg.name.upper(),None)            
-               enumval.type = msg.name
-               msgTypeEnumVals.append(enumval)		
-            if not self.checkMessageFields(msg,AST):
-            	return 
-	
-	
-	
-        enumval      = EnumType.EnumValue("LAST",None)
-        enumval.type = None                                    
+                parent = AST.getType(msg.merge)
+                parent.nbHeir += 1
+                if None != lastMerge:
+
+                      # recurse to find root merge
+
+                    rootMerge = AST.getRootMergeType(msg.merge)
+                    if lastMerge != rootMerge:
+                        blah = AST.getRootMergeType(msg.merge, 1)
+                        self.logger.error('Error: there is more than one merged type (%s != %s (root of %s)). You should use one merged type only'
+                                 % (lastMerge, rootMerge, msg.merge))
+                        self.logger.fatal(' --> Check lines (%d,%d)'
+                                % msg.linespan + ' of <%s>' % AST.name)
+                        return
+                else:
+                    lastMerge = AST.getRootMergeType(msg.merge)
+
+                enumval = EnumType.EnumValue(msg.name.upper(), None)
+                enumval.type = msg.name
+                msgTypeEnumVals.append(enumval)
+            if not self.checkMessageFields(msg, AST):
+                return
+
+        enumval = EnumType.EnumValue('LAST', None)
+        enumval.type = None
         msgTypeEnumVals.append(enumval)
-        AST.eMessageType = EnumType("MessageType",msgTypeEnumVals)
-	if lastMerge != None:
-            mergeClass=AST.getType(lastMerge)
-	    if isinstance(mergeClass,MessageType):
+        AST.eMessageType = EnumType('MessageType', msgTypeEnumVals)
+        if lastMerge != None:
+            mergeClass = AST.getType(lastMerge)
+            if isinstance(mergeClass, MessageType):
                 mergeClass.enum = AST.eMessageType
-	
-        
-         
 
         # @todo
         # Should check if the default value of a field
         # has the appropriate type (builtin types)
         # and that field with defined type have NO
         # default value
-                                
+
         # check if merger are either native or message
         # @todo should check that merger is not an enum
+
         for msg in AST.messages:
             if msg.hasMerge():
                 if not AST.isDefined(msg.merge):
-                    self.logger.fatal("The merge target <%s> of message <%s> is unknown (not a builtin, nor native, nor message)" % (msg.merge,msg.name))
-                    self.logger.fatal(" --> Check lines (%d,%d)" % (msg.linespan) + " of <%s>" % AST.name )                           
+                    self.logger.fatal('The merge target <%s> of message <%s> is unknown (not a builtin, nor native, nor message)'
+                             % (msg.merge, msg.name))
+                    self.logger.fatal(' --> Check lines (%d,%d)'
+                            % msg.linespan + ' of <%s>' % AST.name)
                     return
                 else:
                     msg.merge = AST.getType(msg.merge)
-                    
+
         # check the factory methods
-        if AST.factory.hasFactoryCreator():                        
+
+        if AST.factory.hasFactoryCreator():
             if not AST.isDefined(AST.factory.creator[0]):
-                self.logger.fatal("The return type <%s> of the creator factory method is unknown (not a builtin, nor native, nor message)" % AST.factory.creator[0])
-                self.logger.fatal(" --> Check lines (%d,%d)" % (AST.factory.linespan) + " of <%s>" % AST.name )                
+                self.logger.fatal('The return type <%s> of the creator factory method is unknown (not a builtin, nor native, nor message)'
+                                   % AST.factory.creator[0])
+                self.logger.fatal(' --> Check lines (%d,%d)'
+                                  % AST.factory.linespan + ' of <%s>'
+                                  % AST.name)
                 return
             if not AST.isDefined(AST.factory.creator[2]):
-                self.logger.fatal("The parameter type <%s> of the creator factory method is unknown (not a builtin, nor native, nor message)" % AST.factory.creator[2])
-                self.logger.fatal(" --> Check lines (%d,%d)" % (AST.factory.linespan) + " of <%s>" % AST.name )    
-		
-		return
-	    
-	if AST.factory.hasFactoryReceiver():
+                self.logger.fatal('The parameter type <%s> of the creator factory method is unknown (not a builtin, nor native, nor message)'
+                                   % AST.factory.creator[2])
+                self.logger.fatal(' --> Check lines (%d,%d)'
+                                  % AST.factory.linespan + ' of <%s>'
+                                  % AST.name)
+
+                return
+
+        if AST.factory.hasFactoryReceiver():
             if not AST.isDefined(AST.factory.receiver[0]):
-                self.logger.fatal("The return type <%s> of the receiver factory method is unknown (not a builtin, nor native, nor message)" % AST.factory.receiver[0])
-                self.logger.fatal(" --> Check lines (%d,%d)" % (AST.factory.linespan) + " of <%s>" % AST.name )                
+                self.logger.fatal('The return type <%s> of the receiver factory method is unknown (not a builtin, nor native, nor message)'
+                                   % AST.factory.receiver[0])
+                self.logger.fatal(' --> Check lines (%d,%d)'
+                                  % AST.factory.linespan + ' of <%s>'
+                                  % AST.name)
                 return
             if not AST.isDefined(AST.factory.receiver[2]):
-                self.logger.fatal("The parameter type <%s> of the receiver factory method is unknown (not a builtin, nor native, nor message)" % AST.factory.receiver[2])
-                self.logger.fatal(" --> Check lines (%d,%d)" % (AST.factory.linespan) + " of <%s>" % AST.name )                
+                self.logger.fatal('The parameter type <%s> of the receiver factory method is unknown (not a builtin, nor native, nor message)'
+                                   % AST.factory.receiver[2])
+                self.logger.fatal(' --> Check lines (%d,%d)'
+                                  % AST.factory.linespan + ' of <%s>'
+                                  % AST.name)
                 return
+
         # Now the AST has been checked successfully
-        AST.checked = True                  
-                                                                                 
+
+        AST.checked = True
+
+
diff --git a/scripts/GenMsgBase.py b/scripts/GenMsgBase.py
index 9731b84..cb4f8ad 100644
--- a/scripts/GenMsgBase.py
+++ b/scripts/GenMsgBase.py
@@ -1,3 +1,5 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
 ## ----------------------------------------------------------------------------
 ## CERTI - HLA RunTime Infrastructure
 ## Copyright (C) 2002-2005  ONERA
@@ -20,87 +22,94 @@
 ## $Id: GenMsgBase.py,v 1.5 2010/05/16 08:40:18 erk Exp $
 ## ----------------------------------------------------------------------------
 
+# We use logging for ... logging :-)
+# see http://docs.python.org/library/logging.html
+
 """
 The CERTI Message Generator.
 Generator Base class
 """
 
-# We use logging for ... logging :-)
-# see http://docs.python.org/library/logging.html
 import logging
-import sys 
+import sys
 import datetime
 import GenMsgAST
-    
+
+
 class CodeGenerator(object):
+
     """
     This is a base class generator for C{MessageAST}.
     
     This is not a working generator it should be subclassed. 
     """
-    
+
     def generatorName(cls):
-        raise  Exception("This class method should be overloaded by daughter class <"+cls.__name__+">")    
+        raise Exception('This class method should be overloaded by daughter class <'
+                         + cls.__name__ + '>')
+
     generatorName = classmethod(generatorName)
-    
-    def __init__(self,MessageAST,commentLineBeginWith):
+
+    def __init__(self, MessageAST, commentLineBeginWith):
         self.AST = MessageAST
         self.commentLineBeginWith = commentLineBeginWith
-        self.logger = logging.Logger(self.generatorName()+"Generator")
+        self.logger = logging.Logger(self.generatorName() + 'Generator')
         self.logger.setLevel(logging.ERROR)
         self.logger.addHandler(logging.StreamHandler(sys.stdout))
-        self.__indentString = "   "
-        self.__indentLevel  = 0
-        self.builtinTypeMap = {'onoff'    : 'onoff',
-                               'bool'     : 'bool',
-                               'string'   : 'string',
-                               'byte'     : 'byte',
-                               'int8'     : 'int8',
-                               'uint8'    : 'uint8',
-                               'int16'    : 'int16',
-                               'uint16'   : 'uint16',
-                               'int32'    : 'int32',
-                               'uint32'   : 'uint32',   
-                               'int64'    : 'int64',
-                               'uint64'   : 'uint64',
-                               'float'    : 'float',
-                               'double'   : 'double',}
-
-    def setIndentString(self,indentString):
+        self.__indentString = '   '
+        self.__indentLevel = 0
+        self.builtinTypeMap = {
+            'onoff': 'onoff',
+            'bool': 'bool',
+            'string': 'string',
+            'byte': 'byte',
+            'int8': 'int8',
+            'uint8': 'uint8',
+            'int16': 'int16',
+            'uint16': 'uint16',
+            'int32': 'int32',
+            'uint32': 'uint32',
+            'int64': 'int64',
+            'uint64': 'uint64',
+            'float': 'float',
+            'double': 'double',
+            }
+
+    def setIndentString(self, indentString):
         self.__indentString = indentString
-        
+
     def indent(self):
-        self.__indentLevel += 1            
-        
+        self.__indentLevel += 1
+
     def unIndent(self):
-        if self.__indentLevel>0:
+        if self.__indentLevel > 0:
             self.__indentLevel -= 1
         else:
-            self.logger.error("Trying to unIndent lower than 0!??!")
-            
+            self.logger.error('Trying to unIndent lower than 0!??!')
+
     def getIndent(self):
-        res=""
+        res = ''
         i = self.__indentLevel
-        while i>0:
-             res = res + self.__indentString
-             i -= 1
+        while i > 0:
+            res = res + self.__indentString
+            i -= 1
         return res
-    
-    def getTargetTypeName(self,name):
+
+    def getTargetTypeName(self, name):
         if name in self.builtinTypeMap.keys():
             return self.builtinTypeMap[name]
         else:
             return name
-    
-    def lowerFirst(self,str):
-        res = str[0].lower()+str[1:]
+
+    def lowerFirst(self, str):
+        res = str[0].lower() + str[1:]
         return res
-        
-    def upperFirst(self,str):
-        res = str[0].upper()+str[1:]
-        return res        
-        
-    def writeComment(self,stream,ASTElement):
+
+    def upperFirst(self, str):
+        res = str[0].upper() + str[1:]
+        return res
+
+    def writeComment(self, stream, ASTElement):
         """
         Write a comment block to the stream.
         
@@ -108,137 +117,189 @@ class CodeGenerator(object):
         language has whole line comment support
         with some beginning characters.
         """
+
         if ASTElement.hasComment():
             for line in ASTElement.comment.lines:
+
                 # we should not indent optional comment
                 # since they come at the end of a line
-                if not ASTElement.comment.isAtEOL:                
-                    stream.write(self.getIndent())                
+
+                if not ASTElement.comment.isAtEOL:
+                    stream.write(self.getIndent())
                 stream.write(self.commentLineBeginWith)
                 stream.write(str(line))
-                stream.write("\n")
-        else:            
-            stream.write("\n")        
-    
-    def generateHeader(self,stream,factoryOnly=False):
+                stream.write('\n')
+        else:
+            stream.write('\n')
+
+    def generateHeader(self, stream, factoryOnly=False):
         """
         Generate the header.
         """
-        self.logger.error("generateHeader not IMPLEMENTED")
-    
-    def generateBody(self,stream,factoryOnly=False):
+
+        self.logger.error('generateHeader not IMPLEMENTED')
+
+    def generateBody(self, stream, factoryOnly=False):
         """
         Generate the body.
         """
-        self.logger.error("generateBody not IMPLEMENTED")            
-    
-    def generate(self,stream,what,factoryOnly=False):        
+
+        self.logger.error('generateBody not IMPLEMENTED')
+
+    def generate(
+        self,
+        stream,
+        what,
+        factoryOnly=False,
+        ):
         stream.write(self.commentLineBeginWith)
-        stream.write(" Generated on %s by the CERTI message generator\n"%datetime.datetime.now().strftime("%Y %B %a, %d at %H:%M:%S"))
-        if what.lower() == "header":
-            self.generateHeader(stream,factoryOnly)
-        elif what.lower() == "body":
-            self.generateBody(stream,factoryOnly)
+        stream.write(' Generated on %s by the CERTI message generator\n'
+
+                     % datetime.datetime.now().strftime('%Y %B %a, %d at %H:%M:%S'
+                     ))
+        if what.lower() == 'header':
+            self.generateHeader(stream, factoryOnly)
+        elif what.lower() == 'body':
+            self.generateBody(stream, factoryOnly)
         else:
-            self.logger.error("What <%s> unknown type??"%what)
-    
+            self.logger.error('What <%s> unknown type??' % what)
+
+
 class MsgSpecGenerator(CodeGenerator):
+
     """
     This is a text generator for C{MessageAST}.
     
     This generator should produce almost the same output
     as the input message specification file. 
     """
-    
+
     def generatorName(cls):
-        return "MsgSpec"    
+        return 'MsgSpec'
+
     generatorName = classmethod(generatorName)
-    
-    def __init__(self,MessageAST):
-        super(MsgSpecGenerator,self).__init__(MessageAST,"//")
-        self.logger = logging.Logger("MsgSpecGenerator")
+
+    def __init__(self, MessageAST):
+        super(MsgSpecGenerator, self).__init__(MessageAST, '//')
+        self.logger = logging.Logger('MsgSpecGenerator')
         self.logger.setLevel(logging.ERROR)
         self.logger.addHandler(logging.StreamHandler(sys.stdout))
-        self.__languageName = "MsgSpec"
-                        
-    def generate(self,stream,what,factoryOnly=False):
+        self.__languageName = 'MsgSpec'
+
+    def generate(
+        self,
+        stream,
+        what,
+        factoryOnly=False,
+        ):
         """
         Redefine super.generate.
         
         what is not important in this case.
         """
-        # Generate package 
+
+        # Generate package
+
         if self.AST.hasPackage():
             self.writeComment(stream, self.AST.package)
-            stream.write("package %s\n" % self.AST.package.name)
-	# Generate version
-	if self.AST.hasVersion():
-	    self.writeComment(stream, self.AST.version)
-	    stream.write("version %d.%d\n" % self.AST.version.number)
+            stream.write('package %s\n' % self.AST.package.name)
+
+    # Generate version
+
+        if self.AST.hasVersion():
+            self.writeComment(stream, self.AST.version)
+            stream.write('version %d.%d\n' % self.AST.version.number)
 
         if not factoryOnly:
+
             # Generate native type
-            for native in self.AST.natives:            
+
+            for native in self.AST.natives:
                 self.writeComment(stream, native)
-                stream.write("native %s {\n" % native.name)
+                stream.write('native %s {\n' % native.name)
                 self.indent()
-                if (native.hasRepresentation()):
-                    stream.write(self.getIndent()+ "representation " + native.getRepresentation()+"\n")
-                for (k,v) in native.languages.items():
+                if native.hasRepresentation():
+                    stream.write(self.getIndent() + 'representation '
+                                 + native.getRepresentation() + '\n')
+                for (k, v) in native.languages.items():
                     for l in v:
-                        stream.write(self.getIndent()+"language " +  k + "     ["+l.statement+"]\n")
+                        stream.write(self.getIndent() + 'language ' + k
+                                + '     [' + l.statement + ']\n')
                 self.unIndent()
-                stream.write("}\n")
-                                
+                stream.write('}\n')
+
             # Generate enum
+
             for enum in self.AST.enums:
                 self.writeComment(stream, enum)
-                stream.write("enum %s {\n" % enum.name)
+                stream.write('enum %s {\n' % enum.name)
                 first = True
                 self.indent()
-                for enumval in enum.values:                
+                for enumval in enum.values:
                     if first:
-                        stream.write(self.getIndent()+"%s = %d, " % (enumval.name,enumval.value))                
-                        first=False
+                        stream.write(self.getIndent() + '%s = %d, '
+                                % (enumval.name, enumval.value))
+                        first = False
                     else:
-                        stream.write(self.getIndent()+"%s, " % enumval.name)
+                        stream.write(self.getIndent() + '%s, '
+                                % enumval.name)
                     self.writeComment(stream, enumval)
-                self.unIndent()                    
-                stream.write("}\n\n")                                
-                 
+                self.unIndent()
+                stream.write('''}
+
+''')
+
             # Generate message type
+
             for msg in self.AST.messages:
                 self.writeComment(stream, msg)
-                stream.write("message %s"%msg.name)
+                stream.write('message %s' % msg.name)
                 if msg.hasMerge():
-                    stream.write(" : merge %s {\n" % msg.merge.name)
+                    stream.write(' : merge %s {\n' % msg.merge.name)
                 else:
-                    stream.write(" {\n")
-                
+                    stream.write(' {\n')
+
                 for field in msg.fields:
-                    if (isinstance(field, GenMsgAST.MessageType.CombinedField)):
-                        stream.write("        combined %s {" % (field.typeid))
+                    if isinstance(field,
+                                  GenMsgAST.MessageType.CombinedField):
+                        stream.write('        combined %s {'
+                                % field.typeid)
                         self.writeComment(stream, field)
                         for cfield in field.fields:
-                            stream.write("            %s %s %s " % (cfield.qualifier,cfield.typeid.name,cfield.name))
+                            stream.write('            %s %s %s '
+                                    % (cfield.qualifier,
+                                    cfield.typeid.name, cfield.name))
                             if cfield.hasDefaultValue():
-                                stream.write("[default=%s] " % cfield.defaultValue)                                    
+                                stream.write('[default=%s] '
+                                        % cfield.defaultValue)
                             self.writeComment(stream, cfield)
-                        stream.write("        }\n")    
+                        stream.write('        }\n')
                     else:
-                        stream.write("        %s %s %s " % (field.qualifier,field.typeid.name,field.name))
+                        stream.write('        %s %s %s '
+                                % (field.qualifier, field.typeid.name,
+                                field.name))
                         if field.hasDefaultValue():
-                            stream.write("[default=%s] " % field.defaultValue)                                    
-                        self.writeComment(stream, field)                    
-                stream.write("}\n\n")
-            
+                            stream.write('[default=%s] '
+                                    % field.defaultValue)
+                        self.writeComment(stream, field)
+                stream.write('''}
+
+''')
+
         # Generate Factory
+
         if self.AST.hasFactory():
             self.writeComment(stream, self.AST.factory)
-            stream.write("factory %s {\n" % self.AST.factory.name)
+            stream.write('factory %s {\n' % self.AST.factory.name)
             self.indent()
-            stream.write(self.getIndent()+"factoryCreator %s %s(%s)\n"% self.AST.factory.creator)
-            stream.write(self.getIndent()+"factoryReceiver %s %s(%s)\n"% self.AST.factory.receiver)
+            stream.write(self.getIndent() + 'factoryCreator %s %s(%s)\n'
+                          % self.AST.factory.creator)
+            stream.write(self.getIndent()
+                         + 'factoryReceiver %s %s(%s)\n'
+                         % self.AST.factory.receiver)
             self.unIndent()
-            stream.write("}\n\n")
-                                                                                 
+            stream.write('''}
+
+''')
+
+
diff --git a/scripts/GenMsgCXX.py b/scripts/GenMsgCXX.py
index 24fe7f7..cd9971a 100644
--- a/scripts/GenMsgCXX.py
+++ b/scripts/GenMsgCXX.py
@@ -1,4 +1,6 @@
+#!/usr/bin/python
 # -*- coding: utf-8 -*-
+
 ## ----------------------------------------------------------------------------
 ## CERTI - HLA RunTime Infrastructure
 ## Copyright (C) 2002-2005  ONERA
@@ -25,88 +27,97 @@
 The CERTI Message Generator.
 C++ Backend Generator
 """
+
 import logging
 import GenMsgAST
-import GenMsgBase    
+import GenMsgBase
 import sys
-import os   
-            
-class CXXCERTIGenerator(GenMsgBase.CodeGenerator):    
+import os
+
+
+class CXXCERTIGenerator(GenMsgBase.CodeGenerator):
+
     """
     This is a C++ generator for C{MessageAST}.
     
     """
-    
+
     def generatorName(cls):
-        return "CXX"
+        return 'CXX'
+
     generatorName = classmethod(generatorName)
-    
-    
-    def __init__(self,MessageAST):
-        super(CXXCERTIGenerator,self).__init__(MessageAST,"//")
+
+    def __init__(self, MessageAST):
+        super(CXXCERTIGenerator, self).__init__(MessageAST, '//')
         self.included = dict()
         self.typedefed = dict()
-        self.builtinTypeMap = {'onoff'    : 'bool',
-                               'bool'     : 'bool',
-                               'string'   : 'std::string',
-                               'byte'     : 'uint8_t',
-                               'int8'     : 'int8_t',
-                               'uint8'    : 'uint8_t',
-                               'int16'    : 'int16_t',
-                               'uint16'   : 'uint16_t',
-                               'int32'    : 'int32_t',
-                               'uint32'   : 'uint32_t',   
-                               'int64'    : 'int64_t',
-                               'uint64'   : 'uint64_t',
-                               'float'    : 'float',
-                               'double'   : 'double',}
-        self.serializeTypeMap = {'onoff'    : 'write_bool',
-                               'bool'     : 'write_bool',
-                               'string'   : 'write_string',
-                               'byte'     : 'write_byte',
-                               'int8'     : 'write_int8',
-                               'uint8'    : 'write_uint8',
-                               'int16'    : 'write_int16',
-                               'uint16'   : 'write_uint16',
-                               'int32'    : 'write_int32',
-                               'uint32'   : 'write_uint32',   
-                               'int64'    : 'write_int64',
-                               'uint64'   : 'write_uint64',
-                               'float'    : 'write_float',
-                               'double'   : 'write_double',}
-        self.deserializeTypeMap = {'onoff'    : 'read_bool',
-                               'bool'     : 'read_bool',
-                               'string'   : 'read_string',
-                               'byte'     : 'read_byte',
-                               'int8'     : 'read_int8',
-                               'uint8'    : 'read_uint8',
-                               'int16'    : 'read_int16',
-                               'uint16'   : 'read_uint16',
-                               'int32'    : 'read_int32',
-                               'uint32'   : 'read_uint32',   
-                               'int64'    : 'read_int64',
-                               'uint64'   : 'read_uint64',
-                               'float'    : 'read_float',
-                               'double'   : 'read_double',}
-        self.__languageName="C++"
+        self.builtinTypeMap = {
+            'onoff': 'bool',
+            'bool': 'bool',
+            'string': 'std::string',
+            'byte': 'uint8_t',
+            'int8': 'int8_t',
+            'uint8': 'uint8_t',
+            'int16': 'int16_t',
+            'uint16': 'uint16_t',
+            'int32': 'int32_t',
+            'uint32': 'uint32_t',
+            'int64': 'int64_t',
+            'uint64': 'uint64_t',
+            'float': 'float',
+            'double': 'double',
+            }
+        self.serializeTypeMap = {
+            'onoff': 'write_bool',
+            'bool': 'write_bool',
+            'string': 'write_string',
+            'byte': 'write_byte',
+            'int8': 'write_int8',
+            'uint8': 'write_uint8',
+            'int16': 'write_int16',
+            'uint16': 'write_uint16',
+            'int32': 'write_int32',
+            'uint32': 'write_uint32',
+            'int64': 'write_int64',
+            'uint64': 'write_uint64',
+            'float': 'write_float',
+            'double': 'write_double',
+            }
+        self.deserializeTypeMap = {
+            'onoff': 'read_bool',
+            'bool': 'read_bool',
+            'string': 'read_string',
+            'byte': 'read_byte',
+            'int8': 'read_int8',
+            'uint8': 'read_uint8',
+            'int16': 'read_int16',
+            'uint16': 'read_uint16',
+            'int32': 'read_int32',
+            'uint32': 'read_uint32',
+            'int64': 'read_int64',
+            'uint64': 'read_uint64',
+            'float': 'read_float',
+            'double': 'read_double',
+            }
+        self.__languageName = 'C++'
         self.replacePrefix = None
-        self.exportPrefix = ""
-        self.serializeBufferType = "libhla::MessageBuffer"
-        self.messageTypeGetter = "getType()"
-        self.exception = ["std::string"]
+        self.exportPrefix = ''
+        self.serializeBufferType = 'libhla::MessageBuffer'
+        self.messageTypeGetter = 'getType()'
+        self.exception = ['std::string']
 
-    def getTargetTypeName(self,name):
+    def getTargetTypeName(self, name):
         if name in self.builtinTypeMap.keys():
             return self.builtinTypeMap[name]
         else:
-            t=self.AST.getType(name)
-        if isinstance(t,GenMsgAST.EnumType):
-            prefix=self.AST.name.split(".")[0]+"::"
-            return prefix+name
+            t = self.AST.getType(name)
+        if isinstance(t, GenMsgAST.EnumType):
+            prefix = self.AST.name.split('.')[0] + '::'
+            return prefix + name
         else:
             return name
 
-    def getRepresentationFor(self,name):
+    def getRepresentationFor(self, name):
         for native in self.AST.natives:
             if name == native.name:
                 representation = native.getRepresentation()
@@ -114,7 +125,7 @@ class CXXCERTIGenerator(GenMsgBase.CodeGenerator):
                     return representation
         return None
 
-    def getSerializeMethodName(self,name):
+    def getSerializeMethodName(self, name):
         if name in self.serializeTypeMap.keys():
             return self.serializeTypeMap[name]
         else:
@@ -122,720 +133,1042 @@ class CXXCERTIGenerator(GenMsgBase.CodeGenerator):
             if representation:
                 return self.getSerializeMethodName(representation)
         return None
-        
-    def getDeSerializeMethodName(self,name):
+
+    def getDeSerializeMethodName(self, name):
         if name in self.deserializeTypeMap.keys():
             return self.deserializeTypeMap[name]
         else:
             representation = self.getRepresentationFor(name)
             if representation:
                 return self.getDeSerializeMethodName(representation)
-        return None    
-            
-    def openNamespaces(self,stream):
+        return None
+
+    def openNamespaces(self, stream):
         if self.AST.hasPackage():
             self.writeComment(stream, self.AST.package)
+
             # we may have nested namespace
-            nameSpaceList = self.AST.package.name.split(".")            
+
+            nameSpaceList = self.AST.package.name.split('.')
             for ns in nameSpaceList:
-                stream.write(self.getIndent()+"namespace %s {\n\n" % ns)
+                stream.write(self.getIndent() + '''namespace %s {
+
+'''
+                             % ns)
                 self.indent()
-                
-    def closeNamespaces(self, stream):        
+
+    def closeNamespaces(self, stream):
         if self.AST.hasPackage():
+
             # we may have nested namespace
-            nameSpaceList = self.AST.package.name.split(".")
+
+            nameSpaceList = self.AST.package.name.split('.')
             nameSpaceList.reverse()
             for ns in nameSpaceList:
                 self.unIndent()
-                stream.write(self.getIndent()+"} "+self.commentLineBeginWith+" end of namespace %s \n" % ns)
-                
-    def writeOneGetterSetter(self,stream,field):
-        
+                stream.write(self.getIndent() + '} '
+                             + self.commentLineBeginWith
+                             + ' end of namespace %s \n' % ns)
+
+    def writeOneGetterSetter(self, stream, field):
+
         targetTypeName = self.getTargetTypeName(field.typeid.name)
-        
-        if field.typeid.name == "onoff":
-            if field.qualifier == "repeated":
+
+        if field.typeid.name == 'onoff':
+            if field.qualifier == 'repeated':
                 stream.write(self.getIndent())
-                stream.write("uint32_t get"+self.upperFirst(field.name)+"Size() const")
-                stream.write(" {return "+field.name+".size();}\n")
+                stream.write('uint32_t get'
+                             + self.upperFirst(field.name)
+                             + 'Size() const')
+                stream.write(' {return ' + field.name + '.size();}\n')
 
                 stream.write(self.getIndent())
-                stream.write("void set"+self.upperFirst(field.name)+"Size(uint32_t num)")
-                stream.write(" {"+field.name+".resize(num);}\n")
-                
+                stream.write('void set' + self.upperFirst(field.name)
+                             + 'Size(uint32_t num)')
+                stream.write(' {' + field.name + '.resize(num);}\n')
+
                 stream.write(self.getIndent())
-                stream.write("const std::vector<"+targetTypeName+">& get"+self.upperFirst(field.name)+"() const")
-                stream.write(" {return "+field.name+";}\n")
+                stream.write('const std::vector<' + targetTypeName
+                             + '>& get' + self.upperFirst(field.name)
+                             + '() const')
+                stream.write(' {return ' + field.name + ';}\n')
 
                 stream.write(self.getIndent())
-                stream.write("void "+field.name+"On(uint32_t rank)")
-                stream.write(" {"+field.name+"[rank] = true;}\n")
-            
+                stream.write('void ' + field.name + 'On(uint32_t rank)')
+                stream.write(' {' + field.name + '[rank] = true;}\n')
+
                 stream.write(self.getIndent())
-                stream.write("void "+field.name+"Off(uint32_t rank)")
-                stream.write(" {"+field.name+"[rank] = false;}\n")
-        
+                stream.write('void ' + field.name + 'Off(uint32_t rank)'
+                             )
+                stream.write(' {' + field.name + '[rank] = false;}\n')
+
                 stream.write(self.getIndent())
-                stream.write(targetTypeName+ " is"+self.upperFirst(field.name)+"On(uint32_t rank) const")
-                stream.write(" {return "+field.name+"[rank];}\n")
+                stream.write(targetTypeName + ' is'
+                             + self.upperFirst(field.name)
+                             + 'On(uint32_t rank) const')
+                stream.write(' {return ' + field.name + '[rank];}\n')
             else:
                 stream.write(self.getIndent())
-                stream.write("void "+field.name+"On()")
-                stream.write(" {"+field.name+" = true;}\n")
-            
+                stream.write('void ' + field.name + 'On()')
+                stream.write(' {' + field.name + ' = true;}\n')
+
                 stream.write(self.getIndent())
-                stream.write("void "+field.name+"Off()")
-                stream.write(" {"+field.name+" = false;}\n")
-        
+                stream.write('void ' + field.name + 'Off()')
+                stream.write(' {' + field.name + ' = false;}\n')
+
                 stream.write(self.getIndent())
-                stream.write(targetTypeName+ " is"+self.upperFirst(field.name)+"On() const")
-                stream.write(" {return "+field.name+";}\n")
+                stream.write(targetTypeName + ' is'
+                             + self.upperFirst(field.name)
+                             + 'On() const')
+                stream.write(' {return ' + field.name + ';}\n')
         else:
-            if field.qualifier == "repeated":
+            if field.qualifier == 'repeated':
                 stream.write(self.getIndent())
-                stream.write("uint32_t get"+self.upperFirst(field.name)+"Size() const")
-                stream.write(" {return "+field.name+".size();}\n")
+                stream.write('uint32_t get'
+                             + self.upperFirst(field.name)
+                             + 'Size() const')
+                stream.write(' {return ' + field.name + '.size();}\n')
 
                 stream.write(self.getIndent())
-                stream.write("void set"+self.upperFirst(field.name)+"Size(uint32_t num)")
-                stream.write(" {"+field.name+".resize(num);}\n")
-                
+                stream.write('void set' + self.upperFirst(field.name)
+                             + 'Size(uint32_t num)')
+                stream.write(' {' + field.name + '.resize(num);}\n')
+
                 stream.write(self.getIndent())
-                stream.write("const std::vector<"+targetTypeName+">& get"+self.upperFirst(field.name)+"() const")
-                stream.write(" {return "+field.name+";}\n")
+                stream.write('const std::vector<' + targetTypeName
+                             + '>& get' + self.upperFirst(field.name)
+                             + '() const')
+                stream.write(' {return ' + field.name + ';}\n')
 
                 stream.write(self.getIndent())
-                stream.write("const "+targetTypeName+"& get"+self.upperFirst(field.name)+"(uint32_t rank) const")
-                stream.write(" {return "+field.name+"[rank];}\n")  
-                
+                stream.write('const ' + targetTypeName + '& get'
+                             + self.upperFirst(field.name)
+                             + '(uint32_t rank) const')
+                stream.write(' {return ' + field.name + '[rank];}\n')
+
                 stream.write(self.getIndent())
-                stream.write(targetTypeName+"& get"+self.upperFirst(field.name)+"(uint32_t rank)")
-                stream.write(" {return "+field.name+"[rank];}\n")  
-                
+                stream.write(targetTypeName + '& get'
+                             + self.upperFirst(field.name)
+                             + '(uint32_t rank)')
+                stream.write(' {return ' + field.name + '[rank];}\n')
+
                 stream.write(self.getIndent())
-                stream.write("void set"+self.upperFirst(field.name)+"(const ")
-                stream.write(targetTypeName+"& new"+self.upperFirst(field.name)+", uint32_t rank)")
-                stream.write(" {"+field.name+"[rank]=new"+self.upperFirst(field.name)+";}\n")
-                
+                stream.write('void set' + self.upperFirst(field.name)
+                             + '(const ')
+                stream.write(targetTypeName + '& new'
+                             + self.upperFirst(field.name)
+                             + ', uint32_t rank)')
+                stream.write(' {' + field.name + '[rank]=new'
+                             + self.upperFirst(field.name) + ';}\n')
+
                 stream.write(self.getIndent())
-                stream.write("void remove"+self.upperFirst(field.name)+"(uint32_t rank)")
-                stream.write(" {"+field.name+".erase("+field.name+".begin() + rank);}\n")                     
+                stream.write('void remove'
+                             + self.upperFirst(field.name)
+                             + '(uint32_t rank)')
+                stream.write(' {' + field.name + '.erase(' + field.name
+                             + '.begin() + rank);}\n')
             else:
                 stream.write(self.getIndent())
-                stream.write("const "+targetTypeName+"& get"+self.upperFirst(field.name)+"() const")
-                stream.write(" {return "+field.name+";}\n")        
-            
+                stream.write('const ' + targetTypeName + '& get'
+                             + self.upperFirst(field.name) + '() const')
+                stream.write(' {return ' + field.name + ';}\n')
+
                 stream.write(self.getIndent())
-                stream.write("void set"+self.upperFirst(field.name)+"(const ")
-                stream.write(targetTypeName+"& new"+self.upperFirst(field.name)+") {")
-                if field.qualifier == "optional":                                        
-                    stream.write("\n")
-                    self.indent();                    
-                    stream.write(self.getIndent()+"_has%s=true;\n"%self.upperFirst(field.name))
-                    stream.write(self.getIndent()+field.name+"=new"+self.upperFirst(field.name)+";\n")                    
+                stream.write('void set' + self.upperFirst(field.name)
+                             + '(const ')
+                stream.write(targetTypeName + '& new'
+                             + self.upperFirst(field.name) + ') {')
+                if field.qualifier == 'optional':
+                    stream.write('\n')
+                    self.indent()
+                    stream.write(self.getIndent() + '_has%s=true;\n'
+                                 % self.upperFirst(field.name))
+                    stream.write(self.getIndent() + field.name + '=new'
+                                 + self.upperFirst(field.name) + ';\n')
                     self.unIndent()
-                    stream.write(self.getIndent())         
+                    stream.write(self.getIndent())
                 else:
-                    stream.write(field.name+"=new"+self.upperFirst(field.name)+";")
-                stream.write("}\n")
-                if field.qualifier == "optional":
+                    stream.write(field.name + '=new'
+                                 + self.upperFirst(field.name) + ';')
+                stream.write('}\n')
+                if field.qualifier == 'optional':
                     stream.write(self.getIndent())
                     tmp = self.upperFirst(field.name)
-                    stream.write("bool has%s() {return _has%s;}\n"%(tmp,tmp))
-            
-    def writeDeclarationFieldStatement(self,stream,field):
-        stream.write(self.getIndent())     
-        if field.qualifier == "repeated":
-            stream.write("std::vector<%s> %s;" % (self.getTargetTypeName(field.typeid.name),field.name))        
-        else:               
-            stream.write("%s %s;" % (self.getTargetTypeName(field.typeid.name),field.name))                                                
-        self.writeComment(stream, field)     
-        # optional field generate another boolean field 
+                    stream.write('bool has%s() {return _has%s;}\n'
+                                 % (tmp, tmp))
+
+    def writeDeclarationFieldStatement(self, stream, field):
+        stream.write(self.getIndent())
+        if field.qualifier == 'repeated':
+            stream.write('std::vector<%s> %s;'
+                         % (self.getTargetTypeName(field.typeid.name),
+                         field.name))
+        else:
+            stream.write('%s %s;'
+                         % (self.getTargetTypeName(field.typeid.name),
+                         field.name))
+        self.writeComment(stream, field)
+
+        # optional field generate another boolean field
         # used to detect whether if the optional field has
         # been given or not.
-        if field.qualifier == "optional":
-            stream.write(self.getIndent()+"bool _has%s;\n" % self.upperFirst(field.name))
-	     
-    def generateEnum(self,stream,enum):
+
+        if field.qualifier == 'optional':
+            stream.write(self.getIndent() + 'bool _has%s;\n'
+                         % self.upperFirst(field.name))
+
+    def generateEnum(self, stream, enum):
         self.writeComment(stream, enum)
         stream.write(self.getIndent())
-        stream.write("typedef enum %s {\n" % enum.name)
+        stream.write('typedef enum %s {\n' % enum.name)
         self.indent()
         first = True
-        lastname = (enum.values[len(enum.values)-1]).name
+        lastname = enum.values[len(enum.values) - 1].name
         for enumval in enum.values:
             if first:
                 stream.write(self.getIndent())
-                stream.write("%s = %d, " % (enumval.name,enumval.value))                
-                first=False
+                stream.write('%s = %d, ' % (enumval.name,
+                             enumval.value))
+                first = False
                 self.writeComment(stream, enumval)
             else:
                 stream.write(self.getIndent())
-        if (enumval.name==lastname):
-          stream.write("%s \n" % enumval.name)            
-        else:
-          stream.write("%s, " % enumval.name)            
-          self.writeComment(stream, enumval)
-                                            
-        self.unIndent()      
-        stream.write(self.getIndent())          
-        stream.write("} %s_t; " %  enum.name) 
-        stream.write(self.commentLineBeginWith + "end of enum %s \n" % enum.name)
-                                                    
-    def generateHeader(self,stream,factoryOnly=False):
+                if enumval.name == lastname:
+                    stream.write('%s \n' % enumval.name)
+                else:
+                    stream.write('%s, ' % enumval.name)
+                    self.writeComment(stream, enumval)
+
+        self.unIndent()
+        stream.write(self.getIndent())
+        stream.write('} %s_t; ' % enum.name)
+        stream.write(self.commentLineBeginWith + 'end of enum %s \n'
+                     % enum.name)
+
+    def generateHeader(self, stream, factoryOnly=False):
+
         # write the usual header protecting MACRO
-        supposedHeaderName=stream.name
-        if supposedHeaderName != "<stdout>":
-            supposedHeaderName=os.path.basename(supposedHeaderName)
-            supposedHeaderName=os.path.splitext(supposedHeaderName)[0]
+
+        supposedHeaderName = stream.name
+        if supposedHeaderName != '<stdout>':
+            supposedHeaderName = os.path.basename(supposedHeaderName)
+            supposedHeaderName = os.path.splitext(supposedHeaderName)[0]
             headerProtectMacroName = supposedHeaderName
         else:
-            (headerProtectMacroName,ext) = os.path.splitext(self.AST.name)
-            
-        headerProtectMacroName = "%s_HH" % headerProtectMacroName.upper()            
-        stream.write("#ifndef %s\n"%headerProtectMacroName)
-        stream.write("#define %s\n"%headerProtectMacroName)        
+            (headerProtectMacroName, ext) = \
+                os.path.splitext(self.AST.name)
+
+        headerProtectMacroName = '%s_HH' \
+            % headerProtectMacroName.upper()
+        stream.write('#ifndef %s\n' % headerProtectMacroName)
+        stream.write('#define %s\n' % headerProtectMacroName)
+
         # add necessary standard and global includes
-        stream.write(self.commentLineBeginWith+" ****-**** Global System includes ****-****\n")
-        stream.write("#include <vector>\n")
-        self.included["#include <vector>"]=1
-        stream.write("#include <string>\n")        
-        self.included["#include <string>"]=1
-        # add include coming from native type specification 
-        stream.write(self.commentLineBeginWith+" ****-**** Includes coming from native types ****-****\n")
+
+        stream.write(self.commentLineBeginWith
+                     + ' ****-**** Global System includes ****-****\n')
+        stream.write('#include <vector>\n')
+        self.included['#include <vector>'] = 1
+        stream.write('#include <string>\n')
+        self.included['#include <string>'] = 1
+
+        # add include coming from native type specification
+
+        stream.write(self.commentLineBeginWith
+                     + ' ****-**** Includes coming from native types ****-****\n'
+                     )
         for native in self.AST.natives:
-            if native.hasLanguage("CXX"):
-                for line in native.getLanguageLines("CXX"):
+            if native.hasLanguage('CXX'):
+                for line in native.getLanguageLines('CXX'):
+
                     # we are only interested in native "include" statement
+
                     stmt = line.statement
-                    if stmt.find("#include")>=0 and (not stmt in self.included.keys()):
+                    if stmt.find('#include') >= 0 and not stmt \
+                        in self.included.keys():
                         self.writeComment(stream, native)
-                        stream.write(stmt+"\n")
-                        self.included[stmt]=1
-        # Generate namespace for specified package package 
+                        stream.write(stmt + '\n')
+                        self.included[stmt] = 1
+
+        # Generate namespace for specified package package
         # we may have nested namespace
+
         self.openNamespaces(stream)
-        
+
         if not factoryOnly:
+
             # Native type should be defined in included header
-            stream.write(self.getIndent()+self.commentLineBeginWith)
-            stream.write(" Native types has been defined:\n");
-            stream.write(self.getIndent()+self.commentLineBeginWith)
-            stream.write("     - by included headers (see above)\n")
-            stream.write(self.getIndent()+self.commentLineBeginWith)
-            stream.write("     - with typedef (see below [if any])\n")
-            for native in self.AST.natives:  
-                if native.hasLanguage("CXX"):
-                   for line in native.getLanguageLines("CXX"):
-                       stmt = line.statement
+
+            stream.write(self.getIndent() + self.commentLineBeginWith)
+            stream.write(' Native types has been defined:\n')
+            stream.write(self.getIndent() + self.commentLineBeginWith)
+            stream.write('     - by included headers (see above)\n')
+            stream.write(self.getIndent() + self.commentLineBeginWith)
+            stream.write('     - with typedef (see below [if any])\n')
+            for native in self.AST.natives:
+                if native.hasLanguage('CXX'):
+                    for line in native.getLanguageLines('CXX'):
+                        stmt = line.statement
+
                        # we are only interested in native statement
                        # which are not #include
-                       if stmt.find("typedef")>=0 and (not stmt in self.typedefed.keys()):
-                           self.writeComment(stream, native)
-                           stream.write(self.getIndent()+stmt+"\n")
-                           self.typedefed[stmt]=1                                    
+
+                        if stmt.find('typedef') >= 0 and not stmt \
+                            in self.typedefed.keys():
+                            self.writeComment(stream, native)
+                            stream.write(self.getIndent() + stmt + '\n')
+                            self.typedefed[stmt] = 1
 
             # Put enum in a namespace in order to avoid conflict
+
             stream.write(self.getIndent())
-            stream.write("namespace %s {\n" % self.AST.name.split(".")[0])
+            stream.write('namespace %s {\n' % self.AST.name.split('.'
+                         )[0])
             self.indent()
 
             # Generate version
+
             if self.AST.hasVersion():
-                major,minor = self.AST.version.number
+                (major, minor) = self.AST.version.number
                 stream.write(self.getIndent())
-                stream.write("static const uint32_t versionMajor = %d;\n" % major)
+                stream.write('static const uint32_t versionMajor = %d;\n'
+                              % major)
                 stream.write(self.getIndent())
-                stream.write("static const uint32_t versionMinor = %d;\n" % minor)
+                stream.write('static const uint32_t versionMinor = %d;\n'
+                              % minor)
 
             # Generate enum
-            lastname = ""
+
+            lastname = ''
             for enum in self.AST.enums:
                 self.generateEnum(stream, enum)
-            stream.write("\n")
-               
+            stream.write('\n')
+
             # close enum namespace
-	    
+
             self.unIndent()
             stream.write(self.getIndent())
-            stream.write("}\n")
+            stream.write('}\n')
 
             # Generate message type
+
             for msg in self.AST.messages:
                 self.writeComment(stream, msg)
-                stream.write(self.getIndent())                
-                stream.write("class %s %s" % (self.exportPrefix,msg.name))
+                stream.write(self.getIndent())
+                stream.write('class %s %s' % (self.exportPrefix,
+                             msg.name))
                 if msg.hasMerge():
-                    stream.write(" : public %s {\n" % msg.merge.name)
-                    virtual = "virtual "
+                    stream.write(' : public %s {\n' % msg.merge.name)
+                    virtual = 'virtual '
                 elif msg.hasHeir():
-                    stream.write(" {\n")
-                    virtual = "virtual "
+                    stream.write(' {\n')
+                    virtual = 'virtual '
                 else:
-                    stream.write(" {\n")
-                    virtual = ""
-                                    
-                self.indent()                
+                    stream.write(' {\n')
+                    virtual = ''
+
+                self.indent()
+
                 # begin public
-                stream.write(self.getIndent()+"public:\n") 
+
+                stream.write(self.getIndent() + 'public:\n')
                 self.indent()
-		
-		if msg.hasEnum():
-		    self.generateEnum(stream,msg.enum)
-		    stream.write("\n")
-		
-		    
+
+                if msg.hasEnum():
+                    self.generateEnum(stream, msg.enum)
+                    stream.write('\n')
+
                 if msg.hasMerge():
-                   stream.write(self.getIndent()+"typedef %s Super;\n"%msg.merge.name)
+                    stream.write(self.getIndent()
+                                 + 'typedef %s Super;\n'
+                                 % msg.merge.name)
+
                 # now write constructor/destructor
-                stream.write(self.getIndent()+msg.name+"();\n")
-                stream.write(self.getIndent()+virtual+"~"+msg.name+"();\n")
-                
+
+                stream.write(self.getIndent() + msg.name + '();\n')
+                stream.write(self.getIndent() + virtual + '~'
+                             + msg.name + '();\n')
+
                 # write virtual serialize and deserialize
                 # if we have some specific field
-                if len(msg.fields)>0:
-                    # serialize/deserialize 
-                    stream.write(self.getIndent()+virtual+"void serialize(%s& msgBuffer);\n" % (self.serializeBufferType))
-                    stream.write(self.getIndent()+virtual+"void deserialize(%s& msgBuffer);\n" % (self.serializeBufferType))
+
+                if len(msg.fields) > 0:
+
+                    # serialize/deserialize
+
+                    stream.write(self.getIndent() + virtual
+                                 + 'void serialize(%s& msgBuffer);\n'
+                                 % self.serializeBufferType)
+                    stream.write(self.getIndent() + virtual
+                                 + 'void deserialize(%s& msgBuffer);\n'
+                                 % self.serializeBufferType)
+
                     # specific getter/setter
-                    stream.write(self.getIndent()+self.commentLineBeginWith+" specific Getter(s)/Setter(s)\n")
+
+                    stream.write(self.getIndent()
+                                 + self.commentLineBeginWith
+                                 + ' specific Getter(s)/Setter(s)\n')
                     for field in msg.fields:
-                        if (isinstance(field,GenMsgAST.MessageType.CombinedField)):
+                        if isinstance(field,
+                                GenMsgAST.MessageType.CombinedField):
                             for cfield in field.fields:
-                                self.writeOneGetterSetter(stream,cfield)
+                                self.writeOneGetterSetter(stream,
+                                        cfield)
                         else:
-                            self.writeOneGetterSetter(stream,field)
+                            self.writeOneGetterSetter(stream, field)
+
                     # the show method
-                    stream.write(self.getIndent()+self.commentLineBeginWith+" the show method\n")
-                    stream.write(self.getIndent()+virtual+"std::ostream& show(std::ostream& out);\n")
-                                                    
+
+                    stream.write(self.getIndent()
+                                 + self.commentLineBeginWith
+                                 + ' the show method\n')
+                    stream.write(self.getIndent() + virtual
+                                 + 'std::ostream& show(std::ostream& out);\n'
+                                 )
+
                 self.unIndent()
+
                 # end public:
-                
+
                 # begin protected
-                stream.write(self.getIndent()+"protected:\n")
+
+                stream.write(self.getIndent() + 'protected:\n')
                 self.indent()
                 for field in msg.fields:
-                    if (isinstance(field,GenMsgAST.MessageType.CombinedField)):
+                    if isinstance(field,
+                                  GenMsgAST.MessageType.CombinedField):
                         for cfield in field.fields:
-                            self.writeDeclarationFieldStatement(stream,cfield)
+                            self.writeDeclarationFieldStatement(stream,
+                                    cfield)
                     else:
-                        self.writeDeclarationFieldStatement(stream,field)                    
+                        self.writeDeclarationFieldStatement(stream,
+                                field)
                 self.unIndent()
-                # end protected  
-                
+
+                # end protected
+
                 # begin private
-                stream.write(self.getIndent()+"private:\n")
+
+                stream.write(self.getIndent() + 'private:\n')
                 self.indent()
                 self.unIndent()
+
                 # end private
-                
+
                 self.unIndent()
-                stream.write(self.getIndent() + "};\n")
+                stream.write(self.getIndent() + '};\n')
 
         # Generate Factory (if any)
         # @todo
-        if self.AST.hasFactory():             
+
+        if self.AST.hasFactory():
             self.writeComment(stream, self.AST.factory)
-            stream.write(self.getIndent() + "class %s %s {\n" % (self.exportPrefix,self.AST.factory.name))
+            stream.write(self.getIndent() + 'class %s %s {\n'
+                         % (self.exportPrefix, self.AST.factory.name))
             self.indent()
+
             # begin public
-            stream.write(self.getIndent()+"public:\n")            
+
+            stream.write(self.getIndent() + 'public:\n')
             self.indent()
-	    
-            stream.write(self.getIndent()+"static %s* %s(%s type) throw ("% self.AST.factory.creator)
-	    stream.write("%s" %(self.exception[0]))
-	    for exception in self.exception[1:]:
-	        stream.write(" ,%s" %(exception))
-	    stream.write("); \n")
-	    
-	    if self.AST.factory.hasFactoryReceiver():
-                stream.write(self.getIndent()+"static %s* %s(%s stream) throw ("% self.AST.factory.receiver)
-	        stream.write("%s" %(self.exception[0]))
-	        for exception in self.exception[1:]:
-	            stream.write(" ,%s" %(exception))
-	        stream.write("); \n")
-	    
+
+            stream.write(self.getIndent()
+                         + 'static %s* %s(%s type) throw ('
+                         % self.AST.factory.creator)
+            stream.write('%s' % self.exception[0])
+            for exception in self.exception[1:]:
+                stream.write(' ,%s' % exception)
+            stream.write('); \n')
+
+            if self.AST.factory.hasFactoryReceiver():
+                stream.write(self.getIndent()
+                             + 'static %s* %s(%s stream) throw ('
+                             % self.AST.factory.receiver)
+                stream.write('%s' % self.exception[0])
+                for exception in self.exception[1:]:
+                    stream.write(' ,%s' % exception)
+                stream.write('); \n')
+
             self.unIndent()
-            #end public
-            #begin protected
-            stream.write(self.getIndent()+"protected:\n")
+
+            # end public
+            # begin protected
+
+            stream.write(self.getIndent() + 'protected:\n')
             self.indent()
             self.unIndent()
-            #end protected
-            #begin private
-            stream.write(self.getIndent()+"private:\n")
+
+            # end protected
+            # begin private
+
+            stream.write(self.getIndent() + 'private:\n')
             self.indent()
             self.unIndent()
-            #end private
+
+            # end private
+
             self.unIndent()
-            stream.write(self.getIndent()+"};\n\n")            
-                        
-        # may close any open namespaces 
+            stream.write(self.getIndent() + '''};
+
+''')
+
+        # may close any open namespaces
+
         self.closeNamespaces(stream)
+
         # close usual HEADER protecting MACRO
-        stream.write(self.commentLineBeginWith+" %s\n"%headerProtectMacroName)
-        stream.write("#endif\n")
-        
-    def writeInitFieldStatement(self,stream,field):
-        if field.qualifier == "optional":
+
+        stream.write(self.commentLineBeginWith + ' %s\n'
+                     % headerProtectMacroName)
+        stream.write('#endif\n')
+
+    def writeInitFieldStatement(self, stream, field):
+        if field.qualifier == 'optional':
             stream.write(self.getIndent())
-            stream.write("_has"+self.upperFirst(field.name)+"=false;\n")
-        if field.hasDefaultValue():            
+            stream.write('_has' + self.upperFirst(field.name)
+                         + '=false;\n')
+        if field.hasDefaultValue():
             stream.write(self.getIndent())
-            stream.write(field.name+"="+str(field.defaultValue)+";\n")        
+            stream.write(field.name + '=' + str(field.defaultValue)
+                         + ';\n')
         else:
             stream.write(self.getIndent())
             stream.write(self.commentLineBeginWith)
-            stream.write(field.name+"= <no default value in message spec using builtin>\n")
+            stream.write(field.name
+                         + '= <no default value in message spec using builtin>\n'
+                         )
+
             # FIXME find a default value for every type beside natives
-                           
-    def writeSerializeFieldStatement(self,stream,field):
+
+    def writeSerializeFieldStatement(self, stream, field):
         indexField = ''
-        if field.qualifier == "optional":
+        if field.qualifier == 'optional':
             stream.write(self.getIndent())
-            stream.write("msgBuffer.write_bool(_has%s);\n" % self.upperFirst(field.name))
+            stream.write('msgBuffer.write_bool(_has%s);\n'
+                         % self.upperFirst(field.name))
             stream.write(self.getIndent())
-            stream.write("if (_has%s) {\n" % self.upperFirst(field.name))
+            stream.write('if (_has%s) {\n'
+                         % self.upperFirst(field.name))
             self.indent()
-        elif field.qualifier == "repeated":
+        elif field.qualifier == 'repeated':
             indexField = '[i]'
             stream.write(self.getIndent())
-            stream.write("uint32_t "+field.name+"Size = "+field.name+".size();\n")
+            stream.write('uint32_t ' + field.name + 'Size = '
+                         + field.name + '.size();\n')
             stream.write(self.getIndent())
-            stream.write("msgBuffer.write_uint32("+field.name+"Size);\n")
+            stream.write('msgBuffer.write_uint32(' + field.name
+                         + 'Size);\n')
             stream.write(self.getIndent())
-            stream.write("for (uint32_t i = 0; i < "+field.name+"Size; ++i) {\n")
+            stream.write('for (uint32_t i = 0; i < ' + field.name
+                         + 'Size; ++i) {\n')
             self.indent()
-            
-        stream.write(self.getIndent())        
+
+        stream.write(self.getIndent())
         methodName = self.getSerializeMethodName(field.typeid.name)
-        if None == methodName: # field has no Serialize Method Name found in the map
+        if None == methodName:  # field has no Serialize Method Name found in the map
+
             # non native field case
+
             if field.typeid.name in [m.name for m in self.AST.messages]:
-                stream.write(field.name+indexField+".serialize(msgBuffer);\n")
-            # enum type field case (enum are serialized as uint32)
+                stream.write(field.name + indexField
+                             + '.serialize(msgBuffer);\n')
             elif field.typeid.name in [m.name for m in self.AST.enums]:
-                methodName = self.getSerializeMethodName("uint32")
-                stream.write("msgBuffer."+methodName)
-                stream.write("("+field.name+indexField+");\n")
-	        # native field case  
-            else:	      
-                stream.write(self.commentLineBeginWith+" FIXME FIXME FIXME\n")
-                stream.write(self.getIndent()+self.commentLineBeginWith+" don't know how to serialize native field <%s> of type <%s>\n"%(field.name,field.typeid.name))            
-        else: # field has one Serialize Method Name found in the map
-            stream.write("msgBuffer."+methodName)
-            stream.write("("+field.name+indexField+");\n")
-        
-        if field.qualifier == "optional":
+
+            # enum type field case (enum are serialized as uint32)
+
+                methodName = self.getSerializeMethodName('uint32')
+                stream.write('msgBuffer.' + methodName)
+                stream.write('(' + field.name + indexField + ');\n')
+            else:
+
+            # native field case
+
+                stream.write(self.commentLineBeginWith
+                             + ' FIXME FIXME FIXME\n')
+                stream.write(self.getIndent()
+                             + self.commentLineBeginWith
+                             + " don't know how to serialize native field <%s> of type <%s>\n"
+                              % (field.name, field.typeid.name))
+        else:
+
+              # field has one Serialize Method Name found in the map
+
+            stream.write('msgBuffer.' + methodName)
+            stream.write('(' + field.name + indexField + ');\n')
+
+        if field.qualifier == 'optional':
             self.unIndent()
-            stream.write(self.getIndent()+"}\n")
-        elif field.qualifier == "repeated":
+            stream.write(self.getIndent() + '}\n')
+        elif field.qualifier == 'repeated':
             self.unIndent()
-            stream.write(self.getIndent()+"}\n")
-            
-    def writeShowFieldStatement(self,stream,field):
+            stream.write(self.getIndent() + '}\n')
+
+    def writeShowFieldStatement(self, stream, field):
         indexField = ''
-        if field.qualifier == "optional":
+        if field.qualifier == 'optional':
             stream.write(self.getIndent())
-            stream.write("out << \"(opt) %s =\" " % field.name)
-        elif field.qualifier == "repeated":
+            stream.write('out << "(opt) %s =" ' % field.name)
+        elif field.qualifier == 'repeated':
             indexField = '[i]'
             stream.write(self.getIndent())
-            stream.write("out << \"    %s [] =\" << std::endl;\n" % field.name )
+            stream.write('out << "    %s [] =" << std::endl;\n'
+                         % field.name)
             stream.write(self.getIndent())
-            stream.write("for (uint32_t i = 0; i < get"+self.upperFirst(field.name)+"Size(); ++i) {\n")            
+            stream.write('for (uint32_t i = 0; i < get'
+                         + self.upperFirst(field.name)
+                         + 'Size(); ++i) {\n')
             self.indent()
-            stream.write(self.getIndent()+"out ")
+            stream.write(self.getIndent() + 'out ')
         else:
             stream.write(self.getIndent())
-            stream.write("out << \" %s = \" " % field.name)
-                   
+            stream.write('out << " %s = " ' % field.name)
+
         methodName = self.getSerializeMethodName(field.typeid.name)
-        if None == methodName: # field has no Serialize Method Name found in the map
+        if None == methodName:  # field has no Serialize Method Name found in the map
+
             # non native field case
-            if field.typeid.name in [m.name for m in self.AST.messages]:                
-                stream.write("<< "+field.name+indexField+".show(out)")
-            # enum type field case (enum are serialized as uint32)
+
+            if field.typeid.name in [m.name for m in self.AST.messages]:
+                stream.write('<< ' + field.name + indexField
+                             + '.show(out)')
             elif field.typeid.name in [m.name for m in self.AST.enums]:
-                stream.write("<< %s << \" \" " %(field.name+indexField))
-                
-                #stream.write(self.commentLineBeginWith+" FIXME FIXME FIXME inherited message\n") 
-            # native field case 
+
+            # enum type field case (enum are serialized as uint32)
+
+                stream.write('<< %s << " " ' % (field.name
+                             + indexField))
             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))
-                stream.write("\"")
-                                            
-        else: # field has one Serialize Method Name found in the map                     
-            stream.write("<< %s << \" \" " % (field.name+indexField))
-        
-        if field.qualifier == "optional":            
-            stream.write(self.getIndent()+"<< std::endl;\n")
-        elif field.qualifier == "repeated":
-            stream.write(";\n")
+
+                # stream.write(self.commentLineBeginWith+" FIXME FIXME FIXME inherited message\n")
+            # native field case
+
+                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))
+                stream.write('"')
+        else:
+
+              # field has one Serialize Method Name found in the map
+
+            stream.write('<< %s << " " ' % (field.name + indexField))
+
+        if field.qualifier == 'optional':
+            stream.write(self.getIndent() + '<< std::endl;\n')
+        elif field.qualifier == 'repeated':
+            stream.write(';\n')
             self.unIndent()
-            stream.write(self.getIndent()+"}\n")
-            stream.write(self.getIndent()+"out << std::endl;\n")
+            stream.write(self.getIndent() + '}\n')
+            stream.write(self.getIndent() + 'out << std::endl;\n')
         else:
-            stream.write(self.getIndent()+"<< std::endl;\n")
-                        
-    
-    def writeDeSerializeFieldStatement(self,stream,field):
+            stream.write(self.getIndent() + '<< std::endl;\n')
+
+    def writeDeSerializeFieldStatement(self, stream, field):
         indexField = ''
-        if field.qualifier == "optional":
+        if field.qualifier == 'optional':
             stream.write(self.getIndent())
-            stream.write("_has%s = msgBuffer.read_bool();\n" % self.upperFirst(field.name))
+            stream.write('_has%s = msgBuffer.read_bool();\n'
+                         % self.upperFirst(field.name))
             stream.write(self.getIndent())
-            stream.write("if (_has%s) {\n" % self.upperFirst(field.name))
+            stream.write('if (_has%s) {\n'
+                         % self.upperFirst(field.name))
             self.indent()
-        elif field.qualifier == "repeated":
+        elif field.qualifier == 'repeated':
             indexField = '[i]'
             stream.write(self.getIndent())
-            stream.write("uint32_t "+field.name+"Size = msgBuffer.read_uint32();\n")
+            stream.write('uint32_t ' + field.name
+                         + 'Size = msgBuffer.read_uint32();\n')
             stream.write(self.getIndent())
-            stream.write(field.name+".resize("+field.name+"Size);\n")
+            stream.write(field.name + '.resize(' + field.name
+                         + 'Size);\n')
             stream.write(self.getIndent())
-            stream.write("for (uint32_t i = 0; i < "+field.name+"Size; ++i) {\n")
+            stream.write('for (uint32_t i = 0; i < ' + field.name
+                         + 'Size; ++i) {\n')
             self.indent()
-            
+
         stream.write(self.getIndent())
         methodName = self.getDeSerializeMethodName(field.typeid.name)
-        if None == methodName: # field has no Deserialize Method Name found in the map
-	     # non native field case
+        if None == methodName:  # field has no Deserialize Method Name found in the map
+
+         # non native field case
+
             if field.typeid.name in [m.name for m in self.AST.messages]:
-                stream.write(field.name+indexField+".deserialize(msgBuffer);\n")
-            # enum type field case (enum are deserialized as uint32)
+                stream.write(field.name + indexField
+                             + '.deserialize(msgBuffer);\n')
             elif field.typeid.name in [m.name for m in self.AST.enums]:
-                targetTypeName = self.getTargetTypeName(field.typeid.name)
-                methodName = self.getDeSerializeMethodName("uint32")
+
+            # enum type field case (enum are deserialized as uint32)
+
+                targetTypeName = \
+                    self.getTargetTypeName(field.typeid.name)
+                methodName = self.getDeSerializeMethodName('uint32')
+
                 # We should check if the uint32 value is in enum range before casting it into enumtype
-                stream.write(field.name+indexField+" = static_cast<"+targetTypeName+">(msgBuffer."+methodName+" ());\n")
-            # native field case
+
+                stream.write(field.name + indexField + ' = static_cast<'
+                              + targetTypeName + '>(msgBuffer.'
+                             + methodName + ' ());\n')
             else:
-                stream.write(self.commentLineBeginWith+" FIXME FIXME FIXME\n")
-                stream.write(self.getIndent()+self.commentLineBeginWith+" don't know how to deserialize native field <%s> of type <%s>\n"%(field.name,field.typeid.name))            
-        else: # field has one Deserialize Method Name found in the map
+
+            # native field case
+
+                stream.write(self.commentLineBeginWith
+                             + ' FIXME FIXME FIXME\n')
+                stream.write(self.getIndent()
+                             + self.commentLineBeginWith
+                             + " don't know how to deserialize native field <%s> of type <%s>\n"
+                              % (field.name, field.typeid.name))
+        else:
+
+              # field has one Deserialize Method Name found in the map
+
             if methodName == 'read_string':
-                stream.write("msgBuffer."+methodName+"("+field.name+indexField+");\n")
+                stream.write('msgBuffer.' + methodName + '('
+                             + field.name + indexField + ');\n')
             else:
+
                 # We may have to vast in order to enforce conversion
-                if isinstance(field.typeid,GenMsgAST.NativeType):
-                   stream.write(field.name+indexField+" = static_cast<"+field.typeid.name+">(msgBuffer."+methodName+"());\n")
+
+                if isinstance(field.typeid, GenMsgAST.NativeType):
+                    stream.write(field.name + indexField
+                                 + ' = static_cast<'
+                                 + field.typeid.name + '>(msgBuffer.'
+                                 + methodName + '());\n')
                 else:
-                   stream.write(field.name+indexField+" = msgBuffer."+methodName+"();\n")
-                    
-        if field.qualifier == "optional":
+                    stream.write(field.name + indexField
+                                 + ' = msgBuffer.' + methodName
+                                 + '();\n')
+
+        if field.qualifier == 'optional':
             self.unIndent()
-            stream.write(self.getIndent()+"}\n")
-        elif field.qualifier == "repeated":
+            stream.write(self.getIndent() + '}\n')
+        elif field.qualifier == 'repeated':
             self.unIndent()
-            stream.write(self.getIndent()+"}\n")
-            
-    def writeFactoryCreator(self,stream):
-        creator = (self.AST.factory.creator[0],self.AST.factory.name)+self.AST.factory.creator[1:]            
-        stream.write(self.getIndent()+"%s* %s::%s(%s type) throw ("% creator)
-        stream.write("%s" %(self.exception[0]))
+            stream.write(self.getIndent() + '}\n')
+
+    def writeFactoryCreator(self, stream):
+        creator = (self.AST.factory.creator[0], self.AST.factory.name) \
+            + self.AST.factory.creator[1:]
+        stream.write(self.getIndent() + '%s* %s::%s(%s type) throw ('
+                     % creator)
+        stream.write('%s' % self.exception[0])
         for exception in self.exception[1:]:
-            stream.write(" ,%s" %(exception))
-        stream.write(") { \n")
-	
+            stream.write(' ,%s' % exception)
+        stream.write(') { \n')
+
         self.indent()
-        stream.write(self.getIndent()+"%s* msg = NULL;\n\n" % creator[0])
-        stream.write(self.getIndent() + "switch (type) {\n")
+        stream.write(self.getIndent() + '''%s* msg = NULL;
+
+'''
+                     % creator[0])
+        stream.write(self.getIndent() + 'switch (type) {\n')
         self.indent()
         for e in self.AST.eMessageType.values:
-            if (None!=self.replacePrefix):                        
-                stream.write(self.getIndent()+"case %s::%s:\n" % (creator[0],e.name.replace(self.replacePrefix[0],"",1)))   
+            if None != self.replacePrefix:
+                stream.write(self.getIndent() + 'case %s::%s:\n'
+                             % (creator[0],
+                             e.name.replace(self.replacePrefix[0], '',
+                             1)))
             else:
-		stream.write(self.getIndent()+"case %s::%s:\n" % (creator[0],e.name))
-	                 
+                stream.write(self.getIndent() + 'case %s::%s:\n'
+                             % (creator[0], e.name))
+
             self.indent()
-	    
-            if None==e.type:
-		# we throw here the first exception of the list 
-                stream.write(self.getIndent()+"throw %s(\"%s message type should not be used!!\");\n"%(self.exception[0],e.name))
+
+            if None == e.type:
+
+        # we throw here the first exception of the list
+
+                stream.write(self.getIndent()
+                             + 'throw %s("%s message type should not be used!!");\n'
+                              % (self.exception[0], e.name))
             else:
-                stream.write(self.getIndent()+"msg = new %s();\n" % e.type)
-            stream.write(self.getIndent()+"break;\n")
-            self.unIndent()        
+                stream.write(self.getIndent() + 'msg = new %s();\n'
+                             % e.type)
+            stream.write(self.getIndent() + 'break;\n')
+            self.unIndent()
         self.unIndent()
-        stream.write(self.getIndent()+ "} "+self.commentLineBeginWith+" end if switch (type)\n")        
-        stream.write(self.getIndent()+ "return msg;\n")
+        stream.write(self.getIndent() + '} '
+                     + self.commentLineBeginWith
+                     + ' end if switch (type)\n')
+        stream.write(self.getIndent() + 'return msg;\n')
         self.unIndent()
-        stream.write(self.getIndent()+("} /* end of %s::%s */\n\n" % (creator[1],creator[2])))
-    
-    def writeFactoryReceiver(self,stream):
-        receiver = (self.AST.factory.receiver[0],self.AST.factory.name)+self.AST.factory.receiver[1:]
-        stream.write(self.getIndent()+"%s* %s::%s(%s stream) throw ("% receiver)
-        stream.write("%s" %(self.exception[0]))
-	for exception in self.exception[1:]:
-	    stream.write(" ,%s" %(exception))
-	stream.write(") { \n")
-	
+        stream.write(self.getIndent() + '''} /* end of %s::%s */
+
+'''
+                     % (creator[1], creator[2]))
+
+    def writeFactoryReceiver(self, stream):
+        receiver = (self.AST.factory.receiver[0],
+                    self.AST.factory.name) \
+            + self.AST.factory.receiver[1:]
+        stream.write(self.getIndent() + '%s* %s::%s(%s stream) throw ('
+                     % receiver)
+        stream.write('%s' % self.exception[0])
+        for exception in self.exception[1:]:
+            stream.write(' ,%s' % exception)
+        stream.write(') { \n')
+
         self.indent()
-        stream.write(self.getIndent()+self.commentLineBeginWith+" FIXME This is not thread safe\n")
-        stream.write(self.getIndent()+"static %s msgBuffer;\n" % (self.serializeBufferType))
-        stream.write(self.getIndent()+"%s  msgGen;\n" % receiver[0])
-        stream.write(self.getIndent()+"%s* msg;\n\n" % receiver[0])
-        stream.write(self.getIndent()+self.commentLineBeginWith+" receive generic message \n")
-        stream.write(self.getIndent()+"msgGen.receive(stream,msgBuffer);\n")
-        stream.write(self.getIndent()+self.commentLineBeginWith+" create specific message from type \n")
-        
-        stream.write(self.getIndent()+"msg = ");
-        stream.write(self.AST.factory.name+"::"+self.AST.factory.creator[1]+"(msgGen.%s);\n" %(self.messageTypeGetter))
-        
-        stream.write(self.getIndent()+"msgBuffer.assumeSizeFromReservedBytes();\n")    
-        stream.write(self.getIndent()+"msg->deserialize(msgBuffer);\n")
-        stream.write(self.getIndent()+"return msg;\n")
+        stream.write(self.getIndent() + self.commentLineBeginWith
+                     + ' FIXME This is not thread safe\n')
+        stream.write(self.getIndent() + 'static %s msgBuffer;\n'
+                     % self.serializeBufferType)
+        stream.write(self.getIndent() + '%s  msgGen;\n' % receiver[0])
+        stream.write(self.getIndent() + '''%s* msg;
+
+''' % receiver[0])
+        stream.write(self.getIndent() + self.commentLineBeginWith
+                     + ' receive generic message \n')
+        stream.write(self.getIndent()
+                     + 'msgGen.receive(stream,msgBuffer);\n')
+        stream.write(self.getIndent() + self.commentLineBeginWith
+                     + ' create specific message from type \n')
+
+        stream.write(self.getIndent() + 'msg = ')
+        stream.write(self.AST.factory.name + '::'
+                     + self.AST.factory.creator[1] + '(msgGen.%s);\n'
+                     % self.messageTypeGetter)
+
+        stream.write(self.getIndent()
+                     + 'msgBuffer.assumeSizeFromReservedBytes();\n')
+        stream.write(self.getIndent() + 'msg->deserialize(msgBuffer);\n'
+                     )
+        stream.write(self.getIndent() + 'return msg;\n')
         self.unIndent()
-        stream.write(self.getIndent()+("} /* end of %s::%s */ \n\n" % (receiver[1],receiver[2])))
-    
-    def applyToFields(self,stream,fields,applyObject):
+        stream.write(self.getIndent() + '''} /* end of %s::%s */ 
+
+'''
+                     % (receiver[1], receiver[2]))
+
+    def applyToFields(
+        self,
+        stream,
+        fields,
+        applyObject,
+        ):
         for field in fields:
-            if (isinstance(field, GenMsgAST.MessageType.CombinedField)):
+            if isinstance(field, GenMsgAST.MessageType.CombinedField):
                 for cfield in field.fields:
-                    applyObject(stream,cfield)
+                    applyObject(stream, cfield)
             else:
-                applyObject(stream,field)                        
-        
-    def generateBody(self,stream,factoryOnly=False):
+                applyObject(stream, field)
+
+    def generateBody(self, stream, factoryOnly=False):
         """
         Generate the body.
         """
+
         # add necessary standard includes
-        stream.write("#include <vector>\n")
-        stream.write("#include <string>\n")
+
+        stream.write('#include <vector>\n')
+        stream.write('#include <string>\n')
 
         # [Try to] add corresponding header include
-        supposedHeaderName=stream.name
-        if supposedHeaderName != "<stdout>":
-            supposedHeaderName=os.path.basename(supposedHeaderName)
-            supposedHeaderName=os.path.splitext(supposedHeaderName)[0]
-	    stream.write("#include \""+supposedHeaderName+".hh\"\n")
-        # Generate namespace for specified package package 
+
+        supposedHeaderName = stream.name
+        if supposedHeaderName != '<stdout>':
+            supposedHeaderName = os.path.basename(supposedHeaderName)
+            supposedHeaderName = os.path.splitext(supposedHeaderName)[0]
+            stream.write('#include "' + supposedHeaderName + '.hh"\n')
+
+        # Generate namespace for specified package package
         # we may have nested namespace
+
         self.openNamespaces(stream)
-        if not factoryOnly:                        
+        if not factoryOnly:
+
             # Generate message type
-            for msg in self.AST.messages:                                        
-                # Generate Constructor                
-                stream.write(self.getIndent()+"%s::%s() {\n" % (msg.name,msg.name))            
+
+            for msg in self.AST.messages:
+
+                # 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")
-		    else:
-			stream.write(self.getIndent()+"this->type = "+msg.name.upper()+";\n")
-                        
+
+                    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')
+                    else:
+                        stream.write(self.getIndent() + 'this->type = '
+                                + msg.name.upper() + ';\n')
+
                 # Write init value if any was provided
-                if len(msg.fields)>0:
-                    self.applyToFields(stream, msg.fields, self.writeInitFieldStatement)                                         
+
+                if len(msg.fields) > 0:
+                    self.applyToFields(stream, msg.fields,
+                            self.writeInitFieldStatement)
                 self.unIndent()
-                stream.write(self.getIndent()+"}\n\n")
-                # Generate Destructor                
-                stream.write(self.getIndent()+"%s::~%s() {\n" % (msg.name,msg.name))            
+                stream.write(self.getIndent() + '''}
+
+''')
+
+                # Generate Destructor
+
+                stream.write(self.getIndent() + '%s::~%s() {\n'
+                             % (msg.name, msg.name))
                 self.indent()
                 self.unIndent()
-                stream.write(self.getIndent()+"}\n\n")
-                                
+                stream.write(self.getIndent() + '''}
+
+''')
+
                 # write virtual serialize and deserialize
                 # if we have some specific field
-                if len(msg.fields)>0:
-                    # begin serialize method 
-                    stream.write(self.getIndent()+"void %s::serialize(%s& msgBuffer) {\n" % (msg.name,self.serializeBufferType))
+
+                if len(msg.fields) > 0:
+
+                    # begin serialize method
+
+                    stream.write(self.getIndent()
+                                 + 'void %s::serialize(%s& msgBuffer) {\n'
+                                  % (msg.name,
+                                 self.serializeBufferType))
                     self.indent()
                     if msg.hasMerge():
-                        stream.write(self.getIndent()+self.commentLineBeginWith)
-                        stream.write("Call mother class\n")
-                        stream.write(self.getIndent()+"Super::serialize(msgBuffer);\n")
-                    stream.write(self.getIndent()+self.commentLineBeginWith)
-                    stream.write("Specific serialization code\n")
-                    self.applyToFields(stream, msg.fields, self.writeSerializeFieldStatement)                    
+                        stream.write(self.getIndent()
+                                + self.commentLineBeginWith)
+                        stream.write('Call mother class\n')
+                        stream.write(self.getIndent()
+                                + 'Super::serialize(msgBuffer);\n')
+                    stream.write(self.getIndent()
+                                 + self.commentLineBeginWith)
+                    stream.write('Specific serialization code\n')
+                    self.applyToFields(stream, msg.fields,
+                            self.writeSerializeFieldStatement)
                     self.unIndent()
-                    stream.write(self.getIndent()+"}\n\n")
+                    stream.write(self.getIndent() + '''}
+
+''')
+
                     # end serialize method
-                    
+
                     # begin deserialize method
-                    stream.write(self.getIndent()+"void %s::deserialize(%s& msgBuffer) {\n" % (msg.name,self.serializeBufferType))
+
+                    stream.write(self.getIndent()
+                                 + 'void %s::deserialize(%s& msgBuffer) {\n'
+                                  % (msg.name,
+                                 self.serializeBufferType))
                     self.indent()
                     if msg.hasMerge():
-                        stream.write(self.getIndent()+self.commentLineBeginWith)
-                        stream.write("Call mother class\n")
-                        stream.write(self.getIndent()+"Super::deserialize(msgBuffer);\n")
-                    stream.write(self.getIndent()+self.commentLineBeginWith)
-                    stream.write("Specific deserialization code\n")
-                    self.applyToFields(stream, msg.fields, self.writeDeSerializeFieldStatement)                    
+                        stream.write(self.getIndent()
+                                + self.commentLineBeginWith)
+                        stream.write('Call mother class\n')
+                        stream.write(self.getIndent()
+                                + 'Super::deserialize(msgBuffer);\n')
+                    stream.write(self.getIndent()
+                                 + self.commentLineBeginWith)
+                    stream.write('Specific deserialization code\n')
+                    self.applyToFields(stream, msg.fields,
+                            self.writeDeSerializeFieldStatement)
                     self.unIndent()
-                    stream.write(self.getIndent()+"}\n\n")
+                    stream.write(self.getIndent() + '''}
+
+''')
+
                     # end deserialize method
                     # begin show method
-                    stream.write(self.getIndent()+"std::ostream& %s::show(std::ostream& out) {\n" % msg.name)
+
+                    stream.write(self.getIndent()
+                                 + 'std::ostream& %s::show(std::ostream& out) {\n'
+                                  % msg.name)
                     self.indent()
-                    stream.write(self.getIndent()+"out << \"[%s -Begin]\" << std::endl;" % msg.name)
+                    stream.write(self.getIndent()
+                                 + 'out << "[%s -Begin]" << std::endl;'
+                                 % msg.name)
                     if msg.hasMerge():
-                        stream.write(self.getIndent()+self.commentLineBeginWith)
-                        stream.write("Call mother class\n")
-                        stream.write(self.getIndent()+"Super::show(out);\n")
-                    stream.write(self.getIndent()+self.commentLineBeginWith)
-                    stream.write("Specific show code\n")
-                    self.applyToFields(stream, msg.fields, self.writeShowFieldStatement)                  
-                    stream.write(self.getIndent()+"out << \"[%s -End]\" << std::endl;\n" % msg.name)
-                    stream.write(self.getIndent()+"return out;\n")
+                        stream.write(self.getIndent()
+                                + self.commentLineBeginWith)
+                        stream.write('Call mother class\n')
+                        stream.write(self.getIndent()
+                                + 'Super::show(out);\n')
+                    stream.write(self.getIndent()
+                                 + self.commentLineBeginWith)
+                    stream.write('Specific show code\n')
+                    self.applyToFields(stream, msg.fields,
+                            self.writeShowFieldStatement)
+                    stream.write(self.getIndent()
+                                 + 'out << "[%s -End]" << std::endl;\n'
+                                 % msg.name)
+                    stream.write(self.getIndent() + 'return out;\n')
                     self.unIndent()
-                    stream.write(self.getIndent()+"}\n\n")
+                    stream.write(self.getIndent() + '''}
+
+''')
+
                     # end show method
-                    
+
         # Generate Factory (if any)
         # @todo
-        if self.AST.hasFactory():                                                             
-            # begin creator                                                      
+
+        if self.AST.hasFactory():
+
+            # begin creator
+
             self.writeFactoryCreator(stream)
+
             # begin receiver
-	    if self.AST.factory.hasFactoryReceiver():
-                self.writeFactoryReceiver(stream)                                                            
-                        
+
+            if self.AST.factory.hasFactoryReceiver():
+                self.writeFactoryReceiver(stream)
+
         self.closeNamespaces(stream)
-        
-class CXXCERTIMessageGenerator(CXXCERTIGenerator):    
+
+
+class CXXCERTIMessageGenerator(CXXCERTIGenerator):
+
     """
     This is a C++ generator for C{MessageAST}.
     
-    """               
+    """
+
     def generatorName(cls):
-        return "CXXCERTIMessage"
+        return 'CXXCERTIMessage'
+
     generatorName = classmethod(generatorName)
-        
-    def __init__(self,MessageAST):
-        super(CXXCERTIMessageGenerator,self).__init__(MessageAST)   
+
+    def __init__(self, MessageAST):
+        super(CXXCERTIMessageGenerator, self).__init__(MessageAST)
         self.replacePrefix = list()
-        self.replacePrefix.append("M_")
-        self.replacePrefix.append("Message::")
-        self.exportPrefix = "CERTI_EXPORT"   
-	self.serializeBufferType = "libhla::MessageBuffer"
-	self.messageTypeGetter = "getMessageType()"
-	self.exception = ["NetworkError","NetworkSignal"]
-
-class CXXCERTINetworkMessageGenerator(CXXCERTIGenerator):    
+        self.replacePrefix.append('M_')
+        self.replacePrefix.append('Message::')
+        self.exportPrefix = 'CERTI_EXPORT'
+        self.serializeBufferType = 'libhla::MessageBuffer'
+        self.messageTypeGetter = 'getMessageType()'
+        self.exception = ['NetworkError', 'NetworkSignal']
+
+
+class CXXCERTINetworkMessageGenerator(CXXCERTIGenerator):
+
     """
     This is a C++ generator for C{MessageAST}.
     
-    """               
+    """
+
     def generatorName(cls):
-        return "CXXCERTINetworkMessage"
+        return 'CXXCERTINetworkMessage'
+
     generatorName = classmethod(generatorName)
-    
-    def __init__(self,MessageAST):
-        super(CXXCERTINetworkMessageGenerator,self).__init__(MessageAST)   
+
+    def __init__(self, MessageAST):
+        super(CXXCERTINetworkMessageGenerator,
+              self).__init__(MessageAST)
         self.replacePrefix = list()
-        self.replacePrefix.append("NM_")
-        self.replacePrefix.append("NetworkMessage::")     
-        self.exportPrefix = "CERTI_EXPORT"
-        self.serializeBufferType = "libhla::MessageBuffer"
-	self.messageTypeGetter = "getMessageType()"
-	self.exception = ["NetworkError","NetworkSignal"]
+        self.replacePrefix.append('NM_')
+        self.replacePrefix.append('NetworkMessage::')
+        self.exportPrefix = 'CERTI_EXPORT'
+        self.serializeBufferType = 'libhla::MessageBuffer'
+        self.messageTypeGetter = 'getMessageType()'
+        self.exception = ['NetworkError', 'NetworkSignal']
 
 
diff --git a/scripts/GenMsgJava.py b/scripts/GenMsgJava.py
index da5f7c2..7292fb4 100644
--- a/scripts/GenMsgJava.py
+++ b/scripts/GenMsgJava.py
@@ -1,3 +1,5 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
 ## ----------------------------------------------------------------------------
 ## CERTI - HLA RunTime Infrastructure
 ## Copyright (C) 2002-2005  ONERA
@@ -24,26 +26,33 @@
 The CERTI Message Generator.
 Java Backend Generator
 """
+
 import logging
 import GenMsgBase
 import GenMsgAST
 import sys
 
+
 class JavaGenerator(GenMsgBase.CodeGenerator):
+
     """
     This is a Java generator for C{MessageAST}.
     """
-    
+
     def generatorName(cls):
-        return "Java"    
+        return 'Java'
+
     generatorName = classmethod(generatorName)
-    
+
     def __init__(self, MessageAST):
-        super(JavaGenerator, self).__init__(MessageAST, "//")
+        super(JavaGenerator, self).__init__(MessageAST, '//')
+
         # Message builtin type to Java type
         # Note that java integer type are ALL signed:
         # http://java.sun.com/docs/books/tutorial/java/nutsandbolts/datatypes.html
-        self.builtinTypeMap = {'onoff': 'boolean',
+
+        self.builtinTypeMap = {  # 'FederateHandleSet': 'FederateHandleSet',
+            'onoff': 'boolean',
             'bool': 'boolean',
             'string': 'String',
             'byte': 'byte',
@@ -60,9 +69,10 @@ class JavaGenerator(GenMsgBase.CodeGenerator):
             'Tag': 'byte[]',
             'Extents': 'List<CertiExtent>',
             'SuppliedParameters': 'SuppliedParameters',
-            #'FederateHandleSet': 'FederateHandleSet',
-            'Regions': 'List<Long>'}
-        self.serializeTypeMap = {'onoff': 'messageBuffer.write(%s);',
+            'Regions': 'List<Long>',
+            }
+        self.serializeTypeMap = {
+            'onoff': 'messageBuffer.write(%s);',
             'bool': 'messageBuffer.write(%s);',
             'string': 'messageBuffer.write(%s);',
             'byte': 'messageBuffer.write(%s);',
@@ -81,10 +91,12 @@ class JavaGenerator(GenMsgBase.CodeGenerator):
             'SuppliedAttributes': 'messageBuffer.write(%s);',
             'SuppliedParameters': 'messageBuffer.write(%s);',
             'FederateHandleSet': 'messageBuffer.write(%s);',
-            'LogicalTimeInterval':'messageBuffer.write(%s);',
+            'LogicalTimeInterval': 'messageBuffer.write(%s);',
             'Extents': 'messageBuffer.write(%s);',
-            'Regions': 'messageBuffer.writeRegions(%s);'}
-        self.deserializeTypeMap = {'onoff': '%s = messageBuffer.readBoolean();',
+            'Regions': 'messageBuffer.writeRegions(%s);',
+            }
+        self.deserializeTypeMap = {
+            'onoff': '%s = messageBuffer.readBoolean();',
             'bool': '%s = messageBuffer.readBoolean();',
             'string': '%s = messageBuffer.readString();',
             'byte': '%s = messageBuffer.readByte();',
@@ -103,15 +115,19 @@ class JavaGenerator(GenMsgBase.CodeGenerator):
             'SuppliedAttributes': '%s = messageBuffer.readSuppliedAttributes();',
             'SuppliedParameters': '%s = messageBuffer.readSuppliedParameters();',
             'FederateHandleSet': '%s = messageBuffer.readFederateHandleSet();',
-            'LogicalTimeInterval':'%s = messageBuffer.readLogicalTimeInterval();',
+            'LogicalTimeInterval': '%s = messageBuffer.readLogicalTimeInterval();',
             'Extents': '%s = messageBuffer.readExtents();',
-            'Regions': '%s = messageBuffer.readRegions();'}
+            'Regions': '%s = messageBuffer.readRegions();',
+            }
 
     def writeFieldStatement(self, stream, field):
         if field.hasDefaultValue():
-            stream.write(self.getTargetTypeName(field.typeid.name) + " " + field.name + "=" + str(field.defaultValue) + ";\n")
+            stream.write(self.getTargetTypeName(field.typeid.name) + ' '
+                          + field.name + '=' + str(field.defaultValue)
+                         + ';\n')
         else:
-            stream.write(self.getTargetTypeName(field.typeid.name) + " " + field.name + ";\n")
+            stream.write(self.getTargetTypeName(field.typeid.name) + ' '
+                          + field.name + ';\n')
 
     def generateIncludes(self, stream):
         stream.write("""import certi.communication.CertiException;
@@ -130,19 +146,25 @@ import hla.rti.SuppliedParameters;
 import certi.rti.impl.CertiLogicalTime;
 import certi.rti.impl.CertiLogicalTimeInterval;
 import hla.rti.LogicalTime;
-import hla.rti.LogicalTimeInterval;\n\n""")
+import hla.rti.LogicalTimeInterval;
+
+""")
 
     def generateHeader(self, stream, factoryOnly=False):
         for native in self.AST.natives:
-            if native.hasLanguage("Java"):                               
+            if native.hasLanguage('Java'):
+
                 # This an example may be it would be worth to check whether if the
-                # refered native types are valids?  
-                for line in native.getLanguageLines("Java"):
-                    stream.write("Found native **" + line.statement + "**\n")
+                # refered native types are valids?
+
+                for line in native.getLanguageLines('Java'):
+                    stream.write('Found native **' + line.statement
+                                 + '**\n')
 
     def prepareName(self, name):
-        upperAfterScore = lambda x:__import__('re').sub(r'_(.)', lambda y:y.group(0).upper(), x)
-        return upperAfterScore(name.lower()).replace("_", "")[1:]
+        upperAfterScore = lambda x: __import__('re').sub(r'_(.)',
+                lambda y: y.group(0).upper(), x)
+        return upperAfterScore(name.lower()).replace('_', '')[1:]
 
     def getSerializeMethodName(self, name):
         if name in self.serializeTypeMap.keys():
@@ -151,7 +173,7 @@ import hla.rti.LogicalTimeInterval;\n\n""")
             representation = self.getRepresentationFor(name)
             if representation:
                 return self.getSerializeMethodName(representation)
-        print "No serialize method name for <%s> " % name            
+        print 'No serialize method name for <%s> ' % name
         return None
 
     def getDeSerializeMethodName(self, name):
@@ -177,7 +199,8 @@ import hla.rti.LogicalTimeInterval;\n\n""")
         """
 
         for msg in self.AST.messages:
-            file = open("messages/" + self.prepareName(msg.name) + ".java", "w")
+            file = open('messages/' + self.prepareName(msg.name)
+                        + '.java', 'w')
 
             file.write("""// ----------------------------------------------------------------------------
 // CERTI - HLA Run Time Infrastructure
@@ -201,113 +224,196 @@ import hla.rti.LogicalTimeInterval;\n\n""")
 """)
 
             if self.AST.hasPackage():
-                file.write("package " + self.AST.package.name + ";\n\n")
-            self.generateIncludes(file);
-            file.write(self.getIndent() + "public class " + self.prepareName(msg.name) + " extends CertiMessage {\n")
+                file.write('package ' + self.AST.package.name
+                           + ''';
+
+''')
+            self.generateIncludes(file)
+            file.write(self.getIndent() + 'public class '
+                       + self.prepareName(msg.name)
+                       + ' extends CertiMessage {\n')
             self.indent()
 
             if len(msg.fields) > 0:
                 for field in msg.fields:
-                    file.write(self.getIndent() + "private ");
+                    file.write(self.getIndent() + 'private ')
+
                     # Combined field and "plain" field must not be treated the same way
-                    if not isinstance(field,GenMsgAST.MessageType.CombinedField):
+
+                    if not isinstance(field,
+                            GenMsgAST.MessageType.CombinedField):
                         self.writeFieldStatement(file, field)
                     else:
+
                         # combined field may be written in a specific way
                         # or the field contained in the combined field may
-                        # be written as usual and Getter/Setter for the combined may be 
+                        # be written as usual and Getter/Setter for the combined may be
                         # generated
+
                         for cfield in field.fields:
                             self.writeFieldStatement(file, cfield)
 
-            file.write("\n")
-            #constructor
-            file.write(self.getIndent() + "public " + self.prepareName(msg.name) + "() {\n")
+            file.write('\n')
+
+            # constructor
+
+            file.write(self.getIndent() + 'public '
+                       + self.prepareName(msg.name) + '() {\n')
             self.indent()
-            file.write(self.getIndent() + "super(CertiMessageType." + msg.name.upper()[2:] + ");\n")
+            file.write(self.getIndent() + 'super(CertiMessageType.'
+                       + msg.name.upper()[2:] + ');\n')
             self.unIndent()
-            file.write(self.getIndent() + "}\n\n");
+            file.write(self.getIndent() + '''}
+
+''')
 
-            file.write(self.getIndent() + "public " + self.prepareName(msg.name) + "(CertiLogicalTime federationTime) {\n")
+            file.write(self.getIndent() + 'public '
+                       + self.prepareName(msg.name)
+                       + '(CertiLogicalTime federationTime) {\n')
             self.indent()
-            file.write(self.getIndent() + "super(CertiMessageType." + msg.name.upper()[2:] + ", federationTime);\n")
+            file.write(self.getIndent() + 'super(CertiMessageType.'
+                       + msg.name.upper()[2:] + ', federationTime);\n')
             self.unIndent()
-            file.write(self.getIndent() + "}\n\n");
+            file.write(self.getIndent() + '''}
 
+''')
 
-            #file.write(self.getIndent() + "public " + self.prepareName(msg.name) + "(double federationTime, attributes) {\n")
-            #TODO attributes in constructor
-            #self.indent()
-            #file.write(self.getIndent() + "super(CertiMessageType." + msg.name.upper()[2:] + ", federationTime);\n")
+            # file.write(self.getIndent() + "public " + self.prepareName(msg.name) + "(double federationTime, attributes) {\n")
+            # TODO attributes in constructor
+            # self.indent()
+            # file.write(self.getIndent() + "super(CertiMessageType." + msg.name.upper()[2:] + ", federationTime);\n")
 
-            #TODO initialize local attributes
-            #self.unIndent()
-            #file.write(self.getIndent() + "}\n\n");
+            # TODO initialize local attributes
+            # self.unIndent()
+            # file.write(self.getIndent() + "}\n\n");
 
             if len(msg.fields) > 0:
-                file.write(self.getIndent() + "@Override\n")
-                file.write(self.getIndent() + "public void writeMessage(MessageBuffer messageBuffer) {\n")
+                file.write(self.getIndent() + '@Override\n')
+                file.write(self.getIndent()
+                           + 'public void writeMessage(MessageBuffer messageBuffer) {\n'
+                           )
                 self.indent()
-                file.write(self.getIndent() + "super.writeMessage(messageBuffer); //Header\n\n");
+                file.write(self.getIndent()
+                           + '''super.writeMessage(messageBuffer); //Header
+
+''')
 
                 for field in msg.fields:
+
                     # Combined field and "plain" field must not be treated the same way
-                    if not isinstance(field,GenMsgAST.MessageType.CombinedField):
-                        file.write(self.getIndent() + self.getSerializeMethodName(field.typeid.name) % field.name + "\n")                                            
+
+                    if not isinstance(field,
+                            GenMsgAST.MessageType.CombinedField):
+                        file.write(self.getIndent()
+                                   + self.getSerializeMethodName(field.typeid.name)
+                                   % field.name + '\n')
                     else:
+
                         # FIXME TODO
+
                         for cfield in field.fields:
-                            pass                    
+                            pass
 
                 self.unIndent()
-                file.write(self.getIndent() + "}\n\n");
+                file.write(self.getIndent() + '''}
 
-                file.write(self.getIndent() + "@Override\n")
-                file.write(self.getIndent() + "public void readMessage(MessageBuffer messageBuffer) throws CertiException {\n")
+''')
+
+                file.write(self.getIndent() + '@Override\n')
+                file.write(self.getIndent()
+                           + 'public void readMessage(MessageBuffer messageBuffer) throws CertiException {\n'
+                           )
                 self.indent()
-                file.write(self.getIndent() + "super.readMessage(messageBuffer); //Header \n\n");
+                file.write(self.getIndent()
+                           + '''super.readMessage(messageBuffer); //Header 
+
+''')
 
                 for field in msg.fields:
+
                     # Combined field and "plain" field must not be treated the same way
-                    if not isinstance(field,GenMsgAST.MessageType.CombinedField):
-                        file.write(self.getIndent() + self.getDeSerializeMethodName(field.typeid.name) % field.name + "\n")                        
+
+                    if not isinstance(field,
+                            GenMsgAST.MessageType.CombinedField):
+                        file.write(self.getIndent()
+                                   + self.getDeSerializeMethodName(field.typeid.name)
+                                   % field.name + '\n')
                     else:
+
                         # FIXME TODO
+
                         for cfield in field.fields:
-                            pass                
+                            pass
 
                 self.unIndent()
-                file.write(self.getIndent() + "}\n\n");
+                file.write(self.getIndent() + '''}
 
-                file.write(self.getIndent() + "@Override\n")
-                file.write(self.getIndent() + "public String toString() {\n")
+''')
+
+                file.write(self.getIndent() + '@Override\n')
+                file.write(self.getIndent()
+                           + 'public String toString() {\n')
                 self.indent()
-                file.write(self.getIndent() + "return (super.toString()");
+                file.write(self.getIndent() + 'return (super.toString()'
+                           )
                 for field in msg.fields:
-                    file.write(" + \", " + field.name + ": \" + " + field.name)
-                file.write(");\n")
+                    file.write(' + ", ' + field.name + ': " + '
+                               + field.name)
+                file.write(');\n')
                 self.unIndent()
-                file.write(self.getIndent() + "}\n\n");
+                file.write(self.getIndent() + '''}
+
+''')
+
+                # GETTERS
 
-                #GETTERS
                 for field in msg.fields:
+
                     # Combined field and "plain" field must not be treated the same way
-                    if not isinstance(field,GenMsgAST.MessageType.CombinedField):
-                        file.write(self.getIndent() + "public " + self.getTargetTypeName(field.typeid.name) + " get" + field.name[0].capitalize() + field.name[1:] + "() {\n");
+
+                    if not isinstance(field,
+                            GenMsgAST.MessageType.CombinedField):
+                        file.write(self.getIndent() + 'public '
+                                   + self.getTargetTypeName(field.typeid.name)
+                                   + ' get'
+                                   + field.name[0].capitalize()
+                                   + field.name[1:] + '() {\n')
                         self.indent()
-                        file.write(self.getIndent() + "return " + field.name + ";\n")
+                        file.write(self.getIndent() + 'return '
+                                   + field.name + ';\n')
                         self.unIndent()
-                        file.write(self.getIndent() + "}\n\n")
+                        file.write(self.getIndent() + '''}
+
+''')
+
+                # SETTERS
 
-                #SETTERS
                 for field in msg.fields:
+
                     # Combined field and "plain" field must not be treated the same way
-                    if not isinstance(field,GenMsgAST.MessageType.CombinedField):
-                        file.write(self.getIndent() + "public void set" + field.name[0].capitalize() + field.name[1:] + "(" + self.getTargetTypeName(field.typeid.name) + " new" + field.name[0].capitalize() + field.name[1:] + ") {\n");
+
+                    if not isinstance(field,
+                            GenMsgAST.MessageType.CombinedField):
+                        file.write(self.getIndent() + 'public void set'
+                                   + field.name[0].capitalize()
+                                   + field.name[1:] + '('
+                                   + self.getTargetTypeName(field.typeid.name)
+                                   + ' new'
+                                   + field.name[0].capitalize()
+                                   + field.name[1:] + ') {\n')
                         self.indent()
-                        file.write(self.getIndent() + "this." + field.name + " = new" + field.name[0].capitalize() + field.name[1:] + ";\n")
+                        file.write(self.getIndent() + 'this.'
+                                   + field.name + ' = new'
+                                   + field.name[0].capitalize()
+                                   + field.name[1:] + ';\n')
                         self.unIndent()
-                        file.write(self.getIndent() + "}\n\n")
+                        file.write(self.getIndent() + '''}
+
+''')
+
+            file.write('''}
 
-            file.write("}\n\n")
+''')
             self.unIndent()
+
+
diff --git a/scripts/GenMsgPython.py b/scripts/GenMsgPython.py
index c049fd2..6939092 100644
--- a/scripts/GenMsgPython.py
+++ b/scripts/GenMsgPython.py
@@ -1,3 +1,5 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
 ## ----------------------------------------------------------------------------
 ## CERTI - HLA RunTime Infrastructure
 ## Copyright (C) 2002-2005  ONERA
@@ -24,20 +26,24 @@
 The CERTI Message Generator.
 Python Backend Generator
 """
+
 import logging
-import GenMsgBase       
-                           
+import GenMsgBase
+
+
 class PythonGenerator(GenMsgBase.CodeGenerator):
+
     """
     This is a Python generator for C{MessageAST}.
     """
-    
+
     def generatorName(cls):
-        return "Python"    
+        return 'Python'
+
     generatorName = classmethod(generatorName)
-    
-    
-    def __init__(self,MessageAST):
-        super(PythonGenerator,self).__init__(MessageAST,"##")
+
+    def __init__(self, MessageAST):
+        super(PythonGenerator, self).__init__(MessageAST, '##')
+
+
         # Message builtin type to Python type
-        
\ No newline at end of file
diff --git a/scripts/GenerateMessages.py b/scripts/GenerateMessages.py
index 97df5da..eaa3843 100755
--- a/scripts/GenerateMessages.py
+++ b/scripts/GenerateMessages.py
@@ -1,4 +1,5 @@
-#!/usr/bin/env python
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
 
 ## ----------------------------------------------------------------------------
 ## CERTI - HLA RunTime Infrastructure
@@ -46,32 +47,46 @@ TBD
 """
 
 import os
-import getopt, sys
+import getopt
+import sys
 import datetime
-# We use PLY in order to parse CERTI message specification files 
+
+# We use PLY in order to parse CERTI message specification files
 # PLY is there: http://www.dabeaz.com/ply/
+
 import ply.yacc
 import ply.lex
-# We need some regular expression handling 
+
+# We need some regular expression handling
+
 import re
+
 # We use logging for ... logging :-)
 # see http://docs.python.org/library/logging.html
-import logging 
+
+import logging
 
 # Build some logger related objects
+
 stdoutHandler = logging.StreamHandler(sys.stdout)
+
 # See formatting there:
 # http://docs.python.org/library/datetime.html#strftime-behavior
 # http://docs.python.org/library/logging.html#formatter-objects
-stdoutHandler.setFormatter(logging.Formatter("%(asctime)s.%(msecs)d-[%(name)s::%(levelname)s] %(message)s","%a %H:%M:%S"))
-mainlogger = logging.Logger("Main")
+
+stdoutHandler.setFormatter(logging.Formatter('%(asctime)s.%(msecs)d-[%(name)s::%(levelname)s] %(message)s'
+                           , '%a %H:%M:%S'))
+mainlogger = logging.Logger('Main')
 mainlogger.setLevel(logging.ERROR)
 mainlogger.addHandler(stdoutHandler)
 
 # Load AST related classes
+
 import GenMsgAST
+
 # Load backend specific language generator
 # FIXME TODO: implement automatic loading of additionnal languages
+
 import GenMsgBase
 import GenMsgCXX
 import GenMsgPython
@@ -79,165 +94,211 @@ import GenMsgJava
 import GenMsgAST
 
 generatorBackends = dict()
-generatorBackends[GenMsgBase.MsgSpecGenerator.generatorName().lower()] = GenMsgBase.MsgSpecGenerator
-generatorBackends[GenMsgCXX.CXXCERTIGenerator.generatorName().lower()] = GenMsgCXX.CXXCERTIGenerator
-generatorBackends[GenMsgCXX.CXXCERTIMessageGenerator.generatorName().lower()] = GenMsgCXX.CXXCERTIMessageGenerator
-generatorBackends[GenMsgCXX.CXXCERTINetworkMessageGenerator.generatorName().lower()] = GenMsgCXX.CXXCERTINetworkMessageGenerator
-generatorBackends[GenMsgPython.PythonGenerator.generatorName().lower()] = GenMsgPython.PythonGenerator
-generatorBackends[GenMsgJava.JavaGenerator.generatorName().lower()] = GenMsgJava.JavaGenerator
+generatorBackends[GenMsgBase.MsgSpecGenerator.generatorName().lower()] = \
+    GenMsgBase.MsgSpecGenerator
+generatorBackends[GenMsgCXX.CXXCERTIGenerator.generatorName().lower()] = \
+    GenMsgCXX.CXXCERTIGenerator
+generatorBackends[GenMsgCXX.CXXCERTIMessageGenerator.generatorName().lower()] = \
+    GenMsgCXX.CXXCERTIMessageGenerator
+generatorBackends[GenMsgCXX.CXXCERTINetworkMessageGenerator.generatorName().lower()] = \
+    GenMsgCXX.CXXCERTINetworkMessageGenerator
+generatorBackends[GenMsgPython.PythonGenerator.generatorName().lower()] = \
+    GenMsgPython.PythonGenerator
+generatorBackends[GenMsgJava.JavaGenerator.generatorName().lower()] = \
+    GenMsgJava.JavaGenerator
+
 
 def usage():
-    print "Usage:\n%s --input=<message> [--language=<lang>] [--type=header|body] [--factory-only] [--output=<filename>] [--verbose] [--help]" % os.path.basename(sys.argv[0])
-    print "   Supported target languages are:"
+    print 'Usage:\n%s --input=<message> [--language=<lang>] [--type=header|body] [--factory-only] [--output=<filename>] [--verbose] [--help]' \
+        % os.path.basename(sys.argv[0])
+    print '   Supported target languages are:'
     for gene in generatorBackends.values():
-        print "       - " + gene.generatorName() 
-    
+        print '       - ' + gene.generatorName()
+
+
 try:
-    opts, args = getopt.getopt(sys.argv[1:], "i:l:t:o:vh", ["input=","language=","type=","factory-only","output=","verbose","help"])
+    (opts, args) = getopt.getopt(sys.argv[1:], 'i:l:t:o:vh', [
+        'input=',
+        'language=',
+        'type=',
+        'factory-only',
+        'output=',
+        'verbose',
+        'help',
+        ])
 except getopt.GetoptError, err:
-    mainlogger.error("opt = %s, msg = %s" % (err.opt,err.msg))    
+    mainlogger.error('opt = %s, msg = %s' % (err.opt, err.msg))
     usage()
     sys.exit(2)
 
 if len(opts) < 1:
     usage()
     sys.exit(2)
-    
+
 # default values for command line options
-verbose     = False
+
+verbose = False
 factoryOnly = False
-gentype     = "header"
-language    = GenMsgBase.MsgSpecGenerator.generatorName()
-output      = sys.stdout
-inputFile   = None
+gentype = 'header'
+language = GenMsgBase.MsgSpecGenerator.generatorName()
+output = sys.stdout
+inputFile = None
 
 # Parse command line options
-for o, a in opts:
-    if o in ("-i", "--input"):
-        inputFile=a
-    if o in ("-l", "--language"):
-        language=a
-    if o in ("-t", "--type"):
-        gentype=a
-    if o in ("-f", "--factory-only"):
-        factoryOnly=True
-    if o in ("-o", "--output"):        
-        output=open(a,mode="w")
-    if o in ("-v", "--verbose"):
-        verbose=True
+
+for (o, a) in opts:
+    if o in ('-i', '--input'):
+        inputFile = a
+    if o in ('-l', '--language'):
+        language = a
+    if o in ('-t', '--type'):
+        gentype = a
+    if o in ('-f', '--factory-only'):
+        factoryOnly = True
+    if o in ('-o', '--output'):
+        output = open(a, mode='w')
+    if o in ('-v', '--verbose'):
+        verbose = True
         mainlogger.setLevel(logging.INFO)
-    if o in ("-h", "--help"):
+    if o in ('-h', '--help'):
         usage()
         sys.exit(0)
-        
-mainlogger.info("Reading message specifications from: <%s>" % inputFile)       
-mainlogger.info("output send to: <%s>" % repr(output.name))
-mainlogger.info("Generating for language: <%s>" % language)
+
+mainlogger.info('Reading message specifications from: <%s>' % inputFile)
+mainlogger.info('output send to: <%s>' % repr(output.name))
+mainlogger.info('Generating for language: <%s>' % language)
 
 # Lexer+Parser specification begins here
 # reserved keywords
+
 reserved = {
-   'package'        : 'PACKAGE',
-   'version'        : 'VERSION',
-   'factory'        : 'FACTORY',
-   'factoryCreator' : 'FACTORY_CREATOR',
-   'factoryReceiver': 'FACTORY_RECEIVER',   
-   'native'   : 'NATIVE',
-   'language' : 'LANGUAGE',            
-   'message'  : 'MESSAGE',
-   'merge'    : 'MERGE',
-   'enum'     : 'ENUM',
-   'default'  : 'DEFAULT',
-   'representation' : 'REPRESENTATION',            
-   'required' : 'REQUIRED',
-   'optional' : 'OPTIONAL',
-   'repeated' : 'REPEATED',
-   'combine'  : 'COMBINE',
-   'onoff'    : 'ONOFF_T',
-   'bool'     : 'BOOL_T',
-   'string'   : 'STRING_T',
-   'byte'     : 'BYTE_T',
-   'int8'     : 'INT8_T',
-   'uint8'    : 'UINT8_T',
-   'int16'    : 'INT16_T',
-   'uint16'   : 'UINT16_T',
-   'int32'    : 'INT32_T',
-   'uint32'   : 'UINT32_T',   
-   'int64'    : 'INT64_T',
-   'uint64'   : 'UINT64_T',
-   'float'    : 'FLOAT_T',
-   'double'   : 'DOUBLE_T', 
-}
+    'package': 'PACKAGE',
+    'version': 'VERSION',
+    'factory': 'FACTORY',
+    'factoryCreator': 'FACTORY_CREATOR',
+    'factoryReceiver': 'FACTORY_RECEIVER',
+    'native': 'NATIVE',
+    'language': 'LANGUAGE',
+    'message': 'MESSAGE',
+    'merge': 'MERGE',
+    'enum': 'ENUM',
+    'default': 'DEFAULT',
+    'representation': 'REPRESENTATION',
+    'required': 'REQUIRED',
+    'optional': 'OPTIONAL',
+    'repeated': 'REPEATED',
+    'combine': 'COMBINE',
+    'onoff': 'ONOFF_T',
+    'bool': 'BOOL_T',
+    'string': 'STRING_T',
+    'byte': 'BYTE_T',
+    'int8': 'INT8_T',
+    'uint8': 'UINT8_T',
+    'int16': 'INT16_T',
+    'uint16': 'UINT16_T',
+    'int32': 'INT32_T',
+    'uint32': 'UINT32_T',
+    'int64': 'INT64_T',
+    'uint64': 'UINT64_T',
+    'float': 'FLOAT_T',
+    'double': 'DOUBLE_T',
+    }
 
 # List of token names.   This is always required
-tokens = ['ID',                          
-          'COMMENT',
-          'INTEGER_VALUE',
-          'FLOAT_VALUE',
-          'BOOL_VALUE',      
-          'STRING_VALUE',    
-          'RBRACE','LBRACE',
-          'RPAREN','LPAREN',
-#          'RBRACKET','LBRACKET',
-          'COMMA',
-          'EQUAL',
-          'COLON',
-          'PERIOD',
-#          'NEWLINE',
-          'LANGLINE',
-          ] + list(reserved.values())
-
-# This is a message of field or name identifier          
+
+tokens = [  #          'RBRACKET','LBRACKET',
+            #          'NEWLINE',
+    'ID',
+    'COMMENT',
+    'INTEGER_VALUE',
+    'FLOAT_VALUE',
+    'BOOL_VALUE',
+    'STRING_VALUE',
+    'RBRACE',
+    'LBRACE',
+    'RPAREN',
+    'LPAREN',
+    'COMMA',
+    'EQUAL',
+    'COLON',
+    'PERIOD',
+    'LANGLINE',
+    ] + list(reserved.values())
+
+# This is a message of field or name identifier
+
+
 def t_ID(t):
-    r'[a-zA-Z_][a-zA-Z_0-9]*'
-    if re.match( "^true$|^false$|^True$|^False$|^On$|^on$|^Off$|^off$",t.value):
+    r'''[a-zA-Z_][a-zA-Z_0-9]*'''
+
+    if re.match('^true$|^false$|^True$|^False$|^On$|^on$|^Off$|^off$',
+                t.value):
         t.type = 'BOOL_VALUE'
     else:
-        t.type = reserved.get(t.value,'ID') # Check for reserved words  
+        t.type = reserved.get(t.value, 'ID')  # Check for reserved words
     return t
 
+
 # Comment begins with // and ends up at the end of the line
+
+
 def t_COMMENT(t):
-    r'//.*'
+    r'''//.*'''
+
     return t
-    #pass
-    # if pass No return value. Comments are discarded    
-def t_INTEGER_VALUE(t): 
-    r'\d+'     
-    try: 
-        t.value = int(t.value) 
-    except ValueError: 
-        print "Integer value too large", t.value 
-        t.value = 0 
+
+
+    # pass
+    # if pass No return value. Comments are discarded
+
+
+def t_INTEGER_VALUE(t):
+    r'''\d+'''
+
+    try:
+        t.value = int(t.value)
+    except ValueError:
+        print 'Integer value too large', t.value
+        t.value = 0
     return t
-def t_FLOAT_VALUE(t): 
-    r'\d+\.\d+' 
-    try: 
-        t.value = float(t.value) 
-    except ValueError: 
-        print "Float value too large", t.value 
+
+
+def t_FLOAT_VALUE(t):
+    r'''\d+\.\d+'''
+
+    try:
+        t.value = float(t.value)
+    except ValueError:
+        print 'Float value too large', t.value
         t.value = 0.0
     return t
 
-def t_BOOL_VALUE(t): 
-    r'true|false|True|False|On|on|Off|off'     
-    if t.value.lower()=="true" or t.value.lower()=="on":        
+
+def t_BOOL_VALUE(t):
+    r'''true|false|True|False|On|on|Off|off'''
+
+    if t.value.lower() == 'true' or t.value.lower() == 'on':
         t.value = True
-    elif t.value.lower()=="false" or t.value.lower()=="off" :
+    elif t.value.lower() == 'false' or t.value.lower() == 'off':
+        t.value = False
+    else:
+        t.lexer.logger.error('Invalid Boolean value too large', t.value)
         t.value = False
-    else:                
-        t.lexer.logger.error("Invalid Boolean value too large", t.value) 
-        t.value = False 
     return t
 
+
 def t_STRING_VALUE(t):
-    r'\".*\"'
+    r'''\".*\"'''
+
     return t
-    
+
+
 t_LBRACE = r'{'
 t_RBRACE = r'}'
-#t_LBRACKET = r'\['
-#t_RBRACKET = r'\]'
+
+# t_LBRACKET = r'\['
+# t_RBRACKET = r'\]'
+
 t_LPAREN = r'\('
 t_RPAREN = r'\)'
 t_COMMA = r','
@@ -246,34 +307,48 @@ t_COLON = r':'
 t_PERIOD = r'\.'
 
 # Define a rule so we can track line numbers
+
+
 def t_NEWLINE(t):
-    r'\n'
+    r'''\n'''
+
     t.lexer.lineno += 1
-    
+
+
 def t_LANGLINE(t):
-    r'\[.*\]'
+    r'''\[.*\]'''
+
     return t
-    
+
+
 # A string containing ignored characters (spaces and tabs)
-t_ignore  = ' \t'
+
+t_ignore = ' \t'
 
 # Error handling rule
+
+
 def t_error(t):
     t.lexer.logger.error("Illegal character '%s'" % t.value[0])
     t.lexer.skip(1)
 
+
 # Build the PLY lexer
-lexerlogger = logging.Logger("Lexer")
+
+lexerlogger = logging.Logger('Lexer')
 lexerlogger.setLevel(logging.ERROR)
 lexerlogger.addHandler(stdoutHandler)
 lexer = ply.lex.lex(debug=False)
 lexer.logger = lexerlogger
-            
+
+
 def p_statement_list(p):
     '''statement_list : statement 
                       | statement statement_list'''
+
     p.parser.AST.add(p[1])
 
+
 def p_statement(p):
     '''statement : comment_block
                  | package
@@ -281,193 +356,240 @@ def p_statement(p):
                  | factory
                  | message                 
                  | native                 
-                 | enum'''        
-    p[0]=p[1]                            
-        
+                 | enum'''
+
+    p[0] = p[1]
+
+
 def p_comment_block(p):
     '''comment_block : COMMENT
                      | COMMENT comment_block'''
-    if len(p)==2:                 
-        p[0]=GenMsgAST.CommentBlock(p[1].strip('/'),isAtEOL=False)
+
+    if len(p) == 2:
+        p[0] = GenMsgAST.CommentBlock(p[1].strip('/'), isAtEOL=False)
     else:
-        p[0]=p[2]
-        p[0].lines.append(p[1].strip('/'))        
-    
+        p[0] = p[2]
+        p[0].lines.append(p[1].strip('/'))
+
+
 def p_package(p):
-    '''package : PACKAGE package_id'''    
-    p[0]=GenMsgAST.Package(p[2])
-    p[0].linespan = (p.linespan(1)[0],p.linespan(2)[1])
-    
+    '''package : PACKAGE package_id'''
+
+    p[0] = GenMsgAST.Package(p[2])
+    p[0].linespan = (p.linespan(1)[0], p.linespan(2)[1])
+
+
 def p_package_id(p):
     '''package_id : ID 
                   | ID PERIOD package_id'''
-    if len(p)==2:
-        p[0]=p[1]
+
+    if len(p) == 2:
+        p[0] = p[1]
     else:
-        p[0]=p[1]+"."+p[3]
+        p[0] = p[1] + '.' + p[3]
+
 
 def p_version(p):
     '''version : VERSION INTEGER_VALUE PERIOD INTEGER_VALUE'''
-    p[0]=GenMsgAST.Version((p[2],p[4]))
+
+    p[0] = GenMsgAST.Version((p[2], p[4]))
+
 
 def p_factory(p):
     '''factory : FACTORY ID LBRACE factory_creator factory_receiver RBRACE
                | FACTORY ID LBRACE factory_creator RBRACE'''
-    
-    
-    if len(p)==7:
-	p[0] = GenMsgAST.Factory(p[2],p[4],p[5])
-        p[0].linespan = (p.linespan(1)[0],p.linespan(6)[1])
-	
-    elif len(p)==6:
-	p[0] = GenMsgAST.Factory(p[2],p[4])
-        p[0].linespan = (p.linespan(1)[0],p.linespan(5)[1])
-	
-    
+
+    if len(p) == 7:
+        p[0] = GenMsgAST.Factory(p[2], p[4], p[5])
+        p[0].linespan = (p.linespan(1)[0], p.linespan(6)[1])
+    elif len(p) == 6:
+
+        p[0] = GenMsgAST.Factory(p[2], p[4])
+        p[0].linespan = (p.linespan(1)[0], p.linespan(5)[1])
+
 
 def p_factory_creator(p):
     '''factory_creator : FACTORY_CREATOR ID ID LPAREN ID RPAREN'''
-    p[0]=(p[2],p[3],p[5])
+
+    p[0] = (p[2], p[3], p[5])
+
 
 def p_factory_receiver(p):
     '''factory_receiver : FACTORY_RECEIVER ID ID LPAREN ID RPAREN'''
-    p[0]=(p[2],p[3],p[5])
-            
+
+    p[0] = (p[2], p[3], p[5])
+
+
 def p_message(p):
     '''message : MESSAGE ID LBRACE RBRACE 
                | MESSAGE ID LBRACE field_list RBRACE 
                | MESSAGE ID COLON MERGE ID LBRACE RBRACE 
                | MESSAGE ID COLON MERGE ID LBRACE field_list RBRACE'''
-    if len(p)==5:        
-        p[0] = GenMsgAST.MessageType(p[2],[],None)        
-    elif len(p)==6:
+
+    if len(p) == 5:
+        p[0] = GenMsgAST.MessageType(p[2], [], None)
+    elif len(p) == 6:
         p[4].reverse()
-        p[0] = GenMsgAST.MessageType(p[2],p[4],None)
-    elif len(p)==8:
-        p[0] = GenMsgAST.MessageType(p[2],[],p[5])
-    elif len(p)==9:
+        p[0] = GenMsgAST.MessageType(p[2], p[4], None)
+    elif len(p) == 8:
+        p[0] = GenMsgAST.MessageType(p[2], [], p[5])
+    elif len(p) == 9:
         p[7].reverse()
-        p[0] = GenMsgAST.MessageType(p[2],p[7],p[5])                                    
-    p[0].linespan = (p.linespan(1)[0],p.linespan(len(p)-1)[1]) 
-    
-def p_native(p): 
-    'native : NATIVE ID LBRACE native_line_list RBRACE'
+        p[0] = GenMsgAST.MessageType(p[2], p[7], p[5])
+    p[0].linespan = (p.linespan(1)[0], p.linespan(len(p) - 1)[1])
+
+
+def p_native(p):
+    '''native : NATIVE ID LBRACE native_line_list RBRACE'''
+
     # we should reverse the language list
     # because the parse build it the other way around (recursive way)
+
     p[4].reverse()
-    p[0]=GenMsgAST.NativeType(p[2],p[4])    
-    p[0].linespan = (p.linespan(1)[0],p.linespan(5)[1])
-    
+    p[0] = GenMsgAST.NativeType(p[2], p[4])
+    p[0].linespan = (p.linespan(1)[0], p.linespan(5)[1])
+
+
 def p_native_line_list(p):
     '''native_line_list : native_line eol_comment
                         | native_line eol_comment native_line_list'''
+
     # Create or append the list (of pair)
-    if len(p)==3:
+
+    if len(p) == 3:
         p[1].comment = p[2]
-        p[0]=[p[1]]    
+        p[0] = [p[1]]
     else:
         p[1].comment = p[2]
         p[3].append(p[1])
-        p[0]=p[3]
+        p[0] = p[3]
+
 
 def p_native_line(p):
     '''native_line : language_line
                    | representation_line'''
-    p[0]=p[1]
+
+    p[0] = p[1]
+
 
 def p_language_line(p):
     '''language_line : LANGUAGE ID LANGLINE'''
-    p[0]=GenMsgAST.NativeType.LanguageLine(p[2],p[3])
-    
+
+    p[0] = GenMsgAST.NativeType.LanguageLine(p[2], p[3])
+
+
 def p_representation_line(p):
     '''representation_line : REPRESENTATION typeid
                         | REPRESENTATION COMBINE'''
-    p[0]=GenMsgAST.NativeType.RepresentationLine(p[2])
-        
+
+    p[0] = GenMsgAST.NativeType.RepresentationLine(p[2])
+
+
 def p_enum(p):
-    'enum : ENUM ID LBRACE enum_value_list RBRACE'
+    '''enum : ENUM ID LBRACE enum_value_list RBRACE'''
+
     # we should reverse the enum value list
     # because the parse build it the other way around (recursive way)
+
     p[4].reverse()
-    p[0] = GenMsgAST.EnumType(p[2],p[4])
-    p[0].linespan = (p.linespan(1)[0],p.linespan(5)[1])
-    
+    p[0] = GenMsgAST.EnumType(p[2], p[4])
+    p[0].linespan = (p.linespan(1)[0], p.linespan(5)[1])
+
+
 def p_empty(p):
-    'empty :'
+    '''empty :'''
+
     pass
 
+
 def p_eol_comment(p):
     '''eol_comment : COMMENT 
                         | empty'''
+
     # we may store the comment text for future use
-    if len(p) > 1 and isinstance(p[1],type("")) :
-        p[0] = GenMsgAST.CommentBlock(p[1].strip('/'),isAtEOL=True)
-        p[0].linespan = p.linespan(1)        
+
+    if len(p) > 1 and isinstance(p[1], type('')):
+        p[0] = GenMsgAST.CommentBlock(p[1].strip('/'), isAtEOL=True)
+        p[0].linespan = p.linespan(1)
     else:
-        p[0] = ""         
-    
+        p[0] = ''
+
+
 def p_enum_value_list(p):
     '''enum_value_list : enum_val eol_comment  
                        | enum_val COMMA eol_comment
                        | enum_val COMMA eol_comment enum_value_list'''
+
     # Create or append the list (of pair)
-    if len(p)==3:
+
+    if len(p) == 3:
         p[1].comment = p[2]
-        p[0]=[p[1]]
-    elif len(p)==4:
+        p[0] = [p[1]]
+    elif len(p) == 4:
         p[1].comment = p[3]
-        p[0]=[p[1]]              
+        p[0] = [p[1]]
     else:
         p[1].comment = p[3]
         p[4].append(p[1])
-        p[0]=p[4]        
-    
+        p[0] = p[4]
+
+
 def p_enum_val(p):
     '''enum_val : ID 
                 | ID EQUAL INTEGER_VALUE'''
+
     # Build a pair (ID,value)
-    # value may be None    
-    if len(p)>3:
-        p[0] = GenMsgAST.EnumType.EnumValue(p[1],p[3])
-        p[0].linespan = (p.linespan(1)[0],p.linespan(3)[1])
+    # value may be None
+
+    if len(p) > 3:
+        p[0] = GenMsgAST.EnumType.EnumValue(p[1], p[3])
+        p[0].linespan = (p.linespan(1)[0], p.linespan(3)[1])
     else:
-        p[0] = GenMsgAST.EnumType.EnumValue(p[1],None)
-        p[0].linespan = p.linespan(1)     
+        p[0] = GenMsgAST.EnumType.EnumValue(p[1], None)
+        p[0].linespan = p.linespan(1)
+
 
 def p_field_list(p):
     '''field_list : field_spec eol_comment
                   | field_spec eol_comment field_list'''
-    if len(p)==3:
+
+    if len(p) == 3:
         p[0] = [p[1]]
-    else:        
+    else:
         p[0] = p[3]
-        p[0].append(p[1])    
+        p[0].append(p[1])
+
 
 def p_field_spec(p):
     '''field_spec : qualifier typeid ID eol_comment
                   | qualifier typeid ID LBRACE DEFAULT EQUAL value RBRACE eol_comment
                   | COMBINE typeid LBRACE field_list RBRACE eol_comment'''
-    
-    if len(p)==5:
-        p[0] = GenMsgAST.MessageType.MessageField(p[1],p[2],p[3],None)
+
+    if len(p) == 5:
+        p[0] = GenMsgAST.MessageType.MessageField(p[1], p[2], p[3],
+                None)
         p[0].comment = p[4]
-        p[0].linespan = (p.linespan(1)[0],p.linespan(4)[1])	
-    elif len(p)==7:
+        p[0].linespan = (p.linespan(1)[0], p.linespan(4)[1])
+    elif len(p) == 7:
         p[4].reverse()
-        p[0] = GenMsgAST.MessageType.CombinedField(p[2],p[4])
+        p[0] = GenMsgAST.MessageType.CombinedField(p[2], p[4])
         p[0].comment = p[5]
-        p[0].linespan = (p.linespan(1)[0],p.linespan(4)[1])
-    else:                
-        p[0] = GenMsgAST.MessageType.MessageField(p[1],p[2],p[3],p[7])
-        p[0].comment = p[9]   
-        p[0].linespan = (p.linespan(1)[0],p.linespan(8)[1])
+        p[0].linespan = (p.linespan(1)[0], p.linespan(4)[1])
+    else:
+        p[0] = GenMsgAST.MessageType.MessageField(p[1], p[2], p[3],
+                p[7])
+        p[0].comment = p[9]
+        p[0].linespan = (p.linespan(1)[0], p.linespan(8)[1])
+
 
 def p_qualifier(p):
     '''qualifier : REQUIRED
                  | REPEATED
                  | OPTIONAL'''
+
     p[0] = p[1]
-    
+
+
 def p_typeid(p):
     '''typeid : ONOFF_T
               | BOOL_T
@@ -484,88 +606,105 @@ def p_typeid(p):
               | FLOAT_T
               | DOUBLE_T
               | defined_type'''
-    p[0] = p[1]    
-    
+
+    p[0] = p[1]
+
+
 def p_defined_type(p):
     '''defined_type : ID'''
+
     # A defined type is either a Message or Native or Enum Type.
     # This kind of type should be checked
     # **after* the AST has been built entirely.
     # We cannot check it now because of the recursive nature of the parser.
-    p[0]=p[1]
-    
+
+    p[0] = p[1]
+
+
 def p_value(p):
     '''value : INTEGER_VALUE 
              | FLOAT_VALUE 
              | BOOL_VALUE
-             | STRING_VALUE'''    
-    p[0]=p[1]
-    
-def find_column(input,token):
+             | STRING_VALUE'''
+
+    p[0] = p[1]
+
+
+def find_column(input, token):
     '''input is the input text string
     token is a token instance'''
-    last_cr = input.rfind('\n',0,token.lexpos)
+
+    last_cr = input.rfind('\n', 0, token.lexpos)
     if last_cr < 0:
         last_cr = 0
-    column = (token.lexpos - last_cr) + 1
+    column = token.lexpos - last_cr + 1
     return column
-    
-def p_error(p):             
+
+
+def p_error(p):
     if lexer in dir(p):
-        msg = "Syntax error at '%s' on line %d column %d (token type is '%s')" % (p.value,p.lineno,find_column(p.lexer.lexdata, p),p.type)
+        msg = \
+            "Syntax error at '%s' on line %d column %d (token type is '%s')" \
+            % (p.value, p.lineno, find_column(p.lexer.lexdata, p),
+               p.type)
     else:
-        msg = "Syntax error at '%s' on line %d (token type is '%s')" % (p.value,p.lineno,p.type)
+        msg = "Syntax error at '%s' on line %d (token type is '%s')" \
+            % (p.value, p.lineno, p.type)
     parserlogger.fatal(msg)
-                                                                                 
+
+
 # Build the PLY parser
-parserlogger = logging.Logger("MessageParser")
+
+parserlogger = logging.Logger('MessageParser')
 parserlogger.setLevel(logging.ERROR)
 parserlogger.addHandler(stdoutHandler)
 parser = ply.yacc.yacc(debug=True)
-parser.logger = parserlogger 
-
-if inputFile != None:    
-    mainlogger.info("Parsing message file specifications...")
-    try:    
-        msgFile =  open(inputFile,'r')
-    except IOError, e:        
-        mainlogger.error("IOError raised: <"+str(e)+">")
-        mainlogger.error("May be input file <%s> is unreadable or mispelled?" % inputFile)
+parser.logger = parserlogger
+
+if inputFile != None:
+    mainlogger.info('Parsing message file specifications...')
+    try:
+        msgFile = open(inputFile, 'r')
+    except IOError, e:
+        mainlogger.error('IOError raised: <' + str(e) + '>')
+        mainlogger.error('May be input file <%s> is unreadable or mispelled?'
+                          % inputFile)
         sys.exit()
 else:
-    mainlogger.error("No input file given!!")
+    mainlogger.error('No input file given!!')
     sys.exit()
-    
+
 lexer.lineno = 1
 parser.AST = GenMsgAST.MessageAST(inputFile)
-parser.parse(msgFile.read(),lexer=lexer,tracking=True)
+parser.parse(msgFile.read(), lexer=lexer, tracking=True)
 parser.AST.messages.reverse()
 parser.AST.enums.reverse()
 parser.AST.natives.reverse()
 msgFile.close()
-mainlogger.info("Parse succeeded %s" % (parser.AST))
+mainlogger.info('Parse succeeded %s' % parser.AST)
 
-mainlogger.info("Checking AST properties....")
+mainlogger.info('Checking AST properties....')
 checker = GenMsgAST.ASTChecker()
 checker.check(parser.AST)
-if parser.AST.checked:    
-    mainlogger.info("AST properties checked Ok.")
+if parser.AST.checked:
+    mainlogger.info('AST properties checked Ok.')
 else:
-    mainlogger.error("AST has error, generation step may produce invalid files!!!")
+    mainlogger.error('AST has error, generation step may produce invalid files!!!'
+                     )
     sys.exit()
 
-mainlogger.info("Generate %s from AST,..."%language)
+mainlogger.info('Generate %s from AST,...' % language)
 generator = None
 if language.lower() in generatorBackends.keys():
     generator = generatorBackends[language.lower()](parser.AST)
-elif language.lower()=="none":
-    mainlogger.info("Nothing to generate for <%s>." % language)
+elif language.lower() == 'none':
+    mainlogger.info('Nothing to generate for <%s>.' % language)
     usage()
-else:     
-    mainlogger.error("Language <%s> is unknown" % language)
+else:
+    mainlogger.error('Language <%s> is unknown' % language)
     usage()
-    
+
 if generator != None:
-    generator.generate(output,gentype,factoryOnly) 
-mainlogger.info("Generate %s from AST, Done." % language)
+    generator.generate(output, gentype, factoryOnly)
+mainlogger.info('Generate %s from AST, Done.' % language)
 msgFile.close()
diff --git a/scripts/certi-ctest.cmake b/scripts/certi-ctest.cmake
index ad9dd2b..e69de29 100644
--- a/scripts/certi-ctest.cmake
+++ b/scripts/certi-ctest.cmake
@@ -1,68 +0,0 @@
-####################################################################
-#
-# CTest script which may be used to setup a CDash submission
-# to CERTI Dashboard.
-#
-####################################################################
-SET (CTEST_SOURCE_DIRECTORY "/LOCAL/ERIC/CertiNightly/CERTI")
-SET (CTEST_BINARY_DIRECTORY "/LOCAL/ERIC/CertiNightly/build")
-
-SET (CTEST_CVS_COMMAND "cvs")
-SET (CTEST_CVS_CHECKOUT "${CTEST_CVS_COMMAND} -z3 -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/certi co -d CERTI certi")
-
-# Easy handling of script commande line argument
-SET(MODEL Nightly)
-IF(${CTEST_SCRIPT_ARG} MATCHES Experimental)
-  SET(MODEL Experimental) 
-ENDIF(${CTEST_SCRIPT_ARG} MATCHES Experimental)
-
-# which ctest command to use for running the dashboard
-IF (${MODEL} MATCHES Experimental)
-
-   SET (CTEST_COMMAND
-       "logger -i -t cdash \"CERTI Experimental CDash BEGIN...\" "
-       "ctest -D ${MODEL}"
-       "logger -i -t cdash \"CERTI Experimental CDash END.\" "
-   )
-ELSE(${MODEL} MATCHES Experimental)
-   SET (CTEST_COMMAND 
-     "logger -i -t cdash \"CERTI Nightly CDash BEGIN...\" "
-     "ctest -D NightlyStart -D NightlyUpdate -D NightlyConfigure -D NightlyBuild -D NightlyTest -D NightlySubmit"
-     "ctest -D NightlyMemCheck -D NightlySubmit"
-     "logger -i -t cdash \"CERTI Nightly CDash END.\" "
-   )
-endif(${MODEL} MATCHES Experimental)
-
-# what cmake command to use for configuring this dashboard
-SET (CTEST_CMAKE_COMMAND 
-  "cmake"
-  )
-
-####################################################################
-# The values in this section are optional you can either
-# have them or leave them commented out
-####################################################################
-
-# should ctest backup the source tree and restore it whenever a test failed?
-#SET (CTEST_BACKUP_AND_RESTORE TRUE) 
-
-# should ctest wipe the binary tree before running
-#SET (CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE)
-
-# this is the initial cache to use for the binary tree, be careful to escape
-# any quotes inside of this string if you use it
-SET (CTEST_INITIAL_CACHE "
-MAKECOMMAND:STRING=make
-CMAKE_MAKE_PROGRAM:FILEPATH=make
-CMAKE_GENERATOR:INTERNAL=Unix Makefiles
-BUILDNAME:STRING=Linux-i686-gcc-4.1.2
-SITE:STRING=ErkAtONERA
-CVSCOMMAND:FILEPATH=cvs
-")
-
-SET( $ENV{LC_MESSAGES}    "en_EN" )
-
-# set any extra environment variables to use during the execution of the script here:
-SET (CTEST_ENVIRONMENT
-    "HTTP_PROXY=proxy.onecert.fr:80"
-)
