Changeset 1228

Show
Ignore:
Timestamp:
07/13/08 13:22:12 (2 months ago)
Author:
asterite
Message:

Just uploaded nightly build 0.5.3.20080713

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/descent.core/META-INF/MANIFEST.MF

    r1222 r1228  
    33Bundle-Name: %pluginName 
    44Bundle-SymbolicName: descent.core;singleton:=true 
    5 Bundle-Version: 0.5.3.20080708 
     5Bundle-Version: 0.5.3.20080713 
    66Bundle-Activator: descent.core.JavaCore 
    77Bundle-Vendor: %providerName 
  • trunk/descent.core/src/descent/core/dom/AST.java

    r1165 r1228  
    24262426        return node; 
    24272427    } 
     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    } 
    24282448 
    24292449} 
  • trunk/descent.core/src/descent/core/dom/ASTConverter.java

    r1227 r1228  
    353353        case ASTDmdNode.OR_OR_EXP: 
    354354            return convert((BinExp) symbol, InfixExpression.Operator.OR_OR); 
     355        case ASTDmdNode.POSTBLIT_DECLARATION: 
     356            return convert((PostBlitDeclaration) symbol); 
    355357        case ASTDmdNode.POST_EXP: 
    356358            return convert((PostExp) symbol); 
     
    411413        case ASTDmdNode.TEMPLATE_TYPE_PARAMETER: 
    412414            return convert((TemplateTypeParameter) symbol); 
     415        case ASTDmdNode.TEMPLATE_THIS_PARAMETER: 
     416            return convert((TemplateThisParameter) symbol); 
    413417        case ASTDmdNode.TEMPLATE_VALUE_PARAMETER: 
    414418            return convert((TemplateValueParameter) symbol); 
     
    11321136    public descent.core.dom.TypeTemplateParameter convert(TemplateTypeParameter a) { 
    11331137        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) { 
    11341149        b.setName((SimpleName) convert(a.ident)); 
    11351150        if (a.sourceDefaultType != null) { 
     
    11401155        } 
    11411156        setSourceRange(b, a.start, a.length); 
    1142         return b; 
    11431157    } 
    11441158     
     
    16651679    } 
    16661680     
     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     
    16671711    public descent.core.dom.ForeachStatement convert(ForeachStatement a) { 
    16681712        descent.core.dom.ForeachStatement b = new descent.core.dom.ForeachStatement(ast); 
     
    18011845    public descent.core.dom.EnumMember convert(EnumMember a) { 
    18021846        descent.core.dom.EnumMember b = new descent.core.dom.EnumMember(ast); 
     1847        if (a.sourceType != null) { 
     1848            b.setType(convert(a.sourceType)); 
     1849        } 
    18031850        if (a.ident != null) { 
    18041851            SimpleName convertedIdent = (SimpleName) convert(a.ident); 
     
    31253172        TypeofReturn b = new TypeofReturn(ast); 
    31263173        setSourceRange(b, a.start, a.length); 
     3174         
     3175        if (resolveBindings) { 
     3176            recordNodes(b, a); 
     3177        } 
     3178         
    31273179        return b; 
    31283180    } 
  • trunk/descent.core/src/descent/core/dom/ASTMatcher.java

    r1165 r1228  
    209209            ); 
    210210    } 
     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    } 
    211241 
    212242    /** 
     
    792822        return ( 
    793823            safeSubtreeListMatch(node.preDDocs(), o.preDDocs()) 
     824            && safeSubtreeMatch(node.getType(), o.getType()) 
    794825            && safeSubtreeMatch(node.getName(), o.getName()) 
    795826            && safeSubtreeMatch(node.getValue(), o.getValue()) 
     
    10901121            && safeSubtreeListMatch(node.arguments(), o.arguments()) 
    10911122            && node.isVariadic() == o.isVariadic() 
     1123            && safeSubtreeListMatch(node.postModifiers(), o.postModifiers()) 
    10921124            && safeSubtreeMatch(node.getPrecondition(), o.getPrecondition()) 
    10931125            && safeSubtreeMatch(node.getPostcondition(), o.getPostcondition()) 
  • trunk/descent.core/src/descent/core/dom/ASTNode.java

    r1201 r1228  
    11201120     */ 
    11211121    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; 
    11221136     
    11231137    /** 
     
    14081422        case EMPTY_STATEMENT: 
    14091423            return EmptyStatement.class; 
     1424        case POSTBLIT_DECLARATION: 
     1425            return PostblitDeclaration.class; 
     1426        case THIS_TEMPLATE_PARAMETER: 
     1427            return ThisTemplateParameter.class; 
    14101428        } 
    14111429        return null; 
  • trunk/descent.core/src/descent/core/dom/ASTVisitor.java

    r1165 r1228  
    39373937    } 
    39383938     
     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     
    39393995} 
  • trunk/descent.core/src/descent/core/dom/AliasDeclaration.java

    r964 r1228  
    151151    } 
    152152 
    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        
     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   
    167167         
    168168    /* (omit javadoc for this method) 
     
    183183        result.setType((Type) getType().clone(target)); 
    184184        result.fragments.addAll(ASTNode.copySubtrees(target, fragments())); 
    185     result.setPostDDoc((DDocComment) ASTNode.copySubtree(target, getPostDDoc())); 
     185       result.setPostDDoc((DDocComment) ASTNode.copySubtree(target, getPostDDoc())); 
    186186        return result; 
    187187    } 
  • trunk/descent.core/src/descent/core/dom/Declaration.java

    r1227 r1228  
    2121 *    MixinDeclaration 
    2222 *    ModifierDeclaration 
     23 *    PostblitDeclaration 
    2324 *    PragmaDeclaration 
    2425 *    StaticAssert 
  • trunk/descent.core/src/descent/core/dom/EnumMember.java

    r955 r1228  
    1010 * <pre> 
    1111 * EnumMember: 
    12  *    SimpleName [ <b>=</b> Expression ] 
     12 *    [ Type ] SimpleName [ <b>=</b> Expression ] 
    1313 * </pre> 
    1414 */ 
     
    2020    public static final ChildListPropertyDescriptor PRE_D_DOCS_PROPERTY = 
    2121        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$ 
    2228 
    2329    /** 
     
    5056        createPropertyList(EnumMember.class, properyList); 
    5157        addProperty(PRE_D_DOCS_PROPERTY, properyList); 
    52         addProperty(NAME_PROPERTY, properyList); 
     58        addProperty(TYPE_PROPERTY, properyList); 
     59        addProperty(NAME_PROPERTY, properyList);         
    5360        addProperty(VALUE_PROPERTY, properyList); 
    5461        addProperty(POST_D_DOC_PROPERTY, properyList); 
     
    7885    private ASTNode.NodeList preDDocs = 
    7986        new ASTNode.NodeList(PRE_D_DOCS_PROPERTY); 
     87     
     88    /** 
     89     * The type. 
     90     */ 
     91    private Type type; 
     92     
    8093    /** 
    8194     * The name. 
     
    118131     */ 
    119132    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        } 
    120141        if (property == NAME_PROPERTY) { 
    121142            if (get) { 
     
    171192        result.setSourceRange(this.getStartPosition(), this.getLength()); 
    172193        result.preDDocs.addAll(ASTNode.copySubtrees(target, preDDocs())); 
     194        result.setType((Type) ASTNode.copySubtree(target, getType())); 
    173195        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())); 
    176198        return result; 
    177199    } 
     
    193215            // visit children in normal left to right reading order 
    194216            acceptChildren(visitor, this.preDDocs); 
     217            acceptChild(visitor, getType()); 
    195218            acceptChild(visitor, getName()); 
    196219            acceptChild(visitor, getValue()); 
     
    209232    public List<CodeComment> preDDocs() { 
    210233        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); 
    211261    } 
    212262 
     
    309359     */ 
    310360    int memSize() { 
    311         return BASE_NODE_SIZE + 4 * 4; 
     361        return BASE_NODE_SIZE + 5 * 4; 
    312362    } 
    313363 
     
    319369            memSize() 
    320370            + (this.preDDocs.listSize()) 
     371            + (this.type == null ? 0 : getType().treeSize()) 
    321372            + (this.name == null ? 0 : getName().treeSize()) 
    322373            + (this.value == null ? 0 : getValue().treeSize()) 
  • trunk/descent.core/src/descent/core/dom/FunctionDeclaration.java

    r1227 r1228  
    116116        addProperty(ARGUMENTS_PROPERTY, properyList); 
    117117        addProperty(VARIADIC_PROPERTY, properyList); 
     118        addProperty(POST_MODIFIERS_PROPERTY, properyList); 
    118119        addProperty(PRECONDITION_PROPERTY, properyList); 
    119120        addProperty(POSTCONDITION_PROPERTY, properyList); 
     
    275276            return modifiers(); 
    276277        } 
     278        if (property == POST_MODIFIERS_PROPERTY) { 
     279            return modifiers(); 
     280        } 
    277281        if (property == TEMPLATE_PARAMETERS_PROPERTY) { 
    278282            return templateParameters(); 
     
    285289    } 
    286290 
    287        @Override 
    288        final ChildListPropertyDescriptor internalPreDDocsProperty() { 
    289            return PRE_D_DOCS_PROPERTY; 
    290        
    291         
    292        @Override 
    293        final ChildListPropertyDescriptor internalModifiersProperty() { 
    294            return MODIFIERS_PROPERTY; 
    295        
    296         
    297        @Override 
    298        final ChildListPropertyDescriptor internalArgumentsProperty() { 
    299            return ARGUMENTS_PROPERTY; 
    300        
    301         
    302        @Override 
    303        final SimplePropertyDescriptor internalVariadicProperty() { 
    304            return VARIADIC_PROPERTY; 
    305        
    306         
    307        @Override 
    308        final ChildPropertyDescriptor internalPreconditionProperty() { 
    309            return PRECONDITION_PROPERTY; 
    310        
    311         
    312        @Override 
    313        final ChildPropertyDescriptor internalPostconditionProperty() { 
    314            return POSTCONDITION_PROPERTY; 
    315        
    316         
    317        @Override 
    318        final ChildPropertyDescriptor internalPostconditionVariableNameProperty() { 
    319            return POSTCONDITION_VARIABLE_NAME_PROPERTY; 
    320        
    321         
    322        @Override 
    323        final ChildPropertyDescriptor internalBodyProperty() { 
    324            return BODY_PROPERTY; 
    325        
    326         
    327        @Override 
    328        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   
    331335         
    332336    /* (omit javadoc for this method) 
     
    345349        result.preDDocs.addAll(ASTNode.copySubtrees(target, preDDocs())); 
    346350        result.modifiers.addAll(ASTNode.copySubtrees(target, modifiers())); 
     351        result.postModifiers.addAll(ASTNode.copySubtrees(target, postModifiers())); 
    347352        result.setReturnType((Type) getReturnType().clone(target)); 
    348353        result.setName((SimpleName) getName().clone(target)); 
     
    350355        result.arguments.addAll(ASTNode.copySubtrees(target, arguments())); 
    351356        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())); 
    355360        result.setBody((Block) getBody().clone(target)); 
    356     result.setPostDDoc((DDocComment) ASTNode.copySubtree(target, getPostDDoc())); 
     361       result.setPostDDoc((DDocComment) ASTNode.copySubtree(target, getPostDDoc())); 
    357362        return result; 
    358363    } 
     
    379384            acceptChildren(visitor, this.templateParameters); 
    380385            acceptChildren(visitor, this.arguments); 
     386            acceptChildren(visitor, this.postModifiers); 
    381387            acceptChild(visitor, getPrecondition()); 
    382388            acceptChild(visitor, getPostcondition()); 
  • trunk/descent.core/src/descent/core/dom/GenericVisitor.java

    r1165 r1228  
    16691669        endVisitNode(node); 
    16701670    } 
     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    } 
    16711691 
    16721692} 
  • trunk/descent.core/src/descent/core/dom/NaiveASTFlattener.java

    r1165 r1228  
    710710    public boolean visit(EnumMember node) { 
    711711        printIndent(); 
     712        if (node.getType() != null) { 
     713            node.getType().accept(this); 
     714            this.buffer.append(' '); 
     715        } 
    712716        node.getName().accept(this); 
    713717        if (node.getValue() != null) { 
     
    830834        } 
    831835        this.buffer.append(")"); 
     836         
     837        if (!node.postModifiers().isEmpty()) { 
     838            this.buffer.append(" "); 
     839            visitModifiers(node.postModifiers()); 
     840        } 
     841         
    832842        if (node.getPrecondition() != null) { 
    833843            this.buffer.append(LINE_END); 
     
    16601670     
    16611671    @Override 
     1672    public boolean visit(ThisTemplateParameter node) { 
     1673        this.buffer.append("this "); 
     1674        return visit((TypeTemplateParameter) node); 
     1675    } 
     1676     
     1677    @Override 
    16621678    public boolean visit(UnitTestDeclaration node) { 
    16631679        visitPreDDocss(node.preDDocs()); 
     
    18111827     
    18121828    @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 
    18131867    public boolean visit(WithStatement node) { 
    18141868        printIndent(); 
  • trunk/descent.core/src/descent/core/dom/TemplateParameter.java

    r176 r1228  
    1818 * TypeTemplateParameter: 
    1919 *    SimpleName [ <b>:</b> Type ] [ <b>=</b> Type ] 
     20 * ThisTemplateParameter: 
     21 *    <b>this</b> SimpleName [ <b>:</b> Type ] [ <b>=</b> Type ] 
    2022 * ValueTemplateParameter: 
    2123 *    Type SimpleName [ <b>:</b> Expression ] [ <b>=</b> Expression ] 
  • trunk/descent.core/src/descent/core/dom/TypeTemplateParameter.java

    r176 r1228  
    135135     * Method declared on ASTNode. 
    136136     */ 
    137     final int getNodeType0() { 
     137    int getNodeType0() { 
    138138        return TYPE_TEMPLATE_PARAMETER; 
    139139    } 
     
    154154     * Method declared on ASTNode. 
    155155     */ 
    156     final boolean subtreeMatch0(ASTMatcher matcher, Object other) { 
     156    boolean subtreeMatch0(ASTMatcher matcher, Object other) { 
    157157        // dispatch to correct overloaded match method 
    158158        return matcher.match(this, other); 
  • trunk/descent.core/src/descent/core/dom/VariableBinding.java

    r1097 r1228  
    4242            return bindingResolver.resolveType(typedef.basetype); 
    4343        } 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            } 
    4550        } 
    4651         
  • trunk/descent.core/src/descent/core/formatter/DefaultCodeFormatterConstants.java

    r660 r1228  
    6464    // Formatter value names 
    6565    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"; 
    6667    public static final String FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION = JavaCore.PLUGIN_ID + ".formatter.brace_position_for_type_declaration"; 
    6768    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  
    14311431            } else { 
    14321432                includesFilter = INCLUDE_VARIABLES; 
    1433                 completeNode(node.baseclasses.get(baseClassIndex).type); 
     1433                completeNode(node.sourceBaseclasses.get(baseClassIndex).sourceType); 
    14341434                includesFilter = 0; 
    14351435            } 
     
    31373137        relevance += computeRelevanceForExpectedType(sigChar); 
    31383138        if (parser.inNewExp) { 
    3139             if ((modifiers & (Flags.AccStruct | Flags.AccUnion | Flags.AccInterface | Flags.AccTemplate | Flags.AccEnum)) == 0) { 
     3139            if ((modifiers & (Flags.AccClass)) != 0) { 
    31403140                // Don't suggest abstract classes 
    31413141                if ((modifiers & Flags.AccAbstract) != 0) { 
     
    31443144                 
    31453145                relevance += R_NEW; 
    3146             } else { 
    3147                 return; 
    31483146            } 
    31493147        }