comp.lang.ada
 help / color / mirror / Atom feed
* Help on ada programming!
@ 1994-09-24 15:54 Peter Miller
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Miller @ 1994-09-24 15:54 UTC (permalink / raw)


I am not familiar with ada and have to do a class assigment in the language. 
Does ada have a way to peek ahead in the input stream or get and put back 
characters from an input stream.

Anyone who could reply I would really appricaiate it.

Peter Miller
Peter.Miller@Colorado.edu
 
-- 
                                                        \|/
                                                       (o o)                
===================================================oOo==(_)==oOo===========
Peter M. Miller                                          Home: 303-444-3897



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

* Re: Help on ada programming!
       [not found] <millerpe.780422093@spot.colorado.edu>
@ 1994-09-24 20:57 ` Bob Duff
  1994-09-24 21:43   ` Michael Feldman
  1994-09-27  4:21   ` Sean McNeil
  0 siblings, 2 replies; 4+ messages in thread
From: Bob Duff @ 1994-09-24 20:57 UTC (permalink / raw)


In article <millerpe.780422093@spot.colorado.edu>,
Peter Miller <millerpe@spot.Colorado.EDU> wrote:
>I am not familiar with ada and have to do a class assigment in the language. 
>Does ada have a way to peek ahead in the input stream or get and put back 
>characters from an input stream.
>
>Anyone who could reply I would really appricaiate it.

Ada 83 does not have any standard way to do that, but your vendor might
provide an extension to do it.

Ada 94 has such features -- check out Look_Ahead in RM9X-A.10.7.
-- 
Bob Duff                                bobduff@inmet.com
Oak Tree Software, Inc.
Ada 9X Mapping/Revision Team (Intermetrics, Inc.)



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

* Re: Help on ada programming!
  1994-09-24 20:57 ` Help on ada programming! Bob Duff
@ 1994-09-24 21:43   ` Michael Feldman
  1994-09-27  4:21   ` Sean McNeil
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Feldman @ 1994-09-24 21:43 UTC (permalink / raw)


In article <CwnJJy.J3x@inmet.camb.inmet.com>,
Bob Duff <bobduff@dsd.camb.inmet.com> wrote:
>In article <millerpe.780422093@spot.colorado.edu>,
>Peter Miller <millerpe@spot.Colorado.EDU> wrote:
>>I am not familiar with ada and have to do a class assigment in the language. 
>>Does ada have a way to peek ahead in the input stream or get and put back 
>>characters from an input stream.
>>
>>Anyone who could reply I would really appricaiate it.
>
>Ada 83 does not have any standard way to do that, but your vendor might
>provide an extension to do it.

Well, it depends on whether you _really_ have to look ahead in the
input stream. There are certainly operations in Ada 83 Text_IO to:

- read an entire line into a string, which you can use as your own
  "input buffer" (Get_Line(....))

- parse/convert numeric or enumeration tokens from a string (or string
  slice) just as you can from the _real_ input stream (Get(S,...))

- move around in the string, so you can directly control the "input 
  pointer", looking forward or back as the case requires.

Take a look at the full specification for Text_IO. The LRM and most
textbooks provide it; in the textbook case, usually in an appendix.
You may be unaware of the "goodies" there.

Are you sure this isn't what your instructor meant?

Mike Feldman
------------------------------------------------------------------------
Michael B. Feldman -  chair, SIGAda Education Working Group
Professor, Dept. of Electrical Engineering and Computer Science
The George Washington University -  Washington, DC 20052 USA
202-994-5919 (voice) - 202-994-0227 (fax) - mfeldman@seas.gwu.edu (Internet)
NOTE NEW PHONE NUMBER.
"Pork is all that stuff the government gives the other guys."
------------------------------------------------------------------------



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

* Re: Help on ada programming!
  1994-09-24 20:57 ` Help on ada programming! Bob Duff
  1994-09-24 21:43   ` Michael Feldman
@ 1994-09-27  4:21   ` Sean McNeil
  1 sibling, 0 replies; 4+ messages in thread
From: Sean McNeil @ 1994-09-27  4:21 UTC (permalink / raw)



I suggest that you take a look at some output from AFlex/AYacc generated
code.  It does some look-ahead.  If you can get away with it, I also
suggest that you use these tools to finish your class project.

Sean McNeil



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

end of thread, other threads:[~1994-09-27  4:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <millerpe.780422093@spot.colorado.edu>
1994-09-24 20:57 ` Help on ada programming! Bob Duff
1994-09-24 21:43   ` Michael Feldman
1994-09-27  4:21   ` Sean McNeil
1994-09-24 15:54 Peter Miller

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