Dave
Dave

Reputation: 7603

Lua Syntax Highlighting in Java

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? Here is an example of what I want to do: http://openendedgroup.com/field/attachment/wiki/OverviewBanners2/p2.png

Thanks,

Upvotes: 2

Views: 408

Answers (1)

Daniel
Daniel

Reputation: 28074

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.

Upvotes: 2

Related Questions