Changeset 1228
- Timestamp:
- 07/13/08 13:22:12 (2 months ago)
- Files:
-
- trunk/descent.core/META-INF/MANIFEST.MF (modified) (1 diff)
- trunk/descent.core/src/descent/core/dom/AST.java (modified) (1 diff)
- trunk/descent.core/src/descent/core/dom/ASTConverter.java (modified) (7 diffs)
- trunk/descent.core/src/descent/core/dom/ASTMatcher.java (modified) (3 diffs)
- trunk/descent.core/src/descent/core/dom/ASTNode.java (modified) (2 diffs)
- trunk/descent.core/src/descent/core/dom/ASTVisitor.java (modified) (1 diff)
- trunk/descent.core/src/descent/core/dom/AliasDeclaration.java (modified) (2 diffs)
- trunk/descent.core/src/descent/core/dom/Declaration.java (modified) (1 diff)
- trunk/descent.core/src/descent/core/dom/EnumMember.java (modified) (10 diffs)
- trunk/descent.core/src/descent/core/dom/FunctionDeclaration.java (modified) (6 diffs)
- trunk/descent.core/src/descent/core/dom/GenericVisitor.java (modified) (1 diff)
- trunk/descent.core/src/descent/core/dom/NaiveASTFlattener.java (modified) (4 diffs)
- trunk/descent.core/src/descent/core/dom/PostblitDeclaration.java (added)
- trunk/descent.core/src/descent/core/dom/TemplateParameter.java (modified) (1 diff)
- trunk/descent.core/src/descent/core/dom/ThisTemplateParameter.java (added)
- trunk/descent.core/src/descent/core/dom/TypeTemplateParameter.java (modified) (2 diffs)
- trunk/descent.core/src/descent/core/dom/VariableBinding.java (modified) (1 diff)
- trunk/descent.core/src/descent/core/formatter/DefaultCodeFormatterConstants.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/codeassist/CompletionEngine.java (modified) (3 diffs)
- trunk/descent.core/src/descent/internal/codeassist/SelectionEngine.java (modified) (2 diffs)
- trunk/descent.core/src/descent/internal/compiler/SourceElementParser.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/compiler/parser/ASTDmdNode.java (modified) (2 diffs)
- trunk/descent.core/src/descent/internal/compiler/parser/CallExp.java (modified) (2 diffs)
- trunk/descent.core/src/descent/internal/compiler/parser/Dsymbol.java (modified) (2 diffs)
- trunk/descent.core/src/descent/internal/compiler/parser/EnumMember.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/compiler/parser/Parser.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/compiler/parser/PostBlitDeclaration.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/compiler/parser/TemplateThisParameter.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/compiler/parser/ThisExp.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/compiler/parser/TypeFunction.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/compiler/parser/ast/NaiveASTFlattener.java (modified) (2 diffs)
- trunk/descent.core/src/descent/internal/compiler/parser/port.txt (modified) (1 diff)
- trunk/descent.core/src/descent/internal/formatter/CodeFormatterVisitor.java (modified) (10 diffs)
- trunk/descent.core/src/descent/internal/formatter/DefaultCodeFormatterOptions.java (modified) (5 diffs)
- trunk/descent.core/template/formatter/formatter_options.txt (modified) (1 diff)
- trunk/descent.debug.core/META-INF/MANIFEST.MF (modified) (1 diff)
- trunk/descent.debug.ui/META-INF/MANIFEST.MF (modified) (1 diff)
- trunk/descent.launching/META-INF/MANIFEST.MF (modified) (1 diff)
- trunk/descent.tests/descent/tests/format/FormatFunctionDeclaration_Tests.java (modified) (1 diff)
- trunk/descent.tests/descent/tests/mars/Function_Test.java (modified) (2 diffs)
- trunk/descent.ui-feature/feature.xml (modified) (1 diff)
- trunk/descent.ui.astviewer/META-INF/MANIFEST.MF (modified) (1 diff)
- trunk/descent.ui.metrics/META-INF/MANIFEST.MF (modified) (1 diff)
- trunk/descent.ui/META-INF/MANIFEST.MF (modified) (1 diff)
- trunk/descent.ui/src/descent/internal/ui/JavaUIMessages.java (modified) (1 diff)
- trunk/descent.ui/src/descent/internal/ui/JavaUIMessages.properties (modified) (1 diff)
- trunk/descent.ui/src/descent/internal/ui/preferences/formatter/BracesTabPage.java (modified) (2 diffs)
- trunk/descent.ui/src/descent/internal/ui/preferences/formatter/FormatterMessages.java (modified) (1 diff)
- trunk/descent.ui/src/descent/internal/ui/preferences/formatter/FormatterMessages.properties (modified) (1 diff)
- trunk/descent.ui/src/descent/ui/JavaElementLabels.java (modified) (2 diffs)
- trunk/descent.unittest/META-INF/MANIFEST.MF (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/descent.core/META-INF/MANIFEST.MF
r1222 r1228 3 3 Bundle-Name: %pluginName 4 4 Bundle-SymbolicName: descent.core;singleton:=true 5 Bundle-Version: 0.5.3.200807 085 Bundle-Version: 0.5.3.20080713 6 6 Bundle-Activator: descent.core.JavaCore 7 7 Bundle-Vendor: %providerName trunk/descent.core/src/descent/core/dom/AST.java
r1165 r1228 2426 2426 return node; 2427 2427 } 2428 2429 /** 2430 * Creates an unparented postblit declaration node owned by this AST. 2431 * 2432 * @return the new unparented postblit declaration node 2433 */ 2434 public PostblitDeclaration newPostblitDeclaration() { 2435 PostblitDeclaration node = new PostblitDeclaration(this); 2436 return node; 2437 } 2438 2439 /** 2440 * Creates an unparented this template parameter node owned by this AST. 2441 * 2442 * @return the new unparented this template parameter node 2443 */ 2444 public ThisTemplateParameter newThisTemplateParameter() { 2445 ThisTemplateParameter node = new ThisTemplateParameter(this); 2446 return node; 2447 } 2428 2448 2429 2449 } trunk/descent.core/src/descent/core/dom/ASTConverter.java
r1227 r1228 353 353 case ASTDmdNode.OR_OR_EXP: 354 354 return convert((BinExp) symbol, InfixExpression.Operator.OR_OR); 355 case ASTDmdNode.POSTBLIT_DECLARATION: 356 return convert((PostBlitDeclaration) symbol); 355 357 case ASTDmdNode.POST_EXP: 356 358 return convert((PostExp) symbol); … … 411 413 case ASTDmdNode.TEMPLATE_TYPE_PARAMETER: 412 414 return convert((TemplateTypeParameter) symbol); 415 case ASTDmdNode.TEMPLATE_THIS_PARAMETER: 416 return convert((TemplateThisParameter) symbol); 413 417 case ASTDmdNode.TEMPLATE_VALUE_PARAMETER: 414 418 return convert((TemplateValueParameter) symbol); … … 1132 1136 public descent.core.dom.TypeTemplateParameter convert(TemplateTypeParameter a) { 1133 1137 descent.core.dom.TypeTemplateParameter b = new descent.core.dom.TypeTemplateParameter(ast); 1138 convertCommonTemplateTypeParameter(a, b); 1139 return b; 1140 } 1141 1142 public descent.core.dom.ThisTemplateParameter convert(TemplateThisParameter a) { 1143 descent.core.dom.ThisTemplateParameter b = new descent.core.dom.ThisTemplateParameter(ast); 1144 convertCommonTemplateTypeParameter(a, b); 1145 return b; 1146 } 1147 1148 private void convertCommonTemplateTypeParameter(TemplateTypeParameter a, descent.core.dom.TypeTemplateParameter b) { 1134 1149 b.setName((SimpleName) convert(a.ident)); 1135 1150 if (a.sourceDefaultType != null) { … … 1140 1155 } 1141 1156 setSourceRange(b, a.start, a.length); 1142 return b;1143 1157 } 1144 1158 … … 1665 1679 } 1666 1680 1681 public descent.core.dom.PostblitDeclaration convert(PostBlitDeclaration a) { 1682 descent.core.dom.PostblitDeclaration b = new descent.core.dom.PostblitDeclaration(ast); 1683 1684 if (a.sourceFrequire != null) { 1685 b.setPrecondition((Block) convert(a.sourceFrequire)); 1686 } 1687 if (a.sourceFensure != null) { 1688 b.setPostcondition((Block) convert(a.sourceFensure)); 1689 } 1690 if (a.outId != null) { 1691 b.setPostconditionVariableName((SimpleName) convert(a.outId)); 1692 } 1693 if (a.sourceFbody != null) { 1694 descent.core.dom.Block convertedBody = (Block) convert(a.sourceFbody); 1695 if (convertedBody != null) { 1696 b.setBody(convertedBody); 1697 } 1698 } 1699 1700 fillDeclaration(b, a); 1701 1702 setSourceRange(b, a.start, a.length); 1703 1704 if (resolveBindings) { 1705 recordNodes(b, a); 1706 } 1707 1708 return b; 1709 } 1710 1667 1711 public descent.core.dom.ForeachStatement convert(ForeachStatement a) { 1668 1712 descent.core.dom.ForeachStatement b = new descent.core.dom.ForeachStatement(ast); … … 1801 1845 public descent.core.dom.EnumMember convert(EnumMember a) { 1802 1846 descent.core.dom.EnumMember b = new descent.core.dom.EnumMember(ast); 1847 if (a.sourceType != null) { 1848 b.setType(convert(a.sourceType)); 1849 } 1803 1850 if (a.ident != null) { 1804 1851 SimpleName convertedIdent = (SimpleName) convert(a.ident); … … 3125 3172 TypeofReturn b = new TypeofReturn(ast); 3126 3173 setSourceRange(b, a.start, a.length); 3174 3175 if (resolveBindings) { 3176 recordNodes(b, a); 3177 } 3178 3127 3179 return b; 3128 3180 } trunk/descent.core/src/descent/core/dom/ASTMatcher.java
r1165 r1228 209 209 ); 210 210 } 211 212 /** 213 * Returns whether the given node and the other object match. 214 * <p> 215 * The default implementation provided by this class tests whether the 216 * other object is a node of the same type with structurally isomorphic 217 * child subtrees. Subclasses may override this method as needed. 218 * </p> 219 * 220 * @param node the node 221 * @param other the other object, or <code>null</code> 222 * @return <code>true</code> if the subtree matches, or 223 * <code>false</code> if they do not match or the other object has a 224 * different node type or is <code>null</code> 225 */ 226 public boolean match(PostblitDeclaration node, Object other) { 227 if (!(other instanceof PostblitDeclaration)) { 228 return false; 229 } 230 PostblitDeclaration o = (PostblitDeclaration) other; 231 return ( 232 safeSubtreeListMatch(node.preDDocs(), o.preDDocs()) 233 && safeSubtreeListMatch(node.modifiers(), o.modifiers()) 234 && safeSubtreeMatch(node.getPrecondition(), o.getPrecondition()) 235 && safeSubtreeMatch(node.getPostcondition(), o.getPostcondition()) 236 && safeSubtreeMatch(node.getPostconditionVariableName(), o.getPostconditionVariableName()) 237 && safeSubtreeMatch(node.getBody(), o.getBody()) 238 && safeSubtreeMatch(node.getPostDDoc(), o.getPostDDoc()) 239 ); 240 } 211 241 212 242 /** … … 792 822 return ( 793 823 safeSubtreeListMatch(node.preDDocs(), o.preDDocs()) 824 && safeSubtreeMatch(node.getType(), o.getType()) 794 825 && safeSubtreeMatch(node.getName(), o.getName()) 795 826 && safeSubtreeMatch(node.getValue(), o.getValue()) … … 1090 1121 && safeSubtreeListMatch(node.arguments(), o.arguments()) 1091 1122 && node.isVariadic() == o.isVariadic() 1123 && safeSubtreeListMatch(node.postModifiers(), o.postModifiers()) 1092 1124 && safeSubtreeMatch(node.getPrecondition(), o.getPrecondition()) 1093 1125 && safeSubtreeMatch(node.getPostcondition(), o.getPostcondition()) trunk/descent.core/src/descent/core/dom/ASTNode.java
r1201 r1228 1120 1120 */ 1121 1121 public static final int TYPEOF_RETURN = 138; 1122 1123 /** 1124 * Node type constant indicating a node of type 1125 * <code>PostblitDeclaration</code>. 1126 * @see PostblitDeclaration 1127 */ 1128 public static final int POSTBLIT_DECLARATION = 139; 1129 1130 /** 1131 * Node type constant indicating a node of type 1132 * <code>ThisTemplateParameter</code>. 1133 * @see ThisTemplateParameter 1134 */ 1135 public static final int THIS_TEMPLATE_PARAMETER = 140; 1122 1136 1123 1137 /** … … 1408 1422 case EMPTY_STATEMENT: 1409 1423 return EmptyStatement.class; 1424 case POSTBLIT_DECLARATION: 1425 return PostblitDeclaration.class; 1426 case THIS_TEMPLATE_PARAMETER: 1427 return ThisTemplateParameter.class; 1410 1428 } 1411 1429 return null; trunk/descent.core/src/descent/core/dom/ASTVisitor.java
r1165 r1228 3937 3937 } 3938 3938 3939 /** 3940 * Visits the given type-specific AST node. 3941 * <p> 3942 * The default implementation does nothing and return true. 3943 * Subclasses may reimplement. 3944 * </p> 3945 * 3946 * @param node the node to visit 3947 * @return <code>true</code> if the children of this node should be 3948 * visited, and <code>false</code> if the children of this node should 3949 * be skipped 3950 */ 3951 public boolean visit(PostblitDeclaration node) { 3952 return true; 3953 } 3954 3955 /** 3956 * End of visit the given type-specific AST node. 3957 * <p> 3958 * The default implementation does nothing. Subclasses may reimplement. 3959 * </p> 3960 * 3961 * @param node the node to visit 3962 */ 3963 public void endVisit(PostblitDeclaration node) { 3964 3965 } 3966 3967 /** 3968 * Visits the given type-specific AST node. 3969 * <p> 3970 * The default implementation does nothing and return true. 3971 * Subclasses may reimplement. 3972 * </p> 3973 * 3974 * @param node the node to visit 3975 * @return <code>true</code> if the children of this node should be 3976 * visited, and <code>false</code> if the children of this node should 3977 * be skipped 3978 */ 3979 public boolean visit(ThisTemplateParameter node) { 3980 return true; 3981 } 3982 3983 /** 3984 * End of visit the given type-specific AST node. 3985 * <p> 3986 * The default implementation does nothing. Subclasses may reimplement. 3987 * </p> 3988 * 3989 * @param node the node to visit 3990 */ 3991 public void endVisit(ThisTemplateParameter node) { 3992 3993 } 3994 3939 3995 } trunk/descent.core/src/descent/core/dom/AliasDeclaration.java
r964 r1228 151 151 } 152 152 153 @Override154 final ChildListPropertyDescriptor internalPreDDocsProperty() {155 return PRE_D_DOCS_PROPERTY;156 }157 158 @Override159 final ChildListPropertyDescriptor internalModifiersProperty() {160 return MODIFIERS_PROPERTY;161 }162 163 @Override164 final ChildPropertyDescriptor internalPostDDocProperty() {165 return POST_D_DOC_PROPERTY;166 }153 @Override 154 final ChildListPropertyDescriptor internalPreDDocsProperty() { 155 return PRE_D_DOCS_PROPERTY; 156 } 157 158 @Override 159 final ChildListPropertyDescriptor internalModifiersProperty() { 160 return MODIFIERS_PROPERTY; 161 } 162 163 @Override 164 final ChildPropertyDescriptor internalPostDDocProperty() { 165 return POST_D_DOC_PROPERTY; 166 } 167 167 168 168 /* (omit javadoc for this method) … … 183 183 result.setType((Type) getType().clone(target)); 184 184 result.fragments.addAll(ASTNode.copySubtrees(target, fragments())); 185 result.setPostDDoc((DDocComment) ASTNode.copySubtree(target, getPostDDoc()));185 result.setPostDDoc((DDocComment) ASTNode.copySubtree(target, getPostDDoc())); 186 186 return result; 187 187 } trunk/descent.core/src/descent/core/dom/Declaration.java
r1227 r1228 21 21 * MixinDeclaration 22 22 * ModifierDeclaration 23 * PostblitDeclaration 23 24 * PragmaDeclaration 24 25 * StaticAssert trunk/descent.core/src/descent/core/dom/EnumMember.java
r955 r1228 10 10 * <pre> 11 11 * EnumMember: 12 * SimpleName [ <b>=</b> Expression ]12 * [ Type ] SimpleName [ <b>=</b> Expression ] 13 13 * </pre> 14 14 */ … … 20 20 public static final ChildListPropertyDescriptor PRE_D_DOCS_PROPERTY = 21 21 new ChildListPropertyDescriptor(EnumMember.class, "preDDocs", CodeComment.class, NO_CYCLE_RISK); //$NON-NLS-1$ 22 23 /** 24 * The "type" structural property of this node type. 25 */ 26 public static final ChildPropertyDescriptor TYPE_PROPERTY = 27 new ChildPropertyDescriptor(EnumMember.class, "type", Type.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$ 22 28 23 29 /** … … 50 56 createPropertyList(EnumMember.class, properyList); 51 57 addProperty(PRE_D_DOCS_PROPERTY, properyList); 52 addProperty(NAME_PROPERTY, properyList); 58 addProperty(TYPE_PROPERTY, properyList); 59 addProperty(NAME_PROPERTY, properyList); 53 60 addProperty(VALUE_PROPERTY, properyList); 54 61 addProperty(POST_D_DOC_PROPERTY, properyList); … … 78 85 private ASTNode.NodeList preDDocs = 79 86 new ASTNode.NodeList(PRE_D_DOCS_PROPERTY); 87 88 /** 89 * The type. 90 */ 91 private Type type; 92 80 93 /** 81 94 * The name. … … 118 131 */ 119 132 final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) { 133 if (property == TYPE_PROPERTY) { 134 if (get) { 135 return getType(); 136 } else { 137 setType((Type) child); 138 return null; 139 } 140 } 120 141 if (property == NAME_PROPERTY) { 121 142 if (get) { … … 171 192 result.setSourceRange(this.getStartPosition(), this.getLength()); 172 193 result.preDDocs.addAll(ASTNode.copySubtrees(target, preDDocs())); 194 result.setType((Type) ASTNode.copySubtree(target, getType())); 173 195 result.setName((SimpleName) getName().clone(target)); 174 result.setValue((Expression) ASTNode.copySubtree(target, getValue()));175 result.setPostDDoc((CodeComment) ASTNode.copySubtree(target, getPostDDoc()));196 result.setValue((Expression) ASTNode.copySubtree(target, getValue())); 197 result.setPostDDoc((CodeComment) ASTNode.copySubtree(target, getPostDDoc())); 176 198 return result; 177 199 } … … 193 215 // visit children in normal left to right reading order 194 216 acceptChildren(visitor, this.preDDocs); 217 acceptChild(visitor, getType()); 195 218 acceptChild(visitor, getName()); 196 219 acceptChild(visitor, getValue()); … … 209 232 public List<CodeComment> preDDocs() { 210 233 return this.preDDocs; 234 } 235 236 /** 237 * Returns the type of this enum member. 238 * 239 * @return the type 240 */ 241 public Type getType() { 242 return this.type; 243 } 244 245 /** 246 * Sets the type of this enum member. 247 * 248 * @param type the type 249 * @exception IllegalArgumentException if: 250 * <ul> 251 * <li>the node belongs to a different AST</li> 252 * <li>the node already has a parent</li> 253 * <li>a cycle in would be created</li> 254 * </ul> 255 */ 256 public void setType(Type type) { 257 ASTNode oldChild = this.type; 258 preReplaceChild(oldChild, type, TYPE_PROPERTY); 259 this.type = type; 260 postReplaceChild(oldChild, type, TYPE_PROPERTY); 211 261 } 212 262 … … 309 359 */ 310 360 int memSize() { 311 return BASE_NODE_SIZE + 4* 4;361 return BASE_NODE_SIZE + 5 * 4; 312 362 } 313 363 … … 319 369 memSize() 320 370 + (this.preDDocs.listSize()) 371 + (this.type == null ? 0 : getType().treeSize()) 321 372 + (this.name == null ? 0 : getName().treeSize()) 322 373 + (this.value == null ? 0 : getValue().treeSize()) trunk/descent.core/src/descent/core/dom/FunctionDeclaration.java
r1227 r1228 116 116 addProperty(ARGUMENTS_PROPERTY, properyList); 117 117 addProperty(VARIADIC_PROPERTY, properyList); 118 addProperty(POST_MODIFIERS_PROPERTY, properyList); 118 119 addProperty(PRECONDITION_PROPERTY, properyList); 119 120 addProperty(POSTCONDITION_PROPERTY, properyList); … … 275 276 return modifiers(); 276 277 } 278 if (property == POST_MODIFIERS_PROPERTY) { 279 return modifiers(); 280 } 277 281 if (property == TEMPLATE_PARAMETERS_PROPERTY) { 278 282 return templateParameters(); … … 285 289 } 286 290 287 @Override288 final ChildListPropertyDescriptor internalPreDDocsProperty() {289 return PRE_D_DOCS_PROPERTY;290 }291 292 @Override293 final ChildListPropertyDescriptor internalModifiersProperty() {294 return MODIFIERS_PROPERTY;295 }296 297 @Override298 final ChildListPropertyDescriptor internalArgumentsProperty() {299 return ARGUMENTS_PROPERTY;300 }301 302 @Override303 final SimplePropertyDescriptor internalVariadicProperty() {304 return VARIADIC_PROPERTY;305 }306 307 @Override308 final ChildPropertyDescriptor internalPreconditionProperty() {309 return PRECONDITION_PROPERTY;310 }311 312 @Override313 final ChildPropertyDescriptor internalPostconditionProperty() {314 return POSTCONDITION_PROPERTY;315 }316 317 @Override318 final ChildPropertyDescriptor internalPostconditionVariableNameProperty() {319 return POSTCONDITION_VARIABLE_NAME_PROPERTY;320 }321 322 @Override323 final ChildPropertyDescriptor internalBodyProperty() {324 return BODY_PROPERTY;325 }326 327 @Override328 final ChildPropertyDescriptor internalPostDDocProperty() {329 return POST_D_DOC_PROPERTY;330 }291 @Override 292 final ChildListPropertyDescriptor internalPreDDocsProperty() { 293 return PRE_D_DOCS_PROPERTY; 294 } 295 296 @Override 297 final ChildListPropertyDescriptor internalModifiersProperty() { 298 return MODIFIERS_PROPERTY; 299 } 300 301 @Override 302 final ChildListPropertyDescriptor internalArgumentsProperty() { 303 return ARGUMENTS_PROPERTY; 304 } 305 306 @Override 307 final SimplePropertyDescriptor internalVariadicProperty() { 308 return VARIADIC_PROPERTY; 309 } 310 311 @Override 312 final ChildPropertyDescriptor internalPreconditionProperty() { 313 return PRECONDITION_PROPERTY; 314 } 315 316 @Override 317 final ChildPropertyDescriptor internalPostconditionProperty() { 318 return POSTCONDITION_PROPERTY; 319 } 320 321 @Override 322 final ChildPropertyDescriptor internalPostconditionVariableNameProperty() { 323 return POSTCONDITION_VARIABLE_NAME_PROPERTY; 324 } 325 326 @Override 327 final ChildPropertyDescriptor internalBodyProperty() { 328 return BODY_PROPERTY; 329 } 330 331 @Override 332 final ChildPropertyDescriptor internalPostDDocProperty() { 333 return POST_D_DOC_PROPERTY; 334 } 331 335 332 336 /* (omit javadoc for this method) … … 345 349 result.preDDocs.addAll(ASTNode.copySubtrees(target, preDDocs())); 346 350 result.modifiers.addAll(ASTNode.copySubtrees(target, modifiers())); 351 result.postModifiers.addAll(ASTNode.copySubtrees(target, postModifiers())); 347 352 result.setReturnType((Type) getReturnType().clone(target)); 348 353 result.setName((SimpleName) getName().clone(target)); … … 350 355 result.arguments.addAll(ASTNode.copySubtrees(target, arguments())); 351 356 result.setVariadic(isVariadic()); 352 result.setPrecondition((Block) ASTNode.copySubtree(target, getPrecondition()));353 result.setPostcondition((Block) ASTNode.copySubtree(target, getPostcondition()));354 result.setPostconditionVariableName((SimpleName) ASTNode.copySubtree(target, getPostconditionVariableName()));357 result.setPrecondition((Block) ASTNode.copySubtree(target, getPrecondition())); 358 result.setPostcondition((Block) ASTNode.copySubtree(target, getPostcondition())); 359 result.setPostconditionVariableName((SimpleName) ASTNode.copySubtree(target, getPostconditionVariableName())); 355 360 result.setBody((Block) getBody().clone(target)); 356 result.setPostDDoc((DDocComment) ASTNode.copySubtree(target, getPostDDoc()));361 result.setPostDDoc((DDocComment) ASTNode.copySubtree(target, getPostDDoc())); 357 362 return result; 358 363 } … … 379 384 acceptChildren(visitor, this.templateParameters); 380 385 acceptChildren(visitor, this.arguments); 386 acceptChildren(visitor, this.postModifiers); 381 387 acceptChild(visitor, getPrecondition()); 382 388 acceptChild(visitor, getPostcondition()); trunk/descent.core/src/descent/core/dom/GenericVisitor.java
r1165 r1228 1669 1669 endVisitNode(node); 1670 1670 } 1671 1672 @Override 1673 public boolean visit(PostblitDeclaration node) { 1674 return visitNode(node); 1675 } 1676 1677 @Override 1678 public void endVisit(PostblitDeclaration node) { 1679 endVisitNode(node); 1680 } 1681 1682 @Override 1683 public boolean visit(ThisTemplateParameter node) { 1684 return visitNode(node); 1685 } 1686 1687 @Override 1688 public void endVisit(ThisTemplateParameter node) { 1689 endVisitNode(node); 1690 } 1671 1691 1672 1692 } trunk/descent.core/src/descent/core/dom/NaiveASTFlattener.java
r1165 r1228 710 710 public boolean visit(EnumMember node) { 711 711 printIndent(); 712 if (node.getType() != null) { 713 node.getType().accept(this); 714 this.buffer.append(' '); 715 } 712 716 node.getName().accept(this); 713 717 if (node.getValue() != null) { … … 830 834 } 831 835 this.buffer.append(")"); 836 837 if (!node.postModifiers().isEmpty()) { 838 this.buffer.append(" "); 839 visitModifiers(node.postModifiers()); 840 } 841 832 842 if (node.getPrecondition() != null) { 833 843 this.buffer.append(LINE_END); … … 1660 1670 1661 1671 @Override 1672 public boolean visit(ThisTemplateParameter node) { 1673 this.buffer.append("this "); 1674 return visit((TypeTemplateParameter) node); 1675 } 1676 1677 @Override 1662 1678 public boolean visit(UnitTestDeclaration node) { 1663 1679 visitPreDDocss(node.preDDocs()); … … 1811 1827 1812 1828 @Override 1829 public boolean visit(PostblitDeclaration node) { 1830 visitPreDDocss(node.preDDocs()); 1831 printIndent(); 1832 visitModifiers(node.modifiers()); 1833 this.buffer.append("this(this) "); 1834 1835 if (node.getPrecondition() != null) { 1836 this.buffer.append(LINE_END); 1837 printIndent(); 1838 this.buffer.append("in "); 1839 node.getPrecondition().accept(this); 1840 this.buffer.append(LINE_END); 1841 printIndent(); 1842 } 1843 if (node.getPostcondition() != null) { 1844 this.buffer.append(LINE_END); 1845 printIndent(); 1846 this.buffer.append("out "); 1847 node.getPostcondition().accept(this); 1848 this.buffer.append(LINE_END); 1849 printIndent(); 1850 } 1851 if (node.getBody() != null) { 1852 if (node.getPrecondition() != null || node.getPostcondition() != null) { 1853 this.buffer.append("body"); 1854 } 1855 this.buffer.append(" "); 1856 node.getBody().accept(this); 1857 } 1858 1859 if (node.getPostDDoc() != null) { 1860 this.buffer.append(" "); 1861 node.getPostDDoc().accept(this); 1862 } 1863 return false; 1864 } 1865 1866 @Override 1813 1867 public boolean visit(WithStatement node) { 1814 1868 printIndent(); trunk/descent.core/src/descent/core/dom/TemplateParameter.java
r176 r1228 18 18 * TypeTemplateParameter: 19 19 * SimpleName [ <b>:</b> Type ] [ <b>=</b> Type ] 20 * ThisTemplateParameter: 21 * <b>this</b> SimpleName [ <b>:</b> Type ] [ <b>=</b> Type ] 20 22 * ValueTemplateParameter: 21 23 * Type SimpleName [ <b>:</b> Expression ] [ <b>=</b> Expression ] trunk/descent.core/src/descent/core/dom/TypeTemplateParameter.java
r176 r1228 135 135 * Method declared on ASTNode. 136 136 */ 137 finalint getNodeType0() {137 int getNodeType0() { 138 138 return TYPE_TEMPLATE_PARAMETER; 139 139 } … … 154 154 * Method declared on ASTNode. 155 155 */ 156 finalboolean subtreeMatch0(ASTMatcher matcher, Object other) {156 boolean subtreeMatch0(ASTMatcher matcher, Object other) { 157 157 // dispatch to correct overloaded match method 158 158 return matcher.match(this, other); trunk/descent.core/src/descent/core/dom/VariableBinding.java
r1097 r1228 42 42 return bindingResolver.resolveType(typedef.basetype); 43 43 } else if (node instanceof EnumMember) { 44 return bindingResolver.resolveType(((EnumDeclaration) ((EnumMember) node).parent).type); 44 EnumMember em = (EnumMember) node; 45 if (em.sourceType != null) { 46 return bindingResolver.resolveType(em.type); 47 } else { 48 return bindingResolver.resolveType(((EnumDeclaration) ((EnumMember) node).parent).type); 49 } 45 50 } 46 51 trunk/descent.core/src/descent/core/formatter/DefaultCodeFormatterConstants.java
r660 r1228 64 64 // Formatter value names 65 65 public static final String FORMATTER_BRACE_POSITION_FOR_FUNCTION_DECLARATION = JavaCore.PLUGIN_ID + ".formatter.brace_position_for_function_declaration"; 66 public static final String FORMATTER_BRACE_POSITION_FOR_POSTBLIT_DECLARATION = JavaCore.PLUGIN_ID + ".formatter.brace_position_for_postblit_declaration"; 66 67 public static final String FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION = JavaCore.PLUGIN_ID + ".formatter.brace_position_for_type_declaration"; 67 68 public static final String FORMATTER_BRACE_POSITION_FOR_ENUM_DECLARATION = JavaCore.PLUGIN_ID + ".formatter.brace_position_for_enum_declaration"; trunk/descent.core/src/descent/internal/codeassist/CompletionEngine.java
r1224 r1228 1431 1431 } else { 1432 1432 includesFilter = INCLUDE_VARIABLES; 1433 completeNode(node. baseclasses.get(baseClassIndex).type);1433 completeNode(node.sourceBaseclasses.get(baseClassIndex).sourceType); 1434 1434 includesFilter = 0; 1435 1435 } … … 3137 3137 relevance += computeRelevanceForExpectedType(sigChar); 3138 3138 if (parser.inNewExp) { 3139 if ((modifiers & (Flags.Acc Struct | Flags.AccUnion | Flags.AccInterface | Flags.AccTemplate | Flags.AccEnum)) == 0) {3139 if ((modifiers & (Flags.AccClass)) != 0) { 3140 3140 // Don't suggest abstract classes 3141 3141 if ((modifiers & Flags.AccAbstract) != 0) { … … 3144 3144 3145 3145 relevance += R_NEW; 3146 } else {3147 return;3148 3146 } 3149 3147 }
