:py:mod:`raesl.compile.ast.specification` ========================================= .. py:module:: raesl.compile.ast.specification .. autoapi-nested-parse:: Overall output specification. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: raesl.compile.ast.specification.Specification raesl.compile.ast.specification._DumpSpec Functions ~~~~~~~~~ .. autoapisummary:: raesl.compile.ast.specification.unfold_disjunction raesl.compile.ast.specification.dump raesl.compile.ast.specification.get_doc_comment_spec_elements .. py:class:: Specification Main class. .. attribute:: types Types of the specification. .. attribute:: verb_prepos Verbs and pre-positions. .. attribute:: rel_defs Relation definitions. .. attribute:: comp_defs Component definitions. .. attribute:: world Root component. .. py:class:: _DumpSpec(output_stream: Optional[TextIO] = None) Class for dumping the specification to an output stream. .. py:method:: dump(spec: Specification) Write the specification symbolically onto the output stream. Intended use is verifying content or debugging. .. py:method:: dump_component(compdef) Dump content of the provided component. .. py:method:: _dump_expr(expr: raesl.compile.ast.exprs.Expression, indent: str) .. py:method:: _dump_nodes(node: raesl.compile.ast.nodes.Node, prefixes: List[str] = None) Recursively dump the tree of var/param nodes rooted at 'node', with 'prefixes' containing the leading text-fields if not None. .. py:method:: _dump_docs(element: raesl.compile.ast.comment_storage.DocElement, indent_text: str) Dump documentation of the given element if it has any. If no documentation has been added, report there is no documentation. :param element: Element to check for documentation. :param indent_text: Leading text printed at each line by the function. .. py:method:: _dump_type(btp: raesl.compile.ast.types.BaseType) -> str Dump unique types onto the self.output_stream while assigning them names of the form 'type#'. Each type is output once. Arugments: btp: Type to dump. :returns: Name of the type during the dump process. .. py:method:: _dump_compinst_params(compinst) Dump the arguments of the component instance. .. py:method:: _dump_relinst_params(relinst) Dump the arguments of the relation instance. .. py:method:: _dump_subclauses(clauses) .. py:method:: _dump_conds(conditions) .. py:method:: _dump_results(results) .. py:function:: unfold_disjunction(expr: raesl.compile.ast.exprs.Expression) -> List[raesl.compile.ast.exprs.Expression] Convert the child expressions of top-level disjunction expressions to a list. .. py:function:: dump(spec: Specification, output_stream: Optional[TextIO] = None) Dump the provided specification to an output. :param spec: Specification to dump. :param output_stream: Stream to write to, None means stdout. .. py:function:: get_doc_comment_spec_elements(spec: Specification) -> Generator[raesl.compile.ast.comment_storage.DocStore, None, None] Retrieve the specification elements interested in getting documentation comments from the input. Note: Component definitions are added through components get_doc_comment_comp_elements Note: The implementation is highly knowledgeable about data structure here with respect to the implementation.