def create_switch(self, parent, cur): """ Create switch-branch | Structure (main): | Switch | | <cond expression> | | <case>+ | | <otherwise>? | | Structure (case): | Case | | <cond expression> | | <code block> | | Structure (otherwise): | Otherwise | | <code block> Args: parent (Block): Reference to parent node cur (int): position where switch is identified Returns: int: position where switch ends See also: :py:func:`matlab2cpp.tree.branches.switch` """ assert isinstance(parent, mc.collection.Block) return branches.switch(self, parent, cur)