PackageDescription: PetitParser2(Bundle)


Petit Parser 2

Last published: November 5, 2018 by 'stm'


This is a port of PetitParser2: https://github.com/kursjan/petitparser2
It consists of 5 bundles:
* PetitParser2
* PetitParser2-Tests
* PetitParser2-JSON
* PetitParser2-Smalltalk (defunct, test support only)
* PetitParser2-Validation (defunct, test support only)

PetitParser2 was developed by Jan Kurš.
The port was initially done by Steffen Märcker using Pharo2VW: https://github.com/ObjectProfile/Pharo2VW

# Porting
The process is as follows:

1. Export PP2 in Pharo using script 1 below
2. Creage bundles PetitParser2(-Tests,-Smalltalk,-Validation)
3. Load PetitParser2(-Tests)-Preload
4. File in PP2 code
5. Create packages using script 2 below
6. Load PetitParser2(-Tests)-Postload
7. Move packages to bundles and check prerequisites
- Move references to PetitParser2-Smalltalk to package PetitParser2-Smalltalk-Core

# Script 1 (Pharo export)

Pharo2VW exporter
directory: FileSystem disk workingDirectory/'exports';
namespace: 'PetitParser2';
externalNamespaces: #('PetitParser2');
classNameMapperDo: [:mapper | mapper at: TestResource putNamespace: #SUnit ];
packages: #('PetitParser2'
'PetitParser2-Tests'
'PetitParser2-Validation'
'PetitParser2-Smalltalk');
methodsBlacklist: {"Pharo GUI"
PP2CharSetPredicate >> #gtAcceptedChars: .
PP2RecordingContext >> #gtCacheReport: .
PP2RecordingContext >> #gtEventsMorph: .
PP2RecordingContext >> #gtEventsTable: .
PP2RecordingContext >> #gtRememberTallyIn: .
PP2RecordingContext >> #gtReport: .
PP2RecordingContext >> #gtTallyIn: .
PP2RecordingContext >> #asEventsMorph .
PP2Node >> #displayColor .
PP2Node >> #gtInspectorParserInspectorIn: .
PP2Node >> #gtNamedTreeViewIn: .
PP2Node >> #gtProperties: .
PP2Node >> #gtTreeViewIn: .
PP2Node >> #gtWarningsIn: .
PP2Node >> #viewAllNamedParsersWithSelection:previewing:on: .
PP2Node >> #morphicProduction .
PP2Node >> #morphicShapeDefault .
PP2Node >> #morphicShapeSeen:depth: .
PP2Node >> #morphicShapeSeen:depth:do: .
PP2Node >> #newColumnMorph .
PP2Node >> #newRowMorph .
PP2Node >> #newSpacerMorph .
PP2Node >> #namedChildren .
PP2DelegateNode >> #morphicShapeSeen:depth: .
PP2EpsilonNode >> #morphicShapeSeen:depth: .
PP2ChoiceNode >> #morphicShapeSeen:depth: .
PP2SequenceNode >> #morphicShapeSeen:depth: .
PP2Context >> #gtDebugView: .
PP2Context >> #gtGlobals: .
PP2Context >> #gtProperties: .
PP2Context >> #gtResultIn: .
PP2Context >> #gtSampleIn:result: .
PP2Context >> #gtTabsIn: .
PP2Context >> #gtText: .
PP2Context >> #gtTraceIn: .
PP2Context >> #gtTreeViewIn: .
PP2Failure >> #gtDebugView: .
PP2Failure >> #gtSampleIn:result: .
PP2Failure >> #gtTabsIn: .
PP2Failure >> #gtTraceIn: .
PP2Failure >> #gtTreeViewIn: .
PP2InMemoryContext >> #gtDebugView: .
PP2InMemoryContext >> #gtGlobals: .
PP2InMemoryContext >> #gtProperties: .
PP2InMemoryContext >> #gtResultIn: .
PP2InMemoryContext >> #gtSampleIn:result: .
PP2InMemoryContext >> #gtTabsIn: .
PP2InMemoryContext >> #gtText: .
PP2InMemoryContext >> #gtTraceIn: .
PP2InMemoryContext >> #gtTreeViewIn: .
PP2Token >> #color .
PP2Token >> #color: .
PP2UnresolvedNode >> #displayColor .
PP2DebugResult >> #formattedText .
PP2DebugResult >> #gtTraceIn: .
PP2DebugResult >> #asEventsMorph .
PP2DebugResult >> #gtDebugView: .
PP2DebugResult >> #gtSampleIn:result: .
PP2DebugResult >> #gtTabsIn: .
PP2DebugResult >> #gtTreeViewIn: .
PP2DebugResultLink >> #formattedText .
PP2DebugResultLink >> #asEventsMorph .
PP2EventsTrace >> #colorForEvent: .
PP2EventsTrace >> #eventsMorph: .
PP2ContextTest >> #testGtDebugView .
PP2DebugResultIntegrationTest >> #testGtCacheReport .
PP2InMemoryContextTest >> #testGtDebugView .
PP2RecordingContextTest >> #testGtCacheReport .
PP2RecordingContextTest >> #testGtDebugView .
PP2RecordingContextTest >> #testGtEventsMorph .
PP2RecordingContextTest >> #testGtReportIn .
"Zinc integration"
PP2HtmlHeaderGrammar class >> #example .
PP2HtmlHeaderGrammarTest >> #testZincClientIntegration .
"Undefined"
"PP2AbstractStrategy >> #reparsable ."};
export.


# Script 2 (VisualWorks package creation)

| main classes packages cat pkg |
main := Registry bundleNamed: 'PetitParser2'.
classes := main allClasses.
packages := Dictionary new.
classes do:
[:cls |
cat := cls myClass category asString.
(cat beginsWith: 'PetitParser2')
ifTrue:
[pkg := packages at: cat
ifAbsentPut:
[| p |
p := Registry packageNamedOrCreate: cat.
main addItem: p.
p].
XChangeSet current moveWholeClass: cls toPackage: pkg]].