开发者

Lua Syntax Highlighting in Java

开发者 https://www.devze.com 2023-01-16 06:48 出处:网络
I\'m using Java Swing to develop an application and I want to use Lua as an embedded scripting language. For that I need to create a text component that would provide syntax highlighting and automatic

I'm using Java Swing to develop an application and I want to use Lua as an embedded scripting language. For that I need to create a text component that would provide syntax highlighting and automatically organize the code by adding tabs and so on.

Is there a library or resource that I could use in order to achieve this? Her开发者_JAVA百科e is an example of what I want to do: http://openendedgroup.com/field/attachment/wiki/OverviewBanners2/p2.png

Thanks,


Code formatting (indentation) and Syntax Highlighting are two different pairs of shoes! For formatting you also need a relative complete parser, while for syntax highlighting you can simply tokenize your input and colorize it.

I believe there are extensible highlighters out there, but you will need something like the ANTLR parser if you need to format your code.

0

精彩评论

暂无评论...
验证码 换一张
取 消