X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fsbp%2FGrammar.java;fp=src%2Fedu%2Fberkeley%2Fsbp%2FCache.java;h=9b332d8bdb2c95f742f1f32f2dea79db4a53c977;hp=c60045438a35ec9c52bc585959d5031c801d8ea9;hb=eef891a53c43901acccac0dead16a79dbdb34c77;hpb=dc9bb3a45ed306e2e35549076842b3e74efecb48 diff --git a/src/edu/berkeley/sbp/Cache.java b/src/edu/berkeley/sbp/Grammar.java similarity index 93% rename from src/edu/berkeley/sbp/Cache.java rename to src/edu/berkeley/sbp/Grammar.java index c600454..9b332d8 100644 --- a/src/edu/berkeley/sbp/Cache.java +++ b/src/edu/berkeley/sbp/Grammar.java @@ -1,15 +1,22 @@ // Copyright 2006 all rights reserved; see LICENSE file for BSD-style license package edu.berkeley.sbp; -import edu.berkeley.sbp.*; import edu.berkeley.sbp.util.*; import edu.berkeley.sbp.Sequence.Position; import java.io.*; import java.util.*; -import java.lang.reflect.*; -import java.lang.ref.*; -abstract class Cache { +/** + * A collection of Elements and Sequences which only reference each other. + * + * All analyses are done at the Grammar level, since a given + * Element/Sequence can appear in multiple Grammars. Some of these + * analyses depend on which elements *reference* a given element, + * rather than which elements *are referenced by* a given element. + * + * This class is package-private because it is likely to change often. + */ +abstract class Grammar { protected Union rootUnion; public HashMap follow = new HashMap(); @@ -18,7 +25,7 @@ abstract class Cache { public HashSet all = new HashSet(); abstract Topology emptyTopology(); - public Cache(Union root) { + public Grammar(Union root) { this.rootUnion = root; if (root != null) for(Sequence s : root)