CPEG: A Typed Tree Construction from Parsing Expression Grammars with Regex-Like Captures

12/18/2018
by   Daisuke Yamaguchi, et al.
0

CPEG is an extended parsing expression grammar with regex-like capture annotation. Two annotations (capture and left-folding) allow a flexible construction of syntax trees from arbitrary parsing patterns. More importantly, CPEG is designed to guarantee structural constraints of syntax trees for any input strings. This reduces the amount of user code needed to check whether the intended elements exist. To represent the structural constraints, we focus on regular expression types, a variant formalism of tree automata, which have been intensively studied in the context of XML schemas. Regular expression type is inferred from a given CPEG by the type inference that is formally developed in this paper. We prove the soundness and the uniqueness of the type inference. The type inference enables a CPEG to serve both as a syntactic specification of the input and a schematic specification of the output.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
08/24/2017

A Computational Interpretation of Context-Free Expressions

We phrase parsing with context-free expressions as a type inhabitation p...
research
01/13/2020

A Verified Packrat Parser Interpreter for Parsing Expression Grammars

Parsing expression grammars (PEGs) offer a natural opportunity for build...
research
06/28/2018

Syntax Error Recovery in Parsing Expression Grammars

Parsing Expression Grammars (PEGs) are a formalism used to describe top-...
research
08/01/2016

Left-corner Methods for Syntactic Modeling with Universal Structural Constraints

The primary goal in this thesis is to identify better syntactic constrai...
research
05/24/2021

Fast and Space-Efficient Construction of AVL Grammars from the LZ77 Parsing

Grammar compression is, next to Lempel-Ziv (LZ77) and run-length Burrows...
research
04/09/2018

From Regular Expression Matching to Parsing

Given a regular expression R and a string Q the regular expression match...
research
01/31/2018

Recognising and Generating Terms using Derivatives of Parsing Expression Grammars

Grammar-based sentence generation has been thoroughly explored for Conte...

Please sign up or login with your details

Forgot password? Click here to reset