Parsing Simulink mdl files with Pyparsing
In which I present a simple parser for Simulink mdl files, made using the excellent Pyparsing library.
In which I present a simple parser for Simulink mdl files, made using the excellent Pyparsing library.
I recently held a PowerPoint presentation which had several listings of XHTML and
CSS code. Source listings are not terribly exciting to read, so I wanted
to make them more readable and pretty by using syntax highlighting.
I did some research and found out that what I needed was a decent text editor that could export source code as colored HTML or RTF, that can be imported into PowerPoint and Word. To my pleasant surprise I discovered that I could use the SciTE editor based on the same Scintilla lexers used to colorize source code on fauskes.net.
Syntax highlighting of code snippets is something I've always wanted to implement on fauskes.net. I wanted to generate colorized HTML from XML/HTML, CSS, PHP, LaTeX and Python source code. Writing a full-fledge, multi language syntax highlighter is not a trivial task, and I felt no need for reinventing the wheel. Therefore I went looking for an existing Python package to do all the hard work for me. Fortunately I found SilverCity.