|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
12-05-2007 14:02
For several years I've been meaning to write my own LSL Compiler, LSO VM, and LSO Disassembler. Well the other day I started work on it, and now it's at a point where it is just about usable. Mind you a lot of cleanup is needed... but it works. I doubt many people will find this useful. http://mailerdaemon.home.comcast.net/LSO_Disassembler.zipI wrote it in C# 3.0 so you will need .Net 3.0 (or does it require 3.5?). I used lambda functions and anonymous variables (and a few inline delegates). Things yet to be done to the disassembler: *Add a second pass to convert jumps. *Show dead code. *Code cleanup *Identify function variables. The Disassembler interfaces with the LSO module. The LSO module does the actual parsing but it is up to the disassemble to specify how it is to act. It walks the code but doesn't follow jumps. It does keep track of the address of the most positive jump, this way it doesn't stop when it hits a conditional return. Recursion is not used anywhere. Things yet to be done to the LSO module: *Read the stack *Read the heap *Code cleanup *Store LSL specific information in an external xml file. The end goal is to have 3 namespaces LSO LSL BytecodeWalker
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river. - Cyril Connolly
Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence. - James Nachtwey
|
|
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
|
12-05-2007 14:23
/me blinks. Wow. Not sure I understand but it sure sounds impressive!  Is this: - something the opensim people are drooling at? - a path to getting one of my favorite jiras (switch/case) done? - just something neat? - something else?? pie maybe??
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!! - Go here: http://jira.secondlife.com/browse/SVC-1224- If you see "if you were logged in.." on the left, click it and log in - Click the "Vote for it" link on the left
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
12-05-2007 16:06
From: Meade Paravane /me blinks. Wow. Not sure I understand but it sure sounds impressive!  Is this: - something the opensim people are drooling at? - a path to getting one of my favorite jiras (switch/case) done? - just something neat? - something else?? pie maybe?? Part opensim and part pie LSL is what we write and see but it is compiled to LSO. To create a compiler you either have to do like Alphonse has done, which is a combination of being brilliant and making a lot of really good guess's and spending a few hundred hours attacking the problem. Then you keep testing, tweaking, testing, tweaking and slowly you start to get the output you expected. But if you start at the other end and read back from the LSO file that is created in the viewer then it takes a heck of a lot of the guesswork out of it. Then when you make your compiler you can directly compare it's output against LL's output. But what do I know? It is only my guesstimate
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
12-05-2007 19:58
The opensim folks may find it interesting as it can be used to validate a LSO compiler and help debug an LSO VM.
The way I'm building it, it will be relatively easy to turn it into a VM. After that It will probably evolve into a compiler. Making it into a decompiler just requires adding some clever pattern recognition to it.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river. - Cyril Connolly
Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence. - James Nachtwey
|
|
Jana Kamachi
Registered User
Join date: 19 Apr 2007
Posts: 111
|
12-05-2007 20:26
Lovely! Now if they can fix the script engine in the last...13 SVN builds it would be great. You planning on packing as a library? I could use this in some projects I'm working on.
|