[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=[]):
|
||||
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 = []
|
||||
|
||||
|
11
monkHtml.py
11
monkHtml.py
@ -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):
|
||||
|
@ -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,6 +217,9 @@ class Node():
|
||||
ret += "_"
|
||||
for name in self.namespace:
|
||||
ret += name + "__"
|
||||
if self.name == "":
|
||||
ret += "NO_NAME_" + str(self.uid)
|
||||
else:
|
||||
ret += self.name
|
||||
ret += '.html'
|
||||
return ret
|
||||
@ -223,6 +229,9 @@ class Node():
|
||||
ret += "_"
|
||||
for name in self.namespace:
|
||||
ret += name + "__"
|
||||
if self.name == "":
|
||||
ret += "NO_NAME_" + str(self.uid)
|
||||
else:
|
||||
ret += self.name
|
||||
ret += '.html'
|
||||
return ret
|
||||
|
Loading…
x
Reference in New Issue
Block a user