Le 22 nov. 07 à 23:40, Michael Haupt a écrit :
Hi Stéphane,
Am 22.11.2007 um 20:13 schrieb Stéphane Conversy:
The trick is dirty because I have to bind a variable to the
result of a rule evaluation and then re-bind it to something
entirely different. That's not what I consider clean code.
I still don't understand why you had to do that.
OK. In that rule of the grammar, I need a data structure to
assemble all the AST bits that are returned from the Instruction
rule into a single AST. That data structure is an
OrderedCollection. It is not possible to declare a local variable
in a grammar rule (at least I don't know a "clean" solution). So I
do the following:
1. match the Instruction rule once and store the resulting AST in
the "instructions" variable
2. create an OrderedCollection ("coll" at first) and put
"instructions" (which is currently only the AST pertaining to *one*
instruction) in there
3. assign the OrderedCollection to "instructions"
Now the required state is reached.
Does that clarify things? The crucial problem is that I cannot
declare local variables in rules, as said above.
ok, now it's clear.
I really like the description of the hierarchy between C <
objects < functions. However, is this order the only one ? I
originally thought
there were no such hierarchy, so that objects can use functions,
as much as functions use objects. Does it mean that ST style of
programming can not be applied to COLA, if
ever this question make sense ?
I don't fully understand what you mean.
Ok, maybe it's because your tutorial is about peg, not the entire
"fonc/idst" project. The way I saw it, I thought that this project
could be the base on which the next "squeak" would be built on.
But if you have the order function > object > C, then you can't
express "programs" as a soup of objects (the ST way).
Hm... I'm still not fully sure I understand you; you really should
post this question to the list.
I try to express it differently:
For me, fonc/idst is a general project about language, run-time,
dynamic everything etc, including peg, which is a new way to
implement languages. It seems to me that your tutorial only adresses
the problem
of implementing a language using peg, not about a general use of fonc/
idst.
My concern is: is the order you mention (function > object > C) when
using PEG, still holds when doing more general thing (like
"reimplementing squeak", whatever it means) ?
if you still don't understand the question, nevermind, it's maybe
because I still don't fully understand the goal of fonc/idst (or
COLA ? or LOLA ?), which is a shame, as I usually get things quicker,
I'm getting older :-(
s.
Best,
Michael
--
Dr.-Ing. Michael Haupt [EMAIL PROTECTED]
Software Architecture Group Phone: ++49 (0) 331-5509-542
Hasso Plattner Institute for Fax: ++49 (0) 331-5509-229
Software Systems Engineering http://www.swa.hpi.uni-
potsdam.de/
Prof.-Dr.-Helmert-Str. 2-3, D-14482 Potsdam, Germany
Hasso-Plattner-Institut für Softwaresystemtechnik GmbH, Potsdam
Amtsgericht Potsdam, HRB 12184
Geschäftsführung: Prof. Dr. Christoph Meinel
Stéphane Conversy
Enseignant Chercheur en IHM - ENAC
http://lii-enac.fr/~conversy
enac: +33 5 62 17 40 19
dgac r&d: +33 5 62 25 96 48
_______________________________________________
fonc mailing list
[email protected]
http://vpri.org/mailman/listinfo/fonc