DATEBOOK(4)
NAME
datebook − event file format
DESCRIPTION
The datebook program uses an ascii file format to describe events. The specification is meant to be human readable and easy to use although it sometimes falls short of this.
The general format looks like:
[==defaultclass]
message [=class]
datespec
[time]
<empty line>
.
.
.
Grammar in Yacc format
event : Message class datespec
| Message class datespec timerange
;
class :
| Class
;
datespec: daterange /* All words in a datespec are not case sensitive */
| relativedate
| periodic
| datespec Except datespec
| datespec Logical_And datespec
| datespec Or datespec
| datespec And datespec /* Means "or" as in english usage */
| Not datespec
;
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 /* Day can not be Weekday */
| Every Integer intervals Before_Or_After date
;
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
;
Message
The message is any string or characters enclosed in matching characters from the set: ” "" () {} []
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
All of the following are not case sensitive.
Am_Or_Pm
This can be am, a.m., pm, or p.m.
And Is and.
At Is at.
Before_Or_After
Can be after, ">", starting, ">=", "onorafter", before, "<", until, ending, "<=", or onorbefore.
Class Is an alphanumeric string immediately preceeded by an "=".
Day This can be Weekday, Everyday, the entire name of a day (e.g. Friday), or the first three letters of the name of a day (e.g. Fri).
Every Is every.
Except Is except.
In Can be during, in, from, or 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
Can be day, days, week, weeks, month, months, year, or years.
Logical_And
Is "&&".
Month This 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 Is 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 Is or.
Starting Is starting.
Thru Can be through, thru, to, or "-".
Today Can be today, tomorrow, or yesterday.
Year Of the form 1989 or 89.
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
"Memorial day"
last Monday in May
"staff meeting"
Tuesday except April 25
1:00 PM
"Section meeting
10-11 in the Auditorium"
March 18,1988
10 am
(Doctor’s appointment)=doctor
2nd Tuesday 3:30 PM
[SEPC]=offsite
Aug 1 - Aug 5 8:30
"mail tax return"=nag
1 week before 15 April
"Memorial Day observed"=holiday
1st Monday before 31 May
The line ==meeting specifies that the default class for all events in this file is meeting. All but five 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 three events will have the class offsite, nag, and holiday.
SEE ALSO
— November 10, 1991