The Pyttern Program Query Language

Uloženo v:
Podrobná bibliografie
Název: The Pyttern Program Query Language
Autoři: Liénard, Julien, Mens, Kim, Nijssen, Siegfried
Zdroj: ISBN:978-3-95977-382-9 ; Companion Proceedings of the 9th International Conference on the Art, Science, and Engineering of Programming (Programming 2025), vol. 134 (23) ; 9th Symposium on Computer Languages, Implementations and Tools, Prague, Czechia, 2-6 June 2025.
Informace o vydavateli: Dagstuhl Publishing
Rok vydání: 2025
Popis: Despite the availability of numerous tools and languages for detecting structural patterns in programs, their complexity often presents a steep learning curve. This highlights the need for a program query language that is easier to learn, use, and read while remaining sufficiently expressive for defining and detecting relevant structural coding patterns in program code. To address this challenge, we present Pyttern, a query language that extends Python syntax with regular-expression-inspired wildcards, enabling intuitive pattern-based querying of Python code. Its implementation relies upon a custom pushdown automaton describing how to match patterns over program parse trees, thus providing a robust foundation for structural code analysis. We evaluate Pyttern’s usability and effectiveness through a study involving 35 master’s students, who were asked to write seven different patterns to identify known programming misconceptions. The results demonstrate that Pyttern is both easy to learn and practical to use, at least for analysing small-scale programs. ; status: Published
Druh dokumentu: conference object
Popis souboru: application/pdf
Jazyk: unknown
ISBN: 978-3-95977-382-9
3-95977-382-X
Relation: https://lirias.kuleuven.be/handle/20.500.12942/779981; https://doi.org/10.4230/OASIcs.Programming.2025.23
DOI: 10.4230/OASIcs.Programming.2025.23
Dostupnost: https://lirias.kuleuven.be/handle/20.500.12942/779981
https://hdl.handle.net/20.500.12942/779981
https://lirias.kuleuven.be/retrieve/59bdca85-2d08-4494-b3d2-62ddd0d485a1
https://doi.org/10.4230/OASIcs.Programming.2025.23
Rights: info:eu-repo/semantics/openAccess ; public ; https://creativecommons.org/licenses/by/4.0/
Přístupové číslo: edsbas.6046F8AF
Databáze: BASE
Popis
Abstrakt:Despite the availability of numerous tools and languages for detecting structural patterns in programs, their complexity often presents a steep learning curve. This highlights the need for a program query language that is easier to learn, use, and read while remaining sufficiently expressive for defining and detecting relevant structural coding patterns in program code. To address this challenge, we present Pyttern, a query language that extends Python syntax with regular-expression-inspired wildcards, enabling intuitive pattern-based querying of Python code. Its implementation relies upon a custom pushdown automaton describing how to match patterns over program parse trees, thus providing a robust foundation for structural code analysis. We evaluate Pyttern’s usability and effectiveness through a study involving 35 master’s students, who were asked to write seven different patterns to identify known programming misconceptions. The results demonstrate that Pyttern is both easy to learn and practical to use, at least for analysing small-scale programs. ; status: Published
ISBN:9783959773829
395977382X
DOI:10.4230/OASIcs.Programming.2025.23