1 package polyglot.ast; 2 3 import polyglot.types.Type; 4 import polyglot.types.Flags; 5 import polyglot.types.FieldInstance; 6 import polyglot.types.InitializerInstance; 7 import polyglot.types.SemanticException; 8 9 /** 10 * A <code>FieldDecl</code> is an immutable representation of the declaration 11 * of a field of a class. 12 */ 13 public interface FieldDecl extends ClassMember 14 { 15 /** Get the type object for the declaration's type. */ 16 Type declType(); 17 18 /** Get the declaration's flags. */ 19 Flags flags(); 20 21 /** Set the declaration's flags. */ 22 FieldDecl flags(Flags flags); 23 24 /** Get the declaration's type. */ 25 TypeNode type(); 26 /** Set the declaration's type. */ 27 FieldDecl type(TypeNode type); 28 29 /** Get the declaration's name. */ 30 String name(); 31 /** Set the declaration's name. */ 32 FieldDecl name(String name); 33 34 /** Get the declaration's initializer, or null. */ 35 Expr init(); 36 /** Set the declaration's initializer. */ 37 FieldDecl init(Expr init); 38 39 /** 40 * Get the type object for the field we are declaring. This field may 41 * not be valid until after signature disambiguation. 42 */ 43 FieldInstance fieldInstance(); 44 45 /** Set the type object for the field we are declaring. */ 46 FieldDecl fieldInstance(FieldInstance fi); 47 48 /** 49 * Get the type object for the initializer expression, or null. 50 * We evaluate the initializer expression as if it were in an 51 * initializer block (e.g., <code>{ }</code> or </code>static { }<code>). 52 */ 53 InitializerInstance initializerInstance(); 54 55 /** Set the type object for the initializer expression. */ 56 FieldDecl initializerInstance(InitializerInstance fi); 57 } 58