checking in changes
[IRC.git] / Robust / src / IR / FieldDescriptor.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 FieldDescriptor extends Descriptor {
12
13     protected Modifiers modifier;
14     protected TypeDescriptor td;
15     protected String identifier;
16     protected ExpressionNode en;
17     
18     public FieldDescriptor(Modifiers m, TypeDescriptor t, String identifier, ExpressionNode e) {
19         super(identifier);
20         this.modifier=m;
21         this.td=t;
22         this.identifier=identifier;
23         this.en=e;
24         this.safename = "__" + name + "__";
25         this.uniqueid=count++;
26     }
27
28     public TypeDescriptor getType() {
29         return td;
30     }
31
32     public String toString() {
33         if (en==null)
34             return modifier.toString()+td.toString()+" "+identifier+";";
35         else
36             return modifier.toString()+td.toString()+" "+identifier+"="+en.printNode(0)+";";
37     }
38 }