Important information: this site is currently scheduled to go offline indefinitely by end of the year.

MexScript

Coders and would-be coders alike, this is the place to talk about programming.
Rahly
VVIP member
VVIP member
Posts: 411
Joined: Thu Aug 05, 2004 10:17 am
Been thanked: 1 time

MexScript

Post 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.
"By nature men are alike. Through practice they have become far apart." Confucius (Analect 17:2)
Rahly
VVIP member
VVIP member
Posts: 411
Joined: Thu Aug 05, 2004 10:17 am
Been thanked: 1 time

Post 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.
"By nature men are alike. Through practice they have become far apart." Confucius (Analect 17:2)
Mr.Mouse
Site Admin
Posts: 4073
Joined: Wed Jan 15, 2003 6:45 pm
Location: Dungeons of Doom
Has thanked: 450 times
Been thanked: 682 times
Contact:

Post 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.
User avatar
Dinoguy1000
Site Admin
Posts: 786
Joined: Mon Sep 13, 2004 1:55 am
Has thanked: 154 times
Been thanked: 163 times

Post by Dinoguy1000 »

And support for old scripts? Will that be handled, and if so, how? Or will support for them just be dropped altogether?
Welcome to Xentax!

Rules | Requests | Wiki | Discord

If you run across a post that breaks the rules, please report the post - a mod or admin will handle it from there.
Rahly
VVIP member
VVIP member
Posts: 411
Joined: Thu Aug 05, 2004 10:17 am
Been thanked: 1 time

Post 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.
"By nature men are alike. Through practice they have become far apart." Confucius (Analect 17:2)
Mr.Mouse
Site Admin
Posts: 4073
Joined: Wed Jan 15, 2003 6:45 pm
Location: Dungeons of Doom
Has thanked: 450 times
Been thanked: 682 times
Contact:

Post 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?
Rahly
VVIP member
VVIP member
Posts: 411
Joined: Thu Aug 05, 2004 10:17 am
Been thanked: 1 time

Post 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.
"By nature men are alike. Through practice they have become far apart." Confucius (Analect 17:2)
Mr.Mouse
Site Admin
Posts: 4073
Joined: Wed Jan 15, 2003 6:45 pm
Location: Dungeons of Doom
Has thanked: 450 times
Been thanked: 682 times
Contact:

Post by Mr.Mouse »

Yeah, I was talking about MexScript. ;)
Rahly
VVIP member
VVIP member
Posts: 411
Joined: Thu Aug 05, 2004 10:17 am
Been thanked: 1 time

Post 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.
"By nature men are alike. Through practice they have become far apart." Confucius (Analect 17:2)
Rahly
VVIP member
VVIP member
Posts: 411
Joined: Thu Aug 05, 2004 10:17 am
Been thanked: 1 time

Post by Rahly »

Am I missing any commands?
"By nature men are alike. Through practice they have become far apart." Confucius (Analect 17:2)
Rahly
VVIP member
VVIP member
Posts: 411
Joined: Thu Aug 05, 2004 10:17 am
Been thanked: 1 time

Post 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.
"By nature men are alike. Through practice they have become far apart." Confucius (Analect 17:2)
Mr.Mouse
Site Admin
Posts: 4073
Joined: Wed Jan 15, 2003 6:45 pm
Location: Dungeons of Doom
Has thanked: 450 times
Been thanked: 682 times
Contact:

Post 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.
Rahly
VVIP member
VVIP member
Posts: 411
Joined: Thu Aug 05, 2004 10:17 am
Been thanked: 1 time

Post by Rahly »

simple test ide interface for rad development.

Image
Image
"By nature men are alike. Through practice they have become far apart." Confucius (Analect 17:2)
User avatar
Dinoguy1000
Site Admin
Posts: 786
Joined: Mon Sep 13, 2004 1:55 am
Has thanked: 154 times
Been thanked: 163 times

Post 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...
Welcome to Xentax!

Rules | Requests | Wiki | Discord

If you run across a post that breaks the rules, please report the post - a mod or admin will handle it from there.
Mr.Mouse
Site Admin
Posts: 4073
Joined: Wed Jan 15, 2003 6:45 pm
Location: Dungeons of Doom
Has thanked: 450 times
Been thanked: 682 times
Contact:

Post 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.
Post Reply