home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ogicse!usenet.coe.montana.edu!giac1.oscs.montana.edu!fortran
- From: fortran@giac1.oscs.montana.edu (Lou Glassy)
- Newsgroups: comp.lang.ada
- Subject: Ada questions: ungetting input, and cmd-line args
- Summary: are there standard, portable ways to do these things?
- Message-ID: <1992Jul26.033349.22498@coe.montana.edu>
- Date: 26 Jul 92 03:33:49 GMT
- Article-I.D.: coe.1992Jul26.033349.22498
- Sender: usenet@coe.montana.edu (USENET News System)
- Organization: Montana State University, Bozeman Montana USA
- Lines: 49
-
- Two small Ada 'how-to' questions:
-
- [1] How would you go about un-getting a character of input
- (basically, backing up the input stream by one character,
- like C's ungetc() routine does) ?
-
- I have before me a copy of ANSI/MIL-STD-1815A. In 14.2.4 (Direct
- Input-Output), a procedure called SET_INDEX is described, that could do
- what I think I'd need to do, in a pinch. The cheap-and-dirty solution
- I've got in mind (save the current INDEX, do the GET, then SET_INDEX to
- current INDEX minus one, to back up) is unpleasant at best.
-
- I'm building pieces of a compiler for a small language. The ability to
- unget input would be very handy for the lexical analyzer.
-
- What is the portable, standard way to do this?
-
- Next question:
-
- [2] None of the Ada books I've seen in the school library (nor -1815A)
- mention the environment in which an Ada program is expected to run
- (except minimally). Hence, there are no routines mentioned in the
- standard trio of IO packages (SEQUENTIAL_IO, DIRECT_IO, TEXT_IO)
- that retrieve "command-line arguments." Is there a portable,
- standard-conforming way to do this? or is the idea of "command-line
- arguments" outside of the scope of the Ada definition, or outside
- of the ability of standard Ada? (...I hope not, but it's non-fatal
- if it is. I'll just have to adjust the compiler's user interface
- to suit...)
-
- ----------------
- One last small question: (maybe a silly one.) Will programs written
- in Ada-83 (or whatever the specific name is of the language defined in
- -1815A) continue to compile and run without modification in the next
- version of Ada (Ada-9X)? In other words, is it anticipated that Ada-9X
- will break some standard-conforming Ada-83 programs? or will -9X be a
- strict superset of -83? (Specifically, for 'Sequential-Ada', i.e., the
- subset of Ada without tasking, will -9X break anything? If so, what?)
-
-
- Thanks in advance,
-
- Lou Glassy
-
- --
- Lou Glassy <> Watch the field behind the plow
- Student in Earth Sciences <> Turn to straight, dark rows..
- Montana State University <> Put another season's promise in the ground.
- fortran@giac1.oscs.montana.edu <> --Stan Rogers
-