Solved

Need code to parse script code in Delphi

Posted on 1998-10-02
5
269 Views
Last Modified: 2010-04-06
I need working source code for a Delphi scripting parser.

In the simplest form I would like to be able to create variable in the script and run functions and procedures

Example:

x := 1;
y := 'Nothing';
z := Copy(y, x, 4);
Result := z;

Idealy I would like to be able to define functions in the script similar to what we do in Delphi

Example:

ScriptStart;

TempStr := 'This is a test string';

TempStr := MyCopy(TempStr);

Result := TempStr;

function Mycopy(S: String): String;
begin
  Result := Copy(S,3,3);
end;

ScriptEnd;
0
Comment
Question by:Gerhard100198
  • 2
  • 2
5 Comments
 
LVL 10

Expert Comment

by:Jacco
ID: 1341488
Could you elaborate on what kind of script you need?

Regards Jacco
0
 
LVL 1

Author Comment

by:Gerhard100198
ID: 1341489
Edited text of question
0
 
LVL 2

Expert Comment

by:Thaddy
ID: 1341490
What do you mean? a Delphi scripting parser?
Sergey Kurinn et al. have written a freeware delphi interpreter that's more than pretty good. www.dreamcompany.com
If you mean windows scripting host (vb/jscript a.o.) then I've written an article about how to use the msscript.ocx control with delphi in sdgn magazine (in dutch, code commented in english). It's not a parser, but it enables you to integrate scripting in your applications pretty seamlessly. If you want the code just mail me (thaddy@cyco.nl)
Also, if you want a really GREAT scripting engine with sourcecode,including multiple parsers:delphi, vb, sql,perl,jscript, the afore mentioned Sergey et. al. have written it( not the freeware, but far more than that). Just pay him $395 and it saves you at least a month's work.(dream scripter)


0
 
LVL 1

Author Comment

by:Gerhard100198
ID: 1341491
Thaddy, you've mentioned a freeware version of DreamScripter. I've been to their home page but see only reference to an evaluation version.
0
 
LVL 2

Accepted Solution

by:
Thaddy earned 20 total points
ID: 1341492
http://www.torry.ru/vcl/vcltools/delphin.zip
is the complete freeware delphi parser with source.
If you want to use vbscript or javascript instead, mail me and I'll give you the source to my article
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question