Can someone explain how a stack translator works ? I think it is mainly used for lexical analysis (i could be very much wrong) . Any additional material or links are welcome ! Thanks !
The correct term for what you are searching for is "pushdown transducer" See here, for example: http://www.cse.ohio-state.edu/~gurari/theory-bk/theory-bk-threese2.html