Visitor to provide a conservative estimate for the cost of parsing
a production. One unit of cost is approximately equivalent to the
effort involved in parsing a character and testing it for a
specific value. The cost estimate for a production includes the
costs for any other productions referenced by that production. If
the cost cannot be statically determined (for example, for a
repetition) or a set of productions is mutually recursive, the cost
is assumed to be unlimited, as represented by
Integer.MAX_VALUE. This visitor must be invoked by
visiting a grammar, which clears any previous cost estimates and
annotates each production with its estimated cost.
This visitor assumes that the entire grammar is contained in a
single module.
author: Robert Grimm version: $Revision: 1.26 $