Hi,
Did you tried to inspect the PPFailure in the Moose? There is a tab with a
tree structure giving you a pretty good overview, what is going wrong... Or
as an alternative, one can call:
myParser enableDebug parse:myInput
Otherwise, PetitParser really needs some nice error reporting system. I
would have integrated one, but I am not aware of any suitable solution :(
Cheers,
Jan
On Fri, Jun 12, 2015 at 8:07 AM Francisco Garau <francisco.garau(a)gmail.com>
wrote:
>
> Hi Camile
>
> On 11 Jun 2015, at 10:47, Camille <camille.teruel(a)gmail.com> wrote:
>
>
> On 11 Jun 2015, at 09:30, Jan Kurš <kurs(a)iam.unibe.ch> wrote:
>
> That sounds really cool and useful extension.
>
> Thank you Jan!
>
> Regarding the furthest failure, the core of the problem is the distinction
> between an error and a failure. Error reports on a problem in the input,
> while failure is information for choice parser combinator. In general, the
> furthest failure is a better approximation of an error than the last
> failure, so we use it.
>
> I am not sure what exactly is the problem in case of PrattParser. I guess
> the last failure gives better results for a user?
>
> Yes, with furthest failure I get errors from tokenization instead of my
> errors.
> For exemple with the calculator grammar I gave in my first mail when I
> parse ‘1+’ the furthestFailure is ‘$- expected at 2’ whereas I return
> ‘expression expected at 2’ because there's a whole expression missing. Same
> thing with ‘(1+2’ that returns ‘digit expected at 4’ instead of ‘$)
> expected at 4’.
>
> But furthest failure gives wrong messages in other cases to.
> Consider this sequence parser:
>
> keyword := #letter asParser plus , $: asParser.
> keyword parse: ‘foo'
>
> This returns 'letter expected at 3’, but no matter how many letters I add
> to the end I’ll still get ‘letter expected’.
> I want to get what is really missing: '$: expected at 3’.
>
>
> Any of those error messages wouldn't be too bad if the failing production
> rule were also mentioned. Something like "keyword rule failed with xx
> expected at 3"
>
> But yeah, that would require annotating the production rules which can
> pollute the clarity of the grammar definition...
>
>
> Maybe returning the “latest furthest failure” instead of the “first
> furthest failure” could solves the problem here (i.e. replacing > with >=
> in PPContext>>#noteFailure:)?
>
> One has to consider a pratt parser included in the normal parser, e. g.
> Expressions parsed by pratt in a Java Grammar. Depending where an error
> occurs, different strategy for choosing the proper failure is necessary :-/
>
> Indeed, my hack (redefining #parseWithContext:) works only when the Pratt
> parser is the top parser, but a soon as I compose it I’m screwed because
> only parseOn: is sent to the Pratt parser.
> That’s why I wonder if letting the parser decide what to return wouldn’t
> solve the problem: by default the furthest failure but special parsers can
> still decide.
>
> Regarding tokenization, there is a message token, that returns
> PPTokenParser, which transforms a parsed input into the PPToken object.
> Perhaps this might be helpful?
>
> The Pratt tokens are special: a token points back to the parser that
> generated it (its “kind”).
> PPTokenKind subclasses PPFlatteningParser and generates instances of
> PPPrattToken.
> A PPTokenKind stores the precedence, the action to be executed when a
> token of this kind is met at the start of an expression (for terminals and
> prefixes) and the action to be executed when a token is met in the middle
> of an expression (for postfixes and infixes).
>
> Cheers,
> Camille
>
> Cheers Jan
>
> On Wed, Jun 10, 2015, 20:52 Richard Sargent <
> richard.sargent(a)gemtalksystems.com> wrote:
>
>> camille teruel wrote
>> >> On 10 Jun 2015, at 19:11, Chris Cunningham <
>>
>> > cunningham.cb@
>>
>> > > wrote:
>> >>
>> >> Inteteresting....
>> >>
>> >> On Wed, Jun 10, 2015 at 9:36 AM, Camille <
>>
>> > camille.teruel@
>>
>> > <mailto:
>>
>> > camille.teruel@
>>
>> > >> wrote:
>> >> Hello Pharoers and Moosers,
>> >>
>> >> I did a Pratt parser extension for PetitParser.
>> >>
>> >>
>> > <snip>
>> >
>> >> @PP Devs:
>> >> I had trouble with the PPContext furthestFailure that is taken into
>> >> account instead of the failures I return, so I had to redefine
>> >> #parseWithContext: to return the failures I want. The results given by
>> >> furthestFailure were not very meaningful in my case (the same is true
>> for
>> >> PPExpressionParser btw).
>> >> But I guess it was introduced because it gives good results in other
>> >> cases.
>> >> So would it be possible to change this behavior to let the parser
>> decide
>> >> if it returns the furthestFailure or the original failure?
>> >>
>> >> The intent behind the furthestFailure is that it give the failure that
>> >> gets the furthest into the source stream. It is most useful when there
>> >> are embedded choice operators in the parser - the original/pre furthest
>> >> behaviour would return the last failure, which depending on the
>> incoming
>> >> stream and the order of the choice options could be significantly not
>> >> useful.
>> >>
>> >> I ran into this when working with the sql parser, which started off
>> with
>> >> the outer choice of (by memory):
>> >> ^ selectStatement / insertStatement / updateStatement /
>> >> deleteStatement
>> >> If I was trying to part a select statement that had an error at the
>> very
>> >> end of the statement, the parser would return an error talking about
>> how
>> >> the incoming stream failed in deleteStatement. Not useful.
>> >>
>> >> I would be saddened if this further failure was not available.
>> >
>> > Yes in that case returning the furthest failure gives better results.
>> > However, this don’t give meaningful messages in all cases.
>> > For exemple with the calculator I gave in my previous message, if I
>> parse
>> > ‘1+’ I want to get ‘expression expected at: 2’ but instead it returns
>> ‘$-
>> > expected at 2'.
>> > I’m not proposing to remove this feature but to let parsers decide to
>> use
>> > it or not.
>> > Something like (changes in bold):
>> >
>> > PPParser>>parseWithContext: context
>> > | result |
>> > context initializeFor: self.
>> > result := self parseOn: context.
>> >
>> > "Return the furthest failure, it gives better results than the
>> last
>> > failure"
>> > (result isPetitFailure and: [ self wantsFurthestFailure and: [
>> context
>> > furthestFailure notNil ] ])
>> > ifTrue: [ ^ context furthestFailure ].
>> > ^ result
>>
>> This screams at me. Why not just delegate to the context and use a context
>> that returns the preferred failure? e.g. end with:
>> ^context preferredResultFor: result.
>>
>>
>> >
>> > PPParser>>wantsFurthestFailure
>> > ^ true
>> >
>> > Like this, one can return the failures he wants.
>> >
>> > PPPrattParser>>wantsFurthestFailure
>> > ^ false
>> >
>> >
>> > Camille
>> >
>> >>
>> >> -cbc
>>
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://forum.world.st/Pratt-Parsers-for-PetitParser-tp4831456p4831486.html
>> Sent from the Pharo Smalltalk Developers mailing list archive at
>> Nabble.com.
>>
>>
>
Hi All!
I have implemented a PetitMarkdown grammar for PetitParser according to the
CommonMark 0.19 specification (http://spec.commonmark.org/0.19/). The
current implementation can be loaded like this:
Gofer new
url: 'http://smalltalkhub.com/mc/JanKurs/PetitParser/main';
package: 'PetitMarkdown';
load.
The result of the parsing is AST, so I guess there is a possibility to
write a CommonMark -> Pilar AST transformation. I wrote the AST->HTML
visitor only.
CommonMark uses two pass strategy. The block elements are recognized in the
first phase and the inline elements in the second phase. My implementation
handles the first phase without any problems, there are some issues with
the priorities of inline elements and emphasis (I don't understand, why
more than 50% of the whole specification covers this). There are in total
550 example, the current implementation handles 420 of them so far. I guess
for the most users it handles more than enough,...
If anyone is interested in using it/fixing it/improving performance, I am
more than willing to help you. Some of the rules are pretty crazy, so I
guess it will take some time before we find best solutions.
Cheers,
Jan
That sounds really cool and useful extension.
Regarding the furthest failure, the core of the problem is the distinction
between an error and a failure. Error reports on a problem in the input,
while failure is information for choice parser combinator. In general, the
furthest failure is a better approximation of an error than the last
failure, so we use it.
I am not sure what exactly is the problem in case of PrattParser. I guess
the last failure gives better results for a user? One has to consider a
pratt parser included in the normal parser, e. g. Expressions parsed by
pratt in a Java Grammar. Depending where an error occurs, different
strategy for choosing the proper failure is necessary :-/
Regarding tokenization, there is a message token, that returns
PPTokenParser, which transforms a parsed input into the PPToken object.
Perhaps this might be helpful?
Cheers Jan
On Wed, Jun 10, 2015, 20:52 Richard Sargent <
richard.sargent(a)gemtalksystems.com> wrote:
> camille teruel wrote
> >> On 10 Jun 2015, at 19:11, Chris Cunningham <
>
> > cunningham.cb@
>
> > > wrote:
> >>
> >> Inteteresting....
> >>
> >> On Wed, Jun 10, 2015 at 9:36 AM, Camille <
>
> > camille.teruel@
>
> > <mailto:
>
> > camille.teruel@
>
> > >> wrote:
> >> Hello Pharoers and Moosers,
> >>
> >> I did a Pratt parser extension for PetitParser.
> >>
> >>
> > <snip>
> >
> >> @PP Devs:
> >> I had trouble with the PPContext furthestFailure that is taken into
> >> account instead of the failures I return, so I had to redefine
> >> #parseWithContext: to return the failures I want. The results given by
> >> furthestFailure were not very meaningful in my case (the same is true
> for
> >> PPExpressionParser btw).
> >> But I guess it was introduced because it gives good results in other
> >> cases.
> >> So would it be possible to change this behavior to let the parser decide
> >> if it returns the furthestFailure or the original failure?
> >>
> >> The intent behind the furthestFailure is that it give the failure that
> >> gets the furthest into the source stream. It is most useful when there
> >> are embedded choice operators in the parser - the original/pre furthest
> >> behaviour would return the last failure, which depending on the incoming
> >> stream and the order of the choice options could be significantly not
> >> useful.
> >>
> >> I ran into this when working with the sql parser, which started off with
> >> the outer choice of (by memory):
> >> ^ selectStatement / insertStatement / updateStatement /
> >> deleteStatement
> >> If I was trying to part a select statement that had an error at the very
> >> end of the statement, the parser would return an error talking about how
> >> the incoming stream failed in deleteStatement. Not useful.
> >>
> >> I would be saddened if this further failure was not available.
> >
> > Yes in that case returning the furthest failure gives better results.
> > However, this don’t give meaningful messages in all cases.
> > For exemple with the calculator I gave in my previous message, if I parse
> > ‘1+’ I want to get ‘expression expected at: 2’ but instead it returns ‘$-
> > expected at 2'.
> > I’m not proposing to remove this feature but to let parsers decide to use
> > it or not.
> > Something like (changes in bold):
> >
> > PPParser>>parseWithContext: context
> > | result |
> > context initializeFor: self.
> > result := self parseOn: context.
> >
> > "Return the furthest failure, it gives better results than the last
> > failure"
> > (result isPetitFailure and: [ self wantsFurthestFailure and: [
> context
> > furthestFailure notNil ] ])
> > ifTrue: [ ^ context furthestFailure ].
> > ^ result
>
> This screams at me. Why not just delegate to the context and use a context
> that returns the preferred failure? e.g. end with:
> ^context preferredResultFor: result.
>
>
> >
> > PPParser>>wantsFurthestFailure
> > ^ true
> >
> > Like this, one can return the failures he wants.
> >
> > PPPrattParser>>wantsFurthestFailure
> > ^ false
> >
> >
> > Camille
> >
> >>
> >> -cbc
>
>
>
>
>
> --
> View this message in context:
> http://forum.world.st/Pratt-Parsers-for-PetitParser-tp4831456p4831486.html
> Sent from the Pharo Smalltalk Developers mailing list archive at
> Nabble.com.
>
>
Hello Pharoers and Moosers,
I did a Pratt parser extension for PetitParser.
A Pratt parser (a.k.a top-down operator precedence parser) handles left-recursion and operator precedence.
It handles grouping, prefix, postfix, infix (right- or left-associative) and "multifix” operators (e.g. "if ... then ... else ...", "... ? ... : ...", Smalltalk keyword messages).
Normally Pratt Parsing needs a tokenization phase but here tokenization is done on the fly with other PP parsers.
Apart from tokenization, no backtracking is needed so parsing is quite fast (approximatively 2 times faster than PPExpressionParser).
Here is an exemple of a calculator:
parser := PPPrattParser new.
"Numbers"
parser terminal: #digit asParser plus do: [ :token | token inputValue asNumber ].
parser skip: #space asParser plus.
"Parentheses"
parser groupLeft: $( asParser right: $) asParser.
"Addition, substraction, multiplication, division: all left infix, * and / have higher precedence than + and -"
parser leftInfix: $+ asParser precedence: 1 do: [ :left :op :right | left + right ].
parser leftInfix: $- asParser precedence: 1 do: [ :left :op :right | left - right ].
parser leftInfix: $* asParser precedence: 2 do: [ :left :op :right | left * right ].
parser leftInfix: $/ asParser precedence: 2 do: [ :left :op :right | left / right ].
"Power: right infix with higher precedence than multiplication and division"
parser rightInfix: $^ asParser precedence: 3 do: [ :left :op :right | left raisedTo: right ].
"Unary minus: prefix with highest precedence"
parser prefix: $- asParser precedence: 4 do: [ :op :right | right negated ].
parser parse: '2*3 + 4^(1/2)*3' ----> 12
To try it:
Gofer it
smalltalkhubUser: 'CamilleTeruel' project: 'PetitPratt';
package: 'PetitPratt';
load
Note that it is in beta stage so it might still change drastically.
@PP Devs:
I had trouble with the PPContext furthestFailure that is taken into account instead of the failures I return, so I had to redefine #parseWithContext: to return the failures I want. The results given by furthestFailure were not very meaningful in my case (the same is true for PPExpressionParser btw).
But I guess it was introduced because it gives good results in other cases.
So would it be possible to change this behavior to let the parser decide if it returns the furthestFailure or the original failure?
Cheers,
Camille
Hi,
Last week, we made (Guillaume Larchevêque and my self) 6 hours about Moose. Guillaume was using Moose 5.0 and me the latest stable 5.1 version.
The purpose was, after an introduction to Moose to be able to analyse a real project with a reasonable size (35 to 420 FAMIXClasses) in order to evaluate its quality.
We met some issues:
- MSE file generated by VerveineJ could not be used in Version 5.0 (FileAnchor issue)
- From the MoosePanel, right clicking on a FAMIXClassesGroup to build the UML diagram:
- sometimes, the panel is completely white (since no error, or exception are raised, it is difficult to know why)
- when the UML class diagram appears, it is no zoomable and there is no way to export it. We had to hack the visualization to inspect the view in order to get access to the zooms and the exports.
- sometimes, I reorganized the figure before exportation, but in that cases, the resulting figure didn’t contain the whole diagram.
- When querying a collection of FAMIXEntity, it would be great to get an answer even if the result is empty.
Where can I put some new issues? Have we migrated from google code?
Am I the only one teaching Moose? Having these issues?
Cheers,
Anne
Hi,
We are working on enhancing MooseChef. For that purpose, we have looked
at the FAMIXAssociation. FAMIXReference is not managed as the other: its
source and its target are respectively a ContainerEntity. This enables
to compute references between packages. However we believe that such
computation on the contained entities should be let to MooseChef and not
directly to FAMIX. Indeed, FAMIXInvocation is an association between two
behavioral entities; FAMIXAccess is an association between a behavioral
entity and a structural one.
Would you agree to modify FAMIXReference in order to be consistent with
the other associations?
Regards,
Anne & JC
Hello Pharoers,
We propose a Pharo sprint / Moose dojo this Friday, 12th June, starting at
10:00am. (Local Time Lille).
It will be at the Inria Lille, Building B, third floor (RMoD offices).
Remotely, you can join us on the official IRC channel #pharo on
irc.freenode.net server. During the sprint, we will try to synchronize
local and remote Pharo sprinters.
As the building is not open to the public, please contact us before if
you plan to come.
JC
Hi all,
as you in this video, I was able to use Roassal to visualize a
multi-agent simulation in a grid.
https://www.youtube.com/watch?v=EXvsdL5sTRw
Now I would like to do animate the simulation without using I/O from user.
I try to use the VIVA framework without any success ...
Basically, I'm doing one step of the model, modify the elements of the
view and do a signalUpdate on the view.
|choosenModel aModel nbSteps |
choosenModel := ECEC.
nbSteps := 200.
aModel := choosenModel initialize;new.
aModel initSimulation.
v := RTView new.
b := RTMenuBuilder new view:v.
n := (RTMultiLinearColor new) colors: (ColorPalette sequential colors:
9 scheme: 'Greens').
c := n
command: [:cells| (cells biomass)/10.0.].
b menu: 'step' background: Color red callback:[
|es|
aModel runStep.
v removeAllElements.
es := (RTBox new color: c; size: 25) elementsOn: aModel theVegetationUnits.
v addAll: es.
RTGridLayout new
gapSize:0;
lineItemsCount: aModel spaceModel column;
on: v elements.
v signalUpdate.
].
v
Any hints ?
--
Serge Stinckwich
UCBN & UMI UMMISCO 209 (IRD/UPMC)
Every DSL ends up being Smalltalk
http://www.doesnotunderstand.org/
~~~~~~~~~~~~~~~~
RTAbstractLineLayout>>gapSize: aNumber
gapSize := aNumber. " This value is never used actually "
verticalGap := 2 * aNumber.
horizontalGap := 2 * aNumber
~~~~~~~~~~~~~~~~
What is the reasoning behind doubling the number?
My expectation would be that it should be the same.
Thanks,
Peter
Dear Colleagues and Friends,
We are happy to announce we will organize a CampSmalltalk about the Roassal visualization engine, on _Sunday 12 July_.
As far as we have seen, the interests are multiple. Here is a list of topics we will happy to work on:
- Port of Roassal on VisualWorks
- Using Roassal on Gemstone
- HTML/JavaScript export
- Improving Grapher, our charting library
If you wish to participate, get in touch with us. Since we will probably have a sponsoring of the event, it would be nice to know how many will attend to ease the logistic and the pizza ordering :-)
Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
We are happy to announce version 5.1 of the Moose Suite:
*http://moosetechnology.org/#install*
[image: Inline image 1]
Description
---
This is a minor release. The key highlights are:
- It is based on Pharo 4.0.
- Roassal2 comes with several new builder, most notably the new Mondrian
builder (RTMondrian) and the chart drawing engine (RTGrapher).
- GTSpotter has preview abilities and was extended for multiple search use
cases including the navigation through Moose models.
- GTPlayground was extended with sharing possibilities and transparent
backup.
- GTExample now offers support for documenting classes with example
instances.
- Moose Finder and GTInspector come with more custom presentations.
- PetitParser has seen performance corrections and has been extended with
the ability to parse whitespace languages.
Installation
---
The Moose Suite 5.1 comes for each platform as a separate bundle:
- Moose Suite 5.1 for Mac
http://moosetechnology.org/res/download/moose_suite_5_1-mac.zip
- Moose Suite 5.1 for Windows
http://moosetechnology.org/res/download/moose_suite_5_1-win.zip
- Moose Suite 5.1 for Linux
http://moosetechnology.org/res/download/moose_suite_5_1-linux.zip
The Moose Suite 5.1 can also be loaded in a Pharo 4.0 image either from the
Configuration Browser, or by executing the following script:
Gofer new
smalltalkhubUser: 'Moose' project: 'Moose';
configuration;
loadStable
Enjoy,
The Moose team
> On 04 Jun 2015, at 10:07, Aliaksei Syrel <alex.syrel(a)gmail.com> wrote:
>
> Juhuuuuu, thanks Doru! :)
> Congratulations, Moose!
+100
> Cheers,
> Alex
> On Jun 4, 2015 9:17 AM, "Tudor Girba" <tudor(a)tudorgirba.com> wrote:
> We are happy to announce version 5.1 of the Moose Suite:
> *http://moosetechnology.org/#install*
>
> <moose-5-1.png>
>
> Description
> ---
> This is a minor release. The key highlights are:
> - It is based on Pharo 4.0.
> - Roassal2 comes with several new builder, most notably the new Mondrian builder (RTMondrian) and the chart drawing engine (RTGrapher).
> - GTSpotter has preview abilities and was extended for multiple search use cases including the navigation through Moose models.
> - GTPlayground was extended with sharing possibilities and transparent backup.
> - GTExample now offers support for documenting classes with example instances.
> - Moose Finder and GTInspector come with more custom presentations.
> - PetitParser has seen performance corrections and has been extended with the ability to parse whitespace languages.
>
>
> Installation
> ---
> The Moose Suite 5.1 comes for each platform as a separate bundle:
> - Moose Suite 5.1 for Mac
> http://moosetechnology.org/res/download/moose_suite_5_1-mac.zip
> - Moose Suite 5.1 for Windows
> http://moosetechnology.org/res/download/moose_suite_5_1-win.zip
> - Moose Suite 5.1 for Linux
> http://moosetechnology.org/res/download/moose_suite_5_1-linux.zip
>
> The Moose Suite 5.1 can also be loaded in a Pharo 4.0 image either from the Configuration Browser, or by executing the following script:
>
> Gofer new
> smalltalkhubUser: 'Moose' project: 'Moose';
> configuration;
> loadStable
>
>
> Enjoy,
> The Moose team
>
Hello.
I played with Force based layout and noticed that in some cases you can get infinite recursion.
If you call method #withAll:origin:corner:
from RTQuarTree class with parameters
origin = (3.258667150078313e13(a)5.406136133593736e12)
corner = (3.258667150079787e13(a)5.40613613360932e12)
you would get
dx := corner x - origin x = 14.7421875
dy := corner y - origin y = 15.583984375
So, in this case you will execute the case
dy > dx ifTrue: [ ^ self withAll: aNodeCollection origin: origin corner: (origin x + dy) @ corner y ]
and you will get infinite recursion, because always dy will be =15.583984375 and dx = 15.58203125.
Best regards,
Natalia
Is there a way to specify that a presentation should only be used if a
certain condition is met? The use case I have in mind is adding the Magritte
presentation to object, but only showing if the object has a Magritte
description. It is a PITA to have to copy/paste the presentation method into
every Magritte-described object...
-----
Cheers,
Sean
--
View this message in context: http://forum.world.st/GT-Presentation-Show-Conditionally-tp4829638.html
Sent from the Moose mailing list archive at Nabble.com.
Dear all,
I have some problems when building a Glamour interface.
The + icon appear on MOOSE 5.0 but no more on 5.1
I'm sending the following to a tree instance.
act: [ :b | self addSpatialEntityClass. b update ]
icon: GLMUIThemeExtraIcons glamorousAdd
entitled: 'Add a spatial entity class'.
Any hints ?
--
Serge Stinckwich
UCBN & UMI UMMISCO 209 (IRD/UPMC)
Every DSL ends up being Smalltalk
http://www.doesnotunderstand.org/
Hello,
I don't know if this mailing-list is the appropriate place to a question
about MUCCA.
MUCCA is a system for classification using NLP in documents, and it is
described here: http://mucca.inf.usi.ch/index.html
I downloaded the VirtualBox .ova image but accessing the Seaside demo
presents some problems with getting sources. I searched the proper
PostgreSQL and glorp parent path, currently this directory is /opt/vw771nc
and replaced in $(VISUALWORKS) as suggested by the error window, then
re-evaluated the expression:
SourceFileManager default
changeSourceDirectoryFrom: '$(VISUALWORKS)/glorp'
to: '$(VISUALWORKS)/glorp'
but problems continue (see attachment). Setting VisualWorks Home directory
to /opt/vw771nc or /home/muccauser produces the same error exception.
Anyone with a successful experience can comment the right settings?
Cheers,
Hernán
Hello.
I started to work with Woden. Unfortunately I cannot find the interaction I need.
Does RWoden has the interaction as popup, highlighting and menu activating?
Best regards,
Natalia
Dear all,
I use a MOOSE image for a pair-programming session this afternoon.
In the debugger, my partner click on the ... and select "Step to
debugger"/"Glamour Debugger" and crash the image ... When we try to
stop with the usual CTRL-shift-. and do it again, we crashed
definitively the image without any possibility of recovery ...
--
Serge Stinckwich
UCBN & UMI UMMISCO 209 (IRD/UPMC)
Every DSL ends up being Smalltalk
http://www.doesnotunderstand.org/
Hi all,
this is a proposal from a student internship in Pharo in order to
build a specific UML editor for multi-agent simulation.
Sorry this is only in French and Spanish, but english-speaking student
are welcome also.
Regards,
---------- Forwarded message ----------
From: Pierre Bommel <bommel(a)cirad.fr>
Date: 2015-05-27 1:26 GMT+02:00
Subject: [cormas] [Cormas] Proposition de stage en informatique
To: Cormas <cormas(a)cirad.fr>
Bonjour, hello, hola,
Please find a proposal for an internship in Computer Science to work
on a UML editor for Cormas.
Sorry but it is in french and in spanish..
Pierre
______ Français ______
Proposition de stage en informatique
– Conception d’un éditeur de diagramme de classes UML
pour l’implémentation de modèles multi-agents -
Dans le cadre du développement de sa plateforme de modélisation et
simulation multi-agent, Cormas (http://cormas.cirad.fr), l’Unité de
Recherche GREEN du Cirad (http://ur-green.cirad.fr) propose un stage
indemnisé de 6 mois pour un étudiant en informatique pour développer
un module de Cormas.
Ce développement informatique consiste à mettre au point un éditeur
graphique permettant de dessiner un diagramme de classes UML et de
générer du code SmallTalk (en Pharo, langage de programmation
open-source) de la structure du modèle en se référant au standard
"Executable UML" (xUML) proposé par Mellor & Balcer (2002) and adopté
par l’OMG (2008). Pour ce travail, nous ne cherchons pas un éditeur
exhaustif intégrant tous les éléments décrits par UML2. Pour cet
éditeur, les éléments du méta-modèle proposés seront limités à : la
classe, ses attributs et ses méthodes (déclaration), la spécialisation
de classes et les associations. Les associations sont simples
(uniquement binaires) et sont définies par leur nom et par leurs
extrémités qui comportent chacune un nom de rôle, une valeur de
multiplicité et la navigabilité.
Cormas étant un framework, le modèle créé par un utilisateur doit
s’ancrer sur des classes prédéfinies disponibles dans Cormas. A la fin
de la conception de son modèle, l’utilisateur devra être invité à
rattacher les classes qu’il a créées aux classes prédéfinies. Dans ce
cas, les propriétés héritées (méthodes, associations, attributs, ...)
devront être spécifiées dans le diagramme conceptuel de l’utilisateur
qui pourra être affiché de façon indépendante du framework.
Outre la création dynamique du squelette des classes, le stagiaire
devra porter une attention particulière aux associations entre classes
uni ou bi-directionnelles qui seront traduites en attributs nommés
selon le rôle de l’extrémité de l’association (on parle parfois
d’association dégénérée pour laquelle le rôle de l’extrémité opposée
est traduit en attribut). Ne seront pas prises en compte les
classes-associations, ni les associations n-aires, ni les associations
qualifiées.
Cet éditeur permettra également de ré-afficher un modèle déjà
sauvegarder mais aussi de proposer de générer un nouveau diagramme à
partir d’un modèle déjà implémenté (rétro-ingénierie).
Par ailleurs, un éditeur de diagramme d’activité xUML est déjà
disponible dans Cormas (bommel et al, 2014). En sélectionnant une
méthode de son diagramme de classes, l’utilisateur pourra alors
dessiner le comportement de cette méthode en décrivant la succession
des activités et des conditions booléennes.
Le développement de l’éditeur UML devra se faire sous Roassal, un
moteur puissant de visualisation
(http://objectprofile.com/Roassal.html), disponible pour Pharo.
En option et si le stagiaire en a le temps, cette application pourra
aussi être traduite en VisualWorks : un autre langage Smalltalk sur
lequel Cormas tourne actuellement. Avec la sortie récente de Roassal2,
la mise au point de ce module UML permettra d’accélérer la migration
de Cormas sous Pharo. Enfin, le stagiaire sera libre de générer le
code XML (XMI) d’un modèle pour pouvoir le lire dans un autre éditeur.
______
Durée : 6 mois (ou moins si nécessaire)
Gratification : 485,10 € par mois.
Lieu : pas d’accueil prévu au Cirad. L’étudiant travaillera dans son
laboratoire mais des contacts réguliers seront proposés.
Contacts : Pierre Bommel (bommel(a)cirad.fr) et Grégoire Leclerc
(Leclerc(a)cirad.fr).
Profil de candidature : Etudiant en Informatique, License ou Master,
ayant un goût pour la modélisation et la simulation. L’étudiant doit
avoir de bonnes connaissances des concepts de la modélisation objet et
d’UML. Des compétences en programmation Smalltalk devront être
acquises.
______ Español ______
Propuesta de práctica de informática
- Diseño de un editor de diagramas de clases UML
para la implementación de modelos multi-agentes -
Como parte del desarrollo de su plataforma de modelización y
simulación multi-agente, Cormas (http://cormas.cirad.fr), la Unidad de
Investigación Green del CIRAD (http://ur-green.cirad.fr) ofrece una
práctica remunerada por 6 meses por un estudiante de informática para
desarrollar un módulo de Cormas.
Este desarrollo consiste en crear un editor gráfico para deseñar un
diagrama de clases UML y generar código SmallTalk (en VisualWorks
Cincom y/o en Pharo, de código abierto) de la estructura del modelo
refiriéndose al estándar "ejecutable UML" (xUML) propuesto por Mellor
y Balcer (2002) y adoptado por el OMG (2008). Para este trabajo, no
buscamos un editor global que integre todos los elementos descritos
por UML2. Sin embargo, este editor deberá estar simples y integrar los
elementos del meta-modelo limitados a: clases, atributos y métodos,
especialización de clases y asociaciones. Las asociaciones son simples
(solo binaria) y se definen por su nombre y sus extremos que tienen
cada uno un nombre de rol, un valor de multiplicidad y navegabilidad.
Así que Cormas es un framework, el modelo creado por un usuario deben
heredar de las clases predefinidas en Cormas. Al final del diseño de
su modelo, el usuario se le pedirá para vincular las clases que creó
con las clases predefinidas. En este caso, las características
(métodos, asociaciones, atributos, ...) deben ser especificados en el
diagrama conceptual del usuario que se puede mostrar de forma
independiente de la estructura heredada.
Además de la creación dinámica del esqueleto de las clases, el
estudiante debe prestar especial atención a las asociaciones entre
clases uni o bi-direccional para traducirse en atributos nombrados en
el rol al final de la asociación (a veces llamada asociación
degenerada para el que se traduce el rol del extremo opuesto en el
atributo). No se tendrán en cuenta las clases-asociaciones o las
asociaciones n-arias o asociaciones calificadas.
Este editor también podría re-mostrar un modelo ya salvado, sino
proponer de generar un nuevo diagrama de un modelo ya implantado
(ingeniería inversa).
Además, un editor de diagrama de actividad xUML ya está disponible en
Cormas. Mediante la selección de un método de su diagrama de clases,
el usuario puede desiñar el comportamiento de este método mediante la
descripción de la secuencia de actividades y condiciones booleanas.
Aunque la distribución de VisualWorks se acompaña de algunas
herramientas de ida y vuelta entre el código y diagramas UML Smalltalk
(ADvance, Gipa, BOOST, MetaEdit+, DoME, UMLForSmalltalk ou
Umbrello,..), el desarrollo del editor UML estará construido a partir
de Roassal. De hecho, con el reciente lanzamiento de Roassal2, un
poderoso motor de visualización
(http://objectprofile.com/Roassal.html), disponible tanto para
VisualWorks y Pharo, el enfoque de este módulo UML permitirá de
acelerar la migración de Cormas en Pharo.
Opcionalmente, será interesante de generar código XML (XMI) de un
modelo que será legible con otros editores.
Duración: 6 meses (o menos si es necesario)
Gratificación: € 485,10 por mes.
Localización: no hay recepción prevista en el CIRAD. El estudiante
trabajará en su laboratorio, pero contactos regulares serán
necesarios.
Contactos: Pierre Bommel (bommel(a)cirad.fr) y Gregoire Leclerc
(Leclerc(a)cirad.fr).
Perfil del candidato: Estudiante en Ciencias de la Computación,
licencia o maestra, con un gusto para la modelización y simulación. El
estudiante debe tener un buen conocimiento de los conceptos de
modelización objetos y UML. Conocimientos de programación Smalltalk
deben adquirirse.
Bommel, P., Dieguez, F., Bartaburu, D., Duarte, E., Montes, E.,
Pereira, M., Corral, J., Lucena, C. de and Morales Grosskopf, H.
(2014). A Further Step Towards Participatory Modelling. Fostering
Stakeholder Involvement in Designing Models by Using Executable UML.
Journal of Artificial Societies and Social Simulation 17 (1) 6
<http://jasss.soc.surrey.ac.uk/17/1/6.html>.
Mellor, S. J., & Balcer, M. J. (2002). Executable UML : a foundation
for model-driven architecture. Boston; San Francisco; New York:
Addison-Wesley.
OMG. (2008). Model Driven Architecture, MDA Guide Version 1.0.1
--
Serge Stinckwich
UCBN & UMI UMMISCO 209 (IRD/UPMC)
Every DSL ends up being Smalltalk
http://www.doesnotunderstand.org/
Hello,
today I created the version 0.56 of Pillar and with this version we'll
need to do some changes, sorry.
The first change is the numerator. The old numerator was too limited,
so i changed it. Now if you put different files into the pillar.conf
the numerator will not be reset at each files.
The parameters 'startNumberingAtHeaderLevel:' and
'stopNumberingAtHeaderLevel:' are replace by 'level1:', 'level2:',
'level3:', 'level4:', 'level5:'.
For now they can take 3 sub-parameters: 'numbering', 'size' and 'renderAs'.
numbering: a boolean that say if this header level need to be take in
account by the numerator.
size: the number of level we want to render. You can put numbering at
true and size at 0 if you want your numerator to be reset at a level
without rendering the number of this level.
renderAs: can be number, roman, letter or upperLetter.
Example:
pillar.conf:
{
'level1': {
'numbering': true,
'size': 1,
'renderAs': 'roman'
},
'level2': {
'numbering': true,
'size': 2,
'renderAs': 'number'
},
'level3': {
'numbering': true,
'size': 1,
'renderAs': 'upperLetter'
},
'level4': {
'numbering': true,
'size': 2,
'renderAs': letter
},
'level5': {
'numbering': false
},
}
document.pillar:
! Example
!! Introduction
!!! Beginning
!!! Example - Intro
!!!! Example 1
!!!! Example 2
!!!!! With X
!!!!! With Y
!! Explanation
Result:
I. Example
I.1. Introduction
A. Beginning
B. Example - Intro
B.a. Example 1
B.b. Example 2
With X
With Y
I.2. Explanation
In the future we could also add feature like 'delimiter'.
The second main change is the Internal Links.
Now when you want to reefer to an anchor, a figure or a script you'll
need to use *@anchor* instead of *anchor*.
I'm sorry for that but that's the easiest way to implement the
inter-files links.
And so the last main change is the Inter-files links !
Imagine you're writing a book.
You have a directory 'Chapter1' which contains the file
'chapter1.pillar' and a directory 'Chapter2' with a file
'chapter2.pillar'.
If you want to make a reference to the chapter 1 in the chapter 2 you
can create an interfile link you can now use the syntax:
*../Chapter1/chapter1.pillar*
But be careful ! Remember that pillar can export in different format.
And you can export a group of file as separate output files or as one
file.
So if you don't use an Alias your link will not be render if you
export as one output file in LaTeX. And if you export in LaTeX or HTML
or Markdown as one output file and you don't have an anchor on your
link, the link will be vanish.
So I recommend to use inter file links like this:
*Chapter 1>../Chapter1/chapter1.pillar@cha:chapter1*
when cha:chapter1 is an anchor you need to create at the beginning of
the chapter 1.
I already changed the links on Enterprise Pharo (you can find a table
with the list of the inter-files links on the README.md)
On last thing for the people who write book for SquareBracketAssociates:
It would be good to have some conventions, so if you create anchors
use this form :
@sec:nameOfSection for a section
@cha:nameOfTheChapter for a title of chapter
@fig:nameOfFigure for a figure
@spt:nameOfTheScript for a script
--
Cheers
Cyril Ferlicot
Apparently this black arrow works in Pharo 4.0 but this is broken in MOOSE 5.1
On Sun, May 24, 2015 at 5:33 PM, Cyril Ferlicot
<cyril.ferlicot(a)gmail.com> wrote:
> On the top right of the tools in Pharo you have a little black arrow.
> If you click on it you have a menu and an "about" field to explain the
> purpose of the tool.
>
> On 24 May 2015 at 17:32, Daniel Roe <roedj(a)hotmail.com> wrote:
>> Question to Daniel:
>>
>> Did you try to know something about the tool before in the IDE?
>>
>> For example, did you try to read the About of the tool?
>>
>> (I'm trying to determine how useful/accesible are the help features of the
>> tools)
>>
>> To show you what a noob I am - I don't even understand your question.
>>
>> Dan
>
>
>
> --
> Cheers
> Cyril Ferlicot
>
--
Serge Stinckwich
UCBN & UMI UMMISCO 209 (IRD/UPMC)
Every DSL ends up being Smalltalk
http://www.doesnotunderstand.org/