comp.lang.ada
 help / color / mirror / Atom feed
From: olivea!charnel!rat!koko.csustan.edu!nic.csu.net!vmsa.is.csupomona.edu!lin @ames.arc.nasa.gov  (Johnny Lin)
Subject: Re: Two "Simple" I/O Questions
Date: 5 Feb 93 17:04:00 GMT	[thread overview]
Message-ID: <5FEB199309042794@vmsa.is.csupomona.edu> (raw)

In article <1993Feb5.083009.26460@cs.ucla.edu>, gast@CS.UCLA.EDU (David Gast) w
rites...
>Essentially, I just want a program like "cp" or "cat".  All it has
>to do is copy the input to the output.  I have found two problems.
> 
>1) Text_IO does not handle 8-bit characters.  Is there another
>   package which does?

really?  I didn't know that.  It sounds interesting to investigave about it.

>2) If there are multiple <eol>s at the end of a file, only one
>   get reads.  A skipline at this point skips over all the trailing
>   <eol>s.  There is a sample program in a book which says it copies
>   input to output exactly, but it fails on this case.  Perhaps it
>   is a compiler error.  Any solutions?

I disagree that skip_line would skip over all the trailing <eol>s.  I just
did project which has a multiple <eol>s and it didn't skip all when I tested
it.
The following is a part of lexical analyzer of compiler which I am writing.
This code reads a file throught the standard input and loads the info into
the assigned buffer.

      for i in 0 .. BLOCK_SIZE - 1 loop
        if END_OF_FILE then
          BUFFER (LEX_END + i) := ASCII.EOT;
          exit;
        elsif END_OF_LINE then
          BUFFER (LEX_END + i) := ASCII.CR;
          SKIP_LINE;
        else
          GET (BUFFER (LEX_END + i));
        end if;
      end loop;

>Thanks
> 
>David
> 
>gast@cs.ucla.edu

I hope this helps.

Johnny

internet : LIN@CSUPomona.edu
packet   : KC6DMH @ N6CUS.#SOCA.CA.USA.NA

             reply	other threads:[~1993-02-05 17:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-02-05 17:04 Johnny Lin [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-02-07  2:09 Two "Simple" I/O Questions Erik Magnuson
1993-02-05  8:30 gast
replies disabled

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