[DEV] add support of empty enum

This commit is contained in:
Edouard DUPIN 2014-04-24 21:31:22 +02:00
parent 7654eea321
commit aff1fdf89a
3 changed files with 28 additions and 9 deletions

View File

@ -6,15 +6,22 @@ class Enum(Node.Node):
def __init__(self, stack=[], file="", lineNumber=0, documentation=[]):
self.baseValue = 0;
# check input :
if len(stack) < 2:
debug.error("Can not parse class : " + str(stack))
if len(stack) < 1:
debug.error("Can not parse enum : " + str(stack))
return
self.typedef = False
if stack[0] == 'typedef':
self.typedef = True
stack[1:]
if len(stack) == 0:
debug.error("Can not parse enum : " + str(stack))
return
if len(stack) == 1:
localEnumName = ""
else:
localEnumName = stack[1]
Node.Node.__init__(self, 'enum', stack[1], file, lineNumber, documentation)
Node.Node.__init__(self, 'enum', localEnumName, file, lineNumber, documentation)
self.listElement = []

View File

@ -126,13 +126,16 @@ def generate_html_page_name(element):
def generate_name(element):
namespaceStack = element.get_namespace()
link = ""
namespaceExpanded = ""
for name in namespaceStack:
link += name + "::"
return element.get_node_type() + ": " + link + element.get_name()
namespaceExpanded += name + "::"
if element.get_name() == "":
return element.get_node_type()
return element.get_node_type() + ": " + namespaceExpanded + element.get_name()
def generate_link(element):
if element.get_name() == "":
return '<a href="' + generate_html_page_name(element) + '">** No name **</a>'
return '<a href="' + generate_html_page_name(element) + '">' + element.get_name() + '</a>'
def calculate_methode_size(list):

View File

@ -44,6 +44,9 @@ class Node():
def get_name(self):
return self.name
def get_UID(self):
return self.uid
def add_doc(self, doc):
for element in doc:
self.documenatationCode.append(element)
@ -214,7 +217,10 @@ class Node():
ret += "_"
for name in self.namespace:
ret += name + "__"
ret += self.name
if self.name == "":
ret += "NO_NAME_" + str(self.uid)
else:
ret += self.name
ret += '.html'
return ret
@ -223,7 +229,10 @@ class Node():
ret += "_"
for name in self.namespace:
ret += name + "__"
ret += self.name
if self.name == "":
ret += "NO_NAME_" + str(self.uid)
else:
ret += self.name
ret += '.html'
return ret