EUVIMEDEUVIMED entdecken
Open Access · CC BY 4.0

Syntactic Code Search with Sequence-to-Tree Matching: Supporting Syntactic Search with Incomplete Code Fragments

Gabriel Matute, Wode Ni, Titus Barik, Alvin Cheung, Sarah E. Chasins

Proceedings of the ACM on Programming Languages · 20.06.2024 · 8 (PLDI) · 2051-2072

DOI: 10.1145/3656460 ↗

Kurz gefasst

Fachartikel in der Zeitschrift Proceedings of the ACM on Programming Languages, online erschienen am 20.06.2024. Verfasst von Gabriel Matute und 4 weiteren Autor:innen. Die Arbeit wurde bisher 5-mal zitiert (Crossref) und nennt 47 Literaturangaben. Der Volltext ist frei zugänglich (Open Access, CC BY 4.0). Gefördert von: NSF.

AbstractBibliografische AngabenZitierenVerwandte Studien

Abstract (Originalsprache)

Lightweight syntactic analysis tools like Semgrep and Comby leverage the tree structure of code, making them more expressive than string and regex search. Unlike traditional language frameworks (e.g., ESLint) that analyze codebases via explicit syntax tree manipulations, these tools use query languages that closely resemble the source language. However, state-of-the-art matching techniques for these tools require queries to be complete and parsable snippets, which makes in-progress query specifications useless. We propose a new search architecture that relies only on tokenizing (not parsing) a query. We introduce a novel language and matching algorithm to support tree-aware wildcards on this architecture by building on tree automata. We also present stsearch , a syntactic search tool leveraging our approach. In contrast to past work, our approach supports syntactic search even for previously unparsable queries. We show empirically that stsea rch can support all tokenizable queries, while still providing results comparable to Semgrep for existing queries. Our work offers evidence that lightweight syntactic code search can accept in-progress specifications, potentially improving support for interactive settings. CCS Concepts: • Software and its engineering → Formal language definitions ; Software maintenance tools; • Information systems → Query representation; • Theory of computation → Tree languages.

Förderung

  • NSF

Zitieren

APA

Matute, G., Ni, W., Barik, T., Cheung, A., & Chasins, S. E. (2024). Syntactic Code Search with Sequence-to-Tree Matching: Supporting Syntactic Search with Incomplete Code Fragments. Proceedings of the ACM on Programming Languages, 8(PLDI), 2051-2072. https://doi.org/10.1145/3656460

Vancouver

Matute G, Ni W, Barik T, Cheung A, Chasins SE. Syntactic Code Search with Sequence-to-Tree Matching: Supporting Syntactic Search with Incomplete Code Fragments. Proceedings of the ACM on Programming Languages. 2024;8(PLDI):2051-2072. doi:10.1145/3656460

BibTeX
@article{Matute2024,
  author = {Matute, Gabriel and Ni, Wode and Barik, Titus and Cheung, Alvin and Chasins, Sarah E.},
  title = {Syntactic Code Search with Sequence-to-Tree Matching: Supporting Syntactic Search with Incomplete Code Fragments},
  journal = {Proceedings of the ACM on Programming Languages},
  year = {2024},
  volume = {8},
  number = {PLDI},
  pages = {2051--2072},
  doi = {10.1145/3656460}
}
Kostenlos starten →