languages/gen_h.py
def write_decl(self, decl):
		""" 
		Create simple C declaration. This function supports:
			- simple variable declaration (initialized, non-initialized)
			- enum element declaration (value must be specified on declarations)
			- bitfield element declaration (bitWidth must be specified)
		Arguments:
			decl		Declaration to create
		"""
		if(self.is_supported_type(decl.type) == False):
			return False
		
		if (decl.specifier == None):
			intSpec = ""
		else:
			intSpec = decl.specifier + " "
		
		if (decl.comment != None):
			self.write_comment(decl.comment, decl.gap, small=True)
		
		pref = "{}{}{}{}".format("	" * decl.gap, intSpec,
									decl.type + " ", decl.name)
		post = 	";\n"
		# Initialization of declaration
		if (decl.intType == "initialized"):
			post = " = {};\n".format(decl.value)
		elif (decl.intType == "enum"):
			post = " = {},\n".format(hex(decl.value))
		elif (decl.intType == "bitfield"):
			post = ": {};\n".format(decl.bitWidth)
			
		if (post != ";\n"):
			post = '{:>{}}'.format(post, decl.alignLen - len(pref))
		
		self.__wr_line(pref + post)
		return True
 
		Create simple C declaration. This function supports:
			- simple variable declaration (initialized, non-initialized)
			- enum element declaration (value must be specified on declarations)
			- bitfield element declaration (bitWidth must be specified)
		Arguments:
			decl		Declaration to create
		
Create simple C declaration. This function supports:
simple variable declaration (initialized, non-initialized)
enum element declaration (value must be specified on declarations)
bitfield element declaration (bitWidth must be specified)
Arguments:
decl            Declaration to create
Create simple C declaration . This function supports : simple variable declaration ( initialized non - initialized ) enum element declaration ( value must be specified on declarations ) bitfield element declaration ( bitWidth must be specified ) Arguments : decl Declaration to create
def write_decl(self, decl):
		if(self.is_supported_type(decl.type) == False):
			return False
		if (decl.specifier == None):
			intSpec = ""
		else:
			intSpec = decl.specifier + " "
		if (decl.comment != None):
			self.write_comment(decl.comment, decl.gap, small=True)
		pref = "{}{}{}{}".format("	" * decl.gap, intSpec,
									decl.type + " ", decl.name)
		post = 	";\n"
		if (decl.intType == "initialized"):
			post = " = {};\n".format(decl.value)
		elif (decl.intType == "enum"):
			post = " = {},\n".format(hex(decl.value))
		elif (decl.intType == "bitfield"):
			post = ": {};\n".format(decl.bitWidth)
		if (post != ";\n"):
			post = '{:>{}}'.format(post, decl.alignLen - len(pref))
		self.__wr_line(pref + post)
		return True
def write_decl ( self , decl ) : if ( self . is_supported_type ( decl . type ) == False ) : return False if ( decl . specifier == None ) : intSpec = "" else : intSpec = decl . specifier + " " if ( decl . comment != None ) : self . write_comment ( decl . comment , decl . gap , small = True ) pref = "{}{}{}{}" . format ( "	" * decl . gap , intSpec , decl . type + " " , decl . name ) post = ";\n" if ( decl . intType == "initialized" ) : post = " = {};\n" . format ( decl . value ) elif ( decl . intType == "enum" ) : post = " = {},\n" . format ( hex ( decl . value ) ) elif ( decl . intType == "bitfield" ) : post = ": {};\n" . format ( decl . bitWidth ) if ( post != ";\n" ) : post = '{:>{}}' . format ( post , decl . alignLen - len ( pref ) ) self . __wr_line ( pref + post ) return True
Create simple C declaration.
Create simple C declaration .
""" 
		Create simple C declaration. This function supports:
			- simple variable declaration (initialized, non-initialized)
			- enum element declaration (value must be specified on declarations)
			- bitfield element declaration (bitWidth must be specified)
		Arguments:
			decl		Declaration to create
		""" # Initialization of declaration
self
decl