Results 1 to 7 of 7

Thread: slice2xml or SliceScript

  1. #1
    n2503v is offline Registered User
    Name: Alex Makarenko
    Organization: ACFR, University of Sydney
    Project: Orca
    Join Date
    Jun 2005
    Posts
    134

    slice2xml or SliceScript

    I'm looking for a way to auto-generate code based on Slice definitions. In our project we currently have about 50 Slice interfaces with associated data types. We also have a few utility libraries which operate on each interface. Examples:
    - implementation: "standard" implementations of Slice interfaces
    - logging: subscribe to each interface and store the received data type
    - debugging: we have a tool which allows to connect to an object and "probe" each method.
    - display: a library of toString() functions for each custom data type.

    This type of code tends to be very repetitive (boring). Constant changes in the interfaces lead to a sizable workload. This begs for some soft of scriptable code generation based on Slice definitions. There're probably different way of doing it -- I am not a computer scientist.

    E.g. would it be possible to define an XML descriptor for Slice? A slice2xml parser could convert .ice files to XML. That would be much easier for me to parse and use the contents to do what I want (compared to .ice files themselves). Of course, it would be even better if an XML parser (C++ or python or whatever) was included.

    cheers, alex
    Alex Makarenko
    Marathon Robotics
    project: multi-robot systems

  2. #2
    matthew's Avatar
    matthew is offline ZeroC Staff
    Name: Matthew Newhook
    Organization: ZeroC, Inc.
    Project: Internet Communications Engine
    Join Date
    Feb 2003
    Location
    NL, Canada
    Posts
    1,458
    Why do you think it would be easier to parse & act on the contents of an XML file rather implementing a generator based on the existing slice generators? The generator itself is an implementation of the visitor pattern which is, after all, how any SAX based XML parser works (only with more slice specific context based callbacks).

  3. #3
    n2503v is offline Registered User
    Name: Alex Makarenko
    Organization: ACFR, University of Sydney
    Project: Orca
    Join Date
    Jun 2005
    Posts
    134
    I've done a couple of XML parsers before and it wasn't a big deal. In particular, I recently adapted the IceGrid descriptor parser to my needs and it was a pleasure to work with.

    My only experience with parsers for C-like syntax is the one in Doxygen and it's not something I ever want to look at again. To be honest, I haven't looked how slice2* utilities work. I'll give it a go.

    thanks
    Alex Makarenko
    Marathon Robotics
    project: multi-robot systems

  4. #4
    marc's Avatar
    marc is offline ZeroC Staff
    Name: Marc Laukien
    Organization: ZeroC, Inc.
    Project: The Internet Communications Engine
    Join Date
    Feb 2003
    Location
    Florida
    Posts
    1,860
    Note that the Slice parser API is an internal API, which is not really intended to be used by Ice developers. In other words, this API is neither documented nor supported, and might change without notice. (We might add an "official" API for the Slice parser for some future Ice release.)

  5. #5
    n2503v is offline Registered User
    Name: Alex Makarenko
    Organization: ACFR, University of Sydney
    Project: Orca
    Join Date
    Jun 2005
    Posts
    134
    Quote Originally Posted by marc View Post
    We might add an "official" API for the Slice parser for some future Ice release.
    This would be great. Thanks.
    Alex Makarenko
    Marathon Robotics
    project: multi-robot systems

  6. #6
    joshmoore is offline Registered User
    Name: Josh Moore
    Organization: Glencoe Software, Inc.
    Project: OMERO, http://trac.openmicroscopy.org.uk/omero
    Join Date
    Feb 2007
    Location
    Germany
    Posts
    115
    If I many, +1

    Currently our build system generates slice files from an internal XML format. Obviously, if slice had an API it could prove to be far more efficient. Would it be possible to get access to non-standard metadta in such an API?

    Code:
    module A {
        class B {
            ["ourmetdata"] long id;  
        };
    };

  7. #7
    marc's Avatar
    marc is offline ZeroC Staff
    Name: Marc Laukien
    Organization: ZeroC, Inc.
    Project: The Internet Communications Engine
    Join Date
    Feb 2003
    Location
    Florida
    Posts
    1,860
    Yes, if we would add such an API, then it would certainly be possible to access custom metadata.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. slice2xml transformer
    By mwilson in forum Projects
    Replies: 2
    Last Post: 07-09-2010, 12:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •