package tcra.exercises.resolve_stack_mystery_private;

import java.util.List;
import tcra.math.*;

public class ResolveStackMystery_PostMystery1_1Assertion implements
      Assertion
{
   protected MathString<MathType> empty;
   
   public ResolveStackMystery_PostMystery1_1Assertion()
   {
      MathStringParser msp = new MathStringParser(
                             new MathIntegerParser());
      try { empty = msp.parse(new StringBuilder("<>")); }
      catch(MathFormatException mfe) { /* Should never happen */ }
   } // end ctor

   @SuppressWarnings("unchecked")
   public boolean check(List<MathType> t)
   {
      MathString<MathType> self    = (MathString<MathType>)t.get(1);
      
      return(self.equals(empty));
   } // end check(List)
   
   public String toString()
   {
      return("S = &lt;&gt;;");
   } // end toString()

   @SuppressWarnings("unchecked")
   public String toInstanceString(List<MathType> t)
   {
      MathString<MathType> self    = (MathString<MathType>)t.get(1);
      
      return(self.toHTMLString()+" = "+empty.toHTMLString());
   } // end toInstanceString(List)
} // end class
