Autor Beitrag
Martok
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 3661
Erhaltene Danke: 604

Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
BeitragVerfasst: Fr 04.01.08 18:22 
Vielleicht kennen ja einige die DLangExtensions von Andy.

Veröffentlich hat er sie in der DP, und auf einer eigenen Seite.

Dafür möchte ich jetzt mal Plugins programmieren, und wollte mal mit einem For-Loop mit selbst deklarierendem Zähler anfangen. Also: for i:integer := 0 to 10 do

Hat das schonmal jemand gemacht? Wie geht man da ran? RegEx? Parser? Und was passiert mit Verschachtelungen und wie findet man den entsprechenden Var-Abschnitt?
Fragen über Fragen ;)

mfg
Martok

PS:Eventuell könnte man sogar ein Gemeinschaftsprojekt draus machen. Wär mal was sinnvolles, wo man auch gut arbeitsteilig ran gehen könnte. Das sollte hier aber nicht Thema sein ;)

_________________
"The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."
alias5000
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2145

WinXP Prof SP2, Ubuntu 9.04
C/C++(Code::Blocks, VS.NET),A51(Keil),Object Pascal(D2005PE, Turbo Delphi Explorer) C# (VS 2008 Express)
BeitragVerfasst: Fr 04.01.08 23:16 
Hallo Martok,

zuerst: Frag doch deswegen einfach in der DP ;) Da iss unser jbg aka Andreas Hausladen auch ziemlich aktiv.
zum zweiten: ein Projekt um die Delphi Sprache zu erweitern finde ich nicht schlecht. Nur sollte eins beachtet werden:
Die Sachen müssen sher sinnvoll und sehr konsequent umgesetzt werden. Weil wenn jeder dank anderen Plugins seinen eigenen Delphi-Slang benutzt, dann bringt das mehr Chaos und Arbeit als Entlastung. Es sollte einfach einen quasi Standard geben, also einen Platzhirsch.
Ich habe, wenn ich mir fremden Delphi-Quellcode kompilieren will nicht unbedingt Lust, genau dem sein Sprach-Erweiterungs Plugin installieren zu müssen.

Gruß
alias5000

_________________
Programmers never die, they just GOSUB without RETURN
Martok Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 3661
Erhaltene Danke: 604

Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
BeitragVerfasst: Sa 05.01.08 00:43 
Deswegen hatte ich das als Gemeinschaftsprojekt angedacht, so dass eine Art Quasi-Standard entsteht.

Tja, und in der DP bin ich nicht gereggt, deswegen hab ichs erstmal hier versucht. Lässt sich natürlich ändern ;)
EDIT: bitte was? Da gibt es schon einen Martok? So ein Mist...

_________________
"The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."
Martok Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 3661
Erhaltene Danke: 604

Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
BeitragVerfasst: Sa 05.01.08 18:25 
(Hinweis: auch wenn es noch keine 24h sind: ich schiebe nicht, ich gebe neue Infos ;) )

Irgendwie hab ich jetzt doch eine Art Regex-Verarbeitung zusammen gekriegt. Funktioniert auch ganz ordentlich, nur noch ein Token-Parser fehlt, um z.b. das korrespondierende end, oder auch den var-Abschnitt zu einer Funktion zu finden.

Langsam seh ich aber auch das Problem, dass alias5000 angesprochen hat, auf mich zurollen.
Schreibt mal was. Welche Features in welcher Form hättet ihr gern? Eher for (i:integer:=0; i<10; i:= i+2) oder doch lieber for i:integer:= 0 to 10,i:= i+2 do? Oder was ganz anderes :?:

_________________
"The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."
alias5000
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2145

WinXP Prof SP2, Ubuntu 9.04
C/C++(Code::Blocks, VS.NET),A51(Keil),Object Pascal(D2005PE, Turbo Delphi Explorer) C# (VS 2008 Express)
BeitragVerfasst: Sa 05.01.08 18:38 
Ich persönlich finde den C-Syntax sehr schön :)
Also das erste

Gruß
alias5000

_________________
Programmers never die, they just GOSUB without RETURN
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Sa 05.01.08 18:41 
Ich finde, die C-Syntax hat nichts in einer Pascalsprache zu suchen. Ich finde die Syntax in Chrome sehr nett:

ausblenden Chrome-Quelltext
1:
for i : Integer := 0 to 10 step 2 do					

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
alias5000
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2145

WinXP Prof SP2, Ubuntu 9.04
C/C++(Code::Blocks, VS.NET),A51(Keil),Object Pascal(D2005PE, Turbo Delphi Explorer) C# (VS 2008 Express)
BeitragVerfasst: Sa 05.01.08 18:45 
Hm hast auch irgendwie recht. So schnell gehts und schon ist man Anhänger von Christians Vorschlag.
Aber dadurch, dass das Step wieder mit drinnen ist, ist das schon viel besser

_________________
Programmers never die, they just GOSUB without RETURN
Martok Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 3661
Erhaltene Danke: 604

Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
BeitragVerfasst: Sa 05.01.08 19:33 
Hm. Mit step kann ich mich abfinden ;)
Ich hatte das so dass man einen Ausdruck angeben kann der nach jedem Ausdruck ausgeführt wird. Step ist aber weniger Schreibarbeit ;)

Begin/End macht mir aber grade wirklich Probleme... Irgendwie ist der Regex-Parser greedy, obwohl ich UnGreedy in den Optionen hab.
EDIT: So, fertig ;) Als nächstes mal sehen wie man den zugehörigen Var-Abschnitt findet...

_________________
"The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."