1 /* |
1 /* |
2 * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
140 |
140 |
141 // // Files for storage, based on input file name |
141 // // Files for storage, based on input file name |
142 const char *base = strip_ext(strdup(argv[i])); |
142 const char *base = strip_ext(strdup(argv[i])); |
143 char *temp = base_plus_suffix("dfa_",base); |
143 char *temp = base_plus_suffix("dfa_",base); |
144 AD._DFA_file._name = base_plus_suffix(temp,".cpp"); |
144 AD._DFA_file._name = base_plus_suffix(temp,".cpp"); |
145 delete temp; |
145 delete[] temp; |
146 temp = base_plus_suffix("ad_",base); |
146 temp = base_plus_suffix("ad_",base); |
147 AD._CPP_file._name = base_plus_suffix(temp,".cpp"); |
147 AD._CPP_file._name = base_plus_suffix(temp,".cpp"); |
148 AD._CPP_CLONE_file._name = base_plus_suffix(temp,"_clone.cpp"); |
148 AD._CPP_CLONE_file._name = base_plus_suffix(temp,"_clone.cpp"); |
149 AD._CPP_EXPAND_file._name = base_plus_suffix(temp,"_expand.cpp"); |
149 AD._CPP_EXPAND_file._name = base_plus_suffix(temp,"_expand.cpp"); |
150 AD._CPP_FORMAT_file._name = base_plus_suffix(temp,"_format.cpp"); |
150 AD._CPP_FORMAT_file._name = base_plus_suffix(temp,"_format.cpp"); |
151 AD._CPP_GEN_file._name = base_plus_suffix(temp,"_gen.cpp"); |
151 AD._CPP_GEN_file._name = base_plus_suffix(temp,"_gen.cpp"); |
152 AD._CPP_MISC_file._name = base_plus_suffix(temp,"_misc.cpp"); |
152 AD._CPP_MISC_file._name = base_plus_suffix(temp,"_misc.cpp"); |
153 AD._CPP_PEEPHOLE_file._name = base_plus_suffix(temp,"_peephole.cpp"); |
153 AD._CPP_PEEPHOLE_file._name = base_plus_suffix(temp,"_peephole.cpp"); |
154 AD._CPP_PIPELINE_file._name = base_plus_suffix(temp,"_pipeline.cpp"); |
154 AD._CPP_PIPELINE_file._name = base_plus_suffix(temp,"_pipeline.cpp"); |
155 AD._HPP_file._name = base_plus_suffix(temp,".hpp"); |
155 AD._HPP_file._name = base_plus_suffix(temp,".hpp"); |
156 delete temp; |
156 delete[] temp; |
157 temp = base_plus_suffix("adGlobals_",base); |
157 temp = base_plus_suffix("adGlobals_",base); |
158 AD._VM_file._name = base_plus_suffix(temp,".hpp"); |
158 AD._VM_file._name = base_plus_suffix(temp,".hpp"); |
159 delete temp; |
159 delete[] temp; |
160 temp = base_plus_suffix("bugs_",base); |
160 temp = base_plus_suffix("bugs_",base); |
161 AD._bug_file._name = base_plus_suffix(temp,".out"); |
161 AD._bug_file._name = base_plus_suffix(temp,".out"); |
162 delete temp; |
162 delete[] temp; |
163 } // End of files vs options... |
163 } // End of files vs options... |
164 } // End of while have command line arguments |
164 } // End of while have command line arguments |
165 |
165 |
166 // Open files used to store the matcher and its components |
166 // Open files used to store the matcher and its components |
167 if (AD.open_files() == 0) return 1; // Open all input/output files |
167 if (AD.open_files() == 0) return 1; // Open all input/output files |