comp.lang.ada
 help / color / mirror / Atom feed
* Programs wanted
@ 1993-01-25 23:03 pk115050
  0 siblings, 0 replies; 4+ messages in thread
From: pk115050 @ 1993-01-25 23:03 UTC (permalink / raw)


I am looking for two pieces of source code, preferably written in C (though
not necessary):

1. Determine the number of nodes and edges that are present in a piece of
ADA code.

2. Determine the following from a piece of ADA code:
   A. The number of unique operators.
   B. The number of unique operands.
   C. The total number of operators.
   D. The total number of operands.

Any help will be appreciated.

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

* Re: Programs wanted
@ 1993-01-26  1:57 David Emery
  0 siblings, 0 replies; 4+ messages in thread
From: David Emery @ 1993-01-26  1:57 UTC (permalink / raw)


Consider 
  package P is
	type I1 is new integer;
	-- "+" now redefined for objects of type I1
	function "+" (l :I1; r : integer) return I1;
	function "+" (l: integer; r : I1)  return I1;
  end P;

  with P; use P;
  procedure Q is
    X, Y : I1 := 1;
    I, J : Integer := 2;
    MAGIC_NUMBER : constant := 42;
  begin
    X := X + I;
    X := X + 1;
    X := MAGIC_NUMBER + Y;
    Y := X + J;
    I := integer(X) + integer(Y);
  end Q;

How many unique operators are there in this code???  Almost any answer
to this question involves enough semantic analysis to resolve Ada
overloading.  That's a good-sized chunk of an Ada compiler.  

				dave

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

* Re: Programs wanted
@ 1993-01-26 13:35 David B Rodman
  0 siblings, 0 replies; 4+ messages in thread
From: David B Rodman @ 1993-01-26 13:35 UTC (permalink / raw)


In article <1993Jan25.180334.4567@wvnvms.wvnet.edu> pk115050@wvnvms.wvnet.edu w
rites:
>
>1. Determine the number of nodes and edges that are present in a piece of
>ADA code.
>
>2. Determine the following from a piece of ADA code:
>   A. The number of unique operators.
>   B. The number of unique operands.
>   C. The total number of operators.
>   D. The total number of operands.
>
>Any help will be appreciated.
>

I have to agree with Dave Emery, what you are asking for is alot. I doubt 
that you will be able to find source to do this, however you may find $$$$ tool
s
that will help. You could start with paul@reasoning.com . I understand that the
y 
have a new ada parser for their tool set. There may be other companies providin
g 
similar types of services.

David Rodman
My opinions are my own and not endorsed or sponsored by my employer. Besides wh
o 
would pay for them.
 

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

* Re: Programs wanted
@ 1993-01-26 23:35 Rob Spray
  0 siblings, 0 replies; 4+ messages in thread
From: Rob Spray @ 1993-01-26 23:35 UTC (permalink / raw)


In <1993Jan26.133513.5440@linus.mitre.org> drodman@hotel.mitre.org (David B Rod
man) writes:

>In article <1993Jan25.180334.4567@wvnvms.wvnet.edu> pk115050@wvnvms.wvnet.edu 
writes:
>>
>>1. Determine the number of nodes and edges that are present in a piece of
>>ADA code.
>>
>>2. Determine the following from a piece of ADA code:
>>   A. The number of unique operators.
>>   B. The number of unique operands.
>>   C. The total number of operators.
>>   D. The total number of operands.
>>
>>Any help will be appreciated.
>>

>I have to agree with Dave Emery, what you are asking for is alot. I doubt 
>...

Hmm, from the original poster's address that looks like a student
account.  A new semester has started, so it would not be unreasonable
to presume that some student is turning to The Net to get a head start
on some project.  It wouldn't be the first time.  (I recall one flamefest
a while back where some professor requested netters not to respond
to some student request for information saying that he should find
it by himself.  Of course one outcome was to spur folks like me into
action and send reams of references to the student, since asking the
Net seemed like a perfectly bona fide method of research.  But, I digress!)

As the Daves have pointed out, the scope of the request is far larger 
than I suspect the poster anticipates.  Maybe the educator posed the problem
and let the student pick the language, in which case, education has
already taken place!  But what if the problem was posed using ADA(sic).
How does this reflect upon the "educator"?

Tell me I'm presuming too much.

--Rob   spray@convex.com

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

end of thread, other threads:[~1993-01-26 23:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1993-01-25 23:03 Programs wanted pk115050
  -- strict thread matches above, loose matches on Subject: below --
1993-01-26  1:57 David Emery
1993-01-26 13:35 David B Rodman
1993-01-26 23:35 Rob Spray

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