home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / ada / 2196 < prev    next >
Encoding:
Internet Message Format  |  1992-07-25  |  2.7 KB

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