RegReg: a Lightweight Generator of Robust Parsers for Irregular Languages

Citation

Mario Latendresse. RegReg: a Lightweight Generator of Robust Parsers for Irregular Languages, in Proceedings of the 10th Working Conference on Reverse Engineering (WCRE), Victoria, Canada, November 2003.

Abstract

In reverse engineering, parsing may be partially done to extract lightweight source models. Parsing code containing preprocessing directives, syntactical errors and embedded languages is a difficult task using context-free grammars. Several researchers have proposed some form of lexical analyzer to parse such code. We present a lightweight tool, called RegReg, based on a hierarchy of lexers described by tagged regular expressions. By using tags, the automatically generated parse tree can be easily manipulated. The ability to control the matching rule mechanism for each regular expression increases efficiency and disambiguation choices. RegReg is lightweight as it uses a minimal number of features and its implementation uses only deterministic automaton. It has been implemented in Scheme which allows extending the tool in a functional programming style. We demonstrate how RegReg can be used to implement island and fuzzy parsing. RegReg is publicly available under a BSD-like license.


Read more from SRI

  • surgeons around a surgical robot

    The SRI research behind today’s surgical robotics

    Intuitive’s da Vinci 5 system represents a major leap in robotic-assisted medicine. It all started at SRI, which continues to advance teleoperation technologies.

  • a collage of digital graphs

    A banner year for quantum

    SRI-managed QED-C’s annual report on quantum trends captures an industry accelerating rapidly from technical promise toward major global impact.

  • ICE Cube containing SRI’s aerogel experiment, photographed prior to launch. Source: Aerospace Applications North America

    An SRI carbon capture experiment launches into space

    By synthesizing carbon-absorbing aerogels in microgravity, SRI research will give us a rare glimpse into how these materials could be radically improved.