help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] Documentation for gst-convert?


From: Paolo Bonzini
Subject: Re: [Help-smalltalk] Documentation for gst-convert?
Date: Sun, 21 Sep 2008 10:00:38 +0200
User-agent: Thunderbird 2.0.0.16 (Macintosh/20080707)

> The manpage for gst-convert mentions that "The full documentation for
> gst-convert is maintained as a Texinfo manual." However, I couldn't
> find it in the texinfo documentation.

> Anyway: I understand that gst-convert can read different formats, but
> the output format is always gst2. Is that right?

More precisely, it is always "gst".  gst2 is pre-3.0 !-separated input
(but not following the same rules as in Squeak: for example exclamation
marks inside strings or comments are not doubled).

> If so, then portable code should be written using, say, squeak format
> and then converted to gst?  (No way to go from gst2 to squeak?)

Well, that was done just because it is more common to go that way.  All
of Seaside, GNUPlot (which then evolved independently), Magritte,
OmniBrowser were ported like that.

However, there are provisions for extending it.  Exporting the class is
a more complex task, and it is already done in its own object; exporting
doits right now is using RBFormatter directly and hardcoding the GST syntax.

The steps should be like this (1-3 are just refactorings):

1) Make a new DoitExporter or EvalExporter class in
packages/stinst/parser/Exporter.st.    Move the
EmittedEval>>#emitTo:filteredBy: method of scripts/Convert.st to the new
class there.

2) Make an abstract class out of what is in
packages/stinst/parser/Exporter.st.  Move the previous concrete classes
to a new file, say packages/stinst/parser/GSTExporter.st.

3) Make a factory abstract class that can create both the doit and class
exporters.  Make a concrete subclass for GST.  Use it in scripts/Convert.st.

4) Add to scripts/Convert.st a switch to choose between different exporters.

5) Write new exporters for Squeak, VisualWorks, SIF, or GST2 (in order
of usefulness).  Code for GST2 can be found more or less in GST 2.x
itself's ClassDescription and Class classes.  Code for Squeak would not
be much different.

6) Optional: store Squeak's timestamps for comments and methods in the
objects representing loaded Smalltalk code, to make Squeak-to-Squeak
conversion fully preserve it.  This would make it possible to use
gst-convert for bulk rewrites of Squeak code, which would be a useful
tool for Squeakers too, and good advertisement for GST.

None of this should change the output of scripts/Convert.st.  If you
want I can provide you big testcases for scripts/Convert.st so that you
can test your changes against them.

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]