mparser
This is a MATLAB lexer and parser written using ANTLR. The goal of
this package is to provide a way to parse MATLAB code from within
MATLAB, and to be able to do source code translations on the resulting
AST.
The main workhorse of this package is "mparser", a MEX file which
accepts either a string or a filename and parses it into a deeply
nested set of MATLAB structures representing an AST. These can
examined and manipulated from within MATLAB.
Includes a variety of other tools to parse and examine matlab code.
While I have made every effort to be as exact as I can, there are
still a few differences between this grammar and the "true" MATLAB
grammar. Most of these you will never notice, but there are a few
that are significant:
* The transpose operator ' is not supported (due to lexing confusion
with the single quotes used in string constants).
* Constant matrices and cells must have individual elements separated
by a comma.
* Block comments are not supported.
For others, please see the comments in matlab.g
Hopefully, future versions will remedy this.
Cite As
David Wingate (2026). mparser (https://www.mathworks.com/matlabcentral/fileexchange/32769-mparser), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
mparser-0.1/
mparser-0.1/tests/
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 |
