Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Lua Development Tools » Sample code used in LDT to generate AST(how to generate ast in ldt)
Sample code used in LDT to generate AST [message #1219040] Sat, 30 November 2013 03:14 Go to next message
coco peng is currently offline coco pengFriend
Messages: 2
Registered: November 2013
Junior Member
I have just downloaded LDT and want to develop a lua obfuscator in java based Eclipse.
How can I use LDT to parse a lua source file in java ? I want to create the AST.Is there any sample code I can learn from?

Thanks in advance.
Re: Sample code used in LDT to generate AST [message #1219222 is a reply to message #1219040] Mon, 02 December 2013 17:06 Go to previous message
Marc Aubry is currently offline Marc AubryFriend
Messages: 86
Registered: August 2012
Hi coco peng,

There are no ready to use solution to use build an Lua AST in java, but here some pointors:

The ast is created using metalua:
documentation :
source code :

Here an example of how we use metalua from Lua in LDT:

To call lua files from a java code, we use JNLua

Here an example on how we call Metalua using JNLua in LDT:
The super class:
Previous Topic:Autocompletion for external API
Next Topic:Breakpoint not hit after attaching to Java application
Goto Forum:

Current Time: Tue Oct 06 01:48:10 GMT 2015

Powered by FUDForum. Page generated in 0.02308 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software