-
Notifications
You must be signed in to change notification settings - Fork 1
/
JvInterpreter.pas
8773 lines (8146 loc) · 263 KB
/
JvInterpreter.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{-----------------------------------------------------------------------------
The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/MPL-1.1.html
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either expressed or implied. See the License for
the specific language governing rights and limitations under the License.
The Original Code is: JvInterpreter.PAS, released on 2002-07-04.
The Initial Developers of the Original Code are: Andrei Prygounkov <a dott prygounkov att gmx dott de>
Copyright (c) 1999, 2002 Andrei Prygounkov
All Rights Reserved.
Contributor(s): Dmitry Osinovsky, Peter Thornqvist, Olga Kobzar
Peter Schraut (http://www.console-de.de)
Ivan Ravin (ivan_ra)
Portions created by Dmitry Osinovsky and Olga Kobzar are
Copyright (C) 2003 ProgramBank Ltd.
All Rights Reserved.
You may retrieve the latest version of this file at the Project JEDI's JVCL home page,
located at http://jvcl.delphi-jedi.org
component : JvInterpreterProgram and more..
description : JVCL Interpreter version 2
Known Issues:
String fields in records binded from Delphi don't work
-----------------------------------------------------------------------------}
// $Id$
{ history (JVCL Library versions):
1.10:
- first release;
1.12:
- method HandleException removed as bugged;
- method UpdateExceptionPos now fill error message
with error Unit name and Line pos;
- fixed bug in TJvInterpreterUnit.Assignment method;
- new public property BaseErrLine used in UpdateExceptionPos;
1.17.7:
- local "const" statement for functions;
- global variables and constants - scope on all units - not normal !;
- OnGetValue and OnSetValue now called before call to Adapter;
- fixed bug with "Break" statement inside "for" loop;
1.17.10:
- fixed(?) bug with "begin/end" statement in "else" part of "if" statement;
- fixed few bugs in ole automation support;
1.21.2 (RALib 1.21 Update 2):
- fixed bug with multiple external functions defintions
(greetings to Peter Fischer-Haaser)
- fixed AV-bug in TJvInterpreterFunction.InFunction if errors in source occurred
(greetings to Andre N Belokon)
1.21.4 (RALib 1.21 Update 4):
- fixed bugs in "if" and "while" with "begin" statements;
- "div" and "mod" now working;
1.21.6 (RALib 1.21 Update 6):
- fixed bug with incorrect error line and unit name if erorr
occurred in used unit
(greetings to Dmitry Mokrushin)
- add parameters check (not fully functional - only count checked)
in source fucntion calls;
1.31.2 (RALib 1.31 Update 2):
- fixed bug: sometimes compare-operators ('=', '>', ...)
in expressions do not working.
1.31.4 (RALib 1.31 Update 4):
- fixed bug: plus and minus operators after symbol ']' not working.
1.31.5 (RALib 1.31 Update 5):
- function Statement1 is changed; this remove many bugs and add new ones.
- fixed many bug in exception handling statements and in nested
"begin/end" statements;
- fixed error with source function with TObject (and descendants)
returning values;
1.41.1:
- another fix for bug with incorrect error line and unit name
if erorr occurred in used unit;
- fixed bug with "Break" statement;
- "exit" statement;
- "repeat" loop;
1.50:
- behavior of "UseGlobalAdapter" property was changed; in previous versions
each TJvInterpreterExpression component creates its own copy of GlobalAdapter and
then manage it own copy, but now TJvInterpreterExpression manages two adapters:
own and global, so GlobalJvInterpreterAdapter now is used by all TJvInterpreterExpressions;
performance of "Compile" function increased (there is no necessity
more to Assign adapters) (20 msec on my machine with JvInterpreter_all unit)
and memory requirement decreased;
- sorting in TJvInterpreterAdapter dramatically increase its performance speed;
- fixed bug in "except/on" statement;
1.51:
- arrays as local and global variables. supports simple types (Integer,
double, string, tdatetime, object).
Added by Andrej Olejnik (olej att asset dott sk);
- type conversion with Integer, string, TObject,... keywords;
1.51.2:
- array support was rewritten;
enhanced indexes support: default indexed properties,
access to chars in strings. Many changes are made to make this possible:
new methods: GetElement, SetElement;
- record support is simplified;
- new property TJvInterpreterExpression.Error provide extended error information
about non-interpreter errors.
- "case" statement; not fully implemented - only one expression for one block.
1.52:
- TJvInterpreterExpression.JvInterpreterAdapter property renamed to Adapter;
- new public property TJvInterpreterExpression.SharedAdapter, setting to
GlobalJvInterpreterAdapter by default. This allows to create set of global adapters,
shared between TJvInterpreterExpression components;
- property TJvInterpreterExpression.GlobalAdapter removed; setting SharedAdapter
to nil has same effect as GlobalAdapter := False;
- fixed memory bug in event handling;
- new: unit name in uses list can be placed in quotes and contains any symbols;
- fixed bug: selector in case-statement not working with variables (only constants)
1.53:
- fixed bug: "Type mistmatch error" in expressions with OleAutomation objects;
- fixed bug: error while assign function's result to object's published property;
- call to external functions (placed in dll) in previous versions always
return Integer, now it can return Boolean, if declared so;
1.54:
- new: in call to external function var-parameters are supported for
Integer type;
- new: after call to external function (placed in dll) last win32 error
is restored correctly; in previous versions it was overriden by call to
FreeLibrary;
- fixed bug: memory leak: global variables and constants not allways be freed;
1.60:
- bug fixed in case-statement;
- new: global variables and constants in different units now can have
identical names;
- new: constants, variables and functions can have prefix with unit name
and point to determine appropriate unit;
- new: class declaration for forms (needed for TJvInterpreterFm component);
- bug fixed: record variables do not work;
1.61:
- bug fixed: variable types are not always kept the same when
assigning values to them;
thanks to Ritchie Annand (RitchieA att malibugroup dott com);
- bug fixed: exceptions, raised in dll calls produce AV.
fix: exception of class Exception is raised.
- new internal: LocalVars property in TJvInterpreterFunction (it is used in TJvInterpreterFm).
2.00:
- Delphi 6 compatibility;
- Kylix 1 compatibility;
- exception handling was rewriten in more portable way,
ChangeTopException function is not used anymore;
- fixed bug: intefrace section was not processed correct
(Thanks to Ivan Ravin);
Upcoming JVCL 3.00
- major code cleanups
- introduced data type system for variables and record fields initializations
- interface (IInterface, IUnknown) method call support, see AddIntfGet
- record declaration support
- arrays of records, arrays of arrays
- dynamic arrays
- variant array support
- arrays as parameters to Delphi procedures (sorry, no support for arrays
as procedure parameters)
- fixed record bugs with Delphi 6
- fixed OLE bugs
- (rom) added fix for default properties from ivan_ra 26 Dec 2003
- (wap) fixed bug: memory leak in local-function LeaveFunction, part of
TJvInterpreterFunction.InFunction. See code marker VARLEAKFIX.
(Fix suggested by ivan_ra att mail dott ru)
- bug fixed: exceptions, raised in Assign nil to Method property - dejoy-2004-3-13
- fixed Character '"' error in SkipToEnd from dejoy 2004-5-25;
- peter schraut added shl, shr and xor support
}
unit JvInterpreter;
{$I jvcl.inc}
{.$DEFINE JvInterpreter_DEBUG}
interface
uses
{$IFDEF UNITVERSIONING}
JclUnitVersioning,
{$ENDIF UNITVERSIONING}
SysUtils, Classes,
{$IFDEF MSWINDOWS}
Windows,
{$ENDIF MSWINDOWS}
Variants,
JvInterpreterParser, JvComponentBase;
const
// (rom) renamed to longer names
{ max arguments to functions - small values increase performance }
cJvInterpreterMaxArgs = 32;
{ max fields allowed in records }
cJvInterpreterMaxRecFields = 32;
// (rom) added
cJvInterpreterStackMax = 199;
{ Max available dimensions for arrays }
JvInterpreter_MAX_ARRAY_DIMENSION = 10;
type
{$IFNDEF COMPILER12_UP}
NativeInt = Integer; // also redeclare for Delphi 2007 where it is declared as Int64
{$ENDIF ~COMPILER12_UP}
{ argument definition }
PValueArray = ^TValueArray;
TValueArray = array [0..cJvInterpreterMaxArgs] of Variant;
PTypeArray = ^TTypeArray;
TTypeArray = array [0..cJvInterpreterMaxArgs] of Word;
PNameArray = ^TNameArray;
TNameArray = array [0..cJvInterpreterMaxArgs] of string;
TJvInterpreterArgs = class;
IJvInterpreterDataType = interface;
TJvInterpreterGetValue = procedure(Sender: TObject; Identifier: string; var Value: Variant;
Args: TJvInterpreterArgs; var Done: Boolean) of object;
TJvInterpreterSetValue = procedure(Sender: TObject; Identifier: string;
const Value: Variant; Args: TJvInterpreterArgs; var Done: Boolean) of object;
TJvInterpreterGetUnitSource = procedure(UnitName: string; var Source: string;
var Done: Boolean) of object;
TJvInterpreterAdapterGetValue = procedure(var Value: Variant; Args: TJvInterpreterArgs);
TJvInterpreterAdapterSetValue = procedure(const Value: Variant; Args: TJvInterpreterArgs);
TJvInterpreterAdapterNewRecord = procedure(var Value: Pointer);
TJvInterpreterAdapterDisposeRecord = procedure(const Value: Pointer);
TJvInterpreterAdapterCopyRecord = procedure(var Dest: Pointer; const Source: Pointer);
POpenArray = ^TOpenArray;
TOpenArray = array [0..cJvInterpreterMaxArgs] of TVarRec;
TJvInterpreterRecField = record
Identifier: string;
Offset: Integer;
Typ: Word;
DataType: IJvInterpreterDataType;
end;
TJvInterpreterArgs = class(TObject)
private
FVarNames: TNameArray;
FHasVars: Boolean;
{ open array parameter support }
{ allocates memory only if necessary }
FOAV: PValueArray; { open array values }
public
Identifier: string;
Count: Integer;
Types: TTypeArray;
Values: TValueArray;
Names: TNameArray;
HasResult: Boolean; { = False, if result not needed - used by calls
to OLE automation servers }
Assignment: Boolean; { internal }
Obj: TObject;
ObjTyp: Word; { varObject, varClass, varUnknown }
ObjRefHolder: Variant; { if ObjType is varDispatch or varUnknown,
then we need to hold a reference to it }
Indexed: Boolean; // if True then Args contain Indexes to Identifier
ReturnIndexed: Boolean; // established by GetValue function, indicating
// what Args used as indexed (matters only if Indexed = True)
public
{ open array parameter support }
OA: POpenArray; { open array }
OAS: Integer; { open array size }
destructor Destroy; override;
procedure Clear;
procedure OpenArray(const Index: Integer);
procedure Delete(const Index: Integer);
end;
{ function descriptor }
TJvInterpreterFunctionDesc = class(TObject)
private
FUnitName: string;
FIdentifier: string;
FClassIdentifier: string; { class name, if function declared as
TClassIdentifier.Identifier}
FParamCount: Integer; { - 1..cJvInterpreterMaxArgs }
FParamTypes: TTypeArray;
FParamTypeNames: TNameArray;
FParamNames: TNameArray;
FResTyp: Word;
FResTypName: string;
FResDataType: IJvInterpreterDataType;
FPosBeg: Integer; { position in source }
FPosEnd: Integer;
function GetParamName(Index: Integer): string;
function GetParamType(Index: Integer): Word;
function GetParamTypeNames(Index: Integer): string;
function GetDefine: string;
public
{$WARNINGS OFF} // Delphi 2009+ has a class function UnitName
property UnitName: string read FUnitName;
{$WARNINGS ON}
property Identifier: string read FIdentifier;
property ClassIdentifier: string read FClassIdentifier;
property Define: string read GetDefine;
property ParamCount: Integer read FParamCount;
property ParamTypes[Index: Integer]: Word read GetParamType;
property ParamNames[Index: Integer]: string read GetParamName;
property ParamTypeNames[Index: Integer]: string read GetParamTypeNames;
property ResTyp: Word read FResTyp;
property ResTypName: string read FResTypName;
property ResDataType: IJvInterpreterDataType read FResDataType;
property PosBeg: Integer read FPosBeg;
property PosEnd: Integer read FPosEnd;
end;
TSimpleEvent = procedure of object;
TJvInterpreterExpression = class;
EJvInterpreterError = class;
TJvInterpreterEvent = class(TObject)
private
FOwner: TJvInterpreterExpression;
FInstance: TObject;
FUnitName: string;
FFunctionName: string;
FPropName: string;
FArgs: TJvInterpreterArgs;
function GetArgs: TJvInterpreterArgs;
protected
constructor Create(AOwner: TJvInterpreterExpression; AInstance: TObject;
const AUnitName, AFunctionName, APropName: string); virtual;
function CallFunction(Args: TJvInterpreterArgs; Params: array of Variant): Variant;
property Args: TJvInterpreterArgs read GetArgs;
property Owner: TJvInterpreterExpression read FOwner;
property Instance: TObject read FInstance;
{$WARNINGS OFF} // Delphi 2009+ has a class function UnitName
property UnitName: string read FUnitName;
{$WARNINGS ON}
property FunctionName: string read FFunctionName;
property PropName: string read FPropName;
public
destructor Destroy; override;
end;
TJvInterpreterEventClass = class of TJvInterpreterEvent;
{ variable holder }
TJvInterpreterVar = class(TObject)
public
UnitName: string;
Identifier: string;
Typ: string;
VTyp: Word;
Value: Variant;
public
destructor Destroy; override;
end;
{ variables list }
TJvInterpreterVarList = class(TList)
public
destructor Destroy; override;
procedure Clear; override;
procedure AddVar(const UnitName, Identifier, Typ: string; VTyp: Word;
const Value: Variant; DataType: IJvInterpreterDataType);
function FindVar(const UnitName, Identifier: string): TJvInterpreterVar;
procedure DeleteVar(const UnitName, Identifier: string);
function GetValue(const Identifier: string; var Value: Variant; Args: TJvInterpreterArgs): Boolean;
function SetValue(const Identifier: string; const Value: Variant; Args: TJvInterpreterArgs): Boolean;
procedure Assign(source: TJvInterpreterVarList);
end;
{ notes about TJvInterpreterVarList implementation:
- list must allow to contain more than one Var with same name;
- FindVar must return last added Var with given name;
- DeleteVar must delete last added Var with given name; }
TJvInterpreterIdentifier = class(TObject)
public
UnitName: string;
Identifier: string;
Data: Pointer; // provided by user when call to adapter's addxxx methods
end;
TJvInterpreterIdentifierList = class(TList)
private
FDuplicates: TDuplicates;
public
function IndexOf(const UnitName, Identifier: string): TJvInterpreterIdentifier;
function Find(const Identifier: string; var Index: Integer): Boolean;
procedure Sort(Compare: TListSortCompare = nil); virtual;
property Duplicates: TDuplicates read FDuplicates write FDuplicates;
end;
TJvInterpreterMethodList = class(TJvInterpreterIdentifierList)
public
procedure Sort(Compare: TListSortCompare = nil); override;
end;
IJvInterpreterDataType = interface
['{8C5E4071-65AB-11D7-B235-00A0D2043DC7}']
procedure Init(var V: Variant);
function GetTyp: Word;
end;
//move from implementation section to interface section
TParamCount = -1..cJvInterpreterMaxArgs;
TCallConvention = set of (ccFastCall, ccStdCall, ccCDecl, ccDynamic,
ccVirtual, ccClass);
{ Adapter classes - translates data from JvInterpreter calls to Delphi functions }
TJvInterpreterSrcUnit = class(TJvInterpreterIdentifier)
private
FSource: string;
FUsesList: TNameArray;
public
function UsesList: TNameArray;
property Source: string read FSource;
// Removed because BCB doesn't support it
//property UsesList: TNameArray read FUsesList;
end;
TJvInterpreterMethod = class(TJvInterpreterIdentifier)
protected
FClassType: TClass;
ParamCount: TParamCount;
ParamTypes: TTypeArray; { varInteger, varString, .. }
ResTyp: Word; { varInteger, varString, .. }
Func: Pointer; { TJvInterpreterAdapterGetValue or TJvInterpreterAdapterSetValue }
end;
TJvInterpreterIntfMethod = class(TJvInterpreterIdentifier)
protected
IID: TGUID;
ParamCount: TParamCount;
ParamTypes: TTypeArray; { varInteger, varString, .. }
ResTyp: Word; { varInteger, varString, .. }
Func: Pointer; { TJvInterpreterAdapterGetValue or TJvInterpreterAdapterSetValue }
end;
TJvInterpreterDMethod = class(TJvInterpreterMethod)
protected
ResTyp: Word;
CallConvention: TCallConvention;
end;
TJvInterpreterClass = class(TJvInterpreterIdentifier)
private
FClassFields:TJvInterpreterVarList;
protected
FClassType: TClass;
public
property ClassFields:TJvInterpreterVarList read FClassFields;
constructor Create;
destructor Destroy; override;
end;
TJvInterpreterConst = class(TJvInterpreterIdentifier)
protected
Value: Variant;
end;
TJvInterpreterRecFields = array [0..cJvInterpreterMaxRecFields] of TJvInterpreterRecField;
TJvInterpreterRecord = class(TJvInterpreterIdentifier)
protected
RecordSize: Integer; { SizeOf(Rec^) }
FieldCount: Integer;
Fields: TJvInterpreterRecFields;
CreateFunc: TJvInterpreterAdapterNewRecord;
DestroyFunc: TJvInterpreterAdapterDisposeRecord;
CopyFunc: TJvInterpreterAdapterCopyRecord;
procedure AddField(const UnitName, Identifier, Typ: string; VTyp: Word;
const Value: Variant; DataType: IJvInterpreterDataType);
procedure NewRecord(var Value: Variant);
end;
TJvInterpreterRecMethod = class(TJvInterpreterIdentifier)
protected
JvInterpreterRecord: TJvInterpreterRecord;
ParamCount: TParamCount;
ParamTypes: TTypeArray; { varInteger, varString and so one .. }
ResTyp: Word; { varInteger, varString, .. }
Func: Pointer; { TJvInterpreterAdapterGetValue or TJvInterpreterAdapterSetValue }
end;
TJvInterpreterRecHolder = class(TJvInterpreterIdentifier)
protected
FRecordType: string;
JvInterpreterRecord: TJvInterpreterRecord;
Rec: Pointer; { data }
public
constructor Create(const ARecordType: string; ARec: Pointer);
destructor Destroy; override;
property RecordType: string read FRecordType;
end;
TJvInterpreterArrayValues = array [0..JvInterpreter_MAX_ARRAY_DIMENSION - 1] of Integer;
PJvInterpreterArrayRec = ^TJvInterpreterArrayRec;
TJvInterpreterArrayRec = packed record
Dimension: Integer; {number of dimensions}
BeginPos: TJvInterpreterArrayValues; {starting range for all dimensions}
EndPos: TJvInterpreterArrayValues; {ending range for all dimensions}
ItemType: Integer; {array type}
DT: IJvInterpreterDataType;
ElementSize: Integer; {size of element in bytes}
Size: Integer; {number of elements in array}
Memory: Pointer; {pointer to memory representation of array}
end;
{ interpreter function }
TJvInterpreterSrcFunction = class(TJvInterpreterIdentifier)
private
FFunctionDesc: TJvInterpreterFunctionDesc;
public
constructor Create;
destructor Destroy; override;
property FunctionDesc: TJvInterpreterFunctionDesc read FFunctionDesc; //Move From Private section
end;
{ external function }
TJvInterpreterExtFunction = class(TJvInterpreterSrcFunction)
protected
DllInstance: HINST;
DllName: string;
FunctionName: string;
{or}
FunctionIndex: Integer;
function CallDll(Args: TJvInterpreterArgs): Variant;
end;
TJvInterpreterEventDesc = class(TJvInterpreterIdentifier)
protected
EventClass: TJvInterpreterEventClass;
Code: Pointer;
end;
TJvInterpreterRecordDataType = class(TInterfacedObject, IJvInterpreterDataType)
protected
FRecordDesc: TJvInterpreterRecord;
public
constructor Create(ARecordDesc: TJvInterpreterRecord);
procedure Init(var V: Variant);
function GetTyp: Word;
end;
TJvInterpreterArrayDataType = class(TInterfacedObject, IJvInterpreterDataType)
protected
FArrayBegin, FArrayEnd: TJvInterpreterArrayValues;
FDimension: Integer;
FArrayType: Integer;
FDT: IJvInterpreterDataType;
public
constructor Create(AArrayBegin, AArrayEnd: TJvInterpreterArrayValues;
ADimension: Integer; AArrayType: Integer; ADT: IJvInterpreterDataType);
procedure Init(var V: Variant);
function GetTyp: Word;
end;
TJvInterpreterSimpleDataType = class(TInterfacedObject, IJvInterpreterDataType)
protected
FTyp: TVarType;
public
constructor Create(ATyp: TVarType);
procedure Init(var V: Variant);
function GetTyp: Word;
end;
PMethod = ^TMethod;
{ function context - stack }
PFunctionContext = ^TFunctionContext;
TFunctionContext = record
PrevFunContext: PFunctionContext;
LocalVars: TJvInterpreterVarList;
Fun: TJvInterpreterSrcFunction;
end;
{ TJvInterpreterAdapter - route JvInterpreter calls to Delphi functions }
TJvInterpreterAdapter = class(TObject)
private
FOwner: TJvInterpreterExpression;
FSrcUnitList: TJvInterpreterIdentifierList; // JvInterpreter-units sources
FExtUnitList: TJvInterpreterIdentifierList; // internal units; like "system" in delphi
FGetList: TJvInterpreterIdentifierList; // methods
FSetList: TJvInterpreterIdentifierList; // write properties
FIGetList: TJvInterpreterIdentifierList; // read indexed properties
FISetList: TJvInterpreterIdentifierList; // write indexed properties
FIDGetList: TJvInterpreterIdentifierList; // read default indexed properties
FIDSetList: TJvInterpreterIdentifierList; // write default indexed properties
FIntfGetList: TJvInterpreterIdentifierList; // interface methods
FIntfSetList: TJvInterpreterIdentifierList; // interface write properties
FIntfIGetList: TJvInterpreterIdentifierList; // interface read indexed properties
FIntfISetList: TJvInterpreterIdentifierList; // interface write indexed properties
FIntfIDGetList: TJvInterpreterIdentifierList; // interface read default indexed properties
FIntfIDSetList: TJvInterpreterIdentifierList; // interface write default indexed properties
FDirectGetList: TJvInterpreterIdentifierList; // direct get list
FClassList: TJvInterpreterIdentifierList; // delphi classes
FConstList: TJvInterpreterIdentifierList; // delphi consts
FFunctionList: TJvInterpreterIdentifierList; // functions, procedures
FRecordList: TJvInterpreterIdentifierList; // records
FRecordGetList: TJvInterpreterIdentifierList; // read record field
FRecordSetList: TJvInterpreterIdentifierList; // write record field
FOnGetList: TJvInterpreterIdentifierList; // chain
FOnSetList: TJvInterpreterIdentifierList; // chain
FSrcFunctionList: TJvInterpreterIdentifierList; // functions, procedures in JvInterpreter-source
FExtFunctionList: TJvInterpreterIdentifierList;
FEventHandlerList: TJvInterpreterIdentifierList;
FEventList: TJvInterpreterIdentifierList;
FSrcVarList: TJvInterpreterVarList; // variables, constants in JvInterpreter-source
FSrcClassList: TJvInterpreterIdentifierList; // JvInterpreter-source classes
FDisableExternalFunctions: Boolean;
FSorted: Boolean;
procedure CheckArgs(var Args: TJvInterpreterArgs; ParamCount: Integer;
var ParamTypes: TTypeArray);
function GetRec(const RecordType: string): TObject;
{$IFDEF JvInterpreter_OLEAUTO}
function DispatchCall(const Identifier: string; var Value: Variant;
Args: TJvInterpreterArgs; Get: Boolean): Boolean; stdcall;
{$ENDIF JvInterpreter_OLEAUTO}
function GetValueRTTI(const Identifier: string; var Value: Variant;
Args: TJvInterpreterArgs): Boolean;
function SetValueRTTI(const Identifier: string; const Value: Variant;
Args: TJvInterpreterArgs): Boolean;
protected
procedure CheckAction(Expression: TJvInterpreterExpression; Args: TJvInterpreterArgs;
Data: Pointer); virtual;
function GetValue(Expression: TJvInterpreterExpression; const Identifier: string;
var Value: Variant; Args: TJvInterpreterArgs): Boolean; virtual;
function SetValue(Expression: TJvInterpreterExpression; const Identifier: string;
const Value: Variant; Args: TJvInterpreterArgs): Boolean; virtual;
function GetElement(Expression: TJvInterpreterExpression; const Variable: Variant;
var Value: Variant; var Args: TJvInterpreterArgs): Boolean; virtual;
function SetElement(Expression: TJvInterpreterExpression; var Variable: Variant;
const Value: Variant; var Args: TJvInterpreterArgs): Boolean; virtual;
function NewRecord(const RecordType: string; var Value: Variant): Boolean; virtual;
function FindFunDesc(const UnitName, Identifier: string;
const ClassIdentifier:string=''): TJvInterpreterFunctionDesc; virtual;
procedure CurUnitChanged(const NewUnitName: string; var Source: string); virtual;
function UnitExists(const Identifier: string): Boolean; virtual;
function IsEvent(Obj: TObject; const Identifier: string): Boolean; virtual;
function NewEvent(const UnitName, FunctionName, EventType: string;
AOwner: TJvInterpreterExpression; AObject: TObject;
const APropName: string): TSimpleEvent; virtual;
procedure ClearSource; dynamic;
procedure ClearNonSource; dynamic;
procedure Sort; dynamic;
protected
{ for internal use }
procedure AddSrcClass(JvInterpreterSrcClass: TJvInterpreterIdentifier); virtual;
function GetSrcClass(const Identifier: string): TJvInterpreterIdentifier; virtual;
public
constructor Create(AOwner: TJvInterpreterExpression);
destructor Destroy; override;
function SetRecord(var Value: Variant): Boolean; virtual;
procedure Clear; dynamic;
procedure Assign(Source: TJvInterpreterAdapter); dynamic;
procedure AddSrcUnit(const Identifier, Source, UsesList: string); dynamic;
procedure AddSrcUnitEx(const Identifier, Source, UsesList: string;
Data: Pointer); dynamic;
procedure AddExtUnit(const Identifier: string); dynamic;
procedure AddExtUnitEx(const Identifier: string; Data: Pointer); dynamic;
procedure AddClass(const UnitName: string; AClassType: TClass; const Identifier: string); dynamic;
procedure AddClassEx(const UnitName: string; AClassType: TClass; const Identifier: string;
Data: Pointer); dynamic;
procedure AddIntfGet(IID: TGUID; const Identifier: string;
GetFunc: TJvInterpreterAdapterGetValue; ParamCount: Integer;
ParamTypes: array of Word; ResTyp: Word);
procedure AddIntfGetEx(IID: TGUID; const Identifier: string;
GetFunc: TJvInterpreterAdapterGetValue; ParamCount: Integer;
ParamTypes: array of Word; ResTyp: Word; Data: Pointer);
procedure AddIntfIGet(IID: TGUID; const Identifier: string;
GetFunc: TJvInterpreterAdapterGetValue; ParamCount: Integer;
ParamTypes: array of Word; ResTyp: Word);
procedure AddIntfIGetEx(IID: TGUID; const Identifier: string;
GetFunc: TJvInterpreterAdapterGetValue; ParamCount: Integer;
ParamTypes: array of Word; ResTyp: Word; Data: Pointer);
procedure AddIntfIDGet(IID: TGUID;
GetFunc: TJvInterpreterAdapterGetValue; ParamCount: Integer;
ParamTypes: array of Word; ResTyp: Word);
procedure AddIntfIDGetEx(IID: TGUID;
GetFunc: TJvInterpreterAdapterGetValue; ParamCount: Integer;
ParamTypes: array of Word; ResTyp: Word; Data: Pointer);
procedure AddGet(AClassType: TClass; const Identifier: string;
GetFunc: TJvInterpreterAdapterGetValue; ParamCount: Integer;
ParamTypes: array of Word; ResTyp: Word); dynamic;
procedure AddGetEx(AClassType: TClass; const Identifier: string;
GetFunc: TJvInterpreterAdapterGetValue; ParamCount: Integer;
ParamTypes: array of Word; ResTyp: Word; Data: Pointer); dynamic;
procedure AddSet(AClassType: TClass; const Identifier: string;
SetFunc: TJvInterpreterAdapterSetValue; ParamCount: Integer;
ParamTypes: array of Word); dynamic;
procedure AddSetEx(AClassType: TClass; const Identifier: string;
SetFunc: TJvInterpreterAdapterSetValue; ParamCount: Integer;
ParamTypes: array of Word; Data: Pointer); dynamic;
procedure AddIGet(AClassType: TClass; const Identifier: string;
GetFunc: TJvInterpreterAdapterGetValue; ParamCount: Integer;
ParamTypes: array of Word; ResTyp: Word); dynamic;
procedure AddIGetEx(AClassType: TClass; const Identifier: string;
GetFunc: TJvInterpreterAdapterGetValue; ParamCount: Integer;
ParamTypes: array of Word; ResTyp: Word; Data: Pointer); dynamic;
procedure AddISet(AClassType: TClass; const Identifier: string;
SetFunc: TJvInterpreterAdapterSetValue; ParamCount: Integer;
ParamTypes: array of Word); dynamic;
procedure AddISetEx(AClassType: TClass; const Identifier: string;
SetFunc: TJvInterpreterAdapterSetValue; ParamCount: Integer;
ParamTypes: array of Word; Data: Pointer); dynamic;
procedure AddIDGet(AClassType: TClass;
GetFunc: TJvInterpreterAdapterGetValue; ParamCount: Integer;
ParamTypes: array of Word; ResTyp: Word); dynamic;
procedure AddIDGetEx(AClassType: TClass;
GetFunc: TJvInterpreterAdapterGetValue; ParamCount: Integer;
ParamTypes: array of Word; ResTyp: Word; Data: Pointer); dynamic;
procedure AddIDSet(AClassType: TClass;
SetFunc: TJvInterpreterAdapterSetValue; ParamCount: Integer;
ParamTypes: array of Word); dynamic;
procedure AddIDSetEx(AClassType: TClass;
SetFunc: TJvInterpreterAdapterSetValue; ParamCount: Integer;
ParamTypes: array of Word; Data: Pointer); dynamic;
procedure AddIntfSet(IID: TGUID; const Identifier: string;
SetFunc: TJvInterpreterAdapterSetValue; ParamCount: Integer;
ParamTypes: array of Word);
procedure AddIntfSetEx(IID: TGUID; const Identifier: string;
SetFunc: TJvInterpreterAdapterSetValue; ParamCount: Integer;
ParamTypes: array of Word; Data: Pointer);
procedure AddIntfISet(IID: TGUID; const Identifier: string;
SetFunc: TJvInterpreterAdapterSetValue; ParamCount: Integer;
ParamTypes: array of Word);
procedure AddIntfISetEx(IID: TGUID; const Identifier: string;
SetFunc: TJvInterpreterAdapterSetValue; ParamCount: Integer;
ParamTypes: array of Word; Data: Pointer);
procedure AddIntfIDSet(IID: TGUID;
SetFunc: TJvInterpreterAdapterSetValue; ParamCount: Integer;
ParamTypes: array of Word);
procedure AddIntfIDSetEx(IID: TGUID;
SetFunc: TJvInterpreterAdapterSetValue; ParamCount: Integer;
ParamTypes: array of Word; Data: Pointer);
procedure AddFunction(const UnitName, Identifier: string;
GetFunc: TJvInterpreterAdapterGetValue; ParamCount: Integer;
ParamTypes: array of Word; ResTyp: Word); dynamic;
procedure AddFunctionEx(const UnitName, Identifier: string;
GetFunc: TJvInterpreterAdapterGetValue; ParamCount: Integer;
ParamTypes: array of Word; ResTyp: Word; Data: Pointer); dynamic;
{ function AddDGet under construction - don't use it }
procedure AddDGet(AClassType: TClass; const Identifier: string;
GetFunc: Pointer; ParamCount: Integer; ParamTypes: array of Word;
ResTyp: Word; CallConvention: TCallConvention); dynamic;
procedure AddDGetEx(AClassType: TClass; const Identifier: string;
GetFunc: Pointer; ParamCount: Integer; ParamTypes: array of Word;
ResTyp: Word; CallConvention: TCallConvention; Data: Pointer); dynamic;
procedure AddRec(const UnitName, Identifier: string; RecordSize: Integer;
Fields: array of TJvInterpreterRecField; CreateFunc: TJvInterpreterAdapterNewRecord;
DestroyFunc: TJvInterpreterAdapterDisposeRecord;
CopyFunc: TJvInterpreterAdapterCopyRecord); dynamic;
procedure AddRecEx(const UnitName, Identifier: string; RecordSize: Integer;
Fields: array of TJvInterpreterRecField; CreateFunc: TJvInterpreterAdapterNewRecord;
DestroyFunc: TJvInterpreterAdapterDisposeRecord; CopyFunc: TJvInterpreterAdapterCopyRecord;
Data: Pointer); dynamic;
procedure AddRecGet(const UnitName, RecordType, Identifier: string;
GetFunc: TJvInterpreterAdapterGetValue; ParamCount: Integer;
ParamTypes: array of Word; ResTyp: Word); dynamic;
procedure AddRecGetEx(const UnitName, RecordType, Identifier: string;
GetFunc: TJvInterpreterAdapterGetValue; ParamCount: Integer;
ParamTypes: array of Word; ResTyp: Word; Data: Pointer); dynamic;
procedure AddRecSet(const UnitName, RecordType, Identifier: string;
SetFunc: TJvInterpreterAdapterSetValue; ParamCount: Integer;
ParamTypes: array of Word); dynamic;
procedure AddRecSetEx(const UnitName, RecordType, Identifier: string;
SetFunc: TJvInterpreterAdapterSetValue; ParamCount: Integer;
ParamTypes: array of Word; Data: Pointer); dynamic;
procedure AddConst(const UnitName, Identifier: string; Value: Variant); dynamic;
procedure AddConstEx(const AUnitName, AIdentifier: string; AValue: Variant;
AData: Pointer); dynamic;
procedure AddExtFun(const UnitName, Identifier: string; DllInstance: HINST;
const DllName, FunctionName: string; FunctionIndex: Integer; ParamCount: Integer;
ParamTypes: array of Word; ResTyp: Word); dynamic;
procedure AddExtFunEx(const AUnitName, AIdentifier: string; ADllInstance: HINST;
const ADllName, AFunctionName: string; AFunIndex: Integer; AParamCount: Integer;
AParamTypes: array of Word; AResTyp: Word; AData: Pointer); dynamic;
procedure AddSrcFun(const UnitName, Identifier: string;
ClassIdentifier: string;
PosBeg, PosEnd: Integer; ParamCount: Integer; ParamTypes: array of Word;
ParamTypeNames: array of string;
ParamNames: array of string; ResTyp: Word; const AResTypName: string;
AResDataType: IJvInterpreterDataType; Data: Pointer); dynamic;
procedure AddSrcFunEx(const AUnitName, AIdentifier: string;
AClassIdentifier: string;
APosBeg, APosEnd: Integer; AParamCount: Integer; AParamTypes: array of Word;
AParamTypeNames: array of string;
AParamNames: array of string; AResTyp: Word; const AResTypName: string;
AResDataType: IJvInterpreterDataType; AData: Pointer); dynamic;
procedure AddHandler(const UnitName, Identifier: string;
EventClass: TJvInterpreterEventClass; Code: Pointer); dynamic;
procedure AddHandlerEx(const AUnitName, AIdentifier: string;
AEventClass: TJvInterpreterEventClass; ACode: Pointer; AData: Pointer); dynamic;
procedure AddEvent(const UnitName: string; AClassType: TClass;
const Identifier: string); dynamic;
procedure AddEventEx(const AUnitName: string; AClassType: TClass;
const AIdentifier: string; AData: Pointer); dynamic;
procedure AddSrcVar(const UnitName, Identifier, Typ: string; VTyp: Word;
const Value: Variant; DataType: IJvInterpreterDataType); dynamic;
procedure AddOnGet(Method: TJvInterpreterGetValue); dynamic;
procedure AddOnSet(Method: TJvInterpreterSetValue); dynamic;
public
property DisableExternalFunctions: Boolean read FDisableExternalFunctions write FDisableExternalFunctions;
property SrcUnitList: TJvInterpreterIdentifierList read FSrcUnitList;
property ExtUnitList: TJvInterpreterIdentifierList read FExtUnitList;
property GetList: TJvInterpreterIdentifierList read FGetList;
property SetList: TJvInterpreterIdentifierList read FSetList;
property IGetList: TJvInterpreterIdentifierList read FIGetList;
property ISetList: TJvInterpreterIdentifierList read FISetList;
property IDGetList: TJvInterpreterIdentifierList read FIDGetList;
property IDSetList: TJvInterpreterIdentifierList read FIDSetList;
property IntfGetList: TJvInterpreterIdentifierList read FIntfGetList;
property IntfSetList: TJvInterpreterIdentifierList read FIntfSetList;
property IntfIGetList: TJvInterpreterIdentifierList read FIntfIGetList;
property IntfISetList: TJvInterpreterIdentifierList read FIntfISetList;
property IntfIDGetList: TJvInterpreterIdentifierList read FIntfIDGetList;
property IntfIDSetList: TJvInterpreterIdentifierList read FIntfIDSetList;
property DirectGetList: TJvInterpreterIdentifierList read FDirectGetList;
property ClassList: TJvInterpreterIdentifierList read FClassList;
property ConstList: TJvInterpreterIdentifierList read FConstList;
property FunctionList: TJvInterpreterIdentifierList read FFunctionList;
property RecordList: TJvInterpreterIdentifierList read FRecordList;
property RecordGetList: TJvInterpreterIdentifierList read FRecordGetList;
property RecordSetList: TJvInterpreterIdentifierList read FRecordSetList;
property OnGetList: TJvInterpreterIdentifierList read FOnGetList;
property OnSetList: TJvInterpreterIdentifierList read FOnSetList;
property SrcFunctionList: TJvInterpreterIdentifierList read FSrcFunctionList;
property ExtFunctionList: TJvInterpreterIdentifierList read FExtFunctionList;
property EventHandlerList: TJvInterpreterIdentifierList read FEventHandlerList;
property EventList: TJvInterpreterIdentifierList read FEventList;
property SrcVarList: TJvInterpreterVarList read FSrcVarList;
property SrcClassList: TJvInterpreterIdentifierList read FSrcClassList;
end;
TStackPtr = -1..cJvInterpreterStackMax;
{ Expression evaluator }
TJvInterpreterExpression = class(TJvComponent)
private
FParser: TJvInterpreterParser;
FVResult: Variant;
FExpStack: array [0..cJvInterpreterStackMax] of Variant;
FExpStackPtr: TStackPtr;
FToken: Variant;
FBacked: Boolean;
FTTyp: TTokenKind;
FTokenStr: string;
FPrevTTyp: TTokenKind;
FAllowAssignment: Boolean;
FArgs: TJvInterpreterArgs; { data }
FCurrArgs: TJvInterpreterArgs; { pointer to current }
FPStream: TStream; { parsed source }
FParsed: Boolean;
FAdapter: TJvInterpreterAdapter;
FSharedAdapter: TJvInterpreterAdapter;
FCompiled: Boolean;
FBaseErrLine: Integer;
FOnGetValue: TJvInterpreterGetValue;
FOnSetValue: TJvInterpreterSetValue;
FLastError: EJvInterpreterError;
FDisableExternalFunctions: Boolean;
function GetSource: string;
procedure SetSource(const Value: string);
procedure SetCurPos(Value: Integer);
function GetCurPos: Integer;
function GetTokenStr: string;
procedure ReadArgs;
procedure InternalGetValue(Obj: Pointer; ObjTyp: Word; var Result: Variant);
function CallFunction(const FunctionName: string;
Args: TJvInterpreterArgs; Params: array of Variant): Variant; virtual; abstract;
function CallFunctionEx(Instance: TObject; const UnitName: string;
const FunctionName: string; Args: TJvInterpreterArgs; Params: array of Variant): Variant; virtual; abstract;
procedure SetDisableExternalFunctions(const Value: Boolean);
protected
procedure UpdateExceptionPos(E: Exception; const UnitName: string);
procedure Init; dynamic;
procedure ErrorExpected(const Exp: string);
procedure ErrorNotImplemented(const Msg: string);
function PosBeg: Integer;
function PosEnd: Integer;
procedure Back;
procedure SafeBack; {? please don't use ?}
function CreateAdapter: TJvInterpreterAdapter; dynamic;
procedure ParseToken;
procedure ReadToken;
procedure WriteToken;
procedure Parse;
function Expression1: Variant;
function Expression2(const ExpType: Word): Variant;
function SetExpression1: Variant;
procedure NextToken;
function GetValue(const Identifier: string; var Value: Variant;
var Args: TJvInterpreterArgs): Boolean; virtual;
function SetValue(const Identifier: string; const Value: Variant;
var Args: TJvInterpreterArgs): Boolean; virtual;
function GetElement(const Variable: Variant; var Value: Variant;
var Args: TJvInterpreterArgs): Boolean; virtual;
function SetElement(var Variable: Variant; const Value: Variant;
var Args: TJvInterpreterArgs): Boolean; virtual;
procedure SourceChanged; dynamic;
procedure SetAdapter(Adapter: TJvInterpreterAdapter);
property Token: Variant read FToken;
property TTyp: TTokenKind read FTTyp;
property PrevTTyp: TTokenKind read FPrevTTyp;
property TokenStr: string read GetTokenStr;
property CurPos: Integer read GetCurPos write SetCurPos;
property Compiled: Boolean read FCompiled;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Run; dynamic;
property Source: string read GetSource write SetSource;
property VResult: Variant read FVResult;
property OnGetValue: TJvInterpreterGetValue read FOnGetValue write FOnGetValue;
property OnSetValue: TJvInterpreterSetValue read FOnSetValue write FOnSetValue;
property Adapter: TJvInterpreterAdapter read FAdapter;
property SharedAdapter: TJvInterpreterAdapter read FSharedAdapter;
property BaseErrLine: Integer read FBaseErrLine write FBaseErrLine;
property LastError: EJvInterpreterError read FLastError;
property DisableExternalFunctions: Boolean read FDisableExternalFunctions write SetDisableExternalFunctions;
end;
TParserState = record
CurPos: Integer;
Token: Variant;
TTyp: TTokenKind;
PrevTTyp: TTokenKind;
Backed: Boolean;
AllowAssignment: Boolean;
end;
TJvInterpreterAddVarFunc = procedure(const UnitName,
Identifier, Typ: string; VTyp: Word; const Value: Variant;
ADataType: IJvInterpreterDataType) of object;
{ Function executor }
TJvInterpreterFunction = class(TJvInterpreterExpression)
private
FCurUnitName: string;
FCurInstance: TObject;
FBreak: Boolean;
FContinue: Boolean;
FExit: Boolean;
FFunctionStack: TList;
FFunctionContext: Pointer; { PFunctionContext }
FSS: TStringList;
FStateStack: array [0..cJvInterpreterStackMax] of TParserState;
FStateStackPtr: TStackPtr;
FEventList: TList;
function GetLocalVars: TJvInterpreterVarList;
function GetFunStackCount: Integer;
function GetDebugPointerToGlobalVars: TJvInterpreterVarList;
function GetDebugPointerToFunStack: Pointer;
protected
procedure Init; override;
procedure PushState;
procedure PopState;
procedure RemoveState;
procedure DoOnStatement; virtual;
procedure InFunction(FunctionDesc: TJvInterpreterFunctionDesc);
procedure InterpretStatement;
procedure SkipStatement;
procedure SkipToEnd;
procedure SkipToUntil;
procedure SkipIdentifier;
procedure FindToken(ATTyp: TTokenKind);
procedure InterpretVar(AddVarFunc: TJvInterpreterAddVarFunc);
procedure InterpretConst(AddVarFunc: TJvInterpreterAddVarFunc);
procedure InterpretIdentifier;
procedure InterpretBegin;
procedure InterpretIf;
procedure InterpretWhile;
procedure InterpretRepeat;
procedure InterpretFor;
procedure InterpretCase;
procedure InterpretTry;
procedure InterpretRaise;
function ParseDataType: IJvInterpreterDataType;
function NewEvent(const UnitName, FunctionName, EventType: string;
Instance: TObject; const APropName: string): TSimpleEvent;
function FindEvent(const UnitName: string; Instance: TObject;
const PropName: string): TJvInterpreterEvent;
procedure InternalSetValue(const Identifier: string);
function GetValue(const Identifier: string; var Value: Variant;
var Args: TJvInterpreterArgs): Boolean; override;
function SetValue(const Identifier: string; const Value: Variant;
var Args: TJvInterpreterArgs): Boolean; override;
property LocalVars: TJvInterpreterVarList read GetLocalVars;
property EventList: TList read FEventList;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;