def build(code, disp=False, retall=False, suggest=True, comments=True,
    vtypes=None, **kws):
    """
Build a token tree out of Matlab code.  This function is used by the other
quick-functions as the first step in code translation.

The function also handles syntax errors in the Matlab code.  It will highlight
the line it crashed on and explain as far as it can why it crashed.

Args:
    code (str): Code to be interpreted
    disp (bool): If true, print out diagnostic information while interpreting.
    retall (bool): If true, return full token tree instead of only code related.
    suggest (bool): If true, suggestion engine will be used to fill in datatypes.
    comments (bool): If true, comments will be striped away from the solution.
    vtypes (dict): Verbatim translations added to tree before process.
    **kws: Additional arguments passed to :py:obj:`~matlab2cpp.Builder`.

Returns:
    Builder,Node: The tree constructor if `retall` is true, else the root node for code.

Example::
    >>> from matlab2cpp.tree import Builder
    >>> builder = matlab2cpp.build("a=4", retall=True)
    >>> print(isinstance(builder, Builder))
    True
    >>> node = matlab2cpp.build("a=4", retall=False)
    >>> print(isinstance(node, collection.Node))
    True
    >>> print(matlab2cpp.build("a**b"))
    Traceback (most recent call last):
        ...
    SyntaxError: File: unamed, line 1 in Matlab code:
    a**b
      ^
    Expected: expression start

See also:
    :py:func:`~matlab2cpp.qtree`,
    :py:class:`~matlab2cpp.Builder`,
    :py:class:`~matlab2cpp.Node`

    """
    from . import supplement, tree
    code = code + '\n\n\n\n'
    if vtypes:
        code = supplement.verbatim.set(vtypes, code)
    builder = tree.builder.Builder(disp=disp, comments=comments, **kws)
    builder.load('unamed', code)
    builder.configure(2 * suggest)
    if retall:
        return builder
    if builder[0][1][0].name == 'main':
        out = builder[0][1][0][3]
        return out
    return builder[0][1]
