[DEV] add support of empty enum
This commit is contained in:
parent
7654eea321
commit
aff1fdf89a
13
monkEnum.py
13
monkEnum.py
@ -6,15 +6,22 @@ class Enum(Node.Node):
|
|||||||
def __init__(self, stack=[], file="", lineNumber=0, documentation=[]):
|
def __init__(self, stack=[], file="", lineNumber=0, documentation=[]):
|
||||||
self.baseValue = 0;
|
self.baseValue = 0;
|
||||||
# check input :
|
# check input :
|
||||||
if len(stack) < 2:
|
if len(stack) < 1:
|
||||||
debug.error("Can not parse class : " + str(stack))
|
debug.error("Can not parse enum : " + str(stack))
|
||||||
return
|
return
|
||||||
self.typedef = False
|
self.typedef = False
|
||||||
if stack[0] == 'typedef':
|
if stack[0] == 'typedef':
|
||||||
self.typedef = True
|
self.typedef = True
|
||||||
stack[1:]
|
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 = []
|
self.listElement = []
|
||||||
|
|
||||||
|
11
monkHtml.py
11
monkHtml.py
@ -126,13 +126,16 @@ def generate_html_page_name(element):
|
|||||||
|
|
||||||
def generate_name(element):
|
def generate_name(element):
|
||||||
namespaceStack = element.get_namespace()
|
namespaceStack = element.get_namespace()
|
||||||
link = ""
|
namespaceExpanded = ""
|
||||||
for name in namespaceStack:
|
for name in namespaceStack:
|
||||||
link += name + "::"
|
namespaceExpanded += name + "::"
|
||||||
return element.get_node_type() + ": " + link + element.get_name()
|
if element.get_name() == "":
|
||||||
|
return element.get_node_type()
|
||||||
|
return element.get_node_type() + ": " + namespaceExpanded + element.get_name()
|
||||||
|
|
||||||
def generate_link(element):
|
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>'
|
return '<a href="' + generate_html_page_name(element) + '">' + element.get_name() + '</a>'
|
||||||
|
|
||||||
def calculate_methode_size(list):
|
def calculate_methode_size(list):
|
||||||
|
13
monkNode.py
13
monkNode.py
@ -44,6 +44,9 @@ class Node():
|
|||||||
def get_name(self):
|
def get_name(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
|
def get_UID(self):
|
||||||
|
return self.uid
|
||||||
|
|
||||||
def add_doc(self, doc):
|
def add_doc(self, doc):
|
||||||
for element in doc:
|
for element in doc:
|
||||||
self.documenatationCode.append(element)
|
self.documenatationCode.append(element)
|
||||||
@ -214,7 +217,10 @@ class Node():
|
|||||||
ret += "_"
|
ret += "_"
|
||||||
for name in self.namespace:
|
for name in self.namespace:
|
||||||
ret += name + "__"
|
ret += name + "__"
|
||||||
ret += self.name
|
if self.name == "":
|
||||||
|
ret += "NO_NAME_" + str(self.uid)
|
||||||
|
else:
|
||||||
|
ret += self.name
|
||||||
ret += '.html'
|
ret += '.html'
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
@ -223,7 +229,10 @@ class Node():
|
|||||||
ret += "_"
|
ret += "_"
|
||||||
for name in self.namespace:
|
for name in self.namespace:
|
||||||
ret += name + "__"
|
ret += name + "__"
|
||||||
ret += self.name
|
if self.name == "":
|
||||||
|
ret += "NO_NAME_" + str(self.uid)
|
||||||
|
else:
|
||||||
|
ret += self.name
|
||||||
ret += '.html'
|
ret += '.html'
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user