analysis and var generation