dd
[IRC.git] / Robust / src / IR / VarDescriptor.java
1 package IR;
2 import IR.Tree.Modifiers;
3 import IR.Tree.ExpressionNode;
4
5 /**
6  * Descriptor 
7  *
8  * represents a symbol in the language (var name, function name, etc).
9  */
10
11 public class VarDescriptor extends Descriptor {
12
13     protected TypeDescriptor td;
14     protected String identifier;
15     protected ExpressionNode en;
16     
17     public VarDescriptor(TypeDescriptor t, String identifier, ExpressionNode e) {
18         super(identifier);
19         this.td=t;
20         this.identifier=identifier;
21         this.en=e;
22         this.safename = "__" + name + "__";
23         this.uniqueid=count++;
24     }
25
26     public String toString() {
27         if (en==null)
28             return td.toString()+" "+identifier+";";
29         else
30             return td.toString()+" "+identifier+"="+en.printNode()+";";
31     }
32 }