Sciweavers

DLS
2008

A parsing machine for PEGs

14 years 2 months ago
A parsing machine for PEGs
Parsing Expression Grammar (PEG) is a recognition-based foundation for describing syntax that renewed interest in top-down parsing approaches. Generally, the implementation of PEGs is based on a recursive-descent parser, or uses a memoization algorithm. We present a new approach for implementing PEGs, based on a virtual parsing machine, which is more suitable for pattern matching. Each PEG has a corresponding program that is executed by the parsing machine, and new programs are dynamically created and composed. The virtual machine is embedded in a scripting language and used by a patternmatching tool. We give an operational semantics of PEGs used for pattern matching, then describe our parsing machine and its semantics. We show how to transform PEGs to parsing machine programs, and give a correctness proof of our transformation. Categories and Subject Descriptors D.3.3 [Programming Languages]: Language Constructs and Features; D.3.1 [Programming Languages]: Formal Definitions and Theo...
Sérgio Medeiros, Roberto Ierusalimschy
Added 19 Oct 2010
Updated 19 Oct 2010
Type Conference
Year 2008
Where DLS
Authors Sérgio Medeiros, Roberto Ierusalimschy
Comments (0)