Parsing Smalltalk with SmaCC

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Parsing Smalltalk with SmaCC

Bergel, Alexandre
Dear SmaCC friends,

I wish to adjust a smalltalk parser. However, I was not able to find  
a SmaCC description that actually works.
Just try to install SmaCCDev-lr.17 in a squeak-dev image (that  
already contains SmaCC-lr.13). Open the SmaCC window, load StScanner  
and StParser. And try to test: 1 + 2.
A message not understood: StScanner>>id is raised.

any idea ?

By the way, I was surprise to see that RBParser is not SmaCC-based...

Alexandre


--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.




Reply | Threaded
Open this post in threaded view
|

Re: Parsing Smalltalk with SmaCC

Damien Cassou-3
Have you used the universe browser to install SmaCC?

2007/6/28, Bergel, Alexandre <[hidden email]>:

> Dear SmaCC friends,
>
> I wish to adjust a smalltalk parser. However, I was not able to find
> a SmaCC description that actually works.
> Just try to install SmaCCDev-lr.17 in a squeak-dev image (that
> already contains SmaCC-lr.13). Open the SmaCC window, load StScanner
> and StParser. And try to test: 1 + 2.
> A message not understood: StScanner>>id is raised.
>
> any idea ?
>
> By the way, I was surprise to see that RBParser is not SmaCC-based...
>
> Alexandre
>
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>
>


--
Damien Cassou

Reply | Threaded
Open this post in threaded view
|

Re: Parsing Smalltalk with SmaCC

Bergel, Alexandre
Same thing.
By the way, what is the difference between SqueakMap and Universe?  
Andrew rose a similar question few weeks ago...
Why is there (or why do we need) two deployment tools? If SqueakMap  
is not used anymore, then it should be removed, but having both is  
confusing (at least for me).

Alexandre

On 28 Jun 2007, at 11:51, Damien Cassou wrote:

> Have you used the universe browser to install SmaCC?
>
> 2007/6/28, Bergel, Alexandre <[hidden email]>:
>> Dear SmaCC friends,
>>
>> I wish to adjust a smalltalk parser. However, I was not able to find
>> a SmaCC description that actually works.
>> Just try to install SmaCCDev-lr.17 in a squeak-dev image (that
>> already contains SmaCC-lr.13). Open the SmaCC window, load StScanner
>> and StParser. And try to test: 1 + 2.
>> A message not understood: StScanner>>id is raised.
>>
>> any idea ?
>>
>> By the way, I was surprise to see that RBParser is not SmaCC-based...
>>
>> Alexandre
>>
>>
>> --
>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> Alexandre Bergel  http://www.bergel.eu
>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>
>>
>>
>>
>>
>
>
> --
> Damien Cassou
>

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.




Reply | Threaded
Open this post in threaded view
|

Re: Parsing Smalltalk with SmaCC

Mathieu SUEN
In reply to this post by Bergel, Alexandre
May be try to recompile StScanner
        Mth



On Jun 28, 2007, at 11:44 AM, Bergel, Alexandre wrote:

> Dear SmaCC friends,
>
> I wish to adjust a smalltalk parser. However, I was not able to  
> find a SmaCC description that actually works.
> Just try to install SmaCCDev-lr.17 in a squeak-dev image (that  
> already contains SmaCC-lr.13). Open the SmaCC window, load  
> StScanner and StParser. And try to test: 1 + 2.
> A message not understood: StScanner>>id is raised.
>
> any idea ?
>
> By the way, I was surprise to see that RBParser is not SmaCC-based...
>
> Alexandre
>
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Parsing Smalltalk with SmaCC

Bergel, Alexandre
Same thing. Still broken.

Alexandre


On 28 Jun 2007, at 12:06, Mathieu Suen wrote:

> May be try to recompile StScanner
> Mth
>
>
>
> On Jun 28, 2007, at 11:44 AM, Bergel, Alexandre wrote:
>
>> Dear SmaCC friends,
>>
>> I wish to adjust a smalltalk parser. However, I was not able to  
>> find a SmaCC description that actually works.
>> Just try to install SmaCCDev-lr.17 in a squeak-dev image (that  
>> already contains SmaCC-lr.13). Open the SmaCC window, load  
>> StScanner and StParser. And try to test: 1 + 2.
>> A message not understood: StScanner>>id is raised.
>>
>> any idea ?
>>
>> By the way, I was surprise to see that RBParser is not SmaCC-based...
>>
>> Alexandre
>>
>>
>> --
>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> Alexandre Bergel  http://www.bergel.eu
>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>
>>
>>
>>
>
>

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.




Reply | Threaded
Open this post in threaded view
|

Re: Parsing Smalltalk with SmaCC

Mathieu SUEN
In reply to this post by Bergel, Alexandre
I have take a look, The StScanner>>number method is wrong. You can  
file in the attached file.
        Mth




On Jun 28, 2007, at 11:44 AM, Bergel, Alexandre wrote:

> Dear SmaCC friends,
>
> I wish to adjust a smalltalk parser. However, I was not able to  
> find a SmaCC description that actually works.
> Just try to install SmaCCDev-lr.17 in a squeak-dev image (that  
> already contains SmaCC-lr.13). Open the SmaCC window, load  
> StScanner and StParser. And try to test: 1 + 2.
> A message not understood: StScanner>>id is raised.
>
> any idea ?
>
> By the way, I was surprise to see that RBParser is not SmaCC-based...
>
> Alexandre
>
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>



StScanner-number.st (304 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Parsing Smalltalk with SmaCC

Lukas Renggli
In reply to this post by Bergel, Alexandre
> Just try to install SmaCCDev-lr.17 in a squeak-dev image (that
> already contains SmaCC-lr.13). Open the SmaCC window, load StScanner
> and StParser. And try to test: 1 + 2.
> A message not understood: StScanner>>id is raised.
>
> any idea ?

I published SmaCCDev-lr.18 that fixes the issue you describe. Please
note that the parser takes a full method by example (to parse
expressions you have to use the utility methods on the class side), so
I typed "foo ^ 1 + 2" instead.

We should test and benchmark the SmaCC parser (for example on all the
methods of the image) to see if it generates the same trees as the one
from the RB and compare the speed.

> By the way, I was surprise to see that RBParser is not SmaCC-based...

RB is much older than SmaCC. I guess RB was one of the rasons that
SmaCC was developed, but it never got adapted to use the new parser.
The hand written RB parser is also adaptive, this means it changes its
behavior depending on the platform and the context (Smalltalk, Rewrite
Engine). That's difficult to do with SmaCC.

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch

Reply | Threaded
Open this post in threaded view
|

Re: Parsing Smalltalk with SmaCC

Damien Cassou-3
In reply to this post by Bergel, Alexandre
2007/6/28, Bergel, Alexandre <[hidden email]>:
> Same thing.
> By the way, what is the difference between SqueakMap and Universe?
> Andrew rose a similar question few weeks ago...
> Why is there (or why do we need) two deployment tools? If SqueakMap
> is not used anymore, then it should be removed, but having both is
> confusing (at least for me).

Have a look at the thread from May 24 2007: "Universes/SqueakMap
Separation? (was Re: Fun with Symbol)"

I think we need something better than Universe before switching to
something else than SqueakMap. I currently use Universe for the
squeak-dev image because it manages dependencies between packages.

--
Damien Cassou

Reply | Threaded
Open this post in threaded view
|

Re: Parsing Smalltalk with SmaCC

Edgar J. De Cleene
In reply to this post by Bergel, Alexandre



El 6/28/07 6:57 AM, "Bergel, Alexandre" <[hidden email]> escribió:

> Same thing.
> By the way, what is the difference between SqueakMap and Universe?
> Andrew rose a similar question few weeks ago...
> Why is there (or why do we need) two deployment tools? If SqueakMap
> is not used anymore, then it should be removed, but having both is
> confusing (at least for me).
>
> Alexandre


SqueakMap is keeped only for compatibility reasons.
Some packages ask for it, hope soon developers upgrade to Universes.
SqueakMap still have users and Goran deserves our gratitude.
When we go beta soon my plan is unload of image

Edgar



Reply | Threaded
Open this post in threaded view
|

Re: Parsing Smalltalk with SmaCC

Ralph Johnson
SquekMap and Package Universe differ in at least two ways.

The one that people notice immediately is that PU knows the
prerequisites for a package.  Thus, when you load a package in PU, you
load all the packages that it depends on.  This makes it much easier
to use than SM.  SM ought to be changed to do the same, and if it
doesn't change then in my opinion it is likely to be abandoned.

The second major difference is that there is one SqueakMap, and it
tries to hold everything.  There can be many databases for PU, on the
other hand.  One PU can include another.  Each PU is supposed to have
someone who oversees it and who makes sure that everything goes
together.  However, this last feature hasn't been used much.  There
was a PU for 3.9 and there is a different one for 3.10.  But lots of
different people stick stuff in the 3.10 "universe", and so it can
take awhile before we discover that two packages don't work together.

It is useful to have a complete list of packages.  It would be a shame
to abandon that feature of SM.  Most of the time, however, I only want
packages that are known to work with my current version.

SM has some other features that PU doesn't, such as recording license
info.  PU can't uninstall a package, and I think SM allows this.  It
would be nice if PU added these features.  But the strength of PU is
that everything is supposed to work together, so PU is fundamentally
at odds with the requirement to find every existing package.

Edgar said that the 3.10 release team is going to drop SM.  That is
not entirely true.  We have been moving packages out of the image, and
PU makes that easier.  When we move a package out of the image, we
move it into PU.  So, the plan is to move SM from the image to PU.  It
will still be available.

The names of SM and PU seems wierd to me.  Sicne SM tries to include
everything, it should have been called "Squeak Universe".  Since PU
only contains packages that work toether, it shouldn't have been
called "universe".  Perhaps "galaxy", since there are many galaxies
but only one universe.

-Ralph

Reply | Threaded
Open this post in threaded view
|

Re: Parsing Smalltalk with SmaCC

Bergel, Alexandre
Thanks Ralph for this detailed explanation.

Alexandre


On 29 Jun 2007, at 13:42, Ralph Johnson wrote:

> SquekMap and Package Universe differ in at least two ways.
>
> The one that people notice immediately is that PU knows the
> prerequisites for a package.  Thus, when you load a package in PU, you
> load all the packages that it depends on.  This makes it much easier
> to use than SM.  SM ought to be changed to do the same, and if it
> doesn't change then in my opinion it is likely to be abandoned.
>
> The second major difference is that there is one SqueakMap, and it
> tries to hold everything.  There can be many databases for PU, on the
> other hand.  One PU can include another.  Each PU is supposed to have
> someone who oversees it and who makes sure that everything goes
> together.  However, this last feature hasn't been used much.  There
> was a PU for 3.9 and there is a different one for 3.10.  But lots of
> different people stick stuff in the 3.10 "universe", and so it can
> take awhile before we discover that two packages don't work together.
>
> It is useful to have a complete list of packages.  It would be a shame
> to abandon that feature of SM.  Most of the time, however, I only want
> packages that are known to work with my current version.
>
> SM has some other features that PU doesn't, such as recording license
> info.  PU can't uninstall a package, and I think SM allows this.  It
> would be nice if PU added these features.  But the strength of PU is
> that everything is supposed to work together, so PU is fundamentally
> at odds with the requirement to find every existing package.
>
> Edgar said that the 3.10 release team is going to drop SM.  That is
> not entirely true.  We have been moving packages out of the image, and
> PU makes that easier.  When we move a package out of the image, we
> move it into PU.  So, the plan is to move SM from the image to PU.  It
> will still be available.
>
> The names of SM and PU seems wierd to me.  Sicne SM tries to include
> everything, it should have been called "Squeak Universe".  Since PU
> only contains packages that work toether, it shouldn't have been
> called "universe".  Perhaps "galaxy", since there are many galaxies
> but only one universe.
>
> -Ralph
>

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.




Reply | Threaded
Open this post in threaded view
|

Re: Parsing Smalltalk with SmaCC

Edgar J. De Cleene
In reply to this post by Bergel, Alexandre



El 6/29/07 8:42 AM, "Ralph Johnson" <[hidden email]> escribió:

> That is
> not entirely true.  We have been moving packages out of the image, and
> PU makes that easier.  When we move a package out of the image, we
> move it into PU.  So, the plan is to move SM from the image to PU.  It
> will still be available.

It's my view. Sorry if I miscommunicate.

As I said , Goran deserves our gratitude for SqueakMap,



cbc
Reply | Threaded
Open this post in threaded view
|

Re: Parsing Smalltalk with SmaCC

cbc
In reply to this post by Ralph Johnson
On 6/29/07, Ralph Johnson <[hidden email]> wrote:
SquekMap and Package Universe differ in at least two ways.
...
SM ought to be changed to do the same, and if it
doesn't change then in my opinion it is likely to be abandoned.
 
That would really be a shame.  As you stated, SM is a nice index to a vast wealth of Squeak code and projects over the years, many of which are not in a Universe today (and probably never will be).  It would be a shame to loose visibility to those projects.  SM also has a nice cache of some (most? all?) of those packages, so as the original storage places for those packages rot or dissappear, we can still benefit from them.
 
If everyone started saving all work in Monticello and saved it to SqueakSource - or some other authoritative place - AND there were motivated people to convert all the old (usually very interesting and sometimes useful) code from SM into Montecello, then there might be some justification to removing SM.  I just don't see that happening.
 
-ChrisC