-
Notifications
You must be signed in to change notification settings - Fork 67
Expand file tree
/
Copy path__init__.py
More file actions
executable file
·62 lines (51 loc) · 2.59 KB
/
__init__.py
File metadata and controls
executable file
·62 lines (51 loc) · 2.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env python
# PYTHON_ARGCOMPLETE_OK
"""
The toolbox is sorted into the following modules:
+----------------------------------+----------------------------------------+
| Module | Description |
+==================================+========================================+
| :py:mod:`~matlab2cpp.qfunctions` | Functions for performing simple |
| | translations |
+----------------------------------+----------------------------------------+
| :py:class:`~matlab2cpp.Builder` | Constructing a tree from Matlab code |
+----------------------------------+----------------------------------------+
| :py:class:`~matlab2cpp.Node` | Components in the tree representation |
| | of the code |
+----------------------------------+----------------------------------------+
| :py:mod:`~matlab2cpp.collection` | The collcetion of various node |
+----------------------------------+----------------------------------------+
| :py:mod:`~matlab2cpp.configure` | Rutine for setting datatypes and |
| | backends of the various nodes |
+----------------------------------+----------------------------------------+
| :py:mod:`~matlab2cpp.rules` | Translation rules |
+----------------------------------+----------------------------------------+
| :py:mod:`~matlab2cpp.supplement` | Functions for inserting and extraction |
| | datatypes |
+----------------------------------+----------------------------------------+
| :py:mod:`~matlab2cpp.testsuite` | Suite for testing software |
+----------------------------------+----------------------------------------+
The simplest way to use the library is to use the quick translation functions.
They are available through the `matlab2cpp.qfunctions` module and mirrors the
functionality offered by the `m2cpp` function.
"""
try:
import argcomplete
except ImportError:
argcomplete = None
from .parser import create_parser
from .qfunctions import *
__version__ = "2.0"
def m2cpp(args=None):
"""
Execute main parser.
Args:
args (Optional[List[str]]):
Argument to be parsed. If omitted, use ``sys.args``.
"""
parser = create_parser()
if argcomplete is not None:
argcomplete.autocomplete(parser)
args = parser.parse_args(args)
from matlab2cpp.frontend import execute_parser
execute_parser(args)