# Context-Aware Parse Trees

arXiv: https://arxiv.org/abs/2003.11118 · HTML: https://mlsanity.com/paper/2003.11118/

## Key facts

- Cited by 1 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 24 Mar 2020.

## Built on by (most cited first, 1 of 1)

- [MLSmellHound: A Context-Aware Code Analysis Tool](https://mlsanity.com/paper/2205.03790/) (2022)

## Abstract (arXiv)

The simplified parse tree (SPT) presented in Aroma, a state-of-the-art code recommendation system, is a tree-structured representation used to infer code semantics by capturing program structure rather than program syntax. This is a departure from the classical abstract syntax tree, which is principally driven by programming language syntax. While we believe a semantics-driven representation is desirable, the specifics of an SPT's construction can impact its performance. We analyze these nuances and present a new tree structure, heavily influenced by Aroma's SPT, called a context-aware parse tree (CAPT). CAPT enhances SPT by providing a richer level of semantic representation. Specifically, CAPT provides additional binding support for language-specific techniques for adding semantically-salient features, and language-agnostic techniques for removing syntactically-present but semantically-irrelevant features. Our research quantitatively demonstrates the value of our proposed semantically-salient features, enabling a specific CAPT configuration to be 39% more accurate than SPT across the 48,610 programs we analyzed.
