Smalltalk Parser in GS

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

Smalltalk Parser in GS

BrunoBB

Hi all,

 

I can not find a parser inside GemStone/S to parse some string, like:

 

SmalltalkParser parseExpression: ‘numberOfTickets >= 1500’.

 

Anyone has used a Smalltalk parser inside GS ?

 

Regards,

Bruno

 

Reply | Threaded
Open this post in threaded view
|

Re: Smalltalk Parser in GS

Johan Brichau-2
Hi,

If you just want to execute an expression in a string, there is String>>evaluate.
Of course, that does not help if you want a parsetree...



On 16 Apr 2011, at 22:34, Smalltalk wrote:

> Hi all,
>  
> I can not find a parser inside GemStone/S to parse some string, like:
>  
> SmalltalkParser parseExpression: ‘numberOfTickets >= 1500’.
>  
> Anyone has used a Smalltalk parser inside GS ?
>  
> Regards,
> Bruno
>  

Reply | Threaded
Open this post in threaded view
|

Re: Smalltalk Parser in GS

Dale Henrichs
In reply to this post by BrunoBB
<base href="x-msg://731/">
On Apr 16, 2011, at 1:34 PM, Smalltalk wrote:

Hi all,
 
I can not find a parser inside GemStone/S to parse some string, like:
 
SmalltalkParser parseExpression: ‘numberOfTickets >= 1500’.
 
Anyone has used a Smalltalk parser inside GS ?
 
Regards,
Bruno
 

Bruno,

Check out AST-Core-DaleHenrichs.84.mcz in:

  http://seaside.gemstone.com/ss/rb

It's a port of RBParser to GemStone that I used to parse Smalltalk methods to get the senders and global refs for Bibliocello ...

Dale 


Reply | Threaded
Open this post in threaded view
|

Re: Smalltalk Parser in GS

BrunoBB
<base href="x-msg://731/">

Dale,

 

Thanks very much.

 

My Seaside version: “Seaside2.8g1-dkh.602.mcz 08/12/08 09:43:27“.

 

I tried to install AST-Core version: DaleHenrichs.84 but I get this error:

(Character>>allCharacters method does not exist)

 

MessageNotUnderstood (ExceptionA)>>#defaultAction @6 line 7

MessageNotUnderstood (Error)>>#defaultAction @2 line 7

MessageNotUnderstood>>#defaultAction @2 line 7

MessageNotUnderstood (ExceptionA)>>#doResignal @9 line 9

ExceptionHandler>>#caughtException @4 line 5

ExceptionHandler>>#caughtEx:number:cat:args: @16 line 19

[] in ExceptionHandler>>#try:on:in:do: @9 line 9

Exception>>#_signal:number:args: @2 line 7

System class>>#signal:args:signalDictionary: @5 line 13

Character class (Object)>>#doesNotUnderstand: @6 line 14

Character class (Object)>>#_doesNotUnderstand: @1 line 6

RBScanner class>>#initializeClassificationTable @5 line 5

RBScanner class>>#initialize @1 line 2

MCMethodDefinition>>#postload @5 line 2

MCMethodDefinition (MCDefinition)>>#postloadOver: @1 line 2

[] in MCPackageLoader>>#basicLoad @20 line 7

OrderedCollection (Collection)>>#do: @5 line 10

OrderedCollection (SequenceableCollection)>>#do:displayingProgress: @1 line 3

[] in MCPackageLoader>>#basicLoad @21 line 7

ExceptionHandler>>#try:on:in:do: @13 line 13

InMidstOfFileinNotification class (ExceptionA class)>>#try:on:do: @2 line 4

[] in ExecutableBlock>>#on:do: @2 line 8

[] in MCPackageLoader>>#basicLoad @24 line 8

[] in ExecutableBlock>>#ensure: @4 line 11

[] in ExecutableBlock>>#ensure: @6 line 11

MCPackageLoader>>#basicLoad @27 line 10

[] in MCPackageLoader>>#loadWithNameLike: @6 line 4

[] in MCPackageLoader>>#useChangeSetNamed:during: @8 line 9

[] in ExecutableBlock>>#ensure: @4 line 11

[] in ExecutableBlock>>#ensure: @6 line 11

MCPackageLoader>>#useChangeSetNamed:during: @11 line 9

MCPackageLoader>>#useNewChangeSetNamedLike:during: @3 line 2

MCPackageLoader>>#loadWithNameLike: @7 line 4

MCVersionLoader>>#load @12 line 6

MCVersionLoader class>>#loadVersion: @3 line 4

MCVersion>>#load @2 line 2

JadeServer64bit (JadeServer)>>#mcVersionLoad:from:autoMigrate: @7 line 8

 

 

 

De: [hidden email] [mailto:[hidden email]] En nombre de Dale Henrichs
Enviado el: Sunday, April 17, 2011 1:15 PM
Para: GemStone Seaside beta discussion
Asunto: Re: [GS/SS Beta] Smalltalk Parser in GS

 

 

On Apr 16, 2011, at 1:34 PM, Smalltalk wrote:



Hi all,

 

I can not find a parser inside GemStone/S to parse some string, like:

 

SmalltalkParser parseExpression: ‘numberOfTickets >= 1500’.

 

Anyone has used a Smalltalk parser inside GS ?

 

Regards,

Bruno

 

 

Bruno,

 

Check out AST-Core-DaleHenrichs.84.mcz in:


  http://seaside.gemstone.com/ss/rb

 

It's a port of RBParser to GemStone that I used to parse Smalltalk methods to get the senders and global refs for Bibliocello ...

 

Dale 

 

Reply | Threaded
Open this post in threaded view
|

Re: Smalltalk Parser in GS

BrunoBB
<base href="x-msg://731/">

Dale,

 

I have copied two definitions from Pharo (I use a Dolphin Smalltalk client to program GemStone/S):

Character

allCharacters

                "This name is obsolete since only the characters that will fit in a byte can be queried"

                ^self allByteCharacters

 

allByteCharacters

                "Answer all the characters that can be encoded in a byte"

                ^ (0 to: 255) collect: [:v | Character value: v]

 

It loaded. Now I going to test it.

 

Regards,

Bruno

 

 

De: [hidden email] [mailto:[hidden email]] En nombre de Smalltalk
Enviado el: Sunday, April 17, 2011 3:03 PM
Para: 'GemStone Seaside beta discussion'
Asunto: Re: [GS/SS Beta] Smalltalk Parser in GS

 

Dale,

 

Thanks very much.

 

My Seaside version: “Seaside2.8g1-dkh.602.mcz 08/12/08 09:43:27“.

 

I tried to install AST-Core version: DaleHenrichs.84 but I get this error:

(Character>>allCharacters method does not exist)

 

MessageNotUnderstood (ExceptionA)>>#defaultAction @6 line 7

MessageNotUnderstood (Error)>>#defaultAction @2 line 7

MessageNotUnderstood>>#defaultAction @2 line 7

MessageNotUnderstood (ExceptionA)>>#doResignal @9 line 9

ExceptionHandler>>#caughtException @4 line 5

ExceptionHandler>>#caughtEx:number:cat:args: @16 line 19

[] in ExceptionHandler>>#try:on:in:do: @9 line 9

Exception>>#_signal:number:args: @2 line 7

System class>>#signal:args:signalDictionary: @5 line 13

Character class (Object)>>#doesNotUnderstand: @6 line 14

Character class (Object)>>#_doesNotUnderstand: @1 line 6

RBScanner class>>#initializeClassificationTable @5 line 5

RBScanner class>>#initialize @1 line 2

MCMethodDefinition>>#postload @5 line 2

MCMethodDefinition (MCDefinition)>>#postloadOver: @1 line 2

[] in MCPackageLoader>>#basicLoad @20 line 7

OrderedCollection (Collection)>>#do: @5 line 10

OrderedCollection (SequenceableCollection)>>#do:displayingProgress: @1 line 3

[] in MCPackageLoader>>#basicLoad @21 line 7

ExceptionHandler>>#try:on:in:do: @13 line 13

InMidstOfFileinNotification class (ExceptionA class)>>#try:on:do: @2 line 4

[] in ExecutableBlock>>#on:do: @2 line 8

[] in MCPackageLoader>>#basicLoad @24 line 8

[] in ExecutableBlock>>#ensure: @4 line 11

[] in ExecutableBlock>>#ensure: @6 line 11

MCPackageLoader>>#basicLoad @27 line 10

[] in MCPackageLoader>>#loadWithNameLike: @6 line 4

[] in MCPackageLoader>>#useChangeSetNamed:during: @8 line 9

[] in ExecutableBlock>>#ensure: @4 line 11

[] in ExecutableBlock>>#ensure: @6 line 11

MCPackageLoader>>#useChangeSetNamed:during: @11 line 9

MCPackageLoader>>#useNewChangeSetNamedLike:during: @3 line 2

MCPackageLoader>>#loadWithNameLike: @7 line 4

MCVersionLoader>>#load @12 line 6

MCVersionLoader class>>#loadVersion: @3 line 4

MCVersion>>#load @2 line 2

JadeServer64bit (JadeServer)>>#mcVersionLoad:from:autoMigrate: @7 line 8

 

 

 

De: [hidden email] [mailto:[hidden email]] En nombre de Dale Henrichs
Enviado el: Sunday, April 17, 2011 1:15 PM
Para: GemStone Seaside beta discussion
Asunto: Re: [GS/SS Beta] Smalltalk Parser in GS

 

 

On Apr 16, 2011, at 1:34 PM, Smalltalk wrote:

 

Hi all,

 

I can not find a parser inside GemStone/S to parse some string, like:

 

SmalltalkParser parseExpression: ‘numberOfTickets >= 1500’.

 

Anyone has used a Smalltalk parser inside GS ?

 

Regards,

Bruno

 

 

Bruno,

 

Check out AST-Core-DaleHenrichs.84.mcz in:


  http://seaside.gemstone.com/ss/rb

 

It's a port of RBParser to GemStone that I used to parse Smalltalk methods to get the senders and global refs for Bibliocello ...

 

Dale 

 

Reply | Threaded
Open this post in threaded view
|

Re: Smalltalk Parser in GS

BrunoBB
<base href="x-msg://731/">

Dale,

 

The package loaded but now I have AnsiWriteStream class missing.

 

I think your package is for GemStone 3.0 (I have GemStone 2.3 from the Virtual Appliance).

 

I think this is the problem.

 

Regards,

Bruno

 

 

De: [hidden email] [mailto:[hidden email]] En nombre de Smalltalk
Enviado el: Sunday, April 17, 2011 3:25 PM
Para: 'GemStone Seaside beta discussion'
Asunto: Re: [GS/SS Beta] Smalltalk Parser in GS

 

Dale,

 

I have copied two definitions from Pharo (I use a Dolphin Smalltalk client to program GemStone/S):

Character

allCharacters

                "This name is obsolete since only the characters that will fit in a byte can be queried"

                ^self allByteCharacters

 

allByteCharacters

                "Answer all the characters that can be encoded in a byte"

                ^ (0 to: 255) collect: [:v | Character value: v]

 

It loaded. Now I going to test it.

 

Regards,

Bruno

 

 

De: [hidden email] [mailto:[hidden email]] En nombre de Smalltalk
Enviado el: Sunday, April 17, 2011 3:03 PM
Para: 'GemStone Seaside beta discussion'
Asunto: Re: [GS/SS Beta] Smalltalk Parser in GS

 

Dale,

 

Thanks very much.

 

My Seaside version: “Seaside2.8g1-dkh.602.mcz 08/12/08 09:43:27“.

 

I tried to install AST-Core version: DaleHenrichs.84 but I get this error:

(Character>>allCharacters method does not exist)

 

MessageNotUnderstood (ExceptionA)>>#defaultAction @6 line 7

MessageNotUnderstood (Error)>>#defaultAction @2 line 7

MessageNotUnderstood>>#defaultAction @2 line 7

MessageNotUnderstood (ExceptionA)>>#doResignal @9 line 9

ExceptionHandler>>#caughtException @4 line 5

ExceptionHandler>>#caughtEx:number:cat:args: @16 line 19

[] in ExceptionHandler>>#try:on:in:do: @9 line 9

Exception>>#_signal:number:args: @2 line 7

System class>>#signal:args:signalDictionary: @5 line 13

Character class (Object)>>#doesNotUnderstand: @6 line 14

Character class (Object)>>#_doesNotUnderstand: @1 line 6

RBScanner class>>#initializeClassificationTable @5 line 5

RBScanner class>>#initialize @1 line 2

MCMethodDefinition>>#postload @5 line 2

MCMethodDefinition (MCDefinition)>>#postloadOver: @1 line 2

[] in MCPackageLoader>>#basicLoad @20 line 7

OrderedCollection (Collection)>>#do: @5 line 10

OrderedCollection (SequenceableCollection)>>#do:displayingProgress: @1 line 3

[] in MCPackageLoader>>#basicLoad @21 line 7

ExceptionHandler>>#try:on:in:do: @13 line 13

InMidstOfFileinNotification class (ExceptionA class)>>#try:on:do: @2 line 4

[] in ExecutableBlock>>#on:do: @2 line 8

[] in MCPackageLoader>>#basicLoad @24 line 8

[] in ExecutableBlock>>#ensure: @4 line 11

[] in ExecutableBlock>>#ensure: @6 line 11

MCPackageLoader>>#basicLoad @27 line 10

[] in MCPackageLoader>>#loadWithNameLike: @6 line 4

[] in MCPackageLoader>>#useChangeSetNamed:during: @8 line 9

[] in ExecutableBlock>>#ensure: @4 line 11

[] in ExecutableBlock>>#ensure: @6 line 11

MCPackageLoader>>#useChangeSetNamed:during: @11 line 9

MCPackageLoader>>#useNewChangeSetNamedLike:during: @3 line 2

MCPackageLoader>>#loadWithNameLike: @7 line 4

MCVersionLoader>>#load @12 line 6

MCVersionLoader class>>#loadVersion: @3 line 4

MCVersion>>#load @2 line 2

JadeServer64bit (JadeServer)>>#mcVersionLoad:from:autoMigrate: @7 line 8

 

 

 

De: [hidden email] [mailto:[hidden email]] En nombre de Dale Henrichs
Enviado el: Sunday, April 17, 2011 1:15 PM
Para: GemStone Seaside beta discussion
Asunto: Re: [GS/SS Beta] Smalltalk Parser in GS

 

 

On Apr 16, 2011, at 1:34 PM, Smalltalk wrote:

 

Hi all,

 

I can not find a parser inside GemStone/S to parse some string, like:

 

SmalltalkParser parseExpression: ‘numberOfTickets >= 1500’.

 

Anyone has used a Smalltalk parser inside GS ?

 

Regards,

Bruno

 

 

Bruno,

 

Check out AST-Core-DaleHenrichs.84.mcz in:


  http://seaside.gemstone.com/ss/rb

 

It's a port of RBParser to GemStone that I used to parse Smalltalk methods to get the senders and global refs for Bibliocello ...

 

Dale 

 

Reply | Threaded
Open this post in threaded view
|

Re: Smalltalk Parser in GS

Dale Henrichs
In reply to this post by BrunoBB
<base href="x-msg://731/">Hmmm,

You are using Seaside2.8...and presumably an older version of GLASS, I should have provided more caveats:)

The configuration for the RefactoringBrowser project is on SqueakSource:

  Gofer new
    squeaksource: 'MetacelloRepository';
    package: 'ConfigurationOfRefactoringBrowser';
    load.

  ((Smalltalk at: #ConfigurationOfRefactoringBrowser) project version: '1.5') load

would be the official way to load the package...

But, you may need to upgrade GLASS (depending upon what version you are using) or port the AST code to the older version of GLASS ... 

If you tell me which version of GLASS you are using from the annotation pane in the GemTools Launcher I'll take a crack at the port tomorrow, since I don't think it should be that hard and I've got easy access to the later versions of GLASS to find the missing methods ...

Dale


On Apr 17, 2011, at 11:02 AM, Smalltalk wrote:

Dale,
 
Thanks very much.
 
My Seaside version: “Seaside2.8g1-dkh.602.mcz 08/12/08 09:43:27“.
 
I tried to install AST-Core version: DaleHenrichs.84 but I get this error:
(Character>>allCharacters method does not exist)
 
MessageNotUnderstood (ExceptionA)>>#defaultAction @6 line 7
MessageNotUnderstood (Error)>>#defaultAction @2 line 7
MessageNotUnderstood>>#defaultAction @2 line 7
MessageNotUnderstood (ExceptionA)>>#doResignal @9 line 9
ExceptionHandler>>#caughtException @4 line 5
ExceptionHandler>>#caughtEx:number:cat:args: @16 line 19
[] in ExceptionHandler>>#try:on:in:do: @9 line 9
Exception>>#_signal:number:args: @2 line 7
System class>>#signal:args:signalDictionary: @5 line 13
Character class (Object)>>#doesNotUnderstand: @6 line 14
Character class (Object)>>#_doesNotUnderstand: @1 line 6
RBScanner class>>#initializeClassificationTable @5 line 5
RBScanner class>>#initialize @1 line 2
MCMethodDefinition>>#postload @5 line 2
MCMethodDefinition (MCDefinition)>>#postloadOver: @1 line 2
[] in MCPackageLoader>>#basicLoad @20 line 7
OrderedCollection (Collection)>>#do: @5 line 10
OrderedCollection (SequenceableCollection)>>#do:displayingProgress: @1 line 3
[] in MCPackageLoader>>#basicLoad @21 line 7
ExceptionHandler>>#try:on:in:do: @13 line 13
InMidstOfFileinNotification class (ExceptionA class)>>#try:on:do: @2 line 4
[] in ExecutableBlock>>#on:do: @2 line 8
[] in MCPackageLoader>>#basicLoad @24 line 8
[] in ExecutableBlock>>#ensure: @4 line 11
[] in ExecutableBlock>>#ensure: @6 line 11
MCPackageLoader>>#basicLoad @27 line 10
[] in MCPackageLoader>>#loadWithNameLike: @6 line 4
[] in MCPackageLoader>>#useChangeSetNamed:during: @8 line 9
[] in ExecutableBlock>>#ensure: @4 line 11
[] in ExecutableBlock>>#ensure: @6 line 11
MCPackageLoader>>#useChangeSetNamed:during: @11 line 9
MCPackageLoader>>#useNewChangeSetNamedLike:during: @3 line 2
MCPackageLoader>>#loadWithNameLike: @7 line 4
MCVersionLoader>>#load @12 line 6
MCVersionLoader class>>#loadVersion: @3 line 4
MCVersion>>#load @2 line 2
JadeServer64bit (JadeServer)>>#mcVersionLoad:from:autoMigrate: @7 line 8
 
 
 
De: [hidden email] [mailto:[hidden email]] En nombre de Dale Henrichs
Enviado el: Sunday, April 17, 2011 1:15 PM
Para: GemStone Seaside beta discussion
Asunto: Re: [GS/SS Beta] Smalltalk Parser in GS
 
 
On Apr 16, 2011, at 1:34 PM, Smalltalk wrote:


Hi all,
 
I can not find a parser inside GemStone/S to parse some string, like:
 
SmalltalkParser parseExpression: ‘numberOfTickets >= 1500’.
 
Anyone has used a Smalltalk parser inside GS ?
 
Regards,
Bruno
 
 
Bruno,
 
Check out AST-Core-DaleHenrichs.84.mcz in:
 
It's a port of RBParser to GemStone that I used to parse Smalltalk methods to get the senders and global refs for Bibliocello ...
 
Dale 

 


Reply | Threaded
Open this post in threaded view
|

Re: Smalltalk Parser in GS

Dale Henrichs
In reply to this post by BrunoBB
<base href="x-msg://731/">Bruno,

Ah good, you are moving forward with the port ... You should be able to load GemStone-ANSI-Streams-DaleHenrichs.1.mcz (the two extension methods are for tests, so you can safely ignore them)

Dale

On Apr 17, 2011, at 11:31 AM, Smalltalk wrote:

Dale,
 
The package loaded but now I have AnsiWriteStream class missing.
 
I think your package is for GemStone 3.0 (I have GemStone 2.3 from the Virtual Appliance).
 
I think this is the problem.
 
Regards,
Bruno
 
 
De: [hidden email] [mailto:[hidden email]] En nombre de Smalltalk
Enviado el: Sunday, April 17, 2011 3:25 PM
Para: 'GemStone Seaside beta discussion'
Asunto: Re: [GS/SS Beta] Smalltalk Parser in GS
 
Dale,
 
I have copied two definitions from Pharo (I use a Dolphin Smalltalk client to program GemStone/S):
Character
allCharacters
                "This name is obsolete since only the characters that will fit in a byte can be queried"
                ^self allByteCharacters
 
allByteCharacters
                "Answer all the characters that can be encoded in a byte"
                ^ (0 to: 255) collect: [:v | Character value: v]
 
It loaded. Now I going to test it.
 
Regards,
Bruno
 
 
De: [hidden email] [mailto:[hidden email]] En nombre de Smalltalk
Enviado el: Sunday, April 17, 2011 3:03 PM
Para: 'GemStone Seaside beta discussion'
Asunto: Re: [GS/SS Beta] Smalltalk Parser in GS
 
Dale,
 
Thanks very much.
 
My Seaside version: “Seaside2.8g1-dkh.602.mcz 08/12/08 09:43:27“.
 
I tried to install AST-Core version: DaleHenrichs.84 but I get this error:
(Character>>allCharacters method does not exist)
 
MessageNotUnderstood (ExceptionA)>>#defaultAction @6 line 7
MessageNotUnderstood (Error)>>#defaultAction @2 line 7
MessageNotUnderstood>>#defaultAction @2 line 7
MessageNotUnderstood (ExceptionA)>>#doResignal @9 line 9
ExceptionHandler>>#caughtException @4 line 5
ExceptionHandler>>#caughtEx:number:cat:args: @16 line 19
[] in ExceptionHandler>>#try:on:in:do: @9 line 9
Exception>>#_signal:number:args: @2 line 7
System class>>#signal:args:signalDictionary: @5 line 13
Character class (Object)>>#doesNotUnderstand: @6 line 14
Character class (Object)>>#_doesNotUnderstand: @1 line 6
RBScanner class>>#initializeClassificationTable @5 line 5
RBScanner class>>#initialize @1 line 2
MCMethodDefinition>>#postload @5 line 2
MCMethodDefinition (MCDefinition)>>#postloadOver: @1 line 2
[] in MCPackageLoader>>#basicLoad @20 line 7
OrderedCollection (Collection)>>#do: @5 line 10
OrderedCollection (SequenceableCollection)>>#do:displayingProgress: @1 line 3
[] in MCPackageLoader>>#basicLoad @21 line 7
ExceptionHandler>>#try:on:in:do: @13 line 13
InMidstOfFileinNotification class (ExceptionA class)>>#try:on:do: @2 line 4
[] in ExecutableBlock>>#on:do: @2 line 8
[] in MCPackageLoader>>#basicLoad @24 line 8
[] in ExecutableBlock>>#ensure: @4 line 11
[] in ExecutableBlock>>#ensure: @6 line 11
MCPackageLoader>>#basicLoad @27 line 10
[] in MCPackageLoader>>#loadWithNameLike: @6 line 4
[] in MCPackageLoader>>#useChangeSetNamed:during: @8 line 9
[] in ExecutableBlock>>#ensure: @4 line 11
[] in ExecutableBlock>>#ensure: @6 line 11
MCPackageLoader>>#useChangeSetNamed:during: @11 line 9
MCPackageLoader>>#useNewChangeSetNamedLike:during: @3 line 2
MCPackageLoader>>#loadWithNameLike: @7 line 4
MCVersionLoader>>#load @12 line 6
MCVersionLoader class>>#loadVersion: @3 line 4
MCVersion>>#load @2 line 2
JadeServer64bit (JadeServer)>>#mcVersionLoad:from:autoMigrate: @7 line 8
 
 
 
De: [hidden email] [mailto:[hidden email]] En nombre de Dale Henrichs
Enviado el: Sunday, April 17, 2011 1:15 PM
Para: GemStone Seaside beta discussion
Asunto: Re: [GS/SS Beta] Smalltalk Parser in GS
 
 
On Apr 16, 2011, at 1:34 PM, Smalltalk wrote:

 

Hi all,
 
I can not find a parser inside GemStone/S to parse some string, like:
 
SmalltalkParser parseExpression: ‘numberOfTickets >= 1500’.
 
Anyone has used a Smalltalk parser inside GS ?
 
Regards,
Bruno
 
 
Bruno,
 
Check out AST-Core-DaleHenrichs.84.mcz in:
 
It's a port of RBParser to GemStone that I used to parse Smalltalk methods to get the senders and global refs for Bibliocello ...
 
Dale