annotate graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/java/compiler/JDTCompiler.java @ 16975:ccb4e2bd894f

Truffle-DSL: fixed JDT element comparator violated transitivity.
author Christian Humer <christian.humer@gmail.com>
date Wed, 27 Aug 2014 15:54:00 +0200
parents 23415229349b
children 9e944c7eaded
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10597
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
1 /*
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
4 *
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
8 *
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
13 * accompanied this code).
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
14 *
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
18 *
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
21 * questions.
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
22 */
16759
23415229349b Truffle-DSL: new package structure.
Christian Humer <christian.humer@gmail.com>
parents: 16753
diff changeset
23 package com.oracle.truffle.dsl.processor.java.compiler;
10597
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
24
11188
ae6b8ec920e2 Truffle-DSL: Added a hack to get around eclipse bug 300408. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=300408)
Christian Humer <christian.humer@gmail.com>
parents: 10597
diff changeset
25 import java.util.*;
ae6b8ec920e2 Truffle-DSL: Added a hack to get around eclipse bug 300408. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=300408)
Christian Humer <christian.humer@gmail.com>
parents: 10597
diff changeset
26
10597
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
27 import javax.annotation.processing.*;
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
28 import javax.lang.model.element.*;
16753
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
29 import javax.lang.model.type.*;
10597
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
30
16759
23415229349b Truffle-DSL: new package structure.
Christian Humer <christian.humer@gmail.com>
parents: 16753
diff changeset
31 import com.oracle.truffle.dsl.processor.java.*;
10597
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
32
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
33 public class JDTCompiler extends AbstractCompiler {
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
34
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
35 public static boolean isValidElement(Element currentElement) {
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
36 try {
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
37 Class<?> elementClass = Class.forName("org.eclipse.jdt.internal.compiler.apt.model.ElementImpl");
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
38 return elementClass.isAssignableFrom(currentElement.getClass());
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
39 } catch (ClassNotFoundException e) {
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
40 return false;
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
41 }
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
42 }
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
43
16753
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
44 public List<? extends Element> getAllMembersInDeclarationOrder(ProcessingEnvironment environment, TypeElement type) {
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
45 return sortBySourceOrder(new ArrayList<>(environment.getElementUtils().getAllMembers(type)));
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
46 }
11188
ae6b8ec920e2 Truffle-DSL: Added a hack to get around eclipse bug 300408. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=300408)
Christian Humer <christian.humer@gmail.com>
parents: 10597
diff changeset
47
16753
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
48 public List<? extends Element> getEnclosedElementsInDeclarationOrder(TypeElement type) {
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
49 return sortBySourceOrder(new ArrayList<>(type.getEnclosedElements()));
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
50 }
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
51
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
52 private static List<? extends Element> sortBySourceOrder(List<Element> elements) {
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
53 final Map<TypeElement, List<Object>> declarationOrders = new HashMap<>();
11188
ae6b8ec920e2 Truffle-DSL: Added a hack to get around eclipse bug 300408. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=300408)
Christian Humer <christian.humer@gmail.com>
parents: 10597
diff changeset
54
16975
ccb4e2bd894f Truffle-DSL: fixed JDT element comparator violated transitivity.
Christian Humer <christian.humer@gmail.com>
parents: 16759
diff changeset
55 Comparator<Element> comparator = new Comparator<Element>() {
16753
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
56 public int compare(Element o1, Element o2) {
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
57 try {
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
58 TypeMirror enclosing1 = o1.getEnclosingElement().asType();
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
59 TypeMirror enclosing2 = o2.getEnclosingElement().asType();
11188
ae6b8ec920e2 Truffle-DSL: Added a hack to get around eclipse bug 300408. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=300408)
Christian Humer <christian.humer@gmail.com>
parents: 10597
diff changeset
60
16759
23415229349b Truffle-DSL: new package structure.
Christian Humer <christian.humer@gmail.com>
parents: 16753
diff changeset
61 if (ElementUtils.typeEquals(enclosing1, enclosing2)) {
16753
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
62 List<Object> declarationOrder = lookupDeclarationOrder(declarationOrders, (TypeElement) o1.getEnclosingElement());
16975
ccb4e2bd894f Truffle-DSL: fixed JDT element comparator violated transitivity.
Christian Humer <christian.humer@gmail.com>
parents: 16759
diff changeset
63
16753
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
64 if (declarationOrder == null) {
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
65 return 0;
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
66 }
11188
ae6b8ec920e2 Truffle-DSL: Added a hack to get around eclipse bug 300408. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=300408)
Christian Humer <christian.humer@gmail.com>
parents: 10597
diff changeset
67 Object o1Binding = field(o1, "_binding");
ae6b8ec920e2 Truffle-DSL: Added a hack to get around eclipse bug 300408. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=300408)
Christian Humer <christian.humer@gmail.com>
parents: 10597
diff changeset
68 Object o2Binding = field(o2, "_binding");
ae6b8ec920e2 Truffle-DSL: Added a hack to get around eclipse bug 300408. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=300408)
Christian Humer <christian.humer@gmail.com>
parents: 10597
diff changeset
69
ae6b8ec920e2 Truffle-DSL: Added a hack to get around eclipse bug 300408. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=300408)
Christian Humer <christian.humer@gmail.com>
parents: 10597
diff changeset
70 int i1 = declarationOrder.indexOf(o1Binding);
ae6b8ec920e2 Truffle-DSL: Added a hack to get around eclipse bug 300408. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=300408)
Christian Humer <christian.humer@gmail.com>
parents: 10597
diff changeset
71 int i2 = declarationOrder.indexOf(o2Binding);
ae6b8ec920e2 Truffle-DSL: Added a hack to get around eclipse bug 300408. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=300408)
Christian Humer <christian.humer@gmail.com>
parents: 10597
diff changeset
72
16975
ccb4e2bd894f Truffle-DSL: fixed JDT element comparator violated transitivity.
Christian Humer <christian.humer@gmail.com>
parents: 16759
diff changeset
73 if (i1 == -1 || i2 == -1) {
ccb4e2bd894f Truffle-DSL: fixed JDT element comparator violated transitivity.
Christian Humer <christian.humer@gmail.com>
parents: 16759
diff changeset
74 return 0;
ccb4e2bd894f Truffle-DSL: fixed JDT element comparator violated transitivity.
Christian Humer <christian.humer@gmail.com>
parents: 16759
diff changeset
75 }
ccb4e2bd894f Truffle-DSL: fixed JDT element comparator violated transitivity.
Christian Humer <christian.humer@gmail.com>
parents: 16759
diff changeset
76
11188
ae6b8ec920e2 Truffle-DSL: Added a hack to get around eclipse bug 300408. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=300408)
Christian Humer <christian.humer@gmail.com>
parents: 10597
diff changeset
77 return i1 - i2;
16753
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
78 } else {
16759
23415229349b Truffle-DSL: new package structure.
Christian Humer <christian.humer@gmail.com>
parents: 16753
diff changeset
79 if (ElementUtils.isSubtype(enclosing1, enclosing2)) {
16753
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
80 return 1;
16975
ccb4e2bd894f Truffle-DSL: fixed JDT element comparator violated transitivity.
Christian Humer <christian.humer@gmail.com>
parents: 16759
diff changeset
81 } else {
16753
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
82 return -1;
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
83 }
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
84 }
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
85 } catch (Exception e) {
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
86 throw new RuntimeException(e);
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
87 }
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
88 }
16975
ccb4e2bd894f Truffle-DSL: fixed JDT element comparator violated transitivity.
Christian Humer <christian.humer@gmail.com>
parents: 16759
diff changeset
89 };
ccb4e2bd894f Truffle-DSL: fixed JDT element comparator violated transitivity.
Christian Humer <christian.humer@gmail.com>
parents: 16759
diff changeset
90
ccb4e2bd894f Truffle-DSL: fixed JDT element comparator violated transitivity.
Christian Humer <christian.humer@gmail.com>
parents: 16759
diff changeset
91 Collections.sort(elements, comparator);
16753
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
92 return elements;
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
93 }
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
94
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
95 private static List<Object> lookupDeclarationOrder(Map<TypeElement, List<Object>> declarationOrders, TypeElement type) throws Exception, ClassNotFoundException {
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
96 if (declarationOrders.containsKey(type)) {
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
97 return declarationOrders.get(type);
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
98 }
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
99
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
100 Object binding = field(type, "_binding");
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
101 Class<?> sourceTypeBinding = Class.forName("org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding");
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
102 Class<?> binaryTypeBinding = Class.forName("org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding");
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
103
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
104 List<Object> declarationOrder = null;
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
105 if (sourceTypeBinding.isAssignableFrom(binding.getClass())) {
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
106 declarationOrder = findSourceTypeOrder(binding);
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
107 } else if (binaryTypeBinding.isAssignableFrom(binding.getClass())) {
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
108 declarationOrder = findBinaryTypeOrder(binding);
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
109 }
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
110
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
111 declarationOrders.put(type, declarationOrder);
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
112
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
113 return declarationOrder;
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
114 }
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
115
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
116 private static List<Object> findBinaryTypeOrder(Object binding) throws Exception {
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
117 Object binaryType = lookupBinaryType(binding);
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
118 final Object[] sortedMethods = (Object[]) method(binaryType, "getMethods");
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
119
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
120 List<Object> sortedElements = new ArrayList<>();
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
121 if (sortedMethods != null) {
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
122 sortedElements.addAll(Arrays.asList(sortedMethods));
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
123 }
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
124 final Object[] sortedFields = (Object[]) method(binaryType, "getFields");
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
125 if (sortedFields != null) {
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
126 sortedElements.addAll(Arrays.asList(sortedFields));
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
127 }
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
128 final Object[] sortedTypes = (Object[]) method(binaryType, "getMemberTypes", new Class[0]);
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
129 if (sortedTypes != null) {
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
130 sortedElements.addAll(Arrays.asList(sortedTypes));
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
131 }
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
132
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
133 Collections.sort(sortedElements, new Comparator<Object>() {
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
134 public int compare(Object o1, Object o2) {
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
135 try {
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
136 int structOffset1 = (int) field(o1, "structOffset");
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
137 int structOffset2 = (int) field(o2, "structOffset");
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
138 return structOffset1 - structOffset2;
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
139 } catch (Exception e) {
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
140 throw new RuntimeException(e);
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
141 }
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
142 }
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
143 });
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
144
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
145 Class<?> binaryMethod = Class.forName("org.eclipse.jdt.internal.compiler.env.IBinaryMethod");
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
146 Class<?> binaryField = Class.forName("org.eclipse.jdt.internal.compiler.env.IBinaryField");
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
147 Class<?> nestedType = Class.forName("org.eclipse.jdt.internal.compiler.env.IBinaryNestedType");
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
148
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
149 List<Object> bindings = new ArrayList<>();
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
150 for (Object sortedElement : sortedElements) {
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
151 Class<?> elementClass = sortedElement.getClass();
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
152 if (binaryMethod.isAssignableFrom(elementClass)) {
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
153 char[] selector = (char[]) method(sortedElement, "getSelector");
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
154 Object[] foundBindings = (Object[]) method(binding, "getMethods", new Class[]{char[].class}, selector);
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
155 if (foundBindings == null || foundBindings.length == 0) {
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
156 continue;
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
157 } else if (foundBindings.length == 1) {
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
158 bindings.add(foundBindings[0]);
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
159 } else {
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
160 char[] idescriptor = (char[]) method(sortedElement, "getMethodDescriptor");
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
161 for (Object foundBinding : foundBindings) {
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
162 char[] descriptor = (char[]) method(foundBinding, "signature");
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
163 if (descriptor == null && idescriptor == null || Arrays.equals(descriptor, idescriptor)) {
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
164 bindings.add(foundBinding);
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
165 break;
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
166 }
11188
ae6b8ec920e2 Truffle-DSL: Added a hack to get around eclipse bug 300408. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=300408)
Christian Humer <christian.humer@gmail.com>
parents: 10597
diff changeset
167 }
ae6b8ec920e2 Truffle-DSL: Added a hack to get around eclipse bug 300408. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=300408)
Christian Humer <christian.humer@gmail.com>
parents: 10597
diff changeset
168 }
16753
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
169 } else if (binaryField.isAssignableFrom(elementClass)) {
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
170 char[] selector = (char[]) method(sortedElement, "getName");
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
171 Object foundField = method(binding, "getField", new Class[]{char[].class, boolean.class}, selector, true);
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
172 if (foundField != null) {
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
173 bindings.add(foundField);
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
174 }
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
175 } else if (nestedType.isAssignableFrom(elementClass)) {
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
176 char[] selector = (char[]) method(sortedElement, "getSourceName");
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
177 Object foundType = method(binding, "getMemberType", new Class[]{char[].class}, selector);
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
178 if (foundType != null) {
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
179 bindings.add(foundType);
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
180 }
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
181 } else {
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
182 throw new AssertionError("Unexpected encountered type " + elementClass);
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
183 }
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
184 }
11188
ae6b8ec920e2 Truffle-DSL: Added a hack to get around eclipse bug 300408. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=300408)
Christian Humer <christian.humer@gmail.com>
parents: 10597
diff changeset
185
16753
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
186 return bindings;
11188
ae6b8ec920e2 Truffle-DSL: Added a hack to get around eclipse bug 300408. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=300408)
Christian Humer <christian.humer@gmail.com>
parents: 10597
diff changeset
187 }
ae6b8ec920e2 Truffle-DSL: Added a hack to get around eclipse bug 300408. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=300408)
Christian Humer <christian.humer@gmail.com>
parents: 10597
diff changeset
188
16753
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
189 private static Object lookupBinaryType(Object binding) throws Exception {
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
190 Object lookupEnvironment = field(binding, "environment");
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
191 Object compoundClassName = field(binding, "compoundName");
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
192 Object nameEnvironment = field(lookupEnvironment, "nameEnvironment");
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
193 Object nameEnvironmentAnswer = method(nameEnvironment, "findType", new Class[]{char[][].class}, compoundClassName);
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
194 Object binaryType = method(nameEnvironmentAnswer, "getBinaryType", new Class[0]);
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
195 return binaryType;
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
196 }
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
197
f78eafd5ba9e Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
Christian Humer <christian.humer@gmail.com>
parents: 11188
diff changeset
198 private static List<Object> findSourceTypeOrder(Object binding) throws Exception {
11188
ae6b8ec920e2 Truffle-DSL: Added a hack to get around eclipse bug 300408. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=300408)
Christian Humer <christian.humer@gmail.com>
parents: 10597
diff changeset
199 Object referenceContext = field(field(binding, "scope"), "referenceContext");
ae6b8ec920e2 Truffle-DSL: Added a hack to get around eclipse bug 300408. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=300408)
Christian Humer <christian.humer@gmail.com>
parents: 10597
diff changeset
200
ae6b8ec920e2 Truffle-DSL: Added a hack to get around eclipse bug 300408. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=300408)
Christian Humer <christian.humer@gmail.com>
parents: 10597
diff changeset
201 TreeMap<Integer, Object> orderedBindings = new TreeMap<>();
ae6b8ec920e2 Truffle-DSL: Added a hack to get around eclipse bug 300408. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=300408)
Christian Humer <christian.humer@gmail.com>
parents: 10597
diff changeset
202
ae6b8ec920e2 Truffle-DSL: Added a hack to get around eclipse bug 300408. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=300408)
Christian Humer <christian.humer@gmail.com>
parents: 10597
diff changeset
203 collectSourceOrder(orderedBindings, referenceContext, "methods");
ae6b8ec920e2 Truffle-DSL: Added a hack to get around eclipse bug 300408. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=300408)
Christian Humer <christian.humer@gmail.com>
parents: 10597
diff changeset
204 collectSourceOrder(orderedBindings, referenceContext, "fields");
ae6b8ec920e2 Truffle-DSL: Added a hack to get around eclipse bug 300408. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=300408)
Christian Humer <christian.humer@gmail.com>
parents: 10597
diff changeset
205 collectSourceOrder(orderedBindings, referenceContext, "memberTypes");
ae6b8ec920e2 Truffle-DSL: Added a hack to get around eclipse bug 300408. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=300408)
Christian Humer <christian.humer@gmail.com>
parents: 10597
diff changeset
206
ae6b8ec920e2 Truffle-DSL: Added a hack to get around eclipse bug 300408. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=300408)
Christian Humer <christian.humer@gmail.com>
parents: 10597
diff changeset
207 return new ArrayList<>(orderedBindings.values());
ae6b8ec920e2 Truffle-DSL: Added a hack to get around eclipse bug 300408. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=300408)
Christian Humer <christian.humer@gmail.com>
parents: 10597
diff changeset
208 }
ae6b8ec920e2 Truffle-DSL: Added a hack to get around eclipse bug 300408. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=300408)
Christian Humer <christian.humer@gmail.com>
parents: 10597
diff changeset
209
ae6b8ec920e2 Truffle-DSL: Added a hack to get around eclipse bug 300408. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=300408)
Christian Humer <christian.humer@gmail.com>
parents: 10597
diff changeset
210 private static void collectSourceOrder(TreeMap<Integer, Object> orderedBindings, Object referenceContext, String fieldName) throws Exception {
ae6b8ec920e2 Truffle-DSL: Added a hack to get around eclipse bug 300408. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=300408)
Christian Humer <christian.humer@gmail.com>
parents: 10597
diff changeset
211 Object[] declarations = (Object[]) field(referenceContext, fieldName);
ae6b8ec920e2 Truffle-DSL: Added a hack to get around eclipse bug 300408. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=300408)
Christian Humer <christian.humer@gmail.com>
parents: 10597
diff changeset
212 if (declarations != null) {
ae6b8ec920e2 Truffle-DSL: Added a hack to get around eclipse bug 300408. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=300408)
Christian Humer <christian.humer@gmail.com>
parents: 10597
diff changeset
213 for (int i = 0; i < declarations.length; i++) {
ae6b8ec920e2 Truffle-DSL: Added a hack to get around eclipse bug 300408. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=300408)
Christian Humer <christian.humer@gmail.com>
parents: 10597
diff changeset
214 Integer declarationSourceStart = (Integer) field(declarations[i], "declarationSourceStart");
ae6b8ec920e2 Truffle-DSL: Added a hack to get around eclipse bug 300408. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=300408)
Christian Humer <christian.humer@gmail.com>
parents: 10597
diff changeset
215 orderedBindings.put(declarationSourceStart, field(declarations[i], "binding"));
ae6b8ec920e2 Truffle-DSL: Added a hack to get around eclipse bug 300408. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=300408)
Christian Humer <christian.humer@gmail.com>
parents: 10597
diff changeset
216 }
ae6b8ec920e2 Truffle-DSL: Added a hack to get around eclipse bug 300408. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=300408)
Christian Humer <christian.humer@gmail.com>
parents: 10597
diff changeset
217 }
ae6b8ec920e2 Truffle-DSL: Added a hack to get around eclipse bug 300408. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=300408)
Christian Humer <christian.humer@gmail.com>
parents: 10597
diff changeset
218 }
ae6b8ec920e2 Truffle-DSL: Added a hack to get around eclipse bug 300408. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=300408)
Christian Humer <christian.humer@gmail.com>
parents: 10597
diff changeset
219
10597
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
220 @Override
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
221 public String getMethodBody(ProcessingEnvironment env, ExecutableElement method) {
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
222 try {
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
223
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
224 char[] source = getSource(method);
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
225 if (source == null) {
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
226 return null;
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
227 }
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
228
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
229 /*
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
230 * AbstractMethodDeclaration decl =
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
231 * ((MethodBinding)(((ElementImpl)method)._binding)).sourceMethod(); int bodyStart =
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
232 * decl.bodyStart; int bodyEnd = decl.bodyEnd;
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
233 */
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
234 Object decl = method(field(method, "_binding"), "sourceMethod");
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
235 int bodyStart = (int) field(decl, "bodyStart");
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
236 int bodyEnd = (int) field(decl, "bodyEnd");
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
237
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
238 int length = bodyEnd - bodyStart;
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
239 char[] target = new char[length];
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
240 System.arraycopy(source, bodyStart, target, 0, length);
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
241
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
242 return new String(target);
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
243 } catch (Exception e) {
16759
23415229349b Truffle-DSL: new package structure.
Christian Humer <christian.humer@gmail.com>
parents: 16753
diff changeset
244 return ElementUtils.printException(e);
10597
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
245 }
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
246 }
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
247
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
248 private static char[] getSource(Element element) throws Exception {
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
249 /*
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
250 * Binding binding = ((ElementImpl)element)._binding; char[] source = null; if (binding
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
251 * instanceof MethodBinding) { source = ((MethodBinding)
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
252 * binding).sourceMethod().compilationResult.getCompilationUnit().getContents(); } else if
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
253 * (binding instanceof SourceTypeBinding) { source =
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
254 * ((SourceTypeBinding)binding).scope.referenceContext
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
255 * .compilationResult.compilationUnit.getContents(); } return source;
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
256 */
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
257
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
258 Object binding = field(element, "_binding");
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
259 Class<?> methodBindingClass = Class.forName("org.eclipse.jdt.internal.compiler.lookup.MethodBinding");
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
260 Class<?> referenceBindingClass = Class.forName("org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding");
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
261
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
262 char[] source = null;
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
263 if (methodBindingClass.isAssignableFrom(binding.getClass())) {
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
264 Object sourceMethod = method(binding, "sourceMethod");
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
265 if (sourceMethod == null) {
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
266 return null;
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
267 }
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
268 source = (char[]) method(method(field(sourceMethod, "compilationResult"), "getCompilationUnit"), "getContents");
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
269 } else if (referenceBindingClass.isAssignableFrom(binding.getClass())) {
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
270 source = (char[]) method(field(field(field(field(binding, "scope"), "referenceContext"), "compilationResult"), "compilationUnit"), "getContents");
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
271 }
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
272 return source;
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
273 }
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
274
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
275 @Override
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
276 public String getHeaderComment(ProcessingEnvironment env, Element type) {
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
277 try {
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
278 char[] source = getSource(type);
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
279 if (source == null) {
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
280 return null;
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
281 }
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
282 return parseHeader(new String(source));
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
283 } catch (Exception e) {
16759
23415229349b Truffle-DSL: new package structure.
Christian Humer <christian.humer@gmail.com>
parents: 16753
diff changeset
284 return ElementUtils.printException(e);
10597
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
285 }
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
286 }
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
287
79041ab43660 Truffle-DSL: API-change: Renamed truffle.api.codegen to truffle.api.dsl for all projects and packages.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
288 }