示例#1
0
        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);
        }
示例#2
0
文件: SecondPass.cs 项目: goric/cflat
        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);
        }
示例#3
0
文件: SecondPass.cs 项目: goric/cflat
        /// <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;
        }
示例#4
0
 public override void VisitDeclField(ASTDeclarationField n)
 {
     //nothing to do here, already done in the DeclarationPass
 }
示例#5
0
 public override void VisitDeclField(ASTDeclarationField n)
 {
     _mgr.AddField(_currentType, n);
 }