Announcing Ox release 1.6

Tom Shields <thomas.evans.shields@gmail.com>
Fri, 17 May 2019 17:01:34 -0500

          From comp.compilers

Related articles
Announcing Ox release 1.6 thomas.evans.shields@gmail.com (Tom Shields) (2019-05-17)
| List of all articles for this month |

From: Tom Shields <thomas.evans.shields@gmail.com>
Newsgroups: comp.compilers
Date: Fri, 17 May 2019 17:01:34 -0500
Organization: Compilers Central
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="47753"; mail-complaints-to="abuse@iecc.com"
Keywords: tools, parse, available
Posted-Date: 17 May 2019 18:15:11 EDT

Ox version 1.6 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 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 postdecoration 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.6 (17 May 2019)


** Enhancements


        The Ox "-t" command-line feature to automatically build and display a parse
        tree is reimplemented to build an internal representation of a parse tree
        visualization using the Graphviz cgraph library. The former implementation
        was seriously broken for large parse trees. The Graphviz implementation
        requires user-provided code (using Graphviz package capabilities) to either
        layout, render and display the parse tree, or to serialize the internal
        representation into the Graphviz DOT language external representation into a
        text file for later processing. User-defined visual decoration can be added
        to the default parse tree visualization generated by an evaluator using
        capabilities of the Graphviz cgraph library.




** Bug fixes


        Ox will now handle input text files using the DOS/Windows line break (CRLF)
        and the old Mac line break (CR)


        Corrected an Ox lexer rule that was passing some input file newline (LF)
        characters directly to stdout


        Corrected a segfault when `__purgeBuffer()' was called prior to initializing
        the `struct bufferRec' parameter passed in




** Test suite


        Corrected the Attribute Grammar in test cases bison-2.3-glr, bison-2.4-glr,
        bison-3.x-glr, btyacc-decls, and byacc-bt-decls to make the hidden
        dependencies on the global symbol table explicit




** Build system


        The configure script new displays a configuration summary




-----------------------------------------------------------------------------
** Enhancements


    The GPPL compiler will now build with the Boehm-Demers-Weiser Conservative
    C/C++ Garbage Collector package (www.hboehm.info/gc), if specified in the
    configuration


    Both Ox and the GPPL compiler will now build with the Dmalloc Debug Malloc
    Library (dmalloc.com), if specified in the configuration




** Bug fixes


    Corrected a memory leak in Ox-generated evaluators: semantic stack heap data,
    separate from the attributed AST tree node heap data, not reclaimed


    Corrected a minor memory leak in Ox: heap allocated file name string extracted
    from a "#line" directive not free'd in all cases


    Corrected a segfault in Ox (Linux): if Ox built with libgc w/o libcord, heap
    data allocated (with `malloc()') by the library function `vasprintf()' was
    passed to `GC_free()'


    Corrected a segfault in Ox (Solaris): heap allocatoin size `off by 1' error




** Test suite


    Portability improvements (removed use of `basename' in run script)




** Build system


    Added Dmalloc Debug Malloc Library (dmalloc.com) as a build option


    Improved robustness & generality (option consistency checking,
    option interactions)




-----------------------------------------------------------------------------
** Attribute grammar evaluator skeleton


    The generated evaluator framework has been refactored to work with
    multiple Yacc compatible parser generators (`bison', `byacc', `btyacc',
    `msta') in addition to the original AT&T `yacc'. This includes support
    for the various non-LALR(1) parsing algorithms provided by these tools
    (LR(k>1), GLR, backtracking), the `byacc' and `bison' pure parser skeleton
    variants, and the `bison' push parser skeleton variant.




** Enhancements


    Incorporated patches from the Technical University of Vienna, Austria, by
    Martin Kögler, Florian G. Plug, and Mihai Ghete to build Ox using `flex'.


    Accept/pass-through (most) bison, byacc, btyacc, msta, and flex
    specification %-directives; recognize those that impact generated code.


    Accept C++ namespace IDs and template type specifiers in a `%token', etc,
    type tag.


    Accept a larger subset of the C/C++ type syntax in attribute declarations,
    including types and type qualifiers added in the C99 standard


    Allow properly nested parenthesized expressions in macro actual
    parameters, including C comma expressions, removing the requirement for
    a trailing comma.


    Generate `#line' directives in the Ox-generated lexer and parser
    specifications. Disable this functionality at configuration-time, or at
    run-time with a command-line option, if using lexer and/or parser
    generators that do not accept `#line' directives.


    Additional command-line options:
    - specify the prefix for Ox-generated external names, replacing the
        default "yyy" prefix, which enables linking multiple evaluators in a
        single application
    - specify output file name prefixes, replacing the default "oxout" prefix
    - specify that the lexer is intended for use with a bison or byacc pure
        parser skeleton, generating indirection references to yylval in leaf
        attribute evaluation code.
    - opt out of generating `#line' directives


    Eliminated fixed size tables in Ox and in Ox-generated evaluators.


    Provided the `yyyinit()' function, which must be called prior to the first
    call of the lexer by the parser to initialize Xwindows data structures if
    the Ox "-t" command-line option is used. Invocation of `yyyinit()' is
    added automatically to a generated Lex specification file, but must be
    invoked by user-written code for a generic (non-Lex) handwritten lexer.




** Bug fixes


    Corrected the Ox "-S" command-line option failure for generic (non-Lex)
    lexer specifications.


    Corrected multiple invocations of `fclose()' on a given output file; this
    caused a segmentation fault or an infinite loop within `fclose()' in
    different glibc Linux implementations.


    Added an `atexit()' handler to cleanup temporary files otherwise left
    dangling by an Ox abnormal exit from a C library function.


    Corrected missing parameter in invocation to `genImmCrefForAttrbRef()'
    exposed by the switch to use of Standard C function prototypes.




** Documentation


    Revised User Reference Manual and manpage to match the current release.




** Test suite


    Test cases were added that verify correctness of attribute evaluation with
    the various non-LALR(1) parsing algorithms (LR(k>1), GLR, backtracking)
    and the pure and push parser skeleton variants


    A test case was added to verify that the `#line' directive correctly
    tracks source lines from the original Ox input file in error messages.




** Build system


    Implemented a GNU Automake generated Autoconf Build system, with
    configure-time options to:
    - choose a specific Lex and/or Yacc compatible generator, rather than the
        tool found first by the configure script
    - build a version of Ox with debugging or profiling enabled
    - build a version of Ox with `#line' directives disabled
    - use the Boehm-Demers-Weiser C/C++ Conservative Garbage Collector package
        (www.hboehm.info/gc), if found by the configure script


    Tested build portability across the macOS, Linux, Windows (Cygwin, Msys),
    and Solaris development environments, including multiple version of
    various C/C++ compilers multiple version of lex, yacc, flex, bison, byacc,
    btyacc, and msta.




** Backward incompatible changes from release G1.04


    The approach adopted by Ox to work across multiple Yacc compatible parser
    generators via modification of the Yacc `%union' declaration (or
    generation of a `%union' declaration, if one is not present) enables
    portable use of the Yacc semantic value stack to manage the Ox semantic
    attribute stack.


    Since Ox uses the Yacc `%union' mechanism, the semantic value type
    definition mechanisms supported by Yacc in user-supplied code:
        (1) #define YYSTYPE <C_type_specifier> (default: `int')
        (2) typedef <C_type_specifier> YYSTYPE;
    are not suported. Yacc grammar specifications that make use of one of
    these two approaches to the definition of `YYSTYPE' will not work as-is
    with Ox, but must be first modified to include a Yacc `%union'
    declaration to make the semantic value type explicit.


    The requirement for a trailing comma in macro formal and actual parameter
    lists has been eliminated; trailing commas in these positions are no
    longer supported.


    The curses-based incremental tree construction display mechanism was
    removed. The lookahead processing in the various Yacc compatible
    variants - `msta' LR(k>1), `byacc' & `btyacc' backtracking, and `bison'
    GLR - can buffer more than a single lookahead token. The terminal node
    processing from release G1.04 only worked for the single token lookahead
    case. This capability may be reintroduced in a future version.


    Removed the `@prune' reserved word (the token wasn't actually passed from
    the lexer to the parser in release G1.04) and the associated
    implementation. The generated evaluator knows better than the author when
    pruning is feasible.


    Enabled the `@decorate' reserved word (the token wasn't actually passed
    from the lexer to the parser in release G1.04). The `@decorate' directive
    forces evaluation of attributes, which may be required for the
    implementation of interactive evaluators.


    Renamed `yyyerror()' to `yyyabort()'.


    These command-line options are no longer relevant and have been removed:
        "-aN" set structure-alignment size to N (no longer relevant)
        "-C" print Copyright statment
        "-I" ANSI/ISO C/C++ instead of K&R C source
        "-T" generate curses-based code to display tree construction
        "-U" print command-line usage summary (replaced by "--help")
        "-XaN" change the size of an internal table in Ox
        "-YaN" change the size of an internal table in the generated evaluator
        "-YY" enable "-YaN" command-line option in generated evaluator



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.