comparison graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/node/NodeMethodParser.java @ 11465:3d618420a4b6

Truffle-DSL: minor cleanup.
author Christian Humer <christian.humer@gmail.com>
date Thu, 29 Aug 2013 14:28:43 +0200
parents 7a8835ec5e7d
children 25ecb47a6d0e
comparison
equal deleted inserted replaced
11464:e55e24cc3e7b 11465:3d618420a4b6
83 addDefaultChildren(shortCircuitsEnabled, shortCircuitName, methodSpec); 83 addDefaultChildren(shortCircuitsEnabled, shortCircuitName, methodSpec);
84 84
85 return methodSpec; 85 return methodSpec;
86 } 86 }
87 87
88 private void addDefaultChildren(boolean shortCircuitsEnabled, String shortCircuitName, MethodSpec methodSpec) { 88 public void addDefaultChildren(boolean shortCircuitsEnabled, String breakName, MethodSpec methodSpec) {
89 // children are null when parsing executable types 89 // children are null when parsing executable types
90 if (getNode().getChildren() != null) { 90 if (getNode().getChildren() != null) {
91 for (NodeChildData child : getNode().getChildren()) { 91 for (NodeChildData child : getNode().getChildren()) {
92 String valueName = child.getName();
93 if (breakName != null && valueName.equals(breakName)) {
94 break;
95 }
92 if (child.getExecutionKind() == ExecutionKind.DEFAULT) { 96 if (child.getExecutionKind() == ExecutionKind.DEFAULT) {
93 ParameterSpec spec = createValueParameterSpec(child.getName(), child.getNodeData(), child.getExecuteWith().size()); 97 ParameterSpec spec = createValueParameterSpec(child.getName(), child.getNodeData(), child.getExecuteWith().size());
94 if (child.getCardinality().isMany()) { 98 if (child.getCardinality().isMany()) {
95 spec.setCardinality(Cardinality.MANY); 99 spec.setCardinality(Cardinality.MANY);
96 spec.setIndexed(true); 100 spec.setIndexed(true);
97 } 101 }
98 methodSpec.addRequired(spec); 102 methodSpec.addRequired(spec);
99 } else if (child.getExecutionKind() == ExecutionKind.SHORT_CIRCUIT) { 103 } else if (child.getExecutionKind() == ExecutionKind.SHORT_CIRCUIT) {
100 String valueName = child.getName();
101 if (shortCircuitName != null && valueName.equals(shortCircuitName)) {
102 break;
103 }
104 104
105 if (shortCircuitsEnabled) { 105 if (shortCircuitsEnabled) {
106 methodSpec.addRequired(new ParameterSpec(shortCircuitValueName(valueName), getContext().getType(boolean.class))); 106 methodSpec.addRequired(new ParameterSpec(shortCircuitValueName(valueName), getContext().getType(boolean.class)));
107 } 107 }
108 methodSpec.addRequired(createValueParameterSpec(valueName, child.getNodeData(), child.getExecuteWith().size())); 108 methodSpec.addRequired(createValueParameterSpec(valueName, child.getNodeData(), child.getExecuteWith().size()));