New games every week!
JSE - Parsing Redux Blog
26th April 2021
The rewrite of the Parser, to account for a more complex set of stackage, is going reasonably well..
.. I think!

-=-=-

Print "Hello World "+Rand(1,100)
is now turning into..
[0] _f
[1] _v000000=iPrint
[2] _s01="Hello World "
[3] _v000001=_s01
[4] _v000002=iRand
[5] _v010000=n1
[6] _v010100=n100
[7] _v000003=_r01
[8] _v000004=m+

Which is about 50% accurate.. I think..
Compare with the version from a couple of days ago

I'm having to code the engine in a plain text editor, switch to the browser to code test scripts in the engine, run the script, analyse the output, work out in my head if that's working enough to then start work on the main output again, then hop back to the code editor to fix up any issues.
It's not quite there, yet.
Currently commands are happening at the start, but should instead be happening at the end.
I need to intelligently grab a command, shuffle it to the end of where it oughta be, and then, with any luck, it'll work once more.

Compared to the previous output I showed you, there's now a new "_f" at the top of the output, which is used to say to the engine "This is a new line.. Flush out all your temporary variables."
I'm also hoping to add some kind of back-reference to that, so that when error checking, it can let you know roughly where in the script the error is. (Though, already by this point, that reference might be WAY off where it is in the editor!!)

It'll also be useful for line references, for future gotos/gosubs/function calls and more.
.. All of that is still a LONG way off, though!!!

So...
Yeah.. I really need to shuffle those command names to the end of their parameters, whilst being sure I don't inadvertently move variable names or strings, and then rewrite a chunk of the main engine to account for these new "triad" values in the script.
*sigh*

Keep going, Jay!
Views 97, Upvotes 10  
Jse
New games every week!
Site credits : This was all done by Jayenkai
(c) Jayenkai 2023 and onwards, RSS feed 76

Blog - JSE - Parsing Redux - AGameAWeek