Mercurial > hg > graal-compiler
annotate graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/NodeChildData.java @ 9417:ffa27c3058e9
minor simplifications for writing compiled stubs
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 29 Apr 2013 21:18:37 +0200 |
parents | 8e3a1635cc9e |
children | 746fa60be266 |
rev | line source |
---|---|
9220
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
1 /* |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
4 * |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
8 * |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
13 * accompanied this code). |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
14 * |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
18 * |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
21 * questions. |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
22 */ |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
23 package com.oracle.truffle.codegen.processor.node; |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
24 |
9287
8e3a1635cc9e
Implemented @NodeChild(executeWith={...}).
Christian Humer <christian.humer@gmail.com>
parents:
9227
diff
changeset
|
25 import java.util.*; |
8e3a1635cc9e
Implemented @NodeChild(executeWith={...}).
Christian Humer <christian.humer@gmail.com>
parents:
9227
diff
changeset
|
26 |
9220
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
27 import javax.lang.model.element.*; |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
28 import javax.lang.model.type.*; |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
29 |
9287
8e3a1635cc9e
Implemented @NodeChild(executeWith={...}).
Christian Humer <christian.humer@gmail.com>
parents:
9227
diff
changeset
|
30 import com.oracle.truffle.codegen.processor.*; |
9220
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
31 import com.oracle.truffle.codegen.processor.template.*; |
9287
8e3a1635cc9e
Implemented @NodeChild(executeWith={...}).
Christian Humer <christian.humer@gmail.com>
parents:
9227
diff
changeset
|
32 import com.oracle.truffle.codegen.processor.typesystem.*; |
9220
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
33 |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
34 public class NodeChildData extends MessageContainer { |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
35 |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
36 public enum Cardinality { |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
37 ONE, MANY; |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
38 |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
39 public boolean isMany() { |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
40 return this == MANY; |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
41 } |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
42 |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
43 public boolean isOne() { |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
44 return this == ONE; |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
45 } |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
46 } |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
47 |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
48 public enum ExecutionKind { |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
49 DEFAULT, SHORT_CIRCUIT |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
50 } |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
51 |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
52 private final Element sourceElement; |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
53 private final AnnotationMirror sourceAnnotationMirror; |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
54 |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
55 private final String name; |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
56 private final TypeMirror type; |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
57 private final Element accessElement; |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
58 |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
59 private final Cardinality cardinality; |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
60 private final ExecutionKind executionKind; |
9287
8e3a1635cc9e
Implemented @NodeChild(executeWith={...}).
Christian Humer <christian.humer@gmail.com>
parents:
9227
diff
changeset
|
61 |
8e3a1635cc9e
Implemented @NodeChild(executeWith={...}).
Christian Humer <christian.humer@gmail.com>
parents:
9227
diff
changeset
|
62 private List<NodeChildData> executeWith = Collections.emptyList(); |
8e3a1635cc9e
Implemented @NodeChild(executeWith={...}).
Christian Humer <christian.humer@gmail.com>
parents:
9227
diff
changeset
|
63 |
9220
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
64 private NodeData nodeData; |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
65 |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
66 public NodeChildData(Element sourceElement, AnnotationMirror sourceMirror, String name, TypeMirror nodeType, Element accessElement, Cardinality cardinality, ExecutionKind executionKind) { |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
67 this.sourceElement = sourceElement; |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
68 this.sourceAnnotationMirror = sourceMirror; |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
69 this.name = name; |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
70 this.type = nodeType; |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
71 this.accessElement = accessElement; |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
72 this.cardinality = cardinality; |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
73 this.executionKind = executionKind; |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
74 } |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
75 |
9287
8e3a1635cc9e
Implemented @NodeChild(executeWith={...}).
Christian Humer <christian.humer@gmail.com>
parents:
9227
diff
changeset
|
76 public List<NodeChildData> getExecuteWith() { |
8e3a1635cc9e
Implemented @NodeChild(executeWith={...}).
Christian Humer <christian.humer@gmail.com>
parents:
9227
diff
changeset
|
77 return executeWith; |
8e3a1635cc9e
Implemented @NodeChild(executeWith={...}).
Christian Humer <christian.humer@gmail.com>
parents:
9227
diff
changeset
|
78 } |
8e3a1635cc9e
Implemented @NodeChild(executeWith={...}).
Christian Humer <christian.humer@gmail.com>
parents:
9227
diff
changeset
|
79 |
8e3a1635cc9e
Implemented @NodeChild(executeWith={...}).
Christian Humer <christian.humer@gmail.com>
parents:
9227
diff
changeset
|
80 void setExecuteWith(List<NodeChildData> executeWith) { |
8e3a1635cc9e
Implemented @NodeChild(executeWith={...}).
Christian Humer <christian.humer@gmail.com>
parents:
9227
diff
changeset
|
81 this.executeWith = executeWith; |
8e3a1635cc9e
Implemented @NodeChild(executeWith={...}).
Christian Humer <christian.humer@gmail.com>
parents:
9227
diff
changeset
|
82 } |
8e3a1635cc9e
Implemented @NodeChild(executeWith={...}).
Christian Humer <christian.humer@gmail.com>
parents:
9227
diff
changeset
|
83 |
8e3a1635cc9e
Implemented @NodeChild(executeWith={...}).
Christian Humer <christian.humer@gmail.com>
parents:
9227
diff
changeset
|
84 public ExecutableTypeData findExecutableType(ProcessorContext context, TypeData targetType) { |
8e3a1635cc9e
Implemented @NodeChild(executeWith={...}).
Christian Humer <christian.humer@gmail.com>
parents:
9227
diff
changeset
|
85 ExecutableTypeData executableType = nodeData.findExecutableType(targetType, getExecuteWith().size()); |
8e3a1635cc9e
Implemented @NodeChild(executeWith={...}).
Christian Humer <christian.humer@gmail.com>
parents:
9227
diff
changeset
|
86 if (executableType == null) { |
8e3a1635cc9e
Implemented @NodeChild(executeWith={...}).
Christian Humer <christian.humer@gmail.com>
parents:
9227
diff
changeset
|
87 executableType = findAnyGenericExecutableType(context); |
8e3a1635cc9e
Implemented @NodeChild(executeWith={...}).
Christian Humer <christian.humer@gmail.com>
parents:
9227
diff
changeset
|
88 } |
8e3a1635cc9e
Implemented @NodeChild(executeWith={...}).
Christian Humer <christian.humer@gmail.com>
parents:
9227
diff
changeset
|
89 return executableType; |
8e3a1635cc9e
Implemented @NodeChild(executeWith={...}).
Christian Humer <christian.humer@gmail.com>
parents:
9227
diff
changeset
|
90 } |
8e3a1635cc9e
Implemented @NodeChild(executeWith={...}).
Christian Humer <christian.humer@gmail.com>
parents:
9227
diff
changeset
|
91 |
8e3a1635cc9e
Implemented @NodeChild(executeWith={...}).
Christian Humer <christian.humer@gmail.com>
parents:
9227
diff
changeset
|
92 public List<ExecutableTypeData> findGenericExecutableTypes(ProcessorContext context) { |
8e3a1635cc9e
Implemented @NodeChild(executeWith={...}).
Christian Humer <christian.humer@gmail.com>
parents:
9227
diff
changeset
|
93 return nodeData.findGenericExecutableTypes(context, getExecuteWith().size()); |
8e3a1635cc9e
Implemented @NodeChild(executeWith={...}).
Christian Humer <christian.humer@gmail.com>
parents:
9227
diff
changeset
|
94 } |
8e3a1635cc9e
Implemented @NodeChild(executeWith={...}).
Christian Humer <christian.humer@gmail.com>
parents:
9227
diff
changeset
|
95 |
8e3a1635cc9e
Implemented @NodeChild(executeWith={...}).
Christian Humer <christian.humer@gmail.com>
parents:
9227
diff
changeset
|
96 public ExecutableTypeData findAnyGenericExecutableType(ProcessorContext context) { |
8e3a1635cc9e
Implemented @NodeChild(executeWith={...}).
Christian Humer <christian.humer@gmail.com>
parents:
9227
diff
changeset
|
97 return nodeData.findAnyGenericExecutableType(context, getExecuteWith().size()); |
8e3a1635cc9e
Implemented @NodeChild(executeWith={...}).
Christian Humer <christian.humer@gmail.com>
parents:
9227
diff
changeset
|
98 } |
8e3a1635cc9e
Implemented @NodeChild(executeWith={...}).
Christian Humer <christian.humer@gmail.com>
parents:
9227
diff
changeset
|
99 |
8e3a1635cc9e
Implemented @NodeChild(executeWith={...}).
Christian Humer <christian.humer@gmail.com>
parents:
9227
diff
changeset
|
100 public List<ExecutableTypeData> findExecutableTypes() { |
8e3a1635cc9e
Implemented @NodeChild(executeWith={...}).
Christian Humer <christian.humer@gmail.com>
parents:
9227
diff
changeset
|
101 return nodeData.getExecutableTypes(getExecuteWith().size()); |
8e3a1635cc9e
Implemented @NodeChild(executeWith={...}).
Christian Humer <christian.humer@gmail.com>
parents:
9227
diff
changeset
|
102 } |
8e3a1635cc9e
Implemented @NodeChild(executeWith={...}).
Christian Humer <christian.humer@gmail.com>
parents:
9227
diff
changeset
|
103 |
9220
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
104 @Override |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
105 public Element getMessageElement() { |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
106 return sourceElement; |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
107 } |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
108 |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
109 @Override |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
110 public AnnotationMirror getMessageAnnotation() { |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
111 return sourceAnnotationMirror; |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
112 } |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
113 |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
114 public boolean isShortCircuit() { |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
115 return executionKind == ExecutionKind.SHORT_CIRCUIT; |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
116 } |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
117 |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
118 void setNode(NodeData nodeData) { |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
119 this.nodeData = nodeData; |
9227
6d92fdf1c999
Fixes several minor issues.
Christian Humer <christian.humer@gmail.com>
parents:
9220
diff
changeset
|
120 if (nodeData != null) { |
6d92fdf1c999
Fixes several minor issues.
Christian Humer <christian.humer@gmail.com>
parents:
9220
diff
changeset
|
121 getMessages().addAll(nodeData.collectMessages()); |
6d92fdf1c999
Fixes several minor issues.
Christian Humer <christian.humer@gmail.com>
parents:
9220
diff
changeset
|
122 } |
9220
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
123 } |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
124 |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
125 public Element getAccessElement() { |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
126 return accessElement; |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
127 } |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
128 |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
129 public TypeMirror getNodeType() { |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
130 return type; |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
131 } |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
132 |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
133 public Cardinality getCardinality() { |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
134 return cardinality; |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
135 } |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
136 |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
137 public ExecutionKind getExecutionKind() { |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
138 return executionKind; |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
139 } |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
140 |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
141 public NodeData getNodeData() { |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
142 return nodeData; |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
143 } |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
144 |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
145 public String getName() { |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
146 return name; |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
147 } |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
148 |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
149 @Override |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
150 public String toString() { |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
151 return "NodeFieldData[name=" + getName() + ", kind=" + cardinality + ", execution=" + executionKind + ", node=" + getNodeData() + "]"; |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
152 } |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
153 |
97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
154 } |