Synopsis - Synopsis.Formatters.HTML.Part.Part

module Synopsis.Formatters.HTML.Part
class Part
File: ../Synopsis/Formatters/HTML/Part.py
Base class for formatting a Part of a Scope View. This class contains functionality for modularly formatting an ASG node and its children for display. It is typically used to construct Heading, Summary and Detail formatters. Strategy objects are added according to configuration, and this base class then checks which format methods each strategy implements. For each ASG declaration visited, the Part asks all Strategies which implement the appropriate format method to generate output for that declaration. The final writing of the formatted html is delegated to the write_section_start, write_section_end, and write_section_item methods, which must be implemented in a subclass.
Class attributes Summary:
fragments
Methods Summary:
register(self, view)
view(self)
filename(self)
os(self)
scope(self)
write(self, text)
type_ref(self)
type_label(self)
declarator(self)
parameter(self)
reference(self, name, label = None, * * keys)
Returns a reference to the given name.
label(self, name, label = None)
Create a label for the given name.
format_declaration(self, decl, method)
Format decl using named method of each fragment.
process(self, decl)
Formats the given decl, creating the output for this Part of the view.
visit_declaration(self, decl)
visit_macro(self, decl)
visit_forward(self, decl)
visit_group(self, decl)
visit_scope(self, decl)
visit_module(self, decl)
visit_meta_module(self, decl)
visit_class(self, decl)
visit_class_template(self, decl)
visit_typedef(self, decl)
visit_enum(self, decl)
visit_variable(self, decl)
visit_const(self, decl)
visit_function(self, decl)
visit_function_template(self, decl)
visit_operation(self, decl)
visit_operation_template(self, decl)
format_type(self, typeObj, id_holder = None)
visit_builtin_type_id(self, type)
visit_unknown_type_id(self, type)
visit_declared_type_id(self, type)
visit_dependent_type_id(self, type)
visit_modifier_type_id(self, type)
visit_parametrized_type_id(self, type)
visit_template_id(self, type)
visit_function_type_id(self, type)
write_start(self)
write_section_start(self, heading)
write_section_end(self, heading)
write_section_item(self, text)
write_end(self)
Methods Details:
reference(self, name, label = None, * * keys)
Returns a reference to the given name. The name is a scoped name, and the optional label is an alternative name to use as the link text. The name is looked up in the TOC so the link may not be local. The optional keys are appended as attributes to the A tag.
label(self, name, label = None)
Create a label for the given name. The label is an anchor so it can be referenced by other links. The name of the label is derived by looking up the name in the TOC and using the link in the TOC entry. The optional label is an alternative name to use as the displayed name. If the name is not found in the TOC then the name is not anchored and just label is returned (or name if no label is given).
format_declaration(self, decl, method)
Format decl using named method of each fragment. Each fragment returns two strings - type and name. All the types are joined and all the names are joined separately. The consolidated type and name strings are then passed to write_section_item.
process(self, decl)
Formats the given decl, creating the output for this Part of the view. This method is implemented in various subclasses in different ways, for example Summary and Detail iterate through the children of 'decl' section by section, whereas Heading only formats decl itself.
format_type(self, typeObj, id_holder = None)
Returns a reference string for the given type object
visit_builtin_type_id(self, type)
Sets the label to be a reference to the type's name
visit_unknown_type_id(self, type)
Sets the label to be a reference to the type's link
visit_declared_type_id(self, type)
Sets the label to be a reference to the type's name
visit_dependent_type_id(self, type)
Sets the label to be the type's name (which has no proper scope)
visit_modifier_type_id(self, type)
Adds modifiers to the formatted label of the modifier's alias
visit_parametrized_type_id(self, type)
Adds the parameters to the template name in angle brackets
visit_template_id(self, type)
Labs the template with the parameters
visit_function_type_id(self, type)
Labels the function type with return type, name and parameters
write_start(self)
Abstract method to start the output, eg table headings
write_section_start(self, heading)
Abstract method to start a section of declaration types
write_section_end(self, heading)
Abstract method to end a section of declaration types
write_section_item(self, text)
Abstract method to write the output of one formatted declaration
write_end(self)
Abstract method to end the output, eg close the table
Generated on Thu Apr 16 16:27:01 2009 by
synopsis (version devel)