perm filename RAVE.SAI[HAK,ROB] blob sn#455036 filedate 1979-07-04 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00007 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	BEGIN "LOADAV"
C00006 00003	 α command format
C00008 00004	  init_everything
C00009 00005	  DO BEGIN "The main loop"
C00010 00006	  quit_everything
C00011 00007	  END "LOADAV"
C00012 ENDMK
C⊗;
BEGIN "LOADAV";

  comment

    day ←
      M{ONDAY}|TU{ESDAY}|W{EDNESDAY}|TH{URSDAY}|F{RIDAY}|SA{TURDAY}|SU{NDAY}

    dayspec ←
      day{:day}

    date ←
      1|2|3|4...29|30|31

    datespec ←
      date{:date}

    allspec ←
      ∞

    todayspec ←
      .

    timespec ←
      dayspec|datespec|allspec|todayspec

    operator ←
      *|+|-

    datestring ←
      <null>|timespec{operator datestring}|(datestring)

    switchspec ←
      X{GP}|A{UTOSCALE}|R{EDRAW}|E{XIT}

    switchlist ←
      /{-}<switchspec>{switchlist}

    inputline ← 
      <datestring>{switchlist}

    A DATESTRING consists of a single TIMESPEC or an expression containing
    TIMESPECs and the operators *, +, and -.  Each TIMESPEC represents the
    set of all occurances of that particular unit, ie MON would mean all
    Mondays on file.  The operators represent the set operations UNION
    (+), INTERSECTION (*), and SET DIFFERENCE (-), which are performed on
    the sets of dates which the keywords represent.

    Consider the following DATESTRINGS:

	∞-SA-SU		All days on file except Saturdays and Sundays
	.		Today
	1:7*M		The first Monday of the month
        <null>		Don't change the date info, but apply any switches.
    ;
<RAVE command> ≡ {<date-arg>}↔{switch-list>}
<sl-arg> ≡ <integer> | <integer> SL
<hr-arg> ≡ <military hour> | <civilian hour>
<civilian hour> ≡ [ 1 | 2 | ... | 12 ] { AM | A.M. | PM | P.M.}
<military hour> ≡ [0 | 1 | ... | 23]{00} {HRS|HOURS}
<date-arg> ≡ <people day> | <day-arg>/<month-arg>{/<year-arg>}
<people day> ≡ SUNDAY | MONDAY | ... | SATURDAY
<day-arg> ≡ 0 | 1 | 2 | ... | 31
<month-arg> ≡ <people month> | <computer month>
<people month> ≡ JANUARY | FEBRUARY | ... | DECEMBER
<computer month> ≡ 1 | 2 | ... | 12
<year arg> ≡ {19}71 | {19}72 | ... | {19}99 | 2000 | 2001 | ... |2099
<for-arg> ≡ <integer> | FOR <integer>
<device>  ≡ MTA | PLTR | UDP | <iii>
<iii> ≡ III | III0 | III1 | ... | III5 | III20 | III21 | ... | III25
 α command format

 */itemp .-7:.			; the indoor temparature for the past week
 *(.-7:.)⊗(sat:sun)/otemp/xsp	; the outdoor temp for past week, exclusive of
				; saturdays or sundays, XSPool result when done
 *

 range ←  rel_day{<range_op>day}
 range_op ← ":"
 set ← range{<set_op>range}
 set_op ← "∧"|"∨"|"⊗"
 day ← <dayname>|<date>
 dayname ← "monday"|"tuesday"|"wednesday"|"thursday"|"friday"|"saturday"|"sunday"
   (note that dayname only need be long enough to uniquely specify it)
 date ← 1..31|"."
   ("." means the current date)
 rel_day ← day{"+"|"-"<integer>}
   (relday can be things like .-5, which means five days ago)

 date_spec ← set{<set_op>date_spec}
 command_line ← {switches}{date_spec}{switches}

switchlist ← switch{switchlist}
switch ← "/"switch_spec
switch_spec ← "xspool"|"autoscale"|"addin"|"itemp"|"otemp"|"load"|"diskq"|
	"freecore"|"ddchan"|
  init_everything;
  we_quit ← FALSE;
  DO BEGIN "The main loop"
    instring ← fetch_the_input_line;
    bad_input ← scan_the_input_line(instring);
    IF bad_input
     THEN BEGIN "Invalid Input"
      show_bad_string(bad_string)
      END "Invalid Input"
     ELSE BEGIN "Valid Input"
      generate the data;
      output the data;
      END "Valid Input"
    END "The main loop"
    UNTIL we_quit;
  quit_everything
  END "LOADAV"