Announcing Ox release 1.12.2
From
Tom Shields@thomas.evans.shields@gmail.com to
comp.compilers on Fri Dec 12 13:07:01 2025
From Newsgroup: comp.compilers
Ox version 1.12.2 is now available on SourceForge (sourceforge.net/projects/ox-attribute-grammar-compiler/).
Ox generalizes the function of Yacc in the way that an attribute grammar generalizes a context-free grammar. Ordinary Yacc and Lex specifications may be augmented with definitions of synthesized and inherited attributes written in C/C++ syntax. Ox checks these specifications for consistency and completeness, and generates from them a program that builds and decorates attributed parse trees. The user may specify post-decoration traversals for easy ordering of side
effects, such as code generation. Ox handles the tedious and error-prone details
of writing code for parse-tree management, so its use eases problems of security
and maintainability associated with that aspect of translator development.
Ox NEWS
* Noteworthy changes in release 1.12.2 (6 December 2025)
** Enhancements
The Ox skeleton macro library used in the Ox code generation process is now (mostly) implemented using Ox Macro Language (OXML) macro definitions. The Oxml2m4 package provides the oxml2m4 utility to translate OXML macro definition's into macro definitions usable by M4, leveraging the M4sugar (www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Programming-in-M4sugar.html)
macro library used in the GNU Autoconf (www.gnu.org/software/autoconf/manual). OXML is an XML-based macro definition language defined by an XSD schema, which enables use of an XSD-aware editor to validate OXML source during macro development.
A new command-line option "-I directory" (long form "--include=directory") is now available. If specified, the M4 macro processor will search for Ox skeleton macro files in 'directory' first. If the option occurs more than once, the directories are searched in the order specified. If the rCyOX_M4PATH' environment
variable is set, it is expected to contain a directory to be searched next. Finally, the installed Ox skeleton macro library is searched.
A new long form '--treeviz' of the '-t' command-line option is now available, with optional arguments 'top-to-bottom', 'left-to-right', 'bottom-to-toprCO and 'right-to-left' (default: 'left-to-right') that determine the orientation of the
AST visualization.
Ox macro definitions may now occur local to an L-file.
** Internals
Attribute dependency semantic processing is moved out of the parsers.
Optimizations are implemented in the generated code:
- Run-time tables 'yyyProds', 'yyySorts', and 'yyyIEL` are restructured as irregular multidimensional arrays.
- 'yyyReclaimSemStkEls ()' is skipped for an empty RHS.
- 'yyyGenIntNode ()', called at the start of each Ox-generated parse action,
is split into multiple functions, called in sequence:
1. The revised 'yyyGenIntNode ()' now only creates the AST node.
2. 'yyyInitUnsolvedDeps ()' initializes attribute dependee counts.
3. The run-time loop checking for attributes with zero dependees (solved by default) is unrolled during Ox code generation into a series of calls for attributes with zero dependees to 'yyyMarkLHS0DependeesSolved ()' to add an LHS attribute to the solved attribute list, and to 'yyyReadyRHS0Dependees ()' to add the dependents of an RHS attribute to the Ready Set.
4. The run-time loop over the RHS checking for already solved attributes is unrolled during Ox code generation into a series of calls to 'yyyReadySolvedDeps ()' for each RHS symbol with dependents to add those dependents to the Ready Set.
Run-time management of AST visualization attributes is restructured:
- AST visualization attribute initialization for internal and leaf nodes is merged into a single function.
- The AST visualization attribute is moved from the 'yyyASTnodeT' structure into the the 'yyyT<sort#>' structures: all attribute references in generated code are now identical.
Temporary files are eliminated.
** Bug fixes
A Bison '%skeleton' directive file name with an unexpected C/C++ extension now generates an error diagnostic, rather than bad code.
Correct the check resulting in the error diagnostic that both inherited and synthesized dependents occur in an explicit mode attribute definition.
** Documentation
Appendix D in the Ox User Reference Manual is updated to add the '--treeviz', '-I' and '--include' options.
The introductory discussion in Appendix F in the Reference Manual on Ox support for attributed Abstract Syntax Tree (AST) visualization is expanded.
** Build System
The C++ 2020 standard is now required to compile both the Ox source and Ox generated C++ evaluators.
The Libnew package is now separately distributed, rather than bundled in the Ox distribution package.
The Oxml2m4 package is separately distributed.
--- Synchronet 3.21a-Linux NewsLink 1.2