- // Epsilon Form //////////////////////////////////////////////////////////////////////////////
-
- // FIXME
- private Forest.Many epsilonForm = null;
- Forest epsilonForm() {
- if (epsilonForm != null) return epsilonForm;
- epsilonForm = new Forest.Many();
- for(Sequence s : this) {
- // FIXME FIXME FIXME
- if (new Walk.Cache().possiblyEpsilon(s))
- epsilonForm.merge(s.epsilonForm());
- }
+ /** the Forest which results from matching this Union against the empty string at region <tt>region</tt> */
+ Forest epsilonForm(Input.Region region, Grammar cache) {
+ viewed = true;
+ Forest.Many epsilonForm = new Forest.Many();
+ for(Sequence s : this)
+ if (cache.possiblyEpsilon(s))
+ epsilonForm.merge(s.epsilonForm(region, cache));