--- a/Utilities/ClassBrowsers/ClbrBaseClasses.py Sat Nov 18 12:35:13 2017 +0100 +++ b/Utilities/ClassBrowsers/ClbrBaseClasses.py Sat Nov 18 18:27:25 2017 +0100 @@ -19,10 +19,14 @@ """ Constructor - @param module name of the module containing this class - @param name name of this class + @param module name of the module containing this object + @type str + @param name name of this object + @type str @param file filename containing this object - @param lineno linenumber of the class definition + @type str + @param lineno linenumber of the object definition + @type int """ self.module = module self.name = name @@ -34,7 +38,8 @@ """ Public method to set the ending line number. - @param endLineNo number of the last line (integer) + @param endLineNo number of the last line + @type int """ self.endlineno = endLineNo @@ -47,10 +52,14 @@ """ Constructor - @param module name of the module containing this class - @param name name of this class + @param module name of the module containing this object + @type str + @param name name of this object + @type str @param file filename containing this object - @param lineno linenumber of the class definition + @type str + @param lineno linenumber of the object definition + @type int """ _ClbrBase.__init__(self, module, name, file, lineno) self.methods = {} @@ -62,8 +71,10 @@ """ Protected method to add information about a method. - @param name name of method to be added (string) + @param name name of method to be added + @type str @param function Function object to be added + @type Function """ self.methods[name] = function @@ -72,7 +83,9 @@ Protected method to retrieve a method by name. @param name name of the method (string) - @return the named method or None + @type str + @return the named method + @rtype Function or None """ try: return self.methods[name] @@ -83,7 +96,8 @@ """ Protected method to add information about global variables. - @param attr Attribute object to be added (Attribute) + @param attr Attribute object to be added + @type Attribute """ if attr.name not in self.globals: self.globals[attr.name] = attr @@ -94,8 +108,10 @@ """ Protected method to retrieve a global variable by name. - @param name name of the global variable (string) - @return the named global variable or None + @param name name of the global variable + @type str + @return the named global variable + @rtype Attribute or None """ try: return self.globals[name] @@ -106,7 +122,8 @@ """ Protected method to add information about attributes. - @param attr Attribute object to be added (Attribute) + @param attr Attribute object to be added + @type Attribute """ if attr.name not in self.attributes: self.attributes[attr.name] = attr @@ -117,8 +134,10 @@ """ Protected method to retrieve an attribute by name. - @param name name of the attribute (string) - @return the named attribute or None + @param name name of the attribute + @type str + @return the named attribute + @rtype Attribute or None """ try: return self.attributes[name] @@ -130,7 +149,9 @@ Protected method method to add a nested class to this class. @param name name of the class - @param _class Class object to be added (Class) + @type str + @param _class Class object to be added + @type Class """ self.classes[name] = _class @@ -143,7 +164,8 @@ """ Public method to check, if the visibility is Private. - @return flag indicating Private visibility (boolean) + @return flag indicating Private visibility + @rtype bool """ return self.visibility == 0 @@ -151,7 +173,8 @@ """ Public method to check, if the visibility is Protected. - @return flag indicating Protected visibility (boolean) + @return flag indicating Protected visibility + @rtype bool """ return self.visibility == 1 @@ -159,7 +182,8 @@ """ Public method to check, if the visibility is Public. - @return flag indicating Public visibility (boolean) + @return flag indicating Public visibility + @rtype bool """ return self.visibility == 2 @@ -190,10 +214,14 @@ """ Constructor - @param module name of the module containing this class - @param name name of this class + @param module name of the module containing this attribute + @type str + @param name name of this attribute + @type str @param file filename containing this attribute - @param lineno linenumber of the class definition + @type str + @param lineno line number of the attribute definition + @type int """ _ClbrBase.__init__(self, module, name, file, lineno) @@ -203,8 +231,8 @@ """ Public method to add another assignment line number. - @param lineno linenumber of the additional attribute assignment - (integer) + @param lineno line number of the additional attribute assignment + @type int """ if lineno not in self.linenos: self.linenos.append(lineno) @@ -219,10 +247,15 @@ Constructor @param module name of the module containing this class + @type str @param name name of this class + @type str @param superClasses list of class names this class is inherited from + @type list of str @param file filename containing this class - @param lineno linenumber of the class definition + @type str + @param lineno line number of the class definition + @type int """ ClbrBase.__init__(self, module, name, file, lineno) if superClasses is None: @@ -239,9 +272,13 @@ Constructor @param module name of the module containing this module + @type str @param name name of this module + @type str @param file filename containing this module - @param lineno linenumber of the module definition + @type str + @param lineno line number of the module definition + @type int """ ClbrBase.__init__(self, module, name, file, lineno) @@ -260,13 +297,21 @@ Constructor @param module name of the module containing this function + @type str @param name name of this function - @param file filename containing this class - @param lineno linenumber of the class definition - @param signature parameterlist of the method - @param separator string separating the parameters + @type str + @param file filename containing this function + @type str + @param lineno line number of the function definition + @type int + @param signature parameter list of the function + @type str + @param separator string separating the parameters of the function + @type str @param modifierType type of the function - @param annotation return annotation + @type int + @param annotation function return annotation + @type str """ ClbrBase.__init__(self, module, name, file, lineno) self.parameters = [e.strip() for e in signature.split(separator)] @@ -282,10 +327,34 @@ """ Constructor - @param module name of the module containing this module - @param file filename containing this module - @param lineno linenumber of the module definition + @param module name of the module containing this coding statement + @type str + @param file filename containing this coding statement + @type str + @param lineno line number of the coding definition + @type int @param coding character coding of the source file + @type str """ ClbrBase.__init__(self, module, "Coding", file, lineno) self.coding = coding + + +class Enum(ClbrBase): + """ + Class to represent an enum definition. + """ + def __init__(self, module, name, file, lineno): + """ + Constructor + + @param module name of the module containing this enum + @type str + @param name name of this enum + @type str + @param file filename containing this enum + @type str + @param lineno line number of the enum definition + @type int + """ + ClbrBase.__init__(self, module, name, file, lineno)