Inferring Attributed Grammars from Parser Implementations
Andreas Pointner, Josef Pichler, Herbert Pr\"ahofer

TL;DR
This paper presents a novel method for inferring attributed grammars from parser implementations by analyzing runtime behavior, enabling automatic recovery of both syntax and semantics of input processing.
Contribution
It introduces a dynamic analysis technique to extract semantic information and generate attributed grammars from recursive descent parser implementations.
Findings
Successfully infers attributed grammars from parser code
Accurately reproduces program behavior with generated grammars
Demonstrates feasibility on initial set of programs
Abstract
Software systems that process structured inputs often lack complete and up-to-date specifications, which specify the input syntax and the semantics of input processing. While grammar mining techniques have focused on recovering syntactic structures, the semantics of input processing remains largely unexplored. In this work, we introduce a novel approach for inferring attributed grammars from parser implementations. Given an input grammar, our technique dynamically analyzes the implementation of recursive descent parsers to reconstruct the semantic aspects of input handling, resulting in specifications in the form of attributed grammars. By observing program executions and mapping the program's runtime behavior to the grammar, we systematically extract and embed semantic actions into the grammar rules. This enables comprehensive specification recovery. We demonstrate the feasibility of…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsNatural Language Processing Techniques · Topic Modeling · Semantic Web and Ontologies
