sql regen: extends hooks & compact parseTokens
temporary revert 9b760e6b8ed44e2 due to NPE
fix NPE