These forums are CLOSED. Please visit the new forums HERE
LSL script -> C# -> compile |
|
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
10-21-2006 14:26
I hate to say this but the only way to do this is to write a full LSL parser.
_____________________
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 |
|
Iron Perth
Registered User
Join date: 9 Mar 2005
Posts: 802
|
10-21-2006 15:48
On that note, I have compiled the grammar files with lex and yacc, however I get quite a few compilation errors when I go to gcc.
Has anyone successfully done this? Cheers, Iron. _____________________
http://ironperth.com - Games for SecondLife and more.
|
|
Alphons Jano
Dancer
Join date: 27 Sep 2006
Posts: 121
|
Update on the LSLeditor
10-22-2006 13:04
I we have to build a complete LSL parser.... okay!
At first i had yacc at the back of my mind. Because i have to little experience on yacc, i do the Regex thing..... Status: - llHTTPRequest / http_response - some editor highlight improvements - a lot of ll list function implementation Todo: - a lot New snapshot of the editor can be downloaded. |
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
10-23-2006 18:24
Just in case you didn't know, you can find a copy (an old copy) of the lex & yacc file on the wiki (LexFile). If you use the one on the wiki, you will need to replace "% %" with "%%".
_____________________
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 |
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
10-23-2006 18:40
Things to do:
Get delete key to work in editor (it does *nothing*). Get this to compile: CODE
_____________________
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 |
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
10-24-2006 01:26
Btw, you will need to use C++'s "atof" function. Convert.ToDouble lacks HexFloat support.
At some point you might ask "Strife, if you know so well how this should be written, why don't/haven't you written this?" Simple answer. I lack the experience/education. I spent the last three hours trying to get an "atof" function into C# and hit the managed-unmanaged wall. I have yet to manage to successfully scale the managed-unmanaged wall (This is one of the reasons I hate .Net). _____________________
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 |
|
Alphons Jano
Dancer
Join date: 27 Sep 2006
Posts: 121
|
10-25-2006 11:17
"Get this to compile" ......
gives me enough adrenaline to go on, thanx."I spent the last three hours trying to get an "atof" function into C# and hit the managed-unmanaged wall." Nice!! I got a quick look into some code of the atof..... and cried a while. I spend a few hours on making just a simple "integer" of my own, so you are doing a great job, compared to mine. Meanwhile found out you can't use a const when compiling on-the-fly. So in my sleep i remembered i really should use "static readonly" on my base class consts.... Also SoapFormatter and BinaryFormatter suck big time. XmlSerializer is a better choice for saving some conf parameters. |
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
10-26-2006 02:34
My thought was to just make an assembly that was just atof, and compile it in VC++. One of the features of VC++ is that you can mix managed and unmanaged code; all you have to do is traverse the managed bridge, and the compiler handles the threading. I suspect it would actually be easier to compile a standard simple dll which exported atof, and just pinvoke it in C#.
I have a background in C & C++, so doing greasy programing has become a bit of a skill. I've been using Reflector with a plug-in to decompile the source, I've found not marking things "static" made everything compile. Unfortunately it also made the code crash. Wish I had a better understanding of classes and what the flags like "static" do. I think the problem I was having with managed & unmanaged code is related to security with .Net. _____________________
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 |
|
Destiny Niles
Registered User
Join date: 23 Aug 2006
Posts: 949
|
10-26-2006 10:17
I have made a page for downloading the LSL-editor (100kb zip). Don't kill me if things crash and burn, it is a beta. Did I miss the download link? |
|
Alphons Jano
Dancer
Join date: 27 Sep 2006
Posts: 121
|
Float2Hex example
10-27-2006 17:19
Parsing the global stuff has been improved a lot. Also the boolean stuff works. I had not much sleep, last couple of days, but the result on the "Get this to compile"
Done!! PI? Say[0]->"0x1921FB8p-23" ![]() Check this for editor and compiler screendumps: http://www.heijden.com/alphons/lsleditor/examples/Float2Hex.htm |
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
10-28-2006 05:33
I just remembered, you will need a special double->string routine, otherwise it will loose the sign on zero. (LSL supports signed floats, i do not think c# will print the sign on zero).
_____________________
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 |
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
10-28-2006 07:58
You should know, LSL uses floats (System.Single) not doubles (System.Double). A good number of functions I've written aren't designed to handed the added precision (Float2Hex). I don't know if you have considered this, but now is the time; are you going to be 100% LSL compliant?
I suppose you must have a working atof function, but here is one i wrote that will work exactly like the one in LSL uses. Decided it was a good way to brush up on my regex. CODE
_____________________
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 |
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
10-28-2006 08:28
Things to do:
Typecasting string literals. Creating null lists. New code challenge: CODE
Next Code Challenge: (and it isn't even the most up to date version) CODE
_____________________
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 |
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
10-28-2006 08:39
These should fix your key problem (lsl keys are just strings pretending to be GUIDs)
CODE
_____________________
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 |
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
11-06-2006 11:29
Next incremental challenge.
CODE
_____________________
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 |
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
11-06-2006 12:35
*sighs*
When you rewrote my float code, you removed functionality that is present in LSL, and added flaws. Also, since it's case insensitive, you don't need a-fA-F you just need a-f or A-F
_____________________
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 |
|
Alphons Jano
Dancer
Join date: 27 Sep 2006
Posts: 121
|
11-07-2006 15:45
changed it back. thanx |
|
Alphons Jano
Dancer
Join date: 27 Sep 2006
Posts: 121
|
New URL for the lslseditor project
11-14-2006 16:54
Hello all,
Works on the editor slowed down a bit. As of december i should have a lot of time to work on the beast. In meantime, i claimed a nice url for the project: http://www.lsleditor.org/ have fun. |
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
11-24-2006 17:03
Everything is looking good though there are still some issues with conditional operators not returning integers; the thing you are doing to get booleans for conditionals is the right way of doing things.
_____________________
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 |
|
Mack Morgridge
Registered User
Join date: 19 Sep 2006
Posts: 1
|
11-27-2006 20:25
im good with computers and and all plus id like to write scripts but man this is some confusing stuff when ur new to it. guess being young has its disadvantages.
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
11-27-2006 21:11
im good with computers and and all plus id like to write scripts but man this is some confusing stuff when ur new to it. guess being young has its disadvantages. Well being old doesn't make it any easier, believe me! But it does get easier. _____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum |
|
Alphons Jano
Dancer
Join date: 27 Sep 2006
Posts: 121
|
New version update LSL editor
12-26-2006 04:35
I have to wait on (another) Christmas dinner...
In meantime, progged some print functionality into the editor. Nothing much, really. Available by the update functionality in the program, or go the project website. http://www.lsleditor.org/ Merry Christmas and Best Wishes. -Alphons. |
|
Kiek Shinji
Registered User
Join date: 19 Dec 2006
Posts: 17
|
12-26-2006 10:42
I love your tool Alphons
I've been coding small tools like this sindce the VB5 days ![]() I've only been playing SL for 14 days but I completly fell in love with it, mostly because of this LSL. I like the concept of a statemachine driven language But i wondered, do you *share* your source? or should I just reflector it? ![]() If you do share source, I could assist you in refactoring this software into an enterprise class editor. Including parsers, intellisense, custom DOM and a dockable interface (think visual studio). This could become the premier coding solution for SL Just think about it, I am VERRY experienced in .NET ![]() |
|
Rosie Luna
Registered User
Join date: 10 Aug 2006
Posts: 1
|
Compiler - great - maybe the odd bug
![]() 01-03-2007 10:01
Alphons – I'm impressed by your compiler.
I've spent a few days recently switching between SL and my own editor and it is a very slow process. A colleague suggested a search for an editor/compiler which is how we found you. My only problem is that the second bit of code I tried with your complier causes your program to give an unhandled exception. The code works ok in SL. The offending line is: iListening1=llListen(iInChan, sInName, "", "" ; in the state_entry()of default. It compiles correctly if I move it (but doesn't then necessarily do what I want). |
|
Kalel Venkman
Citizen
Join date: 10 Mar 2006
Posts: 587
|
A clarification for the readers
01-03-2007 10:26
It has never been stated that we will be allowed or enabled to compile locally and upload C# code. MONO has only been discussed in terms of a back-end replacement for the current interpreter, where existing scripts would be gradually recompiled into C# over time.
The offline editor is a wonderful idea. But to the people reading, it's not going to compile and upload C#. The compiler will be running as a daemon on the LL servers. |