You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
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://se.mathworks.com/matlabcentral/fileexchange/32769-mparser), MATLAB Central File Exchange. Retrieved .
General Information
- Version 1.0.0.0 (174 KB)
MATLAB Release Compatibility
- Compatible with any release
Platform Compatibility
- Windows
- macOS
- Linux
| Version | Published | Release Notes | Action |
|---|---|---|---|
| 1.0.0.0 |
