simple pushdown automato in java