Use a single pass to compile

Dialect::compile now creates a visitor object which collects parameters while
traversion the statement AST.