Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

datebook(1)

DATEBOOK(4)

 

NAME

datebook − event file format
 

DESCRIPTION

The datebook program uses an ascii file format to describe events. 
 

File Format

The general format of an event file looks like:

[==defaultclass]
 message [=class]
datespec
[time]
<empty line>
 . . .

 

Grammar Description

The following is a YACC-style specification for the datebook event file grammar.  Keywords are shown in Bold and are defined below. 
 

event : Message Class datespec
| Message Class datespec timerange



datespec : daterange
| relativedate
| periodic
| datespec Except datespec
| datespec Logical_And datespec
| datespec Or datespec
| datespec And datespec
| Not datespec



NOTE: All words in datespec are case insensitive.
The And operator behaves like "or" as in English usage.



daterange : date Thru date
| Month ’,’ Year
| Month Year
| Month
| Integer ’/’ Year
| Year



relativedate : date
| datespec duringrange
| Nth Day
| Nth Day duringrange
| Nth Day Before_Or_After date
| Integer intervals Before_Or_After date
| relativedate Before_Or_After date



duringrange : Between date And date
| In daterange



periodic : relativeday
| Every relativeday
| Day Thru Day
| Every Nth Day Before_Or_After date
| Every Integer intervals Before_Or_After date



NOTE: Day can not be "Weekday"



relativeday : Day
| Day Before_Or_After date



date : Month Integer ’,’ Year
| Integer Month ’,’ Year
| Month Integer Year
| Integer Month Year
| Integer ’/’ Integer ’/’ Year
| Integer ’/’ Integer
| Month Integer
| Integer Month
| Today



timerange : time
| time Thru time
| At time
| At time Thru time



time : Integer ’:’ Integer
| Integer ’:’ Integer Am_Or_PM
| Integer Am_Or_Pm

 

Keywords

All of the following are case insensitive. 
 

Am_Or_Pm
am, a.m., pm, p.m.
 

And and
 

At at
 

Before_Or_After
after, >, starting, >=, onorafter, before, <, until, ending, <=, onorbefore.
 

Between between
 

Class =<class_identifier>
 

Day Weekday, Everyday, name of a day (e.g. Friday), or the first three letters of the name of a day (e.g. Fri). 
 

Every every. 
 

Except except. 
 

In during, in, from, of. 
 

Integer Represents a day of the month (1-31), a month of the year (1-12), a count of intervals (1-59), an hour (0-24), or a minute (0-59). 
 

Intervals day, days, week, weeks, month, months, year, years. 
 

Logical_And
&&.
 

Message Any string or characters enclosed in matching characters from the set:
 

Month Can be "Everymonth", the entire name of a month (e.g. January), or the first three letters of the name of a month (e.g. Jan). 
 

Not not. 
 

Nth From the sequence 1st, 2nd, 3rd, 4th, 5th, The words first, second, ... twentieth are also allowed.  The keyword last can also be used to specify a date prior to another date. 
 

Or or. 
 

Starting starting. 
 

Thru through, thru, to, or "-". 
 

Today today, tomorrow, or yesterday. 
 

Year Of the form 1989 or 89. 
 

Combination Precedence

 

There are several ways to combine datespecs:
datespec IN daterange (or BETWEEN date AND date)
datespec EXCEPT datespec
datespec OR datespec
datespec LOGICAL_AND datespec
NOT datespec
 The associativity and precedence when combining more than one datespec is:
NOTleft associativehighest precedence
LOGICAL_ANDleft associative
OR ANDleft associative
EXCEPTright associative
BETWEEN INnon associativelowest precedence

 
 

EXAMPLE DATE FILE

 
A sample event file might look like this:
 

==meeting
"Joan’s Birthday"
=birthday
October 10
 "Project Meeting in the Sea Breeze room"
Monday 2:00 PM
 "monthly report due"
1st weekday
 "Doctor’s appointment"
=doctor
2nd Tuesday at 3:30 PM
 "staff meeting"
Tuesday except April 25
at 1:00 PM
 "Section meeting
10-11 in the Auditorium"
March 18,1993
at 10 am
 "Leave Early"
Today
 "Pay Day"
Last weekday onorbefore 15 Everymonth
 [SEPC]=offsite
Aug 1 - Aug 5 at 8:30
 "mail tax return"=nag
1 week before 15 April
 "Memorial Day"
=holiday
last Monday in May
 "Memorial Day"
=holiday
1st Monday before 31 May

 
The line ==meeting specifies that the default class for all events in this file is meeting.  All but six of the events will use the default class. 
 
The first event will have the class birthday.  The fourth event will have the class doctor.  The last four events use the classes offsite, nag, and holiday (twice). 
 
The last two events show two alternative ways to specify the same date.
 
Note that datebook may interpret and rewrite date specifications with different syntax, but equivalent semantics.  For example, datebook would read the date specification for the "Pay Day" event and rewrite it as "last weekday ending Everymonth 15." Datebook also would translate the "Leave Early" date specification "Today" into today’s date. 
 

SEE ALSO

datebook(1)
 

  —  May 30, 1996

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026