Yes, basically. Let me elaborate;
I split the implementation into multiple steps:
At stage 1 it, it will be an acceptor:
Given an input string x decide whether x is part of the Oblivion scripting formal language or not. x can be any finite string. If x is a accepted by the compiler, x is a valid script, otherwise it's not, which is guaranteed to be decidable for Oblivion's scripting language (other than for C++ due to Templates being turing complete).
The compiler is based on Flex and Bison, Flex takes a bunch of Regular Expressions (Which have to be ordered such that the maximum munch rule is enforced) and produces a DFA in c. Bison want the actual formal grammar description to generate the parser which calls the tokens from the Flex generated lexer to verify that the script is a derivable sentence of the Scripting Language. Just very basic so far and yes - it would not actually do anything yet.
At stage 2, it will be a partial interpreter:
If the script submitted is valid, bytecode is generated and scheduled for execution, with the opcodes referring to either logical arithmetical primitives or game functions. That's the tricky part because I intend to use some fun additions I added in other Virtual Machines like branch prediction and caching to improve performance.
The Opcodes corresponding to game function have to be implemented of course. I can't test that without being able to load basic Oblivion assets. Alongside that, for many functions the game logic also has to be implemented first or adapted whereever it differs from what we thankfully already have in OpenMW.
Some functions refer to game systems not present in Morrowind like for example GetPersuasionNumber, so that game logic would have to be implemented first, such that the VM is able to call the function once the opcode it hit. I call this partial interpreter as long as not every opcode it implemented
At stage 3, the full interpreter with extensions:
OBSE can be integrated over time for sure, with a priority on the subset of opcodes used by the most important plugins.
As a long term goal, I would also integrating some convenience functions for quick mathematics parsing like for example evaluate("3*5 + sin(2)") with a minimal benchmarked high performance parser (Good reference https://github.com/ArashPartow/math-par ... rk-project ) + an SAT solver (for example good old MiniSAT) and a implementation for SLD resolution to let NPC interfere logical conclusions from a set of known facts (for example events that occurred in the game world like a village being attacked by dragons) about the gameworld. Make it more of a true fun sandbox with hopefully non linear, chaotic events and utilize more CPU power.
So I can either do this in your fork, or I can wait for you to merge your commits into the current master.