Changeset 3376 for devel-tools/trunk


Ignore:
Timestamp:
Feb 6, 2008, 12:00:07 AM (13 years ago)
Author:
yura
Message:
Location:
devel-tools/trunk/eclipse/org.refal.plus.rfpdt/src/org/refal/plus/rfpdt/comp/ast
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • devel-tools/trunk/eclipse/org.refal.plus.rfpdt/src/org/refal/plus/rfpdt/comp/ast/AstCall.java

    r3375 r3376  
    33import org.refal.plus.rfpdt.comp.SrcPosition;
    44
    5 public final class AstCall extends AstTerm {
     5public final class AstCall extends AstTerm implements IHoverInfo {
    66    public final AstName name;
    77    public final AstExp arg;
     
    2929        return "<" + name + (arg.length() == 0 ? "" : " " + arg + " ") + ">";
    3030    }
     31
     32    public String getHoverInfo () {
     33        if (funcDecl == null)
     34            return null;
     35        return funcDecl.getHoverInfo();
     36    }
    3137}
  • devel-tools/trunk/eclipse/org.refal.plus.rfpdt/src/org/refal/plus/rfpdt/comp/ast/AstConstBinding.java

    r3332 r3376  
    2020        v.visit(this, e);
    2121    }
     22
     23    public String getHoverInfo () {
     24        String qname = getQualifiedName();
     25        if (qname == null)
     26            return null;
     27        return "$const " + qname + " = " + exp + ";";
     28    }
    2229}
  • devel-tools/trunk/eclipse/org.refal.plus.rfpdt/src/org/refal/plus/rfpdt/comp/ast/AstDecl.java

    r3332 r3376  
    55import org.refal.plus.rfpdt.comp.SrcPosition;
    66
    7 public abstract class AstDecl extends AstTopNode {
     7public abstract class AstDecl extends AstTopNode implements IHoverInfo {
    88    public final AstName name;
    99    public final boolean isPublic;
     
    1616        this.isPublic = isPublic;
    1717    }
     18
     19    public String getQualifiedName () {
     20        if (name == null)
     21            return null;
     22        return (module != null ? module + "." : "") + name.identifier;
     23    }
    1824}
  • devel-tools/trunk/eclipse/org.refal.plus.rfpdt/src/org/refal/plus/rfpdt/comp/ast/AstFuncDecl.java

    r3375 r3376  
    3535    }
    3636
    37     @Override
    38     public String toString () {
    39         if (name == null)
     37    public String getHoverInfo () {
     38        String qname = getQualifiedName();
     39        if (qname == null)
    4040            return null;
    4141        String inFormat = this.inFormat.toString();
    42         return retMode.select("<b>$func?</b> ", "$func ") + (module != null ? module + "." : "") + name.identifier
    43                 + (inFormat.length() == 0 ? "" : " " + inFormat) + " = " + outFormat + ";";
     42        return retMode.select("$func? ", "$func ") + qname + (inFormat.length() == 0 ? "" : " " + inFormat) + " = "
     43                + outFormat + ";";
    4444    }
    4545}
  • devel-tools/trunk/eclipse/org.refal.plus.rfpdt/src/org/refal/plus/rfpdt/comp/ast/AstFuncDef.java

    r3332 r3376  
    33import org.refal.plus.rfpdt.comp.SrcPosition;
    44
    5 public final class AstFuncDef extends AstTopNode {
     5public final class AstFuncDef extends AstTopNode implements IHoverInfo  {
    66    public final AstName name;
    77    public final AstSentence body;
     
    2323        v.visit(this, e);
    2424    }
     25
     26    public String getHoverInfo () {
     27        if (funcDecl == null)
     28            return null;
     29        return funcDecl.getHoverInfo();
     30    }
    2531}
  • devel-tools/trunk/eclipse/org.refal.plus.rfpdt/src/org/refal/plus/rfpdt/comp/ast/AstObjDecl.java

    r3332 r3376  
    2424        v.visit(this, e);
    2525    }
     26
     27    public String getHoverInfo () {
     28        String qname = getQualifiedName();
     29        if (qname == null)
     30            return null;
     31        return "$" + kind.name().toLowerCase() + " " + qname + ";";
     32    }
    2633}
  • devel-tools/trunk/eclipse/org.refal.plus.rfpdt/src/org/refal/plus/rfpdt/comp/ast/AstRef.java

    r3375 r3376  
    33import org.refal.plus.rfpdt.comp.SrcPosition;
    44
    5 public final class AstRef extends AstTerm {
     5public final class AstRef extends AstTerm implements IHoverInfo {
    66    public final AstName name;
    77    public AstDecl decl = null;
     
    2626        return "&" + name;
    2727    }
     28   
     29    public String getHoverInfo () {
     30        if (decl == null)
     31            return null;
     32        return decl.getHoverInfo();
     33    }
    2834}
Note: See TracChangeset for help on using the changeset viewer.