使用Antlr完成源代码是否可行? [英] Is it feasible to use Antlr for source code completion?

查看:86
本文介绍了使用Antlr完成源代码是否可行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道此问题是否有效,因为我对源代码解析不是很熟悉.我的目标是为学习目的而为一种现有的编程语言(语言"X")编写源代码完成功能. Antlr(v4)是否适合此类任务,或者在不存在现有解决方案的情况下,是否应该手动完成必要的AST/解析树创建和解析?

I don't know, if this question is valid since i'm not very familiar with source code parsing. My goal is to write a source code completion function for one existing programming language (Language "X") for learning purposes. Is Antlr(v4) suitable for such a task or should the necessary AST/Parse Tree creation and parsing be done by hand, assuming no existing solutions exists?

除了编译器书籍列表之外,我没有找到太多关于该特定主题的信息,除了我不追求编译器.

I haven't found much information about that specific topic, except a list of compiler books, except a compiler is not what i'm after for.

推荐答案

GoWorks中的代码完成是使用ANTLR 4完全实现的.以下视频显示了此代码完成引擎的完成级别.代码完成示例从5分钟一直运行到视频结束.

The code completion in GoWorks is completely implemented using ANTLR 4. The following video shows the level of completion of this code completion engine. The code completion example runs from 5 minutes through the end of the video.

隧道视觉实验室的GoWorks IDE简介(预览版)

我从事代码完成算法研究已经很多年了,坚信没有更好的解决方案(自动或手动)来为新语言生成满足我所谓的高度要求的代码完成解决方案,响应式代码完成.如果您对那种性能或准确性不感兴趣,那么其他解决方案可能会让您更轻松地参与其中(我不亲自与他们合作,因为我对结果太失望了.)

I have been working on code completion algorithms for many years, and strongly believe that there is no better solution (automated or manual) for producing a code completion solution for a new language that meets the requirements for what I would call highly-responsive code completion. If you are not interested in that level of performance or accuracy, other solutions may be easier for you to get involved with (I don't work with those personally, because I am too easily disappointed in the results).

这篇关于使用Antlr完成源代码是否可行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆