Re: [Pharo-users] Fast drag option, not really fast

2017-03-28 Thread Stephan Eggermont

On 28/03/17 15:20, Hilaire wrote:

Even over LAN X11 exported display, the fast drag option is slow.
Obvisouly graphic translucent operations can't be fast.


You are using a compression protocol for X11 communication, I assume?

Stephan





Re: [Pharo-users] Fast drag option, not really fast

2017-03-28 Thread Hilaire
In the other hand it is likely the Pharo image does know about drawing
operations on a remote X server, and it may just result in bitmap buffer
transfers to repair damaged areas... Neverthless, the damaged area is
still smaller when dragging with only line outlines.

Le 28/03/2017 à 15:20, Hilaire a écrit :
> Hi,
> 
> Will it be possible to have the really *fast* drag option back as we had
> in old time and does in Squeak?
> 
> Even over LAN X11 exported display, the fast drag option is slow.
> Obvisouly graphic translucent operations can't be fast.
> 
> As far as I can rewind, fast drag is slow since at least Pharo3

-- 
Dr. Geo
http://drgeo.eu




[Pharo-users] FileSystemDirectoryEntry>>#size may be wrong/misleading for symLinks

2017-03-28 Thread PAUL DEBRUICKER
This is on Pharo 5, on a mac.


It reports the size of the symlink and not the linked file.  So when I'd expect 
a size around 70kB its reporting 51B.  



Is there a way to get the size of the linked file?  



doing a 'reference contents size' isn't giving me the correct size either.  In 
some cases it is off by hundreds of bytes.  

Thanks

Paul


Re: [Pharo-users] diff'ing with metacello

2017-03-28 Thread Siemen Baader


Sent from my iPhone

On 28/03/2017, at 14.56, Ben Coman  wrote:

> Can you provide a concrete case of two versions you want to compare?
> cheers -ben
> 
Sure! I'm away from the computer but will post one ASAP!

> On Tue, Mar 28, 2017 at 8:51 PM, Siemen Baader  wrote:
>> 
>> 
>> Sent from my iPhone
>> 
>> On 28/03/2017, at 13.52, Ben Coman  wrote:
>> 
>>> Do you mean the difference between two "ConfigurationXXXmcz" files?
>> 
>> I didn't know there were 'ConfigurationOfX.mcz' files. What do they contain?
>> 
>> What I want to see is what code has changed between two releases. In Git I 
>> would do it with a diff of the two releases' checksums. In other words, I 
>> want to see for releases described with metacello what the
>> Monticello browser can show us for versions of packages. Does this make 
>> sense? It seems like a very common use case to me, people must be doing it 
>> all the time, or...?
>> 
>> cheers,
>> Siemen
>> 
>> 
>>> As a workaround, perhaps load one and then from Monticello,
>>> "start" to merge the other from Monticello and you will see a diff between 
>>> them.
>>> 
>>> cheers -ben
>>> 
>>> On Tue, Mar 28, 2017 at 7:06 PM, Siemen Baader  
>>> wrote:
 Hi all,
 
 is there a tool to diff two Metacello versions with different baselines? I
 tried MetacelloBrowser
 (http://www.squeaksource.com/@6xz1bzmNF75EduBA/vZ263dVA) but it does not
 install on Pharo 5.0.
 
 I need it to see what has changed when I install a new release of PharoJS
 and to bisect in search for regressions.
 
 thanks,
 Siemen
> 



[Pharo-users] Fast drag option, not really fast

2017-03-28 Thread Hilaire
Hi,

Will it be possible to have the really *fast* drag option back as we had
in old time and does in Squeak?

Even over LAN X11 exported display, the fast drag option is slow.
Obvisouly graphic translucent operations can't be fast.

As far as I can rewind, fast drag is slow since at least Pharo3

Hilaire

-- 
Dr. Geo
http://drgeo.eu




Re: [Pharo-users] SSL Exception on running the first example of Live Object Programming mooc

2017-03-28 Thread Ahdach Mohamed
Thanks to Both of you.
M

On 28 March 2017 at 12:39, Sven Van Caekenberghe  wrote:

>
> > On 28 Mar 2017, at 11:36, Esteban Lorenzano  wrote:
> >
> > Hi,
> >
> > I hope your journey will be cool!
> >
> >> On 28 Mar 2017, at 11:28, Ahdach Mohamed  wrote:
> >>
> >> Hi All,
> >>
> >> Newbie to Pharo (48 hours). I'm going through the excellent mooc by
> Stephane D. and his team.
> >>
> >> I've installed Pharo and run into an error when trying to run my second
> expression.
> >>
> >> Here it is:
> >>
> >> (ZnEasy getPng:'http://pharo.org/web/files/pharo.png') asMorph
> openInWindow
> >>
> >> And I have the following error: "SSL Exception: connect failed".
> >>
> >> What am I missing?
> >>
> >
> > there is nothing missing.
> > Currently we have a problem in our web site (that uses a non-supported
> encrypt method), we are going to fix it soon, but for now please use this
> alternative:
> >
> > (ZnEasy getPng:'http://files.pharo.org/media/logo/logo-flat-small.png')
> asMorph openInWindow.
>
> Or this alternative (lose the 'web' part):
>
> (ZnEasy getPng:'http://pharo.org/files/pharo.png') asMorph openInWindow
>
> > cheers!
> > Esteban
> >
> >> Mohamed
> >>
>
>
>


Re: [Pharo-users] diff'ing with metacello

2017-03-28 Thread Ben Coman
Can you provide a concrete case of two versions you want to compare?
cheers -ben

On Tue, Mar 28, 2017 at 8:51 PM, Siemen Baader  wrote:
>
>
> Sent from my iPhone
>
> On 28/03/2017, at 13.52, Ben Coman  wrote:
>
>> Do you mean the difference between two "ConfigurationXXXmcz" files?
>
> I didn't know there were 'ConfigurationOfX.mcz' files. What do they contain?
>
> What I want to see is what code has changed between two releases. In Git I 
> would do it with a diff of the two releases' checksums. In other words, I 
> want to see for releases described with metacello what the
> Monticello browser can show us for versions of packages. Does this make 
> sense? It seems like a very common use case to me, people must be doing it 
> all the time, or...?
>
> cheers,
> Siemen
>
>
>> As a workaround, perhaps load one and then from Monticello,
>> "start" to merge the other from Monticello and you will see a diff between 
>> them.
>>
>> cheers -ben
>>
>> On Tue, Mar 28, 2017 at 7:06 PM, Siemen Baader  
>> wrote:
>>> Hi all,
>>>
>>> is there a tool to diff two Metacello versions with different baselines? I
>>> tried MetacelloBrowser
>>> (http://www.squeaksource.com/@6xz1bzmNF75EduBA/vZ263dVA) but it does not
>>> install on Pharo 5.0.
>>>
>>> I need it to see what has changed when I install a new release of PharoJS
>>> and to bisect in search for regressions.
>>>
>>> thanks,
>>> Siemen
>>
>



Re: [Pharo-users] diff'ing with metacello

2017-03-28 Thread Siemen Baader


Sent from my iPhone

On 28/03/2017, at 13.52, Ben Coman  wrote:

> Do you mean the difference between two "ConfigurationXXXmcz" files?

I didn't know there were 'ConfigurationOfX.mcz' files. What do they contain? 

What I want to see is what code has changed between two releases. In Git I 
would do it with a diff of the two releases' checksums. In other words, I want 
to see for releases described with metacello what the
Monticello browser can show us for versions of packages. Does this make sense? 
It seems like a very common use case to me, people must be doing it all the 
time, or...?

cheers,
Siemen


> As a workaround, perhaps load one and then from Monticello,
> "start" to merge the other from Monticello and you will see a diff between 
> them.
> 
> cheers -ben
> 
> On Tue, Mar 28, 2017 at 7:06 PM, Siemen Baader  wrote:
>> Hi all,
>> 
>> is there a tool to diff two Metacello versions with different baselines? I
>> tried MetacelloBrowser
>> (http://www.squeaksource.com/@6xz1bzmNF75EduBA/vZ263dVA) but it does not
>> install on Pharo 5.0.
>> 
>> I need it to see what has changed when I install a new release of PharoJS
>> and to bisect in search for regressions.
>> 
>> thanks,
>> Siemen
> 



Re: [Pharo-users] diff'ing with metacello

2017-03-28 Thread Ben Coman
Do you mean the difference between two "ConfigurationXXXmcz" files?
As a workaround, perhaps load one and then from Monticello,
"start" to merge the other from Monticello and you will see a diff between them.

cheers -ben

On Tue, Mar 28, 2017 at 7:06 PM, Siemen Baader  wrote:
> Hi all,
>
> is there a tool to diff two Metacello versions with different baselines? I
> tried MetacelloBrowser
> (http://www.squeaksource.com/@6xz1bzmNF75EduBA/vZ263dVA) but it does not
> install on Pharo 5.0.
>
> I need it to see what has changed when I install a new release of PharoJS
> and to bisect in search for regressions.
>
> thanks,
> Siemen



[Pharo-users] meaning of orange losange beside a protocol

2017-03-28 Thread Ahdach Mohamed
Hi,

Whats the meaning of an orange losange at the left of a protocol, actually
initialization

Is there a list of the meanings of the icons one sees at the left of
packages, classes, protocols and methods?

Mohamed


[Pharo-users] diff'ing with metacello

2017-03-28 Thread Siemen Baader
Hi all,

is there a tool to diff two Metacello versions with different baselines? I
tried MetacelloBrowser (
http://www.squeaksource.com/@6xz1bzmNF75EduBA/vZ263dVA) but it does not
install on Pharo 5.0.

I need it to see what has changed when I install a new release of PharoJS
and to bisect in search for regressions.

thanks,
Siemen


Re: [Pharo-users] SSL Exception on running the first example of Live Object Programming mooc

2017-03-28 Thread Sven Van Caekenberghe

> On 28 Mar 2017, at 11:36, Esteban Lorenzano  wrote:
> 
> Hi,
> 
> I hope your journey will be cool!
> 
>> On 28 Mar 2017, at 11:28, Ahdach Mohamed  wrote:
>> 
>> Hi All,
>> 
>> Newbie to Pharo (48 hours). I'm going through the excellent mooc by Stephane 
>> D. and his team.
>> 
>> I've installed Pharo and run into an error when trying to run my second 
>> expression.
>> 
>> Here it is:
>> 
>> (ZnEasy getPng:'http://pharo.org/web/files/pharo.png') asMorph openInWindow
>> 
>> And I have the following error: "SSL Exception: connect failed".
>> 
>> What am I missing?
>> 
> 
> there is nothing missing.
> Currently we have a problem in our web site (that uses a non-supported 
> encrypt method), we are going to fix it soon, but for now please use this 
> alternative: 
> 
> (ZnEasy getPng:'http://files.pharo.org/media/logo/logo-flat-small.png') 
> asMorph openInWindow.

Or this alternative (lose the 'web' part):

(ZnEasy getPng:'http://pharo.org/files/pharo.png') asMorph openInWindow

> cheers!
> Esteban
> 
>> Mohamed
>> 




Re: [Pharo-users] loading petitParser

2017-03-28 Thread Stephane Ducasse
I will update the book
because this pointer does not work either

http://www.themoosebook.org/book/internals/petit-parser

On Tue, Mar 28, 2017 at 11:48 AM, Christophe Demarey <
christophe.dema...@inria.fr> wrote:

> yes because the current way to load projects is:
>
> Metacello new
>   configuration: 'PetitParser';
>   smalltalkhubUser: 'Moose' project: 'PetitParser';
>   load.
>
> if you want to load a specific group, you should use the #load: message
> (current groups are Core, Tests, Parser and  ParserIDE). Default will load
> all.
>
> Le 28 mars 2017 à 10:02, Stephane Ducasse  a
> écrit :
>
> Hi
>
> in the deep into pharo book it is written
>
> Gofer new
>
> smalltalkhubUser: 'Moose' project: 'PetitParser'; package:
> 'ConfigurationOfPetitParser';
>
> load.
>
> (Smalltalk at: #ConfigurationOfPetitParser) perform: #loadDefault
>
>
> But this is not correct. There is no loadDefault.
>
> Should I change it?
>
>
> Stef
>
>
>


Re: [Pharo-users] Smacc debugger

2017-03-28 Thread Thierry Goubier

Le 28/03/2017 à 11:50, Stephane Ducasse a écrit :

OK
I loaded Smacc from github as mentioned by thierry.

Metacello new
 baseline: 'SmaCC';
 repository: 'github://ThierryGoubier/SmaCC';
 load

Are there two configurationOfSmacc?
May be we should only have one no?

I have the impression that even thierry and jason working heavily with
Smacc do not know that.


I know there are two configurations of SmaCC. I told you, probably two 
days ago, that some syntax extensions for grammars may only be supported 
on one of those.



And we should not force them to use Moose. At least we do not have to win
anything with it.


Thierry


Stef

On Mon, Mar 27, 2017 at 6:31 PM, Tudor Girba > wrote:

They come with the ConfigurationOfSmaCC which is already in the
Moose image.

Doru


> On Mar 27, 2017, at 4:52 PM, Stephane Ducasse
> wrote:
>
> Hi
>
> where can I load the Smacc gt extension and debugger extensions?
>
> Stef

--
www.tudorgirba.com 
www.feenk.com 

"Speaking louder won't make the point worthier."








Re: [Pharo-users] Smacc debugger

2017-03-28 Thread Stephane Ducasse
OK
I loaded Smacc from github as mentioned by thierry.

Metacello new
 baseline: 'SmaCC';
 repository: 'github://ThierryGoubier/SmaCC';
 load

Are there two configurationOfSmacc?
May be we should only have one no?

I have the impression that even thierry and jason working heavily with
Smacc do not know that.
And we should not force them to use Moose. At least we do not have to win
anything with it.

Stef

On Mon, Mar 27, 2017 at 6:31 PM, Tudor Girba  wrote:

> They come with the ConfigurationOfSmaCC which is already in the Moose
> image.
>
> Doru
>
>
> > On Mar 27, 2017, at 4:52 PM, Stephane Ducasse 
> wrote:
> >
> > Hi
> >
> > where can I load the Smacc gt extension and debugger extensions?
> >
> > Stef
>
> --
> www.tudorgirba.com
> www.feenk.com
>
> "Speaking louder won't make the point worthier."
>
>
>


Re: [Pharo-users] loading petitParser

2017-03-28 Thread Christophe Demarey
yes because the current way to load projects is:

Metacello new
  configuration: 'PetitParser';
  smalltalkhubUser: 'Moose' project: 'PetitParser';
  load.

if you want to load a specific group, you should use the #load: message 
(current groups are Core, Tests, Parser and  ParserIDE). Default will load all.

> Le 28 mars 2017 à 10:02, Stephane Ducasse  a écrit :
> 
> Hi 
> 
> in the deep into pharo book it is written
> 
> Gofer new
> 
> smalltalkhubUser: 'Moose' project: 'PetitParser'; package: 
> 'ConfigurationOfPetitParser';
> 
> load.
> 
> (Smalltalk at: #ConfigurationOfPetitParser) perform: #loadDefault
> 
> 
> 
> But this is not correct. There is no loadDefault. 
> 
> Should I change it? 
> 
> 
> 
> Stef
> 



Re: [Pharo-users] SSL Exception on running the first example of Live Object Programming mooc

2017-03-28 Thread Esteban Lorenzano
Hi,

I hope your journey will be cool!

> On 28 Mar 2017, at 11:28, Ahdach Mohamed  wrote:
> 
> Hi All,
> 
> Newbie to Pharo (48 hours). I'm going through the excellent mooc by Stephane 
> D. and his team.
> 
> I've installed Pharo and run into an error when trying to run my second 
> expression.
> 
> Here it is:
> 
> (ZnEasy getPng:'http://pharo.org/web/files/pharo.png 
> ') asMorph openInWindow
> 
> And I have the following error: "SSL Exception: connect failed".
> 
> What am I missing?
> 

there is nothing missing.
Currently we have a problem in our web site (that uses a non-supported encrypt 
method), we are going to fix it soon, but for now please use this alternative: 

(ZnEasy getPng:'http://files.pharo.org/media/logo/logo-flat-small.png') asMorph 
openInWindow.

cheers!
Esteban

> Mohamed
> 



[Pharo-users] SSL Exception on running the first example of Live Object Programming mooc

2017-03-28 Thread Ahdach Mohamed
Hi All,

Newbie to Pharo (48 hours). I'm going through the excellent mooc by
Stephane D. and his team.

I've installed Pharo and run into an error when trying to run my second
expression.

Here it is:

(ZnEasy getPng:'http://pharo.org/web/files/pharo.png') asMorph openInWindow

And I have the following error: "SSL Exception: connect failed".

What am I missing?

Mohamed


[Pharo-users] loading petitParser

2017-03-28 Thread Stephane Ducasse
Hi

in the deep into pharo book it is written

Gofer new

smalltalkhubUser: 'Moose' project: 'PetitParser'; package:
'ConfigurationOfPetitParser';

load.

(Smalltalk at: #ConfigurationOfPetitParser) perform: #loadDefault


But this is not correct. There is no loadDefault.

Should I change it?


Stef


Re: [Pharo-users] Smacc question

2017-03-28 Thread Stephane Ducasse
I’m puzzled. I have the same rules in two grammars one parse a sequence and
the other not.

self parse: ‘payable internal'

_FunctionTypeNameOptions
:
| FunctionTypeNameOptions
;
FunctionTypeNameOptions
: FunctionTypeNameOption 'option' {{}}
| FunctionTypeNameOptions FunctionTypeNameOption 'option' {{}}
;
FunctionTypeNameOption
:  "internal" 'token' {{FunctionOption}}
|  "external" 'token' {{FunctionOption}}
|  "constant" 'token' {{FunctionOption}}
|  "payable" 'token' {{FunctionOption}}
;


In the following grammar it parses well sequence

%glr;
%prefix Sol ;
%suffix Node ;
%root TypeName ;

 : \s+;
%root Object;
%prefix  FO;

_FunctionTypeNameOptions
:
| FunctionTypeNameOptions
;
FunctionTypeNameOptions
: FunctionTypeNameOption 'option' {{}}
| FunctionTypeNameOptions FunctionTypeNameOption 'option' {{}}
;
FunctionTypeNameOption
:  "internal" 'token' {{FunctionOption}}
|  "external" 'token' {{FunctionOption}}
|  "constant" 'token' {{FunctionOption}}
|  "payable" 'token' {{FunctionOption}}
;

In this one not (note that it is not connected to the rest yet) and that I
use the start directive to test incrementally.

%glr;
%prefix Sol ;
%suffix Node ;
%root TypeName ;

%start TypeName FunctionTypeName _FunctionTypeNameOptions
FunctionTypeNameOptions;

: \r
| \n
| \r\n
;

: \s+
;


: \/\/\/ [^\r\n]*
| \/\/ [^\r\n]*
  ;

: [a-zA-Z_$] [a-zA-Z0-9_$]*
;

# UserDefinedTypeName = Identifier ( '.' Identifier )*


:  ( .  )*
;

: [0-9]+
;
###
#TypeNameList = '(' ( TypeName (',' TypeName )* )? ')'
ParenthesizedTypeNameList
: "(" TypeNameList_Opt ")"
;

# return nil when empty
TypeNameList_Opt
:
| TypeNameList
;
TypeNameList
: TypeName 'typename' {{}}
| TypeNameList "," TypeName 'typename' {{}}
;
###
#TypeName = ElementaryTypeName
#| UserDefinedTypeName
#| Mapping
#| ArrayTypeName
#| FunctionTypeName

TypeName
: 
| ElementaryTypeName
| Mapping
| ArrayTypeName
;

# Mapping = 'mapping' '(' ElementaryTypeName '=>' TypeName ')'
Mapping
: "mapping" "(" ElementaryTypeName 'from' "=>" TypeName 'to' ")" {{Mapping}}
;

#ArrayTypeName = TypeName '[' Expression? ']'
# for now we will do ArrayTypeName = TypeName '[' PrimaryExpression? ']'
ArrayTypeName
: TypeName 'typeName' "["  "]" {{ArrayTypeName}}
| TypeName 'typeName' "[" PrimaryExpression 'expression' "]"
{{ArrayTypeName}}
;


#FunctionTypeName = 'function' TypeNameList ( 'internal' | 'external' |
'constant' | 'payable' )* ( 'returns' TypeNameList )?

#FunctionTypeName
# : "function" TypeNameList 'typenameList' ( "internal" | "external" |
"constant" | "payable" )* 'kind'
# | "function" TypeNameList 'typenameList' ( "internal" | "external" |
"constant" | "payable" )* ( "returns" TypeNameList returnTypeList )?
{{FunctionTypeName}}
# ;


#FunctionTypeNameOptions
# : {{}}
# |  FunctionTypeNameOptions "internal" 'option' {{}}
# |  FunctionTypeNameOptions "external" 'option' {{}}
# |  FunctionTypeNameOptions "constant" 'option' {{}}
# |  FunctionTypeNameOptions "payable" 'option' {{}}
# ;

_FunctionTypeNameOptions
:
| FunctionTypeNameOptions
;

FunctionTypeNameOptions
: FunctionTypeNameOption 'option' {{}}
| FunctionTypeNameOptions FunctionTypeNameOption 'option' {{}}
;
FunctionTypeNameOption
:  "internal" 'token' {{FunctionOption}}
|  "external" 'token' {{FunctionOption}}
|  "constant" 'token' {{FunctionOption}}
|  "payable" 'token' {{FunctionOption}}
;



# To complete later. Basically copy and paste all the variations

PrimaryExpression
: ElementaryTypeNameExpression
;
ElementaryTypeNameExpression
: ElementaryTypeName  'type' {{Type}}
;
ElementaryTypeName
: "address" | "bool" | "string" | "var" | Int | Uint | Byte | Fixed |
Ufixed
;

Int
: "int" | "int8" | "int16"
  ;
Uint
: "uint" | "uint8" | "uint16"
;
Byte
: "byte" | "bytes"
;
Fixed
: "fixed" | "fixed0x8"
;
UFixed
: "ufixed" | "ufixed0x8"
;
















Stéphane Ducasse
http://stephane.ducasse.free.fr
http://www.synectique.eu / http://www.pharo.org
03 59 35 87 52
Assistant: Julie Jonas
FAX 03 59 57 78 50
TEL 03 59 35 86 16
S. Ducasse - Inria
40, avenue Halley,
Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
Villeneuve d'Ascq 59650
France


On Tue, Mar 28, 2017 at 8:28 AM, Stephane Ducasse 
wrote:

> I’m puzzled. I have the same rules in two grammars one parse a sequence
> and the other not.
>
>
> self parse: ‘payable internal'
>
>
> _FunctionTypeNameOptions
>
> :
>
> | FunctionTypeNameOptions
>
> ;
>
> FunctionTypeNameOptions
>
> : FunctionTypeNameOption 'option' {{}}
>
> | FunctionTypeNameOptions FunctionTypeNameOption 'option' {{}}
>
> ;
>
> FunctionTypeNameOption
>
> :  "internal" 'token' {{FunctionOption}}
>
> |  "external" 'token' {{FunctionOption}}
>
> |  "constant" 'token' {{FunctionOption}}
>
> |  

Re: [Pharo-users] Smacc question

2017-03-28 Thread Stephane Ducasse
I’m puzzled. I have the same rules in two grammars one parse a sequence and
the other not.


self parse: ‘payable internal'


_FunctionTypeNameOptions

:

| FunctionTypeNameOptions

;

FunctionTypeNameOptions

: FunctionTypeNameOption 'option' {{}}

| FunctionTypeNameOptions FunctionTypeNameOption 'option' {{}}

;

FunctionTypeNameOption

:  "internal" 'token' {{FunctionOption}}

|  "external" 'token' {{FunctionOption}}

|  "constant" 'token' {{FunctionOption}}

|  "payable" 'token' {{FunctionOption}}

;



In the following grammar it parses well sequence


%glr;

%prefix Sol ;

%suffix Node ;

%root TypeName ;


 : \s+;

%root Object;

%prefix  FO;


_FunctionTypeNameOptions

:

| FunctionTypeNameOptions

;

FunctionTypeNameOptions

: FunctionTypeNameOption 'option' {{}}

| FunctionTypeNameOptions FunctionTypeNameOption 'option' {{}}

;

FunctionTypeNameOption

:  "internal" 'token' {{FunctionOption}}

|  "external" 'token' {{FunctionOption}}

|  "constant" 'token' {{FunctionOption}}

|  "payable" 'token' {{FunctionOption}}

;


In this one not (note that it is not connected to the rest yet) and that I
use the start directive to test incrementally.


%glr;

%prefix Sol ;

%suffix Node ;

%root TypeName ;


%start TypeName FunctionTypeName _FunctionTypeNameOptions
FunctionTypeNameOptions;



: \r

| \n

| \r\n

;



: \s+

;




: \/\/\/ [^\r\n]*

| \/\/ [^\r\n]*

  ;



: [a-zA-Z_$] [a-zA-Z0-9_$]*

;


# UserDefinedTypeName = Identifier ( '.' Identifier )*




:  ( .  )*

;



: [0-9]+

;

###

#TypeNameList = '(' ( TypeName (',' TypeName )* )? ')'

ParenthesizedTypeNameList

: "(" TypeNameList_Opt ")"

;


# return nil when empty

TypeNameList_Opt

:

| TypeNameList

;

TypeNameList

: TypeName 'typename' {{}}

| TypeNameList "," TypeName 'typename' {{}}

;

###

#TypeName = ElementaryTypeName

#| UserDefinedTypeName

#| Mapping

#| ArrayTypeName

#| FunctionTypeName


TypeName

: 

| ElementaryTypeName

| Mapping

| ArrayTypeName

;


# Mapping = 'mapping' '(' ElementaryTypeName '=>' TypeName ')'

Mapping

: "mapping" "(" ElementaryTypeName 'from' "=>" TypeName 'to' ")" {{Mapping}}

;


#ArrayTypeName = TypeName '[' Expression? ']'

# for now we will do ArrayTypeName = TypeName '[' PrimaryExpression? ']'

ArrayTypeName

: TypeName 'typeName' "["  "]" {{ArrayTypeName}}

| TypeName 'typeName' "[" PrimaryExpression 'expression' "]"
{{ArrayTypeName}}

;



#FunctionTypeName = 'function' TypeNameList ( 'internal' | 'external' |
'constant' | 'payable' )* ( 'returns' TypeNameList )?


#FunctionTypeName

# : "function" TypeNameList 'typenameList' ( "internal" | "external" |
"constant" | "payable" )* 'kind'

# | "function" TypeNameList 'typenameList' ( "internal" | "external" |
"constant" | "payable" )* ( "returns" TypeNameList returnTypeList )?
{{FunctionTypeName}}

# ;




#FunctionTypeNameOptions

# : {{}}

# |  FunctionTypeNameOptions "internal" 'option' {{}}

# |  FunctionTypeNameOptions "external" 'option' {{}}

# |  FunctionTypeNameOptions "constant" 'option' {{}}

# |  FunctionTypeNameOptions "payable" 'option' {{}}

# ;


_FunctionTypeNameOptions

:

| FunctionTypeNameOptions

;


FunctionTypeNameOptions

: FunctionTypeNameOption 'option' {{}}

| FunctionTypeNameOptions FunctionTypeNameOption 'option' {{}}

;

FunctionTypeNameOption

:  "internal" 'token' {{FunctionOption}}

|  "external" 'token' {{FunctionOption}}

|  "constant" 'token' {{FunctionOption}}

|  "payable" 'token' {{FunctionOption}}

;





# To complete later. Basically copy and paste all the variations


PrimaryExpression

: ElementaryTypeNameExpression

;

ElementaryTypeNameExpression

: ElementaryTypeName  'type' {{Type}}

;

ElementaryTypeName

: "address" | "bool" | "string" | "var" | Int | Uint | Byte | Fixed |
Ufixed

;


Int

: "int" | "int8" | "int16"

  ;

Uint

: "uint" | "uint8" | "uint16"

;

Byte

: "byte" | "bytes"

;

Fixed

: "fixed" | "fixed0x8"

;

UFixed

: "ufixed" | "ufixed0x8"

;


















Stéphane Ducasse

http://stephane.ducasse.free.fr

http://www.synectique.eu / http://www.pharo.org

03 59 35 87 52

Assistant: Julie Jonas

FAX 03 59 57 78 50

TEL 03 59 35 86 16

S. Ducasse - Inria

40, avenue Halley,

Parc Scientifique de la Haute Borne, Bât.A, Park Plaza

Villeneuve d'Ascq 59650

France

On Mon, Mar 27, 2017 at 9:37 PM, Thierry Goubier 
wrote:

> Le 27/03/2017 à 21:12, Stephane Ducasse a écrit :
>
>> what was strange is that this version
>>
>>  : \s+;
>>
>> %root MultiListObject;
>> %prefix XPML;
>> modifiers_opt
>> :
>> | modifiers
>> ;
>> modifiers
>> : modifier 'modifier' {{}}
>> | modifiers modifier 'modifier' {{}}
>> ;
>> modifier
>> : "public" 'token' {{Modifier}}
>> | "protected"