|
18 | 18 | import java.io.File;
|
19 | 19 | import java.io.IOException;
|
20 | 20 | import java.util.ArrayList;
|
| 21 | +import java.util.Arrays; |
21 | 22 | import java.util.HashMap;
|
22 | 23 | import java.util.Iterator;
|
23 | 24 | import java.util.LinkedList;
|
|
41 | 42 | import org.emftext.language.java.JavaClasspath;
|
42 | 43 | import org.emftext.language.java.JavaPackage;
|
43 | 44 | import org.emftext.language.java.resource.JavaSourceOrClassFileResourceFactoryImpl;
|
| 45 | +import org.emftext.language.java.resource.java.IJavaOptions; |
44 | 46 |
|
45 | 47 | public class JaMoPPC {
|
46 | 48 |
|
47 | 49 | protected static final ResourceSet rs = new ResourceSetImpl();
|
48 | 50 |
|
49 | 51 | public static void main(String[] args) throws IOException {
|
| 52 | + if ((args.length >= 1) && args[0].equals("--disable-layout")) { |
| 53 | + rs.getLoadOptions().put(IJavaOptions.DISABLE_LAYOUT_INFORMATION_RECORDING, Boolean.TRUE); |
| 54 | + args = Arrays.copyOfRange(args, 1, args.length); |
| 55 | + } |
| 56 | + |
50 | 57 | if (args.length < 2) {
|
51 | 58 | printUsageAndExit();
|
52 | 59 | }
|
@@ -166,21 +173,25 @@ private static void printUsageAndExit() {
|
166 | 173 | + "parsed compilation unit in the target folder, use:");
|
167 | 174 | System.out.println();
|
168 | 175 | System.out
|
169 |
| - .println(" jamoppc <source folder path> <target folder path> <jar file paths>*"); |
| 176 | + .println(" jamoppc [--disable-layout] <source folder path> <target folder path> <jar file paths>*"); |
170 | 177 | System.out.println();
|
171 | 178 | System.out
|
172 | 179 | .println("To parse all files in a source folder and produce one XMI file\n"
|
173 | 180 | + "with the complete syntax graph, use:");
|
174 | 181 | System.out.println();
|
175 | 182 | System.out
|
176 |
| - .println(" jamoppc <source folder path> <target XMI file> <jar file paths>*"); |
| 183 | + .println(" jamoppc [--disable-layout] <source folder path> <target XMI file> <jar file paths>*"); |
177 | 184 | System.out.println();
|
178 | 185 | System.out
|
179 | 186 | .println("In the latter case, the second parameter has to end in \".xmi\".");
|
| 187 | + System.out.println(); |
| 188 | + System.out.println("The --disable-layout option disables the generation of layout information."); |
| 189 | + System.out.println("If given, it must be the first argument given to JaMoPPC."); |
180 | 190 | System.exit(1);
|
181 | 191 | }
|
182 | 192 |
|
183 | 193 | protected static void setUp() {
|
| 194 | + rs.getLoadOptions().put(IJavaOptions.DISABLE_LOCATION_MAP, Boolean.TRUE); |
184 | 195 | EPackage.Registry.INSTANCE.put("http://www.emftext.org/java",
|
185 | 196 | JavaPackage.eINSTANCE);
|
186 | 197 | Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(
|
|
0 commit comments