copying code generation from AST nodes to the code generating visitor