public void AddField(string typeName, ASTDeclarationField n) { TypeBuilderInfo info = TypeBuilderMap[typeName]; //define the field in the type builder, and save the FieldBuiler in a map, keyed off the name of the field FieldBuilder fieldBuilder = info.Builder.DefineField(n.Name, LookupCilType(n.Type), FieldAttributes.Public); info.FieldMap.Add(n.Name, fieldBuilder); }
private List <string> GatherFieldModifiers(ASTDeclarationField n) { var names = new List <String>(); var mods = n.Modifiers; while (!mods.IsEmpty) { names.Add(mods.Modifier); mods = mods.Tail; } return(names); }
/// <summary> /// Type-check and gather information about member variables. /// </summary> /// <param name="n"></param> public override void VisitDeclField(ASTDeclarationField n) { var declFieldType = CheckSubTree(n.FieldType); n.Type = declFieldType; var mods = GatherFieldModifiers(n); var desc = _scopeMgr.AddMember(n.Name, declFieldType, _currentClass, mods); n.Descriptor = desc; }
public override void VisitDeclField(ASTDeclarationField n) { //nothing to do here, already done in the DeclarationPass }
public override void VisitDeclField(ASTDeclarationField n) { _mgr.AddField(_currentType, n); }