comp.lang.ada
 help / color / mirror / Atom feed
* Re: nextc, getc and ungetc
  1999-02-03  0:00 nextc, getc and ungetc Jeremy D. Mullin
@ 1999-02-03  0:00 ` James S. Rogers
  1999-02-03  0:00 ` dennison
  1 sibling, 0 replies; 3+ messages in thread
From: James S. Rogers @ 1999-02-03  0:00 UTC (permalink / raw)


There is no equivalent to ungetc in the Ada.Text_IO package.
The equivalent to getc is the get procedure for type character.
The way you read the next character without advancing the file pointer
is the procedure Look_Ahead.

Jim Rogers
Colorado Springs, Colorado

Jeremy D. Mullin wrote in message <798dvo$loq$1@netra.msu.montana.edu>...
> I am writing a scanner in Ada and was wondering if there was a "peek"
>function I could use to get a char from the input file but not move the
>file pointer. I found definitions for nextc, getc and ungetc in the
>text_io package but they are private declarations.
> Does anyone know of the package/methods I should be using or of any
>resources on the web that might help me?
>
> TIA,
>  J.D.
>--






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

* Re: nextc, getc and ungetc
  1999-02-03  0:00 nextc, getc and ungetc Jeremy D. Mullin
  1999-02-03  0:00 ` James S. Rogers
@ 1999-02-03  0:00 ` dennison
  1 sibling, 0 replies; 3+ messages in thread
From: dennison @ 1999-02-03  0:00 UTC (permalink / raw)


In article <798dvo$loq$1@netra.msu.montana.edu>,
  orion@cs.montana.edu (Jeremy D. Mullin) wrote:
>  I am writing a scanner in Ada and was wondering if there was a "peek"
> function I could use to get a char from the input file but not move the
> file pointer. I found definitions for nextc, getc and ungetc in the
> text_io package but they are private declarations.
>  Does anyone know of the package/methods I should be using or of any
> resources on the web that might help me?

If you want that kind of flexibility, you should look into using direct_io
instead.

T.E.D.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




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

* nextc, getc and ungetc
@ 1999-02-03  0:00 Jeremy D. Mullin
  1999-02-03  0:00 ` James S. Rogers
  1999-02-03  0:00 ` dennison
  0 siblings, 2 replies; 3+ messages in thread
From: Jeremy D. Mullin @ 1999-02-03  0:00 UTC (permalink / raw)


 I am writing a scanner in Ada and was wondering if there was a "peek"
function I could use to get a char from the input file but not move the
file pointer. I found definitions for nextc, getc and ungetc in the
text_io package but they are private declarations.
 Does anyone know of the package/methods I should be using or of any
resources on the web that might help me?

 TIA,
  J.D.
-- 




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

end of thread, other threads:[~1999-02-03  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-02-03  0:00 nextc, getc and ungetc Jeremy D. Mullin
1999-02-03  0:00 ` James S. Rogers
1999-02-03  0:00 ` dennison

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