Example #1
0
        public SSInterpretPropertyInfo AddProperty(string id, BasePropertyDeclarationSyntax property)
        {
            var propertyInfo = new SSInterpretPropertyInfo(this, Runner, id, property)
            {
                IsStatic       = property.Modifiers.IsStatic(),
                DeclaringClass = this,

                AccessModifier = AccessModifierParser.Parse(property.Modifiers)
            };

            Properties.Add(id, propertyInfo);
            return(propertyInfo);
        }
Example #2
0
        public SSFieldInfo AddField(string id, FieldDeclarationSyntax field, VariableDeclaratorSyntax declarator)
        {
            var fieldInfo = new SSInterpretFieldInfo(this)
            {
                Id             = id,
                FieldType      = Runner.Resolver.GetType($"{field.Declaration.Type}"),
                IsStatic       = field.Modifiers.IsStatic() | field.Modifiers.IsConst(),
                IsConst        = field.Modifiers.IsConst(),
                Field          = field,
                DeclaringClass = this,
                Declartor      = declarator,

                AccessModifier = AccessModifierParser.Parse(field.Modifiers)
            };

            Fields.Add(id, fieldInfo);
            return(fieldInfo);
        }
Example #3
0
        public SSInterpretMethodInfo AddMethod(string id, BaseMethodDeclarationSyntax method, JumpDestination[] jumps)
        {
            EnsureMethodKey(id);

            var signature = MemberSignature.GetSignature(
                Runner.Resolver, id, method);

            var methodInfo = new SSInterpretMethodInfo(Runner, id, Type, method)
            {
                Id             = id,
                IsStatic       = method.Modifiers.IsStatic(),
                DeclaringClass = this,
                Declaration    = method,
                Jumps          = jumps,

                AccessModifier = AccessModifierParser.Parse(method.Modifiers)
            };

            Methods[id].RemoveAll(x => x.Signature == signature);
            Methods[id].Add(methodInfo);

            return(methodInfo);
        }