Autor Beitrag
Philipp_Reitter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 430



BeitragVerfasst: Mi 05.09.07 08:22 
hi

hab ne frage.... ich schreib mir gerade nen kleinen parser und da woll ich fragen ob es da schon fertige gibt?
aber ich will dass ich in meine Textdatei (ode von wo der acuh immer ließt) auch was reinschreiben kann wie Button1.caption:='asdf'; oder Form1.Close; ect. und wo ich eigene Proceduren hinzufügen kann...
gibts so nen komplexen oder muss ich den erst erfinden ;-)

Mfg
philipp
noidic
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 851

Win 2000 Win XP Vista
D7 Ent, SharpDevelop 2.2
BeitragVerfasst: Mi 05.09.07 08:28 
Was soll der Parser denn parsen? Welchen Zweck soll er erfüllen?

_________________
Bravery calls my name in the sound of the wind in the night...
Philipp_Reitter Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 430



BeitragVerfasst: Mi 05.09.07 08:34 
ich mein so dass ich in meine button prozedure dann reinschreib
ausblenden Delphi-Quelltext
1:
Parser.Parse('Button1');					

und in meinem Parser Scritp (in irgend ner textdatei oä) steht dann
ausblenden Quelltext
1:
2:
3:
4:
5:
procedure Button1
begin
  button2.enabled := false;
  Memo2.line.add('asdfasdf');
end;


is so was möglich bzw. gibts so was schon?
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Mi 05.09.07 08:38 
Ich denke nicht. Denn der Parser müsste Dein Programm decompilieren und dann noch in Delphi-Code umbasteln. Und das noch mit Bezeichnern, die Du gewählt hast.

Ich bin kein Spezi für De-Compiler, aber das dürfte nicht möglich sein.

EDIT:
Habe es wohl falsch herum verstanden.


Zuletzt bearbeitet von jasocul am Mi 05.09.07 09:12, insgesamt 1-mal bearbeitet
Philipp_Reitter Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 430



BeitragVerfasst: Mi 05.09.07 08:41 
ist es eigentlich schwierig einen eigenen Complier zu schreiben?
bzw. seinen eigenen Code zu Complien...?!
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mi 05.09.07 08:45 
Ich habe zwar noch nicht viel damit gearbeitet, aber vielleicht geht sowas mit Pascal Script auch. Wenn nicht direkt dann vielleicht über Application.MainForm.FindComponent oder so.
noidic
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 851

Win 2000 Win XP Vista
D7 Ent, SharpDevelop 2.2
BeitragVerfasst: Mi 05.09.07 08:48 
Soll die eingelesene procedur dann im Code verbleiben und beliebig aufrufbar sein? Oder soll einfach nur der Code der Prozedure beim Parse-Aufruf ausgeführt werden? Letzteres sollte möglich sein, wenn auch recht aufwändig.

_________________
Bravery calls my name in the sound of the wind in the night...
Philipp_Reitter Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 430



BeitragVerfasst: Mi 05.09.07 08:50 
cih will einfach dass jedesmal wenn ich wie oben im beispiel den button drücke er mir da ausführ was JETZT gerade in der Textdatei steht...
alzaimar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2889
Erhaltene Danke: 13

W2000, XP
D6E, BDS2006A, DevExpress
BeitragVerfasst: Mi 05.09.07 09:08 
Geht Alles, googel mal nach den diversen Pascal / Delphi-Skripten.

Ich kenne DWS (Delphi Web Script), gibts bei Sourceforge.
Dann gibts noch was bei RemObjects und FastReport.Com (ob das FastScript umsonst ist, weiss ich nicht)
Weiterhin dürfte sowas in der JCL/JVCL dabei sein, inwiefern der Zugriff auf die eigene Anwendung unterstützt ist, weiss ich nicht.

Bei DWS und FastScript kannst Du sowas ohne Probleme machen, bei RemObjects PascalScript gehe ich mal davon aus.

Im Prinzip musst Du dem Skript nur mitteilen, das es ein Symbol 'Form1' der Klasse 'TMyForm' gibt.

_________________
Na denn, dann. Bis dann, denn.
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Mi 05.09.07 09:47 
Ansonsten geht sowas mit Spidermonkey und JavaScript. Da Spidermonkey OS ist, kannst du dir ja mal den Source angucken.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
Philipp_Reitter Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 430



BeitragVerfasst: Mi 05.09.07 10:32 
hab mir mal das verlinkte Pascal Script von oben angesehen... könnt ich mit dem so was realiesieren?
alzaimar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2889
Erhaltene Danke: 13

W2000, XP
D6E, BDS2006A, DevExpress
BeitragVerfasst: Mi 05.09.07 12:15 
Bestimmt.

_________________
Na denn, dann. Bis dann, denn.
Philipp_Reitter Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 430



BeitragVerfasst: Mi 05.09.07 16:32 
gibts da irgendwo tutorials dazu oder kennen sich genug leute damit aus um das im forum zu erfragen :D