I was working on a compiler using java

every thing is OK but how to implement the functions of undo/redo using stacks.

thanks