Looks cool.
- I would put the drop-down list with classes on top, seem to be strange to read from the bottom. - Editing a production does not seem to work. The method definition disappears and graph and example are broken. - I missed production protocols already in the old browser. - The start production is somehow missing in the list. - Also useful would be a static tree with the references in the leaves - Inspecting a parse result inspects a GLMMultiValue. - There should be a button to expand the debug trace, at least to a given level.
Below my suggestion for the remove-production refactoring:
remove: aSymbol in: aClass | references | references := aClass new productionNames values intersection: (aClass whichSelectorsReallyRead: aSymbol). references notEmpty ifTrue: [ (self confirm: 'The following production(s) refer to ' , aSymbol printString , ':' , String cr , ((references collect: [ :each | each printString ]) fold: [ :a :b | a , ', ' , b ]) , '. Really delete?') ifFalse: [ ^ self ] ]. (aClass instVarNames includes: aSymbol) ifTrue: [ aClass removeInstVarNamed: aSymbol ]. (aClass selectors includes: aSymbol) ifTrue: [ aClass removeSelector: aSymbol ]
Lukas
On 6 December 2011 22:53, Tudor Girba tudor@tudorgirba.com wrote:
Hi,
I just wanted to let you know that I started to rework the PetitParser browser.
There are several things that have changed:
- it is modular, currently being formed of 3 distinct browsers. To give
them a try (I also attached a couple of screenshots): PPAllParsersBrowser open. PPParserBrowser openOn: PPArithmeticParser. PPParserInspector openOn: PPArithmeticParser new.
- it only relies on the Glamour mechanisms without state in the
implementation code. This was more of a validation that the engine is expressive enough
it has a slightly different layout
the Mondrian map can be used as a navigation, so clicking on a node will
focus the browser on that production.
- it uses a tree widget for the debugger so we can scale for large
debugging traces
What is still to do:
- install the associated instance variable for each newly created
production.
- introduce parser renaming refactoring. This would entail triggering both
a method and an instance var rename.
- add the possibility to remove a production. This would entail removing a
method and the corresponding instance var.
- make the morph graph view interactive.
- add a new grammar class.
- integrate tests for each production. This would involve being able to
browse tests associated to a production, run, add and remove them.
If these would work, we would have a true IDE and for most parts we would not need the Smalltalk editor for building parsers. But, I could use some help on the todos left, especially on the refactorings.
Cheers, Doru
-- www.tudorgirba.com
"Presenting is storytelling."
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev