parse and code generation