Hi all
We got a one year engineer position to support the development of a demonstration for Moose.
The constraints linked with the position are that the person should have got his master
in 2009 or 2010. The starting date is 1 of December 2010.
The salary should be around 3500 Euros bruto ~> 2400 Euros before taxes (but after health insurance).
The job will probably consist in
- getting Moose running into a web browser
- having a better reporting system.
- building a dashboard
- porting part of codecity
By september we should decide if we take this year in 2010 or 2011 (for decembre 2011 the person should have got a master
in 2010 or 2011).
Please send your cv.
Stef
On 8/4/10 5:49 PM, Lukas Renggli wrote:
> I think this parser is called PPFailingParser. It is useful to
> generate custom error messages. It always fails without consuming
> anything.
>
> However for the given example I would use
>
> keywords reduce: [ :a :b | a asParser / b asParser ]
Thanks to both of you for the suggestions,
now the keyword parser (and similarly the separator)
is implemented using:
keywordParsers := keywords keysSortedSafely
collect: [:eachKey | keywords at: eachKey ].
^ (keywordParsers reduce: [ :a :b | a / b ]) token trimBlanks
Since I already have a dictionary "keywords" with each keyword
as a key, and the corresponding parser (not tokenized)
as a value.
Should these parsers be caseInsensitive?
I thought keywords are case sensitive.
Maybe that was another story?
Ciao,
Alberto
On 8/3/10 2:14 PM, Lukas Renggli wrote:
> Hi Alberto,
>
> This is great news. Maybe you also want to post the repository URL? :-)
Sure, please don't be too much horrified by the quality of the code:
http://www.squeaksource.com/PetitJava.html
> For what you noticed on bogus grammar specifications check out the
> work of Vadim Zaytsev (http://mobile.twitter.com/grammarware). Among
> others he analized various Java Language Specifications.
That's interesting, thank you!
> Note that cycles are present in most grammars and perfecly fine. The
> only problematic cycles are the left-recursive ones for recursive
> descent parsers like ANTLR or PetitParser. Even then you can simply
> fix the problem by adding a memoizer into the offending cycle, but
> that yields a very slow grammar. You can find offending cycles with
> the message #cycleSets from the PetitAnalyzer package.
I tried using the "cycle" tab in the PetitParser GUI, which -I think-
does the same thing. Knowing how to call it programmatically is even
better ;)
Alberto
On 8/3/10 10:22 AM, Lukas Renggli wrote:
> Hi Bijan,
>
> Please ask further questions in the Moose mailing-list, other people
> might be interested too.
>
Thanks for sharing it:
I would be definitively happy to read
any discussion related to PetitParser! :)
Btw, it seems that the Java grammar (i.e. PetitJava) is coming.
Just to share my experience, I first tried to implement it
following the Java Language Specification book, Chapter 18.
Even though such chapter should sum up the whole syntax, it is not
completely consistent with the rest of the book (which details
all the rules with explanations and examples), and presents some
errors. Thus, after a brief trial, I moved to implement
the grammar according to the more detailed version.
Alas, such chapters are not perfect, too!
I found out a "corrected" version in a web site [1].
When finally I managed to implement it, it turned out that such
specifications contain various cycles. I tried to fix them, but
that would have required much time.
So, I decided to take the ANTLR version of the java grammar
(which has been tested successfully over a comprehensive regression
test suite) that would contain no dangerous cycles (since it is LL(1))
for PetitParser [2].
Now that grammar is implemented, and it correctly parses the
compilation units I tried. It still needs work (first of all, more
tests. Then, a parser), but it's coming.
From this experience, I would say that the first translator from
grammar-in-another-specification to PetitParser, should be from
ANTLR grammars. The fact that they are LL(1) should avoid cycles
(please correct me, if I am wrong), and there is a very big number
of grammars written for ANTLR.
Ciao,
Alberto
[1]
http://www.cmis.brighton.ac.uk/staff/rnb/bosware/javaSyntax/Java1_6GrammarC…
[2] http://openjdk.java.net/projects/compiler-grammar/antlrworks/Java.g
Hi Bijan,
Please ask further questions in the Moose mailing-list, other people
might be interested too.
> I'm trying to understand how PetitParser initializes grammar classes (the
> tutorial doesn't make it clear how to use def: in a class context). I see
> now that mutual recursive productions should work out of the box.
You don't need #def: in the context of PPCompositeParser, the
framework does that for you. See the class comment of
PPCompositeParser for additional information.
> However, while figuring this out, I noticed this following bit:
>
> ...
>
> parser := PPUnresolvedParser named: aSymbol.
> productionIndexesAndNames do: [ :assoc |
> self instVarAt: assoc key put: (PPUnresolvedParser named:
> assoc value) ].
> parser := self perform: aSymbol.
> ...
>
> It seems that the last line of the snippet should read:
> parser def: (self perform: aSymbol).
Yes, you are right. I changed that in the latest version.
However, consider not to loop into the start state. You get a more
reusable model if you use 'parser' simply as a selector of where to
start the grammar (e.g. the method, the method declaration, or the
expression in the example of Smalltalk).
Lukas
>
> This would be consistent with how the rest of the productions initialize
> themselves and wouldn't make the first line of the snippet pointless.
>
> I can't really discern any difference in commenting out line one, leaving
> everything as is, or shifting the last bit to def: So I'm missing something!
>
> Cheers,
> Bijan.
>
--
Lukas Renggli
www.lukas-renggli.ch
Hi,
moosetechnology.org is temporarily down due to a mistake I made in the
DNS settings. It should be back online in 1 day.
Sorry for the trouble :(.
Cheers,
Doru
--
www.tudorgirba.com
"If you interrupt the barber while he is cutting your hair,
you will end up with a messy haircut."
Hi,
Yet another question on PetitParser :)
All the grammars that I find in PetitParser (e.g., PetitXML,
PetitSmalltalk) are defined in
a single class called PP...Grammar. However, the Java grammar has many rules and
including all of them in a single class seems not the right approach.
For example, now I have a class called PPJavaLexicon, in which I cover the rules
for finding tokens and comments (i.e. the lexical structure [1]).
Then, for example,
I would continue working on types, values, and variables [2]. So, I would
create another class that references PPJavaLexicon and uses the
rules defined there to define the new ones. Something like:
PPJavaTypes>>typeVariable
^ppJavaLexicon identifier
Is this a good approach to split a grammar in more classes,
or would you suggest something different?
Thank you,
Alberto
[1] http://java.sun.com/docs/books/jls/third_edition/html/lexical.html
[2] http://java.sun.com/docs/books/jls/third_edition/html/typesValues.html
Hi Felipe,
The result of opening a browser is a window.
So, you could use something like this:
browser := GLMTabulator new.
...
window := browser openOn: ...
window maximize.
...
window delete.
Could I ask in what context you are using Glamour? Also, a better
forum for discussing these issues is the moose-dev mailing list:
- address: moose-dev(a)iam.unibe.ch
- registration: https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Cheers,
Doru
On 28 Jul 2010, at 21:04, Alexandre Bergel wrote:
> Hi Felipe,
>
> No idea, but this is good to see you here!
>
> Alexandre
>
>
> On 28 Jul 2010, at 18:47, Felipe Ignacio Valverde Campos wrote:
>
>> Hi, i'm beginner on this tools, so i need your help please :)
>> i have some doubts about Glamour, specificaly with GLMTabulator.
>>
>> how can i set the window size ?
>> and how can i close it without pressing the X ?
>>
>> thanks
>> --
>> http://www.dcc.uchile.cl/~fvalverd/public_key.asc
>> Estudiante de Ingeniería Civil en Computación.
>> Facultad de Ciencias Físicas y Matemáticas.
>> Universidad de Chile.
>> _______________________________________________
>> Pharo-project mailing list
>> Pharo-project(a)lists.gforge.inria.fr
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>
>
>
> _______________________________________________
> Pharo-project mailing list
> Pharo-project(a)lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
--
www.tudorgirba.com
"Reasonable is what we are accustomed with."
Hi,
As I wrote in my previous e-mail, I am trying to write the Java grammar
for PetitParser. I am following "The Java Language Specification,
Third Edition",
which is the last available book written by Sun with the specification
for the whole
Java language [1]. It covers Java 1.5.
The project, PetitJava, is on SqueakSource [2].
I've just "finished" to implement the literals [3]
and I am trying it with some tests.
I find something strange, thus probably there is something
in PetitParser that I don't get.
As an example, among the primitives in PPJavaGrammar you find:
<snips>
PPJavaGrammar>>octalEscape
^ $\ asParser , ( octalDigit / (octalDigit , octalDigit) /
(zeroToThree , octalDigit , octalDigit) )
PPJavaGrammar>>octalDigit
^PPPredicateObjectParser anyOf: '01234567'
PPJavaGrammar>>zeroToThree
^PPPredicateObjectParser anyOf: '0123'
</snips>
I take some one of the failing tests as an example:
<snips>
PPJavaGrammarTest>>testOctalEscape1
self parse: '\0' rule: #octalEscape
PPJavaGrammarTest>>testOctalEscape2
self parse: '\00' rule: #octalEscape
PPJavaGrammarTest>>testOctalEscape3
self parse: '\000' rule: #octalEscape
</snips>
While the first test passes as I expected,
the second and the third ones do not.
However, they should be recognized as:
$\ , octalDigit , octalDigit
and
$\ , zeroToThree, octalDigit , octalDigit
as stated in the "octalEscape" implementation.
Is there something wrong with my implementation,
or didn't I understand correctly the '/' operator?
Thank you,
Alberto
[1] http://java.sun.com/docs/books/jls/third_edition/html/j3TOC.html
[2] http://www.squeaksource.com/PetitJava.html
[3] http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.10
Hummm... Strange
According to your log, updateBounds is sent to rectangle from MORoot>>updateBounds. But the code of MORoot>>updateBounds says that #updateBounds can only be sent to a canvas. In your case the canvas is an instance of Rectangle.
In the log, apparently, it is said to be a MOCanvas, as I would expect:
-=-=-=-=-=-=-=-=-=
MORoot>>updateBounds
Receiver: a MORoot
Arguments and temporary variables:
<<error during printing>
Receiver's instance variables:
...
canvas: MOCanvas<0@0 corner: 25@10>
-=-=-=-=-=-=-=-=-=
Really strange...
I am not sure what I can do. Especially if this is related to your image. In that case, just update your image, and wait for it to appear again.
Cheers,
Alexandre
On 27 Jul 2010, at 18:52, Johan Fabry wrote:
> Here you go:
>
> <PharoDebug.log>
>
> On 27 Jul 2010, at 12:37, Alexandre Bergel wrote:
>
>> Johan, do you have the Pharo.log file ?
>>
>> Cheers,
>> Alexandre
>>
>>
>> On 27 Jul 2010, at 18:15, Johan Fabry wrote:
>>
>>> In my image I get 2 DNU, in 2different threads, appearing in the following order
>>>
>>> MORoot>>updateBounds (called in forNode:do: as 'node owner updateBounds.') causes the DNU when sending 'canvas updateBounds'. MORoot canvas is a Rectangle (0@0 corner: 25@10) when causing the DNU but when I debug MORoot canvas is a MOCanvas (MOCanvas<0@0 corner: 25@10>).
>>>
>>> MORoot>>addSelection: aFigure causes DNU in 'selections add: aFigure' because selections is nil. Still nil when I debug it.
>>>
>>> On 26 Jul 2010, at 12:21, Alexandre Bergel wrote:
>>>
>>>> Hi,
>>>>
>>>> I do not get any DNU. I click on inner nodes, and new nodes are normally created.
>>>> forNode:do: is tested in
>>>> #testInteraction10AddingSubNodesAndElementToDisplay
>>>> #testInteraction13NestedInteractions
>>>> #testInteraction14AddingSubnodeToIncreaseRootSize
>>>> #testInteraction4AddingSubNodes
>>>>
>>>> Using the example you gave in your email.
>>>>
>>>> What are exactly the actions you perform to get the DNU?
>>>>
>>>> Cheers,
>>>> Alexandre
>>>>
>>>> On 26 Jul 2010, at 17:58, Johan Fabry wrote:
>>>>
>>>>> Hi Alex, all,
>>>>>
>>>>> The latest mondrian (519) breaks forNode:do: again. Try test code below to get a DNU. Alex could you add some tests for this feature ...
>>>>>
>>>>> view interaction on: MOMouseDown do: [:ann |
>>>>> view forNode: ann element model do: [
>>>>> view interaction on: MOMouseDown do: [:ann2|
>>>>> view forNode: ann2 element model do: [
>>>>> view shape triangle. view nodes: #(6 7 8 9).]].
>>>>> view shape diamond. view nodes: #(3 4 5).]].
>>>>> view nodes: #(1 2)
>>>>>
>>>>> --
>>>>> Johan Fabry
>>>>> jfabry(a)dcc.uchile.cl - http://dcc.uchile.cl/~jfabry
>>>>> PLEIAD Lab - Computer Science Department (DCC) - University of Chile
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Moose-dev mailing list
>>>>> Moose-dev(a)iam.unibe.ch
>>>>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>>>
>>>> --
>>>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>>>> Alexandre Bergel http://www.bergel.eu
>>>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Moose-dev mailing list
>>>> Moose-dev(a)iam.unibe.ch
>>>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>>
>>> --
>>> Johan Fabry
>>> jfabry(a)dcc.uchile.cl - http://dcc.uchile.cl/~jfabry
>>> PLEIAD Lab - Computer Science Department (DCC) - University of Chile
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> Moose-dev mailing list
>>> Moose-dev(a)iam.unibe.ch
>>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>
>> --
>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> Alexandre Bergel http://www.bergel.eu
>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> Moose-dev mailing list
>> Moose-dev(a)iam.unibe.ch
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
> --
> Johan Fabry
> jfabry(a)dcc.uchile.cl - http://dcc.uchile.cl/~jfabry
> PLEIAD Lab - Computer Science Department (DCC) - University of Chile
>
>
>
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Hi Alex, all,
The latest mondrian (519) breaks forNode:do: again. Try test code below to get a DNU. Alex could you add some tests for this feature ...
view interaction on: MOMouseDown do: [:ann |
view forNode: ann element model do: [
view interaction on: MOMouseDown do: [:ann2|
view forNode: ann2 element model do: [
view shape triangle. view nodes: #(6 7 8 9).]].
view shape diamond. view nodes: #(3 4 5).]].
view nodes: #(1 2)
--
Johan Fabry
jfabry(a)dcc.uchile.cl - http://dcc.uchile.cl/~jfabry
PLEIAD Lab - Computer Science Department (DCC) - University of Chile
Hi,
In order to define a Java grammar in PetitParser, I am looking at how
PetitSmalltalk is implemented.
- Should a grammar like that of a programming language be
created as a subclass of PPCompositeParser? What's the advantage over
just a subclass of PPParser?
- Unfortunately, I do not understand why PetitSmalltalk uses a
PPSmalltalkTokenParser instead of a normal "token".
Thanks,
Alberto
Hi Jannik,
The testMatrixDSM started to brake recently. I tried to debug, but
cannot figure out what the problem is. I think maybe you changed the
test fixture for another test? Could you take a look?
Cheers,
Doru
--
www.tudorgirba.com
"Every now and then stop and ask yourself if the war you're fighting
is the right one."
Hi,
I am playing with PetitParser (which looks super-cool!).
Following Lukas' blogpost [1], I defined my identifier as:
<snip>
identifier := #letter asParser , #word asParser star.
</snip>
then, I am using it to find the matches in a given string:
<snip>
identifier matchesIn: 'foo 123 bar12'.
</snip>
which returns:
<snip>
an OrderedCollection(
#($f #($o $o))
#($o #($o))
#($o #())
#($b #($a $r $1 $2))
#($a #($r $1 $2))
#($r #($1 $2))
)
</snip>
Even though the result is correct and makes much sense, would it
be possible to simply have the longest matches?
In that case I would expect something like:
<snip>
an OrderedCollection(
#($f #($o $o))
#($b #($a $r $1 $2))
)
</snip>
Thank you!
Cheers,
Alberto
[1] http://www.lukas-renggli.ch/blog/petitparser-1
Hi Alex, all,
I like the Mondrian NarrowTreeLayout, in my tests it produces the best layout for partially ordered sets (advice dependencies in AspectMaps). However it aligns vertically, and to best fit the visualization it should do this horizontally. Would it be possible to produce a Horizontal version of that one (like HorizontalTreeLayout and friends )?
thanks in advance!
--
Johan Fabry
jfabry(a)dcc.uchile.cl - http://dcc.uchile.cl/~jfabry
PLEIAD Lab - Computer Science Department (DCC) - University of Chile
hi!
I renamed MOGraphElement>>children into nodes.
I produced a new version of DSMCore-Alexandre_Bergel.205
Maybe Jannik wants to double check.
Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Hi,
When dealing large models, the Moose Finder was slow. I looked into
the reason, and it was due to Group>>= which was doing a
transformation to OrderedCollection.
I now removed the method, and thus group equality relies on the
default == implementation. All tests work, so I guess it is not really
a problem.
Anyway, as a consequence, the Finder is significantly faster now.
Please let me know if you relied on Group>>= or if you encounter other
related problems.
Cheers,
Doru
--
www.tudorgirba.com
"Every thing should have the right to be different."
Dear Mondrian friends,
A new cache mechanism has been implemented and some part have been simplified. The goal was to make Package blueprint fast without reducing the speed up for other visualization. The goal has been reached. On my machine, Package Blueprint is snappy (as soon as it got displayed and you do not select anything).
The health report shown below is sensibly the same than the one sent few days ago. However, the new benchmark ("Benchmark many small nodes") is the one that reproduce a situation found in package blueprint. It was costly before this version.
I would like you to try the last version of Mondrian. I tested it against class blueprint and it behaves as it should. However, you may notice some differences. Was the rendering and scrolling faster for you? Are you happy with this new version?
Report produced on 2010-07-16T09:13:19+02:00
System version Pharo-1.1-11400-rc2 of 12 June 2010 update 11400
Benchmark ManyNode (simple rendering of nodes) :
100 nodes => 7 ms
200 nodes => 12 ms
300 nodes => 18 ms
400 nodes => 23 ms
500 nodes => 30 ms
600 nodes => 35 ms
700 nodes => 41 ms
800 nodes => 46 ms
900 nodes => 52 ms
1000 nodes => 58 ms
1600 nodes => 93 ms
3200 nodes => 186 ms
6400 nodes => 373 ms
Benchmark ManyEdges (simple rendering of edges) :
10 edges => 3 ms
20 edges => 9 ms
30 edges => 21 ms
40 edges => 38 ms
50 edges => 65 ms
60 edges => 102 ms
70 edges => 153 ms
80 edges => 223 ms
90 edges => 310 ms
100 edges => 409 ms
200 edges => 5844 ms
300 edges => 37619 ms
Benchmark ManyInnerNodes :
5 nodes => 170 ms
10 nodes => 3012 ms
15 nodes => 11589 ms
Benchmark Displaying ManyInnerNodes :
5 nodes => 152 ms
10 nodes => 1526 ms
15 nodes => 11186 ms
Benchmark Displaying ManyInnerNodesAndEdges :
1 nodes => 9 ms
2 nodes => 239 ms
3 nodes => 3278 ms
4 nodes => 30492 ms
Benchmark Displaying elementAt :
100 nodes => 3 ms
500 nodes => 5 ms
1000 nodes => 9 ms
1500 nodes => 11 ms
2000 nodes => 14 ms
2500 nodes => 16 ms
Benchmark many small nodes :
2000 nodes => 2368 ms
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Hi Alex,
Previously I reported that the color of text does not appear as it should be, but light... You created the withoutBackground method that works but sometimes.
As I display small fonts, having blurred texts does not help
try this code...
(1 to: 10) do: [:n |
view shape rectangle
borderColor:[ :each| Color blue ].
view node: n forIt: [
view node: (n * 2) using: (view shape rectangle withoutBorder
withoutBackground;
fontColor:[ :each| Color red ];
text:[ :e| e asString ]).
]
].
cheers,
Veronica
Hi,
Alex, was trying a similar example in the easel, and what i found is that the problem of the "root interaction" is not in Mondrian but in Glamour.
Tudor, could you please take a look at this? (the first inspect does not work)
in the easel -> i can see the inspect of the root (first line).
view root interaction action: #inspect.
(1 to: 10) do: [:n |
view shape rectangle
borderColor:[ :each| Color blue ].
view interaction action: #inspect.
view node: n forIt: [
view interaction action: #inspect.
view node: (n * 2).
view shape rectangle withoutBorder.
view interaction action: #inspect.
view node: n forIt: [
view shape rectangle
borderColor:[ :each| Color green ].
view interaction action: #inspect.
view node: (n * 3) ].
view verticalLineLayout.
] ]
but if I draw this inside glamour can't
| browser |
browser := GLMTabulator withStatusbar.
browser column: #one.
browser showOn: #one; using: [
browser mondrian
painting: [:view :number|
view root interaction action: #inspect.
(1 to: number) do: [:n |
view shape rectangle
borderColor:[ :each| Color blue ].
view interaction action: #inspect.
view node: n forIt: [
view interaction action: #inspect.
view node: (n * 2).
view shape rectangle withoutBorder.
view interaction action: #inspect.
view node: n forIt: [
view shape rectangle
borderColor:[ :each| Color green ].
view interaction action: #inspect.
view node: (n * 3) ].
view verticalLineLayout.
] ]
] ].
browser openOn: 10
regards,
Veronica