[Oberon] XML Parser-API for OBERON

Jörg Straube joerg.straube at iaeth.ch
Tue Jan 19 08:37:16 CET 2016


Dieter

Deine Aufgabe besteht eigentlich aus zwei Teilen
1) Syntax: Lowlayer Ein- und Ausgabe der zwei Sprachen (XML und TeX)
2) Semantik: Umwandeln bzw Mappen der beiden unterschiedlichen Datenmodelle beider Sprachen
   XML scheint mir nach Stimme bzw Instrument sortiert, TeX scheint nach Takt sortiert.

Du hast das richtig erkannt, dass du eine Art Objektmodell (du nanntest es Datenbank) als temporären Zwischenspeicher brauchst, das die Info aus beiden Datenmodellen beinhaltet.
Nehmen wir mal an, das ganze Ave Maria hätte im Hauptspeicher Platz, dann brauchst du eine Routine, die das XML parst und mit der Hilfe vielen NEW()s als Objektmodell mit entsprechend Verlinkungen zum einfachen Navigieren innerhalb des Objektmodells im Hauptspeicher ablegst.
Im zweiten Schritt liest eine andere Routine das Objektmodell in der von TeX geforderten Reihenfolge aus und generiert den TeX-Text.

Das ist eigentlich vergleichbar mit einem Compiler: Er liest ASCII-Quelltext ein und gibt RISC5-Assemblercode aus :-)
Auch da hast du einen Scanner, der die Lowlayer Syntax beherrscht (in dienem Fall XML) und einen Parser, der sich um die Semantik kümmert. (in deinem Fall die Instrumente und Takte)

Wenn das Ave Mara nicht im Hauptspeicher Platz findet, wird’s komplizierter, da du dann entweder das Objektmodell in einer Datei zwischenspeichern musst, oder du das XML immer wieder von Beginn weg parst bis du bei dem Takt angelangt bist, den du via TeX gerade rausschreiben willst.

Gruss
Jörg
> Am 18.01.2016 um 10:44 schrieb Dieter <d.gloetzel at web.de>:
> 
> Doug,
> 
> you are right. I should express myself more clearly.
> 
> My overall theme is typesetting musical notes. There exists a description language called "MusicXML" developed by RECORDARE Inc., which can be exported from several musical typesetting systems.
> And there is a TeX based musical typesetting system called "MusiXTeX" with a preprocessor called "PMX".
> 
> I want to convert MusicXML as input to PMX. I have solved my problem already by brute force Oberon programming, but I wonder whether there is a more elegant way to do it.
> My program is pretty long,  and several times I hit the compiler limit of 64K for module size already. Also the modular layout may be less then optimal.
> 
> I am looking for something like a  database which makes accessible the contents of the MusicXML file.
> 
> I.e. answering questions like "What is the pitch and duration of the 25th note in measure 10 of instrument 7?"
> 
> I attach an example.
> 
> It would be great, if somebody could share his experience in XML programming with Oberon.
> 
> Regards,
> Dieter
> 
> P.S.: I am using ETHOberon 2.5 plugin for Windows.
> 
> 
> Am 18.01.2016 um 00:28 schrieb Dougls G. Danforth:
>> Dieter,
>> Your question is ambiguous.
>> Do you mean a parser of Oberon written in XML?
>> If so what is the output of the parser?
>> Or do you mean a parser of Oberon that generates XML?
>> 
>> -Doug Danforth
>> 
>> On 1/17/2016 7:57 AM, Dieter wrote:
>>> I wonder wether anybody on this mailing list knows about the existence of an XML Parser API for Oberon.
>>> 
>>> Thanks and regards,
>>> Dieter Glötzel
>>> 
>>> -- 
>>> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
>>> https://lists.inf.ethz.ch/mailman/listinfo/oberon
>>> 
>> 
>> -- 
>> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
>> https://lists.inf.ethz.ch/mailman/listinfo/oberon
>> 
> 
> 
> -- 
> ____________________________________
> Dr. Dieter Glötzel
> Im Rosengarten 27
> 64367 Mühltal
> Tel.: 06151 / 360 82 72
> 
> <SchbAvMaSample.xml><AveMariaY.PMX><AveMariaY.pdf>--
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3579 bytes
Desc: not available
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20160119/8ce572c1/attachment.p7s>


More information about the Oberon mailing list