Journal of Information Processing
Online ISSN : 1882-6652
ISSN-L : 1882-6652
Fast, Flexible, and Declarative Construction of Abstract Syntax Trees with PEGs
Kimio Kuramitsu
Author information
JOURNAL FREE ACCESS

2016 Volume 24 Issue 1 Pages 123-131

Details
Abstract

We address a declarative construction of abstract syntax trees with Parsing Expression Grammars. AST operators (constructor, connector, and tagging) are newly defined to specify flexible AST constructions. A new challenge coming with PEGs is the consistency management of ASTs in backtracking and packrat parsing. We make the transaction AST machine in order to perform AST operations in the context of the speculative parsing of PEGs. All the consistency control is automated by the analysis of AST operators. The proposed approach is implemented in the Nez parser, written in Java. The performance study shows that the transactional AST machine requires 25% approximately more time in CSV, XML, and C grammars.

Content from these authors
© 2016 by the Information Processing Society of Japan
Previous article Next article
feedback
Top