Grammars for Free: Toward Grammar Inference for Ad Hoc Parsers

02/02/2022
by   Michael Schröder, et al.
0

Ad hoc parsers are everywhere: they appear any time a string is split, looped over, interpreted, transformed, or otherwise processed. Every ad hoc parser gives rise to a language: the possibly infinite set of input strings that the program accepts without going wrong. Any language can be described by a formal grammar: a finite set of rules that can generate all strings of that language. But programmers do not write grammars for ad hoc parsers – even though they would be eminently useful. Grammars can serve as documentation, aid program comprehension, generate test inputs, and allow reasoning about language-theoretic security. We propose an automatic grammar inference system for ad hoc parsers that would enable all of these use cases, in addition to opening up new possibilities in mining software repositories and bi-directional parser synthesis.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
02/24/2020

A Mechanised Semantics for HOL with Ad-hoc Overloading

Isabelle/HOL augments classical higher-order logic with ad-hoc overloadi...
research
10/04/2021

Structured abbreviation expansion in context

Ad hoc abbreviations are commonly found in informal communication channe...
research
04/19/2023

An Exploratory Study of Ad Hoc Parsers in Python

Background: Ad hoc parsers are pieces of code that use common string fun...
research
05/03/2022

Extending the View Composition Algebra to Hierarchical Data

Comparison is a core task in visual analysis. Although there are numerou...
research
06/03/2019

On Modelling the Avoidability of Patterns as CSP

Solving avoidability problems in the area of string combinatorics often ...
research
06/12/2019

Towards Geocoding Spatial Expressions

Imprecise composite location references formed using ad hoc spatial expr...
research
10/30/2022

On Catalan Constant Continued Fractions

The Ramanujan Machine project detects new expressions related to constan...

Please sign up or login with your details

Forgot password? Click here to reset