+ # Open specified path or stdin
+ var file
+ var path = opt_output.value
+ if path != null then
+ if path.file_extension != "nit" then
+ print_error "Warning: output file path does not end with '.nit'"
+ end
+
+ file = new FileWriter.open(path)
+ else
+ file = stdout
+ end
+
+ # Generate code