Change log

1.21: Allow redefinition of keywords as macros.  In the process, I
added an undefine keyword to do the obvious: remove a macro.

Added xy_gg macros, too.

Fixed a bug where giving a coordinate name before a parenthesized point
caused a syntax error.  Thanks to Kees Zeelenberg for spotting this.

Added an srand function to seed the random number generator, though
there's none documented in Kernighan and Bentley's grap, and a getpid
function to get a (sort of) random number.  Don't use this for key
generation.  W. Robert Daasc caught this omission.

While I was in there, I discovered that rand was not returning its
full range from [0,1).  It does now.

Some keywords that accept strings weren't accepting sprintf, some of
them have been fixed.

Lee Ji Hwan found a bug with large files being read thru macros
causing a core dump.  That has been fixed.  It was a really
embarrassing coding style error, too...

John Aycock discovered a bug where a line style was ignored on the first
line command executed.  It's not ignored anymore.

I also found a bug in the execution order of copy through macros,
although I'm uncertain if a version was ever released with the bug
intact.  I think this may have been a related to Lee Ji Hwan's bug,
which means it probably hasn't seen the light of day.

-h prints a usage summary.  --help is a synonym for -h and --version is a
synonym for -v.

1.20: The big jump reflects both internal changes and visible feature
changes.  The class structure in the code has been substantially
revamped, and the code brought into better conformance with the
current state of the C++ world.  As of version 1.20, grap no longer
attempts to compile under g++ 2.7.2.  grap 1.11 source will remain
available from http://www.lunabase.org/~faber/Vault/software/grap for
those who need it.

One feature change is that troff and pic commands are now placed
correctly in their relative order rather than being collected before
and after the graph.  This required specifying more carefully where
the frame generation is placed.  Frames are output either immediately
before the first plotted object or after the frame statement, if any.
This change motivated much of the class changes and actually cleaned
them up somewhat.

grap is now *much* more tolerant of variables with the keword names.
Things like

from=1; to = 10 
for i from from to to do { ... }

now work.  This is due to a sizable rewrite of the tokenizer.  In
fact, variables and coordinate spaces can share names.  Things like:

for next = 0 to 10 do {
	next at next next, next
}

now work (you have to add a couple ticks statements to really see that
example). I'd say we're to the point where obfuscated grap programs
are a possibility.

The only change this necessitated was that if you specify a coordinate
system in an automatic ticks statement, you have to use the on or auto
keyword.  See the examples document for an example.

I recoded macros to remove an antiquated construct that was confusing
some non-g++ compilers.  A static array was recoded as an STL vector,
with the result that an artificial constraint on the number of
arguments in a macro went away.

Part of the recoding of the tokenizer encoded a large data structure
in a file called grap_tokenizer.cc.  The code is striaght-ahead
initialization, but it drives the g++ optimizer stone crazy.
(Optimizing this function is very memory intensive.)  By default,
optimization is specifically disabled under g++.  You can override
that behavior by specifying --enable-optimize-grap_tokenizer to
./configure.  On the machines I use, optimizing this module has
absolutely no effect on performance, and I suggest you don't bother
spending the time optimizing it.

The autoconf and make stuff has been revamped to use GNU make's
automatic makefile generation or BSD pmake's automatic .depend
inclusion, as well as simplifying the distribution creation and
caching all configuration values.

Added some GNU standard Makefile targets to the Makefile.

Fixed some bugs in the manual page.

Ran spell again on the examples.  Misspelling Brian Kernighan's name
is bad.

Many additional compatibility changes suggested by Bruce Lilly.

1.11: Strings are now clipped, thanks to John Heidemann for finding the error.

1.10: Cleaned up the automatic tick generation and fixed a bug in
there, too.  

Allow reassignment of coordinate system parameters, e.g.,
.G1
coord test
copy "examples/cy_fatal.d"
coord test x 1980,2000
.G2

Default line format now uses the bullet macro if it's defined.  The
coord statement now will accept multiple log scale modifiers.  The
statement

coord x 1,1000 log x log y

is now legal.  x and y are now legal variable names.  They used to be
language tokens, and in fact still are, although their scope as tokens
is now limited to coord statements.

Tried to streamline the use of for_each and functors by removing
trivial calls to for_each.  Still trying to move code out of grap.y to
make it shorter to compile.

Simplified expression grammar by disallowing logical expressions
outside if statements.  I also caught another memory leak here.

Signifying a line break by using new (or draw) now works.  So code like
.G1
draw solid
next at 2,4
next at 3,5
new
next at 4,6
next at 5,7
.G2
produces 2 solid line segments.  This forced a little rethinking of
the syntax for changing the properties of a line using new/draw.  The
implementation is on the man page.  If it breaks existing grap
scripts, I'd love to hear about it.

Grids support similar syntax to that of ticks for explicitly
requesting automatic grid generation.

Automatic tock or grid generation can now be requested relative to a
named coordinate system, formerly automatic ticks/grid lines were only
generated for the default coordinate system.

Added the ln function.  Why did that take me so long?

Revised and (finally) spell-checked the man page.  I also stopped
including the auto-generated manual page in an macros.  A text version
of the man page is now installed, but the manual uses the doc macors
exclusively.

Line clipping was added in here, too.

1.06: Added an anonymous donor's TeX defines.  Also added the -C
compatibility option for groff and fixed some manpage formatting bugs.

1.05: kromJx@crosswinds.net noticed that numbers like 1. weren't
accepted.  They are now.  While I was fixing that I noticed that copy
until commands without a macro weren't supported.  They are now.  Made
a minor change to the examples to test the fixes.

1.03: Added the -M path option to make groff handle grap better.  I
also added the GRAP_DEFINES environment variable to change the defines
file.  I also added a new source file, grap_parse.cc in an attempt to
break up the monolithic and gigantic grap.y.  I had some small
success.  In the course of creating grap_parse.cc I think I caught
some memory leaks, too.

1.02: Bruce's error handling code produced a few inconsistencies
(eating the last newline of a file, and adding one befor ethe file.  I
think it no longer does that.  In addition I took care of a error
placement bug when the error was in a line containing a macro
expansion, and changed the error handling from using char * to using
Strings, like the rest of grap.

Got rid of an error on SunOS (and presumably other architectures) 
where -0 labels were printed on auto-generated labels.

Fixed bugs in sprintf when compiled using standard strings.

Fixed a memory leak and general bug with the undocumented color
commands. (There, that'll tell me if anyone reads this!)

1.01: Fixed a compilation bug under RedHat 6.1.  Cleaned up autoconf
and tweaked the makefile.

1.0: Incorporated Bruce Lilly's error reporting code.  Cleaned up the
documents (including a menton for Bruce in the man page) for v1.0
release.  Cleared up a file reading bug.

0.98b: Bruce Lilly reported some bugs and DWP incompatibilities,
mainly with negative numbers in number lists and comma separations in
them.  He also compiles in UWIN under NT, which broke autoconf in some
weird ways.  The most important of these necessitated adding a check
to ensure that install supports -d.

His test case is in the example file now.  He also found some spelling
errors.

The README file now reflects the real state of the world, too.  More
kudos to Bruce.

While tinkering with those autoconf changes I found that grap didn't
compile under g++ 2.7.2.1 any more.  Good thing that 0.97b wasn't
really released.  All is well again.

More fun from Bruce: he's given me patches to make cascding
assignments work and to remove a bug with comments not acting as
separators.

I've also make the order of copy commands more flexible (the until can
go before or after an inline macro, for example) and fixed a bug in
the grammar that made it difficult to put general expressions in
places like the frame size.  Expressions can go anywhere now, at the
expense that string comparisons can only appear in if statements.
Those bugs were also spotted by Bruce.

0.97b: Finally have a copy of egcs, so grap will now compile under it
using both the stl and the standard string class.  What do you know,
compiling under egcs halves the run time.  This is roughly half due to
better egcs compilation and half due to the better performance of the
standard string class.

Moved to a config.h-style grap.h.  Smoothed out the header files to
confine as much conditional compilation as possible to grap.h.

The code now uses hash_maps if they're available.

0.95b: bug fix: deleting grap_buffer_state contents twice on error, allow 
more than one shift description on ticks, grids, and labels.  Thanks to
Anindo Banerjea at ISI for spotting my misimplementation.

Another couple of Bannerjea catches: through is now recognized as a
synonym for thru.  "For," "then" and "else" clauses were previously
treated as macros but now have a terminating separator added to them.
The result is that things like

if (x == 3) { y = y + 1 }
x = x + 1

work now.  (If the { } is treated as a macro defined and expanded on
the spot, the grap parser sees y = y + 1x = x + 1 and cannot parse the
expression y+1x).  The new behavior is both more intuitive and more in
line with previous grap implementations.

More from Anindo: expansion of macro arguments assumed that the only
possible character following a dollar sign was a single digit.  This
caused problems both when a non-digit followed and the $ was literal,
and when the intent was to access an argument with an index greater
than 9.  Argument expansion now only expands when a $ is followed by 1
or more digits, and includes all the digits in the index.

The frame statement will now accept the default line style before or
after the frame size.  I still don't accept things like frame ht 3
solid wid 3 - the specifications of the size must be contiguous.

0.92a: bug fix - string equality check.  Small change to Makefile.in
to support default Solaris behavior.  Added -v for version info.  Some
general internals fiddling (I'd like to call it cleanup, but I think
that's generous).

0.91a: small changes for the RPM

0.9a: Added commands for making bars.  

Error reporting is much closer to the correct line now.

Generalized line descriptions for fillable objects.  

Circles now take a line description.  Added new examples of fillable
objects.

Now using the BSD copyright notice instead of my own half-baked one.

0.8a: alpha release
