What do you think of this PetitParser example? Is there a better way to do
this?
Parse a string like '{"login", "bash"}' (an Applescript list) into a
collection of items (i.e. #("login" "bash))...
| delimiter item contents listParser result listClose |
delimiter := ', ' asParser.
listClose := $} asParser.
item := (delimiter / listClose) negate plus flatten.
contents := (item separatedBy: delimiter) ==> [ :nodes | nodes reject: [ :n
| n = ', ' ] ].
listParser := ${ asParser, contents optional, listClose ==> #second.
result := listParser parse: returnString.
^ result isNil
ifTrue: [ OrderedCollection new ]
ifFalse: [ result collect: [ :e | self processAtom: e ] ].
Thanks.
Sean
--
View this message in context: http://forum.world.st/PetitParser-Example-tp4420008p4420008.html
Sent from the Moose mailing list archive at Nabble.com.
Hi,
Recently, I received all sorts of questions related to how to use Moose in practical settings. Many of the answers are provided on the humane assessment website. In particular, I am trying to update the blog continuously both with demos and with stories from the engineering trenches.
If you want to stay up to date register to the RSS feed:
http://www.humane-assessment.com/blog/?view=PBEntriesRssView
or follow the @humaneA on Twitter:
http://twitter.com/humaneA
And of course, I would be happy to answer more questions, and to hear more of your stories, too.
Cheers,
Doru
--
www.tudorgirba.com
"In a world where everything is moving ever faster,
one might have better chances to win by moving slower."
Hi,
I just wanted to let you know that the Glamour and Metanool (transformation engine between Fame and Magritte) are now using Magritte 3.
Consequently, in the latest Moose image you will find Magritte 3.
Cheers,
Doru
--
www.tudorgirba.com
Things happen when they happen,
not when you talk about them happening.
Hi all,
I have a meta-model implemented as a UML profile and i would like to
use this meta-model in MOOSE/Pharo.
Is there anyway to convert this meta-model in FM3 or i have to do it by hand ?
Regards,
--
Serge Stinckwich
UMI UMMISCO 209 (IRD/UPMC), Hanoi, Vietnam
Matsuno Laboratory, Kyoto University, Japan (until 12/2011)
http://www.mechatronics.me.kyoto-u.ac.jp/
Every DSL ends up being Smalltalk
http://doesnotunderstand.org/
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 778 by fabrizio...(a)gmail.com: FAMIXAssociation should not
implement sourceAnchor
http://code.google.com/p/moose-technology/issues/detail?id=778
FAMIXAssociation should not implement sourceAnchor.
Status: New
Owner: tudor.gi...(a)gmail.com
Labels: Type-Defect Priority-Medium Component-Glamour Milestone-4.7
New issue 779 by tudor.gi...(a)gmail.com: Glamour listing should update the
morph
http://code.google.com/p/moose-technology/issues/detail?id=779
The morphic rendering does not properly update the list in the morph tree
morph. This is due to changes in the morphtreemorph internal structure.
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium Component-Glamour Milestone-4.7
New issue 777 by tudor.gi...(a)gmail.com: Pagination does not work for
ListingPresentation
http://code.google.com/p/moose-technology/issues/detail?id=777
When rendering a list with many items, specifying showOnly: does not have
any effect.
To reproduce the problem:
GLMFinder new
show: [:a |
a list display: [:x | 1 to: x ]; showOnly: 100 ];
openOn: 1000
Hi,
There is some code in moose (in FMDefaultCodeGenerator) which use
ORChangesBrowser but the class is not in the system. Was the class removed
in 1.4 or we do not load the proper package?
Cheers,
Fabrizio