The Rexx Parser


The Rexx Parser

The Rexx Parser is hosted on:

The documentation copy at https://rexx.epbcn.com/rexx-parser/ uses the Rexx Highlighter to display Rexx programs, and therefore has better highlighting. On the other hand, the copy at https://github.com/JosepMariaBlasco/rexx-parser/ has version control, bug reporting, and all the features offered by GitHub.

Beware: some of the program listings that appear in this documentation will not display at all in the GitHub version, as GitHub does not implement the source attribute for Rexx fenced code blocks.

/******************************************************************************/
/* This is a sample Rexx code fragment, numbered, starting at line 93.        */
/* It shows many of the features of the Rexx Parser.                          */
/******************************************************************************/

/**
 * This is a doc-comment. The first statement, up to the first period,
 * is the summary, and the rest is the description.
 *
 * @param name Description
 */
::Method open Package Protected         -- Bold, underline, italic
  Expose x pos stem.

  Use Strict Arg name

  a   = 12.34e-56 + " -98.76e+123 "     -- Highlighting of numbers
  len = Length( Stem.12.2a.x.y )        -- A built-in function call
  pos = Pos( "S", "String" )            -- An internal function call
  Call External pos, len, .True         -- An external function call
  .environment~test.2.x = test.2.x      -- Method call, compound variable

  Exit "नमस्ते"G,  "P ≝ 𝔐",  "🦞🍐"     -- Unicode strings

---
---  This is the main description summary.
---
---  _Markdown doc-comment_ lines start with "---".
---
Pos: Procedure                          -- A label
  Return "POS"( Arg(1), Arg(2) ) + 1    -- Built-in function calls

The Rexx Parser is a full Abstract Syntax Tree (AST) parser for Rexx, ooRexx and Executor written by Josep Maria Blasco <>.

The Rexx Parser in ooRexx

The parser and the highlighter are part of ooRexx since version 5.3.0 beta, revision 13571. A program needs only ::Requires "parser.cls". The utilities highlight, fencedcode and rexxcheck are installed with the interpreter, and elements, elident and rxcomp are in its samples/ directory. Their master copy lives in the ooRexx SVN repository, and, as the rest of ooRexx, they are distributed under the Common Public License 1.0, and are copyright of their author and of the Rexx Language Association.

Their reference is the book The Rexx Parser: Parsing and Highlighting, which is part of the ooRexx documentation (PDF; it is a draft: comments are welcome).

This package holds everything else: RexxPub, the Rexx publishing framework, and a number of tools and experiments built on the parser. It is distributed under the Apache 2.0 license, except for the files listed in NOTICE: the style sheets of the highlighter, under the Common Public License 1.0, as in ooRexx, and the files of other origins. Some files may contain contributions from other authors, as attributed in the corresponding copyright notices.

Current version and downloads

The current release is 1.0, refresh 20261126. You can download it here. It needs ooRexx 5.3.0 beta, revision 13677 or later (see Installation). Daily builds can be found at https://rexx.epbcn.com/rexx-parser/.

For a version of ooRexx that does not come with the parser, or that does not have CATCH, FINALLY and THROW, we keep a copy of the package as it was in beta 0.7, refresh 20260929, with its own copy of the parser: Rexx-Parser-standalone.zip.

The Rexx Parser is also distributed as part of net-oo-rexx, a software bundle curated by Rony Flatscher and consisting of several different Rexx- (and NetRexx-) related packages. The net-oo-rexx package can be downloaded at https://github.com/RexxLA/net-oo-rexx/.

Documentation

The reference of the parser and the highlighter is the book (see above). You may also be interested in browsing our documentation, with many examples. In particular, you may want to use one the following quick links:

Child projects

The Rexx Highlighter

The Rexx Highlighter is a child project of the Rexx Parser. Developed around a common code base, it includes output drivers for HTML, ANSI Terminals and DocBook; RexxPub adds a driver for LaTeX.

  • What is highlighted, the styles (with a gallery of all of them), style patches and the output formats: see the book.
  • The LaTeX Highlighter, part of RexxPub.