|
MXVM 1.8.1
Virtual Machine, Compiler, and Pascal Frontend
|
Generates syntax-highlighted HTML output from Pascal (.pas) source code. More...
#include <html_gen.hpp>
Public Member Functions | |
| PasHTMLGen (const std::string &src) | |
| Construct from Pascal source text. | |
| void | output (std::ostream &out, const std::string &filename, const std::string &cssHref="mxvm-highlight.css") |
| Write generated HTML to an output stream. | |
Static Public Member Functions | |
| static std::string | defaultCss () |
| Return the default stylesheet text. | |
Private Attributes | |
| std::string | source |
Generates syntax-highlighted HTML output from Pascal (.pas) source code.
Supports all keywords, types, and built-ins recognised by the MXVM Pascal compiler (from both the parser and validator keyword sets), plus Pascal comment styles ({ }, (* *), //), single-quoted string literals with '' escape, hex literals ($FF), and char literals (#65 / #$41).
The generated HTML links to an external stylesheet instead of embedding styles inline, so colours and fonts can be customised by editing that file. Call defaultCss() to obtain the bundled default stylesheet text.
Definition at line 46 of file html_gen.hpp.
|
explicit |
|
static |
Return the default stylesheet text.
Covers all span classes used by both HTMLGen (.mxvm) and PasHTMLGen (.pas) output. Write this string to mxvm-highlight.css alongside the HTML files and edit it freely to change the colour scheme.
Definition at line 326 of file html_gen.cpp.
Referenced by ensureCss(), and output().
| void mxvm::PasHTMLGen::output | ( | std::ostream & | out, |
| const std::string & | filename, | ||
| const std::string & | cssHref = "mxvm-highlight.css" ) |
Write generated HTML to an output stream.
| out | Output stream |
| filename | Source filename (used in the HTML <title>) |
| cssHref | href for the linked stylesheet (default: "mxvm-highlight.css") |
Definition at line 378 of file html_gen.cpp.
References defaultCss(), and source.
Referenced by writeHtml().
|
private |
Definition at line 70 of file html_gen.hpp.
Referenced by PasHTMLGen(), and output().