Creating a new type of Procedure

In the my current project I am trying to create a newer version of a scripting program. One that used it's own custom script language. It was created back in '96. So, it is a fun challenge for me to do this with Scripter. Many of the scripting commands I was able to just disregard them as not being ported over as there was already a similar command in Delphi syntax. Or a short amount of code to do the same in Delphi. For all but one of the rest I was able to  create those commands in scripter. But, there is one command that I need some advice on how best to implement in scripter.

In the original program it has special procedures that used the following syntaxs:

procedure myProcedure every <time>  // This procedure would run when the amount of time between runs is met.

procedure myProcedure2 when <condition> // This procedure would run only when the condition is met.

procedure myProcedure3 on <event>  // This procedure would only run when the event has happened.

To use these procedures properly you would have a ProcessMessages statement in all other procedures/functions. All the processmessages command did was check to see is any of the those special procedures needed to by processed. And if so then process that procedure. This would cause those procedures to run at any time the ProcessMessages is call and their conditions have been met.

I believe that I would have to created my own Languages.Pascal, or Languages.Basic, to extend those classes. But, I am lost after looking through them on how I should implement the above procedure statements and ProcessMessages statement.

Any advice you can give me would be very grateful.

Thank You.


Changing the language syntax is not trivial, it would not feasible that I explain to you how to do it, but maybe answer specific questions if you have it.

My suggestion is that you do something around it, for example, maybe do a form that lists all procedures in scripter and then your user defines when each procedure is executed? The scripter will just have the "procedure", and in an "external" tool (outside scripter) you add conditions for those procedures to be executed.