gpt4 book ai didi

parsing - 如何解析 kotlin 代码?

转载 作者:IT老高 更新时间:2023-10-28 13:42:05 27 4
gpt4 key购买 nike

我需要分析kotlin文件代码,检测关键字“data”和“?”。

问题是我找不到像 JavaParser 这样的库。我不需要强大的工具,只需要能返回行数的工具。

有什么想法吗?

最佳答案

我使用 antlr4 来做。我创建了一个开源库: https://github.com/sarahBuisson/kotlin-parser

<dependency
<groupId>com.github.sarahbuisson</groupId>
<artifactId>kotlin-parser</artifactId>
</dependency>

关于parsing - 如何解析 kotlin 代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45956449/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com