Page 1 of 2

MexScript

Posted: Tue Nov 21, 2006 5:08 am
by Rahly
MexScript Parser and Interpreter

Major Additions to the language include new types and embeded expressions.

To be compatible with standard parsing, all places where expressions are allowable, requires the expression to be encompased by parenthesis.

Examples include

Code: Select all

Original Code:
Set MyVar MyOtherVar
Math MyVar *= 1024

New Code:
Set MyVar (MyOtherVar * 1024)
Full support for embeded variables

Unlike the current mexscript, types are generally ignored interally, except when using the "GET" command to read,

Code: Select all

Type list
Byte # alias for Word8
Long # alias for Int32
Int # alias for Int16
ThreeByte
String
Int8
Int16
Int32
Int64
Word8
Word16
Word32
Word64
Single
Double
Possibly support for SString (pascal short string) and PString (pascal Long string)

Currently this is a complete rewrite and not all commands have yet been implemented. Mr.Mouse and I have had several discussions about maybe creating a new engine that might end up replacing everything MexScript does. Its too early to say if it'll ever be implemented, but its an idea i've floated past him, that he seems to like. ;-)

Please post new ideas or suggestions, with more to follow, stay in touch.

Posted: Tue Nov 21, 2006 7:02 am
by Rahly
Decide to revamp the Interpreter so that it can act better as a debugger. A script IDE for MexScript could act as a debugger and allow steping through the script. Nice for writters.

Posted: Tue Nov 21, 2006 9:32 am
by Mr.Mouse
Just back from San Diego. Yes, Rahly has done some extensive work on rewriting a "MexScriptor", at least the core code. A new IDE should still be written, if needed. The other idea Rahly has, a new way to approach format interpreting/handling, is really rather cool. But its still very early.

Posted: Thu Nov 23, 2006 2:10 am
by Dinoguy1000
And support for old scripts? Will that be handled, and if so, how? Or will support for them just be dropped altogether?

Posted: Thu Nov 23, 2006 6:34 am
by Rahly
probably not immediately, if ever. but if it does work out, then there wouldn't be any more upgrades to the scripting at least.

Posted: Thu Nov 23, 2006 8:35 am
by Mr.Mouse
Is there already a working version / interface that I can test to use with MexCom? Or do you have any idea when you'b more or less complete the MexScript core?

Posted: Thu Nov 23, 2006 12:48 pm
by Rahly
Not sure what you are talking about, the thing we were talking about or MexScript?

nothing working for the first, just a rough outline

MexScript, not sure, i don't know how you work things and errors that are produced for some things. doing a little guess work, with a few things i'm working out.

Posted: Thu Nov 23, 2006 1:31 pm
by Mr.Mouse
Yeah, I was talking about MexScript. ;)

Posted: Fri Nov 24, 2006 6:00 pm
by Rahly
Command done pending complete testing for it. (aka has worked for a script but not all aspects have been tested)

Code: Select all

Set <variable> <expression>
Get <variable> <type> <expression>
For <varible> = <expression> to <expression>
Next <variable>
GetDString <variable> <expression> <expression>
IDString <expression> <raw string data>
Goto <expression> <expression>
Math <variable> <mathop> <expresion>
Log <expression> <expression> <expression> <expression> <expression> (<expression> <expression>)
CLog <expression> <expression> <expression> <expression> <expression> <expression> <expression>
SavePos <variable> <expression>
ImpType <importtype>
ComType <compressiontype>
Do
While <expression> <relationop> <expression>

// Still need to be added to the interpreter
Open <raw string> <raw string> <expression>
GetCT <variablename> <type> <raw string> <expression>
FindLoc <variablename> <type> <raw string> <expression>
String <variablename> <mathop> <expression>
If <expression> <relationop> <expression>
Else
EndIf
Not exactly sure what ImpType and ComType actually do, wiether it applies to the file being extracted, or the data that being read by the script. Having Clog is allowed for backwards compatibility, but now log allows the 2 options in CLog to be optional, this makes Clog obsolete.

Not quite sure what "GetCt TempVar Long $ 0" is suppose to do.

Posted: Sun Nov 26, 2006 8:01 pm
by Rahly
Am I missing any commands?

Posted: Mon Nov 27, 2006 7:12 am
by Rahly
Another question is how do you want the interface, since the code is in .NET and uses Classes and Objects, which vb doesn't have access to, i have to create a mixed code wrapper for you to call.

Posted: Mon Nov 27, 2006 10:30 am
by Mr.Mouse
ImpType: Tells MexCom what kind of structure to expect in terms of resource replacement in the archive. Standard means that Resource Offsets and Sizes are all there, and there's no tail. StdSize , only sizes are saved, and StdTail (or something) notifies that there's a tail with the file info in it, and a tailpointer to match this. The tailpointer location is saved in TailOffOff. And the value there in TailOff.

ComType: How resources are compressed, only one type per script allowed. ZLib1 (zlib files) and BK2 (bk2 files). ZIP files are not there, as they are processed by MexCom regardless of script.

Code: Select all

GetCt TempVar Long $ 0
Get character-terminated TempVar (a long variable) from file 0. The long is terminated with a $. Mostly used of course with strings that are not null-terminated but terminated with some other character.

Posted: Wed Jan 24, 2007 5:32 pm
by Rahly
simple test ide interface for rad development.

Image
Image

Posted: Thu Jan 25, 2007 6:39 pm
by Dinoguy1000
Just a thought, perhaps number each line of code in the editor? I noticed that your debugger showed a line number, but in a lengthy script, it could be a hassle counting manually to the problematic line...

Posted: Thu Jan 25, 2007 8:33 pm
by Mr.Mouse
Dinoguy1000 wrote:Just a thought, perhaps number each line of code in the editor? I noticed that your debugger showed a line number, but in a lengthy script, it could be a hassle counting manually to the problematic line...
You mean, MY scriptor did. These are pics from Rahly's scriptor. I think it might be an idea in the future, that's up to Rahly though.