1 / 10

Z to SAL conversion

Z to SAL conversion. Hamouda Chantar Abbas Wali Yogesh Sharma Alfonso Sosa. Review. We are interested in translating ZML into SAL. What we need: Knowledge about XML and schemas. Knowledge about Visitor Pattern. CZT parser. XML and Schemas.

andra
Download Presentation

Z to SAL conversion

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Z to SAL conversion HamoudaChantar AbbasWali Yogesh Sharma Alfonso Sosa

  2. Review • We are interested in translating ZML into SAL. • What we need: • Knowledge about XML and schemas. • Knowledge about Visitor Pattern. • CZT parser.

  3. XML and Schemas • XML is a markup language for structuring and exchanging data. • Its textual format allows it to be understandable by both computers and humans. • It is defined with DTDs or Schemas (newer). • It allows cross-platform communication (e.g. Web services).

  4. Schema • It is a document for describing XML documents. • It is itself, an XML document. • The ZML from CZT project is defined with it. • More information on the wiki.

  5. Example • Birthday Book Example: • http://nt-appn.comp.nus.edu.sg/fm/zml/birthdaybook(full).xml

  6. Visitor Pattern • A behaviour design pattern • It helps us reuse code and add more functionality to the existing classes with out changing any of them • We can divide the operation into 2 stages • The set-up process & • The actual operation flow

  7. The set-up • Make a Visitor hierarchy. • Make the Elements available for visiting. • The elements will have an accept (Visitor v) method • The visitors will handle the actual Elements.

  8. Actual operation and flow • The actual flow will start by calling the visit method in the Visitors. • Polymorphism will resolve to the right kind of visitor. • The visitors will resolve to the right kind of Element (in Java, this can be done with function overloading). • More information on the wiki

  9. CZT Parser • Uses a custom Visitor Pattern • Can read from XML and make the AST available to visit. • This will allow to generate SAL code.

  10. What’s next? • Use the CZT library. • We are having problems with identifying how to parse the ZML documents. • Documentation is scarce. • We have not identified at what point our visitor should be invoked. • We need to define a subset of Z to translate (reviewing the current parser would be useful).

More Related