keep track of which reduction created each result (if any)
[sbp.git] / src / edu / berkeley / sbp / Atom.java
1 // (C) 2006-2007 all rights reserved; see LICENSE file for BSD-style license
2
3 package edu.berkeley.sbp;
4 import edu.berkeley.sbp.util.*;
5
6 /**
7  *  <font color=green>
8  *  an element which matches some set of one-token-long input strings
9  *  </font>.
10  *
11  *  <p>
12  *  This class is a topology over itself (yes, this is impredicative).
13  *  This means that you can call Atom.union(Atom) and get back an Atom.
14  *  If you are interested in the topology of <i>tokens</i> which this
15  *  Atom can match, use the <tt>getTokenTopology()</tt> method.
16  *  </p>
17  */
18 public abstract class Atom<Token>
19     extends Element
20     implements Topology<Atom<Token>> {
21
22     /** the set (topology) of tokens that can match this element */
23     public abstract Topology<Token>  getTokenTopology();
24
25     StringBuffer toString(StringBuffer sb) { sb.append(this); return sb; }
26
27 }
28
29