comp.lang.ada
 help / color / mirror / Atom feed
* ANN: ASIS2XML 20041024a
@ 2004-10-24  7:05 Simon Wright
  2004-10-24 15:38 ` Martin Krischik
  0 siblings, 1 reply; 8+ messages in thread
From: Simon Wright @ 2004-10-24  7:05 UTC (permalink / raw)


ASIS2XML converts a unit's ASIS representation into XML, so as to make
it easier to develop transformational tools using (for example) XSLT.

As supplied, it relies on GNAT; the only ASIS-for-GNAT feature it
relies on is that Data_Decomposition.Size has been extended to work
for Subtype Indications; and that only so that it can work out how
many bytes a record component will occupy when streamed (this part is
in progress)

Not every ASIS feature is supported yet.

There is no XML Schema as yet (however, the output's structure follows
that of ASIS as determined from the Ada specs -- I'm not at all sure
this is the Right Thing for an XML representation).

This is an alpha release, and you can find it at
http://www.pushface.org/asis2xml/

-- 
Simon Wright                               100% Ada, no bugs.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ANN: ASIS2XML 20041024a
  2004-10-24  7:05 ANN: ASIS2XML 20041024a Simon Wright
@ 2004-10-24 15:38 ` Martin Krischik
  2004-10-24 17:08   ` Ian Sharpe
  2004-10-24 17:28   ` Simon Wright
  0 siblings, 2 replies; 8+ messages in thread
From: Martin Krischik @ 2004-10-24 15:38 UTC (permalink / raw)


Simon Wright wrote:

> ASIS2XML converts a unit's ASIS representation into XML, so as to make
> it easier to develop transformational tools using (for example) XSLT.
> 
> As supplied, it relies on GNAT; the only ASIS-for-GNAT feature it
> relies on is that Data_Decomposition.Size has been extended to work
> for Subtype Indications; and that only so that it can work out how
> many bytes a record component will occupy when streamed (this part is
> in progress)
> 
> Not every ASIS feature is supported yet.
> 
> There is no XML Schema as yet (however, the output's structure follows
> that of ASIS as determined from the Ada specs -- I'm not at all sure
> this is the Right Thing for an XML representation).

Well XMI would be cool. All important UML tool can import XMI. Also it is a
standart.

With Regards

Martin
-- 
mailto://krischik@users.sourceforge.net
http://www.ada.krischik.com




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ANN: ASIS2XML 20041024a
  2004-10-24 15:38 ` Martin Krischik
@ 2004-10-24 17:08   ` Ian Sharpe
  2004-10-24 17:40     ` Simon Wright
  2004-10-24 17:28   ` Simon Wright
  1 sibling, 1 reply; 8+ messages in thread
From: Ian Sharpe @ 2004-10-24 17:08 UTC (permalink / raw)


A transformation to XMI would certainly be interesting, but I think
that in practice such a thing would be specific to both the UML tool
and the intended use. For example it wouldn't allow ColdFrame
round-tripping 8-).

What kinds of use did you have in mind (both ASIS2XML itself and an
XMI-format representation)?

-- 
Ian Sharpe                  http://www.sharpe-practice.co.uk/isharpe/



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ANN: ASIS2XML 20041024a
  2004-10-24 15:38 ` Martin Krischik
  2004-10-24 17:08   ` Ian Sharpe
@ 2004-10-24 17:28   ` Simon Wright
  2004-10-25  7:27     ` Martin Krischik
  1 sibling, 1 reply; 8+ messages in thread
From: Simon Wright @ 2004-10-24 17:28 UTC (permalink / raw)


Martin Krischik <krischik@users.sourceforge.net> writes:

> Simon Wright wrote:
> 
> > ASIS2XML converts a unit's ASIS representation into XML, so as to make
> > it easier to develop transformational tools using (for example) XSLT.
> > 
> > As supplied, it relies on GNAT; the only ASIS-for-GNAT feature it
> > relies on is that Data_Decomposition.Size has been extended to work
> > for Subtype Indications; and that only so that it can work out how
> > many bytes a record component will occupy when streamed (this part is
> > in progress)
> > 
> > Not every ASIS feature is supported yet.
> > 
> > There is no XML Schema as yet (however, the output's structure follows
> > that of ASIS as determined from the Ada specs -- I'm not at all sure
> > this is the Right Thing for an XML representation).
> 
> Well XMI would be cool. All important UML tool can import XMI. Also
> it is a standart.

Where did I say XMI?!!

I can see the attraction of it, not that I'd thought of such a thing,
but it seems to me that a UML model is going to be (ought to be) a
representation of a problem domain at an abstraction level rather
higher than that of an Ada program. If it's at the same level, why not
just write Ada?

  Model------------------>Code-----------+
               ^                         |------->Executable
               |    Support libraries----+
               |
        Translation rules

There are all sorts of things you can say in Ada that have no natural
representation (that I'm aware of, anyway, though I'd be prepared to
be proved wrong) in UML; for example, a generic formal subprogram
parameter.

I'm pretty sure that XMI would allow communication at the syntactic
level but not at the semantic level. After all, to do anything really
helpful with UML you need a profile to say what the symbols (those in
the standard, and your extensions) actually mean.

The sort of thing I had in mind was where

   type Rec is record
      I : Integer;

turns into

    <ordinary_type_declaration>
      <defining_identifier>
        Rec
      </defining_identifier>
      <type_definition>
        <record_type_definition kind="ordinary_trait"/>
        <record_definition>
          <component_declaration>
            <defining_identifier>
              I
            </defining_identifier>
            <component_definition kind="ordinary_trait" size="32">
              <subtype_indication>
                <identifier>
                  Integer
                </identifier>
              </subtype_indication>
            </component_definition>
          </component_declaration>

From comments in the ASIS source pointed out to me elsewhere, the
lines 6-7 are like that because of (asis.ads)

--  The subordinate Trait_Kinds allow Declaration_Kinds and Definition_Kinds
--  to enumerate fewer higher level elements, and be less cluttered by all
--  possible permutations of syntactic possibilities. For example, in the case
--  of a record_type_definition, Definition_Kinds can provide just two literals
--  that differentiate between ordinary record types and tagged record types:

which isn't a good argument for an XML representation (I'm not sure
it's a good argument for an Ada representation, either, but that would
be second-guessing the standard).

-- 
Simon Wright                               100% Ada, no bugs.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ANN: ASIS2XML 20041024a
  2004-10-24 17:08   ` Ian Sharpe
@ 2004-10-24 17:40     ` Simon Wright
  0 siblings, 0 replies; 8+ messages in thread
From: Simon Wright @ 2004-10-24 17:40 UTC (permalink / raw)


Ian Sharpe <igs.net.news@ntlworld.com> writes:

> A transformation to XMI would certainly be interesting, but I think
> that in practice such a thing would be specific to both the UML tool
> and the intended use. For example it wouldn't allow ColdFrame
> round-tripping 8-).

I tend to agree; see remarks above.

> What kinds of use did you have in mind (both ASIS2XML itself and an
> XMI-format representation)?

The particular use which drove this was working out how a data
structure appears "on the wire" when streamed. Default streams are a
great choice when you don't need to know the representation; when you
do, it gets more traumatic.

I hope people round here won't be too upset if I say that ASIS is a
fantastic idea, but the Ada expression of it is _not_ going lead to
rapid tool development. How long would it take to set up something to
find all the record definitions and process them sorted by type name?
The XSLT for that (with ASIS2XML's "schema", where I've just converted
the enumeration literals by lowercasing them and removing any leading
a_ or an_) is

  <xsl:apply-templates select="//record_definition">
    <xsl:sort select="../../defining_identifier"/>
  </xsl:apply-templates>

-- 
Simon Wright                               100% Ada, no bugs.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ANN: ASIS2XML 20041024a
  2004-10-24 17:28   ` Simon Wright
@ 2004-10-25  7:27     ` Martin Krischik
  2004-10-25 11:58       ` Georg Bauhaus
  0 siblings, 1 reply; 8+ messages in thread
From: Martin Krischik @ 2004-10-25  7:27 UTC (permalink / raw)


Simon Wright wrote:

> Martin Krischik <krischik@users.sourceforge.net> writes:
> 
>> Simon Wright wrote:
>>ignoredSIS2XML converts a unit's ASIS representation into XML, so as to
make
>> > it easier to develop transformational tools using (for example) XSLT.
>> > 
>> > As supplied, it relies on GNAT; the only ASIS-for-GNAT feature it
>> > relies on is that Data_Decomposition.Size has been extended to work
>> > for Subtype Indications; and that only so that it can work out how
>> > many bytes a record component will occupy when streamed (this part is
>> > in progress)
>> > 
>> > Not every ASIS feature is supported yet.
>> > 
>> > There is no XML Schema as yet (however, the output's structure follows
>> > that of ASIS as determined from the Ada specs -- I'm not at all sure
>> > this is the Right Thing for an XML representation).
>> 
>> Well XMI would be cool. All important UML tool can import XMI. Also
>> it is a standart.
> 
> Where did I say XMI?!!

A little misunderstanding here: I was merely suggesting XMI as XML Schema
since you havn't got one yet.

> I can see the attraction of it, not that I'd thought of such a thing,
> but it seems to me that a UML model is going to be (ought to be) a
> representation of a problem domain at an abstraction level rather
> higher than that of an Ada program.

True, but UML should also be forward and reverse engeneerable to the actual
code. Otherwise it would not be of much use.

> If it's at the same level, why not 
> just write Ada?

UML can be used to give to an overvier over the programm. 

> There are all sorts of things you can say in Ada that have no natural
> representation (that I'm aware of, anyway, though I'd be prepared to
> be proved wrong) in UML; for example, a generic formal subprogram
> parameter.

Well UML has generic parameters it does not say much about the type. Which
is inline with the higher level view you where mentioning: There is a
generic parameter - details are left to the languages.

As for XMI: XMI allows user/language defined extentions where those details
can be described. They would be ignored when imported from tools which
don't know them
 
> I'm pretty sure that XMI would allow communication at the syntactic
> level but not at the semantic level. After all, to do anything really
> helpful with UML you need a profile to say what the symbols (those in
> the standard, and your extensions) actually mean.

UML has stereotypes for everything which is beyond the standart. XMI has
extentions where code generators and such like can keep there extra
information.

The real advantage would be the ability to display the model with any
program capable of XMI import - wich should render better then an normal
XML Browser.

With Regards

Martin
-- 
mailto://krischik@users.sourceforge.net
http://www.ada.krischik.com




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ANN: ASIS2XML 20041024a
  2004-10-25  7:27     ` Martin Krischik
@ 2004-10-25 11:58       ` Georg Bauhaus
  2004-10-25 19:24         ` Simon Wright
  0 siblings, 1 reply; 8+ messages in thread
From: Georg Bauhaus @ 2004-10-25 11:58 UTC (permalink / raw)


Martin Krischik wrote:

> The real advantage would be the ability to display the model with any
> program capable of XMI import - wich should render better then an normal
> XML Browser.

An advantage of XML is its accompanying standard XSL. :-)
If you know of a good way to translate the XML representation
of an Ada program into XMI, that is "just" a matter of
writing the corresponding XSL Transformation program.

Another nice side effect of having an XML representation of
an Ada program is that you can now generate FOs from the
XML output, and pass that on to formatters or transformers.
(This doesn't solve the problems of vertical formatting
(breaks, pages, etc.) though, if necessary.)
Still AFAICS, you would have to find your own way of adding
the all-important information in program text to the
XML-output: comments. ;-)

I'm really glad that somebody has found the time to produce
a tool that transforms ASIS information into an XML
representation. I think in the long run this will open doors
to many useful applications dealing with program information.

Thanks!

-- Georg



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ANN: ASIS2XML 20041024a
  2004-10-25 11:58       ` Georg Bauhaus
@ 2004-10-25 19:24         ` Simon Wright
  0 siblings, 0 replies; 8+ messages in thread
From: Simon Wright @ 2004-10-25 19:24 UTC (permalink / raw)


Georg Bauhaus <sb463ba@uni-duisburg.de> writes:

> I'm really glad that somebody has found the time to produce
> a tool that transforms ASIS information into an XML
> representation. I think in the long run this will open doors
> to many useful applications dealing with program information.
> 
> Thanks!

Thank you!

Actually, it wasn't that much work (about 10 hours, I think) -- mainly
because of deciding not to change the structure. Still -- enjoy!

-- 
Simon Wright                               100% Ada, no bugs.



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-10-25 19:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-24  7:05 ANN: ASIS2XML 20041024a Simon Wright
2004-10-24 15:38 ` Martin Krischik
2004-10-24 17:08   ` Ian Sharpe
2004-10-24 17:40     ` Simon Wright
2004-10-24 17:28   ` Simon Wright
2004-10-25  7:27     ` Martin Krischik
2004-10-25 11:58       ` Georg Bauhaus
2004-10-25 19:24         ` Simon Wright

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox