Skip to content

Commit a0a2004

Browse files
committed
applied patch from issue #1 and added 'DISABLE_LOCATION_MAP = true' option
1 parent 02bd63c commit a0a2004

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed
Binary file not shown.

Utils/org.emftext.language.java.jamoppc/src/org/emftext/language/java/jamoppc/JaMoPPC.java

+13-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import java.io.File;
1919
import java.io.IOException;
2020
import java.util.ArrayList;
21+
import java.util.Arrays;
2122
import java.util.HashMap;
2223
import java.util.Iterator;
2324
import java.util.LinkedList;
@@ -41,12 +42,18 @@
4142
import org.emftext.language.java.JavaClasspath;
4243
import org.emftext.language.java.JavaPackage;
4344
import org.emftext.language.java.resource.JavaSourceOrClassFileResourceFactoryImpl;
45+
import org.emftext.language.java.resource.java.IJavaOptions;
4446

4547
public class JaMoPPC {
4648

4749
protected static final ResourceSet rs = new ResourceSetImpl();
4850

4951
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+
5057
if (args.length < 2) {
5158
printUsageAndExit();
5259
}
@@ -166,21 +173,25 @@ private static void printUsageAndExit() {
166173
+ "parsed compilation unit in the target folder, use:");
167174
System.out.println();
168175
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>*");
170177
System.out.println();
171178
System.out
172179
.println("To parse all files in a source folder and produce one XMI file\n"
173180
+ "with the complete syntax graph, use:");
174181
System.out.println();
175182
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>*");
177184
System.out.println();
178185
System.out
179186
.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.");
180190
System.exit(1);
181191
}
182192

183193
protected static void setUp() {
194+
rs.getLoadOptions().put(IJavaOptions.DISABLE_LOCATION_MAP, Boolean.TRUE);
184195
EPackage.Registry.INSTANCE.put("http://www.emftext.org/java",
185196
JavaPackage.eINSTANCE);
186197
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(

0 commit comments

Comments
 (0)