arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2402.08754cs.SE
收藏

即时语法高亮:泛化与加速

On-the-Fly Syntax Highlighting: Generalisation and Speed-ups

Marco Edoardo Palma, Alex Wolf, Pasquale Salza, Harald C. Gall

AI总结:

本文研究即时语法高亮的泛化与加速问题,通过扩展循环神经网络方法至三种新编程语言验证泛化性,并提出新型卷积神经网络模型在GPU上实现更快速度与高准确率。

摘要:

即时语法高亮是将视觉次要记号值快速关联到语言派生中每个字符的任务。该领域的研究由在线软件开发工具的普及所驱动,这些工具经常在屏幕上显示源代码并严重依赖语法高亮机制。在此背景下,该领域的解析器面临三个相互矛盾的需求:速度、准确性和开发成本。速度约束对于确保工具可用性至关重要,表现为访问在线源代码的终端用户的响应能力以及最小化系统开销。同时,实现精确的高亮对于增强代码可理解性至关重要。然而,获得准确的结果需要对所考虑的代码执行语法分析的能力,即使在语法正确性不同的情况下也是如此。此外,鉴于编程语言版本众多,解决此类解析器的开发成本势在必行。该领域当前最先进的方法利用编程语言的原始词法分析器和语法分析器创建语法高亮预言机,随后用于训练基础循环神经网络模型。由于该解决方案的泛化问题仍然存在,本文通过将原始工作扩展到三种额外的编程语言并对结果进行全面审查来解决这一方面。此外,通过引入一种新颖的基于卷积的神经网络模型,缓解了评估性能和训练成本方面的原始限制。本研究考察了在GPU上运行模型的性能提升,发现新的CNN实现比以前的方法快得多,同时保持高准确率。

英文摘要:

On-the-fly syntax highlighting is the task of rapidly associating visual secondary notation values with each character of a language derivation. Research in this domain is driven by the prevalence of online software development tools, which frequently display source code on screen and heavily rely on syntax highlighting mechanisms. In this context, three contrasting demands confront resolvers in this space: speed, accuracy, and development costs. Speed constraints are essential to ensure tool usability, manifesting as responsiveness for end users accessing online source code and minimising system overhead. Simultaneously, achieving precise highlighting is critical for enhancing code comprehensibility. Nevertheless, obtaining accurate results necessitates the capacity to perform grammatical analysis on the code under consideration, even in cases of varying grammatical correctness. Furthermore, addressing the development costs of such resolvers is imperative, given the multitude of programming language versions. The current state-of-the-art approach in this field leverages the original lexer and parser of programming languages to create syntax highlighting oracles, subsequently used for training base Recurrent Neural Network models. As the question of the generalisation of such a solution persists, this paper addresses this aspect by extending the original work to three additional mainstream programming languages and conducting a comprehensive review of the outcomes. Moreover, the original limitations in evaluation performance and training costs are mitigated through the introduction of a novel Convolutional based Neural Network model. This study examines the performance gains of running models on GPUs, finding that the new CNN implementation is much faster than previous methods while maintaining high accuracy.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑