Exemplo n.º 1
0
        public void AddField(SyntaxTokenList modifiers, TypeSymbol type, VariableDeclaratorSyntax vds)
        {
            if (vds.ArgumentList != null)
            {
                throw new NotImplementedException("array field");
            }

            //bool bStatic = false;
            if (modifiers.ToString().Contains("static"))
            {
                throw new NotImplementedException("static field declaration");
            }

            FieldExtraInfo fei = new FieldExtraInfo() { Name = vds.Identifier.ToString(), Type = type };
            if (vds.Initializer!=null)
                fei.Initializer = vds.Initializer.Value;

            int nField = Fields.Count;
            FieldNames.Add(fei.Name, nField);
            Fields.Add(fei);
        }
Exemplo n.º 2
0
        public void AddEnumMember(string name, ExpressionSyntax initializer)
        {
            FieldExtraInfo fei = new FieldExtraInfo() { Name = name, Type = this.Type };
            fei.Initializer = initializer;

            int nField = StaticFields.Count;
            StaticFieldNames.Add(fei.Name, nField);
            StaticFields.Add(fei);
        }