Dear all, my JSP/PHP/ASP indentation engine consisted of only one BNF production which did nothing more than accepting EOF. All information was gathered as a flow of SPECIAL tokens accross various lexical states. A new similar BNF (root) production is added. It waits for EOF as well. It needs to start at different lexical state than DEFAULT in order to correctly process Java source. No lookaheads are used. Token definitions don't change. One "solution" that works [just now]: 1. no CACHE_TOKENS enither OPTIMIZE_TOKEN_MANAGER 2. {token_source.SwitchTo(CODE);} at the beginning of BNF rule I'd be thankful for any other hits. Peter Kehl http://paneris.org/~peterk/SPindent/